* process.c: Avoid unnecessary calls to gettime.
[bpt/emacs.git] / src / ChangeLog
1 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
2
3 * process.c: Avoid unnecessary calls to gettime.
4 (wait_reading_process_output): Don't get the time of day
5 when gobbling data immediately and not waiting, as there's no need
6 for it in that case. This removes a FIXME.
7
8 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
9
10 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
11 is defined (Bug#11768).
12
13 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
14
15 Fix marker debugging code.
16 * marker.c (byte_char_debug_check): Do not perform the check
17 if buffer is not multibyte.
18 (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Call
19 byte_char_debug_check with correct arguments.
20
21 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
22
23 Compile marker debugging code only if ENABLE_CHECKING is defined.
24 * marker.c (byte_char_debug_check, count_markers): Use
25 only if ENABLE_CHECKING is defined.
26 (byte_debug_flag): Remove.
27 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
28 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
29
30 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
31
32 Avoid code repetition in marker-related functions.
33 * marker.c (attach_marker): New function.
34 (Fset_marker, set_marker_restricted, set_marker_both)
35 (set_marker_restricted_both): Use it.
36 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
37 Consistently rename charno to charpos.
38 (marker_position): Add eassert.
39 (marker_byte_position): Convert to eassert.
40
41 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
42
43 Simplify list operations in unchain_overlay and unchain_marker.
44 * buffer.c (unchain_overlay): Simplify. Add comment.
45 * marker.c (unchain_marker): Simplify. Fix comments.
46
47 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
48
49 Introduce fast path for the widely used marker operation.
50 * alloc.c (build_marker): New function.
51 * lisp.h (build_marker): New prototype.
52 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
53 * composite.c (autocmp_chars): Likewise.
54 * editfns.c (buildmark): Remove.
55 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
56 (save_restriction_save): Use build_marker.
57 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
58 * window.c (save_window_save): Likewise.
59
60 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
61
62 Do not use Fdelete_overlay in delete_all_overlays
63 to avoid redundant calls to unchain_overlay.
64 * buffer.c (drop_overlay): New function.
65 (delete_all_overlays, Fdelete_overlay): Use it.
66 * minibuf.c (get_minibuffer): Fix comment.
67
68 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
69
70 Port to OpenBSD 5.1 amd64.
71 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
72 This is needed for OpenBSD, and should be harmless on all BSD systems.
73 Also, include <sys/sysctl.h>, as it should be available on all
74 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
75 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
76 use p_pid member, not kp_proc.pid.
77
78 2012-07-06 Glenn Morris <rgm@gnu.org>
79
80 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
81
82 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
83
84 More xmalloc and related cleanup.
85 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
86 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
87 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
88 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
89 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
90 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
91 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
92 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
93 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
94 * xterm.c:
95 Omit needless casts involving void * pointers and allocation.
96 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
97 as the former is more robust if P's type is changed.
98 Prefer xzalloc to xmalloc + memset 0.
99 Simplify malloc-or-realloc to realloc.
100 Don't worry about xmalloc returning a null pointer.
101 Prefer xstrdup to xmalloc + strcpy.
102 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
103 growing it.
104 * keyboard.c (apply_modifiers_uncached): Prefer local array to
105 alloca of a constant.
106
107 2012-07-05 Eli Zaretskii <eliz@gnu.org>
108
109 * xdisp.c (display_line): Fix horizontal pixel coordinates when
110 hscroll is larger than the line width. Fixes long and futile
111 looping inside extend_face_to_end_of_line (on a TTY) producing
112 glyphs that are not needed and thrown away.
113
114 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
115
116 * marker.c (set_marker_restricted_both): Simplify by using
117 clip_to_bounds.
118
119 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
120
121 * editfns.c (region_limit): Simplify by using clip_to_bounds.
122
123 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
124
125 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
126 not defined (Bug#11768).
127 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
128 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
129 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
130 followed by gtk_box_set_homogeneous (Bug#11768).
131 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
132 (update_theme_scrollbar_width, xg_create_scroll_bar): Use
133 gtk_scrollbar_new (Bug#11768).
134 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
135 (is_box_type): New function (Bug#11768).
136 (xg_tool_item_stale_p): Call is_box_type.
137 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
138 with default display (Bug#11768).
139
140 2012-07-05 Eli Zaretskii <eliz@gnu.org>
141
142 * xdisp.c (window_hscroll_limited): New function.
143 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
144 coordinates when window's hscroll is set to insanely large
145 values. (Bug#11857)
146
147 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
148
149 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
150 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
151
152 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
153
154 Cleanup xmalloc.
155 * lisp.h (xzalloc): New prototype. Omit needless casts.
156 * alloc.c (xzalloc): New function. Omit needless casts.
157 * charset.c: Omit needless casts. Convert all calls to
158 xmalloc with following memset to xzalloc.
159 * dispnew.c: Likewise.
160 * fringe.c: Likewise.
161 * image.c: Likewise.
162 * sound.c: Likewise.
163 * term.c: Likewise.
164 * w32fns.c: Likewise.
165 * w32font.c: Likewise.
166 * w32term.c: Likewise.
167 * xfaces.c: Likewise.
168 * xfns.c: Likewise.
169 * xterm.c: Likewise.
170 * atimer.c: Omit needless casts.
171 * buffer.c: Likewise.
172 * callproc.c: Likewise.
173 * ccl.c: Likewise.
174 * coding.c: Likewise.
175 * composite.c: Likewise.
176 * doc.c: Likewise.
177 * doprnt.c: Likewise.
178 * editfns.c: Likewise.
179 * emacs.c: Likewise.
180 * eval.c: Likewise.
181 * filelock.c: Likewise.
182 * fns.c: Likewise.
183 * gtkutil.c: Likewise.
184 * keyboard.c: Likewise.
185 * lisp.h: Likewise.
186 * lread.c: Likewise.
187 * minibuf.c: Likewise.
188 * msdos.c: Likewise.
189 * print.c: Likewise.
190 * process.c: Likewise.
191 * region-cache.c: Likewise.
192 * search.c: Likewise.
193 * sysdep.c: Likewise.
194 * termcap.c: Likewise.
195 * terminal.c: Likewise.
196 * tparam.c: Likewise.
197 * w16select.c: Likewise.
198 * w32.c: Likewise.
199 * w32reg.c: Likewise.
200 * w32select.c: Likewise.
201 * w32uniscribe.c: Likewise.
202 * widget.c: Likewise.
203 * xdisp.c: Likewise.
204 * xmenu.c: Likewise.
205 * xrdb.c: Likewise.
206 * xselect.c: Likewise.
207
208 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
209
210 * fileio.c (time_error_value): Check the right error number.
211 Problem reported by Troels Nielsen in
212 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
213
214 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
215
216 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
217 This should be fixed in a better way; see Eli Zaretskii in
218 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
219 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
220
221 * fileio.c (time_error_value): Rename from special_mtime.
222 The old name's problems were noted by Eli Zaretskii in
223 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
224
225 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
226 This variable's comment says Emacs needs at least one GDB-visible
227 symbol of type enum pvec_type, to work around GDB problems.
228 The symbol's value doesn't matter.
229
230 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
231 that causes compilation to fail on pre-C99 compilers.
232
233 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
234
235 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
236 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
237
238 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
239
240 * buffer.c (init_buffer_once): Fix initialization of
241 headers for buffer_defaults and buffer_local_symbols.
242 Reported by Juanma Barranquero <lekktu@gmail.com>.
243
244 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
245
246 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
247 * lisp.h (enum pvec_type): Use fewer bits.
248 (PSEUDOVECTOR_SIZE_BITS): New constant.
249 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
250 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
251 change in pvec_type.
252 (PSEUDOVECTOR_TYPEP): New macro.
253 (TYPED_PSEUDOVECTORP): Use it.
254 * fns.c (internal_equal): Adapt code to extract pvectype.
255 * emacs.c (gdb_pvec_type): Update type.
256 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
257 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
258 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
259 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
260 (sweep_vectors): Use it. Use local var `total_bytes' instead of
261 abusing vector->header.next.nbytes.
262 (live_vector_p): Use PVEC_TYPE.
263 (mark_object): Adapt code to extract pvectype. Use switch.
264
265 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
266
267 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
268 Tighten new eassert a bit.
269
270 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
271
272 Fix compilation with --enable-gcc-warnings and -O1
273 optimization level.
274 * doprnt.c (doprnt): Change type of tem to int, initialize
275 to avoid compiler warning. Add eassert.
276 * search.c (simple_search): Initialize match_byte to avoid
277 compiler warning. Add eassert.
278
279 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
280
281 Avoid weird behavior with large horizontal scrolls.
282 Without this change, for example, large hscroll values would
283 mess up Emacs's display on Fedora 15 x86, presumably due to
284 overflows in int calculations in the display code.
285 Also, if buffers had long lines, Emacs would freeze.
286 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
287 (set_window_hscroll): New function, containing the old guts of
288 Fset_window_hscroll. Return the clipped value.
289 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
290 This avoids the need to check against PTRDIFF_MAX.
291
292 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
293
294 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
295
296 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
297
298 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
299
300 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
301 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
302 since GCC 4.4.6 issues a bogus warning for them.
303
304 Fix bugs in file timestamp newness comparisons.
305 * fileio.c (Ffile_newer_than_file_p):
306 * lread.c (Fload): Use full timestamp resolution of files,
307 not just the 1-second resolution, so that files that are only
308 slightly newer still count as newer.
309 * fileio.c (Ffile_newer_than_file_p): Don't assume file
310 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
311
312 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
313
314 * fileio.c: Improve handling of file time marker. (Bug#11852)
315 (special_mtime): New function.
316 (Finsert_file_contents, Fverify_visited_file_modtime):
317 Use it to set special mtime values consistently.
318
319 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
320
321 * fileio.c (Finsert_file_contents): Properly handle st_mtime
322 marker for non-existing file. (Bug#11852)
323
324 2012-07-03 Glenn Morris <rgm@gnu.org>
325
326 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
327 and did not make it into globals.h).
328
329 2012-07-03 Tom Tromey <tromey@redhat.com>
330
331 * window.c (Fset_window_margins, Fset_window_fringes)
332 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
333 * textprop.c (Fprevious_property_change): No longer static.
334 * syntax.c (Fsyntax_table_p): No longer static.
335 * process.c (Fget_process, Fprocess_datagram_address): No longer
336 static.
337 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
338 * keyboard.c (Fcommand_execute): No longer static.
339 Remove EXFUN.
340 * insdel.c (Fcombine_after_change_execute): No longer static.
341 * image.c (Finit_image_library): No longer static.
342 * fileio.c (Fmake_symbolic_link): No longer static.
343 * eval.c (Ffetch_bytecode): No longer static.
344 * editfns.c (Fuser_full_name): No longer static.
345 * doc.c (Fdocumentation_property, Fsnarf_documentation):
346 No longer static.
347 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
348 static.
349 * dired.c (Ffile_attributes): No longer static.
350 * composite.c (Fcomposition_get_gstring): No longer static.
351 * callproc.c (Fgetenv_internal): No longer static.
352
353 * ccl.h: Remove EXFUNs.
354 * buffer.h: Remove EXFUNs.
355 * dispextern.h: Remove EXFUNs.
356 * intervals.h: Remove EXFUNs.
357 * fontset.h: Remove EXFUN.
358 * font.h: Remove EXFUNs.
359 * dosfns.c (system_process_attributes): Remove EXFUN.
360 * keymap.h: Remove EXFUNs.
361 * lisp.h: Remove EXFUNs.
362 * w32term.h: Remove EXFUNs.
363 * window.h: Remove EXFUNs.
364 * xsettings.h: Remove EXFUN.
365 * xterm.h: Remove EXFUN.
366
367 2012-07-03 Glenn Morris <rgm@gnu.org>
368
369 * lisp.h (Frandom): Make it visible to C.
370 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
371 buffer for invisible buffers. (Bug#1229)
372
373 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
374
375 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
376 values which aren't power of 2.
377 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro. Verify
378 it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
379 accordingly.
380
381 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
382
383 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
384
385 * alloc.c (mark_object): Revert part of last patch to use `switch'.
386
387 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
388
389 * alloc.c (allocate_vector_block): Remove redundant
390 calls to mallopt if DOUG_LEA_MALLOC is defined.
391 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
392 avoid calls to mallopt if zero_vector is returned.
393
394 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
395
396 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
397 is enabled, avoid dereferencing NULL current_sblock if
398 running undumped.
399
400 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
401
402 Cleanup basic buffer management.
403 * buffer.h (struct buffer): Change layout to use generic vector
404 marking code. Fix some comments. Change type of 'clip_changed'
405 to bitfield. Remove unused #ifndef old.
406 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
407 (GET_OVERLAYS_AT): Fix indentation.
408 (for_each_per_buffer_object_at): New macro.
409 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
410 (Fbuffer_local_variables): Use it.
411 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
412 * alloc.c (allocate_buffer): Adjust to match new layout of
413 struct buffer. Fix comment.
414 (mark_overlay): New function.
415 (mark_buffer): Use it. Use mark_vectorlike to mark normal
416 Lisp area of struct buffer.
417 (mark_object): Use it. Adjust marking of misc objects
418 and related comments.
419
420 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
421
422 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
423 wrapper that is not needed because the wrapped code is a no-op (zero
424 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
425 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
426
427 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
428
429 * alloc.c (mark_buffer): Simplify. Remove prototype.
430 (mark_object): Add comment. Reorganize marking of vector-like
431 objects. Use CHECK_LIVE for all vector-like objects except buffers
432 and subroutines when GC_CHECK_MARKED_OBJECTS is defined. Avoid
433 redundant calls to mark_vectorlike for bool vectors.
434
435 2012-06-30 Glenn Morris <rgm@gnu.org>
436
437 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
438
439 * epaths.in (PATH_SITELOADSEARCH): New.
440 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
441 This is rather than relying on --enable-locallisppath elements
442 having "site-lisp" in their names. (Bug#10208#25, 11658)
443
444 2012-06-30 Eli Zaretskii <eliz@gnu.org>
445
446 * w32proc.c (sys_select): Accept and ignore one more argument.
447
448 * w32.c (emacs_gnutls_pull): Call select with one more argument.
449
450 * sysselect.h [DOS_NT]: Don't include sys/select.h.
451 (pselect) [!MS_DOS]: Redirect to sys_select.
452
453 * sysdep.c: Don't include dos.h and dosfns.h.
454
455 * process.c (sys_select):
456 * msdos.c (sys_select): Accept one more argument and ignore it.
457
458 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
459 adapt data types and code to that.
460
461 * dosfns.c:
462 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
463 which clashes with the gnulib function of the same name.
464
465 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
466
467 * font.c (font_style_to_value, font_style_symbolic)
468 (font_prop_validate_style): Add type checks for values in
469 font_style_table.
470
471 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
472 argument.
473 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
474 uses.
475
476 2012-06-29 Eli Zaretskii <eliz@gnu.org>
477
478 * xdisp.c (try_window_id): Undo last change.
479
480 * w32.c (getwd): Adjust commentary about startup_dir.
481 (init_environment): Always call sys_access, even in non-MSVC
482 builds. Don't chdir to the directory of the Emacs executable.
483 This undoes code from 1997 which was justified by the need to
484 "avoid conflicts when removing and renaming directories". But its
485 downside was that every relative file name was being interpreted
486 relative to the directory of the Emacs executable, which can never
487 be TRT. In particular, it broke sys_access when called with
488 relative file names.
489 (sys_access): Map GetLastError to errno.
490
491 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
492
493 * window.h (struct window): Change type of 'fringes_outside_margins'
494 to bitfield. Fix comment. Adjust users accordingly.
495 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
496 Adjust comment.
497 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
498 to ptrdiff_t.
499
500 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
501
502 * gnutls.c (emacs_gnutls_handshake):
503 Add QUIT to make the loop interruptible.
504
505 2012-06-29 Glenn Morris <rgm@gnu.org>
506
507 * charset.c (init_charset): Make lack of etc/charsets fatal.
508
509 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
510
511 * editfns.c (region_limit): Fix type mismatch.
512
513 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
514
515 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
516 undefined. Convert from xassert to eassert.
517 * nsmenu.m: Convert from xassert to eassert.
518 * nsterm.m: Likewise.
519
520 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
521
522 * editfns.c (region_limit): Clip to narrowing (bug#11770).
523
524 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
525
526 Avoid integer overflow on scroll-left and scroll-right.
527 * window.c (HSCROLL_MAX): New macro.
528 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
529 overflow when requested scroll falls outside ptrdiff_t range.
530
531 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
532
533 * window.h (struct window): Change type of 'hscroll',
534 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
535 'last_modified' and 'last_overlay_modified' to EMACS_INT.
536 Adjust users accordingly.
537 * xdisp.c (try_cursor_movement): Replace type check with eassert.
538 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
539 from EMACS_INT to ptrdiff_t.
540 (make_window): Omit redundant initialization.
541
542 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
543
544 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
545
546 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
547
548 * window.h (struct window): Change type of 'use_time' and
549 'sequence_number' from Lisp_Object to int.
550 * frame.c (make_frame): Adjust users accordingly.
551 * print.c (print_object): Likewise.
552 * window.c (select_window, Fwindow_use_time, make_parent_window)
553 (make_window): Likewise.
554
555 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
556
557 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
558 enabled with --enable-checking=[all,glyphs] configure option.
559 Fix GLYPH_DEBUG usage assuming that it may be undefined,
560 adjust comments accordingly.
561 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
562 undefined, adjust comments accordingly.
563 * image.c: Likewise.
564 * scroll.c: Likewise.
565 * w32fns.c: Likewise.
566 * w32term.c: Likewise.
567 * xdisp.c: Likewise.
568 * xfaces.c: Likewise.
569 * xfns.c: Likewise.
570 * xterm.c: Likewise.
571
572 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
573
574 Generalize run-time debugging checks.
575 * dispextern.h (XASSERTS): Remove.
576 * fontset.c (xassert): Remove.
577 Convert from xassert to eassert.
578 * alloc.c: Convert from xassert to eassert.
579 * bidi.c: Likewise.
580 * dispnew.c: Likewise.
581 * fns.c: Likewise.
582 * fringe.c: Likewise.
583 * ftfont.c: Likewise.
584 * gtkutil.c: Likewise.
585 * image.c: Likewise.
586 * keyboard.c: Likewise.
587 * menu.c: Likewise.
588 * process.c: Likewise.
589 * scroll.c: Likewise.
590 * sound.c: Likewise.
591 * term.c: Likewise.
592 * w32console.c: Likewise.
593 * w32fns.c: Likewise.
594 * w32term.c: Likewise.
595 * window.c: Likewise.
596 * xdisp.c: Likewise.
597 * xfaces.c: Likewise.
598 * xfns.c: Likewise.
599 * xselect.c: Likewise.
600 * xterm.c: Likewise.
601
602 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
603
604 * fns.c (maybe_resize_hash_table): Output message when growing the
605 purify-hashtable.
606
607 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
608
609 * alloc.c (allocate_string_data): Remove dead code.
610 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
611 avoid GCC warning about unused macro.
612
613 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
614
615 * alloc.c (allocate_string): Omit intervals initialization.
616 * alloc.c (make_uninit_multibyte_string): Initialize intervals
617 as in make_pure_string and make_pure_c_string.
618
619 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
620
621 * alloc.c (allocate_string): Fix last change.
622
623 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
624
625 * alloc.c (allocate_string): Remove two redundant calls
626 to memset, add explicit initialization where appropriate.
627
628 2012-06-27 Glenn Morris <rgm@gnu.org>
629
630 * lisp.mk (lisp): Remove paths.elc.
631
632 2012-06-27 Chong Yidong <cyd@gnu.org>
633
634 * doc.c (Fsubstitute_command_keys): Fix punctuation.
635
636 2012-06-26 John Wiegley <johnw@newartisans.com>
637
638 * unexmacosx.c (copy_data_segment): Add two section names used
639 on Mac OS X Lion: __mod_init_func and __mod_term_func.
640
641 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
642 when building with Clang.
643
644 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
645
646 * eval.c (Fapply): Allow calling it with a single argument.
647
648 2012-06-26 Eli Zaretskii <eliz@gnu.org>
649
650 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
651 _stricmp and _strnicmp.
652 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
653
654 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
655
656 * alloc.c (allocate_window): Zero out non-Lisp part of newly
657 allocated window.
658 (allocate_process): Likewise for new process.
659 (allocate_terminal): Change to use offsetof.
660 (allocate_frame): Likewise.
661 * frame.c (make_frame): Omit redundant initialization.
662 * window.c (make_parent_window): Use memset.
663 (make_window): Omit redundant initialization.
664 * process.c (make_process): Omit redundant initialization.
665 * terminal.c (create_terminal): Likewise.
666
667 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
668
669 * term.c (delete_tty): Remove redundant call to memset.
670
671 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
672
673 * alloc.c: Remove build_string.
674 * lisp.h: Define build_string as static inline. This provides
675 a better opportunity to optimize away calls to strlen when the
676 function is called with compile-time constant argument.
677 * image.c (imagemagick_error): Convert to build_string.
678 * w32proc.c (sys_spawnve): Likewise.
679 * xterm.c (x_term_init): Likewise.
680
681 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
682
683 Use sprintf return value instead of invoking strlen on result.
684 In the old days this wasn't portable, since some sprintf
685 implementations returned char *. But they died out years ago and
686 Emacs already assumes sprintf returns int.
687 Similarly for float_to_string.
688 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
689 * ccl.c (ccl_driver):
690 * character.c (string_escape_byte8):
691 * data.c (Fnumber_to_string):
692 * doprnt.c (doprnt):
693 * print.c (print_object):
694 * xdisp.c (message_dolog):
695 * xfns.c (syms_of_xfns):
696 Use sprintf or float_to_string result to avoid need to call strlen.
697 * data.c (Fnumber_to_string):
698 Use make_unibyte_string, since the string must be ASCII.
699 * lisp.h, print.c (float_to_string): Now returns int length.
700 * term.c (produce_glyphless_glyph):
701 Use sprintf result rather than recomputing it.
702
703 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
704 * Makefile.in (ALL_CFLAGS):
705 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
706 * gmalloc.c, regex.c: Include <config.h> unconditionally.
707
708 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
709
710 * dispextern.h (xstrcasecmp): Define to library function
711 strcasecmp if available.
712 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
713
714 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
715
716 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
717 Avoid comma operator.
718 * menu.c (push_submenu_start, push_submenu_end)
719 (push_left_right_boundary, push_menu_pane): Likewise.
720 * msdos.c (dos_rawgetc): Likewise.
721
722 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
723
724 * xfns.c (xic_create_fontsetname): Remove redundant calls
725 to memset.
726
727 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
728
729 * gtkutil.c (get_utf8_string): Remove redundant assignment.
730 sprintf already null-terminates its output.
731
732 * xfns.c (x_window): Remove redundant cast.
733
734 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
735
736 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
737 `const char *' to `char *' to avoid compiler warning.
738
739 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
740
741 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
742 instead of truncating it to 63 (admittedly a generous limit).
743
744 * process.c: Fix spelling and caps in comments.
745
746 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
747
748 * emacs.c (setpgrp): Remove definition, unused.
749 * sysdep.c (setpgrp): Remove definition, not used in this file.
750
751 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
752
753 * makefile.w32-in: Update dependencies.
754
755 2012-06-24 Eli Zaretskii <eliz@gnu.org>
756
757 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
758 (SYSTIME_H): Add nt/inc/sys/time.h.
759
760 * systime.h [WINDOWSNT]: Include sys/time.h.
761
762 * s/ms-w32.h (struct timespec): Definition moved from
763 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
764
765 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
766
767 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
768 * buffer.h (buffer_slot_type_mismatch):
769 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
770 * eval.c (unwind_to_catch):
771 * image.c (my_png_error, my_error_exit):
772 * keyboard.c (quit_throw_to_read_char, user_error)
773 (Fexit_recursive_edit, Fabort_recursive_edit):
774 * lisp.h (die, args_out_of_range, args_out_of_range_3)
775 (wrong_type_argument, buffer_overflow, __executable_start)
776 (memory_full, buffer_memory_full, string_overflow, Fthrow)
777 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
778 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
779 (fatal):
780 (child_setup) [!DOS_NT]:
781 * lread.c (end_of_file_error, invalid_syntax):
782 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
783 * puresize.h (pure_write_error):
784 * search.c (matcher_overflow):
785 * sound.c (sound_perror, alsa_sound_perror):
786 * sysdep.c, syssignal.h (croak):
787 * term.c (maybe_fatal, vfatal):
788 * textprop.c (text_read_only):
789 * undo.c (user_error):
790 * unexmacosx.c (unexec_error):
791 * xterm.c (x_ins_del_lines, x_delete_glyphs):
792 Use _Noreturn rather than NO_RETURN.
793 No need for separate decl merely because of _Noreturn.
794 * sound.c (sound_warning, parse_sound):
795 Remove unnecessary forward decls.
796
797 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
798
799 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
800 * lisp.h (WAIT_READING_MAX): New macro.
801 * dispnew.c (Fsleep_for, sit_for):
802 * keyboard.c (kbd_buffer_get_event):
803 * process.c (Faccept_process_output):
804 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
805 This improves on the previous patch, which introduced a bug
806 when time_t is unsigned and as wide as intmax_t.
807 See <http://bugs.gnu.org/9000#51>.
808
809 2012-06-23 Eli Zaretskii <eliz@gnu.org>
810
811 * dispnew.c (sit_for, Fsleep_for):
812 * keyboard.c (kbd_buffer_get_event):
813 * process.c (Faccept_process_output): Avoid compiler warnings when
814 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
815
816 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
817
818 * makefile.w32-in: Update dependencies.
819
820 * w32.c (ltime): Add return type and declare static.
821 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
822
823 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
824
825 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
826 Privately reported by Herbert J. Skuhra.
827 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
828 All uses changed.
829 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
830 not make_lisp_timeval, when the argument is of type EMACS_TIME.
831
832 2012-06-23 Eli Zaretskii <eliz@gnu.org>
833
834 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
835 last argument of make_unibyte_string.
836
837 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
838 language ID in the event parameters.
839
840 * w32term.c (w32_read_socket): Put the new keyboard codepage into
841 event.code, not the obscure "character set ID".
842
843 2012-06-23 Chong Yidong <cyd@gnu.org>
844
845 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
846
847 2012-06-23 Eli Zaretskii <eliz@gnu.org>
848
849 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
850 * w32.c (fdutimens): New function.
851
852 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
853
854 * s/ms-w32.h (pselect): Redirect to sys_select.
855
856 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
857
858 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
859 in the logic of incrementing and decrementing the value of
860 use_relocatable_buffers.
861
862 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
863
864 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
865 Privately reported by Herbert J. Skuhra.
866 [__FreeBSD__]: Remove "*/" typo after "#include".
867 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
868 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
869 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
870 Don't assume EMACS_TIME and struct timeval are the same type.
871
872 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
873
874 Support higher-resolution time stamps (Bug#9000).
875 The time stamps are only nanosecond-resolution at the C level,
876 since that's the best that any real-world system supports now.
877 But they are picosecond-resolution at the Lisp level, as that's
878 easy, and leaves room for future OS improvements.
879
880 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
881 (LIBES): Use it.
882
883 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
884 Don't get current time unless it's needed.
885
886 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
887 now provides it if it's absent.
888 (start_atimer): Port to higher-res time stamps.
889 Check for time stamp overflow. Don't get current time more
890 often than is needed.
891
892 * buffer.h (struct buffer): Buffer modtime now has high resolution.
893 Include systime.h, not time.h.
894 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
895
896 * dired.c: Include stat-time.h.
897 (Ffile-attributes): File times now have higher resolution.
898
899 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
900 (struct image): Timestamp now has higher resolution.
901
902 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
903 has at least microseconds now. All uses removed.
904 (update_frame, update_single_window, update_window, update_frame_1)
905 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
906
907 * editfns.c (time_overflow): Now extern.
908 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
909 (float-time, Fformat_time_string, Fcurrent_time_string)
910 (Fcurrent_time_zone): Accept and generate higher-resolution
911 time stamps.
912 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
913 (decode_time_components, lisp_seconds_argument): New functions.
914 (make_time): Now static.
915 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
916 Report an error if the time is invalid, rather than having the caller
917 do that.
918
919 * fileio.c: Include <stat-time.h>
920 (Fcopy_file): Copy higher-resolution time stamps.
921 Prefer to set the time stamp via a file descriptor if that works.
922 (Fset_file_times, Finsert_file_contents, Fwrite_region)
923 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
924 (Fvisited_file_modtime, Fset_visited_file_modtime):
925 Support higher-resolution time stamps.
926
927 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
928
929 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
930
931 * image.c (prepare_image_for_display, clear_image_cache)
932 (lookup_image): Port to higer-resolution time stamps.
933
934 * keyboard.c (start_polling, bind_polling_period):
935 Check for time stamp overflow.
936 (read_char, kbd_buffer_get_event, timer_start_idle)
937 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
938 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
939 Port to higher-resolution time stamps. Do not assume time_t is signed.
940 (decode_timer): New function. Timers are now vectors of length 9,
941 not 8, to accommodate the picosecond component.
942 (timer_check_2): Use it.
943
944 * nsterm.m (select_timeout, timeval_subtract): Remove.
945 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
946 as they're a bit more accurate and handle overflow better.
947 (ns_select): Change prototype to be compatible with pselect.
948 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
949 * nsterm.h (ns_select): Adjust prototype.
950
951 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
952 us-resolution time stamps.
953 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
954
955 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
956
957 * lisp.h (time_overflow): New decl.
958 (wait_reading_process_output): First arg is now intmax_t, not int,
959 to accommodate larger waits.
960
961 * process.h (struct Lisp_Process.read_output_delay):
962 Now counts nanoseconds, not microseconds.
963 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
964 EMACS_HAS_USECS.
965 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
966 (wait_reading_process_output):
967 Port to ns-resolution time stamps.
968 (Faccept_process_output, wait_reading_process_output):
969 Check for time stamp overflow. Do not assume time_t is signed.
970 (select_wrapper): Remove; we now use pselect.
971 (Fprocess_attributes): Now generates ns-resolution time stamps.
972
973 * sysdep.c: Include utimens.h. Don't include utime.h
974 or worry about struct utimbuf; gnulib does that for us now.
975 (gettimeofday): Remove; gnulib provides a substitute.
976 (make_timeval): New function.
977 (set_file_times): Now sets ns-resolution time stamps.
978 New arg FD; all uses changed.
979 (time_from_jiffies, ltime_from_jiffies, get_up_time)
980 (system_process_attributes):
981 Now returns ns-resolution time stamp. All uses changed.
982 Check for time stamp overflow.
983
984 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
985 provides a substitute now.
986
987 * systime.h: Include timespec.h rather than sys/time.h and time.h,
988 since it guarantees struct timespec.
989 (EMACS_TIME): Now struct timespec, so that we can support
990 ns-resolution time stamps.
991 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
992 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
993 (EMACS_USECS): Remove.
994 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
995 so multiply the arg by 1000 before storing it.
996 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
997 New macros.
998 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
999 Port to ns-resolution time stamps.
1000 (EMACS_TIME_NEG_P): Remove; replaced by....
1001 (EMACS_TIME_SIGN): New macro.
1002 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
1003 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
1004 (set_file_times, make_time, lisp_time_argument): Adjust signature.
1005 (make_timeval, make_lisp_time, decode_time_components): New decls.
1006 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
1007 that it mishandled time_t overflow. You can't compare by subtracting!
1008 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
1009 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
1010
1011 * term.c: Include <sys/time.h>.
1012 (timeval_to_Time): New function, for proper overflow wraparound.
1013 (term_mouse_position, term_mouse_click): Use it.
1014
1015 * undo.c (record_first_change): Support higher-resolution time stamps
1016 in the undo buffer.
1017 (Fprimitive_undo): Use them when restoring time stamps.
1018
1019 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
1020 (w32_get_internal_run_time):
1021 Port to higher-resolution Emacs time stamps.
1022 (ltime): Now accepts single 64-bit integer, as that's more convenient
1023 for callers.
1024
1025 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
1026
1027 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
1028 for compatibility with pselect. Support ns-resolution time stamps.
1029
1030 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
1031
1032 * xselect.c (wait_for_property_change, x_get_foreign_selection):
1033 Check for time stamp overflow, and support ns-resolution time stamps.
1034
1035 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
1036 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
1037 (timeval_subtract): Remove; no longer needed.
1038 (XTflash, XTring_bell, x_wait_for_event):
1039 Port to ns-resolution time stamps. Don't assume time_t is signed.
1040
1041 2012-06-22 Chong Yidong <cyd@gnu.org>
1042
1043 * xdisp.c (x_consider_frame_title): Revert last change.
1044
1045 2012-06-22 Eli Zaretskii <eliz@gnu.org>
1046
1047 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
1048 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
1049 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
1050 staticidx goes up to 1597 out of 1600 = 0x640.)
1051
1052 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
1053
1054 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
1055 Otherwise, the umask might be mistakenly 0 while handling input signals.
1056
1057 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
1058
1059 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
1060
1061 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
1062
1063 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
1064 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
1065 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
1066 access to `contents' member of Lisp_Vector objects with AREF and ASET
1067 where appropriate.
1068
1069 2012-06-19 Chong Yidong <cyd@gnu.org>
1070
1071 * frame.c (delete_frame): When selecting a frame on a different
1072 text terminal, do not alter the terminal's top-frame.
1073
1074 * xdisp.c (format_mode_line_unwind_data): Record the target
1075 frame's selected window and its terminal's top-frame.
1076 (unwind_format_mode_line): Restore them.
1077 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
1078 Callers changed.
1079 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
1080 since tty frames can be explicitly named.
1081 (prepare_menu_bars): Likewise.
1082
1083 * term.c (Ftty_top_frame): New function.
1084
1085 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
1086
1087 Port byte-code-meter to modern targets.
1088 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
1089 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
1090 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
1091 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
1092 (METER_1, METER_2): Simplify.
1093
1094 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
1095
1096 * data.c (Fdefalias): Return `symbol' (bug#11686).
1097
1098 2012-06-18 Martin Rudalics <rudalics@gmx.at>
1099
1100 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1101 gets killed during executing of this function (Bug#11665).
1102 Try to always return Qt when the buffer has been actually killed.
1103 (Vkill_buffer_query_functions): In doc-string say that functions
1104 run by this hook should not change the current buffer.
1105
1106 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
1107
1108 Fix recently-introduced process.c problems found by static checking.
1109 * process.c (write_queue_push, write_queue_pop, send_process):
1110 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
1111 (write_queue_pop): Fix pointer signedness problem.
1112 (send_process): Remove unused local.
1113
1114 2012-06-17 Chong Yidong <cyd@gnu.org>
1115
1116 * xdisp.c (redisplay_internal): No need to redisplay terminal
1117 frames that are not on top.
1118
1119 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
1120
1121 * process.c (make_process): Initialize write_queue.
1122 (write_queue_push, write_queue_pop): New functions.
1123 (send_process): Use them to maintain correct ordering of process
1124 writes (Bug#10815).
1125
1126 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
1127
1128 * lisp.h (eassert): Assume C89 or later.
1129 This removes the need for CHECK.
1130 (CHECK): Remove. Its comments about always evaluating its
1131 argument were confusing, as 'eassert' typically does not evaluate
1132 its argument.
1133
1134 * coding.c (produce_chars): Use ptrdiff_t, not int.
1135
1136 * xterm.c (x_draw_underwave): Check for integer overflow.
1137 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
1138
1139 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
1140
1141 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
1142 referenced (Bug#11583).
1143
1144 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
1145
1146 Implement wave-style variant of underlining.
1147 * dispextern.h (face_underline_type): New enum.
1148 (face): Add field for underline type.
1149 * nsterm.m (ns_draw_underwave): New function.
1150 (ns_draw_text_decoration): Use it.
1151 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
1152 New functions.
1153 (x_draw_glyph_string): Use them.
1154 * xfaces.c (Qline, Qwave): New Lisp objects.
1155 (check_lface_attrs, merge_face_ref)
1156 (Finternal_set_lisp_face_attribute, realize_x_face):
1157 Handle wave-style underline face attributes.
1158 * xterm.c (x_draw_underwave): New function.
1159 (x_draw_glyph_string): Use it.
1160
1161 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
1162
1163 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
1164 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
1165 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
1166 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
1167 ($(BLD)/w32select.$(O)): Update dependencies.
1168
1169 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
1170
1171 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
1172 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
1173 * character.c (_fetch_multibyte_char_p): Remove.
1174 * alloc.c: Include "character.h" before "buffer.h".
1175 * bidi.c: Likewise.
1176 * buffer.c: Likewise.
1177 * bytecode.c: Likewise.
1178 * callint.c: Likewise.
1179 * callproc.c: Likewise.
1180 * casefiddle.c: Likewise.
1181 * casetab.c: Likewise.
1182 * category.c: Likewise.
1183 * cmds.c: Likewise.
1184 * coding.c: Likewise.
1185 * composite.c: Likewise.
1186 * dired.c: Likewise.
1187 * dispnew.c: Likewise.
1188 * doc.c: Likewise.
1189 * dosfns.c: Likewise.
1190 * editfns.c: Likewise.
1191 * emacs.c: Likewise.
1192 * fileio.c: Likewise.
1193 * filelock.c: Likewise.
1194 * font.c: Likewise.
1195 * fontset.c: Likewise.
1196 * fringe.c: Likewise.
1197 * indent.c: Likewise.
1198 * insdel.c: Likewise.
1199 * intervals.c: Likewise.
1200 * keyboard.c: Likewise.
1201 * keymap.c: Likewise.
1202 * lread.c: Likewise.
1203 * macros.c: Likewise.
1204 * marker.c: Likewise.
1205 * minibuf.c: Likewise.
1206 * nsfns.m: Likewise.
1207 * nsmenu.m: Likewise.
1208 * print.c: Likewise.
1209 * process.c: Likewise.
1210 * regex.c: Likewise.
1211 * region-cache.c: Likewise.
1212 * search.c: Likewise.
1213 * syntax.c: Likewise.
1214 * term.c: Likewise.
1215 * textprop.c: Likewise.
1216 * undo.c: Likewise.
1217 * unexsol.c: Likewise.
1218 * w16select.c: Likewise.
1219 * w32fns.c: Likewise.
1220 * w32menu.c: Likewise.
1221 * window.c: Likewise.
1222 * xdisp.c: Likewise.
1223 * xfns.c: Likewise.
1224 * xmenu.c: Likewise.
1225 * xml.c: Likewise.
1226 * xselect.c: Likewise.
1227
1228 2012-06-16 Eli Zaretskii <eliz@gnu.org>
1229
1230 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
1231 If all the glyphs of the glyph row came from strings, and we have no
1232 cursor positioning clues, put the cursor on the first glyph of the
1233 row.
1234 (handle_face_prop): Use chunk-relative overlay string index when
1235 indexing into it->string_overlays array. (Bug#11653)
1236 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
1237 the rightmost. (Bug#11720)
1238
1239 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
1240
1241 * category.h (CHAR_HAS_CATEGORY): Define as inline.
1242 (CATEGORY_MEMBER): Enforce 1/0 value.
1243 * category.c (_temp_category_set): Remove.
1244
1245 2012-06-16 Eli Zaretskii <eliz@gnu.org>
1246
1247 * window.c (Fdelete_other_windows_internal)
1248 (Fdelete_window_internal): Don't access frame's mouse highlight
1249 info of the initial frame. (Bug#11677)
1250
1251 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
1252
1253 * .gdbinit (xgetint): Fix recently-introduced paren typo.
1254 Assume USE_2_TAGS_FOR_INTS.
1255 (xreload): Adjust $tagmask width to match recent lisp.h change.
1256
1257 Simplify lisp.h in minor ways that should not affect code.
1258 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
1259 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
1260 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
1261 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
1262 (INTTYPEBITS): New macro, for clarity.
1263 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1264 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
1265 Simplify now that USE_LSB_TAG is always defined.
1266 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
1267 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
1268
1269 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
1270
1271 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
1272
1273 2012-06-13 Glenn Morris <rgm@gnu.org>
1274
1275 * s/bsd-common.h (BSD4_3):
1276 * s/usg5-4-common.h (USG5_4): No longer define; unused.
1277
1278 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
1279
1280 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
1281 instead of union.
1282 (XLI, XIL): Define.
1283 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
1284 Use them.
1285 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
1286 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1287 * alloc.c (widen_to_Lisp_Object): Remove.
1288 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
1289 * frame.c (delete_frame): Remove outdated comment.
1290 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
1291 USE_LISP_UNION_TYPE.
1292 (Fw32_unregister_hot_key): Likewise.
1293 (Fw32_toggle_lock_key): Likewise.
1294 * w32menu.c (add_menu_item): Likewise.
1295 (w32_menu_display_help): Use XIL instead of checking
1296 USE_LISP_UNION_TYPE.
1297 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
1298 (init_heap): Likewise.
1299 * w32term.c (w32_read_socket): Update comment.
1300
1301 2012-06-13 Glenn Morris <rgm@gnu.org>
1302
1303 * s/usg5-4-common.h, src/s/unixware.h:
1304 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
1305
1306 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
1307
1308 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
1309
1310 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
1311 * alloc.c (make_number) [!defined make_number]:
1312 Remove, as lisp.h always defines this now.
1313 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
1314 (roundup_size): Verify that it is a power of 2.
1315 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
1316 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
1317 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
1318 -DUSE_LSB_TAG=0, to override the automatically-selected default.
1319 USE_LSB_TAG now is always defined to be either 0 or 1.
1320 All uses changed.
1321 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
1322 code works fine either way, and efficiency is not a concern here,
1323 as the union type is for debugging, not for production.
1324 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
1325 Use an inline function on all platforms when using the union type,
1326 since this is simpler and 'static inline' can be used portably
1327 within Emacs now.
1328 (LISP_INITIALLY_ZERO): New macro.
1329 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
1330 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
1331
1332 2012-06-12 Glenn Morris <rgm@gnu.org>
1333
1334 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
1335
1336 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
1337
1338 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
1339 Move BROKEN_SIGIO to configure.
1340
1341 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
1342 Move NO_TERMIO to configure.
1343
1344 2012-06-12 Chong Yidong <cyd@gnu.org>
1345
1346 * image.c (imagemagick_load_image): Use MagickFlattenImage if
1347 MagickMergeImageLayers is undefined. Use pixel pusher loop if
1348 MagickExportImagePixels is undefined.
1349
1350 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
1351
1352 * image.c (imagemagick_load_image): Remove unused label.
1353
1354 2012-06-11 Glenn Morris <rgm@gnu.org>
1355
1356 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
1357 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
1358 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
1359 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
1360
1361 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
1362
1363 * alloc.c (make_byte_code): New function.
1364 (Fmake_byte_code): Use it. Don't purify here.
1365 * lread.c (read1): Use it as well to avoid extra allocation.
1366
1367 2012-06-11 Chong Yidong <cyd@gnu.org>
1368
1369 * image.c (imagemagick_load_image): Implement transparency.
1370
1371 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
1372
1373 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
1374 account for preceding backslashes. (Bug#11663)
1375
1376 2012-06-09 Chong Yidong <cyd@gnu.org>
1377
1378 * term.c: Support italics in capable terminals (Bug#9652).
1379 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
1380 (turn_on_face): Output using TS_enter_italic_mode if available.
1381 Don't handle unused blinking and alt-charset cases.
1382 (turn_off_face): Handle italic case; discard unused tty_blinking_p
1383 and tty_alt_charset_p cases.
1384 (tty_capable_p, init_tty): Support italics.
1385
1386 * termchar.h (struct tty_display_info): Add field for italics.
1387 Remove unused blink field.
1388
1389 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
1390 Handle slant.
1391
1392 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
1393 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
1394 tty_alt_charset_p. Add tty_italic_p.
1395
1396 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
1397
1398 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
1399 dbus_type_is_basic if available.
1400 (xd_extract_signed, xd_extract_unsigned): Rename from
1401 extract_signed and extract_unsigned, respectively. Adapt callers.
1402
1403 2012-06-09 Chong Yidong <cyd@gnu.org>
1404
1405 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
1406
1407 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
1408 case (Bug#9752).
1409
1410 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
1411
1412 * xdisp.c (vmessage): Treat frame message as multibyte.
1413 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
1414 would generate the diagnostic "Making \302\247 buffer-local while
1415 let-bound!".
1416
1417 2012-06-08 Eli Zaretskii <eliz@gnu.org>
1418
1419 * dispnew.c (showing_window_margins_p): Undo last change, which
1420 was done due to an inadvertent commit.
1421 (adjust_frame_glyphs_for_frame_redisplay): Do call
1422 showing_window_margins_p.
1423
1424 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
1425
1426 * eval.c (Fmake_var_non_special): New primitive.
1427 (syms_of_eval): Defsubr it.
1428 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
1429
1430 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
1431
1432 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
1433 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
1434
1435 2012-06-08 Eli Zaretskii <eliz@gnu.org>
1436
1437 * alloc.c (allocate_vectorlike): Fix last change.
1438
1439 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
1440
1441 Block-based vector allocation of small vectors.
1442 * lisp.h (struct vectorlike_header): New field `nbytes',
1443 adjust comment accordingly.
1444 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
1445 to denote vector blocks. Adjust users (live_vector_p,
1446 mark_maybe_pointer, valid_lisp_object_p) accordingly.
1447 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
1448 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
1449 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
1450 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
1451 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
1452 (roundup_size): New constant.
1453 (struct vector_block): New data type.
1454 (vector_blocks, vector_free_lists, zero_vector): New variables.
1455 (all_vectors): Rename to `large_vectors'.
1456 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
1457 (sweep_vectors): New functions.
1458 (allocate_vectorlike): Return `zero_vector' as the only vector of
1459 0 items. Allocate new vector from block if vector size is less than
1460 or equal to VBLOCK_BYTES_MAX.
1461 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
1462 (init_alloc_once): Add call to init_vectors.
1463
1464 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
1465
1466 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
1467
1468 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
1469
1470 * doprnt.c (doprnt): Truncate multibyte char correctly.
1471 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
1472 would mishandle a string argument "Xc" if X was a multibyte
1473 character of length 2: it would truncate after X's first byte
1474 rather than including all of X.
1475
1476 2012-06-06 Chong Yidong <cyd@gnu.org>
1477
1478 * buffer.c (word_wrap): Doc fix.
1479
1480 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
1481
1482 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
1483
1484 2012-06-03 Glenn Morris <rgm@gnu.org>
1485
1486 * xdisp.c (tool-bar-style): Doc fix.
1487
1488 2012-06-03 Ulrich Müller <ulm@gentoo.org>
1489
1490 * Makefile.in (PAXCTL): Define.
1491 (temacs$(EXEEXT)): Disable memory randomization for the temacs
1492 binary via PaX flags if the paxctl utility is available.
1493 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
1494 Restore PaX flags to their default. (Bug#11398)
1495
1496 2012-06-03 Chong Yidong <cyd@gnu.org>
1497
1498 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
1499 buffer (Bug#11226).
1500
1501 2012-06-03 Chong Yidong <cyd@gnu.org>
1502
1503 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
1504 (note_mode_line_or_margin_highlight): If there is no help echo,
1505 use mode-line-default-help-echo. Handle the case where the mouse
1506 position is past the end of the mode line string.
1507
1508 * buffer.c (buffer_local_value_1): New function, split from
1509 Fbuffer_local_value; can return Qunbound.
1510 (Fbuffer_local_value): Use it.
1511 (Vmode_line_format): Docstring tweaks.
1512
1513 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
1514
1515 * sysdep.c (system_process_attributes): Improve comment.
1516
1517 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
1518
1519 * keyboard.c: Export real-this-command to Elisp.
1520 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
1521 and DEFVAR it. Update all users.
1522
1523 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
1524
1525 * minibuf.c (Fassoc_string): Remove duplicate declaration.
1526
1527 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
1528 Convert pctcpu and pctmem to Lisp float properly.
1529 Let the compiler fold better, as 100.0/0x8000 is exact.
1530
1531 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
1532
1533 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
1534 cons_block.
1535
1536 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
1537
1538 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
1539
1540 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
1541
1542 For a 'struct window', replace some Lisp_Object fields to
1543 bitfields where appropriate, remove unused fields.
1544 * window.h (struct window): Remove unused 'last_mark_x' and
1545 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
1546 change it's type from Lisp_Object to bitfield.
1547 Change type of 'force_start', 'optional_new_start',
1548 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
1549 fields from Lisp_Object to bitfield. Adjust users accordingly.
1550
1551 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
1552
1553 Pacify gcc -Wdouble-precision when using Xaw.
1554 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
1555 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
1556 Use 'float' consistently, rather than 'float' in most places
1557 and 'double' in a couple of places.
1558
1559 2012-05-31 Eli Zaretskii <eliz@gnu.org>
1560
1561 * xdisp.c (handle_stop): Detect whether we have overlay strings
1562 loaded by testing it->current.overlay_string_index to be
1563 non-negative, instead of checking whether n_overlay_strings is
1564 positive. (Bug#11587)
1565
1566 2012-05-31 Chong Yidong <cyd@gnu.org>
1567
1568 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
1569
1570 * doc.c (Fsubstitute_command_keys): Doc fix.
1571
1572 2012-05-31 Eli Zaretskii <eliz@gnu.org>
1573
1574 * search.c (search_buffer): Remove calls to
1575 r_alloc_inhibit_buffer_relocation, as it is now called by
1576 maybe_unify_char, which was the cause of relocation of buffer text
1577 in bug#11519.
1578
1579 2012-05-31 Eli Zaretskii <eliz@gnu.org>
1580
1581 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
1582 for the duration of call to load_charset, to avoid problems with
1583 callers of maybe_unify_char that access buffer text through C
1584 pointers.
1585
1586 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
1587 decrement the inhibition flag, instead of just setting or
1588 resetting it.
1589
1590 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
1591
1592 Remove obsolete '#define static' cruft.
1593 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
1594 This #undef was "temporary" in 2000; it is no longer needed
1595 now that '#define static' has gone away.
1596 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
1597 (gray_bitmap_bits): Remove; no longer needed.
1598 All uses replaced with definiens.
1599 * xterm.c: Include "bitmaps/gray.xbm".
1600
1601 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
1602
1603 Clean up __executable_start, monstartup when --enable-profiling.
1604 The following changes affect the code only when profiling.
1605 * dispnew.c (__executable_start): Rename from safe_bcopy.
1606 Define only on platforms that need it.
1607 * emacs.c: Include <sys/gmon.h> when profiling.
1608 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
1609 (__executable_start): Remove decl, since lisp.h does it now.
1610 (safe_bcopy): Remove decl; no longer has that name.
1611 (main): Coalesce #if into single bit of code, for simplicity.
1612 Cast pointers to uintptr_t, since standard libraries want integers
1613 and not pointers.
1614 * lisp.h (__executable_start): New decl.
1615
1616 2012-05-31 Glenn Morris <rgm@gnu.org>
1617
1618 * image.c (Fimagemagick_types): Doc fix.
1619
1620 2012-05-30 Jim Meyering <meyering@redhat.com>
1621
1622 * callproc.c (Fcall_process_region): Include directory component
1623 in mkstemp error message (Bug#11586).
1624
1625 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
1626
1627 * alloc.c, lisp.h (make_pure_vector): Now static.
1628
1629 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
1630
1631 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
1632 Move to byte-run.el.
1633 (Fautoload): Do the hash-doc more carefully.
1634 * data.c (Fdefalias): Purify definition, except for keymaps.
1635 (Qdefun): Move from eval.c.
1636 * lisp.h (Qdefun): Remove.
1637 * lread.c (read1): Tiny simplification.
1638
1639 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
1640
1641 Do not create empty overlays with the evaporate property (Bug#9642).
1642 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
1643 Bug#9642, but explicitly check that the buffer the overlay would
1644 be moved to is live and rearrange lines to make sure that errors
1645 will not put the overlay in an inconsistent state.
1646 (Fdelete_overlay): Cosmetics.
1647
1648 2012-05-28 Eli Zaretskii <eliz@gnu.org>
1649
1650 * w32term.c (my_bring_window_to_top): New function.
1651 (x_raise_frame): Use handle returned by DeferWindowPos, which
1652 could be different from the original one.
1653 Call my_bring_window_to_top instead of my_set_foreground_window.
1654 (Bug#11513)
1655
1656 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
1657 by calling BringWindowToTop.
1658
1659 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
1660 (WM_EMACS_END): Increase by one.
1661
1662 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
1663
1664 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
1665 This avoids undefined behavior that might cause the eassert
1666 to not catch an out-of-range value.
1667
1668 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
1669
1670 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
1671 Update dependencies.
1672
1673 2012-05-27 Eli Zaretskii <eliz@gnu.org>
1674
1675 * bidi.c (bidi_mirror_char): Fix last change.
1676
1677 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
1678
1679 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
1680 when referring to sectname field in printf format.
1681
1682 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
1683
1684 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
1685 Only r_alloc_inhibit_buffer_relocation needed to be added;
1686 the others were already declared.
1687
1688 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
1689 before checking whether it's out of range. Put the check inside
1690 eassert. See
1691 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
1692
1693 2012-05-27 Ken Brown <kbrown@cornell.edu>
1694
1695 * callproc.c (Fcall_process): Restore a line that was accidentally
1696 commented out in the 2011-02-13 change (bug#11547).
1697
1698 2012-05-27 Eli Zaretskii <eliz@gnu.org>
1699
1700 * lisp.h [REL_ALLOC]: Add prototypes for external functions
1701 defined on ralloc.c.
1702
1703 * buffer.c [REL_ALLOC]: Remove prototypes of
1704 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
1705 they are now on lisp.h.
1706
1707 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
1708
1709 * search.c (search_buffer): Use it to inhibit relocation of buffer
1710 text while re_search_2 is doing its job, because re_search_2 is
1711 passed C pointers to buffer text. (Bug#11519)
1712
1713 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
1714 Update value to 24.
1715
1716 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
1717 state after an additional call to move_it_in_display_line_to, keep
1718 the values of it->max_ascent and it->max_descent found for the
1719 entire line.
1720 (pos_visible_p): Revert the comparison against bottom_y to what it
1721 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
1722 (Bug#11464)
1723
1724 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
1725
1726 Fix coding-related core dumps with gcc -ftrapv.
1727 The code was computing A - B, where A and B are pointers, and B is
1728 random garbage. This can lead to core dumps on platforms that
1729 have special pointer registers, and it also leads to core dumps on
1730 x86-64 when compiled with gcc -ftrapv. The fix is to compute
1731 A - B only when B is initialized properly.
1732 * coding.c (coding_set_source, coding_set_destination): Return void.
1733 (coding_change_source, coding_change_destinations): New functions,
1734 with the old behaviors of coding_set_source and coding_set_destination.
1735 All callers that need an offset changed to use these new functions.
1736
1737 2012-05-26 Glenn Morris <rgm@gnu.org>
1738
1739 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
1740
1741 2012-05-26 Eli Zaretskii <eliz@gnu.org>
1742
1743 Extend mouse support on W32 text-mode console.
1744 * xdisp.c (draw_row_with_mouse_face):
1745 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
1746
1747 * w32console.c: Include window.h.
1748 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
1749 New functions.
1750 (initialize_w32_display): Initialize mouse-highlight data.
1751
1752 * w32inevt.c: Include termchar.h and window.h.
1753 (do_mouse_event): Support mouse-autoselect-window. When the mouse
1754 moves, call note_mouse_highlight. If help_echo changed, call
1755 gen_help_event to produce help-echo message in the echo area.
1756 Call clear_mouse_face if mouse_face_hidden is set in the mouse
1757 highlight info.
1758
1759 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
1760
1761 * lread.c (read1): Simplify slightly to avoid an overflow warning
1762 with GCC 4.7.0 on x86-64.
1763
1764 2012-05-26 Eli Zaretskii <eliz@gnu.org>
1765
1766 * bidi.c (bidi_mirror_char): Revert last change: an int is
1767 definitely wide enough here.
1768
1769 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
1770
1771 Fix integer width and related bugs (Bug#9874).
1772 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
1773 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
1774 (string_bytes, check_sblock, allocate_string_data):
1775 (compact_small_strings, Fmake_bool_vector, make_string)
1776 (make_unibyte_string, make_multibyte_string)
1777 (make_string_from_bytes, make_specified_string)
1778 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
1779 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
1780 (mark_vectorlike):
1781 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1782 (allocate_pseudovector):
1783 Use int, not EMACS_INT, where int is wide enough.
1784 (inhibit_garbage_collection, Fgarbage_collect):
1785 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1786 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
1787 int might not be wide enough.
1788 (bidi_cache_search, bidi_cache_find, bidi_init_it)
1789 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
1790 (bidi_at_paragraph_end, bidi_find_paragraph_start)
1791 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
1792 (bidi_level_of_next_char, bidi_move_to_visually_next):
1793 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1794 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
1795 (Fkill_buffer, Fset_buffer_major_mode)
1796 (advance_to_char_boundary, Fbuffer_swap_text)
1797 (Fset_buffer_multibyte, overlays_at, overlays_in)
1798 (overlay_touches_p, struct sortvec, record_overlay_string)
1799 (overlay_strings, recenter_overlay_lists)
1800 (adjust_overlays_for_insert, adjust_overlays_for_delete)
1801 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
1802 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
1803 (Foverlay_recenter, last_overlay_modification_hooks_used)
1804 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
1805 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1806 (validate_region): Omit unnecessary test for b <= e,
1807 since that's guaranteed by the previous test.
1808 (adjust_overlays_for_delete): Avoid pos + length overflow.
1809 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
1810 (report_overlay_modification):
1811 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1812 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
1813 Omit pointer cast, which isn't needed anyway, and doesn't work
1814 after the EMACS_INT -> ptrdiff_t change.
1815 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
1816 * buffer.h: Adjust decls to match defn changes elsewhere.
1817 (struct buffer_text, struct buffer):
1818 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1819 Use EMACS_INT, not int, where int might not be wide enough.
1820 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
1821 not int, to avoid needless 32-bit limit on 64-bit hosts.
1822 (exec_byte_code): Use tighter memory-full test, one that checks
1823 for alloca overflow. Don't compute the address of the object just
1824 before an array, as that's not portable. Use EMACS_INT, not
1825 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
1826 * callint.c (Fcall_interactively):
1827 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1828 * callproc.c (call_process_kill, Fcall_process):
1829 Don't assume pid_t fits into an Emacs fixnum.
1830 (call_process_cleanup, Fcall_process, child_setup):
1831 Don't assume pid_t fits into int.
1832 (call_process_cleanup, Fcall_process, delete_temp_file)
1833 (Fcall_process_region):
1834 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1835 (Fcall_process): Simplify handling of volatile integers.
1836 Use int, not EMACS_INT, where int will do.
1837 * casefiddle.c (casify_object, casify_region, operate_on_word)
1838 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
1839 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1840 (casify_object): Avoid integer overflow when overallocating buffer.
1841 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
1842 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
1843 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
1844 * category.h (CATEGORYP): Don't assume arg is nonnegative.
1845 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
1846 integers are now checked earlier. All uses replaced with XINT.
1847 (ccl_driver):
1848 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1849 For CCL_MapSingle, check that content and value are in int range.
1850 (ccl_driver, Fregister_code_conversion_map):
1851 Check that Vcode_version_map_vector is a vector.
1852 (resolve_symbol_ccl_program): Check that vector header is in range.
1853 Always copy the vector, so that we can check its contents reliably
1854 now rather than having to recheck each instruction as it's being
1855 executed. Check that vector words fit in 'int'.
1856 (ccl_get_compiled_code, Fregister_ccl_program)
1857 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
1858 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
1859 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
1860 contents are in range.
1861 (Fccl_execute_on_string): Check that status is in range.
1862 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
1863 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
1864 Accept and return EMACS_INT, not int, because callers can pass values
1865 out of 'int' range.
1866 (c_string_width, strwidth, lisp_string_width, chars_in_text)
1867 (multibyte_chars_in_text, parse_str_as_multibyte)
1868 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
1869 (str_as_unibyte, str_to_unibyte, string_count_byte8)
1870 (string_escape_byte8, Fget_byte):
1871 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1872 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
1873 avoid mishandling large integers.
1874 * character.h: Adjust decls to match defn changes elsewhere.
1875 * charset.c (load_charset_map_from_file, find_charsets_in_text)
1876 (Ffind_charset_region):
1877 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1878 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
1879 (load_charset_map_from_vector, Fdefine_charset_internal):
1880 Don't assume fixnum fits in int.
1881 (load_charset_map_from_vector, Fmap_charset_chars):
1882 Remove now-unnecessary CHECK_NATNUMs.
1883 (Fdefine_charset_internal): Check ranges here, more carefully.
1884 Don't rely on undefined behavior with signed left shift overflow.
1885 Don't assume unsigned int fits into fixnum, or that fixnum fits
1886 into unsigned int. Don't require max_code to be a valid fixnum;
1887 that's not true for gb10830 4-byte on a 32-bit host. Allow
1888 invalid_code to be a cons, for the same reason. Require code_offset
1889 to be a character. Avoid int overflow if max_char is close
1890 to INT_MAX.
1891 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
1892 this is intended anyway and avoids some undefined behavior.
1893 (load_charset_map): Pass unsigned, not int, as 2nd arg of
1894 INDEX_TO_CODE_POINT, as that's what it expects.
1895 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
1896 * charset.h (DECODE_CHAR): Return int, not unsigned;
1897 this is what was intended anyway, and it avoids undefined behavior.
1898 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
1899 integer-overflow issues.
1900 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
1901 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
1902 where the argument is EMACS_INT, and this behavior is not intended.
1903 * chartab.c (Fmake_char_table, Fset_char_table_range)
1904 (uniprop_get_decoder, uniprop_get_encoder):
1905 Don't assume fixnum fits in int.
1906 * cmds.c (move_point): New function, that does the gist of
1907 Fforward_char and Fbackward_char, but does so while checking
1908 for integer overflow more accurately.
1909 (Fforward_char, Fbackward_char): Use it.
1910 (Fforward_line, Fend_of_line, internal_self_insert)
1911 (internal_self_insert):
1912 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1913 Fix a FIXME, by checking for integer overflow when calculating
1914 target_clm and actual_clm.
1915 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
1916 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
1917 (ASSURE_DESTINATION, coding_alloc_by_realloc)
1918 (coding_alloc_by_making_gap, alloc_destination)
1919 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
1920 (encode_coding_utf_16, detect_coding_emacs_mule)
1921 (decode_coding_emacs_mule, encode_coding_emacs_mule)
1922 (detect_coding_iso_2022, decode_coding_iso_2022)
1923 (encode_invocation_designation, encode_designation_at_bol)
1924 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
1925 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
1926 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
1927 (encode_coding_ccl, encode_coding_raw_text)
1928 (detect_coding_charset, decode_coding_charset)
1929 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
1930 (produce_composition, produce_charset, produce_annotation)
1931 (decode_coding, handle_composition_annotation)
1932 (handle_charset_annotation, consume_chars, decode_coding_gap)
1933 (decode_coding_object, encode_coding_object, detect_coding_system)
1934 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
1935 (code_convert_region, code_convert_string)
1936 (Fdefine_coding_system_internal)
1937 (coding_set_source, coding_set_destination):
1938 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1939 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
1940 (Fdefine_coding_system_internal):
1941 Don't assume fixnums fit in int.
1942 (decode_coding_gap, decode_coding_object, encode_coding_object)
1943 (Fread_coding_system, Fdetect_coding_region)
1944 (Funencodable_char_position, Fcheck_coding_systems_region)
1945 (get_translation, handle_composition_annotation, consume_chars):
1946 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1947 (consume_chars): Rewrite to not calculate an address outside buffer.
1948 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
1949 Don't access memory outside of the args array.
1950 (Fdefine_coding_system_internal): Check for charset-id overflow.
1951 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
1952 result of ENCODE_CHAR.
1953 * coding.h: Adjust decls to match defn changes elsewhere.
1954 (struct coding_system):
1955 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1956 * composite.c (get_composition_id, find_composition)
1957 (run_composition_function, update_compositions)
1958 (compose_text, composition_gstring_put_cache)
1959 (composition_gstring_p, composition_gstring_width)
1960 (fill_gstring_header, fill_gstring_body, autocmp_chars)
1961 (composition_compute_stop_pos, composition_reseat_it)
1962 (composition_update_it, struct position_record)
1963 (find_automatic_composition, composition_adjust_point)
1964 (Fcomposition_get_gstring, Ffind_composition_internal):
1965 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1966 (update_compositions):
1967 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1968 * composite.h: Adjust decls to match defn changes elsewhere.
1969 (struct composition):
1970 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1971 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
1972 Do not attempt to compute the address of the object just before a
1973 buffer; this is not portable.
1974 (Faref, Faset):
1975 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1976 (Faset): Use int, not EMACS_INT, where int is wide enough.
1977 (Fstring_to_number): Don't assume fixnums fit in int.
1978 (Frem): Don't assume arg is nonnegative.
1979 * dbusbind.c (xd_append_arg): Check for integers out of range.
1980 (Fdbus_call_method): Don't overflow the timeout int.
1981 (extract_signed, extract_unsigned): New functions.
1982 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
1983 (xd_get_connection_references): Return ptrdiff_t, not int.
1984 All uses changed.
1985 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
1986 (xd_read_message_1):
1987 Use int, not unsigned, where the dbus API uses int.
1988 (Fdbus_message_internal): Don't overflow mtype.
1989 (syms_of_dbusbind): Allocate right-sized buffer for integers.
1990 * dired.c (directory_files_internal, file_name_completion, scmp)
1991 (file_name_completion_stat):
1992 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1993 (file_name_completion): Don't overflow matchcount.
1994 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
1995 * dispextern.h: Adjust decls to match defn changes elsewhere.
1996 (struct text_pos, struct glyph, struct bidi_saved_info)
1997 (struct bidi_string_data, struct bidi_it, struct composition_it)
1998 (struct it):
1999 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2000 (struct display_pos, struct composition_it, struct it):
2001 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2002 * dispnew.c (increment_matrix_positions)
2003 (increment_row_positions, mode_line_string)
2004 (marginal_area_string):
2005 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2006 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
2007 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2008 (duration_to_sec_usec): New function, to check for overflow better.
2009 (Fsleep_for, sit_for): Use it.
2010 * doc.c (get_doc_string, store_function_docstring):
2011 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2012 (get_doc_string, Fsnarf_documentation):
2013 Use int, not EMACS_INT, where int is wide enough.
2014 (get_doc_string):
2015 Use SAFE_ALLOCA, not alloca.
2016 Check for overflow when converting EMACS_INT to off_t.
2017 * doprnt.c (doprnt):
2018 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2019 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
2020 Don't assume uid_t fits into fixnum.
2021 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
2022 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
2023 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
2024 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
2025 (general_insert_function)
2026 (Finsert_char, make_buffer_string, make_buffer_string_both)
2027 (update_buffer_properties, Fbuffer_substring)
2028 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
2029 (Fsubst_char_in_region, check_translation)
2030 (Ftranslate_region_internal, save_restriction_restore, Fformat)
2031 (transpose_markers, Ftranspose_regions):
2032 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2033 (clip_to_bounds): Move to lisp.h as an inline function).
2034 (Fconstrain_to_field): Don't assume integers are nonnegative.
2035 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
2036 (Fsubst_char_in_region, Fsave_restriction):
2037 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2038 (Femacs_pid): Don't assume pid_t fits into fixnum.
2039 (lo_time): Use int, not EMACS_INT, when int suffices.
2040 (lisp_time_argument): Check for usec out of range.
2041 (Fencode_time): Don't assume fixnum fits in int.
2042 (Fuser_login_name, Fuser_full_name): Signal an error
2043 if a uid argument is out of range, rather than relying on
2044 undefined behavior.
2045 (Fformat_time_string): Remove now-unnecessary check.
2046 lisp_time_argument checks for out-of-range usec now.
2047 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
2048 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
2049 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
2050 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
2051 (init_cmdargs, Fdump_emacs):
2052 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2053 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
2054 the bottom (typically) 32 bits of the fixnum.
2055 * eval.c (specpdl_size, call_debugger):
2056 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2057 (when_entered_debugger, Fbacktrace_debug):
2058 Don't assume fixnum can fit in int.
2059 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
2060 the object just before a buffer; this is not portable.
2061 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
2062 (grow_specpdl, unbind_to):
2063 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2064 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
2065 (grow_specpdl): Simplify allocation by using xpalloc.
2066 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
2067 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
2068 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
2069 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2070 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
2071 (a_write, e_write):
2072 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2073 (Fcopy_file, non_regular_nbytes, read_non_regular)
2074 (Finsert_file_contents):
2075 Use int, not EMACS_INT, where int is wide enough.
2076 (READ_BUF_SIZE): Verify that it fits in int.
2077 (Finsert_file_contents): Check that counts are in proper range,
2078 rather than assuming fixnums fit into ptrdiff_t etc.
2079 Don't assume fixnums fit into int.
2080 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
2081 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
2082 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
2083 (string_char_to_byte, string_byte_to_char)
2084 (string_make_multibyte, string_to_multibyte)
2085 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
2086 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
2087 (substring_both, Fdelete, internal_equal, Ffillarray)
2088 (Fclear_string, mapcar1)
2089 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
2090 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
2091 (larger_vector, make_hash_table, maybe_resize_hash_table)
2092 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
2093 (Fmaphash, secure_hash):
2094 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2095 (concat): Check for string index and length overflow.
2096 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
2097 (Frequire):
2098 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2099 (larger_vector): New API (vec, incr_min, size_max) replaces old
2100 one (vec, new_size, init). This catches size overflow.
2101 INIT was removed because it was always Qnil.
2102 All callers changed.
2103 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
2104 the upper bound on a hash table index size.
2105 (make_hash_table, maybe_resize_hash_table): Use it.
2106 (secure_hash): Computer start_byte and end_byte only after
2107 they're known to be in ptrdiff_t range.
2108 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
2109 (Ffont_get_glyphs, Ffont_at):
2110 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2111 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
2112 (Flist_fonts, Fopen_font):
2113 Don't assume fixnum can fit in int.
2114 (check_gstring): Don't assume index can fit in int.
2115 (font_match_p): Check that fixnum is a character, not a nonnegative
2116 fixnum, since the later code needs to stuff it into an int.
2117 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
2118 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
2119 conversion overflow issues.
2120 (Fopen_font): Check for integer out of range.
2121 (Ffont_get_glyphs): Don't assume index can fit in int.
2122 * font.h: Adjust decls to match defn changes elsewhere.
2123 * fontset.c (reorder_font_vector): Redo score calculation to avoid
2124 integer overflow.
2125 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
2126 printmax_t, where ptrdiff_t is wide enough.
2127 (Finternal_char_font):
2128 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2129 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
2130 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
2131 (Fset_frame_position, x_set_frame_parameters)
2132 (x_set_line_spacing, x_set_border_width)
2133 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
2134 Check that fixnums are in proper range for system types.
2135 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
2136 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2137 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
2138 Use SAFE_ALLOCA_LISP, not alloca.
2139 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
2140 intptr_t is wide enough.
2141 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
2142 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
2143 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
2144 Check for fixnum out of range.
2145 * ftfont.c (ftfont_list): Don't assume index fits in int.
2146 Check that fixnums are in proper range for system types.
2147 (ftfont_shape_by_flt):
2148 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2149 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
2150 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2151 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
2152 Check that fixnums are in proper range for system types.
2153 * gnutls.h: Adjust decls to match defn changes elsewhere.
2154 * gtkutil.c (xg_dialog_run):
2155 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2156 (update_frame_tool_bar):
2157 Check that fixnums are in proper range for system types.
2158 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
2159 (lookup_image): Check that fixnums are in range for system types.
2160 * indent.c (last_known_column, last_known_column_point):
2161 (current_column_bol_cache):
2162 (skip_invisible, current_column, check_display_width):
2163 (check_display_width, scan_for_column, current_column_1)
2164 (Findent_to, Fcurrent_indentation, position_indentation)
2165 (indented_beyond_p, Fmove_to_column, compute_motion):
2166 (Fcompute_motion, Fvertical_motion):
2167 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2168 (last_known_column_modified): Use EMACS_INT, not int.
2169 (check_display_width):
2170 (Fcompute_motion):
2171 Check that fixnums and floats are in proper range for system types.
2172 (compute_motion): Don't assume index or fixnum fits in int.
2173 (compute_motion, Fcompute_motion):
2174 Use int, not EMACS_INT, when it is wide enough.
2175 (vmotion): Omit local var start_hpos that is always 0; that way
2176 we don't need to worry about overflow in expressions involving it.
2177 * indent.h: Adjust decls to match defn changes elsewhere.
2178 (struct position):
2179 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2180 Use int, not EMACS_INT, where int is wide enough.
2181 Remove unused members ovstring_chars_done and tab_offset;
2182 all uses removed.
2183 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
2184 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
2185 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
2186 (make_gap, copy_text, insert, insert_and_inherit)
2187 (insert_before_markers, insert_before_markers_and_inherit)
2188 (insert_1, count_combining_before, count_combining_after)
2189 (insert_1_both, insert_from_string)
2190 (insert_from_string_before_markers, insert_from_string_1)
2191 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
2192 (adjust_after_replace, adjust_after_insert, replace_range)
2193 (replace_range_2, del_range, del_range_1, del_range_byte)
2194 (del_range_both, del_range_2, modify_region)
2195 (prepare_to_modify_buffer, signal_before_change)
2196 (signal_after_change, Fcombine_after_change_execute):
2197 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2198 * intervals.c (traverse_intervals, rotate_right, rotate_left)
2199 (balance_an_interval, split_interval_right, split_interval_left)
2200 (find_interval, next_interval, update_interval)
2201 (adjust_intervals_for_insertion, delete_node, delete_interval)
2202 (interval_deletion_adjustment, adjust_intervals_for_deletion)
2203 (static_offset_intervals, offset_intervals)
2204 (merge_interval_right, merge_interval_left, make_new_interval)
2205 (graft_intervals_into_buffer, temp_set_point_both)
2206 (temp_set_point, set_point, adjust_for_invis_intang)
2207 (set_point_both, move_if_not_intangible, get_property_and_range)
2208 (get_local_map, copy_intervals, copy_intervals_to_string)
2209 (compare_string_intervals, set_intervals_multibyte_1):
2210 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2211 * intervals.h: Adjust decls to match defn changes elsewhere.
2212 (struct interval):
2213 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2214 * keyboard.c (this_command_key_count, this_single_command_key_start)
2215 (before_command_key_count, before_command_echo_length, echo_now)
2216 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
2217 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
2218 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
2219 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
2220 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2221 (last_non_minibuf_size, last_point_position, echo_truncate)
2222 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
2223 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
2224 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
2225 (stuff_buffered_input):
2226 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2227 (last_auto_save, command_loop_1, read_char):
2228 Use EMACS_INT, not int, to avoid integer overflow.
2229 (record_char): Avoid overflow in total_keys computation.
2230 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
2231 * keyboard.h: Adjust decls to match defn changes elsewhere.
2232 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
2233 (Fkey_description, Fdescribe_vector, Flookup_key):
2234 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2235 (click_position): New function, to check that positions are in range.
2236 (Fcurrent_active_maps):
2237 (describe_command):
2238 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2239 (Faccessible_keymaps, Fkey_description):
2240 (preferred_sequence_p):
2241 Don't assume fixnum can fit into int.
2242 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
2243 Check for integer overflow in size calculations.
2244 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
2245 avoid mishandling large integers.
2246 * lisp.h: Adjust decls to match defn changes elsewhere.
2247 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
2248 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
2249 (struct Lisp_Marker):
2250 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2251 (clip_to_bounds): Now an inline function, moved here from editfns.c.
2252 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
2253 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
2254 All callers changed.
2255 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
2256 Assume the arg has valid form, since it always does.
2257 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
2258 unsigned integer system type.
2259 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
2260 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
2261 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2262 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
2263 (duration_to_sec_usec): New decl.
2264 * lread.c (read_from_string_index, read_from_string_index_byte)
2265 (read_from_string_limit, readchar, unreadchar, openp)
2266 (read_internal_start, read1, oblookup):
2267 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2268 (Fload, readevalloop, Feval_buffer, Feval_region):
2269 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2270 (openp): Check for out-of-range argument to 'access'.
2271 (read1): Use int, not EMACS_INT, where int is wide enough.
2272 Don't assume fixnum fits into int.
2273 Fix off-by-one error that can read outside a buffer.
2274 (read_filtered_event): Use duration_to_sec_usec
2275 to do proper overflow checking on durations.
2276 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
2277 in size calculation.
2278 (Fexecute_kbd_macro):
2279 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2280 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
2281 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
2282 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
2283 (set_marker_both, set_marker_restricted_both, marker_position)
2284 (marker_byte_position, Fbuffer_has_markers_at):
2285 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2286 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
2287 * menu.c (ensure_menu_items): Rename from grow_menu_items.
2288 It now merely ensures that the menu is large enough, without
2289 necessarily growing it, as this avoids some integer overflow issues.
2290 All callers changed.
2291 (keymap_panes, parse_single_submenu, Fx_popup_menu):
2292 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2293 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
2294 Use SAFE_ALLOCA_LISP, not alloca.
2295 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
2296 to EMACS_INT. Check that fixnums are in proper range for system types.
2297 * minibuf.c (minibuf_prompt_width, string_to_object)
2298 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
2299 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
2300 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2301 (get_minibuffer, read_minibuf_unwind):
2302 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2303 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
2304 this simplifies overflow checking. All callers changed.
2305 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
2306 (Ftest_completion):
2307 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2308 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
2309 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
2310 Check that fixnums are in proper range for system types.
2311 (Fx_create_frame, Fx_show_tip):
2312 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2313 * nsfont.m (ns_findfonts, nsfont_list_family):
2314 Don't assume fixnum fits in long.
2315 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
2316 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2317 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
2318 wide enough.
2319 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
2320 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2321 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
2322 (PRINTDECLARE, PRINTPREPARE):
2323 (strout, print_string):
2324 (print, print_preprocess, print_check_string_charset_prop)
2325 (print_object):
2326 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2327 (PRINTDECLARE):
2328 (temp_output_buffer_setup, Fprin1_to_string, print_object):
2329 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2330 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
2331 (printchar, strout): Use xpalloc to catch size calculation overflow.
2332 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
2333 (print_error_message): Use SAFE_ALLOCA, not alloca.
2334 (print_object): Use int, not EMACS_INT, where int is wide enough.
2335 (print_depth, new_backquote_output, print_number_index):
2336 Use ptrdiff_t, not int, where int might not be wide enough.
2337 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
2338 (Fset_process_window_size, Fformat_network_address)
2339 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
2340 (sigchld_handler):
2341 Check that fixnums are in proper range for system types.
2342 (Fsignal_process): Simplify by avoiding a goto.
2343 Check for process-ids out of pid_t range rather than relying on
2344 undefined behavior.
2345 (process_tick, update_tick): Use EMACS_INT, not int.
2346 (Fformat_network_address, read_process_output, send_process)
2347 (Fprocess_send_region, status_notify):
2348 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2349 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
2350 (wait_reading_process_output, read_process_output, exec_sentinel):
2351 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2352 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
2353 (Faccept_process_output): Use duration_to_sec_usec to do proper
2354 overflow checking on durations.
2355 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
2356 Don't assume pid_t fits in int.
2357 * process.h (struct Lisp_Process): Members tick and update_tick
2358 are now of type EMACS_INT, not int.
2359 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
2360 configured --with-wide-int.
2361 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
2362 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
2363 * search.c (looking_at_1, string_match_1):
2364 (fast_string_match, fast_c_string_match_ignore_case)
2365 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
2366 (scan_newline, find_before_next_newline, search_command)
2367 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
2368 (set_search_regs, wordify):
2369 (Freplace_match):
2370 (Fmatch_data):
2371 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2372 (string_match_1, search_buffer, set_search_regs):
2373 (Fmatch_data):
2374 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2375 (wordify): Check for overflow in size calculation.
2376 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
2377 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
2378 Check that fixnums are in proper range for system types.
2379 * sound.c (struct sound_device)
2380 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
2381 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2382 (Fplay_sound_internal):
2383 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2384 * syntax.c (struct lisp_parse_state, find_start_modiff)
2385 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
2386 (Fparse_partial_sexp):
2387 Don't assume fixnums can fit in int.
2388 (struct lisp_parse_state, find_start_pos, find_start_value)
2389 (find_start_value_byte, find_start_begv)
2390 (update_syntax_table, char_quoted, dec_bytepos)
2391 (find_defun_start, prev_char_comend_first, back_comment):
2392 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
2393 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
2394 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2395 (Finternal_describe_syntax_value): Check that match_lisp is a
2396 character, not an integer, since the code stuffs it into int.
2397 (scan_words, scan_sexps_forward):
2398 Check that fixnums are in proper range for system types.
2399 (Fforward_word):
2400 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2401 (scan_sexps_forward):
2402 Use CHARACTERP, not INTEGERP, since the value must fit into int.
2403 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
2404 * syntax.h: Adjust decls to match defn changes elsewhere.
2405 (struct gl_state_s):
2406 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2407 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
2408 MOST_POSITIVE_FIXNUM.
2409 * sysdep.c (wait_for_termination_1, wait_for_termination)
2410 (interruptible_wait_for_termination, mkdir):
2411 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
2412 (emacs_read, emacs_write):
2413 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2414 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
2415 and double all fit in int.
2416 * term.c (set_tty_color_mode):
2417 Check that fixnums are in proper range for system types.
2418 * termhooks.h (struct input_event):
2419 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2420 * textprop.c (validate_interval_range, interval_of)
2421 (Fadd_text_properties, set_text_properties_1)
2422 (Fremove_text_properties, Fremove_list_of_text_properties)
2423 (Ftext_property_any, Ftext_property_not_all)
2424 (copy_text_properties, text_property_list, extend_property_ranges)
2425 (verify_interval_modification):
2426 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2427 (Fnext_single_char_property_change)
2428 (Fprevious_single_char_property_change):
2429 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2430 (copy_text_properties):
2431 Check for integer overflow in index calculation.
2432 * undo.c (last_boundary_position, record_point, record_insert)
2433 (record_delete, record_marker_adjustment, record_change)
2434 (record_property_change):
2435 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2436 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
2437 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2438 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
2439 (Fx_hide_tip, Fx_file_dialog):
2440 * w32menu.c (set_frame_menubar):
2441 Use ptrdiff_t, not int, for consistency with rest of code.
2442 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
2443 (select_window, Fdelete_other_windows_internal)
2444 (window_scroll_pixel_based, window_scroll_line_based)
2445 (Frecenter, Fset_window_configuration):
2446 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2447 (Fset_window_hscroll, run_window_configuration_change_hook)
2448 (set_window_buffer, temp_output_buffer_show, scroll_command)
2449 (Fscroll_other_window, Frecenter):
2450 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2451 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
2452 Don't assume fixnum fits in int.
2453 (Fset_window_scroll_bars):
2454 Check that fixnums are in proper range for system types.
2455 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
2456 (string_pos, c_string_pos, number_of_chars, init_iterator)
2457 (in_ellipses_for_invisible_text_p, init_from_display_pos)
2458 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
2459 (compute_display_string_end, handle_face_prop)
2460 (face_before_or_after_it_pos, handle_invisible_prop)
2461 (handle_display_prop, handle_display_spec, handle_single_display_spec)
2462 (display_prop_intangible_p, string_buffer_position_lim)
2463 (string_buffer_position, handle_composition_prop, load_overlay_strings)
2464 (get_overlay_strings_1, get_overlay_strings)
2465 (iterate_out_of_display_property, forward_to_next_line_start)
2466 (back_to_previous_visible_line_start, reseat, reseat_to_string)
2467 (get_next_display_element, set_iterator_to_next)
2468 (get_visually_first_element, compute_stop_pos_backwards)
2469 (handle_stop_backwards, next_element_from_buffer)
2470 (move_it_in_display_line_to, move_it_in_display_line)
2471 (move_it_to, move_it_vertically_backward, move_it_by_lines)
2472 (add_to_log, message_dolog, message_log_check_duplicate)
2473 (message2, message2_nolog, message3, message3_nolog
2474 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
2475 (current_message_1, truncate_echo_area, truncate_message_1)
2476 (set_message, set_message_1, store_mode_line_noprop)
2477 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
2478 (text_outside_line_unchanged_p, check_point_in_composition)
2479 (reconsider_clip_changes)
2480 (redisplay_internal, set_cursor_from_row, try_scrolling)
2481 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
2482 (redisplay_window, find_last_unchanged_at_beg_row)
2483 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
2484 (trailing_whitespace_p, find_row_edges, display_line)
2485 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
2486 (display_mode_element, store_mode_line_string)
2487 (pint2str, pint2hrstr, decode_mode_spec)
2488 (display_count_lines, display_string, draw_glyphs)
2489 (x_produce_glyphs, x_insert_glyphs)
2490 (rows_from_pos_range, mouse_face_from_buffer_pos)
2491 (fast_find_string_pos, mouse_face_from_string_pos)
2492 (note_mode_line_or_margin_highlight, note_mouse_highlight):
2493 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2494 (safe_call, init_from_display_pos, handle_fontified_prop)
2495 (handle_single_display_spec, load_overlay_strings)
2496 (with_echo_area_buffer, setup_echo_area_for_printing)
2497 (display_echo_area, echo_area_display)
2498 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
2499 (update_tool_bar, hscroll_window_tree, redisplay_internal)
2500 (redisplay_window, dump_glyph_row, display_mode_line)
2501 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
2502 (handle_display_spec, display_prop_string_p):
2503 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2504 (handle_single_display_spec, build_desired_tool_bar_string)
2505 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
2506 (get_specified_cursor_type):
2507 Check that fixnums are in proper range for system types.
2508 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
2509 (Flookup_image_map):
2510 Don't assume fixnums fit in int.
2511 (compare_overlay_entries):
2512 Avoid mishandling comparisons due to subtraction overflow.
2513 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
2514 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
2515 (handle_tool_bar_click):
2516 Use int, not unsigned, since we prefer signed and the signedness
2517 doesn't matter here.
2518 (get_next_display_element, next_element_from_display_vector):
2519 Use int, not EMACS_INT, when int is wide enough.
2520 (start_hourglass): Use duration_to_sec_usec to do proper
2521 overflow checking on durations.
2522 * xfaces.c (Fbitmap_spec_p):
2523 Check that fixnums are in proper range for system types.
2524 (compare_fonts_by_sort_order):
2525 Avoid mishandling comparisons due to subtraction overflow.
2526 (Fx_family_fonts, realize_basic_faces):
2527 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2528 (Fx_family_fonts):
2529 Don't assume fixnum fits in int.
2530 Use SAFE_ALLOCA_LISP, not alloca.
2531 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
2532 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
2533 (face_at_buffer_position, face_for_overlay_string)
2534 (face_at_string_position):
2535 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2536 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
2537 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
2538 (Fx_show_tip):
2539 Check that fixnums are in proper range for system types.
2540 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
2541 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
2542 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2543 (Fx_change_window_property): Don't assume fixnums fit in int.
2544 * xfont.c (xfont_chars_supported):
2545 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2546 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
2547 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
2548 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2549 * xml.c (parse_region):
2550 * xrdb.c (magic_file_p):
2551 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2552 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
2553 (x_get_local_selection, x_reply_selection_request)
2554 (x_handle_selection_request, wait_for_property_change):
2555 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2556 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
2557 short is wide enough.
2558 (x_send_client_event): Don't assume fixnum fits in int.
2559 * xterm.c (x_x_to_emacs_modifiers):
2560 Don't assume EMACS_INT overflows nicely into int.
2561 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
2562 may come from Lisp.
2563 (handle_one_xevent): NATNUMP can eval its arg twice.
2564 (x_connection_closed):
2565 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2566 * xterm.h: Adjust decls to match defn changes elsewhere.
2567 (struct scroll_bar): Use struct vectorlike_header
2568 rather than rolling our own approximation.
2569 (SCROLL_BAR_VEC_SIZE): Remove; not used.
2570
2571 2012-05-25 Glenn Morris <rgm@gnu.org>
2572
2573 * lisp.mk (lisp): Update for more files being compiled now.
2574
2575 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
2576
2577 * lread.c: Remove `read_pure' which makes no difference.
2578 (read_pure): Remove var.
2579 (unreadpure): Remove function.
2580 (readevalloop): Don't call read_list with -1 flag.
2581 (read1, read_vector): Don't test read_pure any more.
2582 (read_list): Simplify.
2583
2584 * fileio.c, character.h: Minor style tweaks.
2585
2586 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
2587
2588 * window.h (clip_changed): Remove useless declaration.
2589
2590 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
2591
2592 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
2593 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
2594
2595 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
2596
2597 Remove src/m/*.
2598 This directory predates autoconf and is no longer needed nowadays.
2599 Move its few remaining bits of functionality to where they're needed.
2600 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
2601 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
2602 * m/template.h: Remove.
2603 * Makefile.in (M_FILE): Remove. All uses removed.
2604 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
2605 * lisp.h (USE_LSB_TAG):
2606 * mem-limits.h (EXCEEDS_LISP_PTR):
2607 Use VAL_MAX, not VALBITS, in #if.
2608 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
2609 (EMACS_UINT): Define unconditionally now.
2610 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
2611 (BITS_PER_EMACS_INT): New constants, replacing
2612 what used to be in config.h, but not useful in #if.
2613 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
2614 define them any more.
2615 (VAL_MAX): New macro.
2616 (VALMASK): Use it.
2617 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
2618 BITS_PER_EMACS_INT, in #if.
2619 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
2620 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
2621 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
2622 * s/ms-w32.h (DATA_START):
2623 Move here from removed file m/intel386.h.
2624 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
2625 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
2626
2627 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
2628
2629 Assume C89 or later.
2630 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
2631 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
2632 (xrealloc):
2633 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
2634 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
2635 * textprop.c, tparam.c (NULL): Remove.
2636 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
2637 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
2638 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
2639 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
2640 * xterm.c (input_signal_count): Assume volatile works.
2641
2642 2012-05-21 Ken Brown <kbrown@cornell.edu>
2643
2644 * xgselect.c (xg_select): Fix first argument in call to 'select'
2645 (bug#11508).
2646
2647 2012-05-20 Ken Brown <kbrown@cornell.edu>
2648
2649 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
2650 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
2651
2652 2012-05-19 Ken Brown <kbrown@cornell.edu>
2653
2654 * xfns.c (x_in_use): Remove `static' qualifier.
2655 * xterm.h (x_in_use): Declare.
2656 * xgselect.c: Include xterm.h.
2657 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
2658 and `display_arg' (bug#9754).
2659
2660 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
2661
2662 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
2663
2664 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
2665 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
2666
2667 2012-05-18 Eli Zaretskii <eliz@gnu.org>
2668
2669 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
2670
2671 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
2672 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c
2673
2674 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
2675 reference to image_cache->refcount.
2676 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
2677
2678 2012-05-17 Juri Linkov <juri@jurta.org>
2679
2680 * search.c (Fword_search_regexp, Fword_search_backward)
2681 (Fword_search_forward, Fword_search_backward_lax)
2682 (Fword_search_forward_lax): Move functions to isearch.el
2683 (bug#10145, bug#11381).
2684
2685 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
2686
2687 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
2688
2689 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
2690
2691 * lread.c (init_obarray): Declare Qt and Qnil as special.
2692
2693 2012-05-14 Glenn Morris <rgm@gnu.org>
2694
2695 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
2696 Put "libexec" before "bin", for the sake of init_callproc_1.
2697
2698 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
2699
2700 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
2701
2702 * unexaix.c: Port to more-recent AIX compilers.
2703 (report_error, report_error_1, make_hdr, copy_sym)
2704 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
2705 Make arguments const char *, not char *, to avoid violations of C
2706 standard and to fix some AIX warnings reported by Gilles Pion.
2707
2708 2012-05-14 Eli Zaretskii <eliz@gnu.org>
2709
2710 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
2711 already have overlays loaded.
2712 (handle_single_display_spec): Before returning without displaying
2713 fringe bitmap, synchronize the bidi iterator with the main display
2714 iterator, by calling iterate_out_of_display_property.
2715 (iterate_out_of_display_property): Detect buffer iteration by
2716 testing that it->string is a Lisp string.
2717 (get_next_display_element): When the current object is exhausted,
2718 and there's something on it->stack, call set_iterator_to_next to
2719 proceed with what's on the stack, instead of returning zero.
2720 (set_iterator_to_next): If called at the end of a Lisp string,
2721 proceed to consider_string_end without incrementing string
2722 position. Don't increment display vector index past the end of
2723 the display vector. (Bug#11417)
2724 (pos_visible_p): Don't report a position visible when move_it_to
2725 stopped at the last line of window, which happens to be scanned
2726 backwards by the bidi iteration. (Bug#11464)
2727
2728 2012-05-14 Eli Zaretskii <eliz@gnu.org>
2729
2730 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
2731 and right-margin display specs even if the spec is invalid or we
2732 are on a TTY, and thus unable to display on the fringes.
2733 That's because the text with the property will not be displayed anyway,
2734 so we need to signal to the caller that this is a "replacing"
2735 display spec. This fixes display when the spec is invalid or we
2736 are on a TTY.
2737
2738 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
2739
2740 * unexaix.c (make_hdr): Fix typo in prototype.
2741 This bug broke the build on AIX. Problem reported by Gilles Pion.
2742
2743 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
2744
2745 * keyboard.c (kbd_buffer_get_event): Read special events also in
2746 batch mode. (Bug#11415)
2747
2748 2012-05-12 Glenn Morris <rgm@gnu.org>
2749
2750 * ns.mk: Update for ns_appbindir no longer having trailing "/".
2751
2752 2012-05-12 Eli Zaretskii <eliz@gnu.org>
2753
2754 * lisp.mk (lisp): Add newcomment.elc.
2755
2756 2012-05-12 Glenn Morris <rgm@gnu.org>
2757
2758 * Makefile.in (MKDIR_P): New, set by configure.
2759 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
2760
2761 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
2762
2763 Remove unused function hourglass_started.
2764 * dispextern.h (hourglass_started):
2765 * w32fns.c (hourglass_started):
2766 * xdisp.c (hourglass_started): Remove.
2767
2768 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
2769
2770 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
2771 Update dependencies.
2772
2773 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
2774
2775 * xgselect.c (xg_select): Put maxfds+1 into a var.
2776 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
2777
2778 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
2779
2780 2012-05-10 Dave Abrahams <dave@boostpro.com>
2781
2782 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
2783 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
2784
2785 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
2786
2787 * dbusbind.c (xd_registered_buses): New internal Lisp object.
2788 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
2789 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
2790 Initialize xd_registered_buses.
2791
2792 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
2793
2794 Untag more efficiently if USE_LSB_TAG.
2795 This is based on a proposal by YAMAMOTO Mitsuharu in
2796 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
2797 For an admittedly artificial (nth 8000 longlist) benchmark on
2798 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
2799 Emacs's overall text size by 1%.
2800 * lisp.h (XUNTAG): New macro.
2801 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
2802 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
2803 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
2804 * eval.c (Fautoload):
2805 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
2806 * frame.h (XFRAME): Use XUNTAG.
2807
2808 Port recent dbusbind.c changes to 32-bit --with-wide-int.
2809 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
2810 Remove unportable assumptions about print widths of types like
2811 dbus_uint32_t.
2812 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
2813 intptr_t when converting between pointer and integer, to avoid GCC
2814 warnings about wrong width.
2815
2816 2012-05-09 Eli Zaretskii <eliz@gnu.org>
2817
2818 * w32proc.c (new_child): Force Windows to reserve only 64KB of
2819 stack for each reader_thread, instead of defaulting to 8MB
2820 determined by the linker. This avoids failures in creating
2821 subprocesses on Windows 7, see the discussion in this thread:
2822 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
2823
2824 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
2825
2826 Fix up display of the *Minibuf-0* buffer in the mini window.
2827 * keyboard.c (read_char): Don't clear the echo area if there's no
2828 message to clear.
2829 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2830 contents of *Minibuf-0*) if there's no message displayed in its stead.
2831
2832 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
2833
2834 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
2835 batch mode.
2836
2837 2012-05-06 Chong Yidong <cyd@gnu.org>
2838
2839 * lisp.mk (lisp): Update.
2840
2841 2012-05-05 Jim Meyering <meyering@redhat.com>
2842
2843 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
2844
2845 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
2846
2847 * data.c (PUT_ERROR): New macro.
2848 (syms_of_data): Use it. Add new error type `user-error'.
2849 * undo.c (user_error): New function.
2850 (Fprimitive_undo): Use it.
2851 * print.c (print_error_message): Adjust print style for `user-error'.
2852 * keyboard.c (user_error): New function.
2853 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
2854
2855 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
2856
2857 Do not limit current-time-string to years 1000..9999.
2858 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
2859 (Fcurrent_time_string): Support any year that is supported by the
2860 underlying localtime representation. Don't use asctime, as it
2861 has undefined behavior for years outside the range -999..9999.
2862
2863 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
2864
2865 Fix race conditions involving setenv, gmtime, localtime, asctime.
2866 Without this fix, interrupts could mess up code that uses these
2867 nonreentrant functions, since setting TZ invalidates existing
2868 tm_zone or tzname values, and since most of these functions return
2869 pointers to static storage.
2870 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
2871 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
2872 Grow the critical sections to include not just invoking
2873 localtime/gmtime, but also accessing these functions' results
2874 including their tm_zone values if any, and any related TZ setting.
2875 (format_time_string): Last arg is now struct tm *, not struct tm **,
2876 so that the struct tm is saved in the critical section.
2877 All callers changed. Simplify allocation of initial buffer, partly
2878 motivated by the fact that memory allocation needs to be outside
2879 the critical section.
2880
2881 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
2882
2883 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
2884 with RESET_INTERVAL.
2885
2886 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
2887 Remove duplicated buffer name initialization.
2888
2889 2012-05-02 Jim Meyering <jim@meyering.net>
2890
2891 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
2892
2893 * xfns.c (x_window): Use xstrdup (Bug#11375).
2894
2895 2012-05-02 Eli Zaretskii <eliz@gnu.org>
2896
2897 * xdisp.c (pos_visible_p): If already at a newline from the
2898 display string before the 'while' loop, don't walk back the glyphs
2899 from it3.glyph_row. Solves assertion violation when the display
2900 string begins with a newline (egg.el). (Bug#11367)
2901
2902 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
2903
2904 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
2905 Move to simple.el.
2906
2907 2012-05-01 Glenn Morris <rgm@gnu.org>
2908
2909 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
2910 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
2911 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
2912 All were removed before 23.1.
2913
2914 * dispnew.c: Remove HAVE_LIBNCURSES test;
2915 it is always true on relevant platforms.
2916
2917 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
2918 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
2919
2920 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
2921
2922 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
2923
2924 * .gdbinit (xpr): Remove checks for no longer existing misc types.
2925 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
2926 Remove.
2927
2928 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
2929
2930 Do not avoid creating empty evaporating overlays (Bug#9642).
2931 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
2932 That is, do not delete an evaporating overlay if it becomes
2933 empty after its bounds are adjusted to fit within its buffer.
2934 This fix caused other problems, and I'm reverting it until we get
2935 to the bottom of them.
2936
2937 2012-04-27 Chong Yidong <cyd@gnu.org>
2938
2939 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
2940
2941 2012-04-27 Eli Zaretskii <eliz@gnu.org>
2942
2943 * xdisp.c (pos_visible_p): If the window start position is beyond
2944 ZV, start the display from buffer beginning. Prevents assertion
2945 violation in init_iterator when the minibuffer window is scrolled
2946 via the scroll bar.
2947
2948 * window.c (window_scroll_pixel_based): Likewise.
2949
2950 2012-04-27 Chong Yidong <cyd@gnu.org>
2951
2952 * keymap.c (where_is_internal): Doc fix (Bug#10872).
2953
2954 2012-04-27 Glenn Morris <rgm@gnu.org>
2955
2956 * fileio.c (Fcopy_file, Fset_file_selinux_context):
2957 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
2958
2959 2012-04-27 Eli Zaretskii <eliz@gnu.org>
2960
2961 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
2962 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
2963
2964 2012-04-26 Eli Zaretskii <eliz@gnu.org>
2965
2966 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
2967 display element, check also the underlying string or buffer
2968 character. (Bug#11341)
2969
2970 * w32menu.c: Include w32heap.h.
2971 (add_menu_item): If the call to AppendMenuW (via
2972 unicode_append_menu) fails, disable Unicode menus only if we are
2973 running on Windows 9X/Me.
2974
2975 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
2976
2977 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
2978 (xgetint): Add missing shift for LSB tags.
2979
2980 2012-04-24 Martin Rudalics <rudalics@gmx.at>
2981
2982 * keyboard.c (read_char): Don't wipe echo area for select window
2983 events: These might get delayed via `mouse-autoselect-window'
2984 (Bug#11304).
2985
2986 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
2987
2988 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
2989 manipulation of :loaded-from data.
2990
2991 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
2992
2993 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
2994 now a cons (bug#11311).
2995
2996 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
2997
2998 Do not create empty overlays with the evaporate property (Bug#9642).
2999 * buffer.c (Fmove_overlay): Delete an evaporating overlay
3000 if it becomes empty after its bounds are adjusted to fit within
3001 its buffer. Without this fix, in a nonempty buffer (let ((o
3002 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
3003 yields an empty overlay that has the evaporate property, which is
3004 not supposed to happen.
3005
3006 Fix minor GTK3 problems found by static checking.
3007 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
3008 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
3009 (struct _EmacsFixedClass, emacs_fixed_get_type):
3010 Move decls here from emacsgtkfixed.h, since they needn't be public.
3011 (emacs_fixed_get_type): Now static.
3012 (emacs_fixed_class_init): Omit unused local.
3013 (emacs_fixed_child_type): Remove; unused.
3014 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
3015 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
3016 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
3017 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
3018 (EMACS_FIXED_GET_CLASS): Remove; unused.
3019 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
3020
3021 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
3022 Problem reported by Juanma Barranquero for Windows -Wunused-function.
3023
3024 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
3025
3026 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
3027 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
3028 (__malloc_size_t, __malloc_ptrdiff_t):
3029 Remove. All uses removed, replaced by the definiens if needed,
3030 since we can assume C89 or better now.
3031 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
3032 (protect_malloc_state, align, get_contiguous_space)
3033 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
3034 (malloc_atfork_handler_child, malloc_enable_thread)
3035 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
3036 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
3037 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
3038 (special_realloc, _realloc_internal_nolock, _realloc_internal)
3039 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
3040 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
3041 Define using prototypes, not old style.
3042 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
3043 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
3044 (align): Don't assume that signed integer overflow wraps around.
3045 Omit unused local var.
3046 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
3047 (_free_internal_nolock, memalign, mallochook, reallochook):
3048 Omit no-longer-needed casts.
3049 (valloc): Use getpagesize, not __getpagesize.
3050 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
3051 (struct hdr): The 'magic' member is now size_t, not unsigned long.
3052
3053 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
3054
3055 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
3056
3057 Move functions from C to Lisp. Make non-blocking method calls
3058 the default. Implement further D-Bus standard interfaces.
3059
3060 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
3061 (QCdbus_request_name_allow_replacement)
3062 (QCdbus_request_name_replace_existing)
3063 (QCdbus_request_name_do_not_queue)
3064 (QCdbus_request_name_reply_primary_owner)
3065 (QCdbus_request_name_reply_in_queue)
3066 (QCdbus_request_name_reply_exists)
3067 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
3068 (QCdbus_registered_serial, QCdbus_registered_method)
3069 (QCdbus_registered_signal): New Lisp objects.
3070 (XD_DEBUG_MESSAGE): Use sizeof.
3071 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
3072 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
3073 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
3074 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
3075 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
3076 (xd_signature, xd_append_arg): Allow float for integer types.
3077 (xd_get_connection_references): New function.
3078 (xd_get_connection_address): Rename from xd_initialize.
3079 Return cached address.
3080 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
3081 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
3082 level.
3083 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
3084 Return number of refcounts.
3085 (Fdbus_get_unique_name): Make stronger parameter check.
3086 (Fdbus_message_internal): New defun.
3087 (Fdbus_call_method, Fdbus_call_method_asynchronously)
3088 (Fdbus_method_return_internal, Fdbus_method_error_internal)
3089 (Fdbus_send_signal, Fdbus_register_service)
3090 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
3091 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
3092 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
3093 (Vdbus_compiled_version, Vdbus_runtime_version)
3094 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
3095 (Vdbus_message_type_method_return, Vdbus_message_type_error)
3096 (Vdbus_message_type_signal): New defvars.
3097 (Vdbus_registered_buses, Vdbus_registered_objects_table):
3098 Adapt docstring.
3099
3100 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
3101
3102 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
3103 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
3104 Do not assume ptrdiff_t is the same width as 'int'.
3105
3106 * alloc.c: Handle unusual debugging option combinations.
3107 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
3108 since the two debugging options are incompatible.
3109 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
3110 is defined.
3111 (mem_init, mem_insert, mem_insert_fixup):
3112 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
3113 (NEED_MEM_INSERT): Remove; no longer needed.
3114
3115 2012-04-22 Leo Liu <sdl.web@gmail.com>
3116
3117 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
3118
3119 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
3120
3121 * sysdep.c [__FreeBSD__]: Minor cleanups.
3122 (list_system_processes, system_process_attributes) [__FreeBSD__]:
3123 Use Emacs indenting style more consistently. Avoid some casts.
3124 Use 'double' consistently rather than mixing 'float' and 'double'.
3125
3126 2012-04-21 Eduard Wiebe <usenet@pusto.de>
3127
3128 * sysdep.c (list_system_processes, system_process_attributes):
3129 Add implementation for FreeBSD (Bug#5243).
3130
3131 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
3132
3133 * lisp.mk (lisp): Update.
3134
3135 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
3136
3137 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
3138 It is never used otherwise.
3139
3140 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
3141
3142 * print.c (print_preprocess): Only check print_depth if print-circle
3143 is nil.
3144 (print_object): Check for cycles even when print-circle is nil and
3145 print-gensym is t, but only check print_depth if print-circle is nil.
3146
3147 2012-04-20 Chong Yidong <cyd@gnu.org>
3148
3149 * process.c (wait_reading_process_output): If EIO occurs on a pty,
3150 set the status to "failed" and ensure that sentinel is run.
3151
3152 2012-04-20 Glenn Morris <rgm@gnu.org>
3153
3154 * process.c (Fset_process_inherit_coding_system_flag)
3155 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
3156 (Fmake_network_process, Fmake_serial_process): Doc fix.
3157
3158 2012-04-20 Eli Zaretskii <eliz@gnu.org>
3159
3160 * xdisp.c (string_buffer_position_lim): Limit starting position to
3161 BEGV.
3162 (set_cursor_from_row): If called for a mode-line or header-line
3163 row, return zero immediately.
3164 (try_cursor_movement): If inside continuation line, don't back up
3165 farther than the first row after the header line, if any.
3166 Don't consider the header-line row as "partially visible", even if
3167 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
3168
3169 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
3170
3171 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
3172 (bug#11238).
3173
3174 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
3175 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
3176
3177 configure: new option --enable-gcc-warnings (Bug#11207)
3178 * Makefile.in (C_WARNINGS_SWITCH): Remove.
3179 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
3180 (ALL_CFLAGS): Use new macros rather than old.
3181 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
3182 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
3183 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
3184 -Wunused-result, -Wunused-variable. This should go away once
3185 the Emacs and Gnulib regex code is merged.
3186 (xmalloc, xrealloc): Now static.
3187
3188 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
3189
3190 * dired.c (Fsystem_groups): Remove unused local.
3191
3192 2012-04-17 Glenn Morris <rgm@gnu.org>
3193
3194 * dired.c (Fsystem_users): Doc fix.
3195
3196 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
3197
3198 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
3199 (syms_of_dired): Add them.
3200
3201 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
3202
3203 Fix minor alloc.c problems found by static checking.
3204 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
3205 New extern decls, to avoid calling undeclared functions.
3206 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
3207 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
3208 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
3209 (NEED_MEM_INSERT): New macro.
3210 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
3211 Remove one incorrect comment and fix another.
3212
3213 Fix minor ralloc.c problems found by static checking.
3214 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
3215 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
3216 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
3217 (r_alloc_sbrk): Now static.
3218
3219 Improve ralloc.c interface checking.
3220 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
3221 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
3222 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
3223 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
3224 [REL_ALLOC]: ... to here, to check interface.
3225 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
3226 Remove decls. This fixes an "It stinks!".
3227
3228 * alloc.c (which_symbols): Fix alignment issue / type clash.
3229
3230 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
3231
3232 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
3233 (struct Lisp_Misc_Any): Likewise.
3234 (struct Lisp_Free): Likewise.
3235 * alloc.c (union aligned_Lisp_Symbol): Define.
3236 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
3237 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
3238 (union aligned_Lisp_Misc): Define.
3239 (MARKER_BLOCK_SIZE, struct marker_block): Use union
3240 aligned_Lisp_Misc instead of union Lisp_Misc.
3241 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
3242
3243 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
3244
3245 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
3246 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
3247 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
3248 * s/netbsd.h, s/sol2-6.h:
3249 Remove definition of GC_MARK_STACK, since the default now works.
3250 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
3251 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
3252 no longer the default.
3253 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
3254
3255 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
3256
3257 * lread.c (lisp_file_lexically_bound_p):
3258 Fix hang at ";-*-\n" (bug#11238).
3259
3260 2012-04-14 Eli Zaretskii <eliz@gnu.org>
3261
3262 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
3263 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
3264
3265 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
3266
3267 * nsterm.m (constrainFrameRect): Always constrain when there is only
3268 one screen (Bug#10962).
3269
3270 2012-04-13 Ken Brown <kbrown@cornell.edu>
3271
3272 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
3273
3274 2012-04-13 Reuben Thomas <rrt@sc3d.org>
3275
3276 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
3277
3278 2012-04-11 Daniel Colascione <dancol@dancol.org>
3279
3280 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
3281 against is gone. It's better to use vfork now so that when Cygwin
3282 gains a new, working vfork, we use it automatically (bug#10398).
3283
3284 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
3285
3286 * window.c (save_window_save): Obey window-point-insertion-type.
3287
3288 2012-04-11 Glenn Morris <rgm@gnu.org>
3289
3290 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
3291
3292 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
3293
3294 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
3295
3296 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
3297
3298 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
3299 (force_quit_count): New var.
3300 (handle_interrupt): Use it.
3301
3302 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
3303
3304 * w32.c (w32_delayed_load): Record the full path of the library
3305 being loaded (bug#10424).
3306
3307 2012-04-09 Glenn Morris <rgm@gnu.org>
3308
3309 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
3310 not just in the obarray, before snarfing them. (Bug#11036)
3311
3312 * Makefile.in ($(leimdir)/leim-list.el):
3313 Pass EMACS rather than BUILT_EMACS.
3314
3315 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
3316
3317 * process.c (make_process):
3318 * process.h: Add integer `gnutls_handshakes_tried' member to
3319 process struct.
3320
3321 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
3322 Add convenience `GNUTLS_LOG2i' macro.
3323
3324 * gnutls.c (gnutls_log_function2i): Convenience log function.
3325 (emacs_gnutls_read): Use new log functions,
3326 `gnutls_handshakes_tried' process member, and
3327 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
3328 attempts per process (connection).
3329
3330 2012-04-09 Chong Yidong <cyd@gnu.org>
3331
3332 * eval.c (Fuser_variable_p, user_variable_p_eh)
3333 (lisp_indirect_variable): Functions deleted.
3334 (Fdefvar): Caller changed.
3335
3336 * callint.c (Finteractive, Fcall_interactively):
3337 * minibuf.c (Fread_variable): Callers changed.
3338
3339 2012-04-09 Eli Zaretskii <eliz@gnu.org>
3340
3341 * xdisp.c (set_cursor_from_row): If the display string appears in
3342 the buffer at position that is closer to point than the position
3343 after the display string, display the cursor on the first glyph of
3344 the display string. Fixes cursor display when a 'display' text
3345 property immediately follows invisible text. (Bug#11094)
3346
3347 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
3348
3349 composite.c: use 'double' consistently
3350 * composite.c (get_composition_id): Use 'double' consistently
3351 instead of converting 'float' to 'double' and vice versa; this is
3352 easier to understand and avoids a GCC warning.
3353
3354 2012-04-09 Glenn Morris <rgm@gnu.org>
3355
3356 * Makefile.in: Generate leim-list with bootstrap-emacs, in
3357 preparation for dumping it with emacs. (Bug#4789)
3358 (leimdir): New variable.
3359 ($(leimdir)/leim-list.el): New rule.
3360 (emacs$(EXEEXT)): Depend on leim-list.el.
3361
3362 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
3363 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
3364 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
3365
3366 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
3367
3368 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
3369 proper alignment.
3370
3371 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
3372
3373 * xml.c (init_libxml2_functions) [WINDOWSNT]:
3374 Remove unused local variable.
3375
3376 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
3377
3378 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
3379 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
3380 (mark_memory): Mark Lisp_Objects only if pointers might hide in
3381 objects, as mark_maybe_pointer will catch them otherwise.
3382 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
3383 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
3384
3385 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
3386
3387 Fix typo that broke non-Windows builds.
3388 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
3389
3390 2012-04-07 Eli Zaretskii <eliz@gnu.org>
3391
3392 Support building on MS-Windows with libxml2.
3393
3394 * makefile.w32-in (OBJ2): Add xml.$(O).
3395 (GLOBAL_SOURCES): Add xml.c.
3396 ($(BLD)/xml.$(O)): New dependency list.
3397
3398 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
3399 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
3400 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
3401 [!WINDOWSNT]: New macros.
3402 (init_libxml2_functions, libxml2_loaded_p): New functions.
3403 (parse_region): Call fn_xmlCheckVersion instead of using the macro
3404 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
3405 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
3406 Calls xmlCleanupParser only if libxml2 was loaded (or statically
3407 linked in).
3408 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
3409 Call init_libxml2_functions before calling libxml2 functions.
3410 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
3411
3412 * emacs.c: Don't include libxml/parser.h.
3413 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
3414 xmlCleanupParser directly.
3415
3416 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
3417
3418 2012-04-07 Eli Zaretskii <eliz@gnu.org>
3419
3420 * indent.c (Fvertical_motion): If there is a display string at
3421 point, use it.vpos to compute how many lines to backtrack after
3422 move_it_to point. (Bug#11133)
3423
3424 2012-04-06 Eli Zaretskii <eliz@gnu.org>
3425
3426 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
3427 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
3428 about subtle differences between FETCH_CHAR* and STRING_CHAR*
3429 macros related to unification of CJK characters. For the details,
3430 see the discussion following the message here:
3431 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
3432
3433 2012-04-04 Chong Yidong <cyd@gnu.org>
3434
3435 * keyboard.c (Vdelayed_warnings_list): Doc fix.
3436
3437 2012-04-01 Eli Zaretskii <eliz@gnu.org>
3438
3439 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
3440 instead of alloca. (Bug#11138)
3441
3442 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
3443
3444 * w32menu.c (is_simple_dialog): Properly check lisp types.
3445 (Bug#11141)
3446
3447 2012-03-31 Eli Zaretskii <eliz@gnu.org>
3448
3449 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
3450 position we get to after a call to move_it_to fails the
3451 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
3452 only if we wind up in a string from display property. (Bug#11063)
3453
3454 * window.c (Fdelete_other_windows_internal): Invalidate the row
3455 and column information about mouse highlight, so that redisplay
3456 restores it after reallocating the glyph matrices. (Bug#7464)
3457
3458 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
3459 string comes from a `display' text property, use the buffer
3460 position of that property as if we actually saw that position in
3461 the row's glyphs.
3462 (move_it_by_lines): Remove the assertion that
3463 "it->current_x == 0 && it->hpos == 0" which can be legitimately
3464 violated when there's a before-string at the beginning of a line.
3465 (Bug#11063)
3466
3467 2012-03-30 Eli Zaretskii <eliz@gnu.org>
3468
3469 * xdisp.c (append_space_for_newline): If the default face was
3470 remapped, use the remapped face for the appended newline.
3471 (extend_face_to_end_of_line): Use the remapped default face for
3472 extending the face to the end of the line.
3473 (display_line): Call extend_face_to_end_of_line when the default
3474 face was remapped. (Bug#11068)
3475
3476 2012-03-29 Eli Zaretskii <eliz@gnu.org>
3477
3478 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
3479
3480 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
3481
3482 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
3483
3484 2012-03-27 Glenn Morris <rgm@gnu.org>
3485
3486 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
3487 Doc fixes.
3488
3489 2012-03-26 Kenichi Handa <handa@m17n.org>
3490
3491 * dispextern.h (struct glyph): Fix previous change. Change the
3492 bit length of glyphless.ch to 25 (Bug#11082).
3493
3494 2012-03-26 Chong Yidong <cyd@gnu.org>
3495
3496 * keyboard.c (Vselection_inhibit_update_commands): New variable.
3497 (command_loop_1): Use it; inhibit selection update for
3498 handle-select-window too (Bug#8996).
3499
3500 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
3501
3502 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
3503
3504 2012-03-25 Kenichi Handa <handa@m17n.org>
3505
3506 * dispextern.h (struct glyph): Change the bit length of
3507 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
3508
3509 2012-03-24 Eli Zaretskii <eliz@gnu.org>
3510
3511 * s/ms-w32.h (tzname): Include time.h before redirecting to
3512 _tzname. Fixes the MSVC build. (Bug#9960)
3513
3514 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
3515
3516 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
3517 characters.
3518
3519 * xterm.c (XTread_socket): Only modify handling_signal if
3520 !SYNC_INPUT. (Bug#11080)
3521
3522 2012-03-23 Eli Zaretskii <eliz@gnu.org>
3523
3524 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
3525 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
3526 when fetching a multibyte character consumes more bytes than
3527 CHAR_BYTES returns, due to unification of CJK characters in
3528 string_char. (Bug#11073)
3529
3530 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
3531
3532 * process.c (wait_reading_process_output): Handle pty disconnect
3533 by refraining from sending oneself a SIGCHLD (bug#10933).
3534
3535 2012-03-22 Chong Yidong <cyd@gnu.org>
3536
3537 * dispextern.h (struct it): New member string_from_prefix_prop_p.
3538
3539 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
3540 Mark string as coming from a prefix property.
3541 (handle_face_prop): Use default face for prefix strings (Bug#4281).
3542 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
3543
3544 2012-03-21 Chong Yidong <cyd@gnu.org>
3545
3546 * xfaces.c (Vface_remapping_alist): Doc fix.
3547
3548 2012-03-20 Eli Zaretskii <eliz@gnu.org>
3549
3550 * w32proc.c (Fw32_set_console_codepage)
3551 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
3552 Doc fixes.
3553
3554 2012-03-20 Chong Yidong <cyd@gnu.org>
3555
3556 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
3557 to reflect default non-nil value of redisplay-dont-pause.
3558
3559 2012-03-19 Kenichi Handa <handa@m17n.org>
3560
3561 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
3562 it fit in a valid range (Bug#11003).
3563
3564 2012-03-18 Eli Zaretskii <eliz@gnu.org>
3565
3566 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
3567 that is not from display property, accept the row as a "cursor
3568 row" if one of the string's character has a non-nil `cursor'
3569 property. Fixes cursor positioning when there are newlines in
3570 overlay strings, e.g. in icomplete.el. (Bug#11035)
3571
3572 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
3573
3574 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
3575
3576 2012-03-12 Chong Yidong <cyd@gnu.org>
3577
3578 * eval.c (inhibit_lisp_code): Rename from
3579 inhibit_window_configuration_change_hook; move from window.c.
3580
3581 * xfns.c (unwind_create_frame_1, Fx_create_frame):
3582 * window.c (run_window_configuration_change_hook)
3583 (syms_of_window): Callers changed.
3584
3585 2012-03-11 Chong Yidong <cyd@gnu.org>
3586
3587 * keymap.c (Fkey_description): Doc fix (Bug#9700).
3588
3589 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
3590
3591 2012-03-10 Chong Yidong <cyd@gnu.org>
3592
3593 * frame.c (other_visible_frames): Don't assume the selected frame
3594 is visible (Bug#10955).
3595
3596 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
3597
3598 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
3599
3600 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
3601
3602 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
3603 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
3604 zero (Bug#10954).
3605
3606 2012-03-03 Glenn Morris <rgm@gnu.org>
3607
3608 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
3609
3610 2012-03-02 Eli Zaretskii <eliz@gnu.org>
3611
3612 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
3613 position past the first glyph_row that ends at ZV. (Bug#10902)
3614 (redisplay_window, next_element_from_string): Fix typos in
3615 comments.
3616 (redisplay_window): Pass to move_it_vertically the margin in
3617 pixels, not in screen lines.
3618
3619 2012-03-02 Glenn Morris <rgm@gnu.org>
3620
3621 * buffer.c (buffer-list-update-hook): Doc fix.
3622
3623 2012-02-29 Eli Zaretskii <eliz@gnu.org>
3624
3625 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
3626 push_it before setting up the iterator for the first overlay
3627 string, even if we have an empty string loaded.
3628 (next_overlay_string): If there's an empty string on the iterator
3629 stack, pop the stack. (Bug#10903)
3630
3631 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
3632
3633 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
3634 Suggested by Stefan Monnier in
3635 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
3636 * alloc.c (widen_to_Lisp_Object): New static function.
3637 (mark_memory): Also mark Lisp_Objects by fetching pointer words
3638 and widening them to Lisp_Objects. This would work even if
3639 USE_LSB_TAG is defined and wide integers are used, which might
3640 happen in a future version of Emacs.
3641
3642 2012-02-25 Chong Yidong <cyd@gnu.org>
3643
3644 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
3645 Doc fix.
3646
3647 * xselect.c (Fx_selection_exists_p): Doc fix.
3648 (x_clipboard_manager_save_all): Print an informative message
3649 before saving to clipboard manager.
3650
3651 2012-02-24 Chong Yidong <cyd@gnu.org>
3652
3653 * keyboard.c (process_special_events): Handle all X selection
3654 requests in kbd_buffer, not just the next one (Bug#8869).
3655
3656 2012-02-23 Chong Yidong <cyd@gnu.org>
3657
3658 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
3659 call when setting menu-bar-lines and tool-bar-lines parameters.
3660 (unwind_create_frame_1): New helper function.
3661
3662 * window.c (inhibit_window_configuration_change_hook): New var.
3663 (run_window_configuration_change_hook): Obey it.
3664 (syms_of_window): Initialize it.
3665
3666 2012-02-22 Chong Yidong <cyd@gnu.org>
3667
3668 * xterm.c (x_draw_image_relief): Add missing type check for
3669 Vtool_bar_button_margin (Bug#10743).
3670
3671 2012-02-21 Chong Yidong <cyd@gnu.org>
3672
3673 * fileio.c (Vfile_name_handler_alist): Doc fix.
3674
3675 * buffer.c (Fget_file_buffer): Protect against invalid file
3676 handler return value.
3677
3678 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
3679
3680 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
3681 when computing $valmask.
3682
3683 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
3684 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
3685 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
3686 It's useless in that case, and it can cause problems on hosts
3687 that allocate halves of EMACS_INT values separately.
3688 Reported by Dan Horák. Diagnosed by Andreas Schwab in
3689 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
3690 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
3691 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
3692 it avoids undefined behavior on hosts where shifting right by more
3693 than the word width has undefined behavior.
3694
3695 2012-02-19 Chong Yidong <cyd@gnu.org>
3696
3697 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
3698 (Funhandled_file_name_directory, Ffile_name_as_directory)
3699 (Fdirectory_file_name, Fexpand_file_name)
3700 (Fsubstitute_in_file_name): Protect against invalid file handler
3701 return values (Bug#10845).
3702
3703 2012-02-18 Eli Zaretskii <eliz@gnu.org>
3704
3705 * .gdbinit (pitx): Fix incorrect references to fields of the
3706 iterator stack.
3707
3708 2012-02-17 Chong Yidong <cyd@gnu.org>
3709
3710 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
3711
3712 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
3713
3714 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
3715 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
3716
3717 2012-02-15 Chong Yidong <cyd@gnu.org>
3718
3719 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
3720 marked as special. Also, starting docstrings with * is obsolete.
3721
3722 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
3723
3724 * gnutls.c (emacs_gnutls_write): Fix last change.
3725
3726 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
3727
3728 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
3729 send_process.
3730
3731 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
3732
3733 * keymap.c (Fsingle_key_description): Handle char ranges.
3734
3735 2012-02-12 Chong Yidong <cyd@gnu.org>
3736
3737 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
3738 as that creates a dangerous corner case.
3739
3740 * window.c (Fdelete_window_internal): Invalidate the mouse
3741 highlight (Bug#9904).
3742
3743 2012-02-12 Glenn Morris <rgm@gnu.org>
3744
3745 * xselect.c (Fx_own_selection_internal)
3746 (Fx_get_selection_internal, Fx_disown_selection_internal)
3747 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
3748 * nsselect.m (Fx_own_selection_internal)
3749 (Fx_disown_selection_internal, Fx_selection_exists_p)
3750 (Fx_selection_owner_p, Fx_get_selection_internal):
3751 Sync docs and argument specs with the xselect.c versions.
3752
3753 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
3754
3755 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
3756
3757 2012-02-11 Eli Zaretskii <eliz@gnu.org>
3758
3759 * w32select.c (Fx_selection_exists_p): Sync doc string and
3760 argument list with xselect.c. (Bug#10783)
3761
3762 * w16select.c (Fx_selection_exists_p): Sync doc string and
3763 argument list with xselect.c. (Bug#10783)
3764
3765 2012-02-10 Glenn Morris <rgm@gnu.org>
3766
3767 * fns.c (Fsecure_hash): Doc fix.
3768
3769 2012-02-09 Kenichi Handa <handa@m17n.org>
3770
3771 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
3772
3773 2012-02-07 Chong Yidong <cyd@gnu.org>
3774
3775 * buffer.c (Fbuffer_local_variables)
3776 (buffer_lisp_local_variables): Handle unbound vars correctly;
3777 don't let Qunbound leak into Lisp.
3778
3779 2012-02-07 Glenn Morris <rgm@gnu.org>
3780
3781 * image.c (Fimagemagick_types): Doc fix.
3782
3783 * image.c (imagemagick-render-type): Change it from a lisp object
3784 to an integer. Move the doc here from the lisp manual.
3785 Treat all values not equal to 0 the same.
3786
3787 2012-02-06 Chong Yidong <cyd@gnu.org>
3788
3789 * doc.c (store_function_docstring): Avoid applying docstring of
3790 alias to base function (Bug#2603).
3791
3792 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
3793
3794 * .gdbinit (pp1, pv1): Remove redundant defines.
3795 (pr): Use pp.
3796
3797 2012-02-04 Chong Yidong <cyd@gnu.org>
3798
3799 * nsterm.m: Declare a global (Bug#10694).
3800
3801 2012-02-04 Eli Zaretskii <eliz@gnu.org>
3802
3803 * w32.c (get_emacs_configuration_options):
3804 Include --enable-checking, if specified, in the return value.
3805
3806 2012-02-04 Martin Rudalics <rudalics@gmx.at>
3807
3808 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
3809 after rounding frame sizes. (Bug#9723)
3810
3811 2012-02-04 Eli Zaretskii <eliz@gnu.org>
3812
3813 * keyboard.c (adjust_point_for_property): Don't position point
3814 before BEGV. (Bug#10696)
3815
3816 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
3817
3818 Handle overflow when computing char display width (Bug#9496).
3819 * character.c (char_width): Return EMACS_INT, not int.
3820 (char_width, c_string_width): Check for overflow when
3821 computing the width; this is possible now that individual
3822 characters can have unbounded width. Problem introduced
3823 by merge from Emacs 23 on 2012-01-19.
3824
3825 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
3826
3827 * dbusbind.c (Fdbus_register_method): Mention the return value
3828 :ignore in the docstring.
3829
3830 2012-02-02 Glenn Morris <rgm@gnu.org>
3831
3832 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
3833
3834 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
3835 Unconditionally set to t. (Bug#10673)
3836 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
3837 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
3838 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
3839
3840 2012-02-02 Kenichi Handa <handa@m17n.org>
3841
3842 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
3843 0, do not call append_composite_glyph.
3844
3845 2012-02-02 Kenichi Handa <handa@m17n.org>
3846
3847 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
3848 NULL (Bug#6988).
3849 (x_produce_glyphs): If the component of a composition is a null
3850 string, set it->pixel_width to 1 to avoid zero-width glyph.
3851
3852 2012-02-01 Eli Zaretskii <eliz@gnu.org>
3853
3854 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
3855 first 2 arguments are identical. This makes inserting large
3856 output from a subprocess an order of magnitude faster on
3857 MS-Windows, where all sbrk'ed memory is always contiguous.
3858
3859 2012-01-31 Glenn Morris <rgm@gnu.org>
3860
3861 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
3862 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
3863 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
3864
3865 2012-01-29 Glenn Morris <rgm@gnu.org>
3866
3867 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
3868
3869 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
3870
3871 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
3872
3873 2012-01-28 Chong Yidong <cyd@gnu.org>
3874
3875 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
3876
3877 2012-01-26 Chong Yidong <cyd@gnu.org>
3878
3879 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
3880
3881 * search.c (Fsearch_forward, Fsearch_backward): Document negative
3882 repeat counts (Bug#10507).
3883
3884 2012-01-26 Glenn Morris <rgm@gnu.org>
3885
3886 * lread.c (syms_of_lread): Doc fix.
3887
3888 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
3889
3890 * coding.c (encode_designation_at_bol): Change return value to
3891 EMACS_INT.
3892
3893 2012-01-25 Chong Yidong <cyd@gnu.org>
3894
3895 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
3896
3897 2012-01-21 Chong Yidong <cyd@gnu.org>
3898
3899 * floatfns.c (Fcopysign): Make the second argument non-optional,
3900 since nil is not allowed anyway.
3901
3902 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
3903
3904 * process.c (read_process_output): Use p instead of XPROCESS (proc).
3905 (send_process): Likewise.
3906
3907 2012-01-19 Martin Rudalics <rudalics@gmx.at>
3908
3909 * window.c (save_window_save, Fcurrent_window_configuration)
3910 (Vwindow_persistent_parameters): Do not use Qstate.
3911 Rewrite doc-strings.
3912
3913 2012-01-19 Kenichi Handa <handa@m17n.org>
3914
3915 * character.c (char_width): New function.
3916 (Fchar_width, c_string_width, lisp_string_width):
3917 Use char_width (Bug#9496).
3918
3919 2012-01-16 Martin Rudalics <rudalics@gmx.at>
3920
3921 * window.c (Vwindow_persistent_parameters): New variable.
3922 (Fset_window_configuration, save_window_save): Handle persistent
3923 window parameters.
3924
3925 2012-01-14 Eli Zaretskii <eliz@gnu.org>
3926
3927 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
3928 thrashing the stack of the thread. (Bug#9087)
3929
3930 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
3931
3932 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
3933
3934 2012-01-11 Eli Zaretskii <eliz@gnu.org>
3935
3936 * xdisp.c (rows_from_pos_range): Handle the case where the
3937 highlight ends on a newline. (Bug#10464)
3938 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
3939 he end column for display of highlight that ends on a newline
3940 before a R2L line.
3941
3942 2012-01-11 Glenn Morris <rgm@gnu.org>
3943
3944 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
3945 from load-path also when installation-directory is nil. (Bug#10208)
3946
3947 2012-01-10 Glenn Morris <rgm@gnu.org>
3948
3949 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
3950
3951 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
3952 Update template values to be closer to their typical values these days.
3953
3954 2012-01-09 Eli Zaretskii <eliz@gnu.org>
3955
3956 * xdisp.c (rows_from_pos_range): Accept additional argument
3957 DISP_STRING, and accept any glyph in a row whose object is that
3958 string as eligible for mouse highlight. Fixes mouse highlight of
3959 display strings from overlays. (Bug#10464)
3960
3961 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
3962
3963 emacs: fix an auto-save permissions race condition (Bug#10400)
3964 * fileio.c (auto_saving_dir_umask): New static var.
3965 (Fmake_directory_internal): Use it.
3966 (do_auto_save_make_dir): Set it, instead of invoking chmod after
3967 creating the directory. The old code temporarily assigns
3968 too-generous permissions to the directory.
3969 (do_auto_save_eh): Clear it.
3970 (Fdo_auto_save): Catch all errors, not just file errors, so
3971 that the var is always cleared.
3972
3973 2012-01-07 Eli Zaretskii <eliz@gnu.org>
3974
3975 * search.c (scan_buffer): Pass character positions to
3976 know_region_cache, not byte positions. (Bug#6540)
3977
3978 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
3979
3980 * w32.c (sys_rename): Report EXDEV when rename of a directory
3981 fails because the target is on another logical disk. (Bug#10284)
3982
3983 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
3984
3985 * xterm.c (x_embed_request_focus): New function.
3986
3987 * xterm.h: Add prototype.
3988
3989 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
3990
3991 2012-01-05 Glenn Morris <rgm@gnu.org>
3992
3993 * emacs.c (emacs_copyright): Update short copyright year to 2012.
3994
3995 2012-01-01 Eli Zaretskii <eliz@gnu.org>
3996
3997 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
3998 Load gnutls_transport_set_lowat only if GnuTLS version is below
3999 2.11.1.
4000 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
4001 GnuTLS versions below 2.11.1.
4002
4003 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
4004
4005 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
4006 to the doc string advising against its use for altering the way
4007 windows are scrolled.
4008
4009 2011-12-28 Kenichi Handa <handa@m17n.org>
4010
4011 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
4012 coding-system ASCII compatible only when it does not produce BOM
4013 on encoding (Bug#10383).
4014
4015 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
4016
4017 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
4018 can scroll.
4019 (create_and_show_popup_menu): Always use menu_position_func for
4020 Gtk3 (Bug#10361).
4021
4022 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
4023
4024 * callint.c (Fcall_interactively): Don't truncate prompt string.
4025
4026 2011-12-23 Eli Zaretskii <eliz@gnu.org>
4027
4028 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
4029 property that ends at ZV, so that the bidi iteration could be
4030 resumed from there (after widening). (Bug#10360)
4031
4032 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
4033
4034 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
4035
4036 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
4037
4038 * nsterm.m (x_free_frame_resources):
4039 Release f->output_data.ns->miniimage.
4040 (ns_index_color): Fix indentation. Do not retain
4041 color_table->colors[i].
4042
4043 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
4044 before returning.
4045
4046 * nsfns.m (x_set_background_color): Assign return value from
4047 ns_index_color to face-background instead of NSColor*.
4048 (ns_implicitly_set_icon_type): Fix indentation.
4049 Change assignment in for loop to comparison.
4050
4051 * emacs.c (ns_pool): New variable.
4052 (main): Assign ns_pool.
4053 (Fkill_emacs): Call ns_release_autorelease_pool.
4054
4055 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
4056 autorelease fdesc, release fdAttrs and tdict.
4057 (ns_get_covering_families): Release charset.
4058 (ns_findfonts): Release NSFontDescriptor created with new.
4059 (ns_uni_to_glyphs): Fix indentation.
4060 (setString): Release attrStr before assigning new value.
4061
4062 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
4063
4064 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
4065 and NS_IMPL_COCOA.
4066 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
4067 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
4068
4069 2011-12-18 David Reitter <reitter@cmu.edu>
4070
4071 * nsterm.m (ns_term_init): Subscribe for notifications
4072 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
4073 to method trackingNotification in EmacsMenu.
4074
4075 * nsmenu.m (trackingMenu): New variable.
4076 (trackingNotification): New method (from Aquamacs).
4077 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
4078 from Aquamacs (Bug#7030).
4079
4080 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
4081
4082 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
4083 (symbol_to_nsstring): Fix indentation.
4084 (ns_symbol_to_pb): New function.
4085 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
4086 (Fns_rotate_cut_buffers_internal): Remove.
4087 (Fns_store_selection_internal): Rename from
4088 Fns_store_cut_buffer_internal.
4089 (ns_get_foreign_selection, Fx_own_selection_internal)
4090 (Fx_disown_selection_internal, Fx_selection_exists_p)
4091 (Fns_get_selection_internal, Fns_store_selection_internal):
4092 Use ns_symbol_to_pb and check if return value is nil.
4093 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
4094 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
4095 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
4096 renamed to Sns_store_selection_internal.
4097 (ns_handle_selection_request): Move code to Fx_own_selection_internal
4098 and remove this function.
4099 (ns_handle_selection_clear): Remove, never used.
4100 (Fx_own_selection_internal): Move code from ns_handle_selection_request
4101 here.
4102
4103 2011-12-17 Ken Brown <kbrown@cornell.edu>
4104
4105 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
4106 GID is unknown (Bug#10257).
4107
4108 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
4109
4110 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
4111 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
4112 which caused a build failure on GNU/Linux IA-64. This problem was
4113 introduced by my 2011-10-07 patch.
4114
4115 2011-12-15 Juri Linkov <juri@jurta.org>
4116
4117 * image.c (imagemagick_error): New function. (Bug#10112)
4118 (imagemagick_load_image): Comment out `MagickSetResolution' call.
4119 Use `imagemagick_error' where ImageMagick functions return
4120 `MagickFalse'.
4121 (Fimagemagick_types): Add `Fnreverse' to return the list in the
4122 proper order.
4123
4124 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4125
4126 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
4127 fill background (Bug#8992).
4128
4129 2011-12-13 Martin Rudalics <rudalics@gmx.at>
4130
4131 * window.c (Vwindow_combination_resize)
4132 (Vwindow_combination_limit): Use t instead of non-nil in
4133 doc-strings.
4134 (Vrecenter_redisplay): Add first sentence of doc-string on
4135 separate line.
4136 (Frecenter): Fix doc-string typo.
4137
4138 2011-12-11 Kenichi Handa <handa@m17n.org>
4139
4140 * coding.c (Funencodable_char_position): Pay attention to the
4141 buffer text relocation (Bug#9389).
4142
4143 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
4144
4145 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
4146 gtk_init (Bug#10100).
4147
4148 2011-12-10 Eli Zaretskii <eliz@gnu.org>
4149
4150 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
4151 IT->string is nil. (Bug#10263)
4152
4153 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
4154
4155 * nsterm.h (x_free_frame_resources): Declare.
4156
4157 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
4158 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
4159
4160 * nsterm.h (ns_get_defaults_value): Declare.
4161
4162 * nsterm.m (ns_default): Call ns_get_defaults_value.
4163
4164 2011-12-09 Eli Zaretskii <eliz@gnu.org>
4165
4166 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
4167 (Bug#10170)
4168
4169 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4170
4171 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
4172 that where the value of an _OBJC_* symbol points to is in the .bss
4173 section (Bug#10240).
4174
4175 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4176
4177 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
4178 after the loop to call ccl_driver at least once (Bug#8619).
4179
4180 2011-12-08 Kenichi Handa <handa@m17n.org>
4181
4182 * ftfont.c (get_adstyle_property): Fix previous change
4183 (Bug#10233).
4184
4185 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
4186
4187 * w32.c (init_environment): If no_site_lisp, remove site-lisp
4188 dirs from the default value of EMACSLOADPATH (bug#10208).
4189
4190 2011-12-07 Glenn Morris <rgm@gnu.org>
4191
4192 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
4193 installation and source directories as well. (Bug#10208)
4194
4195 2011-12-06 Chong Yidong <cyd@gnu.org>
4196
4197 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
4198
4199 2011-12-06 Glenn Morris <rgm@gnu.org>
4200
4201 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
4202 as an error, not just -1. (Bug#10217)
4203
4204 2011-12-05 Chong Yidong <cyd@gnu.org>
4205
4206 * keyboard.c (process_special_events): New function.
4207 (swallow_events, Finput_pending_p): Use it (Bug#10195).
4208
4209 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
4210
4211 * coding.c (encode_designation_at_bol): Don't use uninitialized
4212 local variable (Bug#9318).
4213
4214 2011-12-05 Kenichi Handa <handa@m17n.org>
4215
4216 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
4217 return Qnil (Bug#8046, Bug#10193).
4218
4219 2011-12-05 Kenichi Handa <handa@m17n.org>
4220
4221 * coding.c (encode_designation_at_bol): New args charbuf_end and
4222 dst. Return the number of produced bytes. Callers changed.
4223 (coding_set_source): Return how many bytes coding->source was
4224 relocated.
4225 (coding_set_destination): Return how many bytes
4226 coding->destination was relocated.
4227 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
4228 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
4229
4230 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4231
4232 * coding.c (CODING_CHAR_CHARSET_P): New macro.
4233 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
4234 macro (Bug#9318).
4235
4236 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
4237
4238 The following changes are to fix Bug#9318.
4239
4240 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
4241 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
4242 (encode_coding_iso_2022, encode_coding_sjis)
4243 (encode_coding_big5, encode_coding_charset): Use the above macros.
4244
4245 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
4246
4247 * lisp.h (process_quit_flag): Fix external declaration.
4248
4249 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
4250
4251 Don't macro-inline non-performance-critical code.
4252 * eval.c (process_quit_flag): New function.
4253 * lisp.h (QUIT): Use it.
4254
4255 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
4256
4257 * nsfns.m (get_geometry_from_preferences): New function.
4258 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
4259
4260 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
4261
4262 * emacs.c (Qkill_emacs): Define.
4263 (syms_of_emacs): Initialize it.
4264 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
4265 Qquit_flag to `kill-emacs' instead.
4266 (quit_throw_to_read_char): Add parameter `from_signal'.
4267 All callers changed. Call Fkill_emacs if requested and safe.
4268 * lisp.h (QUIT): Call Fkill_emacs if requested.
4269
4270 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
4271
4272 * widget.c (update_wm_hints): Return if wmshell is null.
4273 (widget_update_wm_size_hints): New function.
4274
4275 * widget.h (widget_update_wm_size_hints): Declare.
4276
4277 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
4278 widget_update_wm_size_hints (Bug#10104).
4279
4280 2011-12-03 Eli Zaretskii <eliz@gnu.org>
4281
4282 * xdisp.c (handle_invisible_prop): If the invisible text ends just
4283 before a newline, prepare the bidi iterator for consuming the
4284 newline, and keep the current paragraph direction. (Bug#10183)
4285 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
4286
4287 2011-12-02 Juri Linkov <juri@jurta.org>
4288
4289 * search.c (Fword_search_regexp): New Lisp function created from
4290 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
4291 (Fword_search_backward, Fword_search_forward)
4292 (Fword_search_backward_lax, Fword_search_forward_lax):
4293 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
4294 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
4295
4296 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
4297
4298 * fileio.c (Finsert_file_contents): Move after-change-function call
4299 to before the "handled:" label, since all "goto handled" appear in
4300 cases where the *-change-functions have already been properly called
4301 (bug#10117).
4302
4303 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
4304
4305 * keyboard.c (interrupt_signal): Don't call kill-emacs when
4306 waiting for input. (Bug#10169)
4307
4308 2011-11-30 Eli Zaretskii <eliz@gnu.org>
4309
4310 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
4311 verifies glyph row's hash code--we have just reallocated the
4312 glyphs, so their contents can be complete garbage. (Bug#10164)
4313
4314 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
4315
4316 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
4317
4318 2011-11-30 Eli Zaretskii <eliz@gnu.org>
4319
4320 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
4321 attributes are tested _before_ calling verify_row_hash, to protect
4322 against GCC re-ordering of the tests. (Bug#10164)
4323
4324 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
4325
4326 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
4327
4328 * xterm.c (handle_one_xevent): Only set async_visible and friends
4329 if net_wm_state_hidden_seen is non-zero (Bug#10002)
4330 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
4331 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
4332
4333 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
4334
4335 Remove GCPRO-related macros that exist only to avoid shadowing locals.
4336 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
4337 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
4338 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
4339 All uses changed to use GCPRO1 etc.
4340 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
4341 Revert to old implementation (i.e., before 2011-03-11).
4342
4343 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4344
4345 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
4346 of scroll runs so as to avoid assigning disabled bogus rows and
4347 unnecessary graphics copy operations.
4348
4349 2011-11-27 Eli Zaretskii <eliz@gnu.org>
4350
4351 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
4352 (snprintf) [_MSC_VER]: Redirect to _snprintf.
4353 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
4354 (malloc, free, realloc, calloc): Redirect to e_* only when
4355 compiling Emacs.
4356
4357 * lisp.h (GCTYPEBITS): Move before first use.
4358 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
4359 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
4360 this macro definition.
4361
4362 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
4363 _MSC_VER.
4364
4365 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
4366
4367 * gtkutil.c (xg_create_frame_widgets):
4368 Call gtk_window_set_has_resize_grip (FALSE) if that function is
4369 present with Gtk+ 2.0.
4370
4371 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
4372
4373 * fileio.c (Finsert_file_contents): Undo previous change; see
4374 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
4375
4376 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
4377
4378 Rename locals to avoid shadowing.
4379 * fileio.c (Finsert_file_contents):
4380 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
4381 * process.c (wait_reading_process_output):
4382 Rename inner 'proc' to 'p' to avoid shadowing.
4383 Indent for consistency with usual Emacs style.
4384
4385 2011-11-25 Eli Zaretskii <eliz@gnu.org>
4386
4387 * xdisp.c (redisplay_window): If cursor row is not fully visible
4388 after recentering, and scroll-conservatively is set to a large
4389 number, scroll window by a few more lines to make the cursor fully
4390 visible and out of scroll-margin. (Bug#10105)
4391 (start_display): Don't move to the next line if the display should
4392 start at a newline that is part of a display vector or an overlay
4393 string. (Bug#10119)
4394
4395 2011-11-24 Juri Linkov <juri@jurta.org>
4396
4397 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
4398 after the `MagickPingImage' call. (Bug#10112)
4399
4400 2011-11-23 Chong Yidong <cyd@gnu.org>
4401
4402 * window.c (Fcoordinates_in_window_p): Accept only live windows.
4403
4404 2011-11-23 Martin Rudalics <rudalics@gmx.at>
4405
4406 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
4407 making another buffer current. (Bug#10114)
4408
4409 2011-11-23 Glenn Morris <rgm@gnu.org>
4410
4411 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
4412
4413 2011-11-23 Chong Yidong <cyd@gnu.org>
4414
4415 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
4416 using it (Bug#5984).
4417
4418 2011-11-22 Eli Zaretskii <eliz@gnu.org>
4419
4420 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
4421 and header-lines, as they don't have one computed for them.
4422 (Bug#10098)
4423
4424 * .gdbinit (prow): Make displayed values more self-explaining.
4425 Add row's hash code.
4426
4427 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
4428
4429 * process.c (wait_reading_process_output): Fix asynchrounous
4430 GnuTLS socket handling on some versions of the GnuTLS library.
4431 (wait_reading_process_output): Add comment and URL.
4432
4433 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
4434
4435 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
4436
4437 2011-11-21 Chong Yidong <cyd@gnu.org>
4438
4439 * window.c (Fnext_window, Fprevious_window): Doc fix.
4440
4441 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
4442
4443 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
4444
4445 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
4446
4447 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
4448
4449 2011-11-20 Martin Rudalics <rudalics@gmx.at>
4450
4451 * window.c (Fset_window_combination_limit): Rename argument
4452 STATUS to LIMIT.
4453 (Vwindow_combination_limit): Remove "status" from doc-string.
4454
4455 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
4456
4457 * m/ibms390.h: Remove.
4458 * m/ibms390x.h: Don't include "ibms390.h".
4459
4460 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
4461
4462 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
4463 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
4464
4465 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
4466
4467 * casetab.c (Fset_case_table):
4468 * charset.c (Fcharset_after): Fix typos.
4469
4470 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
4471
4472 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
4473 Otherwise, valgrind does not work on some platforms.
4474 Problem reported by Andreas Schwab in
4475 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
4476 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
4477 is set, removing the need for VIRT_ADDRESS_VARIES.
4478 (PURE_P): Use a more-efficient implementation that needs just one
4479 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
4480 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
4481 to 4 (xorl, subq, cmpq, setbe).
4482 * alloc.c (pure): Always extern now, since that's the
4483 VIRT_ADDR_VARIES behavior.
4484 (PURE_POINTER_P): Use a single comparison, not two, for
4485 consistency with the new puresize.h.
4486 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
4487 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
4488 Remove VIRT_ADDR_VARIES no longer needed.
4489
4490 2011-11-19 Eli Zaretskii <eliz@gnu.org>
4491
4492 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
4493 (erase_phys_cursor, update_window_cursor, show_mouse_face)
4494 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
4495 behave as if the cursor position were at the window margin.
4496
4497 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
4498 and the cursor position is out of bounds, behave as if the cursor
4499 position were at the window margin. (Bug#10075)
4500
4501 2011-11-18 Chong Yidong <cyd@gnu.org>
4502
4503 * window.c (Fwindow_combination_limit): Make first argument
4504 non-optional, since it is meaningless for live windows like the
4505 selected window.
4506
4507 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
4508
4509 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
4510
4511 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
4512
4513 * intervals.c: Fix grafting over the whole buffer (bug#10071).
4514 (graft_intervals_into_buffer): Simplify.
4515
4516 2011-11-18 Eli Zaretskii <eliz@gnu.org>
4517
4518 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
4519 hash values of the two rows.
4520 (copy_row_except_pointers): Preserve the used[] arrays and the
4521 hash values of the two rows. (Bug#10035)
4522 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
4523
4524 * xdisp.c (row_hash): New function, body extracted from
4525 compute_line_metrics.
4526 (compute_line_metrics): Call row_hash, instead of computing the
4527 hash code inline.
4528
4529 * dispnew.c (verify_row_hash): Call row_hash for computing the
4530 hash code of a row, instead of duplicating code from xdisp.c.
4531
4532 * dispextern.h (row_hash): Add prototype.
4533
4534 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
4535
4536 * frame.c (delete_frame): Don't delete the terminal when the last
4537 X frame is closed if emacs is built with GTK toolkit.
4538
4539 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
4540
4541 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
4542
4543 2011-11-17 Martin Rudalics <rudalics@gmx.at>
4544
4545 * window.c (Vwindow_splits): Rename to
4546 Vwindow_combination_resize. Suggested by Juri Linkov.
4547 (Fsplit_window_internal): Use Vwindow_combination_resize instead
4548 of Vwindow_splits.
4549
4550 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
4551
4552 * nsfns.m (Fns_font_name):
4553 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
4554
4555 2011-11-16 Martin Rudalics <rudalics@gmx.at>
4556
4557 * window.h (window): Rename slot "nest" to "combination_limit".
4558 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
4559 (Fset_window_nest): Rename to Fset_window_combination_limit.
4560 (Vwindow_nest): Rename to Vwindow_combination_limit.
4561 (recombine_windows, make_parent_window, make_window)
4562 (Fsplit_window_internal, saved_window)
4563 (Fset_window_configuration, save_window_save): Rename all
4564 occurrences of window_nest to window_combination_limit.
4565
4566 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
4567
4568 * image.c (imagemagick_load_image): Fix typo.
4569
4570 2011-11-14 Eli Zaretskii <eliz@gnu.org>
4571
4572 * xdisp.c (display_line): Move the call to
4573 highlight_trailing_whitespace before the call to
4574 compute_line_metrics, since the latter needs to see the final
4575 faces of all the glyphs to compute ROW's hash value.
4576 Fixes assertion violations in row_equal_p. (Bug#10035)
4577
4578 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
4579
4580 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
4581 just return (bug#10044).
4582
4583 2011-11-12 Eli Zaretskii <eliz@gnu.org>
4584
4585 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
4586 with user-defined heap size. Bump the default size of the temacs
4587 heap to 27MB, to avoid memory warning when running temacs.
4588 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
4589
4590 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
4591 current_matrix and desired_matrix. (Bug#9990)
4592 (verify_row_hash) [XASSERTS]: New function.
4593 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
4594 that the hash value of glyph rows is correct.
4595
4596 2011-11-12 Martin Rudalics <rudalics@gmx.at>
4597
4598 * window.h (window): Remove splits slot.
4599 * window.c (Fwindow_splits, Fset_window_splits): Remove.
4600 (Fdelete_other_windows_internal, make_parent_window)
4601 (make_window, Fsplit_window_internal, Fdelete_window_internal)
4602 (Fset_window_configuration, save_window_save): Don't deal with
4603 split status of windows.
4604 (saved_window): Remove splits slot.
4605 (Vwindow_splits): Rewrite doc-string.
4606
4607 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
4608
4609 * xfns.c (unwind_create_frame):
4610 * nsfns.m (unwind_create_frame):
4611 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
4612 Vframe_list (Bug#9999).
4613
4614 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
4615
4616 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
4617
4618 2011-11-11 Kenichi Handa <handa@m17n.org>
4619
4620 * callproc.c (Fcall_process): Set the member dst_multibyte of
4621 process_coding.
4622
4623 2011-11-11 Johan Bockgård <bojohan@gnu.org>
4624
4625 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
4626 avoid a crash (bug#9496).
4627
4628 2011-11-09 Chong Yidong <cyd@gnu.org>
4629
4630 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
4631 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
4632
4633 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
4634
4635 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
4636
4637 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
4638
4639 Avoid some portability problems by eschewing 'extern inline' functions.
4640 The trivial performance wins aren't worth the portability hassles; see
4641 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
4642 et seq.
4643 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
4644 (window_box_width, window_box_left, window_box_left_offset)
4645 (window_box_right, window_box_right_offset): Undo previous change,
4646 by removing the "extern"s.
4647 * intervals.c (adjust_intervals_for_insertion)
4648 (adjust_intervals_for_deletion): Undo previous change,
4649 making these static again.
4650 (offset_intervals, temp_set_point_both, temp_set_point)
4651 (copy_intervals_to_string): No longer inline.
4652 * xdisp.c (window_text_bottom_y, window_box_width)
4653 (window_box_height, window_box_left_offset)
4654 (window_box_right_offset, window_box_left, window_box_right)
4655 (window_box): No longer inline.
4656
4657 2011-11-08 Chong Yidong <cyd@gnu.org>
4658
4659 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
4660 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
4661 Signal an error if not a live window.
4662 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
4663 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
4664
4665 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
4666
4667 * lisp.h (syms_of_abbrev): Remove declaration.
4668 Reported by CHENG Gao <chenggao@royau.me>.
4669
4670 2011-11-07 Eli Zaretskii <eliz@gnu.org>
4671
4672 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
4673 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
4674 of temacs in GUI mode.
4675
4676 2011-11-07 Martin Rudalics <rudalics@gmx.at>
4677
4678 * window.h: Declare delete_all_child_windows instead of
4679 delete_all_subwindows.
4680 * window.c (Fwindow_nest, Fset_window_nest)
4681 (Fset_window_new_total, Fset_window_new_normal)
4682 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
4683 (delete_all_subwindows): Rename to delete_all_child_windows.
4684 (Fdelete_other_windows_internal, Fset_window_configuration):
4685 Call delete_all_child_windows instead of delete_all_subwindows.
4686 * frame.c (delete_frame): Call delete_all_child_windows instead
4687 of delete_all_subwindows.
4688
4689 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
4690
4691 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
4692 This is also needed for porting to any host where GC_MARK_STACK is
4693 not GC_MAKE_GCPROS_NOOPS.
4694 (which_symbols): Use it.
4695
4696 2011-11-07 Kenichi Handa <handa@m17n.org>
4697
4698 * coding.c (coding_set_destination): Check coding->src_pos only
4699 when coding->src_object is a buffer (bug#9910).
4700
4701 * process.c (send_process): Set the member src_multibyte of coding
4702 to 0 (bug#9911) when sending a unibyte text.
4703
4704 * callproc.c (Fcall_process): Set the member src_multibyte of
4705 process_coding to 0 (bug#9912).
4706
4707 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4708
4709 * xmenu.c (cleanup_widget_value_tree): New function.
4710 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
4711 calling free_menubar_widget_value_tree directly (Bug#9830).
4712
4713 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
4714
4715 Fix some portability problems with 'inline'.
4716 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
4717 (window_box_width, window_box_left, window_box_left_offset)
4718 (window_box_right, window_box_right_offset): Declare extern.
4719 Otherwise, these inline functions do not conform to C99 and
4720 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
4721 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
4722 * intervals.c (adjust_intervals_for_insertion)
4723 (adjust_intervals_for_deletion): Now extern, because otherwise the
4724 extern inline functions 'offset_intervals' couldn't refer to it.
4725 (static_offset_intervals): Remove.
4726 (offset_intervals): Rewrite using the old contents of
4727 static_offset_intervals. The old version didn't conform to C99
4728 because an extern inline function contained a reference to an
4729 identifier with static linkage.
4730
4731 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
4732
4733 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
4734 GC.
4735
4736 2011-11-06 Eli Zaretskii <eliz@gnu.org>
4737
4738 * xdisp.c (init_iterator, reseat_to_string): Don't set the
4739 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
4740 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
4741 return Qleft_to_right.
4742
4743 2011-11-06 Chong Yidong <cyd@gnu.org>
4744
4745 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
4746 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
4747 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
4748 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
4749 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
4750 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
4751 (Fwindow_vscroll): Doc fix.
4752 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
4753 argument, since it makes no sense to pass a live window and for
4754 consistency with window-child.
4755
4756 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
4757
4758 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
4759 support MSVC.
4760
4761 2011-11-05 Jason Rumney <jasonr@gnu.org>
4762
4763 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
4764 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
4765 fonts (Bug#6029).
4766 (add_font_entity_to_list): Fix logic errors in mixed boolean and
4767 bitwise arithmetic preventing use of unicode-sip and non-truetype
4768 opentype fonts.
4769
4770 2011-11-05 Eli Zaretskii <eliz@gnu.org>
4771
4772 * s/ms-w32.h (fstat, stat, utime): Move redirections to
4773 "emacs"-only part.
4774
4775 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
4776 initialization code to keep similarity to xfns.c after changes
4777 from 2011-11-05.
4778
4779 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
4780
4781 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
4782 (unwind_create_frame): New function (Bug#9943).
4783 (Fx_create_frame): Restructure code to be more similar to the one in
4784 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
4785 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
4786 Move terminal->reference_count++ just before making the frame official
4787 (Bug#9943).
4788
4789 * nsterm.m (x_free_frame_resources): New function.
4790 (x_destroy_window): Move code to x_free_frame_resources.
4791
4792 * xfns.c (unwind_create_frame): Fix comment.
4793 (Fx_create_frame, x_create_tip_frame):
4794 Move terminal->reference_count++ just before making the frame
4795 official. Move initialization of image_cache_refcount and
4796 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
4797
4798 2011-11-05 Eli Zaretskii <eliz@gnu.org>
4799
4800 Support MSVC build with newer versions of Visual Studio.
4801 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
4802 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
4803 nt/gmake.defs.
4804
4805 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
4806 which are not supported by MSVC.
4807 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
4808 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
4809 bitfields.
4810 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
4811 types in bitfields.
4812 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
4813
4814 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
4815
4816 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
4817
4818 Support MSVC build with newer versions of Visual Studio.
4819 * w32.c: Don't include w32api.h for MSVC.
4820 (init_environment) [_MSC_VER]: Call sys_access, not _access.
4821
4822 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
4823 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
4824 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
4825 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
4826 e_* cousins.
4827 (alloca) [_MSC_VER]: Define to _alloca.
4828
4829 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
4830
4831 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
4832
4833 2011-11-04 Eli Zaretskii <eliz@gnu.org>
4834
4835 * xdisp.c (note_mouse_highlight): If either of
4836 previous/next-single-property-change returns nil, treat that as
4837 the beginning or the end of the buffer. (Bug#9955)
4838
4839 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
4840
4841 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
4842 label is not null (Bug#9951).
4843 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
4844 may be NULL.
4845
4846 2011-11-04 Eli Zaretskii <eliz@gnu.org>
4847
4848 * window.c (Fwindow_body_size): Mention in the doc string that the
4849 return value is in frame's canonical units. (Bug#9949)
4850
4851 2011-11-03 Eli Zaretskii <eliz@gnu.org>
4852
4853 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
4854
4855 * w32fns.c (unwind_create_frame): If needed, free the glyph
4856 matrices of the partially constructed frame. (Bug#9943)
4857 * xfns.c (unwind_create_frame): Likewise.
4858
4859 2011-11-01 Eli Zaretskii <eliz@gnu.org>
4860
4861 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
4862 Don't stop backward scan on the continuation glyph, even though
4863 its CHARPOS is positive.
4864 (mouse_face_from_buffer_pos, note_mouse_highlight):
4865 Rename cover_string to disp_string.
4866
4867 2011-11-01 Martin Rudalics <rudalics@gmx.at>
4868
4869 * window.c (temp_output_buffer_show): Don't use
4870 Vtemp_buffer_show_specifiers.
4871 (Vtemp_buffer_show_specifiers): Remove unused variable.
4872
4873 2011-10-30 Eli Zaretskii <eliz@gnu.org>
4874
4875 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
4876 past the beginning of the current glyph matrix.
4877
4878 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
4879
4880 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
4881 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
4882 HAVE_GTK3 (Bug#9869).
4883
4884 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
4885 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
4886
4887 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
4888
4889 * xterm.c: Declare x_handle_net_wm_state to return int.
4890 (handle_one_xevent): Check if we are iconified but don't have
4891 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
4892 (get_current_wm_state): Return non-zero if not hidden,
4893 check for _NET_WM_STATE_HIDDEN (Bug#9893).
4894 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
4895 (x_handle_net_wm_state): Return what get_current_wm_state returns.
4896 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
4897
4898 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
4899
4900 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
4901 so that this new function doesn't get optimized away by a
4902 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
4903
4904 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
4905
4906 * frame.h (MOUSE_HL_INFO): Remove excess parens.
4907
4908 2011-10-29 Eli Zaretskii <eliz@gnu.org>
4909
4910 Fix the `xbytecode' command.
4911 * .gdbinit (xprintbytestr): New command.
4912 (xwhichsymbols): Rename from `which'; all callers changed.
4913 (xbytecode): Print the byte-code string as well.
4914
4915 2011-10-29 Kim Storm <storm@cua.dk>
4916
4917 * alloc.c (which_symbols): New function.
4918
4919 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
4920
4921 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
4922 line. (Bug#9903)
4923
4924 2011-10-29 Glenn Morris <rgm@gnu.org>
4925
4926 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
4927 Not clear what it was for, and it causes various bugs. (Bug#9839)
4928
4929 2011-10-28 Eli Zaretskii <eliz@gnu.org>
4930
4931 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
4932 possible random value that matches one of those tested as
4933 condition to clear the mouse face.
4934
4935 2011-10-28 Chong Yidong <cyd@gnu.org>
4936
4937 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
4938
4939 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
4940
4941 * window.c (make_window): Initialize phys_cursor_on_p.
4942
4943 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
4944
4945 * lisp.h (struct Lisp_Symbol): Update comments.
4946
4947 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
4948
4949 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
4950
4951 2011-10-28 Eli Zaretskii <eliz@gnu.org>
4952
4953 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
4954 <oslsachem@gmail.com> for helping to debug this.
4955
4956 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
4957 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
4958 (g_b_init_get_glyph_outline_w): New static variables.
4959 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
4960 (GetGlyphOutlineW_Proc): New typedefs.
4961 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
4962 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
4963 New functions.
4964 (w32font_open_internal, compute_metrics):
4965 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
4966 instead of calling the "wide" APIs directly.
4967
4968 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
4969
4970 * w32.h (syms_of_w32font): Add prototype.
4971
4972 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
4973
4974 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
4975 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
4976 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
4977 (Fmove_to_window_line): Doc fix.
4978
4979 2011-10-27 Chong Yidong <cyd@gnu.org>
4980
4981 * process.c (make_process): Set gnutls_state to NULL.
4982
4983 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
4984 non-NULL, regardless of GNUTLS_INITSTAGE.
4985 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
4986 an error. Set process slots as soon as we allocate them.
4987
4988 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
4989
4990 2011-10-27 Chong Yidong <cyd@gnu.org>
4991
4992 * gnutls.c (emacs_gnutls_deinit): New function.
4993 Deallocate credentials structures as well as calling gnutls_deinit.
4994 (Fgnutls_deinit, Fgnutls_boot): Use it.
4995
4996 * process.c (make_process): Initialize GnuTLS credentials to NULL.
4997 (deactivate_process): Call emacs_gnutls_deinit.
4998
4999 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
5000
5001 * image.c (x_create_x_image_and_pixmap):
5002 * w32.c (sys_rename, w32_delayed_load):
5003 * w32font.c (fill_in_logfont):
5004 * w32reg.c (x_get_string_resource): Silence compiler warnings.
5005
5006 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
5007
5008 * w32fns.c (w32_default_color_map): New function,
5009 extracted from Fw32_default_color_map.
5010 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5011
5012 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
5013
5014 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
5015
5016 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
5017
5018 * keyboard.c (test_undefined): New function (bug#9751).
5019 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
5020
5021 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
5022
5023 * sysdep.c (init_sys_modes): Fix the check for the controlling
5024 terminal (Bug#6649).
5025
5026 2011-10-20 Eli Zaretskii <eliz@gnu.org>
5027
5028 * dispextern.h (struct bidi_it): New member next_en_type.
5029
5030 * bidi.c (bidi_line_init): Initialize the next_en_type member.
5031 (bidi_resolve_explicit_1): When next_en_pos is valid for the
5032 current character, check also for next_en_type being WEAK_EN.
5033 (bidi_resolve_weak): Don't enter the expensive loop if the current
5034 position is before next_en_pos. Record the bidi type of the first
5035 non-ET, non-BN character we find, in addition to its position.
5036 (bidi_level_of_next_char): Invalidate next_en_type when
5037 next_en_pos is over-stepped.
5038
5039 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
5040
5041 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
5042 * editfns.c: Rewrite current-time-zone so that it invokes
5043 the equivalent of (format-time-string "%Z") to get the time zone name.
5044 This fixes a bug when the time zone name contains characters that
5045 need converting from the system time locale to Emacs internal format.
5046 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
5047 that patch fixed format-time-string to do the conversion, but
5048 I forgot to fix current-time-zone.
5049 (format_time_string): New function, containing most of
5050 what Fformat_time_string used to contain.
5051 (Fformat_time_string): Rewrite in terms of format_time_string.
5052 This doesn't change this function's behavior.
5053 (current-time-zone): Rewrite to use format_time_string.
5054 This fixes the bug reported by Michael Schierl in
5055 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
5056 Jason Rumney's 2007-06-07 change worked around this bug, but
5057 didn't fix it.
5058 * systime.h (tzname, timezone): Remove no-longer-used declarations.
5059
5060 2011-10-19 Eli Zaretskii <eliz@gnu.org>
5061
5062 * xdisp.c (start_display): If the character at POS is displayed
5063 via a display vector, reset IT->current.dpvec_index to zero.
5064 (try_window_reusing_current_matrix): If a line ends in a display
5065 vector or the next line starts in a display vector, continue
5066 redrawing the window even though the character position of
5067 start_row was reached.
5068 (Bug#9771, part 2)
5069
5070 2011-10-18 Chong Yidong <cyd@gnu.org>
5071
5072 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
5073 with nobreak-char-display too.
5074
5075 2011-10-18 Eli Zaretskii <eliz@gnu.org>
5076
5077 Fix part 3 of bug#9771.
5078 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
5079 (bidi_resolve_neutral): Don't enter the expensive loop looking for
5080 non-neutral characters if the current character is a paragraph
5081 separator (a.k.a. Newline). This avoids running the same
5082 expensive loop twice, once when we consume the preceding newline
5083 and the other time when the line actually needs to be displayed.
5084 Avoid the loop when we see neutrals on the base embedding level
5085 following a character whose directionality is the same as the
5086 paragraph's. This avoids running the expensive loop when a line
5087 ends in a long sequence of neutrals, like control characters.
5088 Add assertion against STRONG_AL type. Slightly rearrange code
5089 that determines the type of a neutral given the first non-neutral
5090 that follows it.
5091 (bidi_level_of_next_char): Set next_en_pos to zero when
5092 invalidating its info.
5093
5094 2011-10-17 Eli Zaretskii <eliz@gnu.org>
5095
5096 * xdisp.c (push_display_prop): Determine whether to record string
5097 or buffer position by IT->string, not by IT->method. Allow
5098 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
5099 (move_it_vertically_backward): Don't look for character position
5100 immediately after the newline when in a continuation line.
5101 (Bug#9771, part 1)
5102
5103 2011-10-15 Martin Rudalics <rudalics@gmx.at>
5104
5105 * window.c (coordinates_in_window): Rewrite and delabelize
5106 vertical border check. (Bug#5357) (Bug#9618)
5107
5108 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
5109
5110 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
5111 errors in XSetWindowBorder (bug#9310).
5112
5113 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
5114
5115 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
5116 avoid crash when xmalloc overrun checking is enabled.
5117
5118 2011-10-13 Eli Zaretskii <eliz@gnu.org>
5119
5120 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
5121 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
5122 cursor motion with <left> and <right> arrow keys.
5123
5124 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
5125 some callers set that themselves.
5126
5127 2011-10-12 Eli Zaretskii <eliz@gnu.org>
5128
5129 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
5130 display string and the previous row comes from the same string and
5131 is empty. (Bug#9739) (Bug#9738)
5132
5133 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
5134
5135 * doc.c (get_doc_string): Encode file name (bug#9735).
5136
5137 2011-10-12 Eli Zaretskii <eliz@gnu.org>
5138
5139 * bidi.c (bidi_level_of_next_char):
5140 * xdisp.c (get_visually_first_element): Remove old incorrect
5141 comments regarding the Unicode Line Separator character.
5142
5143 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
5144
5145 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
5146
5147 * alloc.c (Fgc_status): Do not access beyond zombies array
5148 boundary if nzombies > MAX_ZOMBIES.
5149 * alloc.c (dump_zombies): Add missing format specifier.
5150
5151 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
5152
5153 * xdisp.c (set_cursor_from_row): Simplify conditionals,
5154 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
5155
5156 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
5157 Some packages use them to denote characters with modifiers.
5158
5159 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
5160
5161 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
5162 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
5163 matching a pp-number. Rename parameter var to var1.
5164
5165 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
5166
5167 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
5168
5169 2011-10-08 Glenn Morris <rgm@gnu.org>
5170
5171 * callint.c (Fcall_interactively): Give a more explicit error for the
5172 'c' case with a non-character input. (Bug#8479)
5173
5174 2011-10-08 Eli Zaretskii <eliz@gnu.org>
5175
5176 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
5177 lines.
5178 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
5179 lines that are hscrolled on the left.
5180
5181 * dispnew.c (buffer_posn_from_coords): Account for a possible
5182 presence of header-line. (Bug#4426)
5183
5184 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
5185
5186 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
5187 Don't advertise functionality which we discourage or doesn't work.
5188
5189 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
5190
5191 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
5192 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
5193 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
5194 this makes Emacs dump core during garbage collection on rare
5195 occasions. sizeof is obviously inferior to offsetof here, so
5196 stick with offsetof.
5197 (GC_POINTER_ALIGNMENT): New macro.
5198 (mark_memory): Omit 3rd (offset) arg; caller changed.
5199 Don't assume EMACS_INT alignment is the same as pointer alignment.
5200
5201 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
5202
5203 * keyboard.c (read_key_sequence_remapped): New var.
5204 (read_key_sequence): Compute remapping in the right buffer.
5205 (command_loop_1): Use read_key_sequence's remapping directly.
5206
5207 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
5208
5209 * dired.c (file_name_completion): Don't expand file name.
5210 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
5211 before checking file name handler.
5212
5213 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
5214 they've been requested explicitly (bug#9591).
5215
5216 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
5217
5218 * keymap.c (Fsingle_key_description): Use make_specified_string
5219 instead of build_string to build string from push_key_description.
5220 (Bug#5193)
5221
5222 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
5223
5224 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
5225 This fixes a Y2038 bug on 64-bit hosts.
5226 * buffer.c (reset_buffer):
5227 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
5228 (Fclear_buffer_auto_save_failure):
5229 Use 0, not -1, to represent an unset failure time, since time_t
5230 might not be signed.
5231
5232 Remove dependency on glibc malloc internals.
5233 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
5234 Move back here from lisp.h, but with their new implementations.
5235 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
5236 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
5237 * charset.c (charset_table_init): New static var.
5238 (syms_of_charset): Use it instead of xmalloc. This removes a
5239 dependency on glibc malloc internals. See Eli Zaretskii's comment in
5240 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
5241 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
5242 Move back to alloc.c.
5243 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
5244 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
5245
5246 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
5247
5248 * nsterm.m (windowDidResize): Call x_set_window_size only when
5249 ns_in_resize is true. Otherwise set pixelwidth/height and
5250 call change_frame_size (Bug#9628).
5251
5252 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
5253
5254 Port --enable-checking=all to Fedora 14 x86-64.
5255 * charset.c (syms_of_charset): Also account for glibc malloc's
5256 internal overhead when calculating the initial malloc maximum.
5257
5258 Port --enable-checking=all to Fedora 14 x86.
5259 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
5260 Move to lisp.h.
5261 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
5262 (overrun_check_realloc, overrun_check_free):
5263 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
5264 That way, xmalloc returns a properly-aligned pointer even if
5265 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
5266 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
5267 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
5268 into account when calculating the initial malloc maximum.
5269 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
5270 Move here from alloc.c, so that charset.c can use it too.
5271 Properly align; the old code wasn't right for common 32-bit hosts
5272 when configured with --enable-checking=all.
5273 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
5274 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
5275
5276 2011-09-29 Eli Zaretskii <eliz@gnu.org>
5277
5278 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
5279 use EDOM.
5280
5281 2011-09-28 Eli Zaretskii <eliz@gnu.org>
5282
5283 * xdisp.c (compute_display_string_end): If there's no display
5284 string at CHARPOS, return -1.
5285
5286 * bidi.c (bidi_fetch_char): When compute_display_string_end
5287 returns a negative value, treat the character as a normal
5288 character not covered by a display string. (Bug#9624)
5289
5290 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
5291
5292 * lread.c (Fread_from_string): Fix typo in docstring.
5293
5294 2011-09-27 Eli Zaretskii <eliz@gnu.org>
5295
5296 * xdisp.c (handle_invisible_prop): If invisible text ends on a
5297 newline, reseat the iterator instead of bidi-iterating there one
5298 character at a time. (Bug#9610)
5299 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
5300 TO_CHARPOS if the bidi iterator is at base embedding level.
5301
5302 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
5303
5304 * lread.c (readevalloop): Use correct code for NBSP.
5305 (read1): Likewise. (Bug#9608)
5306
5307 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
5308
5309 * dbusbind.c (Fdbus_register_signal): When service is not
5310 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
5311
5312 2011-09-25 Glenn Morris <rgm@gnu.org>
5313
5314 * buffer.c (truncate-lines): Doc fix.
5315
5316 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
5317
5318 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
5319 (Fset_window_next_buffers): Doc fix.
5320
5321 2011-09-24 Glenn Morris <rgm@gnu.org>
5322
5323 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
5324
5325 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
5326
5327 Fix minor problems found by static checking.
5328 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
5329 * indent.c (Fvertical_motion): Fix == vs = typo.
5330
5331 2011-09-24 Eli Zaretskii <eliz@gnu.org>
5332
5333 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
5334 Default value is now t. Doc fix.
5335
5336 * indent.c (Fvertical_motion): Compute and apply the overshoot
5337 logic when moving up, not only when moving down. Fix the
5338 confusing name and values of the it_overshoot_expected variable;
5339 logic changes accordingly. (Bug#9254) (Bug#9549)
5340
5341 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
5342 CHARPOS is covered by a display string which includes newlines.
5343 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
5344 is covered by a display string with embedded newlines.
5345
5346 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
5347
5348 * dbusbind.c (Fdbus_register_signal): Add match rule to
5349 Vdbus_registered_objects_table. (Bug#9581)
5350 (Fdbus_register_method, Vdbus_registered_objects_table):
5351 Fix docstring.
5352
5353 2011-09-24 Jim Meyering <meyering@redhat.com>
5354
5355 do not ignore write error for any output size
5356 The previous change was incomplete.
5357 While it makes emacs --batch detect the vast majority of stdout
5358 write failures, errors were still ignored whenever the output size is
5359 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
5360 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
5361 && echo FAIL: ignored write error
5362 FAIL: ignored write error
5363 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
5364 && echo FAIL: ignored write error
5365 FAIL: ignored write error
5366 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
5367
5368 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
5369
5370 * emacs.c (Fkill_emacs): In noninteractive mode exit
5371 non-successfully if a write error occurred on stdout. (Bug#9574)
5372
5373 2011-09-21 Eli Zaretskii <eliz@gnu.org>
5374
5375 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
5376 the xassert test.
5377
5378 * dispextern.h (struct it): Update the comment documenting what
5379 can it->OBJECT be.
5380
5381 2011-09-20 Eli Zaretskii <eliz@gnu.org>
5382
5383 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
5384 a display string, extend search for cursor position to end of row.
5385 (find_row_edges): If the row ends in a newline from a display
5386 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
5387 Handle the case of a display string with multiple newlines.
5388 (Fcurrent_bidi_paragraph_direction): Fix search for previous
5389 non-empty line. Fixes confusing cursor motion with arrow keys at
5390 the beginning of a line that starts with whitespace.
5391
5392 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
5393
5394 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
5395 (bug#9493).
5396
5397 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
5398
5399 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
5400 boolean (Bug#9154).
5401
5402 2011-09-18 Eli Zaretskii <eliz@gnu.org>
5403
5404 * xdisp.c (display_line): Record maximum and minimum buffer
5405 positions even if no glyphs were produced (e.g., by a zero-width
5406 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
5407 buffer positions that will be removed from the glyph row because
5408 they don't fit.
5409 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
5410 column is beyond frame width: don't subtract 1 "pixel" when
5411 computing width of the stretch.
5412 (reseat_at_next_visible_line_start): Undo the change made on
5413 2011-09-17 that saved paragraph information and restored it after
5414 the call to `reseat'. (Bug#9545)
5415
5416 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5417
5418 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
5419 and turn window cursor on if cleared (Bug#9415).
5420
5421 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
5422
5423 * search.c (boyer_moore): Take unibyte characters from pattern
5424 literally. (Bug#9458)
5425
5426 2011-09-18 Eli Zaretskii <eliz@gnu.org>
5427
5428 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
5429
5430 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
5431
5432 Fix minor problem found by static checking.
5433 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
5434 initialized, to pacify gcc -Wuninitialized.
5435
5436 * fileio.c: Report proper errno when syscall falls.
5437 (Finsert_file_contents): Save and restore errno,
5438 so that report_file_error outputs the correct diagnostic.
5439 (Fwrite_region) [CLASH_DETECTION]: Likewise.
5440
5441 2011-09-18 Eli Zaretskii <eliz@gnu.org>
5442
5443 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
5444
5445 2011-09-17 Eli Zaretskii <eliz@gnu.org>
5446
5447 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
5448 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
5449
5450 2011-09-17 Eli Zaretskii <eliz@gnu.org>
5451
5452 * xdisp.c (reseat_at_next_visible_line_start): Keep information
5453 about the current paragraph and restore it after the call to reseat.
5454
5455 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
5456 (bidi_find_paragraph_start): Search back for paragraph beginning
5457 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
5458 (bidi_move_to_visually_next): Only trigger paragraph-related
5459 computations when the last character is a newline or at EOB, not
5460 just any NEUTRAL_B. (Bug#9470)
5461
5462 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
5463 truncated lines if point is covered by a display string. (Bug#9524)
5464
5465 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
5466
5467 * xselect.c: Relax test for outgoing X longs (Bug#9498).
5468 (cons_to_x_long): New function.
5469 (lisp_data_to_selection_data): Use it. Correct the test for
5470 short-versus-long data; it was negated. Break out of vector
5471 loop, for efficiency, when a long datum is discovered.
5472
5473 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
5474
5475 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
5476
5477 2011-09-16 Eli Zaretskii <eliz@gnu.org>
5478
5479 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
5480 GCC PR/17406) by declaring this function with external scope.
5481
5482 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
5483
5484 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
5485 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
5486
5487 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
5488
5489 * editfns.c (Fformat): Correctly handle text properties on "%%".
5490
5491 2011-09-15 Eli Zaretskii <eliz@gnu.org>
5492
5493 * xterm.c (x_draw_composite_glyph_string_foreground):
5494 * w32term.c (x_draw_composite_glyph_string_foreground):
5495 * term.c (encode_terminal_code):
5496 * composite.c (composition_update_it, get_composition_id):
5497 * xdisp.c (get_next_display_element)
5498 (fill_composite_glyph_string): Add comments about special meaning
5499 of TAB characters in a composition.
5500
5501 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
5502
5503 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
5504 This occurs when processing a multibyte format.
5505 Problem reported by Wolfgang Jenker.
5506
5507 2011-09-15 Johan Bockgård <bojohan@gnu.org>
5508
5509 * xdisp.c (try_cursor_movement): Only check for exact match if
5510 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
5511
5512 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
5513
5514 Remove unused external symbols.
5515 * dispextern.h (calc_pixel_width_or_height): Remove decl.
5516 * xdisp.c (calc_pixel_width_or_height): Now static.
5517 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
5518 * indent.c (check_display_width):
5519 * w32term.c: Fix comment to match code.
5520 * xterm.c, xterm.h (x_catching_errors): Remove.
5521
5522 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
5523
5524 * xselect.c: Use signed conversions more consistently (Bug#9498).
5525 (selection_data_to_lisp_data): Assume incoming selection data are
5526 signed integers, not unsigned. This is to be consistent with
5527 outgoing selection data, which was modified to use signed integers
5528 in as part of the fix to Bug#9196 in response to Jan D.'s comment
5529 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
5530 expects long, not unsigned long.
5531
5532 2011-09-14 Eli Zaretskii <eliz@gnu.org>
5533
5534 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
5535 computation of loop end. Reported by Johan Bockgård
5536 <bojohan@gnu.org>.
5537
5538 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
5539
5540 * frame.c (Fother_visible_frames_p): Function deleted.
5541
5542 2011-09-12 Eli Zaretskii <eliz@gnu.org>
5543
5544 * indent.c (compute_motion): Process display vector front to back
5545 rather than the other way around. (Bug#2496)
5546
5547 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
5548
5549 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
5550
5551 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
5552
5553 * minibuf.c (Fread_from_minibuffer): Doc fix.
5554
5555 2011-09-11 Eli Zaretskii <eliz@gnu.org>
5556
5557 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
5558 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
5559
5560 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
5561
5562 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
5563 value for non-existent files.
5564
5565 2011-09-11 Eli Zaretskii <eliz@gnu.org>
5566
5567 * fileio.c (Finsert_file_contents): If the file cannot be opened,
5568 set its "size" to -1. This will set the modtime_size field of
5569 the corresponding buffer to -1, which is what
5570 verify-visited-file-modtime expects for files that do not exist.
5571 (Bug#9139)
5572
5573 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
5574
5575 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
5576 here ...
5577 * lisp.h: ... from here. push_key_description is no longer
5578 defined in keyboard.c, so its declaration should not be in
5579 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
5580 logically belongs with push_key_description.
5581
5582 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
5583
5584 * buffer.h: Include <sys/types.h> instead of <time.h>.
5585 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
5586 Problem reported by Herbert J. Skuhra.
5587
5588 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
5589
5590 * xml.c (parse_region): Make the parsing work for
5591 non-comment-starting XML files again (bug#9144).
5592
5593 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
5594
5595 * image.c (gif_load): Fix calculation of bottom and right corner.
5596 (Bug#9468)
5597
5598 2011-09-10 Eli Zaretskii <eliz@gnu.org>
5599
5600 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
5601 redisplay in small windows.
5602
5603 2011-09-09 Eli Zaretskii <eliz@gnu.org>
5604
5605 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
5606
5607 2011-09-08 Martin Rudalics <rudalics@gmx.at>
5608
5609 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
5610 Operate on live windows only.
5611
5612 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
5613
5614 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
5615
5616 2011-09-07 Eli Zaretskii <eliz@gnu.org>
5617
5618 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
5619 only under bidi iteration.
5620
5621 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
5622
5623 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
5624
5625 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
5626
5627 isnan: Fix porting problem to Solaris 10 with bundled gcc.
5628 Without this fix, the command to link temacs failed due to an
5629 undefined symbol __builtin_isnan. This is because
5630 /usr/include/iso/math_c99.h #defines isnan(x) to
5631 __builtin_isnan(x), but the bundled gcc, which identifies itself
5632 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
5633 a __builtin_isnan.
5634 * floatfns.c (isnan): #undef, and then #define to a clone of
5635 what's in data.c.
5636 (Fisnan): Always define, since it's always available now.
5637 (syms_of_floatfns): Always define isnan at the Lisp level.
5638
5639 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
5640
5641 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
5642
5643 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
5644
5645 * fileio.c: Fix bugs with large file offsets (Bug#9428).
5646 The previous code assumed that file offsets (off_t values) fit in
5647 EMACS_INT variables, which is not true on typical 32-bit hosts.
5648 The code messed up by falsely reporting buffer overflow in cases
5649 such as (insert-file-contents "big" nil 1 2) into an empty buffer
5650 when "big" contains more than 2**29 bytes, even though this
5651 inserts just one byte and does not overflow the buffer.
5652 (Finsert_file_contents): Store file offsets as off_t
5653 values, not as EMACS_INT values. Check for overflow when
5654 converting between EMACS_INT and off_t. When checking for
5655 buffer overflow or for overlap, take the offsets into account.
5656 Don't use EMACS_INT for small values where int suffices.
5657 When checking for overlap, fix a typo: ZV was used where
5658 ZV_BYTE was intended.
5659 (Fwrite_region): Don't assume off_t fits into 'long'.
5660 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
5661
5662 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
5663
5664 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
5665
5666 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
5667
5668 sprintf-related integer and memory overflow issues (Bug#9412).
5669
5670 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
5671 (esprintf, exprintf, evxprintf): New functions.
5672 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
5673 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
5674 (modify_event_symbol): Do not assume that the length of
5675 name_alist_or_stem is safe to alloca and fits in int.
5676 (Fexecute_extended_command): Likewise for function name and binding.
5677 (Frecursion_depth): Wrap around reliably on integer overflow.
5678 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
5679 since some callers pass EMACS_INT values.
5680 (Fsingle_key_description): Don't crash if symbol name contains more
5681 than MAX_ALLOCA bytes.
5682 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
5683 (get_minibuffer): Arg is now EMACS_INT, not int.
5684 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
5685 (esprintf, exprintf, evxprintf): New decls.
5686 * window.h (command_loop_level, minibuf_level): Reflect API changes.
5687
5688 * dbusbind.c (signature_cat): New function.
5689 (xd_signature, Fdbus_register_signal):
5690 Do not overrun buffer; instead, report string overflow.
5691
5692 * dispnew.c (add_window_display_history): Don't overrun buffer.
5693 Truncate instead; this is OK since it's just a log.
5694
5695 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
5696 even if the time zone offset is outlandishly large.
5697 Don't mishandle offset == INT_MIN.
5698
5699 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
5700 when creating daemon; the previous buffer-overflow check was incorrect.
5701
5702 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
5703 which has the guts of the old verror function.
5704
5705 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
5706 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
5707
5708 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
5709 (font_unparse_xlfd): Don't blindly alloca long strings.
5710 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
5711 fits in int, when using sprintf. Use single snprintf to count
5712 length of string rather than counting it via multiple sprintfs;
5713 that's simpler and more reliable.
5714 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
5715 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
5716 sprintf, in case result does not fit in int.
5717
5718 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
5719 (fontset_from_font): Print it.
5720
5721 * frame.c (tty_frame_count): Now printmax_t, not int.
5722 (make_terminal_frame, set_term_frame_name): Print it.
5723 (x_report_frame_params): In X, window IDs are unsigned long,
5724 not signed long, so print them as unsigned.
5725 (validate_x_resource_name): Check for implausibly long names,
5726 and don't assume name length fits in 'int'.
5727 (x_get_resource_string): Don't blindly alloca invocation name;
5728 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
5729 not fit in int.
5730
5731 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
5732 (xg_check_special_colors, xg_set_geometry):
5733 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
5734
5735 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
5736 Use esprintf, not sprintf, in case result does not fit in int.
5737
5738 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
5739 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
5740 it as a large positive number.
5741 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
5742 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
5743
5744 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
5745 in case result does not fit in int.
5746
5747 * print.c (float_to_string): Detect width overflow more reliably.
5748 (print_object): Make sprintf buffer a bit bigger, to avoid potential
5749 buffer overrun. Don't assume list length fits in 'int'. Treat
5750 print length of 0 as 0, not as infinity; to be consistent with other
5751 uses of print length in this function. Don't overflow print length
5752 index. Don't assume hash table size fits in 'long', or that
5753 vectorlike size fits in 'unsigned long'.
5754
5755 * process.c (make_process): Use printmax_t, not int, to format
5756 process-name gensyms.
5757
5758 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
5759
5760 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
5761 to avoid potential buffer overrun.
5762
5763 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
5764 if X resource line is longer than 512 bytes.
5765
5766 * xfns.c (x_window): Make sprintf buffer a bit bigger
5767 to avoid potential buffer overrun.
5768
5769 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
5770
5771 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
5772
5773 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
5774
5775 Integer overflow fixes for scrolling, etc.
5776 Without these, Emacs silently mishandles large integers sometimes.
5777 For example, "C-u 4294967297 M-x recenter" was treated as if
5778 it were "C-u 1 M-x recenter" on a typical 64-bit host.
5779
5780 * xdisp.c (try_window_id): Check Emacs fixnum range before
5781 converting to 'int'.
5782
5783 * window.c (window_scroll_line_based, Frecenter):
5784 Check that an Emacs fixnum is in range before assigning it to 'int'.
5785 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
5786 values converted from Emacs fixnums.
5787 (Frecenter): Don't wrap around a line count if it is out of 'int'
5788 range; instead, treat it as an extreme value.
5789 (Fset_window_configuration, compare_window_configurations):
5790 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
5791
5792 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
5793 that can exceed INT_MAX. Check that EMACS_INT value is in range
5794 before assigning it to the (possibly-narrower) index.
5795 (match_limit): Don't assume that a fixnum can fit in 'int'.
5796
5797 * print.c (print_object): Use ptrdiff_t, not int, for index that can
5798 exceed INT_MAX.
5799
5800 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
5801 (Fvertical_motion): Don't wrap around LINES values that don't fit
5802 in 'int'. Instead, treat them as extreme values. This is good
5803 enough for windows, which can't have more than INT_MAX lines anyway.
5804
5805 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
5806
5807 * Require libxml/parser.h to avoid compilation warning.
5808
5809 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
5810
5811 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
5812 since this reportedly can destroy thread storage.
5813
5814 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
5815
5816 * syntax.c (find_defun_start): Update all cache variables if
5817 exiting early (Bug#9401).
5818
5819 2011-08-30 Eli Zaretskii <eliz@gnu.org>
5820
5821 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
5822
5823 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
5824 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
5825 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
5826
5827 * term.c (tty_append_glyph): New function.
5828 (produce_stretch_glyph): Static function and its prototype deleted.
5829
5830 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
5831 Add prototypes.
5832
5833 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
5834
5835 * image.c (parse_image_spec): Check for nonnegative, not for positive,
5836 when checking :margin (Bug#9390).
5837 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
5838 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
5839 so that the name doesn't mislead. All uses changed.
5840
5841 2011-08-28 Johan Bockgård <bojohan@gnu.org>
5842
5843 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
5844 set_tty_hooks.
5845
5846 2011-08-27 Eli Zaretskii <eliz@gnu.org>
5847
5848 * xdisp.c (move_it_to): Don't bail out early when reaching
5849 position beyond to_charpos, if we are scanning backwards.
5850 (move_it_vertically_backward): When DY == 0, make sure we get to
5851 the first character in the line after the newline.
5852
5853 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
5854
5855 * ccl.c: Improve and simplify overflow checking (Bug#9196).
5856 (ccl_driver): Do not generate an out-of-range pointer.
5857 (Fccl_execute_on_string): Remove unnecessary check for
5858 integer overflow, noted by Stefan Monnier in
5859 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
5860 Remove a FIXME that didn't need fixing.
5861 Simplify the newly-introduced buffer reallocation code.
5862
5863 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
5864
5865 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
5866
5867 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
5868
5869 Integer and memory overflow issues (Bug#9196).
5870
5871 * doc.c (get_doc_string): Rework so that
5872 get_doc_string_buffer_size is the actual buffer size, rather than
5873 being 1 less than the actual buffer size; this makes xpalloc more
5874 convenient.
5875
5876 * image.c (x_allocate_bitmap_record, cache_image):
5877 * xselect.c (Fx_register_dnd_atom):
5878 Simplify previous changes by using xpalloc.
5879
5880 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
5881 since either will do and ptrdiff_t is convenient with xpalloc.
5882
5883 * charset.c (charset_table_size)
5884 (struct charset_sort_data.priority): Now ptrdiff_t.
5885 (charset_compare): Don't overflow if priorities differ greatly.
5886 (Fsort_charsets): Don't assume list length fits in int.
5887 Check for size-calculation overflow when allocating sort data.
5888 (syms_of_charset): Allocate an initial charset table that is
5889 just under 64 KiB, to avoid problems with glibc malloc and mmap.
5890
5891 * cmds.c (internal_self_insert): Check for size-calculation overflow.
5892
5893 * composite.h (struct composition.glyph_len): Now int, not unsigned.
5894 The actual value is always <= INT_MAX, and leaving it unsigned made
5895 overflow checking harder.
5896
5897 * dispextern.h (struct glyph_matrix.rows_allocated)
5898 (struct face_cache.size): Now ptrdiff_t, for convenience in use
5899 with xpalloc. The values are still always <= INT_MAX.
5900
5901 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
5902
5903 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
5904 (SAFE_NALLOCA): New macro.
5905
5906 * region-cache.c (struct boundary.pos, find_cache_boundary)
5907 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
5908 (set_cache_region, invalidate_region_cache)
5909 (revalidate_region_cache, know_region_cache, region_cache_forward)
5910 (region_cache_backward, pp_cache):
5911 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
5912 so that ptrdiff_t * can be passed to xpalloc.
5913 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
5914 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
5915 (pp_cache): Don't assume cache_len fits in int.
5916 * region-cache.h: Adjust extern decls to match.
5917
5918 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
5919 EMACS_INT, since either will do, for xpalloc.
5920
5921 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
5922 (xnmalloc, xnrealloc, xpalloc): New functions.
5923
5924 * bidi.c (bidi_shelve_header_size): New constant.
5925 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
5926 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
5927
5928 * bidi.c (bidi_cache_shrink):
5929 * buffer.c (overlays_at, overlays_in, record_overlay_string)
5930 (overlay_strings):
5931 Don't update size of array until after memory allocation succeeds,
5932 because xmalloc/xrealloc may not return.
5933 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
5934 now that we have proper integer overflow checking.
5935 (record_overlay_string, overlay_strings): Catch overflows when
5936 calculating size of overlay_str_buf.
5937
5938 * callproc.c (Fcall_process): Check for size overflow when
5939 calculating size of args2.
5940 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
5941 Normally we prefer signed values, but sticking with ptrdiff_t would
5942 require adding more-complicated checks.
5943
5944 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
5945 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
5946 Redo buffer-overflow calculations to avoid integer overflow.
5947 Add a FIXME comment where memory seems to be over-allocated.
5948
5949 * character.c (Fstring): Check for size-calculation overflow.
5950
5951 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
5952 unnecessary integer overflow. Check for size overflow.
5953 (encode_coding_object): Don't update size until xmalloc succeeds.
5954
5955 * composite.c (get_composition_id): Check for overflow in glyph
5956 length calculations.
5957
5958 Integer and memory overflow fixes for display code.
5959 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
5960 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
5961 (scrolling_window): Check for overflow in size calculations.
5962 (line_draw_cost, realloc_glyph_pool, add_row_entry):
5963 Don't assume glyph table len fits in int.
5964 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
5965 (row_table_size): Now ptrdiff_t, not int.
5966 (scrolling_window): Avoid overflow in size calculations.
5967 Don't update size until allocation succeeds.
5968 * fns.c (concat): Check for overflow in size calculations.
5969 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
5970 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
5971 (NEXT_ALMOST_PRIME_LIMIT): New constant.
5972
5973 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
5974 (get_doc_string): Check for size calculation overflow.
5975 Don't update size until allocation succeeds.
5976 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
5977 EMACS_INT, where ptrdiff_t will do.
5978 (Fsubstitute_command_keys): Check for string overflow.
5979
5980 * editfns.c (set_time_zone_rule): Don't assume environment length
5981 fits in int.
5982 (message_length): Now ptrdiff_t, not int.
5983 (Fmessage_box): Don't update size until allocation succeeds.
5984 Don't assume message length fits in int.
5985 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
5986
5987 * emacs.c (main): Do not reallocate argv, since there is a null at
5988 the end that can be overwritten, and this way there's no need to
5989 worry about size-calculation overflow.
5990 (sort_args): Check for size-calculation overflow.
5991
5992 * eval.c (init_eval_once, grow_specpdl): Don't update size until
5993 alloc succeeds.
5994 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
5995
5996 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
5997 (x_set_scroll_bar_width, x_figure_window_size):
5998 Check for integer overflow.
5999 (x_set_alpha): Do not assume XINT fits in int.
6000
6001 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
6002 This is for the members text_lines, text_cols, total_lines, total_cols,
6003 where the system imposes an 'int' limit.
6004
6005 * fringe.c (Fdefine_fringe_bitmap):
6006 Don't update size until alloc works.
6007
6008 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
6009 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
6010
6011 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
6012 Check for size-calculation overflow.
6013 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
6014 do, as we prefer signed integers.
6015 (id_to_widget.max_size, id_to_widget.used)
6016 (xg_store_widget_in_map, xg_remove_widget_from_map)
6017 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
6018 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
6019 Use and return ptrdiff_t, not int.
6020 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
6021 * gtkutil.h: Change prototypes to match the above.
6022
6023 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
6024 are duplicate now that they've been promoted to lisp.h.
6025 (x_allocate_bitmap_record, x_alloc_image_color)
6026 (make_image_cache, cache_image, xpm_load):
6027 Don't update size until alloc is done.
6028 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
6029 (x_detect_edges):
6030 Check for size calculation overflow.
6031 (ct_colors_allocated_max): New constant.
6032 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
6033 overflow.
6034
6035 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
6036 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
6037 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
6038 Use ptrdiff_t, not int, to count maps.
6039 (read_char_minibuf_menu_prompt): Check for overflow in size
6040 calculations. Don't update size until allocation succeeds.
6041 Redo calculations to avoid overflow.
6042 * keyboard.h: Change prototypes to match the above.
6043
6044 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
6045 to count maps.
6046 (current_minor_maps): Check for size calculation overflow.
6047 * keymap.h: Change prototypes to match the above.
6048
6049 * lread.c (read1, init_obarray): Don't update size until alloc done.
6050
6051 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
6052 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
6053
6054 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
6055 Now ptrdiff_t, not int.
6056 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
6057 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
6058
6059 * process.c (Fnetwork_interface_list): Check for overflow
6060 in size calculation.
6061
6062 * region-cache.c (move_cache_gap): Check for size calculation overflow.
6063
6064 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
6065 overflow. Don't bother calling xmalloc when xrealloc will do.
6066
6067 * search.c (Freplace_match): Check for size calculation overflow.
6068 (Fset_match_data): Don't assume list lengths fit in 'int'.
6069
6070 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
6071 for command line length. Do not attempt to address one before the
6072 beginning of an array, as that's not portable.
6073
6074 * term.c (max_frame_lines): Remove; unused.
6075 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
6076 not int.
6077 (encode_terminal_code, calculate_costs): Check for size
6078 calculation overflow.
6079 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
6080 table lengths and related sizes. Don't update size until alloc
6081 done. Redo calculations to avoid overflow.
6082 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
6083
6084 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
6085 subtracting pointers.
6086 (gobble_line): Check for overflow more carefully. Don't update size
6087 until alloc done.
6088
6089 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
6090 Don't update size until alloc done.
6091 Redo size calculations to avoid overflow.
6092 Check for size calculation overflow.
6093 (main) [DEBUG]: Fix typo in invoking tparam1.
6094
6095 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
6096 Use ptrdiff_t, not int, for sizes.
6097 (store_mode_line_noprop_char): Don't update size until alloc done.
6098
6099 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
6100 Use ptrdiff_t, not int, for sizes.
6101 (Finternal_make_lisp_face, cache_face):
6102 Check for size calculation overflow.
6103 (cache_face): Treat size calculation overflows as if they were
6104 memory exhaustion (the usual treatment), rather than aborting.
6105
6106 * xfns.c (x_encode_text, x_set_name_internal)
6107 (Fx_change_window_property): Use ptrdiff_t, not int, to count
6108 sizes, since they can exceed INT_MAX in size. Check for size
6109 calculation overflow.
6110
6111 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
6112 (xg_select): Check for size calculation overflow.
6113 Don't update size until alloc done.
6114
6115 * xrdb.c (get_environ_db): Don't assume path length fits in int,
6116 as sprintf is limited to int lengths.
6117
6118 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
6119 (X_LONG_MIN): New macros.
6120 Use them to make the following changes clearer.
6121 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
6122 This change doesn't affect the value now, but it may help remind
6123 future maintainers not to raise the value too much later.
6124 (SELECTION_QUANTUM): Remove, replacing with ...
6125 (selection_quantum): ... new function, which avoids overflow.
6126 All uses changed.
6127 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
6128 assumption that selection length fits in 'int'.
6129 (x_reply_selection_request, x_handle_selection_request)
6130 (x_get_window_property, receive_incremental_selection)
6131 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
6132 (lisp_data_to_selection_data, clean_local_selection_data):
6133 Use ptrdiff_t, not int, to record length of selection.
6134 (x_reply_selection_request, x_get_window_property)
6135 (receive_incremental_selection, x_property_data_to_lisp):
6136 Redo calculations to avoid overflow.
6137 (x_reply_selection_request): When sending hint, ceiling it at
6138 X_LONG_MAX rather than relying on wraparound overflow to send
6139 something.
6140 (x_get_window_property, receive_incremental_selection)
6141 (lisp_data_to_selection_data, x_property_data_to_lisp):
6142 Check for size-calculation overflow.
6143 (x_get_window_property, receive_incremental_selection)
6144 (lisp_data_to_selection_data, Fx_register_dnd_atom):
6145 Don't store size until memory allocation succeeds.
6146 (x_get_window_property): Plug memory leak on memory exhaustion.
6147 Don't double-block input; malloc is safe here. Don't assume 2**34
6148 - 4 fits in unsigned long. Add an xassert to check
6149 XGetWindowProperty overflow. Be more careful about overflow
6150 calculations, and distinguish size from memory overflow better.
6151 (receive_incremental_selection): When tracing, don't assume
6152 unsigned int is less than INT_MAX.
6153 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
6154 harmful) conversions of unsigned short to int.
6155 (lisp_data_to_selection_data): Don't assume that integers
6156 in the range -65535 through -1 fit in an X unsigned short.
6157 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
6158 result parameters unless successful. Rely on cons_to_unsigned
6159 to report problems with elements; the old code wasn't right anyway.
6160 (x_check_property_data): Check for int overflow; we cannot use
6161 a wider type due to X limits.
6162 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
6163
6164 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
6165
6166 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
6167 (x_term_init): Check for size calculation overflow.
6168 (x_color_cells): Don't store size until memory allocation succeeds.
6169 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
6170 Don't assume alloca size is less than MAX_ALLOCA.
6171 (x_term_init): Don't assume length fits in int (sprintf is limited
6172 to int size).
6173
6174 Use ptrdiff_t for composition IDs.
6175 * character.c (lisp_string_width):
6176 * composite.c (composition_table_size, n_compositions)
6177 (get_composition_id, composition_gstring_from_id):
6178 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
6179 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
6180 * window.c (Frecenter):
6181 Use ptrdiff_t, not int, for composition IDs.
6182 * composite.c (get_composition_id): Check for integer overflow.
6183 * composite.h: Adjust prototypes to match the above changes.
6184
6185 Use ptrdiff_t for hash table indexes.
6186 * category.c (hash_get_category_set):
6187 * ccl.c (ccl_driver):
6188 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
6189 * coding.c (coding_system_charset_list, detect_coding_system):
6190 * coding.h (struct coding_system.id):
6191 * composite.c (get_composition_id, gstring_lookup_cache):
6192 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
6193 * image.c (xpm_get_color_table_h):
6194 * lisp.h (hash_lookup, hash_put):
6195 * minibuf.c (Ftest_completion):
6196 Use ptrdiff_t for hash table indexes, not int (which is too
6197 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
6198 32-bit --with-wide-int hosts).
6199
6200 * charset.c (Fdefine_charset_internal): Check for integer overflow.
6201 Add a FIXME comment about memory leaks.
6202 (syms_of_charset): Don't assume xmalloc returns.
6203
6204 Don't assume that stated character widths fit in int.
6205 * character.c (Fchar_width, c_string_width, lisp_string_width):
6206 * character.h (CHAR_WIDTH):
6207 * indent.c (MULTIBYTE_BYTES_WIDTH):
6208 Use sanitize_char_width to avoid undefined and/or bad behavior
6209 with outlandish widths.
6210 * character.h (sanitize_tab_width): Rename from sanitize_width,
6211 now that we have two such functions. All uses changed.
6212 (sanitize_char_width): New inline function.
6213
6214 Don't assume that tab-width fits in int.
6215 * character.h (sanitize_width): New inline function.
6216 (SANE_TAB_WIDTH): New macro.
6217 (ASCII_CHAR_WIDTH): Use it.
6218 * indent.c (sane_tab_width): Remove. All uses replaced by
6219 SANE_TAB_WIDTH (current_buffer).
6220 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
6221
6222 * fileio.c: Integer overflow issues with file modes.
6223 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
6224
6225 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
6226 Remove unreachable code.
6227 (read_hex, load_charset_map_from_file): Check for integer overflow.
6228
6229 * xterm.c: Don't go over XClientMessageEvent limit.
6230 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
6231 (x_send_scroll_bar_event): Likewise. Check that the size does not
6232 exceed limits imposed by XClientMessageEvent, as well as the usual
6233 ptrdiff_t and size_t limits.
6234
6235 * keyboard.c: Overflow, signedness and related fixes.
6236 (make_lispy_movement): Use same integer type in forward decl
6237 that is used in the definition.
6238 (read_key_sequence, keyremap_step):
6239 Change bufsize argument back to int, undoing my 2011-03-30 change.
6240 We prefer signed types, and int is wide enough here.
6241 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
6242 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
6243 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
6244 length, not size_t. Use ptrdiff_t for index, not int.
6245 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
6246 possibility of integer overflow.
6247
6248 Overflow, signedness and related fixes for images.
6249
6250 * dispextern.h (struct it.stack[0].u.image.image_id)
6251 (struct_it.image_id, struct image.id, struct image_cache.size)
6252 (struct image_cache.used, struct image_cache.ref_count):
6253 * gtkutil.c (update_frame_tool_bar):
6254 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
6255 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
6256 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
6257 * nsmenu.m (update_frame_tool_bar):
6258 * xdisp.c (calc_pixel_width_or_height):
6259 * xfns.c (image_cache_refcount):
6260 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
6261 on typical 64-bit hosts.
6262
6263 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
6264 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
6265 Omit unnecessary casts to int.
6266 (parse_image_spec): Check that integers fall into 'int' range
6267 when the callers expect that.
6268 (image_ascent): Redo ascent calculation to avoid int overflow.
6269 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
6270 (lookup_image): Remove unnecessary tests.
6271 (xbm_image_p): Locals are now of int, not EMACS_INT,
6272 since parse_image_check makes sure they fit into int.
6273 (png_load, gif_load, svg_load_image):
6274 Prefer int to unsigned where either will do.
6275 (tiff_handler): New function, combining the cores of the
6276 old tiff_error_handler and tiff_warning_handler.
6277 This function is rewritten to use vsnprintf and thereby avoid
6278 stack buffer overflows. It uses only the features of vsnprintf
6279 that are common to both POSIX and native Microsoft.
6280 (tiff_error_handler, tiff_warning_handler): Use it.
6281 (tiff_load, gif_load, imagemagick_load_image):
6282 Don't assume :index value fits in 'int'.
6283 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
6284 (imagemagick_load_image): Check that crop parameters fit into
6285 the integer types that MagickCropImage accepts. Don't assume
6286 Vimagemagick_render_type has a nonnegative value. Don't assume
6287 size_t fits in 'long'.
6288 (gs_load): Use printmax_t to print the widest integers possible.
6289 Check for integer overflow when computing image height and width.
6290
6291 2011-08-26 Eli Zaretskii <eliz@gnu.org>
6292
6293 * xdisp.c (redisplay_window): Don't force window start if point
6294 will be invisible in the resulting window. (Bug#9324)
6295
6296 2011-08-25 Eli Zaretskii <eliz@gnu.org>
6297
6298 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
6299 the display spec is of the form `(space ...)'.
6300 (handle_display_spec): Return the value returned by
6301 handle_single_display_spec, not just 1 or zero.
6302 (handle_single_display_spec): If the display spec is of the form
6303 `(space ...)', and specifies display in the text area, return 2
6304 rather than 1.
6305 (try_cursor_movement): Check for the need to scroll more
6306 accurately, and prefer exact match for point under bidi.
6307 Don't advance `row' beyond the last row of the window.
6308
6309 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
6310 into disp_prop; all users changed.
6311
6312 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
6313 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
6314 for the text covered by the display property.
6315
6316 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
6317
6318 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
6319 Change return value to nil.
6320 (Frecord_buffer): Delete unused function.
6321
6322 2011-08-24 Eli Zaretskii <eliz@gnu.org>
6323
6324 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
6325 buffers, return left-to-right.
6326 (set_cursor_from_row): Consider candidate row a win if its glyph
6327 represents a newline and point is on that newline. Fixes cursor
6328 positioning on the newline at EOL of R2L text within L2R
6329 paragraph, and vice versa.
6330 (try_cursor_movement): Check continued rows, in addition to
6331 continuation rows. Fixes unwarranted scroll when point enters a
6332 continued line of R2L text within an L2R paragraph, or vice versa.
6333 (cursor_row_p): Consider the case of point being equal to
6334 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
6335 from the end of a short line to the beginning of a continued line
6336 of R2L text within L2R paragraph.
6337 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
6338 composed characters.
6339
6340 * bidi.c (bidi_check_type): Use xassert.
6341 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
6342 members.
6343
6344 2011-08-23 Eli Zaretskii <eliz@gnu.org>
6345
6346 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
6347 a character.
6348
6349 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
6350
6351 * nsfont.m (ns_otf_to_script): Fix typo.
6352
6353 2011-08-22 Kenichi Handa <handa@m17n.org>
6354
6355 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
6356 extra slot even if the purpose is char-code-property-table.
6357
6358 2011-08-23 Eli Zaretskii <eliz@gnu.org>
6359
6360 * xdisp.c (redisplay_window): When computing centering_position,
6361 account for the height of the header line. (Bug#8874)
6362
6363 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
6364 instead of CHAR_TO_BYTE. Fixes a crash when a completion
6365 candidate is selected by the mouse, and that candidate has a
6366 composed character under the mouse.
6367
6368 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
6369 coordinates reported by pos-visible-in-window-p for a composed
6370 character in column zero.
6371
6372 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
6373
6374 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
6375
6376 2011-08-22 Eli Zaretskii <eliz@gnu.org>
6377
6378 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
6379 consider it a hit if to_charpos is anywhere in the range of the
6380 composed buffer positions.
6381
6382 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
6383
6384 * image.c (gif_load): Don't assume that each subimage has the same
6385 dimensions as the base image. Handle disposal method that is
6386 "undefined" by the gif spec (Bug#9335).
6387
6388 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
6389
6390 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
6391 (Fcondition_case): Document `debug' symbol in error handler.
6392
6393 2011-08-19 Eli Zaretskii <eliz@gnu.org>
6394
6395 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
6396 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
6397 from an Org mode buffer to a Speedbar frame.
6398
6399 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
6400 a composition, take its buffer position from IT->cmp_it.charpos.
6401 Fixes cursor positioning at the beginning of a line that begins
6402 with a composed character.
6403
6404 2011-08-18 Eli Zaretskii <eliz@gnu.org>
6405
6406 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
6407 character bidirectional type, use STRONG_L instead. Fixes crashes
6408 in a buffer produced by `describe-categories'.
6409
6410 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
6411 members before the level stack, so they would be saved and
6412 restored when copying iterator state. Fixes incorrect reordering
6413 around TABs covered by display properties.
6414
6415 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
6416
6417 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
6418
6419 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
6420
6421 * eval.c (internal_condition_case, internal_condition_case_1)
6422 (internal_condition_case_2, internal_condition_case_n):
6423 Remove unnecessary aborts (Bug#9081).
6424
6425 2011-08-17 Eli Zaretskii <eliz@gnu.org>
6426
6427 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
6428 has no `load' handler, try opening the file locally. (Bug#9311)
6429
6430 2011-08-16 Ken Brown <kbrown@cornell.edu>
6431
6432 * gmalloc.c: Expand comment.
6433
6434 2011-08-16 Eli Zaretskii <eliz@gnu.org>
6435
6436 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
6437 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
6438
6439 2011-08-16 Ken Brown <kbrown@cornell.edu>
6440
6441 Fix memory allocation problems in Cygwin build (Bug#9273).
6442
6443 * unexcw.c ( __malloc_initialized): Declare external variable.
6444 (fixup_executable): Force the dumped emacs to reinitialize malloc.
6445
6446 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
6447 New variables.
6448 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
6449 dumped emacs.
6450 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
6451 in the static heap.
6452 [CYGWIN] (special_realloc): New function.
6453 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
6454 requests to realloc storage in the static heap.
6455
6456 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
6457
6458 * bidi.c (bidi_initialize): Remove unused local.
6459
6460 2011-08-15 Eli Zaretskii <eliz@gnu.org>
6461
6462 * bidimirror.h:
6463 * biditype.h: Remove file.
6464 * makefile.w32-in ($(BLD)/bidi.$(O)):
6465 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
6466
6467 * dispextern.h: Fix a typo in the comment to bidi_type_t.
6468
6469 * chartab.c: Improve commentary for the uniprop_table API.
6470
6471 * bidi.c (bidi_paragraph_init): Support zero value of
6472 bidi_ignore_explicit_marks_for_paragraph_level.
6473 (bidi_initialize): Use uniprop_table instead of including
6474 biditype.h and bidimirror.h.
6475
6476 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
6477 coordinates of the iterator when restoring from ppos_it.
6478 (Bug#9296)
6479
6480 2011-08-14 Kenichi Handa <handa@m17n.org>
6481
6482 * process.c (create_process): Call setup_process_coding_systems
6483 after the pid of the process is set to -1 (Bug#8162).
6484
6485 2011-08-14 Eli Zaretskii <eliz@gnu.org>
6486
6487 * xdisp.c (move_it_in_display_line_to): Don't invoke
6488 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
6489 ppos_it. Fixes vertical cursor motion when line beginning is
6490 covered by an image. (Bug#9296)
6491
6492 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
6493
6494 * nsterm.h (ns_run_ascript): Declare.
6495 (NSAPP_DATA2_RUNASSCRIPT): Define.
6496
6497 * nsfns.m (as_script, as_result, as_status): New static variables.
6498 (ns_run_ascript): New function.
6499 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
6500 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
6501 the event loop. Get status from as_status (Bug#7276).
6502
6503 * nsterm.m (sendEvent): If event is NSApplicationDefined and
6504 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
6505 the event loop (Bug#7276).
6506
6507 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
6508
6509 * gnutls.c (QCgnutls_bootprop_priority)
6510 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
6511 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
6512 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
6513 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
6514 (QCgnutls_bootprop_verify_hostname_error)
6515 (QCgnutls_bootprop_callbacks_verify): Rename from
6516 Qgnutls_bootprop_..., all uses changed.
6517
6518 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
6519 uses changed.
6520
6521 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
6522
6523 * xfaces.c (Qframe_set_background_mode): Now static.
6524 * dispextern.h (Qframe_set_background_mode): Remove decl.
6525
6526 * process.c (Fnetwork_interface_info): Declare local only if needed.
6527
6528 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
6529
6530 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
6531 (Fnetwork_interface_list): Allocate in increments of bytes instead
6532 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
6533 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
6534 sockaddr.
6535 (struct ifflag_def): notrailers is smart on OSX.
6536 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
6537 Get hardware address with getifaddrs if available.
6538
6539 2011-08-12 Eli Zaretskii <eliz@gnu.org>
6540
6541 * xdisp.c (iterate_out_of_display_property): xassert that
6542 IT->position is set to within IT->object's boundaries. Break from
6543 the loop as soon as EOB is reached; avoids infloops in redisplay
6544 when IT->position is set up wrongly due to some bug.
6545 Set IT->current to match the bidi iterator unconditionally.
6546 (push_display_prop): Allow GET_FROM_STRING as IT->method on
6547 entry. Force push_it to save on the stack the current
6548 buffer/string position, to be restored by pop_it. Fix flags in
6549 the iterator structure wrt the object coming from a display
6550 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
6551 properties. (Bug#9284)
6552
6553 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
6554
6555 * fontset.c (fontset_get_font_group): Add proper type checks.
6556 (Bug#9172)
6557
6558 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6559
6560 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
6561 and LC_VERSION_MIN_MACOSX.
6562 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
6563 (dump_it) [LC_FUNCTION_STARTS]: Use it.
6564
6565 2011-08-08 Eli Zaretskii <eliz@gnu.org>
6566
6567 * xdisp.c (forward_to_next_line_start): Allow to use the
6568 no-display-properties-and-no-overlays under bidi display.
6569 Set disp_pos in the bidi iterator to avoid searches for display
6570 properties and overlays.
6571
6572 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
6573
6574 * editfns.c (Fset_time_zone_rule): Document relationship with the
6575 setenv function.
6576
6577 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
6578 the font entity extracted from the cache (Bug#8109).
6579
6580 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
6581
6582 * composite.c (autocmp_chars): Don't reset point. That is done by
6583 restore_point_unwind (Bug#5984).
6584
6585 2011-08-07 Juri Linkov <juri@jurta.org>
6586
6587 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
6588 to show the arg `TIME' instead of `TIMEVAL'.
6589
6590 2011-08-06 Eli Zaretskii <eliz@gnu.org>
6591
6592 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
6593 display property strides EOL and includes a newline, as in
6594 longlines-mode. (Bug#9254)
6595 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
6596 word-wrap under bidirectional display. (Bug#9224)
6597
6598 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
6599 is non-zero, even if the data buffer is NULL. Fixes a crash in
6600 vertical-motion with longlines-mode. (Bug#9254)
6601
6602 2011-08-05 Eli Zaretskii <eliz@gnu.org>
6603
6604 * bidi.c <bidi_cache_total_alloc>: Now static.
6605 (bidi_initialize): Initialize bidi_cache_total_alloc.
6606
6607 * xdisp.c (display_line): Release buffer allocated for shelved bidi
6608 cache. (Bug#9221)
6609
6610 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
6611 amount allocated this far in `bidi_cache_total_alloc'.
6612 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
6613 non-zero, only free the data buffer without restoring the cache
6614 contents. All callers changed.
6615
6616 * dispextern.h (bidi_unshelve_cache): Update prototype.
6617
6618 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
6619 (move_it_in_display_line, move_it_to)
6620 (move_it_vertically_backward, move_it_by_lines): Replace the call
6621 to xfree to an equivalent call to bidi_unshelve_cache.
6622 (move_it_in_display_line_to): Fix logic of returning
6623 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
6624
6625 2011-08-05 Eli Zaretskii <eliz@gnu.org>
6626
6627 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
6628 came from a string character with a `cursor' property. (Bug#9229)
6629
6630 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
6631
6632 * Makefile.in (LIB_PTHREAD): New variable.
6633 (LIBES): Add LIB_PTHREAD (Bug#9216).
6634
6635 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
6636 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
6637
6638 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
6639
6640 * regex.c (re_iswctype): Remove some redundant boolean conversions.
6641
6642 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
6643
6644 * xterm.c (x_find_topmost_parent): New function.
6645 (x_set_frame_alpha): Find topmost parent window with
6646 x_find_topmost_parent and set the property there also (bug#9181).
6647 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
6648
6649 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
6650
6651 * callproc.c (Fcall_process): Avoid vfork clobbering
6652 the local vars buffer, coding_systems, current_dir.
6653
6654 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
6655
6656 * keymap.c (Fmake_composed_keymap): Move to subr.el.
6657
6658 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
6659
6660 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
6661 so that it is not optimized away.
6662
6663 * xdisp.c (compute_display_string_pos): Remove unused local.
6664
6665 2011-08-02 Eli Zaretskii <eliz@gnu.org>
6666
6667 Fix slow cursor motion and scrolling in large buffers with
6668 selective display, like Org Mode buffers. (Bug#9218)
6669
6670 * dispextern.h (struct bidi_it): New member disp_prop_p.
6671
6672 * xdisp.c: Remove one-slot cache of display string positions.
6673 (compute_display_string_pos): Accept an additional argument
6674 DISP_PROP_P; callers changed. Scan at most 5K characters forward
6675 for a display string or property. If found, set DISP_PROP_P
6676 non-zero.
6677
6678 * bidi.c (bidi_fetch_char): Accept an additional argument
6679 DISP_PROP_P, and pass it to compute_display_string_pos.
6680 Only handle text covered by a display string if DISP_PROP_P is returned
6681 non-zero. All callers of bidi_fetch_char changed.
6682
6683 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
6684
6685 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
6686
6687 2010-12-03 Don March <don@ohspite.net>
6688
6689 * keymap.c (Fdefine_key): Fix non-prefix key error message when
6690 last character M-[char] is translated to ESC [char] (bug#7541).
6691
6692 2011-08-02 Kenichi Handa <handa@m17n.org>
6693
6694 * lisp.h (uniprop_table): Extern it.
6695
6696 * chartab.c (uniprop_table): Make it non-static.
6697
6698 2011-08-01 Eli Zaretskii <eliz@gnu.org>
6699
6700 * xdisp.c (forward_to_next_line_start): Accept additional argument
6701 BIDI_IT_PREV, and store into it the state of the bidi iterator had
6702 on the newline.
6703 (reseat_at_next_visible_line_start): Use the bidi iterator state
6704 returned by forward_to_next_line_start to restore the state of
6705 it->bidi_it after backing up to previous newline. (Bug#9212)
6706
6707 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
6708
6709 * regex.c (re_comp): Protoize.
6710 (re_exec): Fix return type.
6711 (regexec): Fix type of `ret'. (Bug#9203)
6712
6713 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
6714
6715 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
6716 This is needed if max-image-size is a floating-point number.
6717
6718 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
6719
6720 * print.c (print_object): Print empty symbol as ##.
6721
6722 * lread.c (read1): Read ## as empty symbol.
6723
6724 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
6725
6726 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
6727 setting frame foreground color (Bug#9175).
6728 (x_set_background_color): Likewise.
6729
6730 * nsmenu.m (-setText): Size tooltip dimensions precisely to
6731 contents (Bug#9176).
6732 (EmacsTooltip -init): Remove bezels and add shadows to
6733 tooltip windows.
6734
6735 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
6736 or scroll bar (Bug#8470).
6737
6738 * nsfont.m (nsfont_open): Remove assignment to voffset and
6739 unnecessary vars hshink, expand, hd, full_height, min_height.
6740 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
6741
6742 * nsterm.h (nsfont_info): Remove voffset field.
6743
6744 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
6745
6746 Implement strike-through and overline on NextStep (Bug#8863).
6747
6748 * nsfont.m (nsfont_open): Use underline position provided by font,
6749 instead of hard-coded value of 2.
6750 (nsfont_draw): Call ns_draw_text_decoration instead.
6751
6752 * nsterm.h: Add declaration for ns_draw_text_decoration.
6753
6754 * nsterm.m (ns_draw_text_decoration): New function for drawing
6755 underline, overline, and strike-through.
6756 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
6757 ns_draw_text_decoration. Change treatment of cursor drawing to
6758 accommodate underlining, etc.
6759
6760 2011-07-28 Eli Zaretskii <eliz@gnu.org>
6761
6762 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
6763 default.
6764
6765 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
6766
6767 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
6768 Without this fix, if a signal arrives just after memory fills up,
6769 'malloc' might be invoked reentrantly.
6770
6771 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
6772 In other words, assume that every image size is allowed, on non-X
6773 hosts. This assumption is probably wrong, but it lets Emacs compile.
6774
6775 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
6776
6777 * regex.c (re_iswctype): Convert return values to boolean.
6778
6779 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
6780
6781 * xdisp.c (compute_display_string_pos): Don't use cached display
6782 string position if the buffer had its restriction changed.
6783 (Bug#9184)
6784
6785 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
6786
6787 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
6788
6789 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
6790
6791 Integer signedness and overflow and related fixes. (Bug#9079)
6792
6793 * bidi.c: Integer size and overflow fixes.
6794 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
6795 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
6796 (bidi_cache_find_level_change, bidi_cache_ensure_space)
6797 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
6798 (bidi_find_other_level_edge):
6799 Use ptrdiff_t instead of EMACS_INT where either will do.
6800 This works better on 32-bit hosts configured --with-wide-int.
6801 (bidi_cache_ensure_space): Check for size-calculation overflow.
6802 Use % rather than repeated addition, for better worst-case speed.
6803 Don't set bidi_cache_size until after xrealloc returns, because it
6804 might not return.
6805 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
6806 (bidi_cache_ensure_space): Also check that the bidi cache size
6807 does not exceed that of the largest Lisp string or buffer. See Eli
6808 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
6809
6810 * alloc.c (__malloc_size_t): Remove.
6811 All uses replaced by size_t. See Andreas Schwab's note
6812 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
6813
6814 * image.c: Improve checking for integer overflow.
6815 (check_image_size): Assume that f is nonnull, since
6816 it is always nonnull in practice. This is one less thing to
6817 worry about when checking for integer overflow later.
6818 (x_check_image_size): New function, which checks for integer
6819 overflow issues inside X.
6820 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
6821 This removes the need for a memory_full check.
6822 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
6823 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
6824 (xbm_read_bitmap_data): Change locals back to 'int', since
6825 their values must fit in 'int'.
6826 (xpm_load_image, png_load, tiff_load):
6827 Invoke x_create_x_image_and_pixmap earlier,
6828 to avoid much needless work if the image is too large.
6829 (tiff_load): Treat overly large images as if
6830 x_create_x_image_and_pixmap failed, not as malloc failures.
6831 (gs_load): Use x_check_image_size.
6832
6833 * gtkutil.c: Omit integer casts.
6834 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
6835 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
6836
6837 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
6838
6839 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
6840 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
6841 would wrongly return t on a 64-bit host.
6842
6843 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
6844 The plain *_OVERFLOW macros run afoul of GCC bug 49705
6845 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
6846 and therefore cause GCC to emit a bogus diagnostic in some cases.
6847
6848 * image.c: Integer signedness and overflow and related fixes.
6849 This is not an exhaustive set of fixes, but it's time to
6850 record what I've got.
6851 (lookup_pixel_color, check_image_size): Remove redundant decls.
6852 (check_image_size): Don't assume that arbitrary EMACS_INT values
6853 fit in 'int', or that arbitrary 'double' values fit in 'int'.
6854 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
6855 (tiff_load, imagemagick_load_image):
6856 Check for overflow in size calculations.
6857 (x_create_x_image_and_pixmap): Remove unnecessary test for
6858 xmalloc returning NULL; that can't happen.
6859 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
6860 (xpm_color_bucket): Use better integer hashing function.
6861 (xpm_cache_color): Don't possibly over-allocate memory.
6862 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
6863 (gif_memory_source):
6864 Use ptrdiff_t, not int or size_t, to record sizes.
6865 (png_load): Don't assume values greater than 2**31 fit in 'int'.
6866 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
6867 either works, as we prefer signed integers.
6868 (tiff_read_from_memory, tiff_write_from_memory):
6869 Return tsize_t, not size_t, since that's what the TIFF API wants.
6870 (tiff_read_from_memory): Don't fail simply because the read would
6871 go past EOF; instead, return a short read.
6872 (tiff_load): Omit no-longer-needed casts.
6873 (Fimagemagick_types): Don't assume size fits into 'int'.
6874
6875 Improve hashing quality when configured --with-wide-int.
6876 * fns.c (hash_string): New function, taken from sxhash_string.
6877 Do not discard information about ASCII character case; this
6878 discarding is no longer needed.
6879 (sxhash-string): Use it. Change sig to match it. Caller changed.
6880 * lisp.h: Declare it.
6881 * lread.c (hash_string): Remove, since we now use fns.c's version.
6882 The fns.c version returns a wider integer if --with-wide-int is
6883 specified, so this should help the quality of the hashing a bit.
6884
6885 * emacs.c: Integer overflow minor fix.
6886 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
6887 Define only if GNU_LINUX.
6888 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
6889
6890 * dispnew.c: Integer signedness and overflow fixes.
6891 Remove unnecessary forward decls, that were a maintenance hassle.
6892 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
6893 All uses changed.
6894 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
6895 (scrolling_window): Use ptrdiff_t, not int, for byte count.
6896 (prepare_desired_row, line_draw_cost):
6897 Use int, not unsigned, where either works.
6898 (save_current_matrix, restore_current_matrix):
6899 Use ptrdiff_t, not size_t, where either works.
6900 (init_display): Check for overflow more accurately, and without
6901 relying on undefined behavior.
6902
6903 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
6904 Remove, replacing with the new symbols in lisp.h. All uses changed.
6905 * fileio.c (make_temp_name):
6906 * filelock.c (lock_file_1, lock_file):
6907 * xdisp.c (message_dolog):
6908 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
6909 Use pMd etc. instead.
6910 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
6911 replacing the pWIDE etc. symbols removed from editfns.c.
6912
6913 * keyboard.h (num_input_events): Now uintmax_t.
6914 This is (very slightly) less likely to mess up due to wraparound.
6915 All uses changed.
6916
6917 * buffer.c: Integer signedness fixes.
6918 (alloc_buffer_text, enlarge_buffer_text):
6919 Use ptrdiff_t rather than size_t when either will do, as we prefer
6920 signed integers.
6921
6922 * alloc.c: Integer signedness and overflow fixes.
6923 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
6924 (__malloc_size_t): Default to size_t, not to int.
6925 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
6926 (Fgarbage_collect, mark_object_loop_halt, mark_object):
6927 Prefer ptrdiff_t to size_t when either would do, as we prefer
6928 signed integers.
6929 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
6930 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
6931 Now const. Initialize with values that are in range even if char
6932 is signed.
6933 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
6934 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
6935 These functions do the right thing with sizes > 2**32.
6936 (check_depth): Now ptrdiff_t, not int.
6937 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
6938 Adjust to new way of storing sizes. Check for size overflow bugs
6939 in rest of code.
6940 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
6941 slightly wrong anyway, as it missed one instance of
6942 XMALLOC_OVERRUN_CHECK_OVERHEAD.
6943 (refill_memory_reserve): Omit needless cast to size_t.
6944 (mark_object_loop_halt): Mark as externally visible.
6945
6946 * xselect.c: Integer signedness and overflow fixes.
6947 (Fx_register_dnd_atom, x_handle_dnd_message):
6948 Use ptrdiff_t, not size_t, since we prefer signed.
6949 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
6950 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
6951 x_dnd_atoms_size and x_dnd_atoms_length.
6952
6953 * doprnt.c: Prefer signed to unsigned when either works.
6954 * eval.c (verror):
6955 * doprnt.c (doprnt):
6956 * lisp.h (doprnt):
6957 * xdisp.c (vmessage):
6958 Use ptrdiff_t, not size_t, when using or implementing doprnt,
6959 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
6960 prefer signed arithmetic to avoid comparison confusion.
6961 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
6962 but is a bit tricky.
6963
6964 Assume freestanding C89 headers, string.h, stdlib.h.
6965 * data.c, doprnt.c, floatfns.c, print.c:
6966 Include float.h unconditionally.
6967 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
6968 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
6969 * regex.c: Likewise for stddef.h, string.h.
6970 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
6971 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
6972 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
6973 (STDC_HEADERS): Remove obsolete defines.
6974 * sysdep.c: Include limits.h unconditionally.
6975
6976 Assume support for memcmp, memcpy, memmove, memset.
6977 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
6978 * regex.c (memcmp, memcpy):
6979 Remove; we assume C89 now.
6980
6981 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
6982 (__malloc_safe_bcopy): Remove; no longer needed.
6983
6984 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6985 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
6986 well either way, and we prefer signed to unsigned.
6987
6988 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
6989
6990 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
6991 closes the connection while we're reading (bug#9182).
6992
6993 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
6994
6995 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
6996 are specified (Bug#9168).
6997
6998 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
6999
7000 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
7001 Found by GCC static checking and --with-wide-int on a 32-bit host.
7002
7003 2011-07-25 Eli Zaretskii <eliz@gnu.org>
7004
7005 * xdisp.c (compute_display_string_pos): Fix logic of caching
7006 previous display string position. Initialize cached_prev_pos to
7007 -1. Fixes slow-down at the beginning of a buffer.
7008
7009 2011-07-24 Eli Zaretskii <eliz@gnu.org>
7010
7011 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
7012 for attrs[LFACE_FONTSET_INDEX].
7013
7014 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
7015
7016 * xml.c (parse_region): Remove unused local
7017 that was recently introduced.
7018
7019 2011-07-23 Eli Zaretskii <eliz@gnu.org>
7020
7021 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
7022 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
7023
7024 * xdisp.c (move_it_in_display_line_to): Record the best matching
7025 position for TO_CHARPOS while scanning the line, and restore it on
7026 exit if none of the characters scanned was an exact match.
7027 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
7028 when exact match is impossible due to invisible text, and the
7029 lines are truncated.
7030
7031 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
7032
7033 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
7034 for OSX >= 10.7.
7035
7036 2011-07-22 Eli Zaretskii <eliz@gnu.org>
7037
7038 Fix a significant slow-down of cursor motion with C-n, C-p,
7039 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
7040 auto-repeat under bidi redisplay in fontified buffers.
7041 * xdisp.c (compute_stop_pos_backwards): New function.
7042 (next_element_from_buffer): Call compute_stop_pos_backwards to
7043 find a suitable prev_stop when we find ourselves before
7044 base_level_stop.
7045 (reseat): Don't look for prev_stop, as that could mean a very long
7046 run.
7047 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
7048 <cached_disp_overlay_modiff>: Cache for last found display string
7049 position.
7050 (compute_display_string_pos): Return the cached position if asked
7051 about the same buffer in the same area of character positions, and
7052 the buffer wasn't changed since the time the display string
7053 position was cached.
7054
7055 2011-07-22 Eli Zaretskii <eliz@gnu.org>
7056
7057 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
7058 is an integer, which is important for empty lines. (Bug#9149)
7059
7060 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
7061
7062 * frame.c (Fmodify_frame_parameters): In tty case, update the
7063 default face if necessary (Bug#4238).
7064
7065 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
7066
7067 * editfns.c (Fstring_to_char): No need to explain what a character
7068 is in the docstring (Bug#6576).
7069
7070 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
7071
7072 * xml.c (parse_region): Make sure we always return a tree.
7073
7074 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
7075
7076 * xml.c (parse_region): If a document contains only comments,
7077 return that, too.
7078
7079 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
7080
7081 * xml.c (make_dom): Return comments, too.
7082
7083 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
7084
7085 Port to OpenBSD.
7086 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
7087 and the surrounding thread.
7088 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
7089 rather than fgets, and retry after EINTR. Otherwise, 'emacs
7090 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
7091 timer goes off.
7092 * s/openbsd.h (BROKEN_SIGIO): Define.
7093 * unexelf.c (unexec) [__OpenBSD__]:
7094 Don't update the .mdebug section of the Alpha COFF symbol table.
7095
7096 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
7097
7098 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
7099 (bug#8460).
7100
7101 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
7102
7103 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
7104 This fixes some race conditions on the permissions of any newly
7105 created file.
7106
7107 * alloc.c (valid_pointer_p): Use pipe, not open.
7108 This fixes some permissions issues when debugging.
7109
7110 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
7111 If fchown fails to set both uid and gid, try to set just gid,
7112 as that is sometimes allowed. Adjust the file's mode to eliminate
7113 setuid or setgid bits that are inappropriate if fchown fails.
7114
7115 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
7116
7117 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
7118 to compare Lisp_Objects.
7119 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
7120 global_gnutls_log_level, don't mistake it for a Lisp_Object.
7121 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
7122
7123 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
7124
7125 * lread.c (read_integer): Unread even EOF character.
7126 (read1): Likewise. Properly record start position of symbol.
7127
7128 * lread.c (read1): Read `#:' as empty uninterned symbol if no
7129 symbol character follows.
7130
7131 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
7132
7133 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
7134 This works around a problem with the previous change to Fcopy_file.
7135 Recent glibc declares fchown with __attribute__((warn_unused_result)),
7136 and without this change, GCC might complain about discarding
7137 fchown's return value.
7138
7139 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
7140
7141 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
7142
7143 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
7144
7145 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
7146
7147 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
7148
7149 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
7150 it's used from the C level.
7151
7152 * process.c: Use the same condition for POLL_FOR_INPUT in both
7153 keyboard.c and process.c (bug#1858).
7154
7155 2011-07-09 Lawrence Mitchell <wence@gmx.li>
7156
7157 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
7158 (Fgnutls_boot): Use it.
7159
7160 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
7161
7162 * doc.c (Fsubstitute_command_keys): Revert last change.
7163
7164 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
7165
7166 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
7167 quotes the next character, and doesn't affect other longer
7168 sequences (bug#8935).
7169
7170 * lread.c (syms_of_lread): Clarify that is isn't only
7171 `eval-buffer' and `eval-defun' that's affected by
7172 `lexical-binding' (bug#8460).
7173
7174 2011-07-15 Eli Zaretskii <eliz@gnu.org>
7175
7176 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
7177 bidi redisplay when a line includes both an image and is truncated.
7178
7179 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
7180
7181 Fix minor problems found by static checking.
7182 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
7183 (elsz): Now a signed constant, not a size_t var. We prefer signed
7184 types to unsigned, to avoid integer comparison confusion. Without
7185 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
7186 "cannot optimize loop, the loop counter may overflow", a symptom
7187 of the confusion.
7188 * indent.c (Fvertical_motion): Mark locals as initialized.
7189 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
7190
7191 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
7192
7193 * search.c (Fre_search_backward): Mention `case-fold-search' in
7194 all the re_search_* functions (bug#8138).
7195
7196 * keyboard.c (Fopen_dribble_file): Document when the file is
7197 closed (bug#8056).
7198
7199 2011-07-14 Eli Zaretskii <eliz@gnu.org>
7200
7201 * bidi.c (bidi_dump_cached_states): Fix format of displaying
7202 bidi_cache_idx.
7203
7204 Support bidi reordering of display and overlay strings.
7205 * xdisp.c (compute_display_string_pos)
7206 (compute_display_string_end): Accept additional argument STRING.
7207 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
7208 (reseat_to_string): Initialize bidi_it->string.s and
7209 bidi_it->string.schars.
7210 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
7211 NULL (avoids a crash in bidi_paragraph_init).
7212 Initialize itb.string.lstring.
7213 (init_iterator): Call bidi_init_it only of a valid
7214 buffer position was specified. Initialize paragraph_embedding to
7215 L2R.
7216 (reseat_to_string): Initialize the bidi iterator.
7217 (display_string): If we need to ignore text properties of
7218 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
7219 original value of -1 will not work with bidi.)
7220 (compute_display_string_pos): First arg is now struct
7221 `text_pos *'; all callers changed. Support display properties on
7222 Lisp strings.
7223 (compute_display_string_end): Support display properties on Lisp
7224 strings.
7225 (init_iterator, reseat_1, reseat_to_string): Initialize the
7226 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
7227 when iterating on a string not from display properties).
7228 (compute_display_string_pos, compute_display_string_end):
7229 Fix calculation of the object to scan. Fixes an error when using
7230 arrow keys.
7231 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
7232 base_level_stop; instead, set base_level_stop to BEGV.
7233 Fixes crashes in vertical-motion.
7234 (next_element_from_buffer): Improve commentary for when
7235 the iterator is before prev_stop.
7236 (init_iterator): Initialize bidi_p from the default value of
7237 bidi-display-reordering, not from buffer-local value. Use the
7238 buffer-local value only if initializing for buffer iteration.
7239 (handle_invisible_prop): Support invisible properties on strings
7240 that are being bidi-reordered.
7241 (set_iterator_to_next): Support bidi reordering of C strings and
7242 Lisp strings.
7243 (next_element_from_string): Support bidi reordering of Lisp
7244 strings.
7245 (handle_stop_backwards): Support Lisp strings as well.
7246 (display_string): Support display of R2L glyph rows.
7247 Use IT_STRING_CHARPOS when displaying from a Lisp string.
7248 (init_iterator): Don't initialize it->bidi_p for strings
7249 here.
7250 (reseat_to_string): Initialize it->bidi_p for strings here.
7251 (next_element_from_string, next_element_from_c_string)
7252 (next_element_from_buffer): Add xassert's for correspondence
7253 between IT's object being iterated and it->bidi_it.string
7254 structure.
7255 (face_before_or_after_it_pos): Support bidi iteration.
7256 (next_element_from_c_string): Handle the case of the first string
7257 character that is not the first one in the visual order.
7258 (get_visually_first_element): New function, refactored from common
7259 parts of next_element_from_buffer, next_element_from_string, and
7260 next_element_from_c_string.
7261 (tool_bar_lines_needed, redisplay_tool_bar)
7262 (display_menu_bar): Force left-to-right direction. Add a FIXME
7263 comment for making that be controlled by a user option.
7264 (push_it, pop_it): Save and restore the state of the
7265 bidi iterator. Save and restore the bidi_p flag.
7266 (pop_it): Iterate out of display property for string iteration as
7267 well.
7268 (iterate_out_of_display_property): Support iteration over strings.
7269 (handle_single_display_spec): Set up it->bidi_it for iteration
7270 over a display string, and call bidi_init_it.
7271 (handle_single_display_spec, next_overlay_string)
7272 (get_overlay_strings_1, push_display_prop): Set up the bidi
7273 iterator for displaying display or overlay strings.
7274 (forward_to_next_line_start): Don't use the shortcut if
7275 bidi-iterating.
7276 (back_to_previous_visible_line_start): If handle_display_prop
7277 pushed the iterator stack, restore the internal state of the bidi
7278 iterator by calling bidi_pop_it same number of times.
7279 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
7280 and we are bidi-iterating, don't decrement the iterator position;
7281 instead, set the first_elt flag in the bidi iterator, to produce
7282 the same effect.
7283 (reseat_1): Remove redundant setting of string_from_display_prop_p.
7284 (push_display_prop): xassert that we are iterating a buffer.
7285 (push_it, pop_it): Save and restore paragraph_embedding member.
7286 (handle_single_display_spec, next_overlay_string)
7287 (get_overlay_strings_1, reseat_1, reseat_to_string)
7288 (push_display_prop): Set up the `unibyte' member of bidi_it.string
7289 correctly. Don't assume unibyte strings are not bidi-reordered.
7290 (compute_display_string_pos)
7291 (compute_display_string_end): Fix handling the case of C string.
7292 (push_it, pop_it): Save and restore from_disp_prop_p.
7293 (handle_single_display_spec, push_display_prop): Set the
7294 from_disp_prop_p flag.
7295 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
7296 (pop_it): Call iterate_out_of_display_property only if we are
7297 popping after iteration over a string that came from a display
7298 property. Fix a typo in popping stretch info. Add an assertion
7299 for verifying that the iterator position is in sync with the bidi
7300 iterator.
7301 (handle_single_display_spec, get_overlay_strings_1)
7302 (push_display_prop): Fix initialization of paragraph direction for
7303 string when that of the parent object is not yet determined.
7304 (reseat_1): Call bidi_init_it to resync the bidi
7305 iterator with IT's position. (Bug#7616)
7306 (find_row_edges): If ROW->start.pos gives position
7307 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
7308 (handle_stop, back_to_previous_visible_line_start, reseat_1):
7309 Reset the from_disp_prop_p flag.
7310 (SAVE_IT, RESTORE_IT): New macros.
7311 (pos_visible_p, face_before_or_after_it_pos)
7312 (back_to_previous_visible_line_start)
7313 (move_it_in_display_line_to, move_it_in_display_line)
7314 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7315 (try_scrolling, redisplay_window, display_line): Use them when
7316 saving a temporary copy of the iterator and restoring it back.
7317 (back_to_previous_visible_line_start, reseat_1)
7318 (init_iterator): Empty the bidi cache "stack".
7319 (move_it_in_display_line_to): If iterator ended up at
7320 EOL, but we never saw any buffer positions smaller than
7321 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
7322 motion in bidi-reordered lines.
7323 (move_it_in_display_line_to): Record prev_method and prev_pos
7324 immediately before the call to set_iterator_to_next. Fixes cursor
7325 motion in bidi-reordered lines with stretch glyphs and strings
7326 displayed in margins. (Bug#8133) (Bug#8867)
7327 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
7328 TO_CHARPOS.
7329 (pos_visible_p): Support positions in bidi-reordered lines.
7330 Save and restore bidi cache.
7331
7332 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
7333 (bidi_paragraph_info): Delete unused struct.
7334 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
7335 (bidi_cache_start): New variable.
7336 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
7337 to zero.
7338 (bidi_cache_fetch_state, bidi_cache_search)
7339 (bidi_cache_find_level_change, bidi_cache_iterator_state)
7340 (bidi_cache_find, bidi_peek_at_next_level)
7341 (bidi_level_of_next_char, bidi_find_other_level_edge)
7342 (bidi_move_to_visually_next): Compare cache index with
7343 bidi_cache_start rather than with zero.
7344 (bidi_fetch_char): Accept new argument STRING; all callers
7345 changed. Support iteration over a string. Support strings with
7346 display properties. Support unibyte strings. Fix the type of
7347 `len' according to what STRING_CHAR_AND_LENGTH expects.
7348 (bidi_paragraph_init, bidi_resolve_explicit_1)
7349 (bidi_resolve_explicit, bidi_resolve_weak)
7350 (bidi_level_of_next_char, bidi_move_to_visually_next):
7351 Support iteration over a string.
7352 (bidi_set_sor_type, bidi_resolve_explicit_1)
7353 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
7354 can now be zero (for strings); special values 0 and -1 were
7355 changed to -1 and -2, respectively.
7356 (bidi_char_at_pos): New function.
7357 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
7358 Call it instead of FETCH_MULTIBYTE_CHAR.
7359 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
7360 initialized to valid values.
7361 (bidi_init_it): Don't initialize charpos and bytepos with invalid
7362 values.
7363 (bidi_level_of_next_char): Allow the sentinel "position" to pass
7364 the test for valid cached positions. Fix the logic for looking up
7365 the sentinel state in the cache. GCPRO the Lisp string we are
7366 iterating.
7367 (bidi_push_it, bidi_pop_it): New functions.
7368 (bidi_initialize): Initialize the bidi cache start stack pointer.
7369 (bidi_cache_ensure_space): New function, refactored from part of
7370 bidi_cache_iterator_state. Don't assume the required size is just
7371 one BIDI_CACHE_CHUNK away.
7372 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
7373 (bidi_count_bytes, bidi_char_at_pos): New functions.
7374 (bidi_cache_search): Don't assume bidi_cache_last_idx is
7375 always valid if bidi_cache_idx is valid.
7376 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
7377 is valid if it's going to be used.
7378 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
7379 (bidi_cache_fetch_state, bidi_cache_search)
7380 (bidi_cache_find_level_change, bidi_cache_ensure_space)
7381 (bidi_cache_iterator_state, bidi_cache_find)
7382 (bidi_find_other_level_edge, bidi_cache_start_stack):
7383 All variables related to cache indices are now EMACS_INT.
7384
7385 * dispextern.h (struct bidi_string_data): New structure.
7386 (struct bidi_it): New member `string'. Make flag members be 1-bit
7387 fields, and put them last in the struct.
7388 (compute_display_string_pos, compute_display_string_end):
7389 Update prototypes.
7390 (bidi_push_it, bidi_pop_it): Add prototypes.
7391 (struct iterator_stack_entry): New members bidi_p,
7392 paragraph_embedding, and from_disp_prop_p.
7393 (struct it): Member bidi_p is now a bit field 1 bit wide.
7394 (bidi_shelve_cache, bidi_unshelve_cache):
7395 Declare prototypes.
7396
7397 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
7398 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
7399 and vector-like objects.
7400
7401 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
7402 cache around display iteration.
7403
7404 * window.c (Fwindow_end, window_scroll_pixel_based)
7405 (displayed_window_lines, Frecenter): Save and restore the bidi
7406 cache around display iteration.
7407
7408 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
7409
7410 * editfns.c (Fdelete_region): Clarify the use of the named
7411 parameters (bug#6788).
7412
7413 2011-07-14 Martin Rudalics <rudalics@gmx.at>
7414
7415 * indent.c (Fvertical_motion): Set and restore w->pointm when
7416 saving and restoring the window's buffer (Bug#9006).
7417
7418 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
7419
7420 * editfns.c (Fstring_to_char): Clarify just what is returned
7421 (bug#6576). Text by Eli Zaretskii.
7422
7423 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
7424
7425 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
7426
7427 2011-07-13 Eli Zaretskii <eliz@gnu.org>
7428
7429 * buffer.c (mmap_find): Fix a typo.
7430
7431 2011-07-13 Johan Bockgård <bojohan@gnu.org>
7432
7433 Fix execution of x selection hooks.
7434 * xselect.c (Qx_lost_selection_functions)
7435 (Qx_sent_selection_functions): New vars.
7436 (syms_of_xselect): DEFSYM them.
7437 (x_handle_selection_request): Pass Qx_sent_selection_functions
7438 rather than Vx_sent_selection_functions to Frun_hook_with_args.
7439 (x_handle_selection_clear,x_clear_frame_selections):
7440 Pass Qx_lost_selection_functions rather than
7441 Vx_lost_selection_functions to Frun_hook_with_args.
7442
7443 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
7444
7445 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
7446 The old code sometimes used this field without initializing it.
7447
7448 * alloc.c (gc_sweep): Don't read past end of array.
7449 In theory, the old code could also have corrupted Emacs internals,
7450 though it'd be very unlikely.
7451
7452 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
7453
7454 * character.c (Fcharacterp): Don't advertise optional ignored
7455 argument. (Bug#4026)
7456
7457 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
7458
7459 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
7460 key" (bug#4257).
7461
7462 * window.c (Fset_window_start): Doc fix (bug#4199).
7463 (Fset_window_hscroll): Ditto.
7464
7465 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
7466
7467 Fix minor new problems caught by GCC 4.6.1.
7468 * term.c (init_tty): Remove unused local.
7469 * xsettings.c (store_monospaced_changed): Define this function only
7470 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
7471 not used otherwise.
7472
7473 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
7474
7475 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
7476
7477 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
7478
7479 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
7480 are the mini-buffer and the echo area (bug#3320).
7481
7482 * term.c (init_tty): Remove support for supdup, c10 and perq
7483 terminals, which are no longer supported (bug#1482).
7484
7485 2011-07-10 Johan Bockgård <bojohan@gnu.org>
7486
7487 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
7488
7489 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
7490
7491 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
7492 for non-popups (Bug#3642).
7493
7494 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
7495
7496 * alloc.c (reset_malloc_hooks): Protoize.
7497 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
7498 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
7499 * cm.c (losecursor): Likewise.
7500 * data.c (fmod): Likewise.
7501 * dispnew.c (swap_glyphs_in_rows): Likewise.
7502 * emacs.c (memory_warning_signal): Likewise.
7503 * floatfns.c (float_error): Likewise.
7504 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
7505 (otf_open, font_otf_capability, generate_otf_features)
7506 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
7507 Likewise.
7508 * image.c (pbm_read_file): Likewise.
7509 * indent.c (string_display_width): Likewise.
7510 * intervals.c (check_for_interval, search_for_interval)
7511 (inc_interval_count, count_intervals, root_interval)
7512 (adjust_intervals_for_insertion, make_new_interval): Likewise.
7513 * lread.c (defalias): Likewise.
7514 * ralloc.c (r_alloc_check): Likewise.
7515 * regex.c (set_image_of_range_1, set_image_of_range)
7516 (regex_grow_registers): Likewise.
7517 * sysdep.c (strerror): Likewise.
7518 * termcap.c (valid_filename_p, tprint, main): Likewise.
7519 * tparam.c (main): Likewise.
7520 * unexhp9k800.c (run_time_remap, save_data_space)
7521 (update_file_ptrs, read_header, write_header, calculate_checksum)
7522 (copy_file, copy_rest, display_header): Likewise.
7523 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
7524 Likewise.
7525 * xdisp.c (check_it): Likewise.
7526 * xfaces.c (register_color, unregister_color, unregister_colors):
7527 Likewise.
7528 * xfns.c (print_fontset_result): Likewise.
7529 * xrdb.c (member, fatal, main): Likewise.
7530
7531 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
7532
7533 Fix minor problems found by static checking (Bug#9031).
7534 * chartab.c (char_table_set_range, map_sub_char_table):
7535 Remove unused locals.
7536 (uniprop_table): Now static.
7537 * composite.c (_work_char): Remove unused static var.
7538
7539 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
7540
7541 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
7542
7543 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
7544
7545 * gtkutil.c (qttip_cb): Remove code without function.
7546
7547 2011-07-09 Eli Zaretskii <eliz@gnu.org>
7548
7549 * w32.c (pthread_sigmask): New stub.
7550
7551 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
7552
7553 Use pthread_sigmask, not sigprocmask (Bug#9010).
7554 sigprocmask is portable only for single-threaded applications, and
7555 Emacs can be multi-threaded when it uses GTK.
7556 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
7557 (LIBES): Use it.
7558 * callproc.c (Fcall_process):
7559 * process.c (create_process):
7560 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
7561 Use pthread_sigmask, not sigprocmask.
7562
7563 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
7564
7565 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
7566 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
7567 wrong (Bug#8591).
7568
7569 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
7570
7571 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
7572 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
7573 (xg_hide_tooltip): Fix comment.
7574
7575 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
7576 in registerServicesMenuSendTypes.
7577 (validRequestorForSendType): Don't check ns_return_types.
7578
7579 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
7580 ns_return_type.
7581
7582 2011-07-08 Jason Rumney <jasonr@gnu.org>
7583
7584 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
7585 SH_SHOW for hidden windows (Bug#5482).
7586
7587 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
7588 frame struct members of non-existent frames (Bug#6284).
7589
7590 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
7591
7592 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
7593 variable firstTime not needed on OSX >= 10.6.
7594 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
7595 >= 10.5. Use setKnobProportion, setDoubleValue.
7596
7597 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
7598 (MAC_OS_X_VERSION_10_5): Define if not defined.
7599 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
7600 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
7601 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
7602
7603 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
7604 cString and lossyCString on OSX >= 10.4
7605
7606 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
7607 sizeToFit on OSX >= 10.2.
7608
7609 * nsimage.m (allocInitFromFile): Don't use deprecated method
7610 bestRepresentationForDevice on OSX >= 10.6.
7611
7612 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
7613 to avoid warning.
7614
7615 * emacs.c: Declare unexec_init_emacs_zone.
7616
7617 * nsgui.h: Fix compiler warning about gnulib redefining verify.
7618
7619 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
7620
7621 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
7622 on svcsMenu (Bug#8842).
7623
7624 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
7625 ns_return_types.
7626 (Fns_list_services): Just return Qnil on 10.6, code not working there.
7627
7628 * nsterm.m (QUTF8_STRING): Declare.
7629 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
7630 (validRequestorForSendType): Return type is (id).
7631 Change indexOfObjectIdenticalTo to indexOfObject.
7632 Check if we have local selection before returning self (Bug#8842).
7633 (writeSelectionToPasteboard): Put local selection into paste board
7634 if we have a local selection (Bug#8842).
7635 (syms_of_nsterm): DEFSYM QUTF8_STRING.
7636
7637 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
7638 (ns_get_local_selection): Declare.
7639
7640 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
7641
7642 * keymap.c (describe_map_tree): Don't insert a double newline at
7643 the end of the buffer (bug#1169) and return whether we inserted
7644 something.
7645
7646 * callint.c (Fcall_interactively): Change "reading args" to
7647 "providing args" to try to clarify what it does (bug#1010).
7648
7649 2011-07-07 Kenichi Handa <handa@m17n.org>
7650
7651 * composite.c (composition_compute_stop_pos): Ignore a static
7652 composition starting before CHARPOS (Bug#8915).
7653
7654 * xdisp.c (handle_composition_prop): Likewise.
7655
7656 2011-07-07 Eli Zaretskii <eliz@gnu.org>
7657
7658 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
7659 (Bug#9015)
7660
7661 2011-07-07 Kenichi Handa <handa@m17n.org>
7662
7663 * character.h (unicode_category_t): New enum type.
7664
7665 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
7666 (Qchar_code_property_table): New variable.
7667 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
7668 (UNIPROP_COMPRESSED_FORM_P): New macros.
7669 (char_table_ascii): Uncompress the compressed values.
7670 (sub_char_table_ref): New arg is_uniprop. Callers changed.
7671 Uncompress the compressed values.
7672 (sub_char_table_ref_and_range): Likewise.
7673 (char_table_ref_and_range): Uncompress the compressed values.
7674 (sub_char_table_set): New arg is_uniprop. Callers changed.
7675 Uncompress the compressed values.
7676 (sub_char_table_set_range): Args changed. Callers changed.
7677 (char_table_set_range): Adjuted for the above change.
7678 (map_sub_char_table): Delete args default_val and parent. Add arg
7679 top. Give decoded values to a Lisp function.
7680 (map_char_table): Adjust for the above change. Give decoded
7681 values to a Lisp function. Gcpro more variables.
7682 (uniprop_table_uncompress)
7683 (uniprop_decode_value_run_length): New functions.
7684 (uniprop_decoder, uniprop_decoder_count): New variables.
7685 (uniprop_get_decoder, uniprop_encode_value_character)
7686 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
7687 New functions.
7688 (uniprop_encoder, uniprop_encoder_count): New variables.
7689 (uniprop_get_encoder, uniprop_table)
7690 (Funicode_property_table_internal, Fget_unicode_property_internal)
7691 (Fput_unicode_property_internal): New functions.
7692 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
7693 Sunicode_property_table_internal, Sget_unicode_property_internal,
7694 and Sput_unicode_property_internal. Defvar_lisp
7695 char-code-property-alist.
7696
7697 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
7698 Vunicode_category_table.
7699
7700 * font.c (font_range): Adjust for the change of
7701 Vunicode_category_table.
7702
7703 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
7704
7705 * m/iris4d.h: Remove file, move contents ...
7706 * s/irix6-5.h: ... here.
7707
7708 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
7709
7710 Remove unportable assumption about struct layout (Bug#8884).
7711 * alloc.c (mark_buffer):
7712 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
7713 (clone_per_buffer_values): Don't assume that
7714 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
7715 This isn't true in general, and it's particularly not true
7716 if Emacs is configured with --with-wide-int.
7717 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
7718 New macros, used in the buffer.c change.
7719
7720 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
7721
7722 * xsettings.c: Use both GConf and GSettings if both are available.
7723 (store_config_changed_event): Add comment.
7724 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
7725 (store_tool_bar_style_changed): New functions.
7726 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
7727 (struct xsettings): Move font inside HAVE_XFT.
7728 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
7729 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
7730 Move inside HAVE_XFT.
7731 (something_changed_gsettingsCB): Rename from something_changedCB.
7732 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
7733 also.
7734 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
7735 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
7736 (something_changed_gconfCB): Rename from something_changedCB.
7737 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
7738 (parse_settings): Move check for font inside HAVE_XFT.
7739 (read_settings, apply_xft_settings): Add comment.
7740 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
7741 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
7742 call store_font_name_changed.
7743 (xft_settings_event): Add comment.
7744 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
7745 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
7746 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
7747 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
7748 (xsettings_initialize): Call init_gsettings last.
7749 (xsettings_get_system_font, xsettings_get_system_normal_font):
7750 Add comment.
7751
7752 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
7753
7754 Random fixes. E.g., (random) never returned negative values.
7755 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
7756 subseconds part to the entropy, as that's a bit more random.
7757 Prefer signed to unsigned, since the signedness doesn't matter and
7758 in general we prefer signed. When given a limit, use a
7759 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
7760 latter isn't right if USE_2_TAGS_FOR_INTS.
7761 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
7762 not 0..VALMASK. Don't discard "excess" bits that random () returns.
7763
7764 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
7765
7766 * textprop.c (text_property_stickiness):
7767 Obey Vtext_property_default_nonsticky.
7768 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
7769 * w32fns.c (syms_of_w32fns):
7770 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
7771
7772 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
7773
7774 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
7775 This is more efficient than Ffile_directory_p and avoids a minor race.
7776
7777 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
7778
7779 * buffer.c (Foverlay_put): Say what the return value is
7780 (bug#7835).
7781
7782 * fileio.c (barf_or_query_if_file_exists): Check first if the file
7783 is a directory before asking whether to use the file name
7784 (bug#7564).
7785 (barf_or_query_if_file_exists): Make the "File is a directory"
7786 error be more correct.
7787
7788 * fns.c (Frequire): Remove the mention of the .gz files, since
7789 that's installation-specific, but keep the mention of
7790 `get-load-suffixes'.
7791
7792 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
7793
7794 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
7795 Report string overflow if the output is too long.
7796
7797 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
7798
7799 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
7800 (syms_of_gnutls): Remove duplicate DEFSYM for
7801 Qgnutls_bootprop_verify_hostname_error, an error for
7802 Qgnutls_bootprop_verify_error (which is no longer used).
7803
7804 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
7805 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
7806 Also (re)move comments that are misplaced or no longer relevant.
7807
7808 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
7809
7810 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
7811
7812 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
7813
7814 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
7815 and background color parameters if they have been changed.
7816
7817 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
7818
7819 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
7820
7821 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
7822
7823 * xsettings.c (SYSTEM_FONT): Define only when used.
7824 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
7825
7826 * keymap.c (access_keymap_1): Now static.
7827
7828 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
7829
7830 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
7831 leave any prefix arg for the up event (Bug#1586).
7832
7833 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
7834
7835 * lread.c (syms_of_lread): Mention single symbols defined by
7836 `defvar' or `defconst' (bug#7154).
7837
7838 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7839 (Frequire): Mention get-load-suffixes.
7840
7841 2011-07-02 Martin Rudalics <rudalics@gmx.at>
7842
7843 * window.h (window): Remove clone_number slot.
7844 * window.c (Fwindow_clone_number, Fset_window_clone_number):
7845 Remove.
7846 (make_parent_window, make_window, saved_window)
7847 (Fset_window_configuration, save_window_save): Don't deal with
7848 clone numbers.
7849 * buffer.c (Qclone_number): Remove declaration.
7850 (sort_overlays, overlay_strings): Don't deal with clone numbers.
7851
7852 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
7853
7854 Add multiple inheritance to keymaps.
7855 * keymap.c (Fmake_composed_keymap): New function.
7856 (Fset_keymap_parent): Simplify.
7857 (fix_submap_inheritance): Remove.
7858 (access_keymap_1): New function extracted from access_keymap to handle
7859 embedded parents and handle lists of maps.
7860 (access_keymap): Use it.
7861 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
7862 (Fcopy_keymap): Handle embedded parents.
7863 (Fcommand_remapping, define_as_prefix): Simplify.
7864 (Fkey_binding): Simplify.
7865 (syms_of_keymap): Move minibuffer-local-completion-map,
7866 minibuffer-local-filename-completion-map,
7867 minibuffer-local-must-match-map, and
7868 minibuffer-local-filename-must-match-map to Elisp.
7869 (syms_of_keymap): Defsubr make-composed-keymap.
7870 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
7871 (parse_menu_item): Trivial simplification.
7872
7873 2011-07-01 Glenn Morris <rgm@gnu.org>
7874
7875 * Makefile.in (SETTINGS_LIBS): Fix typo.
7876
7877 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
7878
7879 * coding.c (Fencode_coding_string): Record the last coding system
7880 used, as the function doc string says (bug#8738).
7881
7882 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
7883
7884 * xsettings.c (store_monospaced_changed): Take new font as arg and
7885 check for change against current_mono_font.
7886 (EMACS_TYPE_SETTINGS): Remove this and related defines.
7887 (emacs_settings_constructor, emacs_settings_get_property)
7888 (emacs_settings_set_property, emacs_settings_class_init)
7889 (emacs_settings_init, gsettings_obj): Remove.
7890 (something_changedCB): New function for HAVE_GSETTINGS.
7891 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
7892 with value as argument.
7893 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
7894 g_settings_new (Bug#8967). Do not create gsettings_obj.
7895 Remove calls to g_settings_bind. Connect something_changedCB to
7896 "changed".
7897
7898 * xgselect.c: Add defined (HAVE_GSETTINGS).
7899 (xgselect_initialize): Ditto.
7900
7901 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
7902 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
7903 xg_select.
7904
7905 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
7906
7907 * eval.c (struct backtrace): Simplify and port the data structure.
7908 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
7909 signed bit field, as this assumption is not portable and it makes
7910 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
7911 "char debug_on_exit : 1" as this is not portable either; instead,
7912 use the portable "unsigned int debug_on_exit : 1". Remove unused
7913 member evalargs. Remove obsolete comments about cc bombing out.
7914
7915 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
7916
7917 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
7918 Let HAVE_GSETTINGS override HAVE_GCONF.
7919 (store_monospaced_changed): New function.
7920 (EMACS_SETTINGS): A new type derived from GObject to handle
7921 GSettings notifications.
7922 (emacs_settings_constructor, emacs_settings_get_property)
7923 (emacs_settings_set_property, emacs_settings_class_init):
7924 New functions.
7925 (gsettings_client, gsettings_obj): New variables.
7926 (GSETTINGS_SCHEMA): New define.
7927 (something_changedCB): Call store_monospaced_changed.
7928 (init_gsettings): New function.
7929 (xsettings_initialize): Call init_gsettings.
7930 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
7931 to NULL.
7932
7933 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
7934 GCONF_CFLAGS/LIBS.
7935
7936 2011-06-29 Martin Rudalics <rudalics@gmx.at>
7937
7938 * window.c (resize_root_window, grow_mini_window)
7939 (shrink_mini_window): Rename Qresize_root_window to
7940 Qwindow_resize_root_window and Qresize_root_window_vertically to
7941 Qwindow_resize_root_window_vertically.
7942
7943 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
7944
7945 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
7946
7947 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
7948
7949 * makefile.w32-in: Redesign dependencies so they reflect more
7950 clearly which files are directly included by each source file,
7951 and not through other includes.
7952
7953 2011-06-27 Martin Rudalics <rudalics@gmx.at>
7954
7955 * buffer.c (Qclone_number): Declare static and DEFSYM it.
7956 (sort_overlays, overlay_strings): When an overlay's clone number
7957 matches the window's clone number process the overlay even if
7958 the overlay's window property doesn't match the current window.
7959
7960 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
7961 (Fwindow_hchild): Rename to Fwindow_left_child.
7962 (Fwindow_next): Rename to Fwindow_next_sibling.
7963 (Fwindow_prev): Rename to Fwindow_prev_sibling.
7964 (resize_window_check): Rename to window_resize_check.
7965 (resize_window_apply): Rename to window_resize_apply.
7966 (Fresize_window_apply): Rename to Fwindow_resize_apply.
7967 (Fdelete_other_windows_internal, resize_frame_windows)
7968 (Fsplit_window_internal, Fdelete_window_internal)
7969 (grow_mini_window, shrink_mini_window)
7970 (Fresize_mini_window_internal): Fix callers accordingly.
7971
7972 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
7973
7974 * emacsgtkfixed.h: State that this is only used with Gtk+3.
7975 (emacs_fixed_set_min_size): Remove.
7976 (emacs_fixed_new): Take frame as argument.
7977
7978 * emacsgtkfixed.c: State that this is only used with Gtk+3.
7979 (_EmacsFixedPrivate): Remove minwidth/height.
7980 Add struct frame *f.
7981 (emacs_fixed_init): Initialize priv->f.
7982 (get_parent_class, emacs_fixed_set_min_size): Remove.
7983 (emacs_fixed_new): Set priv->f to argument.
7984 (emacs_fixed_get_preferred_width)
7985 (emacs_fixed_get_preferred_height): Use min_width/height from
7986 frames size_hint to set minimum and natural (Bug#8919).
7987 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
7988 and use min_width/height from frames size_hint to set
7989 min_width/height (Bug#8919).
7990
7991 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
7992 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
7993 Fix indentation.
7994
7995 2011-06-26 Eli Zaretskii <eliz@gnu.org>
7996
7997 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
7998 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
7999 called at ZV.
8000
8001 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
8002
8003 * process.c (wait_reading_process_output): Bypass select if
8004 waiting for a cell while ignoring keyboard input, and input is
8005 pending. Suggested by Jan Djärv (Bug#8869).
8006
8007 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
8008
8009 Use gnulib's dup2 module instead of rolling our own.
8010 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
8011
8012 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8013
8014 * dispnew.c (scrolling_window): Before scrolling, turn off a
8015 mouse-highlight in the window being scrolled.
8016
8017 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
8018
8019 Move DEFSYM to lisp.h and use everywhere.
8020
8021 * character.h (DEFSYM): Move declaration...
8022 * lisp.h (DEFSYM): ...here.
8023
8024 * gnutls.c:
8025 * minibuf.c:
8026 * w32menu.c:
8027 * w32proc.c:
8028 * w32select.c: Don't include character.h.
8029
8030 * alloc.c (syms_of_alloc):
8031 * buffer.c (syms_of_buffer):
8032 * bytecode.c (syms_of_bytecode):
8033 * callint.c (syms_of_callint):
8034 * casefiddle.c (syms_of_casefiddle):
8035 * casetab.c (init_casetab_once):
8036 * category.c (init_category_once, syms_of_category):
8037 * ccl.c (syms_of_ccl):
8038 * cmds.c (syms_of_cmds):
8039 * composite.c (syms_of_composite):
8040 * dbusbind.c (syms_of_dbusbind):
8041 * dired.c (syms_of_dired):
8042 * dispnew.c (syms_of_display):
8043 * doc.c (syms_of_doc):
8044 * editfns.c (syms_of_editfns):
8045 * emacs.c (syms_of_emacs):
8046 * eval.c (syms_of_eval):
8047 * fileio.c (syms_of_fileio):
8048 * fns.c (syms_of_fns):
8049 * frame.c (syms_of_frame):
8050 * fringe.c (syms_of_fringe):
8051 * insdel.c (syms_of_insdel):
8052 * keymap.c (syms_of_keymap):
8053 * lread.c (init_obarray, syms_of_lread):
8054 * macros.c (syms_of_macros):
8055 * msdos.c (syms_of_msdos):
8056 * print.c (syms_of_print):
8057 * process.c (syms_of_process):
8058 * search.c (syms_of_search):
8059 * sound.c (syms_of_sound):
8060 * syntax.c (init_syntax_once, syms_of_syntax):
8061 * terminal.c (syms_of_terminal):
8062 * textprop.c (syms_of_textprop):
8063 * undo.c (syms_of_undo):
8064 * w32.c (globals_of_w32):
8065 * window.c (syms_of_window):
8066 * xdisp.c (syms_of_xdisp):
8067 * xfaces.c (syms_of_xfaces):
8068 * xfns.c (syms_of_xfns):
8069 * xmenu.c (syms_of_xmenu):
8070 * xsettings.c (syms_of_xsettings):
8071 * xterm.c (syms_of_xterm): Use DEFSYM.
8072
8073 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
8074
8075 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
8076
8077 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
8078
8079 Integer and buffer overflow fixes (Bug#8873).
8080
8081 * print.c (printchar, strout): Check for string overflow.
8082 (PRINTPREPARE, printchar, strout):
8083 Don't set size unless allocation succeeds.
8084
8085 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
8086 for sizes. Check for string overflow more accurately.
8087 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
8088
8089 * macros.c: Integer and buffer overflow fixes.
8090 * keyboard.h (struct keyboard.kbd_macro_bufsize):
8091 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
8092 Use ptrdiff_t, not int, for sizes.
8093 Don't increment bufsize until after realloc succeeds.
8094 Check for size-calculation overflow.
8095 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
8096
8097 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
8098
8099 * lread.c: Integer overflow fixes.
8100 (read_integer): Radix is now EMACS_INT, not int,
8101 to improve quality of diagnostics for out-of-range radices.
8102 Calculate buffer size correctly for out-of-range radices.
8103 (read1): Check for integer overflow in radices, and in
8104 read-circle numbers.
8105 (read_escape): Avoid int overflow.
8106 (Fload, openp, read_buffer_size, read1)
8107 (substitute_object_recurse, read_vector, read_list, map_obarray):
8108 Use ptrdiff_t, not int, for sizes.
8109 (read1): Use EMACS_INT, not int, for sizes.
8110 Check for size overflow.
8111
8112 * image.c (cache_image): Check for size arithmetic overflow.
8113
8114 * lread.c: Integer overflow issues.
8115 (saved_doc_string_size, saved_doc_string_length)
8116 (prev_saved_doc_string_size, prev_saved_doc_string_length):
8117 Now ptrdiff_t, not int.
8118 (read1): Don't assume doc string length fits in int. Check for
8119 out-of-range doc string lengths.
8120 (read_list): Don't assume file position fits in int.
8121 (read_escape): Check for hex character overflow.
8122
8123 2011-06-22 Leo Liu <sdl.web@gmail.com>
8124
8125 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
8126 Move to minibuffer.el.
8127
8128 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
8129
8130 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
8131 The following patches are for when GLYPH_DEBUG && !XASSERT.
8132 * dispextern.h (trace_redisplay_p, dump_glyph_string):
8133 * dispnew.c (flush_stdout):
8134 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
8135 Mark as externally visible.
8136 * dispnew.c (check_window_matrix_pointers): Now static.
8137 * dispnew.c (window_to_frame_vpos):
8138 * xfns.c (unwind_create_frame):
8139 * xterm.c (x_check_font): Remove unused local.
8140 * scroll.c (CHECK_BOUNDS):
8141 * xfaces.c (cache_fache): Rename local to avoid shadowing.
8142 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
8143 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
8144 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
8145 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
8146 Now static.
8147 (debug_method_add): Use va_list and vsprintf rather than relying
8148 on undefined behavior with wrong number of arguments.
8149 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
8150 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
8151 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
8152 since we're not interested in debugging glyphs with old libraries.
8153 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
8154 GCC 4.6.0's static checking.
8155
8156 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
8157
8158 Integer overflow and signedness fixes (Bug#8873).
8159 A few related buffer overrun fixes, too.
8160
8161 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
8162
8163 * dispextern.h (struct face.stipple):
8164 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
8165 (x_bitmap_mask, x_allocate_bitmap_record)
8166 (x_create_bitmap_from_data, x_create_bitmap_from_file)
8167 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
8168 (x_create_bitmap_from_xpm_data):
8169 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
8170 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
8171 (.bitmaps_last):
8172 * xfaces.c (load_pixmap):
8173 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
8174 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
8175 (.bitmaps_last, struct x_output.icon_bitmap):
8176 Use ptrdiff_t, not int, for bitmap indexes.
8177 (x_allocate_bitmap_record): Check for size overflow.
8178 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
8179
8180 Use ptrdiff_t, not int, for overlay counts.
8181 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
8182 * editfns.c (overlays_around, get_pos_property):
8183 * textprop.c (get_char_property_and_overlay):
8184 * xdisp.c (next_overlay_change, note_mouse_highlight):
8185 * xfaces.c (face_at_buffer_position):
8186 * buffer.c (OVERLAY_COUNT_MAX): New macro.
8187 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
8188 (Fnext_overlay_change, Fprevious_overlay_change)
8189 (mouse_face_overlay_overlaps, Foverlays_in):
8190 Use ptrdiff_t, not int, for sizes.
8191 (overlays_at, overlays_in): Check for size-calculation overflow.
8192
8193 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
8194
8195 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
8196 (x_session_initialize): Do not assume string length fits in int.
8197
8198 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
8199 This is unlikely, but can occur if DPI is outlandish.
8200
8201 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
8202 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
8203
8204 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
8205 * xrdb.c (magic_file_p, search_magic_path):
8206 Omit last arg SUFFIX; it was always 0. All callers changed.
8207 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
8208
8209 * xfont.c (xfont_match): Avoid need for strlen.
8210
8211 * xfns.c: Don't assume strlen fits in int.
8212 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
8213
8214 * xdisp.c (message_log_check_duplicate): Return intmax_t,
8215 not unsigned long, as we prefer signed integers. All callers changed.
8216 Detect integer overflow in repeat count.
8217 (message_dolog): Don't assume print length fits in 39 bytes.
8218 (display_mode_element): Don't assume strlen fits in int.
8219
8220 * termcap.c: Don't assume sizes fit in int and never overflow.
8221 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
8222 (gobble_line): Check for size-calculation overflow.
8223
8224 * minibuf.c (Fread_buffer):
8225 * lread.c (intern, intern_c_string):
8226 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
8227 Don't assume string length fits in int.
8228
8229 * keyboard.c (parse_tool_bar_item):
8230 * gtkutil.c (style_changed_cb): Avoid need for strlen.
8231
8232 * font.c: Don't assume string length fits in int.
8233 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
8234 Use ptrdiff_t, not int.
8235 (font_intern_prop): Don't assume string length fits in int.
8236 Don't assume integer property fits in fixnum.
8237 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
8238
8239 * filelock.c: Fix some buffer overrun and integer overflow issues.
8240 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
8241 Reformulate so as not to need the command string.
8242 Invoke gzip -cd rather than gunzip, as it's more portable.
8243 (lock_info_type, lock_file_1, lock_file):
8244 Don't assume pid_t and time_t fit in unsigned long.
8245 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
8246 (current_lock_owner): Prefer signed type for sizes.
8247 Use memcpy, not strncpy, where memcpy is what is really wanted.
8248 Don't assume (via atoi) that time_t and pid_t fit in int.
8249 Check for time_t and/or pid_t out of range, e.g., via a network share.
8250 Don't alloca where an auto var works fine.
8251
8252 * fileio.c: Fix some integer overflow issues.
8253 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
8254 Don't assume string length fits in int.
8255 (directory_file_name): Don't assume string length fits in long.
8256 (make_temp_name): Don't assume pid fits in int, or that its print
8257 length is less than 20.
8258
8259 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
8260
8261 * coding.c (make_subsidiaries): Don't assume string length fits in int.
8262
8263 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
8264
8265 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
8266 We prefer signed integers, even for size calculations.
8267
8268 * emacs.c: Don't assume string length fits in 'int'.
8269 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
8270 (main): Don't invoke strlen when not needed.
8271
8272 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
8273 (XD_DEBUG_MESSAGE): Don't waste a byte.
8274
8275 * callproc.c (getenv_internal_1, getenv_internal)
8276 (Fgetenv_internal):
8277 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
8278
8279 * lread.c (invalid_syntax): Omit length argument.
8280 All uses changed. This doesn't fix a bug, but it simplifies the
8281 code away from its former Hollerith-constant appearance, and it's
8282 one less 'int' to worry about when looking at integer-overflow issues.
8283 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
8284
8285 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
8286 This didn't break anything, but it didn't help either.
8287 It's confusing to put a bogus integer in a place where the actual
8288 value does not matter.
8289 (LIST_END_P): Remove unused macro and its bogus comment.
8290 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
8291
8292 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
8293 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
8294 implementation.
8295 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
8296 We prefer signed types, and the value cannot exceed the EMACS_INT
8297 range anyway (because otherwise the length would not be representable).
8298 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
8299 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
8300 This avoids a GCC warning when WIDE_EMACS_INT.
8301
8302 * indent.c (sane_tab_width): New function.
8303 (current_column, scan_for_column, Findent_to, position_indentation)
8304 (compute_motion): Use it. This is just for clarity.
8305 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
8306
8307 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
8308
8309 * lisp.h (lint_assume): New macro.
8310 * composite.c (composition_gstring_put_cache):
8311 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
8312
8313 * editfns.c, insdel.c:
8314 Omit unnecessary forward decls, to simplify future changes.
8315
8316 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
8317
8318 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
8319
8320 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
8321 Use much-faster test for byte-length change.
8322 Don't assume string byte-length fits in 'int'.
8323 Check that character arg fits in 'int'.
8324 (mapcar1): Declare byte as byte, for clarity.
8325
8326 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
8327
8328 * fns.c (concat): Catch string overflow earlier.
8329 Do not rely on integer wraparound.
8330
8331 * dispextern.h (struct it.overlay_strings_charpos)
8332 (struct it.selective): Now EMACS_INT, not int.
8333 * xdisp.c (forward_to_next_line_start)
8334 (back_to_previous_visible_line_start)
8335 (reseat_at_next_visible_line_start, next_element_from_buffer):
8336 Don't arbitrarily truncate the value of 'selective' to int.
8337
8338 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
8339
8340 * composite.c: Don't truncate sizes to 'int'.
8341 (composition_gstring_p, composition_reseat_it)
8342 (composition_adjust_point): Use EMACS_INT, not int.
8343 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
8344 not EMACS_UINT, for indexes.
8345
8346 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
8347
8348 * buffer.c: Include <verify.h>.
8349 (struct sortvec.priority, struct sortstr.priority):
8350 Now EMACS_INT, not int.
8351 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
8352 (struct sortstr.size, record_overlay_string)
8353 (struct sortstrlist.size, struct sortlist.used):
8354 Don't truncate size to int.
8355 (record_overlay_string): Check for size-calculation overflow.
8356 (init_buffer_once): Check at compile-time, not run-time.
8357
8358 2011-06-22 Jim Meyering <meyering@redhat.com>
8359
8360 Don't leak an XBM-image-sized buffer
8361 * image.c (xbm_load): Free the image buffer after using it.
8362
8363 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
8364
8365 Port to Sun C.
8366 * composite.c (find_automatic_composition): Omit needless 'return 0;'
8367 that Sun C diagnosed.
8368 * fns.c (secure_hash): Fix pointer signedness issue.
8369 * intervals.c (static_offset_intervals): New function.
8370 (offset_intervals): Use it.
8371
8372 2011-06-21 Leo Liu <sdl.web@gmail.com>
8373
8374 * deps.mk (fns.o):
8375 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
8376 sha512.h.
8377
8378 * fns.c (secure_hash): Rename from crypto_hash_function and change
8379 the first arg to accept symbols.
8380 (Fsecure_hash): New primitive.
8381 (syms_of_fns): New symbols.
8382
8383 2011-06-20 Deniz Dogan <deniz@dogan.se>
8384
8385 * process.c (Fset_process_buffer): Clarify return value in
8386 docstring.
8387
8388 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
8389
8390 * dispnew.c (add_window_display_history): Use BVAR.
8391
8392 * xdisp.c (debug_method_add): Use BVAR.
8393 (check_window_end, dump_glyph_matrix, dump_glyph)
8394 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
8395
8396 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
8397 Likewise.
8398
8399 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
8400 check till after the cache is created in init_frame_faces.
8401
8402 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
8403
8404 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
8405
8406 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
8407
8408 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
8409 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
8410 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
8411
8412 Improve buffer-overflow checking (Bug#8873).
8413 * fileio.c (Finsert_file_contents):
8414 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
8415 Remove the old (too-loose) buffer overflow checks.
8416 They weren't needed, since make_gap checks for buffer overflow.
8417 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
8418 The old code merely checked for Emacs fixnum overflow, and relied
8419 on undefined (wraparound) behavior. The new code avoids undefined
8420 behavior, and also checks for ptrdiff_t and/or size_t overflow.
8421
8422 * editfns.c (Finsert_char): Don't dump core with very negative counts.
8423 Tune. Don't use wider integers than needed. Don't use alloca.
8424 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
8425
8426 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
8427
8428 * insdel.c, lisp.h (buffer_overflow): New function.
8429 (insert_from_buffer_1, replace_range, replace_range_2):
8430 * insdel.c (make_gap_larger):
8431 * editfns.c (Finsert_char):
8432 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
8433
8434 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
8435
8436 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
8437
8438 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
8439
8440 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
8441 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
8442
8443 * fileio.c: Don't assume EMACS_INT fits in off_t.
8444 (emacs_lseek): New static function.
8445 (Finsert_file_contents, Fwrite_region): Use it.
8446 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
8447
8448 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
8449
8450 * fns.c: Don't overflow int when computing a list length.
8451 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
8452 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
8453 truncation on 64-bit hosts. Check for QUIT every
8454 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
8455 faster and is responsive enough.
8456 (Flength): Report an error instead of overflowing an integer.
8457 (Fsafe_length): Return a float if the value is not representable
8458 as a fixnum. This shouldn't happen except in contrived situations.
8459 (Fnthcdr, Fsort): Don't assume list length fits in int.
8460 (Fcopy_sequence): Don't assume vector length fits in int.
8461
8462 * alloc.c: Check that resized vectors' lengths fit in fixnums.
8463 (header_size, word_size): New constants.
8464 (allocate_vectorlike): Don't check size overflow here.
8465 (allocate_vector): Check it here instead, since this is the only
8466 caller of allocate_vectorlike that could cause overflow.
8467 Check that the new vector's length is representable as a fixnum.
8468
8469 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
8470 The previous code was bogus. For example, next_almost_prime (32)
8471 returned 39, which is undesirable as it is a multiple of 3; and
8472 next_almost_prime (24) returned 25, which is a multiple of 5 so
8473 why was the code bothering to check for multiples of 7?
8474
8475 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
8476
8477 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
8478
8479 Variadic C functions now count arguments with ptrdiff_t.
8480 This partly undoes my 2011-03-30 change, which replaced int with size_t.
8481 Back then I didn't know that the Emacs coding style prefers signed int.
8482 Also, in the meantime I found a few more instances where arguments
8483 were being counted with int, which may truncate counts on 64-bit
8484 machines, or EMACS_INT, which may be unnecessarily wide.
8485 * lisp.h (struct Lisp_Subr.function.aMANY)
8486 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
8487 Arg counts are now ptrdiff_t, not size_t.
8488 All variadic functions and their callers changed accordingly.
8489 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
8490 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
8491 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
8492 * callint.c (Fcall_interactively): Check arg count for overflow,
8493 to avoid potential buffer overrun. Use signed char, not 'int',
8494 for 'varies' array, so that we needn't bother to check its size
8495 calculation for overflow.
8496 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
8497 * eval.c (apply_lambda):
8498 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
8499 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
8500 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
8501
8502 * callint.c (Fcall_interactively): Don't use index var as event count.
8503
8504 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
8505 * mem-limits.h (SIZE): Remove; no longer used.
8506
8507 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
8508
8509 Remove unnecessary casts.
8510 * xterm.c (x_term_init):
8511 * xfns.c (x_set_border_pixel):
8512 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
8513 These aren't needed now that we assume ANSI C.
8514
8515 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
8516 It's more likely to cause problems (due to unsigned overflow)
8517 than to cure them.
8518
8519 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
8520
8521 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
8522
8523 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
8524
8525 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
8526
8527 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
8528
8529 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
8530
8531 GLYPH_CODE_FACE returns EMACS_INT, not int.
8532 * dispextern.h (merge_faces):
8533 * xfaces.c (merge_faces):
8534 * xdisp.c (get_next_display_element, next_element_from_display_vector):
8535 Don't assume EMACS_INT fits in int.
8536
8537 * character.h (CHAR_VALID_P): Remove unused parameter.
8538 * fontset.c, lisp.h, xdisp.c: All uses changed.
8539
8540 * editfns.c (Ftranslate_region_internal): Omit redundant test.
8541
8542 * fns.c (concat): Minor tuning based on overflow analysis.
8543 This doesn't fix any bugs. Use int to hold character, instead
8544 of constantly refetching from Emacs object. Use XFASTINT, not
8545 XINT, for value known to be a character. Don't bother comparing
8546 a single byte to 0400, as it's always less.
8547
8548 * floatfns.c (Fexpt):
8549 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
8550
8551 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
8552 for characters.
8553
8554 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
8555
8556 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
8557 Without this fix, on a 64-bit host (aset S 0 4294967386) would
8558 incorrectly succeed when S was a string, because 4294967386 was
8559 truncated before it was used.
8560
8561 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
8562 Otherwise, an out-of-range integer could cause undefined behavior
8563 on a 64-bit host.
8564
8565 * composite.c: Use int, not EMACS_INT, for characters.
8566 (fill_gstring_body, composition_compute_stop_pos): Use int, not
8567 EMACS_INT, for values that are known to be in character range.
8568 This doesn't fix any bugs but is the usual style inside Emacs and
8569 may generate better code on 32-bit machines.
8570
8571 Make sure a 64-bit char is never passed to ENCODE_CHAR.
8572 This is for reasons similar to the recent CHAR_STRING fix.
8573 * charset.c (Fencode_char): Check that character arg is actually
8574 a character. Pass an int to ENCODE_CHAR.
8575 * charset.h (ENCODE_CHAR): Verify that the character argument is no
8576 wider than 'int', as a compile-time check to prevent future regressions
8577 in this area.
8578
8579 * character.c (char_string): Remove unnecessary casts.
8580
8581 Make sure a 64-bit char is never passed to CHAR_STRING.
8582 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
8583 by silently ignoring the top 32 bits, allowing some values
8584 that were far too large to be valid characters.
8585 * character.h: Include <verify.h>.
8586 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
8587 arguments are no wider than unsigned, as a compile-time check
8588 to prevent future regressions in this area.
8589 * data.c (Faset):
8590 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
8591 (Fsubst_char_in_region):
8592 * fns.c (concat):
8593 * xdisp.c (decode_mode_spec_coding):
8594 Adjust to CHAR_STRING's new requirement.
8595 * editfns.c (Finsert_char, Fsubst_char_in_region):
8596 * fns.c (concat): Check that character args are actually
8597 characters. Without this test, these functions did the wrong
8598 thing with wildly out-of-range values on 64-bit hosts.
8599
8600 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
8601 These casts should not be needed on 32-bit hosts, either.
8602 * keyboard.c (read_char):
8603 * lread.c (Fload): Remove casts to unsigned.
8604
8605 * lisp.h (UNSIGNED_CMP): New macro.
8606 This fixes comparison bugs on 64-bit hosts.
8607 (ASCII_CHAR_P): Use it.
8608 * casefiddle.c (casify_object):
8609 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
8610 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
8611 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
8612 * dispextern.h (FACE_FROM_ID):
8613 * keyboard.c (read_char): Use UNSIGNED_CMP.
8614
8615 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
8616 not to EMACS_INT, to avoid GCC warning.
8617
8618 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
8619
8620 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
8621 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
8622 isn't needed on 32-bit machines.
8623
8624 * buffer.c (Fgenerate_new_buffer_name):
8625 Use EMACS_INT for count, not int.
8626 (advance_to_char_boundary): Return EMACS_INT, not int.
8627
8628 * data.c (Qcompiled_function): Now static.
8629
8630 * window.c (window_body_lines): Now static.
8631
8632 * image.c (gif_load): Rename local to avoid shadowing.
8633
8634 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
8635 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
8636 * alloc.c (make_save_value): Integer argument is now of type
8637 ptrdiff_t, not int.
8638 (mark_object): Use ptrdiff_t, not int.
8639 * lisp.h (pD): New macro.
8640 * print.c (print_object): Use it.
8641
8642 * alloc.c: Use EMACS_INT, not int, to count objects.
8643 (total_conses, total_markers, total_symbols, total_vector_size)
8644 (total_free_conses, total_free_markers, total_free_symbols)
8645 (total_free_floats, total_floats, total_free_intervals)
8646 (total_intervals, total_strings, total_free_strings):
8647 Now EMACS_INT, not int. All uses changed.
8648 (Fgarbage_collect): Compute overall total using a double, so that
8649 integer overflow is less likely to be a problem. Check for overflow
8650 when converting back to an integer.
8651 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
8652 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
8653 These were 'int' variables that could overflow on 64-bit hosts;
8654 they were never used, so remove them instead of repairing them.
8655 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
8656 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
8657 Previously, this ceilinged at INT_MAX, but that doesn't work on
8658 64-bit machines.
8659 (allocate_pseudovector): Don't use EMACS_INT when int would do.
8660
8661 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
8662 (allocate_vectorlike): Check for ptrdiff_t overflow.
8663 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
8664 when a (possibly-narrower) signed value would do just as well.
8665 We prefer using signed arithmetic, to avoid comparison confusion.
8666
8667 * alloc.c: Catch some string size overflows that we were missing.
8668 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
8669 for convenience in STRING_BYTES_MAX.
8670 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
8671 The definition here is exact; the one in lisp.h was approximate.
8672 (allocate_string_data): Check for string overflow. This catches
8673 some instances we weren't catching before. Also, it catches
8674 size_t overflow on (unusual) hosts where SIZE_MAX <= min
8675 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
8676 and ptrdiff_t and EMACS_INT are both 64 bits.
8677
8678 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
8679 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
8680 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
8681
8682 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
8683
8684 * alloc.c (Fmake_string): Check for out-of-range init.
8685
8686 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
8687
8688 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
8689
8690 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
8691
8692 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
8693 xg_get_default_scrollbar_width.
8694
8695 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
8696 (int_gtk_range_get_value): Move to the scroll bar part of the file.
8697 (style_changed_cb): Call update_theme_scrollbar_width and call
8698 x_set_scroll_bar_default_width and xg_frame_set_char_size for
8699 all frames (Bug#8505).
8700 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
8701 Call gtk_window_set_resizable if HAVE_GTK3.
8702 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
8703 and height if HAVE_GTK3 (Bug#8505).
8704 (scroll_bar_width_for_theme): New variable.
8705 (update_theme_scrollbar_width): New function.
8706 (xg_get_default_scrollbar_width): Move code to
8707 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
8708 (xg_initialize): Call update_theme_scrollbar_width.
8709
8710 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
8711
8712 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
8713
8714 2011-06-12 Martin Rudalics <rudalics@gmx.at>
8715
8716 * frame.c (make_frame): Call other_buffer_safely instead of
8717 other_buffer.
8718
8719 * window.c (temp_output_buffer_show): Call display_buffer with
8720 second argument Vtemp_buffer_show_specifiers and reset latter
8721 immediately after the call.
8722 (Vtemp_buffer_show_specifiers): New variable.
8723 (auto_window_vscroll_p, next_screen_context_lines)
8724 (Vscroll_preserve_screen_position): Remove leading asterisks from
8725 doc-strings.
8726
8727 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
8728
8729 Fix minor problems found by GCC 4.6.0 static checking.
8730 * buffer.c (Qclone_number): Remove for now, as it's unused.
8731 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
8732 (record_buffer): Remove unused local.
8733 * frame.c (other_visible_frames, frame_buffer_list): Now static.
8734 (set_frame_buffer_list): Remove; unused.
8735 * frame.h (other_visible_frames): Remove decl.
8736 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
8737 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
8738 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
8739 if HAVE_GPM.
8740 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
8741 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
8742 Define only if HAVE_GPM.
8743 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
8744 (update_hints_inhibit): Remove; never set. All uses removed.
8745 * widgetprv.h (emacsFrameClassRec): Remove decl.
8746 * window.c (delete_deletable_window): Now returns void, since it
8747 wasn't returning anything.
8748 (compare_window_configurations): Remove unused locals.
8749 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
8750 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
8751 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
8752 the same widths as pointers. This follows up on the 2011-05-06 patch.
8753 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
8754 * xterm.h: Likewise.
8755 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
8756
8757 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
8758
8759 * makefile.w32-in: Update dependencies.
8760 (LISP_H): Add lib/intprops.h.
8761
8762 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
8763
8764 * image.c (gif_load): Add animation frame delay to the metadata.
8765 (syms_of_image): Use DEFSYM. New symbol `delay'.
8766
8767 2011-06-11 Martin Rudalics <rudalics@gmx.at>
8768
8769 * window.c (delete_deletable_window): Re-add.
8770 (Fset_window_configuration): Rewrite to handle dead buffers and
8771 consequently deletable windows.
8772 (window_tree, Fwindow_tree): Remove. Supply functionality in
8773 window.el.
8774 (compare_window_configurations): Simplify code.
8775
8776 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
8777
8778 * image.c (imagemagick_load_image): Fix type mismatch.
8779 (Fimagemagick_types): Likewise.
8780
8781 * window.h (replace_buffer_in_windows): Declare.
8782
8783 2011-06-11 Martin Rudalics <rudalics@gmx.at>
8784
8785 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
8786 Qclone_number. Remove external declaration of Qdelete_window.
8787 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
8788 code.
8789 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
8790 Run Qbuffer_list_update_hook if allowed.
8791 (Fother_buffer): Rewrite doc-string. Major rewrite for new
8792 buffer list implementation.
8793 (other_buffer_safely): New function.
8794 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
8795 calls to replace_buffer_in_windows and
8796 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
8797 if allowed.
8798 (record_buffer): Inhibit quitting and rewrite using quittable
8799 functions. Run Qbuffer_list_update_hook if allowed.
8800 (Frecord_buffer, Funrecord_buffer): New functions.
8801 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
8802 Move switch-to-buffer to window.el.
8803 (bury-buffer): Move to window.el.
8804 (Vbuffer_list_update_hook): New variable.
8805
8806 * lisp.h (other_buffer_safely): Add prototype in buffer.c
8807 section.
8808
8809 * window.h (resize_frame_windows): Move up in code.
8810 (Fwindow_frame): Remove EXFUN.
8811 (replace_buffer_in_all_windows): Remove prototype.
8812 (replace_buffer_in_windows_safely): Add prototype.
8813
8814 * window.c: Declare Qdelete_window static again. Move down
8815 declaration of select_count.
8816 (Fnext_window, Fprevious_window): Rewrite doc-strings.
8817 (Fother_window): Move to window.el.
8818 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
8819 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
8820 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
8821 window.el.
8822 (replace_buffer_in_windows): Implement by calling
8823 Qreplace_buffer_in_windows.
8824 (replace_buffer_in_all_windows): Remove with some functionality
8825 moved into replace_buffer_in_windows_safely.
8826 (replace_buffer_in_windows_safely): New function.
8827 (select_window_norecord, select_frame_norecord): Move in front
8828 of run_window_configuration_change_hook. Remove now obsolete
8829 declarations.
8830 (Fset_window_buffer): Rewrite doc-string.
8831 Call Qrecord_window_buffer.
8832 (keys_of_window): Move binding for other-window to window.el.
8833
8834 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
8835
8836 * dispextern.h (struct image): Replace data member, whose int_val
8837 and ptr_val fields were not used by anything, with a single
8838 lisp_val object.
8839
8840 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
8841 (gif_clear_image, gif_load, imagemagick_load_image)
8842 (gs_clear_image, gs_load): Callers changed.
8843
8844 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
8845
8846 * buffer.h: Include <time.h>, for time_t.
8847 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
8848
8849 Fix minor problems found by static checking.
8850
8851 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
8852
8853 Make identifiers static if they are not used in other modules.
8854 * data.c (Qcompiled_function, Qframe, Qvector):
8855 * image.c (QimageMagick, Qsvg):
8856 * minibuf.c (Qmetadata):
8857 * window.c (resize_window_check, resize_root_window): Now static.
8858 * window.h (resize_window_check, resize_root_window): Remove decls.
8859
8860 * window.c (window_deletion_count, delete_deletable_window):
8861 Remove; unused.
8862 (window_body_lines): Now static.
8863 (Fdelete_other_windows_internal): Mark vars as initialized.
8864 Make sure 'resize_failed' is initialized.
8865 (run_window_configuration_change_hook): Rename local to avoid shadowing.
8866 (resize_window_apply): Remove unused local.
8867 * window.h (delete_deletable_window): Remove decl.
8868
8869 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
8870 (imagemagick_load_image): Fix pointer signedness problem by changing
8871 last arg from unsigned char * to char *. All uses changed.
8872 Also, fix a local for similar reasons.
8873 Remove unused locals. Remove locals to avoid shadowing.
8874 (fn_rsvg_handle_free): Remove; unused.
8875 (svg_load, svg_load_image): Fix pointer signedness problem.
8876 (imagemagick_load_image): Don't use garbage pointer image_wand.
8877
8878 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
8879
8880 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
8881
8882 * image.c (gif_load): Fix omitted cast error introduced by
8883 2011-06-06 change.
8884
8885 2011-06-10 Martin Rudalics <rudalics@gmx.at>
8886
8887 * window.h (resize_proportionally, orig_total_lines)
8888 (orig_top_line): Remove from window structure.
8889 (set_window_height, set_window_width, change_window_heights)
8890 (Fdelete_window): Remove prototypes.
8891 (resize_frame_windows): Remove duplicate declaration.
8892
8893 2011-06-10 Eli Zaretskii <eliz@gnu.org>
8894
8895 * window.h (resize_frame_windows, resize_window_check)
8896 (delete_deletable_window, resize_root_window)
8897 (resize_frame_windows): Declare prototypes.
8898
8899 * window.c (resize_window_apply): Make definition be "static" to
8900 match the prototype.
8901
8902 2011-06-10 Martin Rudalics <rudalics@gmx.at>
8903
8904 * window.c: Remove declarations of Qwindow_size_fixed,
8905 window_min_size_1, window_min_size_2, window_min_size,
8906 size_window, window_fixed_size_p, enlarge_window, delete_window.
8907 Remove static from declaration of Qdelete_window, it's
8908 temporarily needed by Fbury_buffer.
8909 (replace_window): Don't assign orig_top_line and
8910 orig_total_lines.
8911 (Fdelete_window, delete_window): Remove. Window deletion is
8912 handled by window.el.
8913 (window_loop): Remove DELETE_OTHER_WINDOWS case.
8914 Replace Fdelete_window calls with calls to Qdelete_window.
8915 (Fdelete_other_windows): Remove. Deleting other windows is
8916 handled by window.el.
8917 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
8918 handled in window.el.
8919 (window_min_size_2, window_min_size_1, window_min_size): Remove.
8920 Window minimum sizes are handled in window.el.
8921 (shrink_windows, size_window, set_window_height)
8922 (set_window_width, change_window_heights, window_height)
8923 (window_width, CURBEG, CURSIZE, enlarge_window)
8924 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
8925 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
8926 handled in window.el.
8927 (make_dummy_parent): Rename to make_parent_window and give it a
8928 second argument horflag.
8929 (make_window): Don't set resize_proportionally any more.
8930 (Fsplit_window): Remove. Windows are split in window.el.
8931 (save_restore_action, save_restore_orig_size)
8932 (shrink_window_lowest_first, save_restore_orig_size): Remove.
8933 Resize mini windows in window.el.
8934 (grow_mini_window, shrink_mini_window): Implement by calling
8935 Qresize_root_window_vertically, resize_window_check and
8936 resize_window_apply.
8937 (saved_window, Fset_window_configuration, save_window_save):
8938 Do not handle orig_top_line, orig_total_lines, and
8939 resize_proportionally.
8940 (window_min_height, window_min_width): Move to window.el.
8941 (keys_of_window): Move bindings for delete-other-windows,
8942 split-window, delete-window and enlarge-window to window.el.
8943
8944 * buffer.c: Temporarily extern Qdelete_window.
8945 (Fbury_buffer): Temporarily call Qdelete_window instead of
8946 Fdelete_window (Fbury_buffer will move to window.el soon).
8947
8948 * frame.c (set_menu_bar_lines_1): Remove code handling
8949 orig_top_line and orig_total_lines.
8950
8951 * dispnew.c (adjust_frame_glyphs_initially): Don't use
8952 set_window_height but set heights directly.
8953 (change_frame_size_1): Use resize_frame_windows.
8954
8955 * xdisp.c (init_xdisp): Don't use set_window_height but set
8956 heights directly.
8957
8958 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
8959 Use resize_frame_windows instead of change_window_heights and run
8960 run_window_configuration_change_hook.
8961
8962 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
8963 instead of change_window_heights and run
8964 run_window_configuration_change_hook.
8965
8966 2011-06-09 Martin Rudalics <rudalics@gmx.at>
8967
8968 * window.c (replace_window): Rename second argument REPLACEMENT to
8969 NEW. New third argument SETFLAG. Rewrite.
8970 (delete_window, make_dummy_parent): Call replace_window with
8971 third argument 1.
8972 (window_list_1): Move down in code.
8973 (run_window_configuration_change_hook): Move set_buffer part
8974 before select_frame_norecord part in order to unwind correctly.
8975 Rename count1 to count.
8976 (recombine_windows, delete_deletable_window, resize_root_window)
8977 (Fdelete_other_windows_internal)
8978 (Frun_window_configuration_change_hook, make_parent_window)
8979 (resize_window_check, resize_window_apply, Fresize_window_apply)
8980 (resize_frame_windows, Fsplit_window_internal)
8981 (Fdelete_window_internal, Fresize_mini_window_internal):
8982 New functions.
8983 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
8984
8985 2011-06-08 Martin Rudalics <rudalics@gmx.at>
8986
8987 * window.h (window): Add some new members to window structure -
8988 normal_lines, normal_cols, new_total, new_normal, clone_number,
8989 splits, nest, prev_buffers, next_buffers.
8990 (WINDOW_TOTAL_SIZE): Move here from window.c.
8991 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
8992
8993 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
8994 Remove.
8995 (make_dummy_parent): Set new members of windows structure.
8996 (make_window): Move down in code. Handle new members of window
8997 structure.
8998 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
8999 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
9000 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
9001 (Fset_window_prev_buffers, Fwindow_next_buffers)
9002 (Fset_window_next_buffers, Fset_window_clone_number):
9003 New functions.
9004 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
9005 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
9006 Doc-string fixes.
9007 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
9008 Argument WINDOW can be now internal window too.
9009 (Fwindow_use_time): Move up in code.
9010 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
9011 Rewrite doc-string.
9012 (Fset_window_configuration, saved_window)
9013 (Fcurrent_window_configuration, save_window_save): Handle new
9014 members of window structure.
9015 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
9016 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
9017 (syms_of_window): New Lisp objects Qrecord_window_buffer,
9018 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
9019 Qget_mru_window, Qresize_root_window,
9020 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
9021 Qauto_buffer_name; staticpro them.
9022
9023 2011-06-07 Martin Rudalics <rudalics@gmx.at>
9024
9025 * window.c (Fwindow_total_size, Fwindow_left_column)
9026 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
9027 (Fwindow_list_1): New functions.
9028 (window_box_text_cols): Replace with window_body_cols.
9029 (Fwindow_width, Fscroll_left, Fscroll_right):
9030 Use window_body_cols instead of window_box_text_cols.
9031 (delete_window, Fset_window_configuration):
9032 Call delete_all_subwindows with window as argument.
9033 (delete_all_subwindows): Take a window as argument and not a
9034 structure. Rewrite.
9035 (window_loop): Remove handling of GET_LRU_WINDOW and
9036 GET_LARGEST_WINDOW.
9037 (Fget_lru_window, Fget_largest_window): Move to window.el.
9038
9039 * window.h: Extern window_body_cols instead of
9040 window_box_text_cols. delete_all_subwindows now takes a
9041 Lisp_Object as argument.
9042
9043 * indent.c (compute_motion, Fcompute_motion):
9044 Use window_body_cols instead of window_box_text_cols.
9045
9046 * frame.c (delete_frame): Call delete_all_subwindows with root
9047 window as argument.
9048
9049 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
9050
9051 * fns.c (Fputhash): Document return value.
9052
9053 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
9054
9055 * image.c (gif_load): Implement gif89a spec "no disposal" method.
9056
9057 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
9058
9059 Cons<->int and similar integer overflow fixes (Bug#8794).
9060
9061 Check for overflow when converting integer to cons and back.
9062 * charset.c (Fdefine_charset_internal, Fdecode_char):
9063 Use cons_to_unsigned to catch overflow.
9064 (Fencode_char): Use INTEGER_TO_CONS.
9065 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
9066 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
9067 * data.c (long_to_cons, cons_to_long): Remove.
9068 (cons_to_unsigned, cons_to_signed): New functions.
9069 These signal an error for invalid or out-of-range values.
9070 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
9071 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
9072 * font.c (Ffont_variation_glyphs):
9073 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
9074 * lisp.h: Include <intprops.h>.
9075 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
9076 (cons_to_signed, cons_to_unsigned): New decls.
9077 (long_to_cons, cons_to_long): Remove decls.
9078 * undo.c (record_first_change): Use INTEGER_TO_CONS.
9079 (Fprimitive_undo): Use CONS_TO_INTEGER.
9080 * xfns.c (Fx_window_property): Likewise.
9081 * xselect.c: Include <limits.h>.
9082 (x_own_selection, selection_data_to_lisp_data):
9083 Use INTEGER_TO_CONS.
9084 (x_handle_selection_request, x_handle_selection_clear)
9085 (x_get_foreign_selection, Fx_disown_selection_internal)
9086 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
9087 (lisp_data_to_selection_data): Use cons_to_unsigned.
9088 (x_fill_property_data): Use cons_to_signed.
9089 Report values out of range.
9090
9091 Check for buffer and string overflow more precisely.
9092 * buffer.h (BUF_BYTES_MAX): New macro.
9093 * lisp.h (STRING_BYTES_MAX): New macro.
9094 * alloc.c (Fmake_string):
9095 * character.c (string_escape_byte8):
9096 * coding.c (coding_alloc_by_realloc):
9097 * doprnt.c (doprnt):
9098 * editfns.c (Fformat):
9099 * eval.c (verror):
9100 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
9101 since they may not be the same number.
9102 * editfns.c (Finsert_char):
9103 * fileio.c (Finsert_file_contents):
9104 Likewise for BUF_BYTES_MAX.
9105
9106 * image.c: Use ptrdiff_t, not int, for sizes.
9107 (slurp_file): Switch from int to ptrdiff_t.
9108 All uses changed.
9109 (slurp_file): Check that file size fits in both size_t (for
9110 malloc) and ptrdiff_t (for sanity and safety).
9111
9112 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
9113 if b->modtime has its maximal value.
9114
9115 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
9116
9117 Don't assume time_t can fit into int.
9118 * buffer.h (struct buffer.modtime): Now time_t, not int.
9119 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
9120 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
9121
9122 Minor fixes for signed vs unsigned integers.
9123 * character.h (MAYBE_UNIFY_CHAR):
9124 * charset.c (maybe_unify_char):
9125 * keyboard.c (read_char, reorder_modifiers):
9126 XINT -> XFASTINT, since the integer must be nonnegative.
9127 * ftfont.c (ftfont_spec_pattern):
9128 * keymap.c (access_keymap, silly_event_symbol_error):
9129 XUINT -> XFASTINT, since the integer must be nonnegative.
9130 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
9131 since it makes no difference and we prefer signed.
9132 * keyboard.c (record_char): Use XUINT when all the neighbors do.
9133 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
9134 nonnegative.
9135
9136 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
9137
9138 * window.h (Fwindow_frame): Declare.
9139
9140 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
9141
9142 * alloc.c: Simplify handling of large-request failures (Bug#8800).
9143 (SPARE_MEMORY): Always define.
9144 (LARGE_REQUEST): Remove.
9145 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
9146
9147 2011-06-06 Martin Rudalics <rudalics@gmx.at>
9148
9149 * lisp.h: Move EXFUNS for Fframe_root_window,
9150 Fframe_first_window and Fset_frame_selected_window to window.h.
9151
9152 * window.h: Move EXFUNS for Fframe_root_window,
9153 Fframe_first_window and Fset_frame_selected_window here from
9154 lisp.h.
9155
9156 * frame.c (Fwindow_frame, Fframe_first_window)
9157 (Fframe_root_window, Fframe_selected_window)
9158 (Fset_frame_selected_window): Move to window.c.
9159 (Factive_minibuffer_window): Move to minibuf.c.
9160 (Fother_visible_frames_p): New function.
9161
9162 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
9163
9164 * window.c (decode_window, decode_any_window): Move up in code.
9165 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
9166 (inhibit_frame_unsplittable): Remove unused variable.
9167 (Fwindow_buffer): Move up and rewrite doc-string.
9168 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
9169 (Fwindow_prev): New functions.
9170 (Fwindow_frame): Move here from frame.c. Accept any window as
9171 argument.
9172 (Fframe_root_window, Fframe_first_window)
9173 (Fframe_selected_window): Move here from frame.c. Accept frame
9174 or arbitrary window as argument. Update doc-strings.
9175 (Fminibuffer_window): Move up in code.
9176 (Fwindow_minibuffer_p): Move up in code and simplify.
9177 (Fset_frame_selected_window): Move here from frame.c.
9178 Marginal rewrite.
9179 (Fselected_window, select_window, Fselect_window): Move up in
9180 code. Minor doc-string fixes.
9181
9182 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
9183
9184 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
9185 Do not assume that spare memory exists; that assumption is valid
9186 only if SYSTEM_MALLOC.
9187 (LARGE_REQUEST): New macro, so that the issue of large requests
9188 is separated from the issue of spare memory.
9189
9190 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
9191
9192 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
9193 format. (Bug#8806)
9194
9195 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
9196
9197 * xfns.c (x_set_scroll_bar_default_width): Move declarations
9198 before statements.
9199
9200 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
9201
9202 * gtkutil.c (xg_get_default_scrollbar_width): New function.
9203
9204 * gtkutil.h: Declare xg_get_default_scrollbar_width.
9205
9206 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
9207 min width by calling x_set_scroll_bar_default_width (Bug#8505).
9208
9209 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
9210
9211 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
9212
9213 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
9214
9215 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
9216 (x_clipboard_manager_save): Add return value.
9217 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
9218 New error handlers.
9219 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
9220 Obey Vx_select_enable_clipboard_manager. Catch errors in
9221 x_clipboard_manager_save (Bug#8779).
9222 (Vx_select_enable_clipboard_manager): New variable.
9223 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
9224
9225 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
9226
9227 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
9228
9229 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9230
9231 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
9232 in the current matrix if keep_current_p is non-zero.
9233
9234 2011-06-04 Eli Zaretskii <eliz@gnu.org>
9235
9236 * bidi.c (bidi_level_of_next_char): Fix last change.
9237
9238 2011-06-03 Eli Zaretskii <eliz@gnu.org>
9239
9240 Support bidi reordering of text covered by display properties.
9241
9242 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
9243 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
9244 (bidi_cache_search, bidi_cache_iterator_state)
9245 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
9246 (bidi_level_of_next_char, bidi_move_to_visually_next):
9247 Support character positions inside a run of characters covered by a
9248 display string.
9249 (bidi_paragraph_init, bidi_resolve_explicit_1)
9250 (bidi_level_of_next_char): Call bidi_fetch_char and
9251 bidi_fetch_char_advance instead of FETCH_CHAR and
9252 FETCH_CHAR_ADVANCE.
9253 (bidi_init_it): Initialize new members.
9254 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
9255 definitions.
9256 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
9257 instead of using explicit *_CHAR codes.
9258 (bidi_resolve_explicit, bidi_resolve_weak):
9259 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
9260 bidirectional text is supported only in multibyte buffers.
9261 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
9262 it to initialize the frame_window_p member of struct bidi_it.
9263 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
9264 (bidi_resolve_explicit, bidi_resolve_weak)
9265 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
9266 bidi_it->nchars is non-positive.
9267 (bidi_level_of_next_char): Don't try to lookup the cache for the
9268 next/previous character if nothing is cached there yet, or if we
9269 were just reseat()'ed to a new position.
9270
9271 * xdisp.c (set_cursor_from_row): Set start and stop points
9272 according to the row's direction when priming the loop that looks
9273 for the glyph on which to display cursor.
9274 (single_display_spec_intangible_p): Function deleted.
9275 (display_prop_intangible_p): Reimplement to call
9276 handle_display_spec instead of single_display_spec_intangible_p.
9277 Accept 3 additional arguments needed by handle_display_spec.
9278 This fixes incorrect cursor motion across display property with complex
9279 values: lists, `(when COND...)' forms, etc.
9280 (single_display_spec_string_p): Support property values that are
9281 lists with the argument STRING its top-level element.
9282 (display_prop_string_p): Fix the condition for processing a
9283 property that is a list to be consistent with handle_display_spec.
9284 (handle_display_spec): New function, refactored from the
9285 last portion of handle_display_prop.
9286 (compute_display_string_pos): Accept additional argument
9287 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
9288 value of a `display' property is a "replacing spec".
9289 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
9290 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
9291 the display property, but just return a value indicating whether
9292 the display property will replace the characters it covers.
9293 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
9294 frame_window_p members of struct bidi_it.
9295 (compute_display_string_pos, compute_display_string_end):
9296 New functions.
9297 (push_it): Accept second argument POSITION, where pop_it should
9298 jump to continue iteration.
9299 (reseat_1): Initialize bidi_it.disp_pos.
9300
9301 * keyboard.c (adjust_point_for_property): Adjust the call to
9302 display_prop_intangible_p to its new signature.
9303
9304 * dispextern.h (struct bidi_it): New member frame_window_p.
9305 (bidi_init_it): Update prototypes.
9306 (display_prop_intangible_p): Update prototype.
9307 (compute_display_string_pos, compute_display_string_end):
9308 Declare prototypes.
9309 (struct bidi_it): New members nchars and disp_pos. ch_len is now
9310 EMACS_INT.
9311
9312 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
9313
9314 Malloc failure behavior now depends on size of allocation.
9315 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
9316 * lisp.h: Change signatures accordingly.
9317 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
9318 All callers changed. (Bug#8762)
9319
9320 * gnutls.c: Use Emacs's memory allocators.
9321 Without this change, the gnutls library would invoke malloc etc.
9322 directly, which causes problems on non-SYNC_INPUT hosts, and which
9323 runs afoul of improving memory_full behavior. (Bug#8761)
9324 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
9325 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
9326 xfree instead of the default malloc, realloc, free.
9327 (Fgnutls_boot): No need to check for memory allocation failure,
9328 since xmalloc does that for us.
9329
9330 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
9331 * category.c (hash_get_category_set):
9332 * ccl.c (ccl_driver):
9333 * charset.c (Fdefine_charset_internal):
9334 * charset.h (struct charset.hash_index):
9335 * composite.c (get_composition_id, gstring_lookup_cache)
9336 (composition_gstring_put_cache):
9337 * composite.h (struct composition.hash_index):
9338 * dispextern.h (struct image.hash):
9339 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
9340 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
9341 (hashfn_equal, hashfn_user_defined, make_hash_table)
9342 (maybe_resize_hash_table, hash_lookup, hash_put)
9343 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
9344 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
9345 (Fsxhash, Fgethash, Fputhash, Fmaphash):
9346 * image.c (make_image, search_image_cache, lookup_image)
9347 (xpm_put_color_table_h):
9348 * lisp.h (struct Lisp_Hash_Table):
9349 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
9350 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
9351 for hashes and hash indexes, instead of 'unsigned' and 'int'.
9352 * alloc.c (allocate_vectorlike):
9353 Check for overflow in vector size calculations.
9354 * ccl.c (ccl_driver):
9355 Check for overflow when converting EMACS_INT to int.
9356 * fns.c, image.c: Remove unnecessary static decls that would otherwise
9357 need to be updated by these changes.
9358 * fns.c (make_hash_table, maybe_resize_hash_table):
9359 Check for integer overflow with large hash tables.
9360 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
9361 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
9362 (SXHASH_REDUCE): New macro.
9363 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
9364 Use it instead of discarding useful hash info with large hash values.
9365 (sxhash_float): New function.
9366 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
9367 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
9368 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
9369 Rewrite to use FIXNUM_BITS, as this simplifies things.
9370 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
9371 Adjust signatures to match updated version of code.
9372 (consing_since_gc): Now EMACS_INT, since a single hash table can
9373 use more than INT_MAX bytes.
9374
9375 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
9376
9377 Make it possible to build with GCC-4.6+ -O2 -flto.
9378
9379 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
9380
9381 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
9382
9383 * minibuf.c (get_minibuffer, read_minibuf_unwind):
9384 Call minibuffer-inactive-mode.
9385
9386 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
9387
9388 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
9389 Update dependencies.
9390
9391 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
9392
9393 * data.c (init_data): Remove code for UTS, this system is not
9394 supported anymore.
9395
9396 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
9397
9398 Don't force ./temacs to start in terminal mode.
9399
9400 * frame.c (make_initial_frame): Initialize faces in all cases, not
9401 only when CANNOT_DUMP is defined.
9402 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
9403
9404 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
9405
9406 * dispnew.c (add_window_display_history): Use const for the string
9407 pointer. Remove declaration, not needed.
9408
9409 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9410
9411 Use 'inline', not 'INLINE'.
9412 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
9413 * alloc.c, fontset.c (INLINE): Remove.
9414 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
9415 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
9416 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
9417 * gmalloc.c (register_heapinfo): Use inline unconditionally.
9418 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
9419
9420 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
9421
9422 Make it possible to run ./temacs.
9423
9424 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
9425 syms_of_callproc does the same thing. Remove test for
9426 "initialized", do it in the caller.
9427 * emacs.c (main): Avoid calling set_initial_environment when dumping.
9428
9429 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
9430
9431 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
9432 (read_minibuf): Use get_minibuffer.
9433 (syms_of_minibuf): Use DEFSYM.
9434 (Qmetadata): New var.
9435 * data.c (Qbuffer): Don't make it static.
9436 (syms_of_data): Use DEFSYM.
9437
9438 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9439
9440 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
9441 (CCL_CODE_MIN): New macro.
9442
9443 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
9444
9445 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
9446
9447 * eval.c (Qdebug): Now static.
9448 * lisp.h (Qdebug): Remove decl. This reverts a part of the
9449 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
9450 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
9451
9452 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
9453
9454 * image.c: Various fixes to ImageMagick code comments.
9455 (Fimagemagick_types): Doc fix.
9456
9457 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
9458
9459 Minor fixes prompted by GCC 4.6.0 warnings.
9460
9461 * xselect.c (converted_selections, conversion_fail_tag): Now static.
9462
9463 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
9464 (x_clipboard_manager_save_all): Move extern decl to ...
9465 * xterm.h: ... here, so that it can be checked for consistency.
9466
9467 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
9468
9469 * xselect.c (x_clipboard_manager_save_frame)
9470 (x_clipboard_manager_save_all): New functions.
9471 (Fx_clipboard_manager_save): Lisp function deleted.
9472
9473 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
9474 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
9475
9476 * xterm.h: Update prototype.
9477
9478 2011-05-28 William Xu <william.xwl@gmail.com>
9479
9480 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
9481 exiting (Bug#8239).
9482
9483 2011-05-28 Jim Meyering <meyering@redhat.com>
9484
9485 Avoid a sign-extension bug in crypto_hash_function.
9486 * fns.c (to_uchar): Define.
9487 (crypto_hash_function): Use it to convert some newly-signed
9488 variables to unsigned, to avoid sign-extension bugs. For example,
9489 without this change, (md5 "truc") would evaluate to
9490 45723a2aff78ff4fff7fff1114760e62 rather than the expected
9491 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
9492 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
9493
9494 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
9495
9496 Integer overflow fixes.
9497
9498 * dbusbind.c: Serial number integer overflow fixes.
9499 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
9500 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
9501 to hold a serial number that is too large for a fixnum.
9502 (Fdbus_method_return_internal, Fdbus_method_error_internal):
9503 Check for serial numbers out of range. Decode any serial number
9504 that was so large that it became a float. (Bug#8722)
9505
9506 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
9507 (Fdbus_call_method, Fdbus_call_method_asynchronously):
9508 Use XFASTINT rather than XUINT when numbers are nonnegative.
9509 (xd_append_arg, Fdbus_method_return_internal):
9510 (Fdbus_method_error_internal): Likewise. Also, for unsigned
9511 arguments, check that Lisp number is nonnegative, rather than
9512 silently wrapping negative numbers around. (Bug#8722)
9513 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
9514 (Bug#8722)
9515
9516 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
9517
9518 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
9519
9520 ccl: Add integer overflow checks.
9521 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
9522 (IN_INT_RANGE): New macros.
9523 (ccl_driver): Use them to check for integer overflow when
9524 decoding a CCL program. Many of the new checks are whether XINT (x)
9525 fits in int; it doesn't always, on 64-bit hosts. The new version
9526 doesn't catch all possible integer overflows, but it's an
9527 improvement. (Bug#8719)
9528
9529 * alloc.c (make_event_array): Use XINT, not XUINT.
9530 There's no need for unsigned here.
9531
9532 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
9533 This follows up to the 2011-05-06 change that substituted uintptr_t
9534 for EMACS_INT. This case wasn't caught back then.
9535
9536 Rework Fformat to avoid integer overflow issues.
9537 * editfns.c: Include <float.h> unconditionally, as it's everywhere
9538 now (part of C89). Include <verify.h>.
9539 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
9540 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
9541 (Fformat): Avoid the prepass trying to compute sizes; it was only
9542 approximate and thus did not catch overflow reliably. Instead, walk
9543 through the format just once, formatting and computing sizes as we go,
9544 checking for integer overflow at every step, and allocating a larger
9545 buffer as needed. Keep track separately whether the format is
9546 multibyte. Keep only the most-recently calculated precision, rather
9547 than them all. Record whether each argument has been converted to
9548 string. Use EMACS_INT, not int, for byte and char and arg counts.
9549 Support field widths and precisions larger than INT_MAX. Avoid
9550 sprintf's undefined behavior with conversion specifications such as %#d
9551 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
9552 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
9553 formatting out-of-range floating point numbers with int
9554 formats. (Bug#8668)
9555
9556 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
9557
9558 * data.c: Avoid integer truncation in expressions involving floats.
9559 * data.c: Include <intprops.h>.
9560 (arith_driver): When there's an integer overflow in an expression
9561 involving floating point, convert the integers to floating point
9562 so that the resulting value does not suffer from catastrophic
9563 integer truncation. For example, on a 64-bit host (* 4
9564 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
9565 Do not rely on undefined behavior after integer overflow.
9566
9567 merge count_size_as_multibyte, parse_str_to_multibyte
9568 * character.c, character.h (count_size_as_multibyte):
9569 Rename from parse_str_to_multibyte; all uses changed.
9570 Check for integer overflow.
9571 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
9572 since it's now a duplicate of the other. This is more of
9573 a character than a buffer op, so better that it's in character.c.
9574 * fns.c, print.c: Adjust to above changes.
9575
9576 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
9577
9578 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
9579
9580 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
9581
9582 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
9583 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
9584 (x_clipboard_manager_save): Now static.
9585 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
9586
9587 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
9588 (crypto_hash_function): Now static.
9589 Fix pointer signedness problems. Avoid unnecessary initializations.
9590
9591 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
9592
9593 * termhooks.h (Vselection_alist): Make it terminal-local.
9594
9595 * terminal.c (create_terminal): Initialize it.
9596
9597 * xselect.c: Support for clipboard managers.
9598 (Vselection_alist): Move to termhooks.h as terminal-local var.
9599 (LOCAL_SELECTION): New macro.
9600 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
9601 (symbol_to_x_atom): Remove gratuitous arg.
9602 (x_handle_selection_request, lisp_data_to_selection_data)
9603 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
9604 (x_own_selection, x_get_local_selection, x_convert_selection):
9605 New arg, specifying work frame. Use terminal-local Vselection_alist.
9606 (some_frame_on_display): Delete unused function.
9607 (Fx_own_selection_internal, Fx_get_selection_internal)
9608 (Fx_disown_selection_internal, Fx_selection_owner_p)
9609 (Fx_selection_exists_p): New optional frame arg.
9610 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
9611 (x_handle_selection_clear): Don't treat other terminals with the
9612 same keyboard specially. Use the terminal-local Vselection_alist.
9613 (x_clear_frame_selections): Use Frun_hook_with_args.
9614
9615 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
9616
9617 * xterm.h: Add support for those atoms.
9618
9619 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
9620
9621 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
9622 (converted_selections, conversion_fail_tag): New global variables.
9623 (x_selection_request_lisp_error): Free the above.
9624 (x_get_local_selection): Remove unnecessary code.
9625 (x_reply_selection_request): Args changed; handle arbitrary array
9626 of converted selections stored in converted_selections.
9627 Separate the XChangeProperty and SelectionNotify steps.
9628 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
9629 (x_convert_selection): New function.
9630 (x_handle_selection_event): Simplify.
9631 (x_get_foreign_selection): Don't ignore incoming requests while
9632 waiting for an answer; this will fail when we implement
9633 SAVE_TARGETS, and seems unnecessary anyway.
9634 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
9635 (Vx_sent_selection_functions): Doc fix.
9636
9637 2011-05-26 Leo Liu <sdl.web@gmail.com>
9638
9639 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
9640
9641 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9642
9643 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
9644
9645 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
9646 for fringe update if it has periodic bitmap.
9647 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
9648 and fringe_bitmap_periodic_p.
9649
9650 * fringe.c (get_fringe_bitmap_data): New function.
9651 (draw_fringe_bitmap_1, update_window_fringes): Use it.
9652 (update_window_fringes): Record periodicity of fringe bitmap in glyph
9653 row. Mark glyph row for fringe update if periodicity changed.
9654
9655 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
9656 for fringe update unless it has periodic bitmap.
9657
9658 2011-05-25 Kenichi Handa <handa@m17n.org>
9659
9660 * xdisp.c (get_next_display_element): Set correct it->face_id for
9661 a static composition.
9662
9663 2011-05-24 Leo Liu <sdl.web@gmail.com>
9664
9665 * deps.mk (fns.o):
9666 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
9667
9668 * fns.c (crypto_hash_function, Fsha1): New function.
9669 (Fmd5): Use crypto_hash_function.
9670 (syms_of_fns): Add Ssha1.
9671
9672 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
9673
9674 * gnutls.c: Remove unused macros.
9675 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
9676 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
9677 Remove macros that are defined and never used.
9678 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
9679
9680 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
9681
9682 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
9683 (Fx_get_selection_internal): Minor cleanup.
9684 (Fx_own_selection_internal): Rename arguments for consistency with
9685 select.el.
9686
9687 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
9688
9689 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
9690
9691 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
9692
9693 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
9694
9695 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9696
9697 * dispnew.c (scrolling_window): Don't exclude the case that the
9698 last enabled row in the desired matrix touches the bottom boundary.
9699
9700 2011-05-21 Glenn Morris <rgm@gnu.org>
9701
9702 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
9703 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
9704 and add some more files.
9705
9706 2011-05-20 Eli Zaretskii <eliz@gnu.org>
9707
9708 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
9709 report_file_error introduced by the change from 2011-05-07.
9710
9711 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
9712
9713 * systime.h (Time): Define only if emacs is defined.
9714 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
9715 where the include path doesn't have X11/X.h by default. See
9716 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
9717
9718 2011-05-20 Kenichi Handa <handa@m17n.org>
9719
9720 * composite.c (find_automatic_composition): Fix previous change.
9721
9722 2011-05-20 Glenn Morris <rgm@gnu.org>
9723
9724 * lisp.mk: New file, split from Makefile.in.
9725 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
9726 (shortlisp): Remove.
9727 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
9728
9729 2011-05-19 Glenn Morris <rgm@gnu.org>
9730
9731 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
9732 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
9733 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
9734 (lisp): Set the order to that of loadup.el.
9735 (shortlisp): Make it a copy of $lisp.
9736 (SOME_MACHINE_LISP): Remove.
9737 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
9738 Use just $shortlisp, not $SOME_MACHINE_LISP too.
9739
9740 2011-05-18 Kenichi Handa <handa@m17n.org>
9741
9742 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
9743 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
9744 (find_automatic_composition): Mostly rewrite for efficiency.
9745
9746 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
9747
9748 * makefile.w32-in: Update dependencies.
9749
9750 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
9751
9752 * menu.c: Include limits.h (fixes the MS-Windows build broken by
9753 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
9754
9755 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
9756
9757 Fix some integer overflow issues, such as string length overflow.
9758
9759 * insdel.c (count_size_as_multibyte): Check for string overflow.
9760
9761 * character.c (lisp_string_width): Check for string overflow.
9762 Use EMACS_INT, not int, for string indexes and lengths; in
9763 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
9764 the resulting string length overflows an EMACS_INT; instead,
9765 report a string overflow if no precision given. When checking for
9766 precision exhaustion, use a check that cannot possibly have
9767 integer overflow. (Bug#8675)
9768 * character.h (lisp_string_width): Adjust to new signature.
9769
9770 * alloc.c (string_overflow): New function.
9771 (Fmake_string): Use it. This doesn't change behavior, but saves
9772 a few bytes and will simplify future changes.
9773 * character.c (string_escape_byte8): Likewise.
9774 * lisp.h (string_overflow): New decl.
9775
9776 Fixups, following up to the user-interface timestamp change.
9777 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
9778 for UI timestamps, instead of unsigned long.
9779 * msdos.c (mouse_get_pos): Likewise.
9780 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
9781 * w32gui.h (Time): Define by including "systime.h" rather than by
9782 declaring it ourselves. (Bug#8664)
9783
9784 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
9785 * image.c (clear_image_cache): Likewise.
9786
9787 * term.c (term_mouse_position): Don't assume time_t wraparound.
9788
9789 Be more systematic about user-interface timestamps.
9790 Before, the code sometimes used 'Time', sometimes 'unsigned long',
9791 and sometimes 'EMACS_UINT', to represent these timestamps.
9792 This change causes it to use 'Time' uniformly, as that's what X uses.
9793 This makes the code easier to follow, and makes it easier to catch
9794 integer overflow bugs such as Bug#8664.
9795 * frame.c (Fmouse_position, Fmouse_pixel_position):
9796 Use Time, not unsigned long, for user-interface timestamps.
9797 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
9798 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
9799 * keyboard.h (last_event_timestamp): Likewise.
9800 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
9801 * menu.h (xmenu_show): Likewise.
9802 * term.c (term_mouse_position): Likewise.
9803 * termhooks.h (struct input_event.timestamp): Likewise.
9804 (struct terminal.mouse_position_hook): Likewise.
9805 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
9806 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
9807 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
9808 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
9809 what it was before.
9810 * menu.h, termhooks.h: Include "systime.h", for Time.
9811
9812 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
9813 Don't assume that the difference between two unsigned long values
9814 can fit into an integer. At this point, we know button_down_time
9815 <= event->timestamp, so the difference must be nonnegative, so
9816 there's no need to cast the result if double-click-time is
9817 nonnegative, as it should be; check that it's nonnegative, just in
9818 case. This bug is triggered when events are more than 2**31 ms
9819 apart (about 25 days). (Bug#8664)
9820
9821 * xselect.c (last_event_timestamp): Remove duplicate decl.
9822 (x_own_selection): Remove needless cast to unsigned long.
9823
9824 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
9825 that always fit in int. Use a sentinel instead of a counter, to
9826 avoid a temp and to allay GCC's concerns about possible int overflow.
9827 * frame.h (struct frame): Use int for menu_bar_items_used
9828 instead of EMACS_INT, since it always fits in int.
9829
9830 * menu.c (grow_menu_items): Check for int overflow.
9831
9832 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
9833
9834 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
9835 Before, the code was not consistent. These values cannot exceed
9836 2**31 - 1 so there's no need to make them unsigned.
9837 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
9838 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
9839 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
9840 as modifiers.
9841 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
9842
9843 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
9844 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
9845 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
9846 presumably because the widths might not match.
9847
9848 * window.c (size_window): Avoid needless test at loop start.
9849
9850 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
9851
9852 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
9853
9854 2011-05-12 Drew Adams <drew.adams@oracle.com>
9855
9856 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
9857
9858 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9859
9860 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
9861 `width' to `bar_area_x' and `bar_area_width', respectively.
9862 (x_scroll_run): Take account of fringe background extension.
9863
9864 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
9865 Rename local vars `left' and `width' to `bar_area_x' and
9866 `bar_area_width', respectively.
9867 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
9868 background extension.
9869
9870 2011-05-10 Jim Meyering <meyering@redhat.com>
9871
9872 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
9873
9874 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
9875
9876 * image.c (Finit_image_library): Return t for built-in image types,
9877 like pbm and xbm. (Bug#8640)
9878
9879 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
9880
9881 * w32menu.c (set_frame_menubar): Fix submenu allocation.
9882
9883 2011-05-07 Eli Zaretskii <eliz@gnu.org>
9884
9885 * w32console.c (Fset_screen_color): Doc fix.
9886 (Fget_screen_color): New function.
9887 (syms_of_ntterm): Defsubr it.
9888
9889 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
9890 unlink the temporary file if Fcall_process didn't create it in the
9891 first place.
9892 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
9893 child process will be redirected to a file specified with `:file'.
9894 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
9895 cue to call_process_cleanup not to close that handle.
9896
9897 2011-05-07 Ben Key <bkey76@gmail.com>
9898
9899 * makefile.w32-in: The bootstrap-temacs rule now makes use of
9900 one of two shell specific rules, either bootstrap-temacs-CMD or
9901 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
9902 to the previous implementation of the bootstrap-temacs rule.
9903 The bootstrap-temacs-CMD rule is similar to the previous
9904 implementation of the bootstrap-temacs rule except that it
9905 makes use of the ESC_CFLAGS variable instead of the CFLAGS
9906 variable.
9907
9908 These changes, along with some changes to nt/configure.bat,
9909 nt/gmake.defs, and nt/nmake.defs, are required to extend my
9910 earlier fix to add support for --cflags and --ldflags options
9911 that include quotes so that it works whether make uses cmd or
9912 sh as the shell.
9913
9914 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
9915
9916 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
9917 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
9918 is a constant.
9919 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
9920 a string. Handle both cases.
9921 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
9922 (Fdbus_register_method): Use Qinvalid_function.
9923
9924 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
9925
9926 * makefile.w32-in: Update dependencies.
9927 (LISP_H): Add inttypes.h and stdin.h.
9928 (PROCESS_H): Add unistd.h.
9929
9930 2011-05-06 Eli Zaretskii <eliz@gnu.org>
9931
9932 * lread.c: Include limits.h (fixes the MS-Windows build broken by
9933 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
9934
9935 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
9936
9937 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
9938
9939 * term.c (vfatal): Remove stray call to va_end.
9940 It's not needed and the C Standard doesn't allow it here anyway.
9941
9942 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
9943 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
9944
9945 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
9946 bytes.
9947
9948 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
9949
9950 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
9951
9952 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
9953
9954 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
9955
9956 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
9957
9958 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
9959 * charset.c (Fdefine_charset_internal): Don't initialize
9960 charset.code_space[15]. The value was garbage, on hosts with
9961 32-bit int (Bug#8600).
9962
9963 * lread.c (read_integer): Be more consistent with string-to-number.
9964 Use string_to_number to do the actual conversion; this avoids
9965 rounding errors and fixes some other screwups. Without this fix,
9966 for example, #x1fffffffffffffff was misread as -2305843009213693952.
9967 (digit_to_number): Move earlier, for benefit of read_integer.
9968 Return -1 if the digit is out of range for the base, -2 if it is
9969 not a digit in any supported base. (Bug#8602)
9970
9971 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
9972
9973 * dispnew.c (scrolling_window): Return 1 if we scrolled,
9974 to match comment at start of function. This also removes a
9975 GCC warning about overflow in a 32+64-bit port.
9976
9977 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
9978
9979 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
9980 Reported by Stefan Monnier in
9981 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
9982 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
9983 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
9984
9985 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
9986 (EMACS_UINTPTR): Likewise, with uintptr_t.
9987
9988 * lisp.h: Prefer 64-bit EMACS_INT if available.
9989 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
9990 on 32-bit hosts that have 64-bit int, so that they can access
9991 large files.
9992 However, temporarily disable this change unless the temporary
9993 symbol WIDE_EMACS_INT is defined.
9994
9995 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
9996
9997 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
9998 This removes an assumption that EMACS_INT and long are the same
9999 width as pointers. The assumption is true for Emacs porting targets
10000 now, but we want to make other targets possible.
10001 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
10002 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
10003 In the rest of the code, change types of integers that hold casted
10004 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
10005 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
10006 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
10007 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
10008 No need to cast type when ORing.
10009 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
10010 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
10011 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
10012 assume EMACS_INT is the same width as char *.
10013 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
10014 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
10015 Remove no-longer-needed casts.
10016 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
10017 (xg_tool_bar_help_callback, xg_make_tool_item):
10018 Use EMACS_INTPTR to hold an integer
10019 that will be cast to void *; this can avoid a GCC warning
10020 if EMACS_INT is not the same width as void *.
10021 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
10022 * xdisp.c (display_echo_area_1, resize_mini_window_1):
10023 (current_message_1, set_message_1):
10024 Use a local to convert to proper width without a cast.
10025 * xmenu.c (dialog_selection_callback): Likewise.
10026
10027 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
10028 Also, don't assume VALBITS / RAND_BITS is less than 5,
10029 and don't rely on undefined behavior when shifting a 1 left into
10030 the sign bit.
10031 * lisp.h (get_random): Change signature to match.
10032
10033 * lread.c (hash_string): Use size_t, not int, for hash computation.
10034 Normally we prefer signed values; but hashing is special, because
10035 it's better to use unsigned division on hash table sizes so that
10036 the remainder is nonnegative. Also, size_t is the natural width
10037 for hashing into memory. The previous code used 'int', which doesn't
10038 retain enough info to hash well into very large tables.
10039 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
10040
10041 * dbusbind.c: Don't possibly lose pointer info when converting.
10042 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
10043 Use XPNTR rather than XHASH, so that the high-order bits of
10044 the pointer aren't lost when converting through void *.
10045
10046 * eval.c (Fautoload): Don't double-shift a pointer.
10047
10048 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
10049
10050 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
10051
10052 * gnutls.c (DEF_GNUTLS_FN):
10053 * image.c (DEF_IMGLIB_FN): Make function pointers static.
10054
10055 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
10056
10057 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
10058 marker. (Bug#8610)
10059
10060 2011-05-05 Eli Zaretskii <eliz@gnu.org>
10061
10062 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
10063 New version that can reserve upto 2GB of heap space.
10064
10065 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
10066
10067 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
10068
10069 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
10070
10071 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
10072 `gnutls_certificate_set_x509_key_file'.
10073
10074 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
10075
10076 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
10077 Update dependencies.
10078
10079 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
10080
10081 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
10082 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
10083 Remove unused parameter `fildes'.
10084 * process.c (read_process_output, send_process): Don't pass it.
10085
10086 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
10087
10088 Fix previous change: the library cache is defined in w32.c.
10089 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
10090 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
10091
10092 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
10093
10094 Implement dynamic loading of GnuTLS on Windows.
10095
10096 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
10097 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
10098 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
10099 Declare.
10100
10101 * gnutls.c (Qgnutls_dll): Define.
10102 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
10103 (gnutls_*): Declare function pointers.
10104 (init_gnutls_functions): New function to initialize function pointers.
10105 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
10106 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
10107 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
10108 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
10109 (emacs_gnutls_write, emacs_gnutls_read)
10110 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
10111 (Fgnutls_available_p): New function.
10112 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
10113 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
10114 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
10115
10116 * image.c: Include w32.h.
10117 (Vimage_type_cache): Delete.
10118 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
10119 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
10120 (w32_delayed_load): Move to w32.c.
10121
10122 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
10123
10124 * w32.c (QCloaded_from, Vlibrary_cache): Define.
10125 (w32_delayed_load): Move from image.c. When loading a library, record
10126 its filename in the :loaded-from property of the library id.
10127 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
10128 Initialize and staticpro them.
10129 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
10130
10131 * process.c: Include lisp.h before w32.h, not after.
10132 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
10133 instead of gnutls_record_check_pending.
10134
10135 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
10136
10137 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
10138
10139 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
10140 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
10141 as passed in.
10142
10143 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
10144
10145 * xterm.c (x_set_frame_alpha): Do not set property on anything
10146 else than FRAME_X_OUTER_WINDOW (Bug#8608).
10147
10148 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
10149
10150 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
10151
10152 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
10153
10154 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
10155 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
10156 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
10157 (gnutls_global_initialized, Qgnutls_bootprop_priority)
10158 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
10159 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
10160 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
10161 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
10162 (Qgnutls_bootprop_callbacks_verify): Make static.
10163
10164 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
10165
10166 * callproc.c: Indentation fixup.
10167
10168 * sysdep.c (wait_for_termination_1): Make static.
10169 (wait_for_termination, interruptible_wait_for_termination):
10170 Move after wait_for_termination_1.
10171
10172 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
10173
10174 * sysdep.c (interruptible_wait_for_termination): New function
10175 which is like wait_for_termination, but allows keyboard
10176 interruptions.
10177
10178 * callproc.c (Fcall_process): Add (:file "file") as an option for
10179 the STDOUT buffer.
10180 (Fcall_process_region): Ditto.
10181
10182 2011-04-30 Eli Zaretskii <eliz@gnu.org>
10183
10184 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
10185 rather than `XVECTOR (FOO)->size'.
10186
10187 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
10188 inttypes.h, as a gnulib replacement is used if it not available in
10189 system headers.
10190
10191 2011-04-21 Eli Zaretskii <eliz@gnu.org>
10192
10193 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
10194 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
10195 of MOST_POSITIVE_FIXNUM. (Bug#8528)
10196
10197 * coding.c (coding_alloc_by_realloc): Error out if destination
10198 will grow beyond MOST_POSITIVE_FIXNUM.
10199 (decode_coding_emacs_mule): Abort if there isn't enough place in
10200 charbuf for the composition carryover bytes. Reserve an extra
10201 space for up to 2 characters produced in a loop.
10202 (decode_coding_iso_2022): Abort if there isn't enough place in
10203 charbuf for the composition carryover bytes.
10204
10205 2011-04-21 Eli Zaretskii <eliz@gnu.org>
10206
10207 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
10208 aborting when %lld or %lll format is passed.
10209 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
10210 %llo or %llx format is passed. (Bug#8545)
10211
10212 * window.c (window_scroll_line_based): Use a marker instead of
10213 simple variables to record original value of point. (Bug#7952)
10214
10215 * doprnt.c (doprnt): Fix the case where a multibyte sequence
10216 produced by %s or %c overflows available buffer space. (Bug#8545)
10217
10218 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
10219
10220 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
10221 (SIZE_MAX): Move defn after all includes, as they might #define it.
10222
10223 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
10224
10225 * w32.c (init_environment): Warn about defaulting HOME to C:\.
10226
10227 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
10228
10229 * keyboard.c (Qdelayed_warnings_hook): Define.
10230 (command_loop_1): Run `delayed-warnings-hook'
10231 if Vdelayed_warnings_list is non-nil.
10232 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
10233 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
10234
10235 2011-04-28 Eli Zaretskii <eliz@gnu.org>
10236
10237 * doprnt.c (doprnt): Don't return value smaller than the buffer
10238 size if the message was truncated. (Bug#8545).
10239
10240 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
10241
10242 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
10243 (Fx_window_property): #if-0 the whole functions, not just the bodies.
10244
10245 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
10246
10247 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
10248
10249 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
10250
10251 * makefile.w32-in: Update dependencies.
10252
10253 2011-04-27 Eli Zaretskii <eliz@gnu.org>
10254
10255 Improve `doprnt' and its usage. (Bug#8545)
10256 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
10257 `format_end'. Remove support for %l as a conversion specifier.
10258 Don't use xrealloc. Improve diagnostics when the %l size modifier
10259 is used. Update the commentary.
10260
10261 * eval.c (verror): Simplify calculation of size_t.
10262
10263 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
10264 messages.
10265
10266 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
10267
10268 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
10269 change.
10270
10271 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
10272
10273 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
10274 This makes this file independent of the recent pseudovector change.
10275
10276 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
10277
10278 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
10279
10280 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
10281 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
10282 Remove unused local.
10283 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
10284
10285 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
10286 GCC 4.6.0 optimizes based on type-based alias analysis.
10287 For example, if b is of type struct buffer * and v of type struct
10288 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
10289 != &v->size, and therefore "v->size = 1; b->size = 2; return
10290 v->size;" must therefore return 1. This assumption is incorrect
10291 for Emacs, since it type-puns struct Lisp_Vector * with many other
10292 types. To fix this problem, this patch adds a new type struct
10293 vectorlike_header that documents the constraints on layout of vectors
10294 and pseudovectors, and helps optimizing compilers not get fooled
10295 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
10296 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
10297 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
10298 the size member.
10299 (XSETPVECTYPE): Rewrite in terms of new macro.
10300 (XSETPVECTYPESIZE): New macro, specifying both type and size.
10301 This is a bit clearer, and further avoids the possibility of
10302 undesirable aliasing.
10303 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
10304 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
10305 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
10306 since Lisp_Subr is a special case (no "next" field).
10307 (ASIZE): Now uses header.size rather than size.
10308 All previous uses of XVECTOR (foo)->size replaced to use this macro,
10309 to avoid the hassle of writing XVECTOR (foo)->header.size.
10310 (struct vectorlike_header): New type.
10311 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
10312 object, to help avoid aliasing.
10313 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
10314 (SUBRP): Likewise, since Lisp_Subr is a special case.
10315 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
10316 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
10317 (struct Lisp_Hash_Table): Combine first two members into a single
10318 struct vectorlike_header member. All uses of "size" and "next" members
10319 changed to be "header.size" and "header.next".
10320 * buffer.h (struct buffer): Likewise.
10321 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
10322 * frame.h (struct frame): Likewise.
10323 * process.h (struct Lisp_Process): Likewise.
10324 * termhooks.h (struct terminal): Likewise.
10325 * window.c (struct save_window_data, struct saved_window): Likewise.
10326 * window.h (struct window): Likewise.
10327 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
10328 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
10329 * buffer.c (init_buffer_once): Likewise.
10330 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
10331 special case.
10332 * process.c (Fformat_network_address): Use local var for size,
10333 for brevity.
10334
10335 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
10336
10337 Make the Lisp reader and string-to-float more consistent (Bug#8525)
10338 * data.c (atof): Remove decl; no longer used or needed.
10339 (digit_to_number): Move to lread.c.
10340 (Fstring_to_number): Use new string_to_number function, to be
10341 consistent with how the Lisp reader treats infinities and NaNs.
10342 Do not assume that floating-point numbers represent EMACS_INT
10343 without losing information; this is not true on most 64-bit hosts.
10344 Avoid double-rounding errors, by insisting on integers when
10345 parsing non-base-10 numbers, as the documentation specifies.
10346 * lisp.h (string_to_number): New decl, replacing ...
10347 (isfloat_string): Remove.
10348 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
10349 (read1): Do not accept +. and -. as integers; this
10350 appears to have been a coding error. Similarly, do not accept
10351 strings like +-1e0 as floating point numbers. Do not report
10352 overflow for integer overflows unless the base is not 10 which
10353 means we have no simple and reliable way to continue.
10354 Break out the floating-point parsing into a new
10355 function string_to_number, so that Fstring_to_number parses
10356 floating point numbers consistently with the Lisp reader.
10357 (digit_to_number): Move here from data.c. Make it static inline.
10358 (E_CHAR, EXP_INT): Remove, replacing with ...
10359 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
10360 (string_to_number): New function, replacing isfloat_string.
10361 This function checks for valid syntax and produces the resulting
10362 Lisp float number too. Rework it so that string-to-number
10363 no longer mishandles examples like "1.0e+". Use strtoumax,
10364 so that overflow for non-base-10 numbers is reported only when
10365 there's no portable and simple way to convert to floating point.
10366
10367 * textprop.c (set_text_properties_1): Rewrite for clarity,
10368 and to avoid GCC warning about integer overflow.
10369
10370 * intervals.h (struct interval): Use EMACS_INT for members
10371 where EMACS_UINT might cause problems. See
10372 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
10373 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
10374 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
10375 All uses changed.
10376 (offset_intervals): Tell GCC not to worry about length overflow
10377 when negating a negative length.
10378
10379 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
10380 (overrun_check_free): Likewise.
10381
10382 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
10383 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
10384 word size.
10385
10386 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
10387 (gnutls_make_error): Rename local to avoid shadowing.
10388 (gnutls_emacs_global_deinit): ifdef out; not used.
10389 (Fgnutls_boot): Use const for pointer to readonly storage.
10390 Comment out unused local. Fix pointer signedness problems.
10391
10392 * lread.c (openp): Don't stuff size_t into an 'int'.
10393 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
10394 about possible signed overflow.
10395
10396 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
10397 (GDK_KEY_g): Don't define if already defined.
10398 (xg_prepare_tooltip): Avoid pointer signedness problem.
10399 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
10400
10401 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
10402 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
10403
10404 * xfns.c (Fx_window_property): Simplify a bit,
10405 to make a bit faster and to avoid GCC 4.6.0 warning.
10406 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
10407
10408 * fns.c (internal_equal): Don't assume size_t fits in int.
10409
10410 * alloc.c (compact_small_strings): Tighten assertion a little.
10411
10412 Replace pEd with more-general pI, and fix some printf arg casts.
10413 * lisp.h (pI): New macro, generalizing old pEd macro to other
10414 conversion specifiers. For example, use "...%"pI"d..." rather
10415 than "...%"pEd"...".
10416 (pEd): Remove. All uses replaced with similar uses of pI.
10417 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
10418 * alloc.c (check_pure_size): Don't overflow by converting size to int.
10419 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
10420 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
10421 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
10422 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
10423 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
10424 64-bit hosts.
10425 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
10426 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
10427 * print.c (safe_debug_print, print_object): Likewise.
10428 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
10429 to int.
10430 Use pI instead of if-then-else-abort. Use %p to avoid casts,
10431 avoiding the 0 flag, which is not portable.
10432 * process.c (Fmake_network_process): Use pI to avoid cast.
10433 * region-cache.c (pp_cache): Likewise.
10434 * xdisp.c (decode_mode_spec): Likewise.
10435 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
10436 behavior on 64-bit hosts with printf arg.
10437 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
10438 (x_stop_queuing_selection_requests): Likewise.
10439 (x_get_window_property): Don't truncate byte count to an 'int'
10440 when tracing.
10441
10442 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
10443 here, since it parses constructs like leading '-' and spaces,
10444 which are not wanted; and it overflows with large numbers.
10445 Instead, simply match F[0-9]+, which is what is wanted anyway.
10446
10447 * alloc.c: Remove unportable assumptions about struct layout.
10448 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
10449 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
10450 (allocate_vectorlike, make_pure_vector): Use the new macros,
10451 plus offsetof, to remove unportable assumptions about struct layout.
10452 These assumptions hold on all porting targets that I know of, but
10453 they are not guaranteed, they're easy to remove, and removing them
10454 makes further changes easier.
10455
10456 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
10457 This doesn't fix a bug but makes the code clearer.
10458 (string_overrun_cookie): Now const. Use initializers that
10459 don't formally overflow signed char, to avoid warnings.
10460 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
10461 can cause Emacs to crash when string overrun checking is enabled.
10462 (allocate_buffer): Don't assume sizeof (struct buffer) is a
10463 multiple of sizeof (EMACS_INT); it need not be, if
10464 alignof(EMACS_INT) < sizeof (EMACS_INT).
10465 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
10466
10467 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
10468
10469 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
10470
10471 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
10472
10473 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
10474 supposed to be handshaking. (Bug#8556)
10475 Reported by Paul Eggert <eggert@cs.ucla.edu>.
10476
10477 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
10478
10479 * lisp.h (Qdebug): List symbol.
10480 * eval.c (Qdebug): Restore global linkage.
10481 * keyboard.c (debug-on-event): New variable.
10482 (handle_user_signal): Break into debugger when debug-on-event
10483 matches the current signal symbol.
10484
10485 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
10486
10487 * alloc.c (check_sblock, check_string_bytes)
10488 (check_string_free_list): Convert to standard C.
10489
10490 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
10491
10492 * w32.c (emacs_gnutls_push): Fix typo.
10493
10494 2011-04-25 Eli Zaretskii <eliz@gnu.org>
10495
10496 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
10497 "cast to pointer from integer of different size".
10498
10499 Improve doprnt and its use in verror. (Bug#8545)
10500 * doprnt.c (doprnt): Document the set of format control sequences
10501 supported by the function. Use SAFE_ALLOCA instead of always
10502 using `alloca'.
10503
10504 * eval.c (verror): Don't limit the buffer size at size_max-1, that
10505 is one byte too soon. Don't use xrealloc; instead xfree and
10506 xmalloc anew.
10507
10508 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
10509
10510 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
10511 callbacks stage.
10512
10513 * gnutls.c: Renamed global_initialized to
10514 gnutls_global_initialized. Added internals for the
10515 :verify-hostname-error, :verify-error, and :verify-flags
10516 parameters of `gnutls-boot' and documented those parameters in the
10517 docstring. Start callback support.
10518 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
10519 unless a fatal error occurred. Call gnutls_alert_send_appropriate
10520 on error. Return error code.
10521 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
10522 (emacs_gnutls_read): Likewise.
10523 (Fgnutls_boot): Return handshake error code.
10524 (emacs_gnutls_handle_error): New function.
10525 (wsaerror_to_errno): Likewise.
10526
10527 * w32.h (emacs_gnutls_pull): Add prototype.
10528 (emacs_gnutls_push): Likewise.
10529
10530 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
10531 (emacs_gnutls_push): Likewise.
10532
10533 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
10534
10535 * process.c (wait_reading_process_output): Check if GnuTLS
10536 buffered some data internally if no FDs are set for TLS
10537 connections.
10538
10539 * makefile.w32-in (OBJ2): Add gnutls.$(O).
10540 (LIBS): Link to USER_LIBS.
10541 ($(BLD)/gnutls.$(0)): New target.
10542
10543 2011-04-24 Eli Zaretskii <eliz@gnu.org>
10544
10545 * xdisp.c (handle_single_display_spec): Rename the
10546 display_replaced_before_p argument into display_replaced_p, to
10547 make it consistent with the commentary. Fix typos in the
10548 commentary.
10549
10550 * textprop.c (syms_of_textprop): Remove dead code.
10551 (copy_text_properties): Delete obsolete commentary about an
10552 interface that was deleted long ago. Fix typos in the description
10553 of arguments.
10554
10555 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
10556 to changes in oldXMenu/XMenu.h from 2011-04-16.
10557 <menu_help_message, prev_menu_help_message>: Constify.
10558 (IT_menu_make_room): menu->help_text is now `const char **';
10559 adjust.
10560
10561 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
10562 to changes in oldXMenu/XMenu.h from 2011-04-16.
10563 (struct XMenu): Declare `help_text' `const char **'.
10564
10565 * xfaces.c <Qunspecified>: Make extern again.
10566
10567 * syntax.c: Include sys/types.h before including regex.h, as
10568 required by POSIX.
10569
10570 * doc.c (get_doc_string): Improve the format passed to `error'.
10571
10572 * doprnt.c (doprnt): Improve commentary.
10573
10574 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
10575
10576 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
10577 them with etags.
10578
10579 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
10580 changes in globals.h immediately force recompilation.
10581 (TAGS): Depend on $(CURDIR)/m/intel386.h and
10582 $(CURDIR)/s/ms-w32.h.
10583 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
10584
10585 * character.c (Fchar_direction): Function deleted.
10586 (syms_of_character): Don't defsubr it.
10587 <char-direction-table>: Deleted.
10588
10589 2011-04-23 Eli Zaretskii <eliz@gnu.org>
10590
10591 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
10592 * doprnt.c: Include limits.h.
10593 (SIZE_MAX): New macro.
10594 (doprnt): Return a size_t value. 2nd arg is now size_t.
10595 Many local variables are now size_t instead of int or unsigned.
10596 Improve overflow protection. Support `l' modifier for integer
10597 conversions. Support %l conversion. Don't assume an EMACS_INT
10598 argument for integer conversions and for %c.
10599
10600 * lisp.h (doprnt): Restore prototype.
10601
10602 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
10603 $(SRC)/character.h.
10604
10605 * Makefile.in (base_obj): Add back doprnt.o.
10606
10607 * deps.mk (doprnt.o): Add back prerequisites.
10608 (callint.o): Depend on character.h.
10609
10610 * eval.c (internal_lisp_condition_case): Include the handler
10611 representation in the error message.
10612 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
10613 when breaking from the loop.
10614
10615 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
10616
10617 * callint.c (Fcall_interactively): When displaying error message
10618 about invalid control letter, pass the character's codepoint, not
10619 a pointer to its multibyte form. Improve display of the character
10620 in octal and display also its hex code.
10621
10622 * character.c (char_string): Use %x to display the (unsigned)
10623 codepoint of an invalid character, to avoid displaying a bogus
10624 negative value.
10625
10626 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
10627 `error', not SYMBOL_NAME itself.
10628
10629 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
10630 character arguments to `error'.
10631
10632 * charset.c (check_iso_charset_parameter): Fix incorrect argument
10633 to `error' in error message about FINAL_CHAR argument. Make sure
10634 FINAL_CHAR is a character, and use %c when it is passed as
10635 argument to `error'.
10636
10637 2011-04-23 Eli Zaretskii <eliz@gnu.org>
10638
10639 * s/ms-w32.h (localtime): Redirect to sys_localtime.
10640
10641 * w32.c: Include <time.h>.
10642 (sys_localtime): New function.
10643
10644 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
10645
10646 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
10647
10648 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
10649
10650 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
10651
10652 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
10653 zombies (Bug#8467).
10654
10655 2011-04-19 Eli Zaretskii <eliz@gnu.org>
10656
10657 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
10658 gl_state.e_property when gl_state.object is Qt.
10659
10660 * insdel.c (make_gap_larger): Remove limitation of buffer size
10661 to <= INT_MAX.
10662
10663 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
10664
10665 * xdisp.c (lookup_glyphless_char_display)
10666 (produce_glyphless_glyph): Handle cons cell entry in
10667 glyphless-char-display.
10668 (Vglyphless_char_display): Document it.
10669
10670 * term.c (produce_glyphless_glyph): Handle cons cell entry in
10671 glyphless-char-display.
10672
10673 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
10674
10675 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
10676
10677 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
10678
10679 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
10680 definition for no-X builds.
10681
10682 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
10683
10684 Static checks with GCC 4.6.0 and non-default toolkits.
10685
10686 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
10687
10688 * process.c (keyboard_bit_set): Define only if SIGIO.
10689 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
10690 (send_process): Repair possible setjmp clobbering.
10691
10692 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
10693
10694 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
10695
10696 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
10697
10698 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
10699 Define only if needed.
10700
10701 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
10702 by pacifying GCC about it. Maybe it's time to retire it?
10703 * xfaces.c (USG, __TIMEVAL__): Likewise.
10704
10705 * dispextern.h (struct redisplay_interface): Rename param
10706 to avoid shadowing.
10707 * termhooks.h (struct terminal): Likewise.
10708 * xterm.c (xembed_send_message): Likewise.
10709
10710 * insdel.c (make_gap_smaller): Define only if
10711 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
10712
10713 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
10714 it.
10715
10716 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
10717 so that we aren't warned about unused symbols.
10718
10719 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
10720
10721 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
10722
10723 * xfns.c (x_real_positions): Mark locals as initialized.
10724
10725 * xmenu.c (xmenu_show): Don't use uninitialized vars.
10726
10727 * xterm.c: Fix problems found by static analysis with other toolkits.
10728 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
10729 (x_dispatch_event): Declare static if USE_GTK, and
10730 define if USE_GTK || USE_X_TOOLKIT.
10731 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
10732 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
10733 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
10734 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
10735
10736 * xmenu.c (menu_help_callback): Pointer type fixes.
10737 Use const pointers when pointing at readonly data. Avoid pointer
10738 signedness clashes.
10739 (FALSE): Remove unused macro.
10740 (update_frame_menubar): Remove unused decl.
10741
10742 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
10743
10744 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
10745 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
10746 (single_menu_item): Rename local to avoid shadowing.
10747
10748 * keyboard.c (make_lispy_event): Remove unused local var.
10749
10750 * frame.c, frame.h (x_get_resource_string): Bring this back, but
10751 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
10752
10753 * bitmaps: Change bitmaps from unsigned char back to the X11
10754 compatible char. Avoid the old compiler warnings about
10755 out-of-range initializers by using, for example, '\xab' rather
10756 than 0xab.
10757
10758 * xgselect.c (xgselect_initialize): Check vs interface
10759 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
10760
10761 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
10762
10763 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
10764 to read-only memory.
10765
10766 * fns.c (vector): Remove; this old hack is no longer needed.
10767
10768 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
10769 Remove unused var.
10770 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
10771
10772 * xrdb.c (x_load_resources): Omit unused local.
10773
10774 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
10775 (x_window): Rename locals to avoid shadowing.
10776 (USG): Use the kludged USG macro, to pacify gcc.
10777
10778 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
10779 (x_term_init): Remove local to avoid shadowing.
10780
10781 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
10782
10783 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
10784 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
10785
10786 2011-04-16 Eli Zaretskii <eliz@gnu.org>
10787
10788 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
10789
10790 Fix regex.c, syntax.c and friends for buffers > 2GB.
10791 * syntax.h (struct gl_state_s): Declare character position members
10792 EMACS_INT.
10793
10794 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
10795
10796 * textprop.c (verify_interval_modification, interval_of):
10797 Declare arguments EMACS_INT.
10798
10799 * intervals.c (adjust_intervals_for_insertion): Declare arguments
10800 EMACS_INT.
10801
10802 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
10803
10804 * indent.c (Fvertical_motion): Local variable it_start is now
10805 EMACS_INT.
10806
10807 * regex.c (re_match, re_match_2, re_match_2_internal)
10808 (bcmp_translate, regcomp, regexec, print_double_string)
10809 (group_in_compile_stack, re_search, re_search_2, regex_compile)
10810 (re_compile_pattern, re_exec): Declare arguments and local
10811 variables `size_t' and `ssize_t' and return values `regoff_t', as
10812 appropriate.
10813 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
10814 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
10815 <compile_stack_type>: `size' and `avail' are now `size_t'.
10816
10817 * regex.h <regoff_t>: Use ssize_t, not int.
10818 (re_search, re_search_2, re_match, re_match_2): Arguments that
10819 specify buffer/string position and length are now ssize_t and
10820 size_t. Return type is regoff_t.
10821
10822 2011-04-16 Ben Key <bkey76@gmail.com>
10823
10824 * nsfont.m: Fixed bugs in ns_get_family and
10825 ns_descriptor_to_entity that were caused by using free to
10826 deallocate memory blocks that were allocated by xmalloc (via
10827 xstrdup). This caused Emacs to crash when compiled with
10828 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
10829 --enable-checking=xmallocoverrun). xfree is now used to
10830 deallocate these memory blocks.
10831
10832 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
10833
10834 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
10835
10836 emacs_write: Accept and return EMACS_INT for sizes.
10837 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
10838 et seq.
10839 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
10840 Accept and return EMACS_INT.
10841 (emacs_gnutls_write): Return the number of bytes written on
10842 partial writes.
10843 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
10844 (emacs_read, emacs_write): Remove check for negative size, as the
10845 Emacs source code has been audited now.
10846 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
10847 (emacs_read, emacs_write): Use it.
10848 * process.c (send_process): Adjust to the new signatures of
10849 emacs_write and emacs_gnutls_write. Do not attempt to store
10850 a byte offset into an 'int'; it might overflow.
10851 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
10852
10853 * sound.c: Don't assume sizes fit in 'int'.
10854 (struct sound_device.period_size, alsa_period_size):
10855 Return EMACS_INT, not int.
10856 (struct sound_device.write, vox_write, alsa_write):
10857 Accept EMACS_INT, not int.
10858 (wav_play, au_play): Use EMACS_INT to store sizes and to
10859 record read return values.
10860
10861 2011-04-15 Ben Key <bkey76@gmail.com>
10862
10863 * keyboard.c (Qundefined): Don't declare static since it is used
10864 in nsfns.m.
10865 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
10866 static since they are used in nsfont.m.
10867
10868 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
10869
10870 * process.c (Qprocessp): Don't declare static.
10871 * lisp.h (Qprocessp): Declare again.
10872
10873 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
10874
10875 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
10876
10877 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
10878
10879 Improve C-level modularity by making more things 'static'.
10880
10881 Don't publish debugger-only interfaces to other modules.
10882 * lisp.h (safe_debug_print, debug_output_compilation_hack):
10883 (verify_bytepos, count_markers): Move decls to the only modules
10884 that need them.
10885 * region-cache.h (pp_cache): Likewise.
10886 * window.h (check_all_windows): Likewise.
10887 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
10888
10889 * sysdep.c (croak): Now static, if
10890 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
10891 * syssignal.h (croak): Declare only if not static.
10892
10893 * alloc.c (refill_memory_reserve): Now static if
10894 !defined REL_ALLOC || defined SYSTEM_MALLOC.
10895 * lisp.h (refill_memory_reserve): Declare only if not static.
10896
10897 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
10898 Define only if USE_LUCID.
10899
10900 * xrdb.c (x_customization_string, x_rm_string): Now static.
10901
10902 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
10903 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
10904
10905 * xdisp.c (draw_row_with_mouse_face): Now static.
10906 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
10907
10908 * window.h (check_all_windows): Mark externally visible.
10909
10910 * window.c (window_deletion_count): Now static.
10911
10912 * undo.c: Make symbols static if they're not exported.
10913 (last_undo_buffer, last_boundary_position, pending_boundary):
10914 Now static.
10915
10916 * textprop.c (interval_insert_behind_hooks): Now static.
10917 (interval_insert_in_front_hooks): Likewise.
10918
10919 * term.c: Make symbols static if they're not exported.
10920 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
10921 (max_frame_lines, tty_set_terminal_modes):
10922 (tty_reset_terminal_modes, tty_turn_off_highlight):
10923 (get_tty_terminal): Now static.
10924 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
10925 * termhooks.h (term_mouse_moveto): Do not declare if
10926 HAVE_WINDOW_SYSTEM.
10927 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
10928 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
10929
10930 * sysdep.c: Make symbols static if they're not exported.
10931 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
10932 Now static.
10933 (sigprocmask_set, full_mask): Remove; unused.
10934 (wait_debugging): Mark as visible.
10935 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
10936 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
10937
10938 * syntax.c (syntax_temp): Define only if !__GNUC__.
10939
10940 * sound.c (current_sound_device, current_sound): Now static.
10941
10942 * search.c (searchbufs, searchbuf_head): Now static.
10943
10944 * scroll.c (scroll_cost): Remove; unused.
10945 * dispextern.h (scroll_cost): Remove decl.
10946
10947 * region-cache.h (pp_cache): Mark as externally visible.
10948
10949 * process.c: Make symbols static if they're not exported.
10950 (process_tick, update_tick, create_process, chan_process):
10951 (Vprocess_alist, proc_buffered_char, datagram_access):
10952 (fd_callback_data, send_process_frame, process_sent_to): Now static.
10953 (deactivate_process): Mark defn as static, as well as decl.
10954 * lisp.h (create_process): Remove decl.
10955 * process.h (chan_process, Vprocess_alist): Remove decls.
10956
10957 * print.c: Make symbols static if they're not exported.
10958 (print_depth, new_backquote_output, being_printed, print_buffer):
10959 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
10960 (print_interval, print_number_index, initial_stderr_stream):
10961 Now static.
10962 * lisp.h (Fprinc): Remove decl.
10963 (debug_output_compilation_hack): Mark as externally visible.
10964
10965 * sysdep.c (croak): Move decl from here to syssignal.h.
10966 * syssignal.h (croak): Put it here, so the API can be checked when
10967 'croak' is called from dissociate_if_controlling_tty.
10968
10969 * minibuf.c: Make symbols static if they're not exported.
10970 (minibuf_save_list, choose_minibuf_frame): Now static.
10971 * lisp.h (choose_minibuf_frame): Remove decl.
10972
10973 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
10974
10975 * lread.c: Make symbols static if they're not exported.
10976 (read_objects, initial_obarray, oblookup_last_bucket_number):
10977 Now static.
10978 (make_symbol): Remove; unused.
10979 * lisp.h (initial_obarray, make_symbol): Remove decls.
10980
10981 * keyboard.c: Make symbols static if they're not exported.
10982 (single_kboard, recent_keys_index, total_keys, recent_keys):
10983 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
10984 (this_single_command_key_start, echoing, last_auto_save):
10985 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
10986 (command_loop, echo_now, keyboard_init_hook, help_char_p):
10987 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
10988 (Vlispy_mouse_stem, double_click_count):
10989 Now static.
10990 (force_auto_save_soon): Define only if SIGDANGER.
10991 (ignore_mouse_drag_p): Now static if
10992 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
10993 (print_help): Remove; unused.
10994 (stop_character, last_timer_event): Mark as externally visible.
10995 * keyboard.h (ignore_mouse_drag_p): Declare only if
10996 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
10997 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
10998 * lisp.h (echoing): Remove decl.
10999 (force_auto_save_soon): Declare only if SIGDANGER.
11000 * xdisp.c (redisplay_window): Simplify code, to make it more
11001 obvious that ignore_mouse_drag_p is not accessed if !defined
11002 USE_GTK && !defined HAVE_NS.
11003
11004 * intervals.c: Make symbols static if they're not exported.
11005 (merge_properties_sticky, merge_interval_right, delete_interval):
11006 Now static.
11007 * intervals.h (merge_interval_right, delete_interval): Remove decls.
11008
11009 * insdel.c: Make symbols static if they're not exported.
11010 However, leave prepare_to_modify_buffer alone. It's never
11011 called from outside this function, but that appears to be a bug.
11012 (combine_after_change_list, combine_after_change_buffer):
11013 (adjust_after_replace, signal_before_change): Now static.
11014 (adjust_after_replace_noundo): Remove; unused.
11015 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
11016 (signal_before_change): Remove decls.
11017
11018 * indent.c (val_compute_motion, val_vmotion): Now static.
11019
11020 * image.c: Make symbols static if they're not exported.
11021 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
11022 if USE_GTK.
11023 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
11024 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
11025
11026 * fringe.c (standard_bitmaps): Now static.
11027 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
11028
11029 * frame.c: Make symbols static if they're not exported.
11030 (x_report_frame_params, make_terminal_frame): Now static.
11031 (get_frame_param): Now static, unless HAVE_NS.
11032 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
11033 (x_get_resource_string): Remove; not used.
11034 * frame.h (make_terminal_frame, x_report_frame_params):
11035 (x_get_resource_string); Remove decls.
11036 (x_fullscreen_adjust): Declare only if WINDOWSNT.
11037 * lisp.h (get_frame_param): Declare only if HAVE_NS.
11038
11039 * font.c, fontset.c: Make symbols static if they're not exported.
11040 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
11041 (FACE_SUITABLE_FOR_CHAR_P): Use it.
11042 * font.c (font_close_object): Now static.
11043 * font.h (font_close_object): Remove.
11044 * fontset.c (FONTSET_OBJLIST): Remove.
11045 (free_realized_fontset) #if-0 the body, which does nothing.
11046 (face_suitable_for_char_p): #if-0, as it's never called.
11047 * fontset.h (face_suitable_for_char_p): Remove decl.
11048 * xfaces.c (face_at_string_position):
11049 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
11050 since 0 is always ASCII.
11051
11052 * fns.c (weak_hash_tables): Now static.
11053
11054 * fileio.c: Make symbols static if they're not exported.
11055 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
11056 (Vwrite_region_annotation_buffers): Now static.
11057
11058 * eval.c: Make symbols static if they're not exported.
11059 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
11060 * lisp.h (backtrace_list): Remove decl.
11061
11062 * emacs.c: Make symbols static if they're not exported.
11063 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
11064 (fatal_error_code, fatal_error_signal_hook, standard_args):
11065 Now static.
11066 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
11067 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
11068 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
11069 * lisp.h (fatal_error_signal_hook): Remove decl.
11070 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
11071
11072 * editfns.c: Move a (normally-unused) function to its only use.
11073 * editfns.c, lisp.h (get_operating_system_release): Remove.
11074 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
11075 worth the hassle of breaking this out.
11076
11077 * xterm.c: Make symbols static if they're not exported.
11078 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
11079 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
11080 (x_destroy_window, x_delete_display):
11081 Now static.
11082 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
11083 (x_mouse_leave): Remove; unused.
11084 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
11085 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
11086 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
11087 Remove decls.
11088 (x_mouse_leave): Declare only if WINDOWSNT.
11089 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
11090 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
11091 USE_X_TOOLKIT.
11092
11093 * ftxfont.c: Make symbols static if they're not exported.
11094 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
11095 HAVE_FREETYPE.
11096 * font.h (ftxfont_driver): Likewise.
11097
11098 * xfns.c: Make symbols static if they're not exported.
11099 (x_last_font_name, x_display_info_for_name):
11100 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
11101 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
11102 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
11103 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
11104 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
11105 (last_show_tip_args): Now static.
11106 (xic_defaut_fontset, xic_create_fontsetname): Define only if
11107 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
11108 (x_screen_planes): Remove; unused.
11109 * dispextern.h (x_screen_planes): Remove decl.
11110
11111 * dispnew.c: Make symbols static if they're not exported.
11112 * dispextern.h (redraw_garbaged_frames, scrolling):
11113 (increment_row_positions): Remove.
11114 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
11115 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
11116 Now static.
11117 (redraw_garbaged_frames): Remove; unused.
11118
11119 * xfaces.c: Make symbols static if they're not exported.
11120 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
11121 Remove decls.
11122 * xterm.h (defined_color): Remove decls.
11123 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
11124 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
11125 (menu_face_changed_default, defined_color, free_realized_face):
11126 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
11127 (ascii_face_of_lisp_face): Remove; unused.
11128
11129 * xdisp.c: Make symbols static if they're not exported.
11130 * dispextern.h (scratch_glyph_row, window_box_edges):
11131 (glyph_to_pixel_coords, set_cursor_from_row):
11132 (get_next_display_element, set_iterator_to_next):
11133 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
11134 (show_mouse_face): Remove decls
11135 * frame.h (message_buf_print): Likewise.
11136 * lisp.h (pop_message, set_message, check_point_in_composition):
11137 Likewise.
11138 * xterm.h (set_vertical_scroll_bar): Likewise.
11139 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
11140 (message_buf_print, scratch_glyph_row, displayed_buffer):
11141 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
11142 (get_next_display_element, show_mouse_face, window_box_edges):
11143 (frame_to_window_pixel_xy, check_point_in_composition):
11144 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
11145 (glyph_to_pixel_coords): Remove; unused.
11146
11147 * dired.c (file_name_completion): Now static.
11148
11149 * dbusbind.c (xd_in_read_queued_messages): Now static.
11150
11151 * lisp.h (circular_list_error, FOREACH): Remove; unused.
11152 * data.c (circular_list_error): Remove.
11153
11154 * commands.h (last_point_position, last_point_position_buffer):
11155 (last_point_position_window): Remove decls.
11156 * keyboard.c: Make these variables static.
11157
11158 * coding.h (coding, code_convert_region, encode_coding_gap):
11159 Remove decls.
11160 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
11161 (iso_code_class, detect_coding, code_convert_region): Now static.
11162 (encode_coding_gap): Remove; unused.
11163
11164 * chartab.c (chartab_chars, chartab_bits): Now static.
11165
11166 * charset.h (charset_iso_8859_1): Remove decl.
11167 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
11168 Now static.
11169
11170 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
11171 * ccl.c (Vccl_program_table): Now static.
11172 (check_ccl_update): Remove; unused.
11173
11174 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
11175 * category.h: ... from here.
11176 * category.c (check_category_table, set_category_set): Now static.
11177
11178 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
11179 * lisp.h: Remove these decls.
11180
11181 * buffer.c (buffer_count): Remove unused var.
11182
11183 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
11184 so that it's not optimized away.
11185 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
11186 * dispextern.h (bidi_dump_cached_states): Remove, since it's
11187 exported only to the debugger.
11188
11189 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
11190 * atimer.h (run_all_atimers): Remove; not exported.
11191
11192 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
11193 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
11194 was inaccessible from Lisp.
11195 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
11196 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
11197
11198 alloc.c: Import and export fewer symbols, and remove unused items.
11199 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
11200 is defined.
11201 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
11202 it's not optimized away by whole-program optimization.
11203 (message_enable_multibyte, free_misc): Remove.
11204 (catchlist, handlerlist, mark_backtrace):
11205 Declare only if BYTE_MARK_STACK.
11206 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
11207 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
11208 (message_enable_multibyte): Remove decl.
11209 (free_misc, interval_free_list, float_block, float_block_index):
11210 (n_float_blocks, float_free_list, cons_block, cons_block_index):
11211 (cons_free_list, last_marked_index):
11212 Now static.
11213 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
11214 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
11215 (mark_backtrace): Define only if BYTE_MARK_STACK.
11216 * xdisp.c (message_enable_multibyte): Now static.
11217
11218 Declare Lisp_Object Q* variables to be 'static' if not exported.
11219 This makes it easier for human readers (and static analyzers)
11220 to see whether these variables are used from other modules.
11221 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
11222 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
11223 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
11224 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
11225 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
11226 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
11227 * xmenu.c, xselect.c:
11228 Declare Q* vars static if they are not used in other modules.
11229 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
11230 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
11231 Remove decls of unexported vars.
11232 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
11233
11234 * lisp.h (DEFINE_FUNC): Make sname 'static'.
11235
11236 Make Emacs functions such as Fatom 'static' by default.
11237 This makes it easier for human readers (and static analyzers)
11238 to see whether these functions can be called from other modules.
11239 DEFUN now defines a static function. To make the function external
11240 so that it can be used in other C modules, use the new macro DEFUE.
11241 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
11242 (Finit_image_library):
11243 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
11244 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
11245 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
11246 Remove decls, since these functions are now static.
11247 (Funintern, Fget_internal_run_time): New decls, since these functions
11248 were already external.
11249
11250 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
11251 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
11252 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
11253 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
11254 * keyboard.c, keymap.c, lread.c:
11255 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
11256 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
11257 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
11258 Mark functions with DEFUE instead of DEFUN,
11259 if they are used in other modules.
11260 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
11261 decls for now-static functions.
11262 * buffer.h (Fdelete_overlay): Remove decl.
11263 * callproc.c (Fgetenv_internal): Mark as internal.
11264 * composite.c (Fremove_list_of_text_properties): Remove decl.
11265 (Fcomposition_get_gstring): New forward static decl.
11266 * composite.h (Fcomposite_get_gstring): Remove decl.
11267 * dired.c (Ffile_attributes): New forward static decl.
11268 * doc.c (Fdocumntation_property): New forward static decl.
11269 * eval.c (Ffetch_bytecode): New forward static decl.
11270 (Funintern): Remove extern decl; now in .h file where it belongs.
11271 * fileio.c (Fmake_symbolic_link): New forward static decl.
11272 * image.c (Finit_image_library): New forward static decl.
11273 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
11274 * intervals.h (Fprevious_property_change):
11275 (Fremove_list_of_text_properties): Remove decls.
11276 * keyboard.c (Fthis_command_keys): Remove decl.
11277 (Fcommand_execute): New forward static decl.
11278 * keymap.c (Flookup_key): New forward static decl.
11279 (Fcopy_keymap): Now static.
11280 * keymap.h (Flookup_key): Remove decl.
11281 * process.c (Fget_process): New forward static decl.
11282 (Fprocess_datagram_address): Mark as internal.
11283 * syntax.c (Fsyntax_table_p): New forward static decl.
11284 (skip_chars): Remove duplicate decl.
11285 * textprop.c (Fprevious_property_change): New forward static decl.
11286 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
11287 Now internal.
11288 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
11289 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
11290
11291 * editfns.c (Fformat): Remove unreachable code.
11292
11293 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
11294
11295 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
11296 change. (Bug#8496)
11297
11298 2011-04-13 Eli Zaretskii <eliz@gnu.org>
11299
11300 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
11301 when at ZV. (Bug#8487)
11302
11303 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
11304
11305 * charset.c (Fclear_charset_maps): Use xfree instead of free.
11306 (Bug#8437)
11307 * keyboard.c (parse_tool_bar_item): Likewise.
11308 * sound.c (sound_cleanup, alsa_close): Likewise.
11309 * termcap.c (tgetent): Likewise.
11310 * xfns.c (x_default_font_parameter): Likewise.
11311 * xsettings.c (read_and_apply_settings): Likewise.
11312
11313 * alloc.c (overrun_check_malloc, overrun_check_realloc)
11314 (overrun_check_free): Protoize.
11315
11316 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
11317
11318 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
11319 since callers should never pass a negative size.
11320 Change the signature to match that of plain 'read' and 'write'; see
11321 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
11322 * lisp.h: Update prototypes of emacs_write and emacs_read.
11323
11324 2011-04-11 Eli Zaretskii <eliz@gnu.org>
11325
11326 * xdisp.c (redisplay_window): Don't try to determine the character
11327 position of the scroll margin if the window start point w->startp
11328 is outside the buffer's accessible region. (Bug#8468)
11329
11330 2011-04-10 Eli Zaretskii <eliz@gnu.org>
11331
11332 Fix write-region and its subroutines for buffers > 2GB.
11333 * fileio.c (a_write, e_write): Modify declaration of arguments and
11334 local variables to support buffers larger than 2GB.
11335 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
11336
11337 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
11338 argument, local variables, and return value.
11339
11340 * lisp.h: Update prototypes of emacs_write and emacs_read.
11341
11342 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
11343
11344 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
11345
11346 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
11347
11348 Fix more problems found by GCC 4.6.0's static checks.
11349
11350 * xdisp.c (vmessage): Use a better test for character truncation.
11351
11352 * charset.c (load_charset_map): <, not <=, for optimization,
11353 and to avoid potential problems with integer overflow.
11354 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
11355 * casetab.c (set_identity, shuffle): Likewise.
11356 * editfns.c (Fformat): Likewise.
11357 * syntax.c (skip_chars): Likewise.
11358
11359 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
11360 This also lets GCC 4.6.0 generate slightly better loop code.
11361
11362 * callint.c (Fcall_interactively): <, not <=, for optimization.
11363 (Fcall_interactively): Count the number of arguments produced,
11364 not the number of arguments given. This is simpler and lets GCC
11365 4.6.0 generate slightly better code.
11366
11367 * ftfont.c: Distingish more carefully between FcChar8 and char.
11368 The previous code passed unsigned char * to a functions like
11369 strlen and xstrcasecmp that expect char *, which does not
11370 conform to the C standard.
11371 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
11372 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
11373 char * when the C standard requires it.
11374
11375 * keyboard.c (read_char): Remove unused var.
11376
11377 * eval.c: Port to Windows vsnprintf (Bug#8435).
11378 Include <limits.h>.
11379 (SIZE_MAX): Define if the headers do not.
11380 (verror): Do not give up if vsnprintf returns a negative count.
11381 Instead, grow the buffer. This ports to Windows vsnprintf, which
11382 does not conform to C99. Problem reported by Eli Zaretskii.
11383 Also, simplify the allocation scheme, by avoiding the need for
11384 calling realloc, and removing the ALLOCATED variable.
11385
11386 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
11387
11388 Remove invocations of doprnt, as Emacs now uses vsnprintf.
11389 But keep the doprint source code for now, as we might revamp it
11390 and use it again (Bug#8435).
11391 * lisp.h (doprnt): Remove.
11392 * Makefile.in (base_obj): Remove doprnt.o.
11393 * deps.mk (doprnt.o): Remove.
11394
11395 error: Print 32- and 64-bit integers portably (Bug#8435).
11396 Without this change, on typical 64-bit hosts error ("...%d...", N)
11397 was used to print both 32- and 64-bit integers N, which relied on
11398 undefined behavior.
11399 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
11400 * lisp.h (error, verror): Mark as printf-like functions.
11401 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
11402 Report overflow in size calculations when allocating printf buffer.
11403 Do not truncate output string at its first null byte.
11404 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
11405 Truncate the output at a character boundary, since vsnprintf does not
11406 do that.
11407 * charset.c (check_iso_charset_parameter): Convert internal
11408 character to string before calling 'error', since %c now has the
11409 printf meaning.
11410 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
11411 overflow when computing char to be passed to 'error'. Do not
11412 pass Lisp_Object to 'error'; pass the integer instead.
11413 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
11414 formatted with plain %d.
11415
11416 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
11417
11418 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
11419
11420 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
11421
11422 * xterm.c (x_catch_errors): Remove duplicate declaration.
11423
11424 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
11425
11426 * xdisp.c, lisp.h (message_nolog): Remove; unused.
11427
11428 2011-04-10 Jim Meyering <meyering@redhat.com>
11429
11430 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
11431 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
11432 return ssize_t not "int", and use size_t as the buffer length.
11433 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
11434 * gnutls.h: Update declarations.
11435 * process.c (read_process_output): Use ssize_t, to match.
11436 (send_process): Likewise.
11437
11438 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
11439
11440 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
11441
11442 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
11443
11444 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
11445 Use unsigned char, to match FcChar8 type definition.
11446
11447 * xterm.c (handle_one_xevent):
11448 * xmenu.c (create_and_show_popup_menu):
11449 * xselect.c (x_decline_selection_request)
11450 (x_reply_selection_request): Avoid type-punned deref of X events.
11451
11452 2011-04-09 Eli Zaretskii <eliz@gnu.org>
11453
11454 Fix some uses of `int' instead of EMACS_INT.
11455 * search.c (string_match_1, fast_string_match)
11456 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
11457 (scan_buffer, find_next_newline_no_quit)
11458 (find_before_next_newline, search_command, Freplace_match)
11459 (Fmatch_data): Make some `int' variables be EMACS_INT.
11460
11461 * xdisp.c (display_count_lines): 3rd argument and return value now
11462 EMACS_INT. All callers changed.
11463 (pint2hrstr): Last argument is now EMACS_INT.
11464
11465 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
11466 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
11467 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
11468 (decode_coding_utf_16, decode_coding_emacs_mule)
11469 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
11470 (decode_coding_ccl, decode_coding_charset)
11471 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
11472 (decode_coding_iso_2022, decode_coding_emacs_mule)
11473 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
11474 <char_offset, last_offset>: Declare EMACS_INT.
11475 (encode_coding_utf_8, encode_coding_utf_16)
11476 (encode_coding_emacs_mule, encode_invocation_designation)
11477 (encode_designation_at_bol, encode_coding_iso_2022)
11478 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
11479 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
11480 Declare EMACS_INT.
11481 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
11482 (encode_invocation_designation): Last argument P_NCHARS is now
11483 EMACS_INT.
11484 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
11485 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
11486
11487 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
11488 All users changed.
11489
11490 * ccl.c (Fccl_execute_on_string): Declare some variables
11491 EMACS_INT.
11492
11493 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
11494
11495 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
11496
11497 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
11498
11499 * process.c (Fformat_network_address): Doc fix.
11500
11501 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
11502
11503 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
11504
11505 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
11506
11507 * keyboard.c (read_char): Call Lisp function help-form-show,
11508 instead of using internal_with_output_to_temp_buffer.
11509 (Qhelp_form_show): New var.
11510 (syms_of_keyboard): Use DEFSYM macro.
11511
11512 * print.c (internal_with_output_to_temp_buffer): Function deleted.
11513
11514 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
11515
11516 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
11517
11518 * process.c (Flist_processes): Remove to Lisp.
11519 (list_processes_1): Delete.
11520
11521 2011-04-06 Eli Zaretskii <eliz@gnu.org>
11522
11523 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
11524
11525 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
11526
11527 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
11528
11529 Fix more problems found by GCC 4.6.0's static checks.
11530
11531 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
11532
11533 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
11534
11535 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
11536
11537 * xdisp.c (vmessage): Mark as a printf-like function.
11538
11539 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
11540
11541 * sound.c (sound_warning): Don't crash if arg contains a printf format.
11542
11543 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
11544 printf-like functions.
11545 (tiff_load): Add casts to remove these marks before passing them
11546 to system-supplied API.
11547
11548 * eval.c (Fsignal): Remove excess argument to 'fatal'.
11549
11550 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
11551 This avoids several warnings with gcc -Wstrict-overflow.
11552 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
11553 directly, rather than having caller test rule sign. This avoids
11554 some unnecessary tests.
11555 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
11556 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
11557 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
11558
11559 * xfont.c (xfont_text_extents): Remove var that was set but not used.
11560 (xfont_open): Avoid unnecessary tests.
11561
11562 * composite.c (composition_gstring_put_cache): Use unsigned integer.
11563
11564 * composite.h, composite.c (composition_gstring_put_cache):
11565 Use EMACS_INT, not int, for length.
11566
11567 * composite.h (COMPOSITION_DECODE_REFS): New macro,
11568 breaking out part of COMPOSITION_DECODE_RULE.
11569 (COMPOSITION_DECODE_RULE): Use it.
11570 * composite.c (get_composition_id): Remove unused local vars,
11571 by using the new macro.
11572
11573 * textprop.c (set_text_properties_1): Change while to do-while,
11574 since the condition is always true at first.
11575
11576 * intervals.c (graft_intervals_into_buffer): Mark var as used.
11577 (interval_deletion_adjustment): Return unsigned value.
11578 All uses changed.
11579
11580 * process.c (list_processes_1, create_pty, read_process_output):
11581 (exec_sentinel): Remove vars that were set but not used.
11582 (create_pty): Remove unnecessary "volatile"s.
11583 (Fnetwork_interface_info): Avoid possibility of int overflow.
11584 (read_process_output): Do adaptive read buffering even if carryover.
11585 (read_process_output): Simplify nbytes computation if buffered.
11586
11587 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
11588
11589 * syntax.c (scan_words): Remove var that was set but not used.
11590 (update_syntax_table): Use unsigned instead of int.
11591
11592 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
11593 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
11594 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
11595
11596 * print.c (print_error_message): Avoid int overflow.
11597
11598 * font.c (font_list_entities): Redo for clarity,
11599 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
11600
11601 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
11602 (font_score): Avoid potential overflow in diff calculation.
11603
11604 * fns.c (substring_both): Remove var that is set but not used.
11605 (sxhash): Redo loop for clarity and to avoid wraparound warning.
11606
11607 * eval.c (funcall_lambda): Rename local to avoid shadowing.
11608
11609 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
11610 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
11611 can always succeed if overflow has undefined behavior.
11612
11613 * search.c (boyer_moore, wordify): Remove vars set but not used.
11614 (wordify): Omit three unnecessary tests.
11615
11616 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
11617 All callers changed. This avoids the need for an unused var.
11618
11619 * casefiddle.c (casify_region): Remove var that is set but not used.
11620
11621 * dired.c (file_name_completion): Remove var that is set but not used.
11622
11623 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
11624
11625 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
11626 (Finsert_file_contents): Remove unnecessary code checking fd.
11627
11628 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
11629 Check for integer overflow on size calculations.
11630
11631 * buffer.c (Fprevious_overlay_change): Remove var that is set
11632 but not used.
11633
11634 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
11635 Remove vars that are set but not used.
11636 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
11637 (timer_check_2): Mark vars as initialized.
11638
11639 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
11640
11641 * image.c (lookup_image): Remove var that is set but not used.
11642 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
11643
11644 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
11645 that are set but not used.
11646
11647 * xfns.c (make_invisible_cursor): Don't return garbage
11648 if XCreateBitmapFromData fails (Bug#8410).
11649
11650 * xselect.c (x_get_local_selection, x_handle_property_notify):
11651 Remove vars that are set but not used.
11652
11653 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
11654 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
11655
11656 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
11657 Remove var that is set but not used.
11658 (scroll_bar_windows_size): Now size_t, not int.
11659 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
11660 Check for overflow.
11661
11662 * xfaces.c (realize_named_face): Remove vars that are set but not used.
11663 (map_tty_color) [!defined MSDOS]: Likewise.
11664
11665 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
11666
11667 * coding.c: Remove vars that are set but not used.
11668 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
11669 All callers changed.
11670 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
11671 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
11672 (decode_coding_charset): Remove vars that are set but not used.
11673
11674 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
11675 that is set but not used.
11676
11677 * print.c (print_object): Remove var that is set but not used.
11678
11679 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
11680 The gnulib version avoids calling malloc in the usual case,
11681 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
11682 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
11683 * filelock.c (current_lock_owner): Likewise.
11684 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
11685 * sysdep.c: Include allocator.h, careadlinkat.h.
11686 (emacs_no_realloc_allocator): New static constant.
11687 (emacs_readlink): New function.
11688 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
11689 ../lib/careadlinkat.h.
11690
11691 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
11692
11693 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
11694 first non-nil return value).
11695
11696 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
11697
11698 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
11699 if not defined (Bug#8403).
11700
11701 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
11702
11703 * xdisp.c (display_count_lines): Remove parameter `start',
11704 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
11705 (get_char_face_and_encoding): Remove parameter `multibyte_p',
11706 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
11707 (fill_stretch_glyph_string): Remove parameters `row' and `area',
11708 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
11709 and thereabouts. All callers changed.
11710 (get_per_char_metric): Remove parameter `f', unused since
11711 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
11712
11713 2011-04-02 Jim Meyering <meyering@redhat.com>
11714
11715 do not dereference NULL upon failed strdup
11716 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
11717 (ns_get_family): Likewise.
11718
11719 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
11720
11721 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
11722
11723 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
11724
11725 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
11726 later (Bug#8403).
11727
11728 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
11729
11730 Add lexical binding.
11731
11732 * window.c (Ftemp_output_buffer_show): New fun.
11733 (Fsave_window_excursion):
11734 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
11735
11736 * lread.c (lisp_file_lexically_bound_p): New function.
11737 (Fload): Bind Qlexical_binding.
11738 (readevalloop): Remove `evalfun' arg.
11739 Bind Qinternal_interpreter_environment.
11740 (Feval_buffer): Bind Qlexical_binding.
11741 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
11742 Mark as dynamic.
11743 (syms_of_lread): Declare `lexical-binding'.
11744
11745 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
11746
11747 * keyboard.c (eval_dyn): New fun.
11748 (menu_item_eval_property): Use it.
11749
11750 * image.c (parse_image_spec): Use Ffunctionp.
11751
11752 * fns.c (concat, mapcar1): Accept byte-code-functions.
11753
11754 * eval.c (Fsetq): Handle lexical vars.
11755 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
11756 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
11757 (FletX, Flet): Obey lexical binding.
11758 (Fcommandp): Handle closures.
11759 (Feval): New `lexical' arg.
11760 (eval_sub): New function extracted from Feval. Use it almost
11761 everywhere where Feval was used. Look up vars in lexical env.
11762 Handle closures.
11763 (Ffunctionp): Move from subr.el.
11764 (Ffuncall): Handle closures.
11765 (apply_lambda): Remove `eval_flags'.
11766 (funcall_lambda): Handle closures and new byte-code-functions.
11767 (Fspecial_variable_p): New function.
11768 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
11769 but without exporting it to Lisp.
11770
11771 * doc.c (Fdocumentation, store_function_docstring):
11772 * data.c (Finteractive_form): Handle closures.
11773
11774 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
11775 interactive spec.
11776
11777 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
11778 New byte-codes.
11779 (exec_byte_code): New function extracted from Fbyte_code to handle new
11780 calling convention for byte-code-functions. Add new byte-codes.
11781
11782 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
11783
11784 * alloc.c (Fmake_symbol): Init new `declared_special' field.
11785
11786 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
11787
11788 * xdisp.c (redisplay_internal): Fix prototype.
11789
11790 2011-03-31 Eli Zaretskii <eliz@gnu.org>
11791
11792 * xdisp.c (SCROLL_LIMIT): New macro.
11793 (try_scrolling): Use it when setting scroll_limit.
11794 Limit scrolling to 100 screen lines.
11795 (redisplay_window): Even when falling back on "recentering",
11796 position point in the window according to scroll-conservatively,
11797 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
11798
11799 (try_scrolling): When point is above the window, allow searching
11800 as far as scroll_max, or one screenful, to compute vertical
11801 distance from PT to the scroll margin position. This prevents
11802 try_scrolling from unnecessarily failing when
11803 scroll-conservatively is set to a value slightly larger than the
11804 window height. Clean up the case of PT below the margin at bottom
11805 of window: scroll_max can no longer be INT_MAX. When aggressive
11806 scrolling is in use, don't let point enter the opposite scroll
11807 margin as result of the scroll.
11808 (syms_of_xdisp) <scroll-conservatively>: Document the
11809 threshold of 100 lines for never-recentering scrolling.
11810
11811 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
11812
11813 * dispextern.h (move_it_by_lines):
11814 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
11815 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
11816 (message_log_check_duplicate): Remove parameters `prev_bol' and
11817 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
11818 (redisplay_internal): Remove parameter `preserve_echo_area',
11819 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
11820
11821 * indent.c (Fvertical_motion):
11822 * window.c (window_scroll_pixel_based, Frecenter):
11823 Don't pass `need_y_p' to `move_it_by_lines'.
11824
11825 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
11826
11827 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
11828 steal a few bits to be more compact.
11829 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
11830 Remove unneeded casts.
11831
11832 * bytecode.c (Fbyte_code): CAR and CDR can GC.
11833
11834 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
11835
11836 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
11837 binding" message (bug#7967).
11838
11839 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
11840
11841 Fix more problems found by GCC 4.6.0's static checks.
11842
11843 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
11844 Remove unused local var.
11845
11846 * editfns.c (Fmessage_box): Remove unused local var.
11847
11848 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
11849 (note_mode_line_or_margin_highlight, note_mouse_highlight):
11850 Omit unused local vars.
11851 * window.c (shrink_windows): Omit unused local var.
11852 * menu.c (digest_single_submenu): Omit unused local var.
11853 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
11854 Omit unused local var.
11855
11856 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
11857 Don't assume string length fits in int.
11858 (keyremap_step, read_key_sequence): Use size_t for sizes.
11859 (read_key_sequence): Don't check last_real_key_start redundantly.
11860
11861 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
11862 instead of alloca (Bug#8344).
11863
11864 * eval.c (Fbacktrace): Don't assume nargs fits in int.
11865 (Fbacktrace_frame): Don't assume nframes fits in int.
11866
11867 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
11868
11869 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
11870 concerns.
11871
11872 * term.c (produce_glyphless_glyph): Remove unnecessary test.
11873
11874 * cm.c (calccost): Turn while-do into do-while, for clarity.
11875
11876 * keyboard.c (syms_of_keyboard): Use the same style as later
11877 in this function when indexing through an array. This also
11878 works around GCC bug 48267.
11879
11880 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
11881
11882 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
11883
11884 * chartab.c (sub_char_table_ref_and_range): Redo for slight
11885 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
11886
11887 * keyboard.c, keyboard.h (num_input_events): Now size_t.
11888 This avoids undefined behavior on integer overflow, and is a bit
11889 more convenient anyway since it is compared to a size_t variable.
11890
11891 Variadic C functions now count arguments with size_t, not int.
11892 This avoids an unnecessary limitation on 64-bit machines, which
11893 caused (substring ...) to crash on large vectors (Bug#8344).
11894 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
11895 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
11896 All variadic functions and their callers changed accordingly.
11897 (struct gcpro.nvars): Now size_t, not int. All uses changed.
11898 * data.c (arith_driver, float_arith_driver): Likewise.
11899 * editfns.c (general_insert_function): Likewise.
11900 * eval.c (struct backtrace.nargs, interactive_p)
11901 (internal_condition_case_n, run_hook_with_args, apply_lambda)
11902 (funcall_lambda, mark_backtrace): Likewise.
11903 * fns.c (concat): Likewise.
11904 * frame.c (x_set_frame_parameters): Likewise.
11905 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
11906 0 if not found, not -1. All callers changed.
11907
11908 * alloc.c (garbage_collect): Don't assume stack size fits in int.
11909 (stack_copy_size): Now size_t, not int.
11910 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
11911
11912 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
11913
11914 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
11915 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
11916 All callers changed.
11917
11918 * lisp.h (multibyte_char_to_unibyte):
11919 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
11920 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
11921 * character.h (CHAR_TO_BYTE8):
11922 * cmds.c (internal_self_insert):
11923 * editfns.c (general_insert_function):
11924 * keymap.c (push_key_description):
11925 * search.c (Freplace_match):
11926 * xdisp.c (message_dolog, set_message_1): All callers changed.
11927
11928 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
11929
11930 * keyboard.c (safe_run_hook_funcall): New function.
11931 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
11932 don't set the hook to nil, but remove the offending function instead.
11933 (Qcommand_hook_internal): Remove, unused.
11934 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
11935 Vcommand_hook_internal.
11936
11937 * eval.c (enum run_hooks_condition): Remove.
11938 (funcall_nil, funcall_not): New functions.
11939 (run_hook_with_args): Call each function through a `funcall' argument.
11940 Remove `cond' argument, now redundant.
11941 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
11942 (Frun_hook_with_args_until_failure): Adjust accordingly.
11943 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
11944
11945 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
11946
11947 * dispextern.h (string_buffer_position): Remove declaration.
11948
11949 * print.c (strout): Remove parameter `multibyte', unused since
11950 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
11951
11952 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
11953 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
11954 All callers changed.
11955
11956 * w32.c (_wsa_errlist): Use braces for struct initializers.
11957
11958 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
11959 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
11960 All callers changed.
11961 (string_buffer_position): Likewise. Also, make static (it's never
11962 used outside xdisp.c).
11963 (cursor_row_p): Remove parameter `w', unused since
11964 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
11965 (decode_mode_spec): Remove parameter `precision', introduced during
11966 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
11967 All callers changed.
11968
11969 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
11970
11971 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
11972
11973 2011-03-27 Anders Lindgren <andlind@gmail.com>
11974
11975 * nsterm.m (ns_menu_bar_is_hidden): New variable.
11976 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
11977 (ns_update_auto_hide_menu_bar): New functions.
11978 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
11979 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
11980 ns_constrain_all_frames.
11981 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
11982 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
11983
11984 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
11985
11986 * nsmenu.m (runDialogAt): Remove argument to timer_check.
11987
11988 2011-03-27 Glenn Morris <rgm@gnu.org>
11989
11990 * syssignal.h: Replace RETSIGTYPE with void.
11991 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
11992 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
11993 Replace SIGTYPE with void everywhere.
11994 * s/usg5-4-common.h (SIGTYPE): Remove definition.
11995 * s/template.h (SIGTYPE): Remove commented out definition.
11996
11997 2011-03-26 Eli Zaretskii <eliz@gnu.org>
11998
11999 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
12000 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
12001
12002 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
12003
12004 * w32.c (read_unc_volume): Use parameter `henum', instead of
12005 global variable `wget_enum_handle'.
12006
12007 * keymap.c (describe_vector): Remove parameters `indices' and
12008 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
12009 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
12010
12011 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
12012
12013 * keyboard.c (timer_check): Remove parameter `do_it_now',
12014 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
12015 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
12016 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
12017
12018 * keyboard.c (read_char):
12019 * w32menu.c (w32_menu_display_help):
12020 * xmenu.c (show_help_event, menu_help_callback):
12021 Adjust calls to `show_help_echo'.
12022
12023 * gtkutil.c (xg_maybe_add_timer):
12024 * keyboard.c (readable_events):
12025 * process.c (wait_reading_process_output):
12026 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
12027
12028 * insdel.c (adjust_markers_gap_motion):
12029 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
12030 (gap_left, gap_right): Don't call it.
12031
12032 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
12033
12034 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
12035 incurred during fontification.
12036
12037 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
12038
12039 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
12040 (DEFVAR_PER_BUFFER): Don't pass it.
12041
12042 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
12043 (scrolling_window): Don't pass it.
12044
12045 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
12046
12047 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
12048
12049 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
12050 and `suffix'.
12051 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
12052 of variables specific to SELinux and computation of `encoded_absname'.
12053
12054 * image.c (XPutPixel): Remove unused variable `height'.
12055
12056 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
12057
12058 * unexw32.c (get_section_info): Remove unused variable `section'.
12059
12060 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
12061 (system_process_attributes): Remove unused variable `sess'.
12062 (sys_read): Remove unused variable `err'.
12063
12064 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
12065 (w32_wnd_proc): Remove unused variable `isdead'.
12066 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
12067 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
12068 (x_create_tip_frame): Remove unused variable `tem'.
12069
12070 * w32inevt.c (w32_console_read_socket):
12071 Remove unused variable `no_events'.
12072
12073 * w32term.c (x_draw_composite_glyph_string_foreground):
12074 Remove unused variable `width'.
12075
12076 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
12077
12078 * w32term.c (x_set_glyph_string_clipping):
12079 Don't pass uninitialized region to CombineRgn.
12080
12081 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
12082
12083 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
12084 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
12085 (Fx_close_connection): Remove unused variable `i'.
12086
12087 * w32font.c (w32font_draw): Return number of glyphs.
12088 (w32font_open_internal): Remove unused variable `i'.
12089 (w32font_driver): Add missing initializer.
12090
12091 * w32menu.c (utf8to16): Remove unused variable `utf16'.
12092 (fill_in_menu): Remove unused variable `items_added'.
12093
12094 * w32term.c (last_mouse_press_frame): Remove static global variable.
12095 (w32_clip_to_row): Remove unused variable `f'.
12096 (x_delete_terminal): Remove unused variable `i'.
12097
12098 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
12099 (NOTHING): Remove unused static global variable.
12100 (uniscribe_check_otf): Remove unused variable `table'.
12101 (uniscribe_font_driver): Add missing initializers.
12102
12103 2011-03-23 Julien Danjou <julien@danjou.info>
12104
12105 * term.c (Fsuspend_tty, Fresume_tty):
12106 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
12107 * window.c (temp_output_buffer_show):
12108 * insdel.c (signal_before_change):
12109 * frame.c (Fhandle_switch_frame):
12110 * fileio.c (Fdo_auto_save):
12111 * emacs.c (Fkill_emacs):
12112 * editfns.c (save_excursion_restore):
12113 * cmds.c (internal_self_insert):
12114 * callint.c (Fcall_interactively):
12115 * buffer.c (Fkill_all_local_variables):
12116 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
12117 Use Frun_hooks.
12118 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
12119 unconditionally since it does the check itself.
12120
12121 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
12122
12123 Fix more problems found by GCC 4.5.2's static checks.
12124
12125 * coding.c (encode_coding_raw_text): Avoid unnecessary test
12126 the first time through the loop, since we know p0 < p1 then.
12127 This also avoids a gcc -Wstrict-overflow warning.
12128
12129 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
12130 leading to a memory leak, possible in functions like
12131 load_charset_map_from_file that can allocate an unbounded number
12132 of objects (Bug#8318).
12133
12134 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
12135 that could (at least in theory) be that large.
12136
12137 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
12138 This is less likely to overflow, and avoids undefined behavior if
12139 overflow does occur. All callers changed. Use strtoul to scan
12140 for the unsigned long integer.
12141 (pint2hrstr): Simplify and tune code slightly.
12142 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
12143
12144 * scroll.c (do_scrolling): Work around GCC bug 48228.
12145 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
12146
12147 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
12148 This also avoids a warning with gcc -Wstrict-overflow.
12149 (validate_x_resource_name): Simplify count usage.
12150 This also avoids a warning with gcc -Wstrict-overflow.
12151
12152 * fileio.c (Fcopy_file): Report error if fchown or fchmod
12153 fail (Bug#8306).
12154
12155 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
12156
12157 * process.c (Fmake_network_process): Use socklen_t, not int,
12158 where POSIX says socklen_t is required in portable programs.
12159 This fixes a porting bug on hosts like 64-bit HP-UX, where
12160 socklen_t is wider than int (Bug#8277).
12161 (Fmake_network_process, server_accept_connection):
12162 (wait_reading_process_output, read_process_output):
12163 Likewise.
12164
12165 * process.c: Rename or move locals to avoid shadowing.
12166 (list_processes_1, Fmake_network_process):
12167 (read_process_output_error_handler, exec_sentinel_error_handler):
12168 Rename or move locals.
12169 (Fmake_network_process): Define label "retry_connect" only if needed.
12170 (Fnetwork_interface_info): Fix pointer signedness.
12171 (process_send_signal): Add cast to avoid pointer signedness problem.
12172 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
12173 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
12174
12175 Make tparam.h and terminfo.c consistent.
12176 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
12177 Include tparam.h instead, since it declares them.
12178 * cm.h (PC): Remove extern decl; tparam.h now does this.
12179 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
12180 * terminfo.c: Include tparam.h, to check interfaces.
12181 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
12182 (tparam): Adjust signature to match interface in tparam.h;
12183 this removes some undefined behavior. Check that outstring and len
12184 are zero, which they always are with Emacs.
12185 * tparam.h (PC, BC, UP): New extern decls.
12186
12187 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
12188 (xftfont_open): Rename locals to avoid shadowing.
12189
12190 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
12191 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
12192 (OTF_TAG_SYM): Omit macro if not needed.
12193 (ftfont_list): Remove unused local.
12194 (get_adstyle_property, ftfont_pattern_entity):
12195 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
12196 Rename locals to avoid shadowing.
12197
12198 * xfont.c (xfont_list_family): Mark var as initialized.
12199
12200 * xml.c (make_dom): Now static.
12201
12202 * composite.c (composition_compute_stop_pos): Rename local to
12203 avoid shadowing.
12204 (composition_reseat_it): Remove unused locals.
12205 (find_automatic_composition, composition_adjust_point): Likewise.
12206 (composition_update_it): Mark var as initialized.
12207 (find_automatic_composition): Mark vars as initialized,
12208 with a FIXME (Bug#8290).
12209
12210 character.h: Rename locals to avoid shadowing.
12211 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
12212 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
12213 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
12214 (BUF_DEC_POS): Be more systematic about renaming local temporaries
12215 to avoid shadowing.
12216
12217 * textprop.c (property_change_between_p): Remove; unused.
12218
12219 * intervals.c (interval_start_pos): Now static.
12220
12221 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
12222
12223 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
12224 Rename locals to avoid shadowing.
12225
12226 * sound.c (wav_play, au_play, Fplay_sound_internal):
12227 Fix pointer signedness.
12228 (alsa_choose_format): Remove unused local var.
12229 (wav_play): Initialize a variable to 0, to prevent undefined
12230 behavior (Bug#8278).
12231
12232 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
12233
12234 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
12235
12236 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
12237 clobbering (Bug#8298).
12238 * sysdep.c (sys_subshell): Likewise.
12239 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
12240
12241 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
12242 This should get cleaned up, so that child_setup has the
12243 same signature on all platforms.
12244
12245 * callproc.c (call_process_cleanup): Now static.
12246 (relocate_fd): Rename locals to avoid shadowing.
12247
12248 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
12249
12250 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
12251 not to be necessary, and produces flickering.
12252
12253 2011-03-20 Glenn Morris <rgm@gnu.org>
12254
12255 * config.in: Remove file.
12256
12257 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
12258
12259 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
12260 are now in src/globals.h.
12261 (syms_of_minibuf): Remove spurious & from previous change.
12262
12263 2011-03-20 Leo Liu <sdl.web@gmail.com>
12264
12265 * minibuf.c (completing-read-function): New variable.
12266 (completing-read-default): Rename from completing-read.
12267 (completing-read): Call completing-read-function.
12268
12269 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
12270
12271 * xfaces.c (Fx_load_color_file):
12272 Read color file from absolute filename (bug#8250).
12273
12274 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
12275
12276 * makefile.w32-in: Update dependencies.
12277
12278 2011-03-17 Eli Zaretskii <eliz@gnu.org>
12279
12280 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
12281
12282 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
12283
12284 Fix more problems found by GCC 4.5.2's static checks.
12285
12286 * process.c (make_serial_process_unwind, send_process_trap):
12287 (sigchld_handler): Now static.
12288
12289 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
12290 That way, the code declares only the vars that it needs.
12291 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
12292 * s/cygwin.h (PTY_ITERATION): Likewise.
12293 * s/darwin.h (PTY_ITERATION): Likewise.
12294 * s/gnu-linux.h (PTY_ITERATION): Likewise.
12295
12296 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
12297 * process.c (allocate_pty): Don't declare stb unless it's needed.
12298
12299 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
12300 (CONSTANTLIM): Remove; unused.
12301 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
12302 Define only if needed.
12303
12304 * unexelf.c (unexec): Name an expression,
12305 to avoid gcc -Wbad-function-cast warning.
12306 Use a different way to cause a compilation error if anyone uses
12307 n rather than nn, a way that does not involve shadowing.
12308 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
12309
12310 * deps.mk (unexalpha.o): Remove; unused.
12311
12312 New file unexec.h, the (simple) interface for unexec (Bug#8267).
12313 * unexec.h: New file.
12314 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
12315 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
12316 Depend on unexec.h.
12317 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
12318 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
12319 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
12320 Change as necessary to match prototype in unexec.h.
12321
12322 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
12323 shadowing.
12324 (back_comment, skip_chars): Mark vars as initialized.
12325
12326 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
12327 Rename locals to avoid shadowing.
12328
12329 * lread.c (read1): Rewrite so as not to use empty "else".
12330 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
12331
12332 * print.c (Fredirect_debugging_output): Fix pointer signedess.
12333
12334 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
12335 warning when compiling print.c.
12336
12337 * font.c (font_unparse_fcname): Abort in an "impossible" situation
12338 instead of using an uninitialized var.
12339 (font_sort_entities): Mark var as initialized.
12340
12341 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
12342
12343 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
12344 pointers to constants.
12345 (font_parse_fcname): Remove unused vars.
12346 (font_delete_unmatched): Now static.
12347 (font_get_spec): Remove; unused.
12348 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
12349 (font_update_drivers, Ffont_get_glyphs, font_add_log):
12350 Rename or move locals to avoid shadowing.
12351
12352 * fns.c (require_nesting_list, require_unwind): Now static.
12353 (Ffillarray): Rename locals to avoid shadowing.
12354
12355 * floatfns.c (domain_error2): Define only if needed.
12356 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
12357
12358 * alloc.c (mark_backtrace): Move decl from here ...
12359 * lisp.h: ... to here, so that it can be checked.
12360
12361 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
12362 (Fdefvar): Rewrite so as not to use empty "else".
12363 (lisp_indirect_variable): Name an expression,
12364 to avoid gcc -Wbad-function-cast warning.
12365 (Fdefvar): Rename locals to avoid shadowing.
12366
12367 * callint.c (quotify_arg, quotify_args): Now static.
12368 (Fcall_interactively): Rename locals to avoid shadowing.
12369 Use const pointer when appropriate.
12370
12371 * lisp.h (get_system_name, get_operating_system_release):
12372 Move decls here, to check interfaces.
12373 * process.c (get_operating_system_release): Move decl to lisp.h.
12374 * xrdb.c (get_system_name): Likewise.
12375 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
12376 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
12377 some of which prompt warnings from gcc -Wbad-function-cast.
12378 (Fformat_time_string, Fencode_time, Finsert_char):
12379 (Ftranslate_region_internal, Fformat):
12380 Rename or remove local vars to avoid shadowing.
12381 (Ftranslate_region_internal): Mark var as initialized.
12382
12383 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
12384 avoid shadowing.
12385
12386 * lisp.h (eassert): Check that the argument compiles, even if
12387 ENABLE_CHECKING is not defined.
12388
12389 * data.c (Findirect_variable): Name an expression, to avoid
12390 gcc -Wbad-function-cast warning.
12391 (default_value, arithcompare, arith_driver, arith_error): Now static.
12392 (store_symval_forwarding): Rename local to avoid shadowing.
12393 (Fmake_variable_buffer_local, Fmake_local_variable):
12394 Mark variables as initialized.
12395 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
12396
12397 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
12398 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
12399 Rename locals to avoid shadowing.
12400 (mark_stack): Move local variables into the #ifdef region where
12401 they're used.
12402 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
12403 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
12404 needed otherwise.
12405 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
12406 (GC_STRING_CHARS): Remove; not used.
12407 (Fmemory_limit): Cast sbrk's returned value to char *.
12408
12409 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
12410 avoids undefined behavior in theory.
12411
12412 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
12413
12414 Use functions, not macros, for up- and down-casing (Bug#8254).
12415 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
12416 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
12417 to use the following functions instead of these macros.
12418 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
12419 EMACS_INT, since callers assume the returned value fits in int.
12420 (upcase1): Likewise, for UPCASE_TABLE.
12421 (uppercasep, lowercasep, upcase): New static inline functions.
12422 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
12423 the race-condition problem in the old DOWNCASE.
12424
12425 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
12426 Rename locals to avoid shadowing.
12427 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
12428 (regex_compile, re_search_2, re_match_2_internal):
12429 Remove unused local vars.
12430 (FREE_VAR): Rewrite so as not to use empty "else",
12431 which gcc can warn about.
12432 (regex_compile, re_match_2_internal): Mark locals as initialized.
12433 (RETALLOC_IF): Define only if needed.
12434 (WORDCHAR_P): Likewise. This one is never needed, but is used
12435 only in a comment talking about a compiler bug, so put inside
12436 the #if 0 of that comment.
12437 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
12438 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
12439 Remove; unused.
12440
12441 * search.c (boyer_moore): Rename locals to avoid shadowing.
12442 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
12443 (PREV_CHAR_BOUNDARY): Likewise.
12444
12445 * search.c (simple_search): Remove unused var.
12446
12447 * dired.c (compile_pattern): Move decl from here ...
12448 * lisp.h: ... to here, so that it can be checked.
12449 (struct re_registers): New forward decl.
12450
12451 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
12452
12453 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
12454 All uses changed.
12455 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
12456 Rename locals to avoid shadowing.
12457 (Fvertical_motion): Mark locals as initialized.
12458
12459 * casefiddle.c (casify_object, casify_region): Now static.
12460 (casify_region): Mark local as initialized.
12461
12462 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
12463
12464 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
12465 New macros, so that the caller can use some names other than
12466 gcpro1, gcpro2, etc.
12467 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
12468 of the new macros.
12469 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
12470 argument, for consistency with GCPRO2_VAR, etc: it is now the
12471 prefix of the variable, not the variable itself. All uses
12472 changed.
12473 * dired.c (directory_files_internal, file_name_completion):
12474 Rename locals to avoid shadowing.
12475
12476 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
12477 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
12478 dired.c's scmp function, had undefined behavior.
12479 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
12480 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
12481 * buffer.h: ... to here, because these macros use current_buffer,
12482 and the new implementation with inline functions needs to have
12483 current_buffer in scope now, rather than later when the macros
12484 are used.
12485 (downcase, upcase1): New static inline functions.
12486 (DOWNCASE, UPCASE1): Reimplement using these functions.
12487 This avoids undefined behavior in expressions like
12488 DOWNCASE (x) == DOWNCASE (y), which previously suffered
12489 from race conditions in accessing the global variables
12490 case_temp1 and case_temp2.
12491 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
12492 * lisp.h (case_temp1, case_temp2): Remove their decls.
12493 * character.h (ASCII_CHAR_P): Move from here ...
12494 * lisp.h: ... to here, so that the inline functions mentioned
12495 above can use them.
12496
12497 * dired.c (directory_files_internal_unwind): Now static.
12498
12499 * fileio.c (file_name_as_directory, directory_file_name):
12500 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
12501 Now static.
12502 (file_name_as_directory): Use const pointers when appropriate.
12503 (Fexpand_file_name): Likewise. In particular, newdir might
12504 point at constant storage, so make it a const pointer.
12505 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
12506 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
12507 signedness issues.
12508 (Fset_file_times, Finsert_file_contents, auto_save_error):
12509 Rename locals to avoid shadowing.
12510
12511 * minibuf.c (choose_minibuf_frame_1): Now static.
12512 (Ftry_completion, Fall_completions): Rename or remove locals
12513 to avoid shadowing.
12514
12515 * marker.c (bytepos_to_charpos): Remove; unused.
12516
12517 * lisp.h (verify_bytepos, count_markers): New decls,
12518 so that gcc does not warn that these functions aren't declared.
12519
12520 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
12521 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
12522 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
12523 (copy_text): Remove unused local var.
12524
12525 * filelock.c (within_one_second): Now static.
12526 (lock_file_1): Rename local to avoid shadowing.
12527
12528 * buffer.c (fix_overlays_before): Mark locals as initialized.
12529 (fix_start_end_in_overlays): Likewise. This function should be
12530 simplified by using pointers-to-pointers, but that's a different
12531 matter.
12532 (switch_to_buffer_1): Now static.
12533 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
12534 (report_overlay_modification): Rename locals to avoid shadowing.
12535
12536 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
12537 Fix pointer signedness issue.
12538 (sys_subshell): Mark local as volatile if checking for lint,
12539 to suppress a gcc -Wclobbered warning that does not seem to be right.
12540 (MAXPATHLEN): Define only if needed.
12541
12542 * process.c (serial_open, serial_configure): Move decls from here ...
12543 * systty.h: ... to here, so that they can be checked.
12544
12545 * fns.c (get_random, seed_random): Move extern decls from here ...
12546 * lisp.h: ... to here, so that they can be checked.
12547
12548 * sysdep.c (reset_io): Now static.
12549 (wait_for_termination_signal): Remove; unused.
12550
12551 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
12552 (copy_keymap_item, append_key, push_text_char_description):
12553 Now static.
12554 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
12555 (DENSE_TABLE_SIZE): Remove; unused.
12556 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
12557 (describe_map_tree):
12558 Rename locals to avoid shadowing.
12559
12560 * keyboard.c: Declare functions static if they are not used elsewhere.
12561 (echo_char, echo_dash, cmd_error, top_level_2):
12562 (poll_for_input, handle_async_input): Now static.
12563 (read_char, kbd_buffer_get_event, make_lispy_position):
12564 (make_lispy_event, make_lispy_movement, apply_modifiers):
12565 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
12566 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
12567 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
12568 (read_key_sequence, read_char): Mark locals as initialized.
12569 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
12570
12571 * keyboard.h (make_ctrl_char): New decl.
12572 (mark_kboards): Move decl here ...
12573 * alloc.c (mark_kboards): ... from here.
12574
12575 * lisp.h (force_auto_save_soon): New decl.
12576
12577 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
12578 (DEFINE_DUMMY_FUNCTION): New macro.
12579 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
12580 Use it.
12581 (main): Add casts to avoid warnings
12582 if GCC considers string literals to be constants.
12583
12584 * lisp.h (fatal_error_signal): Add decl, since it's exported.
12585
12586 * dbusbind.c: Pointer signedness fixes.
12587 (xd_signature, xd_append_arg, xd_initialize):
12588 (Fdbus_call_method, Fdbus_call_method_asynchronously):
12589 (Fdbus_method_return_internal, Fdbus_method_error_internal):
12590 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
12591 (Fdbus_register_signal): Use SSDATA when the context wants char *.
12592
12593 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
12594 if GCC considers string literals to be constants.
12595 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
12596
12597 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
12598
12599 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
12600 (print_preprocess, print_object): New macro to fix last change.
12601
12602 * print.c (print_preprocess): Don't forget font objects.
12603
12604 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
12605
12606 * emacs.c (USAGE3): Doc fixes.
12607
12608 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
12609
12610 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
12611 structure.
12612
12613 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
12614
12615 * lisp.h (VWindow_system, Qfile_name_history):
12616 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
12617 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
12618 (w32_system_caret_x, w32_system_caret_y): Declare extern.
12619
12620 * w32select.c: Don't #include "keyboard.h".
12621 (run_protected): Add extern declaration for waiting_for_input.
12622
12623 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
12624 * w32console.c (detect_input_pending, read_input_pending)
12625 (encode_terminal_code):
12626 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
12627 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
12628 (w32_system_caret_y, Qfile_name_history):
12629 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
12630 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
12631 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
12632 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
12633 * w32proc.c (Qlocal, report_file_error):
12634 * w32term.c (Vwindow_system, updating_frame):
12635 * w32uniscribe.c (initialized, uniscribe_font_driver):
12636 Remove unneeded extern declarations.
12637
12638 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
12639
12640 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
12641
12642 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
12643
12644 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
12645 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
12646 These macros can no longer be used for assignment.
12647
12648 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
12649 Assign struct members directly, instead of using BUF_BEGV etc.
12650 (record_buffer_markers, fetch_buffer_markers): New functions for
12651 recording and fetching special buffer markers.
12652 (set_buffer_internal_1, set_buffer_temp): Use them.
12653
12654 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
12655
12656 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
12657
12658 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
12659 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
12660
12661 * xdisp.c (hscroll_window_tree):
12662 (reconsider_clip_changes): Use PT instead of BUF_PT.
12663
12664 2011-03-13 Eli Zaretskii <eliz@gnu.org>
12665
12666 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
12667 $(EMACS_ROOT)/lib/intprops.h.
12668
12669 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
12670
12671 Fix more problems found by GCC 4.5.2's static checks.
12672
12673 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
12674 to unsigned char * to avoid compiler diagnostic.
12675 (xg_free_frame_widgets): Make it clear that a local variable is
12676 needed only if USE_GTK_TOOLTIP.
12677 (gdk_window_get_screen): Make it clear that this macro is needed
12678 only if USE_GTK_TOOLTIP.
12679 (int_gtk_range_get_value): New function, which avoids a diagnostic
12680 from gcc -Wbad-function-cast.
12681 (xg_set_toolkit_scroll_bar_thumb): Use it.
12682 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
12683 diagnostic from gcc -Wbad-function-cast.
12684 (get_utf8_string, xg_get_file_with_chooser):
12685 Rename locals to avoid shadowing.
12686 (create_dialog): Move locals to avoid shadowing.
12687
12688 * xgselect.c (xg_select): Remove unused var.
12689
12690 * image.c (four_corners_best): Mark locals as initialized.
12691 (gif_load): Initialize transparent_p to zero (Bug#8238).
12692 Mark another local as initialized.
12693 (my_png_error, my_error_exit): Mark with NO_RETURN.
12694
12695 * image.c (clear_image_cache): Now static.
12696 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
12697 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
12698 (x_edge_detection): Remove unnecessary cast that
12699 gcc -Wbad-function-cast diagnoses.
12700 (gif_load): Fix pointer signedness.
12701 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
12702 (jpeg_load, gif_load): Rename locals to avoid shadowing.
12703
12704 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
12705
12706 Improve quality of tests for time stamp overflow.
12707 For example, without this patch (encode-time 0 0 0 1 1
12708 1152921504606846976) returns the obviously-bogus value (-948597
12709 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
12710 reports time overflow. See
12711 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
12712 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
12713 * editfns.c: Include limits.h and intprops.h.
12714 (TIME_T_MIN, TIME_T_MAX): New macros.
12715 (time_overflow): Move earlier, to before first use.
12716 (hi_time, lo_time): New functions, for an accurate test for
12717 out-of-range times.
12718 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
12719 (Fget_internal_run_time): Don't assume time_t fits in int.
12720 (make_time): Use list2 instead of Fcons twice.
12721 (Fdecode_time): More accurate test for out-of-range times.
12722 (check_tm_member): New function.
12723 (Fencode_time): Use it, to test for out-of-range times.
12724 (lisp_time_argument): Don't rely on undefined left-shift and
12725 right-shift behavior when checking for time stamp overflow.
12726
12727 * editfns.c (time_overflow): New function, refactoring common code.
12728 (Fformat_time_string, Fdecode_time, Fencode_time):
12729 (Fcurrent_time_string): Use it.
12730
12731 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
12732 * dired.c (make_time): Move to ...
12733 * editfns.c (make_time): ... here.
12734 * systime.h: Note the move.
12735
12736 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12737
12738 * fringe.c (update_window_fringes): Remove unused variables.
12739
12740 * unexmacosx.c (copy_data_segment): Also copy __got section.
12741 (Bug#8223)
12742
12743 2011-03-12 Eli Zaretskii <eliz@gnu.org>
12744
12745 * termcap.c [MSDOS]: Include "msdos.h".
12746 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
12747 Constify `char *' arguments and their references according to
12748 prototypes in tparam.h.
12749
12750 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
12751
12752 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
12753 Adapt all references accordingly.
12754
12755 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
12756
12757 2011-03-11 Tom Tromey <tromey@redhat.com>
12758
12759 * buffer.c (syms_of_buffer): Remove obsolete comment.
12760
12761 2011-03-11 Eli Zaretskii <eliz@gnu.org>
12762
12763 * termhooks.h (encode_terminal_code): Declare prototype.
12764
12765 * msdos.c (encode_terminal_code): Don't declare prototype.
12766
12767 * term.c (encode_terminal_code): Now external again, used by
12768 w32console.c and msdos.c.
12769
12770 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
12771 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
12772
12773 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
12774
12775 Fix some minor problems found by GCC 4.5.2's static checks.
12776
12777 * fringe.c (update_window_fringes): Mark locals as initialized
12778 (Bug#8227).
12779 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
12780
12781 * alloc.c (mark_fringe_data): Move decl from here ...
12782 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
12783 to check its interface.
12784 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
12785
12786 * fontset.c (free_realized_fontset): Now static.
12787 (Fset_fontset_font): Rename local to avoid shadowing.
12788 (fontset_font): Mark local as initialized.
12789 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
12790
12791 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
12792
12793 * xselect.c (x_disown_buffer_selections): Remove; not used.
12794 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
12795 (x_own_selection, Fx_disown_selection_internal): Rename locals
12796 to avoid shadowing.
12797 (x_handle_dnd_message): Remove local to avoid shadowing.
12798
12799 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
12800 so that the caller can use some name other than gcpro1.
12801 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
12802 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
12803 (Fx_backspace_delete_keys_p):
12804 Use them to avoid shadowing, and rename vars to avoid shadowing.
12805 (x_decode_color, x_set_name, x_window): Now static.
12806 (Fx_create_frame): Add braces to silence GCC warning.
12807 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
12808 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
12809 Remove unused locals.
12810 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
12811 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
12812 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
12813 macros.
12814
12815 * xterm.h (x_mouse_leave): New decl.
12816
12817 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
12818 Remove unused functions.
12819 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
12820 (x_calc_absolute_position): Now static.
12821 (XTread_socket): Don't define label "out" unless it's used.
12822 Don't declare local "event" unless it's used.
12823 (x_iconify_frame, x_free_frame_resources): Don't declare locals
12824 unless they are used.
12825 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
12826 (x_fatal_error_signal): Remove; not used.
12827 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
12828 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
12829 (x_error_catcher, x_connection_closed, x_error_handler):
12830 (x_error_quitter, xembed_send_message, x_iconify_frame):
12831 (my_log_handler): Rename locals to avoid shadowing.
12832 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
12833 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
12834
12835 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
12836 Rename or move locals to avoid shadowing.
12837 (tty_defined_color, merge_face_heights): Now static.
12838 (free_realized_faces_for_fontset): Remove; not used.
12839 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
12840 does not deduce is never used uninitialized.
12841 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
12842 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
12843
12844 * terminal.c (store_terminal_param): Now static.
12845
12846 * xmenu.c (menu_highlight_callback): Now static.
12847 (set_frame_menubar): Remove unused local.
12848 (xmenu_show): Rename parameter to avoid shadowing.
12849 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
12850 since they might point to immutable storage.
12851 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
12852 since it's unused otherwise.
12853
12854 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
12855 Add a FIXME, since the code still doesn't look right. (Bug#8215)
12856 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
12857 avoids a gcc -Wuninitialized diagnostic.
12858 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
12859 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
12860 does not deduce are never used uninitialized.
12861
12862 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
12863
12864 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
12865 * window.c (window_loop, size_window):
12866 (run_window_configuration_change_hook, enlarge_window): Likewise.
12867
12868 * window.c (display_buffer): Now static.
12869 (size_window): Mark variables that gcc -Wuninitialized
12870 does not deduce are never used uninitialized.
12871 * window.h (check_all_windows): New decl, to forestall
12872 gcc -Wmissing-prototypes diagnostic.
12873 * dispextern.h (bidi_dump_cached_states): Likewise.
12874
12875 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
12876 shadowing.
12877 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
12878 Include <limits.h>.
12879 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
12880 and to avoid gcc -Wuninitialized warning.
12881 (load_charset_map): Mark variables that gcc -Wuninitialized
12882 does not deduce are never used uninitialized.
12883 (load_charset): Abort instead of using uninitialized var (Bug#8229).
12884
12885 * coding.c (coding_set_source, coding_set_destination):
12886 Use "else { /* comment */ }" rather than "else /* comment */;"
12887 for clarity, and to avoid gcc -Wempty-body warning.
12888 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
12889 a block, when the outer 'i' will do.
12890 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
12891 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
12892 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
12893 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
12894 (Fdecode_sjis_char, Fdefine_coding_system_internal):
12895 Rename locals to avoid shadowing.
12896 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
12897 * coding.c (emacs_mule_char, encode_invocation_designation):
12898 Now static, since they're not used elsewhere.
12899 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
12900 (decode_coding_object, encode_coding_object, detect_coding_system):
12901 (decode_coding_emacs_mule): Mark variables that gcc
12902 -Wuninitialized does not deduce are never used uninitialized.
12903 (detect_coding_iso_2022): Initialize a local variable that might
12904 be used uninitialized. Leave a FIXME because it's not clear that
12905 this initialization is needed. (Bug#8211)
12906 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
12907 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
12908 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
12909 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
12910 Remove unused macros.
12911
12912 * category.c (hash_get_category_set): Remove unused local var.
12913 (copy_category_table): Now static, since it's not used elsewhere.
12914 * character.c (string_count_byte8): Likewise.
12915
12916 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
12917 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
12918
12919 * chartab.c (copy_sub_char_table): Now static, since it's not used
12920 elsewhere.
12921 (sub_char_table_ref_and_range, char_table_ref_and_range):
12922 Rename locals to avoid shadowing.
12923 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
12924
12925 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
12926 (BIDI_BOB): Remove unused macro.
12927
12928 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
12929 deduce are never used uninitialized.
12930 * term.c (encode_terminal_code): Likewise.
12931
12932 * term.c (encode_terminal_code): Now static. Remove unused local.
12933
12934 * tparam.h: New file.
12935 * term.c, tparam.h: Include it.
12936 * deps.mk (term.o, tparam.o): Depend on tparam.h.
12937 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
12938 Move these decls to tparam.h, and make them agree with what
12939 is actually in tparam.c. The previous trick of using incompatible
12940 decls in different modules does not conform to the C standard.
12941 All callers of tparam changed to use tparam's actual API.
12942 * tparam.c (tparam1, tparam, tgoto):
12943 Use const pointers where appropriate.
12944
12945 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
12946 * cm.h (struct cm): Likewise.
12947 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
12948 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
12949 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
12950 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
12951 (turn_on_face, init_tty): Likewise.
12952 * termchar.h (struct tty_display_info): Likewise.
12953
12954 * term.c (term_mouse_position): Rename local to avoid shadowing.
12955
12956 * alloc.c (mark_ttys): Move decl from here ...
12957 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
12958
12959 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
12960
12961 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
12962
12963 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
12964
12965 * search.c (compile_pattern_1): Remove argument regp, unused since
12966 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
12967 (compile_pattern): Don't pass it.
12968
12969 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
12970
12971 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
12972 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
12973 for ! HAVE_GTK3.
12974 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
12975
12976 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
12977
12978 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
12979 gdk_window_get_screen, gdk_window_get_geometry,
12980 gdk_x11_window_lookup_for_display and GDK_KEY_g.
12981 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
12982 (xg_get_pixbuf_from_pixmap): New function.
12983 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
12984 to Pixmap, take frame as parameter, remove GdkColormap parameter.
12985 Call xg_get_pixbuf_from_pixmap instead of
12986 gdk_pixbuf_get_from_drawable.
12987 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
12988 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
12989 (xg_check_special_colors): Use GtkStyleContext and its functions
12990 for HAVE_GTK3.
12991 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
12992 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
12993 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
12994 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
12995 Call gtk_widget_get_preferred_size.
12996 (xg_frame_resized): gdk_window_get_geometry only takes 5
12997 parameters.
12998 (xg_win_to_widget, xg_event_is_for_menubar):
12999 Call gdk_x11_window_lookup_for_display.
13000 (xg_set_widget_bg): New function.
13001 (delete_cb): New function.
13002 (xg_create_frame_widgets): Connect delete-event to delete_cb.
13003 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
13004 (xg_set_background_color): Call xg_set_widget_bg.
13005 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
13006 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
13007 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
13008 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
13009 if ! HAVE_GTK3.
13010 (update_frame_tool_bar): Call gtk_widget_hide.
13011 (xg_initialize): Use GDK_KEY_g.
13012
13013 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
13014 if ! HAVE_GTK3
13015 (x_session_initialize): Call gdk_x11_set_sm_client_id.
13016
13017 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
13018 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
13019 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
13020
13021 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
13022
13023 * w32xfns.c (select_palette): Check success of RealizePalette against
13024 GDI_ERROR, not zero.
13025
13026 See ChangeLog.11 for earlier changes.
13027
13028 ;; Local Variables:
13029 ;; coding: utf-8
13030 ;; End:
13031
13032 Copyright (C) 2011-2012 Free Software Foundation, Inc.
13033
13034 This file is part of GNU Emacs.
13035
13036 GNU Emacs is free software: you can redistribute it and/or modify
13037 it under the terms of the GNU General Public License as published by
13038 the Free Software Foundation, either version 3 of the License, or
13039 (at your option) any later version.
13040
13041 GNU Emacs is distributed in the hope that it will be useful,
13042 but WITHOUT ANY WARRANTY; without even the implied warranty of
13043 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13044 GNU General Public License for more details.
13045
13046 You should have received a copy of the GNU General Public License
13047 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.