Remove src/m/*.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
34374650
PE
12012-05-22 Paul Eggert <eggert@cs.ucla.edu>
2
3 Remove src/m/*.
4 This directory predates autoconf and is no longer needed nowadays.
5 Move its few remaining bits of functionality to where they're needed.
6 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
7 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
8 * m/template.h: Remove.
9 * Makefile.in (M_FILE): Remove. All uses removed.
10 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
11 * lisp.h (USE_LSB_TAG):
12 * mem-limits.h (EXCEEDS_LISP_PTR):
13 Use VAL_MAX, not VALBITS, in #if.
14 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
15 (EMACS_UINT): Define unconditionally now.
16 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
17 (BITS_PER_EMACS_INT): New constants, replacing
18 what used to be in config.h, but not useful in #if.
19 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
20 define them any more.
21 (VAL_MAX): New macro.
22 (VALMASK): Use it.
23 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
24 BITS_PER_EMACS_INT, in #if.
25 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
26 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
27 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
28 * s/ms-w32.h (DATA_START):
29 Move here from removed file m/intel386.h.
30 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
31 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
32
261cb4bb
PE
332012-05-21 Paul Eggert <eggert@cs.ucla.edu>
34
35 Assume C89 or later.
36 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
37 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
38 (xrealloc):
39 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
40 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
41 * textprop.c, tparam.c (NULL): Remove.
42 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
43 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
44 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
45 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
46 * xterm.c (input_signal_count): Assume volatile works.
47
ff23cd9f
KB
482012-05-21 Ken Brown <kbrown@cornell.edu>
49
50 * xgselect.c (xg_select): Fix first argument in call to 'select'
51 (bug#11508).
52
1b170bc6
KB
532012-05-20 Ken Brown <kbrown@cornell.edu>
54
55 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
56 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
57
b2f4d39f
KB
582012-05-19 Ken Brown <kbrown@cornell.edu>
59
60 * xfns.c (x_in_use): Remove `static' qualifier.
61 * xterm.h (x_in_use): Declare.
62 * xgselect.c: Include xterm.h.
63 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
64 and `display_arg' (bug#9754).
65
003fdae2
PE
662012-05-19 Paul Eggert <eggert@cs.ucla.edu>
67
9232a6d9
PE
68 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
69
003fdae2
PE
70 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
71 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
72
784b56e2
EZ
732012-05-18 Eli Zaretskii <eliz@gnu.org>
74
75 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
76
77 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
78 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c
79
80 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
81 reference to image_cache->refcount.
82 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
83
a0a79cde
JL
842012-05-17 Juri Linkov <juri@jurta.org>
85
86 * search.c (Fword_search_regexp, Fword_search_backward)
87 (Fword_search_forward, Fword_search_backward_lax)
88 (Fword_search_forward_lax): Move functions to isearch.el
89 (bug#10145, bug#11381).
90
b0572523
PE
912012-05-16 Paul Eggert <eggert@cs.ucla.edu>
92
93 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
94
9660f5fc
SM
952012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
96
97 * lread.c (init_obarray): Declare Qt and Qnil as special.
98
4374de83
GM
992012-05-14 Glenn Morris <rgm@gnu.org>
100
101 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 102 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 103
dc44c39a
PE
1042012-05-14 Paul Eggert <eggert@cs.ucla.edu>
105
078c97cb
PE
106 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
107
dc44c39a
PE
108 * unexaix.c: Port to more-recent AIX compilers.
109 (report_error, report_error_1, make_hdr, copy_sym)
110 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
111 Make arguments const char *, not char *, to avoid violations of C
112 standard and to fix some AIX warnings reported by Gilles Pion.
113
e18afed7 1142012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
115
116 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
117 already have overlays loaded.
118 (handle_single_display_spec): Before returning without displaying
119 fringe bitmap, synchronize the bidi iterator with the main display
120 iterator, by calling iterate_out_of_display_property.
121 (iterate_out_of_display_property): Detect buffer iteration by
122 testing that it->string is a Lisp string.
123 (get_next_display_element): When the current object is exhausted,
124 and there's something on it->stack, call set_iterator_to_next to
125 proceed with what's on the stack, instead of returning zero.
126 (set_iterator_to_next): If called at the end of a Lisp string,
127 proceed to consider_string_end without incrementing string
128 position. Don't increment display vector index past the end of
129 the display vector. (Bug#11417)
c8fb9dc6
EZ
130 (pos_visible_p): Don't report a position visible when move_it_to
131 stopped at the last line of window, which happens to be scanned
132 backwards by the bidi iteration. (Bug#11464)
ac268e67 133
e18afed7 1342012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
135
136 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
137 and right-margin display specs even if the spec is invalid or we
138 are on a TTY, and thus unable to display on the fringes. That's
139 because the text with the property will not be displayed anyway,
140 so we need to signal to the caller that this is a "replacing"
141 display spec. This fixes display when the spec is invalid or we
142 are on a TTY.
143
e18afed7 1442012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
145
146 * unexaix.c (make_hdr): Fix typo in prototype.
147 This bug broke the build on AIX. Problem reported by Gilles Pion.
148
9d0a235a
MA
1492012-05-14 Michael Albinus <michael.albinus@gmx.de>
150
151 * keyboard.c (kbd_buffer_get_event): Read special events also in
152 batch mode. (Bug#11415)
153
9e6b06ed
GM
1542012-05-12 Glenn Morris <rgm@gnu.org>
155
156 * ns.mk: Update for ns_appbindir no longer having trailing "/".
157
c1a1d7a3
EZ
1582012-05-12 Eli Zaretskii <eliz@gnu.org>
159
160 * lisp.mk (lisp): Add newcomment.elc.
161
3fe7cdc8
GM
1622012-05-12 Glenn Morris <rgm@gnu.org>
163
164 * Makefile.in (MKDIR_P): New, set by configure.
165 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
166
53f7d2c0
PE
1672012-05-11 Paul Eggert <eggert@cs.ucla.edu>
168
169 Remove unused function hourglass_started.
170 * dispextern.h (hourglass_started):
171 * w32fns.c (hourglass_started):
172 * xdisp.c (hourglass_started): Remove.
173
75aafb17
JB
1742012-05-10 Juanma Barranquero <lekktu@gmail.com>
175
176 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
177 Update dependencies.
178
12959e8e
PE
1792012-05-10 Paul Eggert <eggert@cs.ucla.edu>
180
97107e2e
PE
181 * xgselect.c (xg_select): Put maxfds+1 into a var.
182 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
183
12959e8e
PE
184 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
185
836d29b3
DA
1862012-05-10 Dave Abrahams <dave@boostpro.com>
187
188 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
189 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
190
5cb67954
MA
1912012-05-09 Michael Albinus <michael.albinus@gmx.de>
192
193 * dbusbind.c (xd_registered_buses): New internal Lisp object.
194 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
195 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
196 Initialize xd_registered_buses.
197
3478ec45
PE
1982012-05-09 Paul Eggert <eggert@cs.ucla.edu>
199
b263a6b0
PE
200 Untag more efficiently if USE_LSB_TAG.
201 This is based on a proposal by YAMAMOTO Mitsuharu in
202 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
203 For an admittedly artificial (nth 8000 longlist) benchmark on
204 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
205 Emacs's overall text size by 1%.
206 * lisp.h (XUNTAG): New macro.
207 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
208 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
209 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
210 * eval.c (Fautoload):
211 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
212 * frame.h (XFRAME): Use XUNTAG.
213
3478ec45
PE
214 Port recent dbusbind.c changes to 32-bit --with-wide-int.
215 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
216 Remove unportable assumptions about print widths of types like
217 dbus_uint32_t.
218 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
219 intptr_t when converting between pointer and integer, to avoid GCC
220 warnings about wrong width.
221
666b903b 2222012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
223
224 * w32proc.c (new_child): Force Windows to reserve only 64KB of
225 stack for each reader_thread, instead of defaulting to 8MB
226 determined by the linker. This avoids failures in creating
227 subprocesses on Windows 7, see the discussion in this thread:
228 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
229
b120cc17
JC
2302012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
231
232 Fix up display of the *Minibuf-0* buffer in the mini window.
233 * keyboard.c (read_char): Don't clear the echo area if there's no
234 message to clear.
235 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 236 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 237
9a4b36f8
MA
2382012-05-07 Michael Albinus <michael.albinus@gmx.de>
239
240 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
241 batch mode.
242
e5f9458f
CY
2432012-05-06 Chong Yidong <cyd@gnu.org>
244
245 * lisp.mk (lisp): Update.
246
eceeb5fc 2472012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
248
249 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
250
71873e2b
SM
2512012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
252
253 * data.c (PUT_ERROR): New macro.
254 (syms_of_data): Use it. Add new error type `user-error'.
255 * undo.c (user_error): New function.
256 (Fprimitive_undo): Use it.
257 * print.c (print_error_message): Adjust print style for `user-error'.
258 * keyboard.c (user_error): New function.
259 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
260
ab0fa4e4
PE
2612012-05-03 Paul Eggert <eggert@cs.ucla.edu>
262
263 Do not limit current-time-string to years 1000..9999.
264 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
265 (Fcurrent_time_string): Support any year that is supported by the
266 underlying localtime representation. Don't use asctime, as it
267 has undefined behavior for years outside the range -999..9999.
268
7ed806a7
PE
2692012-05-02 Paul Eggert <eggert@cs.ucla.edu>
270
271 Fix race conditions involving setenv, gmtime, localtime, asctime.
272 Without this fix, interrupts could mess up code that uses these
273 nonreentrant functions, since setting TZ invalidates existing
274 tm_zone or tzname values, and since most of these functions return
275 pointers to static storage.
276 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
277 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
278 Grow the critical sections to include not just invoking
279 localtime/gmtime, but also accessing these functions' results
280 including their tm_zone values if any, and any related TZ setting.
281 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
282 so that the struct tm is saved in the critical section.
283 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
284 motivated by the fact that memory allocation needs to be outside
285 the critical section.
286
0c16dfed
DA
2872012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
288
289 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
290 with RESET_INTERVAL.
291
292 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
293 Remove duplicated buffer name initialization.
294
3f83ace8
JM
2952012-05-02 Jim Meyering <jim@meyering.net>
296
297 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
298
c7b8541e
JM
299 * xfns.c (x_window): Use xstrdup (Bug#11375).
300
90207a15 3012012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
302
303 * xdisp.c (pos_visible_p): If already at a newline from the
304 display string before the 'while' loop, don't walk back the glyphs
305 from it3.glyph_row. Solves assertion violation when the display
306 string begins with a newline (egg.el). (Bug#11367)
307
b593d6a9
AH
3082012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
309
310 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
311 Move to simple.el.
312
4737362e
GM
3132012-05-01 Glenn Morris <rgm@gnu.org>
314
99cf43f9
GM
315 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
316 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
317 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
318 All were removed before 23.1.
319
9311dcff
GM
320 * dispnew.c: Remove HAVE_LIBNCURSES test;
321 it is always true on relevant platforms.
322
4d5c6349
GM
323 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
324 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
325
4737362e
GM
326 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
327
74dd3a6b
AS
3282012-04-30 Andreas Schwab <schwab@linux-m68k.org>
329
330 * .gdbinit (xpr): Remove checks for no longer existing misc types.
331 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
332 Remove.
333
13c379ee
PE
3342012-04-28 Paul Eggert <eggert@cs.ucla.edu>
335
336 Do not avoid creating empty evaporating overlays (Bug#9642).
337 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
338 That is, do not delete an evaporating overlay if it becomes
339 empty after its bounds are adjusted to fit within its buffer.
340 This fix caused other problems, and I'm reverting it until we get
341 to the bottom of them.
342
a8e7d6d7 3432012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
344
345 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
346
a8e7d6d7 3472012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
348
349 * xdisp.c (pos_visible_p): If the window start position is beyond
350 ZV, start the display from buffer beginning. Prevents assertion
351 violation in init_iterator when the minibuffer window is scrolled
352 via the scroll bar.
353
354 * window.c (window_scroll_pixel_based): Likewise.
355
a8e7d6d7 3562012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
357
358 * keymap.c (where_is_internal): Doc fix (Bug#10872).
359
a8e7d6d7 3602012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
361
362 * fileio.c (Fcopy_file, Fset_file_selinux_context):
363 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
364
a8e7d6d7 3652012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 366
b593d6a9
AH
367 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
368 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 369
1c6900d9
EZ
3702012-04-26 Eli Zaretskii <eliz@gnu.org>
371
4c3fa1d9
EZ
372 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
373 display element, check also the underlying string or buffer
374 character. (Bug#11341)
375
1c6900d9
EZ
376 * w32menu.c: Include w32heap.h.
377 (add_menu_item): If the call to AppendMenuW (via
378 unicode_append_menu) fails, disable Unicode menus only if we are
379 running on Windows 9X/Me.
380
42bf8205
AS
3812012-04-24 Andreas Schwab <schwab@linux-m68k.org>
382
383 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
384 (xgetint): Add missing shift for LSB tags.
385
b1bac16e
MR
3862012-04-24 Martin Rudalics <rudalics@gmx.at>
387
388 * keyboard.c (read_char): Don't wipe echo area for select window
389 events: These might get delayed via `mouse-autoselect-window'
390 (Bug#11304).
391
d69621cc
JB
3922012-04-24 Juanma Barranquero <lekktu@gmail.com>
393
394 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
395 manipulation of :loaded-from data.
396
02fd101b
JB
3972012-04-23 Juanma Barranquero <lekktu@gmail.com>
398
399 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
400 now a cons (bug#11311).
401
888bec30
PE
4022012-04-23 Paul Eggert <eggert@cs.ucla.edu>
403
89a438bd
PE
404 Do not create empty overlays with the evaporate property (Bug#9642).
405 * buffer.c (Fmove_overlay): Delete an evaporating overlay
406 if it becomes empty after its bounds are adjusted to fit within
407 its buffer. Without this fix, in a nonempty buffer (let ((o
408 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
409 yields an empty overlay that has the evaporate property, which is
410 not supposed to happen.
411
1068fe4d
PE
412 Fix minor GTK3 problems found by static checking.
413 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
414 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
415 (struct _EmacsFixedClass, emacs_fixed_get_type):
416 Move decls here from emacsgtkfixed.h, since they needn't be public.
417 (emacs_fixed_get_type): Now static.
418 (emacs_fixed_class_init): Omit unused local.
419 (emacs_fixed_child_type): Remove; unused.
420 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
421 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
422 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
423 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
424 (EMACS_FIXED_GET_CLASS): Remove; unused.
425 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
426
888bec30
PE
427 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
428 Problem reported by Juanma Barranquero for Windows -Wunused-function.
429
de85e130
PE
4302012-04-22 Paul Eggert <eggert@cs.ucla.edu>
431
d0baac98
PE
432 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
433 * gmalloc.c: (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
434 (__malloc_size_t, __malloc_ptrdiff_t):
435 Remove. All uses removed, replaced by the definiens if needed,
436 since we can assume C89 or better now.
437 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
438 (protect_malloc_state, align, get_contiguous_space)
439 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
440 (malloc_atfork_handler_child, malloc_enable_thread)
441 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
442 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
443 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
444 (special_realloc, _realloc_internal_nolock, _realloc_internal)
445 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
446 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
447 Define using prototypes, not old style.
448 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
449 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
450 (align): Don't assume that signed integer overflow wraps around.
451 Omit unused local var.
452 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
453 (_free_internal_nolock, memalign, mallochook, reallochook):
454 Omit no-longer-needed casts.
455 (valloc): Use getpagesize, not __getpagesize.
456 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
457 (struct hdr): The 'magic' member is now size_t, not unsigned long.
458
de85e130
PE
459 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
460
dcbf5805
MA
4612012-04-22 Michael Albinus <michael.albinus@gmx.de>
462
463 Move functions from C to Lisp. Make non-blocking method calls
464 the default. Implement further D-Bus standard interfaces.
465
466 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
467 (QCdbus_request_name_allow_replacement)
468 (QCdbus_request_name_replace_existing)
469 (QCdbus_request_name_do_not_queue)
470 (QCdbus_request_name_reply_primary_owner)
471 (QCdbus_request_name_reply_in_queue)
472 (QCdbus_request_name_reply_exists)
473 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
474 (QCdbus_registered_serial, QCdbus_registered_method)
475 (QCdbus_registered_signal): New Lisp objects.
476 (XD_DEBUG_MESSAGE): Use sizeof.
477 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
478 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
479 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
480 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
481 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
482 (xd_signature, xd_append_arg): Allow float for integer types.
483 (xd_get_connection_references): New function.
b593d6a9
AH
484 (xd_get_connection_address): Rename from xd_initialize.
485 Return cached address.
dcbf5805
MA
486 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
487 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
488 level.
489 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 490 Return number of refcounts.
dcbf5805
MA
491 (Fdbus_get_unique_name): Make stronger parameter check.
492 (Fdbus_message_internal): New defun.
493 (Fdbus_call_method, Fdbus_call_method_asynchronously)
494 (Fdbus_method_return_internal, Fdbus_method_error_internal)
495 (Fdbus_send_signal, Fdbus_register_service)
496 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
497 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
498 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
499 (Vdbus_compiled_version, Vdbus_runtime_version)
500 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
501 (Vdbus_message_type_method_return, Vdbus_message_type_error)
502 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
503 (Vdbus_registered_buses, Vdbus_registered_objects_table):
504 Adapt docstring.
dcbf5805 505
52828e02
PE
5062012-04-22 Paul Eggert <eggert@cs.ucla.edu>
507
da05bc4c
PE
508 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
509 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
510 Do not assume ptrdiff_t is the same width as 'int'.
511
52828e02
PE
512 * alloc.c: Handle unusual debugging option combinations.
513 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
514 since the two debugging options are incompatible.
515 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
516 is defined.
517 (mem_init, mem_insert, mem_insert_fixup):
518 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
519 (NEED_MEM_INSERT): Remove; no longer needed.
520
f01769f9
LL
5212012-04-22 Leo Liu <sdl.web@gmail.com>
522
523 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
524
5790543d
PE
5252012-04-22 Paul Eggert <eggert@cs.ucla.edu>
526
527 * sysdep.c [__FreeBSD__]: Minor cleanups.
528 (list_system_processes, system_process_attributes) [__FreeBSD__]:
529 Use Emacs indenting style more consistently. Avoid some casts.
530 Use 'double' consistently rather than mixing 'float' and 'double'.
531
b91b7e4d
EW
5322012-04-21 Eduard Wiebe <usenet@pusto.de>
533
b593d6a9
AH
534 * sysdep.c (list_system_processes, system_process_attributes):
535 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 536
6114eb15
AS
5372012-04-21 Andreas Schwab <schwab@linux-m68k.org>
538
539 * lisp.mk (lisp): Update.
540
2f38dff7
PE
5412012-04-20 Paul Eggert <eggert@cs.ucla.edu>
542
543 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
544 It is never used otherwise.
545
4ae29f89
SM
5462012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
547
548 * print.c (print_preprocess): Only check print_depth if print-circle
549 is nil.
550 (print_object): Check for cycles even when print-circle is nil and
551 print-gensym is t, but only check print_depth if print-circle is nil.
552
f30d612a
CY
5532012-04-20 Chong Yidong <cyd@gnu.org>
554
555 * process.c (wait_reading_process_output): If EIO occurs on a pty,
556 set the status to "failed" and ensure that sentinel is run.
557
c07a4c0b 5582012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
559
560 * process.c (Fset_process_inherit_coding_system_flag)
561 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 562 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 563
c07a4c0b 5642012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
565
566 * xdisp.c (string_buffer_position_lim): Limit starting position to
567 BEGV.
568 (set_cursor_from_row): If called for a mode-line or header-line
569 row, return zero immediately.
570 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
571 farther than the first row after the header line, if any.
572 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
573 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
574
c07a4c0b 5752012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 576
4ae29f89
SM
577 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
578 (bug#11238).
ad3a2b41 579
c07a4c0b 5802012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 5812012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
582
583 configure: new option --enable-gcc-warnings (Bug#11207)
584 * Makefile.in (C_WARNINGS_SWITCH): Remove.
585 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
586 (ALL_CFLAGS): Use new macros rather than old.
587 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
588 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
589 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
590 -Wunused-result, -Wunused-variable. This should go away once
591 the Emacs and Gnulib regex code is merged.
592 (xmalloc, xrealloc): Now static.
593
aba027e8
PE
5942012-04-17 Paul Eggert <eggert@cs.ucla.edu>
595
596 * dired.c (Fsystem_groups): Remove unused local.
597
e5a36063
GM
5982012-04-17 Glenn Morris <rgm@gnu.org>
599
600 * dired.c (Fsystem_users): Doc fix.
601
316411f0
DA
6022012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
603
604 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
605 (syms_of_dired): Add them.
606
9426aba4
PE
6072012-04-16 Paul Eggert <eggert@cs.ucla.edu>
608
b62a57be
PE
609 Fix minor alloc.c problems found by static checking.
610 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
611 New extern decls, to avoid calling undeclared functions.
612 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
613 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
614 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
615 (NEED_MEM_INSERT): New macro.
616 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 617 Remove one incorrect comment and fix another.
b62a57be 618
3539f31f
PE
619 Fix minor ralloc.c problems found by static checking.
620 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
621 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
622 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
623 (r_alloc_sbrk): Now static.
624
a041960a
PE
625 Improve ralloc.c interface checking.
626 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
627 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
628 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
629 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
630 [REL_ALLOC]: ... to here, to check interface.
631 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
632 Remove decls. This fixes an "It stinks!".
633
9426aba4
PE
634 * alloc.c (which_symbols): Fix alignment issue / type clash.
635
d55c12ed
AS
6362012-04-15 Andreas Schwab <schwab@linux-m68k.org>
637
638 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
639 (struct Lisp_Misc_Any): Likewise.
640 (struct Lisp_Free): Likewise.
641 * alloc.c (union aligned_Lisp_Symbol): Define.
642 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
643 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
644 (union aligned_Lisp_Misc): Define.
645 (MARKER_BLOCK_SIZE, struct marker_block): Use union
646 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 647 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 648
b948ce8b
PE
6492012-04-14 Paul Eggert <eggert@cs.ucla.edu>
650
651 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
652 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
653 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
654 * s/netbsd.h, s/sol2-6.h:
655 Remove definition of GC_MARK_STACK, since the default now works.
656 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
657 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
658 no longer the default.
659 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
660
35dc09a1 6612012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 662
35dc09a1
GM
663 * lread.c (lisp_file_lexically_bound_p):
664 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 665
35dc09a1
GM
6662012-04-14 Eli Zaretskii <eliz@gnu.org>
667
668 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
669 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
670
6712012-04-14 Jan Djärv <jan.h.d@swipnet.se>
672
673 * nsterm.m (constrainFrameRect): Always constrain when there is only
674 one screen (Bug#10962).
675
bcd86815
KB
6762012-04-13 Ken Brown <kbrown@cornell.edu>
677
678 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
679
c25df26e
RT
6802012-04-13 Reuben Thomas <rrt@sc3d.org>
681
682 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
683
0fc59f1e
DC
6842012-04-11 Daniel Colascione <dancol@dancol.org>
685
686 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
687 against is gone. It's better to use vfork now so that when Cygwin
688 gains a new, working vfork, we use it automatically (bug#10398).
689
de8c03dc
SM
6902012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
691
692 * window.c (save_window_save): Obey window-point-insertion-type.
693
2f097256
GM
6942012-04-11 Glenn Morris <rgm@gnu.org>
695
696 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
697
453b951e
SM
6982012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
699
700 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
701
75f1671a 7022012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
703
704 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
705 (force_quit_count): New var.
706 (handle_interrupt): Use it.
707
2a8ce227
JB
7082012-04-10 Juanma Barranquero <lekktu@gmail.com>
709
710 * w32.c (w32_delayed_load): Record the full path of the library
711 being loaded (bug#10424).
712
935396c0
GM
7132012-04-09 Glenn Morris <rgm@gnu.org>
714
05920a43
GM
715 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
716 not just in the obarray, before snarfing them. (Bug#11036)
717
935396c0
GM
718 * Makefile.in ($(leimdir)/leim-list.el):
719 Pass EMACS rather than BUILT_EMACS.
720
a18ecafa
TZ
7212012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
722
723 * process.c (make_process):
724 * process.h: Add integer `gnutls_handshakes_tried' member to
725 process struct.
726
6bbef4e5
JC
727 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
728 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
729
730 * gnutls.c (gnutls_log_function2i): Convenience log function.
731 (emacs_gnutls_read): Use new log functions,
732 `gnutls_handshakes_tried' process member, and
733 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
734 attempts per process (connection).
735
b4d3bc10
CY
7362012-04-09 Chong Yidong <cyd@gnu.org>
737
738 * eval.c (Fuser_variable_p, user_variable_p_eh)
739 (lisp_indirect_variable): Functions deleted.
740 (Fdefvar): Caller changed.
741
742 * callint.c (Finteractive, Fcall_interactively):
743 * minibuf.c (Fread_variable): Callers changed.
744
70f4d973
EZ
7452012-04-09 Eli Zaretskii <eliz@gnu.org>
746
747 * xdisp.c (set_cursor_from_row): If the display string appears in
748 the buffer at position that is closer to point than the position
749 after the display string, display the cursor on the first glyph of
750 the display string. Fixes cursor display when a 'display' text
751 property immediately follows invisible text. (Bug#11094)
752
cb3c2e3e
PE
7532012-04-09 Paul Eggert <eggert@cs.ucla.edu>
754
755 composite.c: use 'double' consistently
756 * composite.c (get_composition_id): Use 'double' consistently
757 instead of converting 'float' to 'double' and vice versa; this is
758 easier to understand and avoids a GCC warning.
759
fd06db5d
GM
7602012-04-09 Glenn Morris <rgm@gnu.org>
761
50fe702a
GM
762 * Makefile.in: Generate leim-list with bootstrap-emacs, in
763 preparation for dumping it with emacs. (Bug#4789)
764 (leimdir): New variable.
765 ($(leimdir)/leim-list.el): New rule.
766 (emacs$(EXEEXT)): Depend on leim-list.el.
767
fd06db5d
GM
768 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
769 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
770 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
771
55c131ee
AS
7722012-04-08 Andreas Schwab <schwab@linux-m68k.org>
773
774 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
775 proper alignment.
776
9209588f
JB
7772012-04-07 Juanma Barranquero <lekktu@gmail.com>
778
779 * xml.c (init_libxml2_functions) [WINDOWSNT]:
780 Remove unused local variable.
781
e3fb2efb
PE
7822012-04-07 Paul Eggert <eggert@cs.ucla.edu>
783
784 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
785 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
786 (mark_memory): Mark Lisp_Objects only if pointers might hide in
787 objects, as mark_maybe_pointer will catch them otherwise.
788 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
789 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
790
b5385551
PE
7912012-04-07 Paul Eggert <eggert@cs.ucla.edu>
792
793 Fix typo that broke non-Windows builds.
794 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
795
9078ead6
EZ
7962012-04-07 Eli Zaretskii <eliz@gnu.org>
797
798 Support building on MS-Windows with libxml2.
799
800 * makefile.w32-in (OBJ2): Add xml.$(O).
801 (GLOBAL_SOURCES): Add xml.c.
802 ($(BLD)/xml.$(O)): New dependency list.
803
804 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
805 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
806 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
807 [!WINDOWSNT]: New macros.
808 (init_libxml2_functions, libxml2_loaded_p): New functions.
809 (parse_region): Call fn_xmlCheckVersion instead of using the macro
810 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
811 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
812 Calls xmlCleanupParser only if libxml2 was loaded (or statically
813 linked in).
6bbef4e5
JC
814 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
815 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
816 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
817
818 * emacs.c: Don't include libxml/parser.h.
819 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
820 xmlCleanupParser directly.
821
822 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
823
3811fdf3
EZ
8242012-04-07 Eli Zaretskii <eliz@gnu.org>
825
826 * indent.c (Fvertical_motion): If there is a display string at
827 point, use it.vpos to compute how many lines to backtrack after
828 move_it_to point. (Bug#11133)
829
2f8e16b2
EZ
8302012-04-06 Eli Zaretskii <eliz@gnu.org>
831
832 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
833 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
834 about subtle differences between FETCH_CHAR* and STRING_CHAR*
835 macros related to unification of CJK characters. For the details,
836 see the discussion following the message here:
837 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
838
3d439cd1
CY
8392012-04-04 Chong Yidong <cyd@gnu.org>
840
841 * keyboard.c (Vdelayed_warnings_list): Doc fix.
842
8bc53d00
EZ
8432012-04-01 Eli Zaretskii <eliz@gnu.org>
844
845 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
846 instead of alloca. (Bug#11138)
847
3b0512a3
AS
8482012-04-01 Andreas Schwab <schwab@linux-m68k.org>
849
850 * w32menu.c (is_simple_dialog): Properly check lisp types.
851 (Bug#11141)
852
8427ddd2
EZ
8532012-03-31 Eli Zaretskii <eliz@gnu.org>
854
979022ef
EZ
855 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
856 position we get to after a call to move_it_to fails the
857 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
858 only if we wind up in a string from display property. (Bug#11063)
859
a6b1c7cc
EZ
860 * window.c (Fdelete_other_windows_internal): Invalidate the row
861 and column information about mouse highlight, so that redisplay
862 restores it after reallocating the glyph matrices. (Bug#7464)
863
8427ddd2
EZ
864 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
865 string comes from a `display' text property, use the buffer
866 position of that property as if we actually saw that position in
867 the row's glyphs.
697ba24b
EZ
868 (move_it_by_lines): Remove the assertion that
869 "it->current_x == 0 && it->hpos == 0" which can be legitimately
870 violated when there's a before-string at the beginning of a line.
871 (Bug#11063)
8427ddd2 872
65a0a738
EZ
8732012-03-30 Eli Zaretskii <eliz@gnu.org>
874
875 * xdisp.c (append_space_for_newline): If the default face was
876 remapped, use the remapped face for the appended newline.
877 (extend_face_to_end_of_line): Use the remapped default face for
878 extending the face to the end of the line.
879 (display_line): Call extend_face_to_end_of_line when the default
880 face was remapped. (Bug#11068)
881
581355cc
EZ
8822012-03-29 Eli Zaretskii <eliz@gnu.org>
883
884 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
885
e8fc049f
SM
8862012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
887
888 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
889
4fb9a543
GM
8902012-03-27 Glenn Morris <rgm@gnu.org>
891
892 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
893 Doc fixes.
894
679910f1
KH
8952012-03-26 Kenichi Handa <handa@m17n.org>
896
897 * dispextern.h (struct glyph): Fix previous change. Change the
898 bit length of glyphless.ch to 25 (Bug#11082).
899
90d49b7f
CY
9002012-03-26 Chong Yidong <cyd@gnu.org>
901
902 * keyboard.c (Vselection_inhibit_update_commands): New variable.
903 (command_loop_1): Use it; inhibit selection update for
904 handle-select-window too (Bug#8996).
905
f514f6f0
FP
9062012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
907
e8fc049f 908 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 909
bf43fa51
KH
9102012-03-25 Kenichi Handa <handa@m17n.org>
911
912 * dispextern.h (struct glyph): Change the bit length of
913 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
914
8a0c01dd
EZ
9152012-03-24 Eli Zaretskii <eliz@gnu.org>
916
917 * s/ms-w32.h (tzname): Include time.h before redirecting to
918 _tzname. Fixes the MSVC build. (Bug#9960)
919
7d1c3a76
AS
9202012-03-24 Andreas Schwab <schwab@linux-m68k.org>
921
8ed79523
AS
922 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
923 characters.
924
7d1c3a76
AS
925 * xterm.c (XTread_socket): Only modify handling_signal if
926 !SYNC_INPUT. (Bug#11080)
927
e99a9b8b
EZ
9282012-03-23 Eli Zaretskii <eliz@gnu.org>
929
930 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
931 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
932 when fetching a multibyte character consumes more bytes than
933 CHAR_BYTES returns, due to unification of CJK characters in
934 string_char. (Bug#11073)
935
5063c0e1
TN
9362012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
937
938 * process.c (wait_reading_process_output): Handle pty disconnect
939 by refraining from sending oneself a SIGCHLD (bug#10933).
940
9f851fbd
CY
9412012-03-22 Chong Yidong <cyd@gnu.org>
942
943 * dispextern.h (struct it): New member string_from_prefix_prop_p.
944
5063c0e1 945 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
946 Mark string as coming from a prefix property.
947 (handle_face_prop): Use default face for prefix strings (Bug#4281).
948 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
949
fb5b8aca
CY
9502012-03-21 Chong Yidong <cyd@gnu.org>
951
952 * xfaces.c (Vface_remapping_alist): Doc fix.
953
62356a1b
EZ
9542012-03-20 Eli Zaretskii <eliz@gnu.org>
955
956 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
957 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
958 Doc fixes.
62356a1b 959
025de85b
CY
9602012-03-20 Chong Yidong <cyd@gnu.org>
961
962 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
963 to reflect default non-nil value of redisplay-dont-pause.
964
4827f94e
KH
9652012-03-19 Kenichi Handa <handa@m17n.org>
966
967 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
968 it fit in a valid range (Bug#11003).
969
e50a24a2
EZ
9702012-03-18 Eli Zaretskii <eliz@gnu.org>
971
972 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
973 that is not from display property, accept the row as a "cursor
974 row" if one of the string's character has a non-nil `cursor'
975 property. Fixes cursor positioning when there are newlines in
976 overlay strings, e.g. in icomplete.el. (Bug#11035)
977
9af5ed87
PE
9782012-03-12 Paul Eggert <eggert@cs.ucla.edu>
979
980 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
981
d1f55f16
CY
9822012-03-12 Chong Yidong <cyd@gnu.org>
983
984 * eval.c (inhibit_lisp_code): Rename from
985 inhibit_window_configuration_change_hook; move from window.c.
986
987 * xfns.c (unwind_create_frame_1, Fx_create_frame):
988 * window.c (run_window_configuration_change_hook)
989 (syms_of_window): Callers changed.
990
66c5eebd
CY
9912012-03-11 Chong Yidong <cyd@gnu.org>
992
413df973
CY
993 * keymap.c (Fkey_description): Doc fix (Bug#9700).
994
66c5eebd
CY
995 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
996
1de11f56
CY
9972012-03-10 Chong Yidong <cyd@gnu.org>
998
999 * frame.c (other_visible_frames): Don't assume the selected frame
1000 is visible (Bug#10955).
1001
cae07000
SM
10022012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
1003
1004 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
1005
89c94350
JD
10062012-03-08 Jan Djärv <jan.h.d@swipnet.se>
1007
1008 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
1009 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
1010 zero (Bug#10954).
1011
999dd333
GM
10122012-03-03 Glenn Morris <rgm@gnu.org>
1013
01a6dcc8 1014 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 1015
de0100f2
EZ
10162012-03-02 Eli Zaretskii <eliz@gnu.org>
1017
1018 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
1019 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
1020 (redisplay_window, next_element_from_string): Fix typos in
1021 comments.
3e441275
EZ
1022 (redisplay_window): Pass to move_it_vertically the margin in
1023 pixels, not in screen lines.
de0100f2 1024
96a72ee9
GM
10252012-03-02 Glenn Morris <rgm@gnu.org>
1026
1027 * buffer.c (buffer-list-update-hook): Doc fix.
1028
312508d7
EZ
10292012-02-29 Eli Zaretskii <eliz@gnu.org>
1030
1031 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
1032 push_it before setting up the iterator for the first overlay
1033 string, even if we have an empty string loaded.
1034 (next_overlay_string): If there's an empty string on the iterator
1035 stack, pop the stack. (Bug#10903)
1036
27f3c637
PE
10372012-02-25 Paul Eggert <eggert@cs.ucla.edu>
1038
1039 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
1040 Suggested by Stefan Monnier in
1041 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
1042 * alloc.c (widen_to_Lisp_Object): New static function.
1043 (mark_memory): Also mark Lisp_Objects by fetching pointer words
1044 and widening them to Lisp_Objects. This would work even if
1045 USE_LSB_TAG is defined and wide integers are used, which might
1046 happen in a future version of Emacs.
1047
3c9dfce6
CY
10482012-02-25 Chong Yidong <cyd@gnu.org>
1049
fa74b241
CY
1050 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
1051 Doc fix.
1052
3c9dfce6
CY
1053 * xselect.c (Fx_selection_exists_p): Doc fix.
1054 (x_clipboard_manager_save_all): Print an informative message
1055 before saving to clipboard manager.
1056
9486df08
CY
10572012-02-24 Chong Yidong <cyd@gnu.org>
1058
1059 * keyboard.c (process_special_events): Handle all X selection
1060 requests in kbd_buffer, not just the next one (Bug#8869).
1061
f01d3321
CY
10622012-02-23 Chong Yidong <cyd@gnu.org>
1063
1064 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
1065 call when setting menu-bar-lines and tool-bar-lines parameters.
1066 (unwind_create_frame_1): New helper function.
1067
1068 * window.c (inhibit_window_configuration_change_hook): New var.
1069 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 1070 (syms_of_window): Initialize it.
f01d3321 1071
86b847b6
CY
10722012-02-22 Chong Yidong <cyd@gnu.org>
1073
1074 * xterm.c (x_draw_image_relief): Add missing type check for
1075 Vtool_bar_button_margin (Bug#10743).
1076
a59225b1
CY
10772012-02-21 Chong Yidong <cyd@gnu.org>
1078
1079 * fileio.c (Vfile_name_handler_alist): Doc fix.
1080
1081 * buffer.c (Fget_file_buffer): Protect against invalid file
1082 handler return value.
1083
310f5bd4
PE
10842012-02-20 Paul Eggert <eggert@cs.ucla.edu>
1085
cb3a28cc
PE
1086 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
1087 when computing $valmask.
1088
310f5bd4
PE
1089 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
1090 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
1091 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
1092 It's useless in that case, and it can cause problems on hosts
1093 that allocate halves of EMACS_INT values separately.
1094 Reported by Dan Horák. Diagnosed by Andreas Schwab in
1095 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
1096 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
1097 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
1098 it avoids undefined behavior on hosts where shifting right by more
1099 than the word width has undefined behavior.
1100
2375c96a
CY
11012012-02-19 Chong Yidong <cyd@gnu.org>
1102
1103 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
1104 (Funhandled_file_name_directory, Ffile_name_as_directory)
1105 (Fdirectory_file_name, Fexpand_file_name)
1106 (Fsubstitute_in_file_name): Protect against invalid file handler
1107 return values (Bug#10845).
1108
3eb49e71
EZ
11092012-02-18 Eli Zaretskii <eliz@gnu.org>
1110
1111 * .gdbinit (pitx): Fix incorrect references to fields of the
1112 iterator stack.
1113
7b926f3f
CY
11142012-02-17 Chong Yidong <cyd@gnu.org>
1115
1116 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
1117
11273115
PE
11182012-02-15 Paul Eggert <eggert@cs.ucla.edu>
1119
1120 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
1121 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
1122
c3a70e2b
CY
11232012-02-15 Chong Yidong <cyd@gnu.org>
1124
1125 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
1126 marked as special. Also, starting docstrings with * is obsolete.
1127
0ca43699
AS
11282012-02-13 Andreas Schwab <schwab@linux-m68k.org>
1129
1130 * gnutls.c (emacs_gnutls_write): Fix last change.
1131
2e8f3c56
LI
11322012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
1133
1134 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
1135 send_process.
1136
af70074f
SM
11372012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
1138
1139 * keymap.c (Fsingle_key_description): Handle char ranges.
1140
95986d52
CY
11412012-02-12 Chong Yidong <cyd@gnu.org>
1142
afd83bd1
CY
1143 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
1144 as that creates a dangerous corner case.
1145
95986d52
CY
1146 * window.c (Fdelete_window_internal): Invalidate the mouse
1147 highlight (Bug#9904).
1148
bd7da63e
GM
11492012-02-12 Glenn Morris <rgm@gnu.org>
1150
1151 * xselect.c (Fx_own_selection_internal)
1152 (Fx_get_selection_internal, Fx_disown_selection_internal)
1153 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
1154 * nsselect.m (Fx_own_selection_internal)
1155 (Fx_disown_selection_internal, Fx_selection_exists_p)
1156 (Fx_selection_owner_p, Fx_get_selection_internal):
1157 Sync docs and argument specs with the xselect.c versions.
1158
77abcbc2
LI
11592012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
1160
1161 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
1162
90b671e2
EZ
11632012-02-11 Eli Zaretskii <eliz@gnu.org>
1164
1c0ca0b7
EZ
1165 * w32select.c (Fx_selection_exists_p): Sync doc string and
1166 argument list with xselect.c. (Bug#10783)
1167
1168 * w16select.c (Fx_selection_exists_p): Sync doc string and
1169 argument list with xselect.c. (Bug#10783)
90b671e2 1170
49241268
GM
11712012-02-10 Glenn Morris <rgm@gnu.org>
1172
1173 * fns.c (Fsecure_hash): Doc fix.
1174
f998bbe7 11752012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
1176
1177 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
1178
0992bd9c
CY
11792012-02-07 Chong Yidong <cyd@gnu.org>
1180
1181 * buffer.c (Fbuffer_local_variables)
1182 (buffer_lisp_local_variables): Handle unbound vars correctly;
1183 don't let Qunbound leak into Lisp.
1184
af008560
GM
11852012-02-07 Glenn Morris <rgm@gnu.org>
1186
dd605cc4
GM
1187 * image.c (Fimagemagick_types): Doc fix.
1188
af008560
GM
1189 * image.c (imagemagick-render-type): Change it from a lisp object
1190 to an integer. Move the doc here from the lisp manual.
1191 Treat all values not equal to 0 the same.
1192
1449fa1d
CY
11932012-02-06 Chong Yidong <cyd@gnu.org>
1194
1195 * doc.c (store_function_docstring): Avoid applying docstring of
1196 alias to base function (Bug#2603).
1197
3723ec07
AS
11982012-02-04 Andreas Schwab <schwab@linux-m68k.org>
1199
1200 * .gdbinit (pp1, pv1): Remove redundant defines.
1201 (pr): Use pp.
1202
79c1cc1e
CY
12032012-02-04 Chong Yidong <cyd@gnu.org>
1204
1205 * nsterm.m: Declare a global (Bug#10694).
1206
d7f29f8e
EZ
12072012-02-04 Eli Zaretskii <eliz@gnu.org>
1208
cae07000
SM
1209 * w32.c (get_emacs_configuration_options):
1210 Include --enable-checking, if specified, in the return value.
d7f29f8e 1211
3b95a6f9
MR
12122012-02-04 Martin Rudalics <rudalics@gmx.at>
1213
1214 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
1215 after rounding frame sizes. (Bug#9723)
1216
d6fa96a6
EZ
12172012-02-04 Eli Zaretskii <eliz@gnu.org>
1218
1219 * keyboard.c (adjust_point_for_property): Don't position point
1220 before BEGV. (Bug#10696)
1221
df0b2940
PE
12222012-02-03 Paul Eggert <eggert@cs.ucla.edu>
1223
1224 Handle overflow when computing char display width (Bug#9496).
1225 * character.c (char_width): Return EMACS_INT, not int.
1226 (char_width, c_string_width): Check for overflow when
1227 computing the width; this is possible now that individual
1228 characters can have unbounded width. Problem introduced
1229 by merge from Emacs 23 on 2012-01-19.
1230
6bee44d6
MA
12312012-02-02 Michael Albinus <michael.albinus@gmx.de>
1232
1233 * dbusbind.c (Fdbus_register_method): Mention the return value
1234 :ignore in the docstring.
1235
44f92739
GM
12362012-02-02 Glenn Morris <rgm@gnu.org>
1237
1b9f60cc
GM
1238 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
1239
44f92739
GM
1240 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
1241 Unconditionally set to t. (Bug#10673)
1242 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
1243 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
1244 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
1245
c5d3843c
KH
12462012-02-02 Kenichi Handa <handa@m17n.org>
1247
1248 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
1249 0, do not call append_composite_glyph.
1250
159462d4 12512012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
1252
1253 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
1254 NULL (Bug#6988).
1255 (x_produce_glyphs): If the component of a composition is a null
1256 string, set it->pixel_width to 1 to avoid zero-width glyph.
1257
78cef877
EZ
12582012-02-01 Eli Zaretskii <eliz@gnu.org>
1259
1260 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
1261 first 2 arguments are identical. This makes inserting large
1262 output from a subprocess an order of magnitude faster on
1263 MS-Windows, where all sbrk'ed memory is always contiguous.
1264
97897668
GM
12652012-01-31 Glenn Morris <rgm@gnu.org>
1266
1267 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 1268 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
1269 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
1270
31fd3586
GM
12712012-01-29 Glenn Morris <rgm@gnu.org>
1272
1273 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
1274
0e24a8b2
CY
12752012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
1276
1277 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
1278
cc0adcb0
CY
12792012-01-28 Chong Yidong <cyd@gnu.org>
1280
1281 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
1282
acc28cb9
CY
12832012-01-26 Chong Yidong <cyd@gnu.org>
1284
9c69cfb7
CY
1285 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
1286
acc28cb9
CY
1287 * search.c (Fsearch_forward, Fsearch_backward): Document negative
1288 repeat counts (Bug#10507).
1289
48da7392
GM
12902012-01-26 Glenn Morris <rgm@gnu.org>
1291
1292 * lread.c (syms_of_lread): Doc fix.
1293
14af5f7f
CY
12942012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
1295
1296 * coding.c (encode_designation_at_bol): Change return value to
1297 EMACS_INT.
1298
0b21c100
CY
12992012-01-25 Chong Yidong <cyd@gnu.org>
1300
1301 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
1302
3c2907f7
CY
13032012-01-21 Chong Yidong <cyd@gnu.org>
1304
1305 * floatfns.c (Fcopysign): Make the second argument non-optional,
1306 since nil is not allowed anyway.
1307
959ad23f
AS
13082012-01-21 Andreas Schwab <schwab@linux-m68k.org>
1309
1310 * process.c (read_process_output): Use p instead of XPROCESS (proc).
1311 (send_process): Likewise.
1312
34a02f46
MR
13132012-01-19 Martin Rudalics <rudalics@gmx.at>
1314
1315 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
1316 (Vwindow_persistent_parameters): Do not use Qstate.
1317 Rewrite doc-strings.
34a02f46 1318
1259009a 13192012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
1320
1321 * character.c (char_width): New function.
70d4fdf6
GM
1322 (Fchar_width, c_string_width, lisp_string_width):
1323 Use char_width (Bug#9496).
25ed9e61 1324
6a6ee00d
MR
13252012-01-16 Martin Rudalics <rudalics@gmx.at>
1326
1327 * window.c (Vwindow_persistent_parameters): New variable.
1328 (Fset_window_configuration, save_window_save): Handle persistent
1329 window parameters.
1330
c85efaf7
EZ
13312012-01-14 Eli Zaretskii <eliz@gnu.org>
1332
1333 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
1334 thrashing the stack of the thread. (Bug#9087)
1335
5944709e
PE
13362012-01-12 Paul Eggert <eggert@cs.ucla.edu>
1337
1338 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
1339
e71f5d99
EZ
13402012-01-11 Eli Zaretskii <eliz@gnu.org>
1341
1342 * xdisp.c (rows_from_pos_range): Handle the case where the
1343 highlight ends on a newline. (Bug#10464)
1344 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
1345 he end column for display of highlight that ends on a newline
1346 before a R2L line.
1347
ce316182
GM
13482012-01-11 Glenn Morris <rgm@gnu.org>
1349
1350 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
1351 from load-path also when installation-directory is nil. (Bug#10208)
1352
5b43da69
GM
13532012-01-10 Glenn Morris <rgm@gnu.org>
1354
74cc8ff9
GM
1355 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
1356
7d8d6e4e
GM
1357 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
1358 Update template values to be closer to their typical values these days.
5b43da69 1359
a0db8d43
EZ
13602012-01-09 Eli Zaretskii <eliz@gnu.org>
1361
1362 * xdisp.c (rows_from_pos_range): Accept additional argument
1363 DISP_STRING, and accept any glyph in a row whose object is that
1364 string as eligible for mouse highlight. Fixes mouse highlight of
1365 display strings from overlays. (Bug#10464)
1366
9a0115ab 13672012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 1368
b9110d6a 1369 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
1370 * fileio.c (auto_saving_dir_umask): New static var.
1371 (Fmake_directory_internal): Use it.
1372 (do_auto_save_make_dir): Set it, instead of invoking chmod after
1373 creating the directory. The old code temporarily assigns
1374 too-generous permissions to the directory.
1375 (do_auto_save_eh): Clear it.
b9110d6a 1376 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
1377 that the var is always cleared.
1378
6c1bd3f3
EZ
13792012-01-07 Eli Zaretskii <eliz@gnu.org>
1380
1381 * search.c (scan_buffer): Pass character positions to
1382 know_region_cache, not byte positions. (Bug#6540)
1383
069d2b50
L
13842012-01-07 LynX <_LynX@bk.ru> (tiny change)
1385
1386 * w32.c (sys_rename): Report EXDEV when rename of a directory
1387 fails because the target is on another logical disk. (Bug#10284)
1388
75bf0d33
DB
13892012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
1390
1391 * xterm.c (x_embed_request_focus): New function.
1392
1393 * xterm.h: Add prototype.
1394
1395 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
1396
1c6e5a32
GM
13972012-01-05 Glenn Morris <rgm@gnu.org>
1398
1399 * emacs.c (emacs_copyright): Update short copyright year to 2012.
1400
651e947e
EZ
14012012-01-01 Eli Zaretskii <eliz@gnu.org>
1402
1403 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
1404 Load gnutls_transport_set_lowat only if GnuTLS version is below
1405 2.11.1.
1406 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
1407 GnuTLS versions below 2.11.1.
1408
3778cdd8
AL
14092011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
1410
1411 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
1412 to the doc string advising against its use for altering the way
1413 windows are scrolled.
1414
0e5317f7
KH
14152011-12-28 Kenichi Handa <handa@m17n.org>
1416
1417 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
1418 coding-system ASCII compatible only when it does not produce BOM
1419 on encoding (Bug#10383).
1420
93d5ca1f
JD
14212011-12-26 Jan Djärv <jan.h.d@swipnet.se>
1422
1423 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
1424 can scroll.
1425 (create_and_show_popup_menu): Always use menu_position_func for
1426 Gtk3 (Bug#10361).
1427
ca22b785
AS
14282011-12-24 Andreas Schwab <schwab@linux-m68k.org>
1429
1430 * callint.c (Fcall_interactively): Don't truncate prompt string.
1431
d048e1e6
EZ
14322011-12-23 Eli Zaretskii <eliz@gnu.org>
1433
1434 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
1435 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 1436 resumed from there (after widening). (Bug#10360)
d048e1e6 1437
5ccaba1f
JD
14382011-12-22 Jan Djärv <jan.h.d@swipnet.se>
1439
1440 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
1441
204ee57f
JD
14422011-12-21 Jan Djärv <jan.h.d@swipnet.se>
1443
b81d40f0
JB
1444 * nsterm.m (x_free_frame_resources):
1445 Release f->output_data.ns->miniimage.
204ee57f
JD
1446 (ns_index_color): Fix indentation. Do not retain
1447 color_table->colors[i].
1448
1449 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
1450 before returning.
1451
1452 * nsfns.m (x_set_background_color): Assign return value from
1453 ns_index_color to face-background instead of NSColor*.
1454 (ns_implicitly_set_icon_type): Fix indentation.
1455 Change assignment in for loop to comparison.
1456
1457 * emacs.c (ns_pool): New variable.
1458 (main): Assign ns_pool.
1459 (Fkill_emacs): Call ns_release_autorelease_pool.
1460
1461 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
1462 autorelease fdesc, release fdAttrs and tdict.
1463 (ns_get_covering_families): Release charset.
1464 (ns_findfonts): Release NSFontDescriptor created with new.
1465 (ns_uni_to_glyphs): Fix indentation.
1466 (setString): Release attrStr before assigning new value.
1467
c803b2b7
JD
14682011-12-18 Jan Djärv <jan.h.d@swipnet.se>
1469
678f4426
JD
1470 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
1471 and NS_IMPL_COCOA.
1472 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
1473 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
1474
cd394be1 14752011-12-18 David Reitter <reitter@cmu.edu>
678f4426 1476
5fecd5fc
JD
1477 * nsterm.m (ns_term_init): Subscribe for notifications
1478 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
1479 to method trackingNotification in EmacsMenu.
1480
1481 * nsmenu.m (trackingMenu): New variable.
3771cb17 1482 (trackingNotification): New method (from Aquamacs).
5fecd5fc 1483 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 1484 from Aquamacs (Bug#7030).
678f4426
JD
1485
14862011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 1487
c803b2b7
JD
1488 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
1489 (symbol_to_nsstring): Fix indentation.
1490 (ns_symbol_to_pb): New function.
cae07000
SM
1491 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
1492 (Fns_rotate_cut_buffers_internal): Remove.
1493 (Fns_store_selection_internal): Rename from
c803b2b7
JD
1494 Fns_store_cut_buffer_internal.
1495 (ns_get_foreign_selection, Fx_own_selection_internal)
1496 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
1497 (Fns_get_selection_internal, Fns_store_selection_internal):
1498 Use ns_symbol_to_pb and check if return value is nil.
1499 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
1500 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
1501 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
1502 renamed to Sns_store_selection_internal.
1503 (ns_handle_selection_request): Move code to Fx_own_selection_internal
1504 and remove this function.
1505 (ns_handle_selection_clear): Remove, never used.
1506 (Fx_own_selection_internal): Move code from ns_handle_selection_request
1507 here.
1508
e1b01a3a
KB
15092011-12-17 Ken Brown <kbrown@cornell.edu>
1510
1511 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
1512 GID is unknown (Bug#10257).
1513
2adb6e85
PE
15142011-12-17 Paul Eggert <eggert@cs.ucla.edu>
1515
1516 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
1517 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
1518 which caused a build failure on GNU/Linux IA-64. This problem was
1519 introduced by my 2011-10-07 patch.
1520
d1d7b339
JL
15212011-12-15 Juri Linkov <juri@jurta.org>
1522
1523 * image.c (imagemagick_error): New function. (Bug#10112)
1524 (imagemagick_load_image): Comment out `MagickSetResolution' call.
1525 Use `imagemagick_error' where ImageMagick functions return
1526 `MagickFalse'.
1527 (Fimagemagick_types): Add `Fnreverse' to return the list in the
1528 proper order.
1529
100d5755
KH
15302011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1531
1532 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
1533 fill background (Bug#8992).
1534
454592a6
MR
15352011-12-13 Martin Rudalics <rudalics@gmx.at>
1536
1537 * window.c (Vwindow_combination_resize)
1538 (Vwindow_combination_limit): Use t instead of non-nil in
1539 doc-strings.
61d4b438
MR
1540 (Vrecenter_redisplay): Add first sentence of doc-string on
1541 separate line.
53524d93 1542 (Frecenter): Fix doc-string typo.
454592a6 1543
3633e3aa
KH
15442011-12-11 Kenichi Handa <handa@m17n.org>
1545
1546 * coding.c (Funencodable_char_position): Pay attention to the
1547 buffer text relocation (Bug#9389).
1548
7b9d523a
JD
15492011-12-10 Jan Djärv <jan.h.d@swipnet.se>
1550
1551 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
1552 gtk_init (Bug#10100).
1553
b73189c6
EZ
15542011-12-10 Eli Zaretskii <eliz@gnu.org>
1555
1556 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
1557 IT->string is nil. (Bug#10263)
1558
f7dfe5d6
JD
15592011-12-10 Jan Djärv <jan.h.d@swipnet.se>
1560
83faebb4
JD
1561 * nsterm.h (x_free_frame_resources): Declare.
1562
f7dfe5d6
JD
1563 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
1564 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
1565
1566 * nsterm.h (ns_get_defaults_value): Declare.
1567
1568 * nsterm.m (ns_default): Call ns_get_defaults_value.
1569
7cd4e72c
EZ
15702011-12-09 Eli Zaretskii <eliz@gnu.org>
1571
1572 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
1573 (Bug#10170)
1574
b34d7317
YM
15752011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1576
1577 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
1578 that where the value of an _OBJC_* symbol points to is in the .bss
1579 section (Bug#10240).
1580
76470ad1
KH
15812011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
1582
1583 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 1584 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 1585
745fff94
KH
15862011-12-08 Kenichi Handa <handa@m17n.org>
1587
1588 * ftfont.c (get_adstyle_property): Fix previous change
1589 (Bug#10233).
1590
6e44397c
JB
15912011-12-07 Juanma Barranquero <lekktu@gmail.com>
1592
1593 * w32.c (init_environment): If no_site_lisp, remove site-lisp
1594 dirs from the default value of EMACSLOADPATH (bug#10208).
1595
7efa6272
GM
15962011-12-07 Glenn Morris <rgm@gnu.org>
1597
1598 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
1599 installation and source directories as well. (Bug#10208)
1600
f6fc4d87
CY
16012011-12-06 Chong Yidong <cyd@gnu.org>
1602
1603 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
1604
2bf26180
GM
16052011-12-06 Glenn Morris <rgm@gnu.org>
1606
1607 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
1608 as an error, not just -1. (Bug#10217)
1609
3a6ad4f0
CY
16102011-12-05 Chong Yidong <cyd@gnu.org>
1611
1612 * keyboard.c (process_special_events): New function.
1613 (swallow_events, Finput_pending_p): Use it (Bug#10195).
1614
75a3b399
PE
16152011-12-05 Paul Eggert <eggert@cs.ucla.edu>
1616
1617 * coding.c (encode_designation_at_bol): Don't use uninitialized
1618 local variable (Bug#9318).
1619
c3c9e25e
KH
16202011-12-05 Kenichi Handa <handa@m17n.org>
1621
1622 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
1623 return Qnil (Bug#8046, Bug#10193).
1624
5eb05ea3
KH
16252011-12-05 Kenichi Handa <handa@m17n.org>
1626
1627 * coding.c (encode_designation_at_bol): New args charbuf_end and
1628 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
1629 (coding_set_source): Return how many bytes coding->source was
1630 relocated.
1631 (coding_set_destination): Return how many bytes
1632 coding->destination was relocated.
1633 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 1634 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
1635
16362011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
1637
1638 * coding.c (CODING_CHAR_CHARSET_P): New macro.
1639 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
1640 macro (Bug#9318).
1641
16422011-12-05 Andreas Schwab <schwab@linux-m68k.org>
1643
1644 The following changes are to fix Bug#9318.
1645
a79703f5 1646 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
1647 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
1648 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 1649 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 1650
7dbda6df
JB
16512011-12-05 Juanma Barranquero <lekktu@gmail.com>
1652
1653 * lisp.h (process_quit_flag): Fix external declaration.
1654
6d5eb5b0
SM
16552011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
1656
1657 Don't macro-inline non-performance-critical code.
1658 * eval.c (process_quit_flag): New function.
1659 * lisp.h (QUIT): Use it.
1660
a0c3fad0
JD
16612011-12-04 Jan Djärv <jan.h.d@swipnet.se>
1662
1663 * nsfns.m (get_geometry_from_preferences): New function.
1664 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
1665
6c07aac2
AS
16662011-12-04 Andreas Schwab <schwab@linux-m68k.org>
1667
1668 * emacs.c (Qkill_emacs): Define.
1669 (syms_of_emacs): Initialize it.
1670 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
1671 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
1672 (quit_throw_to_read_char): Add parameter `from_signal'.
1673 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
1674 * lisp.h (QUIT): Call Fkill_emacs if requested.
1675
c052ead4
JD
16762011-12-03 Jan Djärv <jan.h.d@swipnet.se>
1677
1678 * widget.c (update_wm_hints): Return if wmshell is null.
1679 (widget_update_wm_size_hints): New function.
1680
1681 * widget.h (widget_update_wm_size_hints): Declare.
1682
1683 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
1684 widget_update_wm_size_hints (Bug#10104).
1685
9e49252b
EZ
16862011-12-03 Eli Zaretskii <eliz@gnu.org>
1687
1688 * xdisp.c (handle_invisible_prop): If the invisible text ends just
1689 before a newline, prepare the bidi iterator for consuming the
1690 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 1691 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 1692
02b16839
JL
16932011-12-02 Juri Linkov <juri@jurta.org>
1694
1695 * search.c (Fword_search_regexp): New Lisp function created from
1696 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
1697 (Fword_search_backward, Fword_search_forward)
1698 (Fword_search_backward_lax, Fword_search_forward_lax):
1699 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
1700 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
1701
0068070e
SM
17022011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
1703
1704 * fileio.c (Finsert_file_contents): Move after-change-function call
1705 to before the "handled:" label, since all "goto handled" appear in
1706 cases where the *-change-functions have already been properly called
1707 (bug#10117).
1708
3360a3fc
AS
17092011-12-01 Andreas Schwab <schwab@linux-m68k.org>
1710
1711 * keyboard.c (interrupt_signal): Don't call kill-emacs when
1712 waiting for input. (Bug#10169)
1713
73d6c093
EZ
17142011-11-30 Eli Zaretskii <eliz@gnu.org>
1715
1716 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
1717 verifies glyph row's hash code--we have just reallocated the
1718 glyphs, so their contents can be complete garbage. (Bug#10164)
1719
febe6bea
JB
17202011-11-30 Juanma Barranquero <lekktu@gmail.com>
1721
1722 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
1723
801a4313
EZ
17242011-11-30 Eli Zaretskii <eliz@gnu.org>
1725
1726 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
1727 attributes are tested _before_ calling verify_row_hash, to protect
1728 against GCC re-ordering of the tests. (Bug#10164)
1729
2b56b87e
JD
17302011-11-29 Jan Djärv <jan.h.d@swipnet.se>
1731
1732 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
1733
1734 * xterm.c (handle_one_xevent): Only set async_visible and friends
1735 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 1736 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
1737 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
1738
dbf31225
PE
17392011-11-28 Paul Eggert <eggert@cs.ucla.edu>
1740
1741 Remove GCPRO-related macros that exist only to avoid shadowing locals.
1742 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
1743 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
1744 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
1745 All uses changed to use GCPRO1 etc.
1746 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
1747 Revert to old implementation (i.e., before 2011-03-11).
1748
1305621b
YM
17492011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1750
1751 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
1752 of scroll runs so as to avoid assigning disabled bogus rows and
1753 unnecessary graphics copy operations.
1754
8c9afb46
EZ
17552011-11-27 Eli Zaretskii <eliz@gnu.org>
1756
1757 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
1758 (snprintf) [_MSC_VER]: Redirect to _snprintf.
1759 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
1760 (malloc, free, realloc, calloc): Redirect to e_* only when
1761 compiling Emacs.
1762
1763 * lisp.h (GCTYPEBITS): Move before first use.
1764 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
1765 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
1766 this macro definition.
1767
1768 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
1769 _MSC_VER.
1770
54e9e3bf
JD
17712011-11-27 Jan Djärv <jan.h.d@swipnet.se>
1772
6d5eb5b0
SM
1773 * gtkutil.c (xg_create_frame_widgets):
1774 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
1775 present with Gtk+ 2.0.
1776
83aca1cb
PE
17772011-11-26 Paul Eggert <eggert@cs.ucla.edu>
1778
1779 * fileio.c (Finsert_file_contents): Undo previous change; see
1780 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
1781
5b76caa4
PE
17822011-11-26 Paul Eggert <eggert@cs.ucla.edu>
1783
1784 Rename locals to avoid shadowing.
1785 * fileio.c (Finsert_file_contents):
1786 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
1787 * process.c (wait_reading_process_output):
1788 Rename inner 'proc' to 'p' to avoid shadowing.
1789 Indent for consistency with usual Emacs style.
1790
8c535114
EZ
17912011-11-25 Eli Zaretskii <eliz@gnu.org>
1792
1793 * xdisp.c (redisplay_window): If cursor row is not fully visible
1794 after recentering, and scroll-conservatively is set to a large
1795 number, scroll window by a few more lines to make the cursor fully
1796 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
1797 (start_display): Don't move to the next line if the display should
1798 start at a newline that is part of a display vector or an overlay
1799 string. (Bug#10119)
8c535114 1800
fa4fdb5c
JL
18012011-11-24 Juri Linkov <juri@jurta.org>
1802
1803 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
1804 after the `MagickPingImage' call. (Bug#10112)
1805
90ec88df
CY
18062011-11-23 Chong Yidong <cyd@gnu.org>
1807
1808 * window.c (Fcoordinates_in_window_p): Accept only live windows.
1809
56e2e794
MR
18102011-11-23 Martin Rudalics <rudalics@gmx.at>
1811
1812 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
1813 making another buffer current. (Bug#10114)
1814
b6e64c41
GM
18152011-11-23 Glenn Morris <rgm@gnu.org>
1816
1817 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
1818
6b21de18
CY
18192011-11-23 Chong Yidong <cyd@gnu.org>
1820
1821 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
1822 using it (Bug#5984).
1823
b12cd789
EZ
18242011-11-22 Eli Zaretskii <eliz@gnu.org>
1825
1826 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
1827 and header-lines, as they don't have one computed for them.
1828 (Bug#10098)
1829
1830 * .gdbinit (prow): Make displayed values more self-explaining.
1831 Add row's hash code.
1832
261b6fd4
LMI
18332011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
1834
1835 * process.c (wait_reading_process_output): Fix asynchrounous
1836 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 1837 (wait_reading_process_output): Add comment and URL.
261b6fd4 1838
e7cfd277
JD
18392011-11-21 Jan Djärv <jan.h.d@swipnet.se>
1840
1841 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
1842
a9b9b7f5
CY
18432011-11-21 Chong Yidong <cyd@gnu.org>
1844
1845 * window.c (Fnext_window, Fprevious_window): Doc fix.
1846
b0d15b4f
SM
18472011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
1848
1849 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
1850
fe7a3057
JB
18512011-11-20 Juanma Barranquero <lekktu@gmail.com>
1852
1853 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
1854
d2999b1a
MR
18552011-11-20 Martin Rudalics <rudalics@gmx.at>
1856
1857 * window.c (Fset_window_combination_limit): Rename argument
1858 STATUS to LIMIT.
1859 (Vwindow_combination_limit): Remove "status" from doc-string.
1860
d5ff9cd0
AS
18612011-11-20 Andreas Schwab <schwab@linux-m68k.org>
1862
1863 * m/ibms390.h: Remove.
1864 * m/ibms390x.h: Don't include "ibms390.h".
1865
a5bb9bd3
SM
18662011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
1867
1868 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
1869 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
1870
cd1181db
JB
18712011-11-20 Juanma Barranquero <lekktu@gmail.com>
1872
1873 * casetab.c (Fset_case_table):
1874 * charset.c (Fcharset_after): Fix typos.
1875
615a3b8d 18762011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 1877
17e845af
PE
1878 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
1879 Otherwise, valgrind does not work on some platforms.
1880 Problem reported by Andreas Schwab in
6a0bf43d
PE
1881 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
1882 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
1883 is set, removing the need for VIRT_ADDRESS_VARIES.
1884 (PURE_P): Use a more-efficient implementation that needs just one
1885 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
1886 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
1887 to 4 (xorl, subq, cmpq, setbe).
1888 * alloc.c (pure): Always extern now, since that's the
1889 VIRT_ADDR_VARIES behavior.
1890 (PURE_POINTER_P): Use a single comparison, not two, for
1891 consistency with the new puresize.h.
1892 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
1893 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
1894 Remove VIRT_ADDR_VARIES no longer needed.
1895
f8fe6f96
EZ
18962011-11-19 Eli Zaretskii <eliz@gnu.org>
1897
1898 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
1899 (erase_phys_cursor, update_window_cursor, show_mouse_face)
1900 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
1901 behave as if the cursor position were at the window margin.
1902
1903 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
1904 and the cursor position is out of bounds, behave as if the cursor
1905 position were at the window margin. (Bug#10075)
1906
df05a53c
CY
19072011-11-18 Chong Yidong <cyd@gnu.org>
1908
1909 * window.c (Fwindow_combination_limit): Make first argument
1910 non-optional, since it is meaningless for live windows like the
1911 selected window.
1912
2071918e
DA
19132011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
1914
1915 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
1916
b50a28de
SM
19172011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
1918
1919 * intervals.c: Fix grafting over the whole buffer (bug#10071).
1920 (graft_intervals_into_buffer): Simplify.
1921
015137db
EZ
19222011-11-18 Eli Zaretskii <eliz@gnu.org>
1923
1924 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
1925 hash values of the two rows.
1926 (copy_row_except_pointers): Preserve the used[] arrays and the
1927 hash values of the two rows. (Bug#10035)
68c95424 1928 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
1929
1930 * xdisp.c (row_hash): New function, body extracted from
1931 compute_line_metrics.
1932 (compute_line_metrics): Call row_hash, instead of computing the
1933 hash code inline.
1934
1935 * dispnew.c (verify_row_hash): Call row_hash for computing the
1936 hash code of a row, instead of duplicating code from xdisp.c.
1937
1938 * dispextern.h (row_hash): Add prototype.
1939
a2addb04
TH
19402011-11-18 Tassilo Horn <tassilo@member.fsf.org>
1941
1942 * frame.c (delete_frame): Don't delete the terminal when the last
1943 X frame is closed if emacs is built with GTK toolkit.
1944
df85d315
JB
19452011-11-17 Juanma Barranquero <lekktu@gmail.com>
1946
1947 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
1948
a0c2d0ae
MR
19492011-11-17 Martin Rudalics <rudalics@gmx.at>
1950
1951 * window.c (Vwindow_splits): Rename to
1952 Vwindow_combination_resize. Suggested by Juri Linkov.
1953 (Fsplit_window_internal): Use Vwindow_combination_resize instead
1954 of Vwindow_splits.
1955
58179cce
JB
19562011-11-16 Juanma Barranquero <lekktu@gmail.com>
1957
7877f373
JB
1958 * nsfns.m (Fns_font_name):
1959 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 1960
b6f67890
MR
19612011-11-16 Martin Rudalics <rudalics@gmx.at>
1962
1963 * window.h (window): Rename slot "nest" to "combination_limit".
1964 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
1965 (Fset_window_nest): Rename to Fset_window_combination_limit.
1966 (Vwindow_nest): Rename to Vwindow_combination_limit.
1967 (recombine_windows, make_parent_window, make_window)
1968 (Fsplit_window_internal, saved_window)
1969 (Fset_window_configuration, save_window_save): Rename all
1970 occurrences of window_nest to window_combination_limit.
1971
c7015153
JB
19722011-11-15 Juanma Barranquero <lekktu@gmail.com>
1973
1974 * image.c (imagemagick_load_image): Fix typo.
1975
322ad6ec
EZ
19762011-11-14 Eli Zaretskii <eliz@gnu.org>
1977
1978 * xdisp.c (display_line): Move the call to
1979 highlight_trailing_whitespace before the call to
1980 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
1981 faces of all the glyphs to compute ROW's hash value.
1982 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 1983
f067b8ec
JB
19842011-11-14 Juanma Barranquero <lekktu@gmail.com>
1985
1986 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
1987 just return (bug#10044).
1988
1e5b2111
EZ
19892011-11-12 Eli Zaretskii <eliz@gnu.org>
1990
7ef3cbd5
EZ
1991 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
1992 with user-defined heap size. Bump the default size of the temacs
1993 heap to 27MB, to avoid memory warning when running temacs.
1994 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
1995
1e5b2111
EZ
1996 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
1997 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
1998 (verify_row_hash) [XASSERTS]: New function.
1999 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
2000 that the hash value of glyph rows is correct.
1e5b2111 2001
89d61221
MR
20022011-11-12 Martin Rudalics <rudalics@gmx.at>
2003
2004 * window.h (window): Remove splits slot.
2005 * window.c (Fwindow_splits, Fset_window_splits): Remove.
2006 (Fdelete_other_windows_internal, make_parent_window)
2007 (make_window, Fsplit_window_internal, Fdelete_window_internal)
2008 (Fset_window_configuration, save_window_save): Don't deal with
2009 split status of windows.
2010 (saved_window): Remove splits slot.
2011 (Vwindow_splits): Rewrite doc-string.
2012
97f18cc8
JD
20132011-11-11 Jan Djärv <jan.h.d@swipnet.se>
2014
2015 * xfns.c (unwind_create_frame):
2016 * nsfns.m (unwind_create_frame):
2017 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
2018 Vframe_list (Bug#9999).
2019
22a648b4
DA
20202011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
2021
0b381c7e 2022 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 2023
659afede
KH
20242011-11-11 Kenichi Handa <handa@m17n.org>
2025
2026 * callproc.c (Fcall_process): Set the member dst_multibyte of
2027 process_coding.
2028
9ac0394b
KH
20292011-11-11 Johan Bockgård <bojohan@gnu.org>
2030
2031 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
2032 avoid a crash (bug#9496).
2033
2fbdc249
CY
20342011-11-09 Chong Yidong <cyd@gnu.org>
2035
2036 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2037 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
2038
ac6b1f81
PE
20392011-11-08 Paul Eggert <eggert@cs.ucla.edu>
2040
2041 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
2042
09db192c
PE
20432011-11-08 Paul Eggert <eggert@cs.ucla.edu>
2044
2045 Avoid some portability problems by eschewing 'extern inline' functions.
2046 The trivial performance wins aren't worth the portability hassles; see
2047 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
2048 et seq.
2049 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
2050 (window_box_width, window_box_left, window_box_left_offset)
2051 (window_box_right, window_box_right_offset): Undo previous change,
2052 by removing the "extern"s.
2053 * intervals.c (adjust_intervals_for_insertion)
2054 (adjust_intervals_for_deletion): Undo previous change,
2055 making these static again.
2056 (offset_intervals, temp_set_point_both, temp_set_point)
2057 (copy_intervals_to_string): No longer inline.
2058 * xdisp.c (window_text_bottom_y, window_box_width)
2059 (window_box_height, window_box_left_offset)
2060 (window_box_right_offset, window_box_left, window_box_right)
2061 (window_box): No longer inline.
2062
105216ed
CY
20632011-11-08 Chong Yidong <cyd@gnu.org>
2064
2065 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
2066 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
2067 Signal an error if not a live window.
105216ed
CY
2068 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
2069 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
2070
ae9e237f
JB
20712011-11-07 Juanma Barranquero <lekktu@gmail.com>
2072
2073 * lisp.h (syms_of_abbrev): Remove declaration.
2074 Reported by CHENG Gao <chenggao@royau.me>.
2075
c7aa8333
EZ
20762011-11-07 Eli Zaretskii <eliz@gnu.org>
2077
2078 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
2079 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
2080 of temacs in GUI mode.
2081
be7f5545
MR
20822011-11-07 Martin Rudalics <rudalics@gmx.at>
2083
2084 * window.h: Declare delete_all_child_windows instead of
2085 delete_all_subwindows.
2086 * window.c (Fwindow_nest, Fset_window_nest)
2087 (Fset_window_new_total, Fset_window_new_normal)
2088 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
2089 (delete_all_subwindows): Rename to delete_all_child_windows.
2090 (Fdelete_other_windows_internal, Fset_window_configuration):
2091 Call delete_all_child_windows instead of delete_all_subwindows.
2092 * frame.c (delete_frame): Call delete_all_child_windows instead
2093 of delete_all_subwindows.
2094
ca78dc43
PE
20952011-11-07 Paul Eggert <eggert@cs.ucla.edu>
2096
2097 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
2098 This is also needed for porting to any host where GC_MARK_STACK is
2099 not GC_MAKE_GCPROS_NOOPS.
2100 (which_symbols): Use it.
2101
a0241d01
KH
21022011-11-07 Kenichi Handa <handa@m17n.org>
2103
2104 * coding.c (coding_set_destination): Check coding->src_pos only
2105 when coding->src_object is a buffer (bug#9910).
2106
2107 * process.c (send_process): Set the member src_multibyte of coding
2108 to 0 (bug#9911) when sending a unibyte text.
2109
2110 * callproc.c (Fcall_process): Set the member src_multibyte of
2111 process_coding to 0 (bug#9912).
2112
a64bfdfa 21132011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
2114
2115 * xmenu.c (cleanup_widget_value_tree): New function.
2116 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
2117 calling free_menubar_widget_value_tree directly (Bug#9830).
2118
cb41b32a
PE
21192011-11-06 Paul Eggert <eggert@cs.ucla.edu>
2120
2121 Fix some portability problems with 'inline'.
2122 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
2123 (window_box_width, window_box_left, window_box_left_offset)
2124 (window_box_right, window_box_right_offset): Declare extern.
2125 Otherwise, these inline functions do not conform to C99 and
2126 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
2127 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
2128 * intervals.c (adjust_intervals_for_insertion)
2129 (adjust_intervals_for_deletion): Now extern, because otherwise the
2130 extern inline functions 'offset_intervals' couldn't refer to it.
2131 (static_offset_intervals): Remove.
2132 (offset_intervals): Rewrite using the old contents of
2133 static_offset_intervals. The old version didn't conform to C99
2134 because an extern inline function contained a reference to an
2135 identifier with static linkage.
2136
b7041366
AS
21372011-11-06 Andreas Schwab <schwab@linux-m68k.org>
2138
2139 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
2140 GC.
2141
88a37c4d
EZ
21422011-11-06 Eli Zaretskii <eliz@gnu.org>
2143
2144 * xdisp.c (init_iterator, reseat_to_string): Don't set the
2145 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
2146 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
2147 return Qleft_to_right.
2148
49745b39
CY
21492011-11-06 Chong Yidong <cyd@gnu.org>
2150
2151 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
2152 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
2153 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
2154 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
2155 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
2156 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
2157 (Fwindow_vscroll): Doc fix.
2158 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
2159 argument, since it makes no sense to pass a live window and for
2160 consistency with window-child.
2161
1f05cd82
CS
21622011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
2163
2164 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
2165 support MSVC.
2166
22610910
JR
21672011-11-05 Jason Rumney <jasonr@gnu.org>
2168
2169 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
2170 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
2171 fonts (Bug#6029).
2172 (add_font_entity_to_list): Fix logic errors in mixed boolean and
2173 bitwise arithmetic preventing use of unicode-sip and non-truetype
2174 opentype fonts.
2175
a06776b2
EZ
21762011-11-05 Eli Zaretskii <eliz@gnu.org>
2177
3ad924ba
EZ
2178 * s/ms-w32.h (fstat, stat, utime): Move redirections to
2179 "emacs"-only part.
2180
a06776b2
EZ
2181 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
2182 initialization code to keep similarity to xfns.c after changes
2183 from 2011-11-05.
2184
c9e7db78
JD
21852011-11-05 Jan Djärv <jan.h.d@swipnet.se>
2186
a97f8f3f
JD
2187 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
2188 (unwind_create_frame): New function (Bug#9943).
2189 (Fx_create_frame): Restructure code to be more similar to the one in
2190 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
2191 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
2192 Move terminal->reference_count++ just before making the frame official
2193 (Bug#9943).
2194
2195 * nsterm.m (x_free_frame_resources): New function.
2196 (x_destroy_window): Move code to x_free_frame_resources.
2197
c9e7db78 2198 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
2199 (Fx_create_frame, x_create_tip_frame):
2200 Move terminal->reference_count++ just before making the frame
75f1671a 2201 official. Move initialization of image_cache_refcount and
c9e7db78
JD
2202 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
2203
a6fc3b5c
EZ
22042011-11-05 Eli Zaretskii <eliz@gnu.org>
2205
2206 Support MSVC build with newer versions of Visual Studio.
2207 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
2208 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
2209 nt/gmake.defs.
2210
2211 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
2212 which are not supported by MSVC.
2213 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
2214 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
2215 bitfields.
2216 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
2217 types in bitfields.
2218 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
2219
2220 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
2221
58179cce 22222011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
2223
2224 Support MSVC build with newer versions of Visual Studio.
2225 * w32.c: Don't include w32api.h for MSVC.
2226 (init_environment) [_MSC_VER]: Call sys_access, not _access.
2227
2228 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
2229 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
2230 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
2231 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
2232 e_* cousins.
2233 (alloca) [_MSC_VER]: Define to _alloca.
2234
2235 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
2236
2237 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
2238
a58c13ed
EZ
22392011-11-04 Eli Zaretskii <eliz@gnu.org>
2240
2241 * xdisp.c (note_mouse_highlight): If either of
2242 previous/next-single-property-change returns nil, treat that as
2243 the beginning or the end of the buffer. (Bug#9955)
2244
fe0b6370
JD
22452011-11-04 Jan Djärv <jan.h.d@swipnet.se>
2246
a58c13ed 2247 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
2248 label is not null (Bug#9951).
2249 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
2250 may be NULL.
2251
89bd5ee1
EZ
22522011-11-04 Eli Zaretskii <eliz@gnu.org>
2253
2254 * window.c (Fwindow_body_size): Mention in the doc string that the
2255 return value is in frame's canonical units. (Bug#9949)
2256
84c3edb9
EZ
22572011-11-03 Eli Zaretskii <eliz@gnu.org>
2258
4e2fb5c7
EZ
2259 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
2260
84c3edb9 2261 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 2262 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 2263 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 2264
bc17a887
EZ
22652011-11-01 Eli Zaretskii <eliz@gnu.org>
2266
2267 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
2268 Don't stop backward scan on the continuation glyph, even though
2269 its CHARPOS is positive.
6d5eb5b0
SM
2270 (mouse_face_from_buffer_pos, note_mouse_highlight):
2271 Rename cover_string to disp_string.
bc17a887 2272
4ee88440
MR
22732011-11-01 Martin Rudalics <rudalics@gmx.at>
2274
2275 * window.c (temp_output_buffer_show): Don't use
2276 Vtemp_buffer_show_specifiers.
2277 (Vtemp_buffer_show_specifiers): Remove unused variable.
2278
c2ff3c02
EZ
22792011-10-30 Eli Zaretskii <eliz@gnu.org>
2280
2281 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
2282 past the beginning of the current glyph matrix.
2283
58179cce 22842011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
2285
2286 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
2287 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
2288 HAVE_GTK3 (Bug#9869).
b77a6a7f 2289
3b574623
JD
2290 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
2291 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
2292
b77a6a7f
JD
2293 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
2294
2295 * xterm.c: Declare x_handle_net_wm_state to return int.
2296 (handle_one_xevent): Check if we are iconified but don't have
2297 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
2298 (get_current_wm_state): Return non-zero if not hidden,
2299 check for _NET_WM_STATE_HIDDEN (Bug#9893).
2300 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
2301 (x_handle_net_wm_state): Return what get_current_wm_state returns.
2302 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
2303
196e41e4
PE
23042011-10-29 Paul Eggert <eggert@cs.ucla.edu>
2305
2306 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
2307 so that this new function doesn't get optimized away by a
2308 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
2309
021f2e1a
AS
23102011-10-29 Andreas Schwab <schwab@linux-m68k.org>
2311
2312 * frame.h (MOUSE_HL_INFO): Remove excess parens.
2313
8b058d44
EZ
23142011-10-29 Eli Zaretskii <eliz@gnu.org>
2315
2316 Fix the `xbytecode' command.
2317 * .gdbinit (xprintbytestr): New command.
b50a28de 2318 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
2319 (xbytecode): Print the byte-code string as well.
2320
4452fb80
EZ
23212011-10-29 Kim Storm <storm@cua.dk>
2322
8b058d44
EZ
2323 * alloc.c (which_symbols): New function.
2324
21b72067
AS
23252011-10-29 Andreas Schwab <schwab@linux-m68k.org>
2326
2327 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
2328 line. (Bug#9903)
2329
83ed7b5c
GM
23302011-10-29 Glenn Morris <rgm@gnu.org>
2331
2332 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
2333 Not clear what it was for, and it causes various bugs. (Bug#9839)
2334
5a7a728b
EZ
23352011-10-28 Eli Zaretskii <eliz@gnu.org>
2336
2337 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
2338 possible random value that matches one of those tested as
2339 condition to clear the mouse face.
2340
d3d0842f
CY
23412011-10-28 Chong Yidong <cyd@gnu.org>
2342
2343 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
2344
31b39d13
DN
23452011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
2346
2347 * window.c (make_window): Initialize phys_cursor_on_p.
2348
9aba6043
SM
23492011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
2350
2351 * lisp.h (struct Lisp_Symbol): Update comments.
2352
c20992f4
JB
23532011-10-28 Juanma Barranquero <lekktu@gmail.com>
2354
2355 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
2356
db4f02f2
EZ
23572011-10-28 Eli Zaretskii <eliz@gnu.org>
2358
2359 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
2360 <oslsachem@gmail.com> for helping to debug this.
2361
2362 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
2363 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
2364 (g_b_init_get_glyph_outline_w): New static variables.
2365 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
2366 (GetGlyphOutlineW_Proc): New typedefs.
2367 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
2368 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
2369 New functions.
2370 (w32font_open_internal, compute_metrics):
2371 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
2372 instead of calling the "wide" APIs directly.
2373
2374 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
2375
2376 * w32.h (syms_of_w32font): Add prototype.
2377
87e68db4
JB
23782011-10-27 Juanma Barranquero <lekktu@gmail.com>
2379
2380 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
2381 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
2382 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
2383 (Fmove_to_window_line): Doc fix.
2384
435c1d67
CY
23852011-10-27 Chong Yidong <cyd@gnu.org>
2386
2387 * process.c (make_process): Set gnutls_state to NULL.
2388
2389 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
2390 non-NULL, regardless of GNUTLS_INITSTAGE.
2391 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
2392 an error. Set process slots as soon as we allocate them.
2393
2394 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
2395
9c6c6f49
CY
23962011-10-27 Chong Yidong <cyd@gnu.org>
2397
9aba6043
SM
2398 * gnutls.c (emacs_gnutls_deinit): New function.
2399 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
2400 (Fgnutls_deinit, Fgnutls_boot): Use it.
2401
2402 * process.c (make_process): Initialize GnuTLS credentials to NULL.
2403 (deactivate_process): Call emacs_gnutls_deinit.
2404
657d08d3
JB
24052011-10-27 Juanma Barranquero <lekktu@gmail.com>
2406
2407 * image.c (x_create_x_image_and_pixmap):
2408 * w32.c (sys_rename, w32_delayed_load):
2409 * w32font.c (fill_in_logfont):
2410 * w32reg.c (x_get_string_resource): Silence compiler warnings.
2411
5430d399
JB
24122011-10-26 Juanma Barranquero <lekktu@gmail.com>
2413
2414 * w32fns.c (w32_default_color_map): New function,
2415 extracted from Fw32_default_color_map.
a7ef684b 2416 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 2417
fe0055fa
PE
24182011-10-25 Paul Eggert <eggert@cs.ucla.edu>
2419
2420 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
2421
e6346438
SM
24222011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
2423
2424 * keyboard.c (test_undefined): New function (bug#9751).
2425 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
2426
e112cc37
ET
24272011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
2428
2429 * sysdep.c (init_sys_modes): Fix the check for the controlling
2430 terminal (Bug#6649).
2431
7b5d6677
EZ
24322011-10-20 Eli Zaretskii <eliz@gnu.org>
2433
2434 * dispextern.h (struct bidi_it): New member next_en_type.
2435
2436 * bidi.c (bidi_line_init): Initialize the next_en_type member.
2437 (bidi_resolve_explicit_1): When next_en_pos is valid for the
2438 current character, check also for next_en_type being WEAK_EN.
2439 (bidi_resolve_weak): Don't enter the expensive loop if the current
2440 position is before next_en_pos. Record the bidi type of the first
2441 non-ET, non-BN character we find, in addition to its position.
2442 (bidi_level_of_next_char): Invalidate next_en_type when
2443 next_en_pos is over-stepped.
2444
7da0b018
PE
24452011-10-20 Paul Eggert <eggert@cs.ucla.edu>
2446
2447 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
2448 * editfns.c: Rewrite current-time-zone so that it invokes
2449 the equivalent of (format-time-string "%Z") to get the time zone name.
2450 This fixes a bug when the time zone name contains characters that
2451 need converting from the system time locale to Emacs internal format.
2452 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
2453 that patch fixed format-time-string to do the conversion, but
2454 I forgot to fix current-time-zone.
2455 (format_time_string): New function, containing most of
2456 what Fformat_time_string used to contain.
2457 (Fformat_time_string): Rewrite in terms of format_time_string.
2458 This doesn't change this function's behavior.
2459 (current-time-zone): Rewrite to use format_time_string.
2460 This fixes the bug reported by Michael Schierl in
2461 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
2462 Jason Rumney's 2007-06-07 change worked around this bug, but
2463 didn't fix it.
2464 * systime.h (tzname, timezone): Remove no-longer-used declarations.
2465
8547b010
EZ
24662011-10-19 Eli Zaretskii <eliz@gnu.org>
2467
2468 * xdisp.c (start_display): If the character at POS is displayed
2469 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
2470 (try_window_reusing_current_matrix): If a line ends in a display
2471 vector or the next line starts in a display vector, continue
2472 redrawing the window even though the character position of
2473 start_row was reached.
8547b010
EZ
2474 (Bug#9771, part 2)
2475
4e948d15
CY
24762011-10-18 Chong Yidong <cyd@gnu.org>
2477
2478 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
2479 with nobreak-char-display too.
2480
4787455f
EZ
24812011-10-18 Eli Zaretskii <eliz@gnu.org>
2482
2483 Fix part 3 of bug#9771.
2484 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
2485 (bidi_resolve_neutral): Don't enter the expensive loop looking for
2486 non-neutral characters if the current character is a paragraph
2487 separator (a.k.a. Newline). This avoids running the same
2488 expensive loop twice, once when we consume the preceding newline
2489 and the other time when the line actually needs to be displayed.
2490 Avoid the loop when we see neutrals on the base embedding level
2491 following a character whose directionality is the same as the
2492 paragraph's. This avoids running the expensive loop when a line
2493 ends in a long sequence of neutrals, like control characters.
2494 Add assertion against STRONG_AL type. Slightly rearrange code
2495 that determines the type of a neutral given the first non-neutral
2496 that follows it.
2497 (bidi_level_of_next_char): Set next_en_pos to zero when
2498 invalidating its info.
2499
2c91f553
EZ
25002011-10-17 Eli Zaretskii <eliz@gnu.org>
2501
2502 * xdisp.c (push_display_prop): Determine whether to record string
2503 or buffer position by IT->string, not by IT->method. Allow
2504 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
2505 (move_it_vertically_backward): Don't look for character position
2506 immediately after the newline when in a continuation line.
2507 (Bug#9771, part 1)
2c91f553 2508
c7b08b0d
MR
25092011-10-15 Martin Rudalics <rudalics@gmx.at>
2510
2511 * window.c (coordinates_in_window): Rewrite and delabelize
2512 vertical border check. (Bug#5357) (Bug#9618)
2513
6b02f655
SM
25142011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
2515
2516 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
2517 errors in XSetWindowBorder (bug#9310).
2518
81d40c92
DA
25192011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
2520
2521 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
2522 avoid crash when xmalloc overrun checking is enabled.
2523
d4172c3b
EZ
25242011-10-13 Eli Zaretskii <eliz@gnu.org>
2525
2526 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
2527 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
2528 cursor motion with <left> and <right> arrow keys.
2529
2530 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
2531 some callers set that themselves.
2532
b00eea75
EZ
25332011-10-12 Eli Zaretskii <eliz@gnu.org>
2534
2535 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
2536 display string and the previous row comes from the same string and
2537 is empty. (Bug#9739) (Bug#9738)
2538
8fe012c4
SM
25392011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
2540
2541 * doc.c (get_doc_string): Encode file name (bug#9735).
2542
0074aef2
EZ
25432011-10-12 Eli Zaretskii <eliz@gnu.org>
2544
79beb178
EZ
2545 * bidi.c (bidi_level_of_next_char):
2546 * xdisp.c (get_visually_first_element): Remove old incorrect
2547 comments regarding the Unicode Line Separator character.
2548
0074aef2
EZ
2549 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
2550
6e4b3fbe
DA
25512011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
2552
2553 * alloc.c (Fgc_status): Do not access beyond zombies array
2554 boundary if nzombies > MAX_ZOMBIES.
2555 * alloc.c (dump_zombies): Add missing format specifier.
2556
0324f3af
PE
25572011-10-12 Paul Eggert <eggert@cs.ucla.edu>
2558
b5525cac
PE
2559 * xdisp.c (set_cursor_from_row): Simplify conditionals,
2560 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
2561
0324f3af
PE
2562 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
2563 Some packages use them to denote characters with modifiers.
2564
e9b5f888
AS
25652011-10-11 Andreas Schwab <schwab@linux-m68k.org>
2566
2567 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
2568 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
2569 matching a pp-number. Rename parameter var to var1.
2570
127827c0
SM
25712011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
2572
2573 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
2574
c8fd3bd0
GM
25752011-10-08 Glenn Morris <rgm@gnu.org>
2576
2577 * callint.c (Fcall_interactively): Give a more explicit error for the
2578 'c' case with a non-character input. (Bug#8479)
2579
352ec8ff
EZ
25802011-10-08 Eli Zaretskii <eliz@gnu.org>
2581
03669ccb
EZ
2582 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
2583 lines.
7061c986
EZ
2584 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
2585 lines that are hscrolled on the left.
03669ccb 2586
352ec8ff
EZ
2587 * dispnew.c (buffer_posn_from_coords): Account for a possible
2588 presence of header-line. (Bug#4426)
2589
a66cfb1c
SM
25902011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
2591
6b02f655
SM
2592 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
2593 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 2594
7c5ee88e
PE
25952011-10-07 Paul Eggert <eggert@cs.ucla.edu>
2596
2597 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
2598 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
2599 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
2600 this makes Emacs dump core during garbage collection on rare
2601 occasions. sizeof is obviously inferior to offsetof here, so
2602 stick with offsetof.
2603 (GC_POINTER_ALIGNMENT): New macro.
2604 (mark_memory): Omit 3rd (offset) arg; caller changed.
2605 Don't assume EMACS_INT alignment is the same as pointer alignment.
2606
df1bbe5b
SM
26072011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
2608
2609 * keyboard.c (read_key_sequence_remapped): New var.
2610 (read_key_sequence): Compute remapping in the right buffer.
2611 (command_loop_1): Use read_key_sequence's remapping directly.
2612
51553db6
SM
26132011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
2614
32c1fffd
SM
2615 * dired.c (file_name_completion): Don't expand file name.
2616 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
2617 before checking file name handler.
2618
51553db6
SM
2619 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
2620 they've been requested explicitly (bug#9591).
2621
b6bd1599 26222011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
2623
2624 * keymap.c (Fsingle_key_description): Use make_specified_string
2625 instead of build_string to build string from push_key_description.
2626 (Bug#5193)
2627
f701dc2a
PE
26282011-09-30 Paul Eggert <eggert@cs.ucla.edu>
2629
4222c55d
PE
2630 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
2631 This fixes a Y2038 bug on 64-bit hosts.
2632 * buffer.c (reset_buffer):
2633 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
2634 (Fclear_buffer_auto_save_failure):
2635 Use 0, not -1, to represent an unset failure time, since time_t
2636 might not be signed.
2637
f701dc2a
PE
2638 Remove dependency on glibc malloc internals.
2639 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
2640 Move back here from lisp.h, but with their new implementations.
2641 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
2642 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
2643 * charset.c (charset_table_init): New static var.
2644 (syms_of_charset): Use it instead of xmalloc. This removes a
2645 dependency on glibc malloc internals. See Eli Zaretskii's comment in
2646 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
2647 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
2648 Move back to alloc.c.
2649 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
2650 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
2651
9ceebf39
JD
26522011-09-30 Jan Djärv <jan.h.d@swipnet.se>
2653
2654 * nsterm.m (windowDidResize): Call x_set_window_size only when
2655 ns_in_resize is true. Otherwise set pixelwidth/height and
2656 call change_frame_size (Bug#9628).
2657
cb993c58
PE
26582011-09-30 Paul Eggert <eggert@cs.ucla.edu>
2659
3930c88b
PE
2660 Port --enable-checking=all to Fedora 14 x86-64.
2661 * charset.c (syms_of_charset): Also account for glibc malloc's
2662 internal overhead when calculating the initial malloc maximum.
2663
cb993c58
PE
2664 Port --enable-checking=all to Fedora 14 x86.
2665 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
2666 Move to lisp.h.
2667 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
2668 (overrun_check_realloc, overrun_check_free):
2669 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
2670 That way, xmalloc returns a properly-aligned pointer even if
2671 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
2672 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
2673 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
2674 into account when calculating the initial malloc maximum.
2675 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
2676 Move here from alloc.c, so that charset.c can use it too.
2677 Properly align; the old code wasn't right for common 32-bit hosts
2678 when configured with --enable-checking=all.
2679 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
2680 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
2681
31bed486
EZ
26822011-09-29 Eli Zaretskii <eliz@gnu.org>
2683
04c70788 2684 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
2685 use EDOM.
2686
fbcaa2f3
EZ
26872011-09-28 Eli Zaretskii <eliz@gnu.org>
2688
2689 * xdisp.c (compute_display_string_end): If there's no display
2690 string at CHARPOS, return -1.
2691
2692 * bidi.c (bidi_fetch_char): When compute_display_string_end
2693 returns a negative value, treat the character as a normal
2694 character not covered by a display string. (Bug#9624)
2695
a239d4e9
JB
26962011-09-28 Juanma Barranquero <lekktu@gmail.com>
2697
2698 * lread.c (Fread_from_string): Fix typo in docstring.
2699
88652fd5
EZ
27002011-09-27 Eli Zaretskii <eliz@gnu.org>
2701
2702 * xdisp.c (handle_invisible_prop): If invisible text ends on a
2703 newline, reseat the iterator instead of bidi-iterating there one
2704 character at a time. (Bug#9610)
32c1fffd
SM
2705 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
2706 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 2707
ed497dd4
AS
27082011-09-27 Andreas Schwab <schwab@linux-m68k.org>
2709
2710 * lread.c (readevalloop): Use correct code for NBSP.
2711 (read1): Likewise. (Bug#9608)
2712
b2bf61aa
MA
27132011-09-25 Michael Albinus <michael.albinus@gmx.de>
2714
2715 * dbusbind.c (Fdbus_register_signal): When service is not
2716 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
2717
32bbb17c
GM
27182011-09-25 Glenn Morris <rgm@gnu.org>
2719
2720 * buffer.c (truncate-lines): Doc fix.
2721
94e0933e
CY
27222011-09-24 Chong Yidong <cyd@stupidchicken.com>
2723
2724 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
2725 (Fset_window_next_buffers): Doc fix.
2726
cddde921
GM
27272011-09-24 Glenn Morris <rgm@gnu.org>
2728
2729 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
2730
1260aef1
PE
27312011-09-24 Paul Eggert <eggert@cs.ucla.edu>
2732
25b4bfa0
PE
2733 Fix minor problems found by static checking.
2734 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
2735 * indent.c (Fvertical_motion): Fix == vs = typo.
2736
e3cbd34b
EZ
27372011-09-24 Eli Zaretskii <eliz@gnu.org>
2738
a66cfb1c
SM
2739 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
2740 Default value is now t. Doc fix.
6bf7006f 2741
e3cbd34b 2742 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 2743 logic when moving up, not only when moving down. Fix the
e3cbd34b 2744 confusing name and values of the it_overshoot_expected variable;
32c1fffd 2745 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
2746
2747 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
2748 CHARPOS is covered by a display string which includes newlines.
2749 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
2750 is covered by a display string with embedded newlines.
2751
a3de0cbd
MA
27522011-09-24 Michael Albinus <michael.albinus@gmx.de>
2753
2754 * dbusbind.c (Fdbus_register_signal): Add match rule to
2755 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
2756 (Fdbus_register_method, Vdbus_registered_objects_table):
2757 Fix docstring.
a3de0cbd 2758
b260039d
JM
27592011-09-24 Jim Meyering <meyering@redhat.com>
2760
32c1fffd 2761 do not ignore write error for any output size
b260039d
JM
2762 The previous change was incomplete.
2763 While it makes emacs --batch detect the vast majority of stdout
2764 write failures, errors were still ignored whenever the output size is
2765 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
2766 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
2767 && echo FAIL: ignored write error
2768 FAIL: ignored write error
2769 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
2770 && echo FAIL: ignored write error
2771 FAIL: ignored write error
2772 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
2773
8eca8a7c
AS
27742011-09-23 Andreas Schwab <schwab@linux-m68k.org>
2775
2776 * emacs.c (Fkill_emacs): In noninteractive mode exit
2777 non-successfully if a write error occurred on stdout. (Bug#9574)
2778
3341db62
EZ
27792011-09-21 Eli Zaretskii <eliz@gnu.org>
2780
2781 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
2782 the xassert test.
2783
2784 * dispextern.h (struct it): Update the comment documenting what
2785 can it->OBJECT be.
2786
8c203dbf
EZ
27872011-09-20 Eli Zaretskii <eliz@gnu.org>
2788
2789 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
2790 a display string, extend search for cursor position to end of row.
2791 (find_row_edges): If the row ends in a newline from a display
2792 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
2793 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
2794 (Fcurrent_bidi_paragraph_direction): Fix search for previous
2795 non-empty line. Fixes confusing cursor motion with arrow keys at
2796 the beginning of a line that starts with whitespace.
8c203dbf 2797
a4824228
LMI
27982011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
2799
2800 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
2801 (bug#9493).
2802
33ed493b
CY
28032011-09-18 Chong Yidong <cyd@stupidchicken.com>
2804
2805 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
2806 boolean (Bug#9154).
2807
56cd55c8
EZ
28082011-09-18 Eli Zaretskii <eliz@gnu.org>
2809
2810 * xdisp.c (display_line): Record maximum and minimum buffer
2811 positions even if no glyphs were produced (e.g., by a zero-width
2812 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
2813 buffer positions that will be removed from the glyph row because
2814 they don't fit.
c02dcedf
EZ
2815 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
2816 column is beyond frame width: don't subtract 1 "pixel" when
2817 computing width of the stretch.
3e62b7e0
EZ
2818 (reseat_at_next_visible_line_start): Undo the change made on
2819 2011-09-17 that saved paragraph information and restored it after
2820 the call to `reseat'. (Bug#9545)
56cd55c8 2821
5ed99d36 28222011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
2823
2824 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
2825 and turn window cursor on if cleared (Bug#9415).
2826
5ed99d36 28272011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
2828
2829 * search.c (boyer_moore): Take unibyte characters from pattern
2830 literally. (Bug#9458)
2831
9bade7b2
EZ
28322011-09-18 Eli Zaretskii <eliz@gnu.org>
2833
2834 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
2835
e5e9d610
PE
28362011-09-18 Paul Eggert <eggert@cs.ucla.edu>
2837
87e4427a
PE
2838 Fix minor problem found by static checking.
2839 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
2840 initialized, to pacify gcc -Wuninitialized.
2841
e5e9d610
PE
2842 * fileio.c: Report proper errno when syscall falls.
2843 (Finsert_file_contents): Save and restore errno,
2844 so that report_file_error outputs the correct diagnostic.
2845 (Fwrite_region) [CLASH_DETECTION]: Likewise.
2846
a1674f0b
EZ
28472011-09-18 Eli Zaretskii <eliz@gnu.org>
2848
2849 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
2850
fbfb6dd4
EZ
28512011-09-17 Eli Zaretskii <eliz@gnu.org>
2852
2853 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
2854 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
2855
bb187662
EZ
28562011-09-17 Eli Zaretskii <eliz@gnu.org>
2857
1137e8b8 2858 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 2859 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
2860
2861 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
2862 (bidi_find_paragraph_start): Search back for paragraph beginning
2863 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
2864 (bidi_move_to_visually_next): Only trigger paragraph-related
2865 computations when the last character is a newline or at EOB, not
2866 just any NEUTRAL_B. (Bug#9470)
2867
bb187662
EZ
2868 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
2869 truncated lines if point is covered by a display string. (Bug#9524)
2870
2e621251
PE
28712011-09-16 Paul Eggert <eggert@cs.ucla.edu>
2872
2873 * xselect.c: Relax test for outgoing X longs (Bug#9498).
2874 (cons_to_x_long): New function.
2875 (lisp_data_to_selection_data): Use it. Correct the test for
2876 short-versus-long data; it was negated. Break out of vector
2877 loop, for efficiency, when a long datum is discovered.
2878
91a15bc6
SM
28792011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
2880
2881 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
2882
b41c3a35
EZ
28832011-09-16 Eli Zaretskii <eliz@gnu.org>
2884
2885 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
2886 GCC PR/17406) by declaring this function with external scope.
2887
7812ba2d
PE
28882011-09-15 Paul Eggert <eggert@cs.ucla.edu>
2889
2890 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
2891 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
2892
cf7edc2a
AS
28932011-09-15 Andreas Schwab <schwab@linux-m68k.org>
2894
2895 * editfns.c (Fformat): Correctly handle text properties on "%%".
2896
bd01620e
EZ
28972011-09-15 Eli Zaretskii <eliz@gnu.org>
2898
2899 * xterm.c (x_draw_composite_glyph_string_foreground):
2900 * w32term.c (x_draw_composite_glyph_string_foreground):
2901 * term.c (encode_terminal_code):
2902 * composite.c (composition_update_it, get_composition_id):
2903 * xdisp.c (get_next_display_element)
2904 (fill_composite_glyph_string): Add comments about special meaning
2905 of TAB characters in a composition.
2906
a02719a3
PE
29072011-09-15 Paul Eggert <eggert@cs.ucla.edu>
2908
2909 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
2910 This occurs when processing a multibyte format.
2911 Problem reported by Wolfgang Jenker.
a02719a3 2912
72589a3c
JB
29132011-09-15 Johan Bockgård <bojohan@gnu.org>
2914
2915 * xdisp.c (try_cursor_movement): Only check for exact match if
2916 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
2917
1c14176c
PE
29182011-09-14 Paul Eggert <eggert@cs.ucla.edu>
2919
2920 Remove unused external symbols.
2921 * dispextern.h (calc_pixel_width_or_height): Remove decl.
2922 * xdisp.c (calc_pixel_width_or_height): Now static.
2923 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
2924 * indent.c (check_display_width):
2925 * w32term.c: Fix comment to match code.
2926 * xterm.c, xterm.h (x_catching_errors): Remove.
2927
d2eea5b5
PE
29282011-09-14 Paul Eggert <eggert@cs.ucla.edu>
2929
2930 * xselect.c: Use signed conversions more consistently (Bug#9498).
2931 (selection_data_to_lisp_data): Assume incoming selection data are
2932 signed integers, not unsigned. This is to be consistent with
2933 outgoing selection data, which was modified to use signed integers
2934 in as part of the fix to Bug#9196 in response to Jan D.'s comment
2935 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
2936 expects long, not unsigned long.
2937
46888499
EZ
29382011-09-14 Eli Zaretskii <eliz@gnu.org>
2939
2940 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
2941 computation of loop end. Reported by Johan Bockgård
2942 <bojohan@gnu.org>.
2943
ef8ef9fb
CY
29442011-09-13 Chong Yidong <cyd@stupidchicken.com>
2945
2946 * frame.c (Fother_visible_frames_p): Function deleted.
2947
fa819fed
EZ
29482011-09-12 Eli Zaretskii <eliz@gnu.org>
2949
2950 * indent.c (compute_motion): Process display vector front to back
2951 rather than the other way around. (Bug#2496)
2952
2ba8e008
SM
29532011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2954
2955 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
2956
20f53c69
CY
29572011-09-11 Chong Yidong <cyd@stupidchicken.com>
2958
2959 * minibuf.c (Fread_from_minibuffer): Doc fix.
2960
d562d7a4
EZ
29612011-09-11 Eli Zaretskii <eliz@gnu.org>
2962
2963 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
2964 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
2965
1c4d7f3d
LMI
29662011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
2967
2968 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
2969 value for non-existent files.
2970
b885bf36
EZ
29712011-09-11 Eli Zaretskii <eliz@gnu.org>
2972
2973 * fileio.c (Finsert_file_contents): If the file cannot be opened,
2974 set its "size" to -1. This will set the modtime_size field of
2975 the corresponding buffer to -1, which is what
2976 verify-visited-file-modtime expects for files that do not exist.
2977 (Bug#9139)
2978
6612f0bf
PE
29792011-09-11 Paul Eggert <eggert@cs.ucla.edu>
2980
2981 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
2982 here ...
2983 * lisp.h: ... from here. push_key_description is no longer
2984 defined in keyboard.c, so its declaration should not be in
2985 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
2986 logically belongs with push_key_description.
2987
dfb3f755
PE
29882011-09-10 Paul Eggert <eggert@cs.ucla.edu>
2989
2990 * buffer.h: Include <sys/types.h> instead of <time.h>.
2991 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
2992 Problem reported by Herbert J. Skuhra.
2993
3134906c
LMI
29942011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
2995
2996 * xml.c (parse_region): Make the parsing work for
2997 non-comment-starting XML files again (bug#9144).
2998
8d903f4e
AS
29992011-09-10 Andreas Schwab <schwab@linux-m68k.org>
3000
3001 * image.c (gif_load): Fix calculation of bottom and right corner.
3002 (Bug#9468)
3003
80ad64f4
EZ
30042011-09-10 Eli Zaretskii <eliz@gnu.org>
3005
3006 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
3007 redisplay in small windows.
3008
208a048d
EZ
30092011-09-09 Eli Zaretskii <eliz@gnu.org>
3010
3011 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
3012
9b1c252e
MR
30132011-09-08 Martin Rudalics <rudalics@gmx.at>
3014
3015 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
3016 Operate on live windows only.
3017
2949f33b
JB
30182011-09-08 Juanma Barranquero <lekktu@gmail.com>
3019
3020 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
3021
e08dcafd
EZ
30222011-09-07 Eli Zaretskii <eliz@gnu.org>
3023
3024 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
3025 only under bidi iteration.
3026
115b96bd
JD
30272011-09-07 Jan Djärv <jan.h.d@swipnet.se>
3028
3029 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
3030
c8199d0f
PE
30312011-09-06 Paul Eggert <eggert@cs.ucla.edu>
3032
3033 isnan: Fix porting problem to Solaris 10 with bundled gcc.
3034 Without this fix, the command to link temacs failed due to an
3035 undefined symbol __builtin_isnan. This is because
3036 /usr/include/iso/math_c99.h #defines isnan(x) to
3037 __builtin_isnan(x), but the bundled gcc, which identifies itself
3038 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
3039 a __builtin_isnan.
3040 * floatfns.c (isnan): #undef, and then #define to a clone of
3041 what's in data.c.
3042 (Fisnan): Always define, since it's always available now.
3043 (syms_of_floatfns): Always define isnan at the Lisp level.
3044
e39b275c 30452011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
3046
3047 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
3048
b2db44d9 30492011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 3050
f4af5137 3051 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
3052 The previous code assumed that file offsets (off_t values) fit in
3053 EMACS_INT variables, which is not true on typical 32-bit hosts.
3054 The code messed up by falsely reporting buffer overflow in cases
3055 such as (insert-file-contents "big" nil 1 2) into an empty buffer
3056 when "big" contains more than 2**29 bytes, even though this
3057 inserts just one byte and does not overflow the buffer.
3058 (Finsert_file_contents): Store file offsets as off_t
3059 values, not as EMACS_INT values. Check for overflow when
3060 converting between EMACS_INT and off_t. When checking for
3061 buffer overflow or for overlap, take the offsets into account.
3062 Don't use EMACS_INT for small values where int suffices.
3063 When checking for overlap, fix a typo: ZV was used where
3064 ZV_BYTE was intended.
3065 (Fwrite_region): Don't assume off_t fits into 'long'.
3066 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
3067
ecfc0a49
MA
30682011-09-05 Michael Albinus <michael.albinus@gmx.de>
3069
3070 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
3071
6511acf2 30722011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 3073
0999621a 3074 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
3075
3076 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 3077 (esprintf, exprintf, evxprintf): New functions.
62f19c19 3078 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 3079 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
3080 (modify_event_symbol): Do not assume that the length of
3081 name_alist_or_stem is safe to alloca and fits in int.
3082 (Fexecute_extended_command): Likewise for function name and binding.
3083 (Frecursion_depth): Wrap around reliably on integer overflow.
3084 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
3085 since some callers pass EMACS_INT values.
3086 (Fsingle_key_description): Don't crash if symbol name contains more
3087 than MAX_ALLOCA bytes.
3088 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
3089 (get_minibuffer): Arg is now EMACS_INT, not int.
3090 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 3091 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
3092 * window.h (command_loop_level, minibuf_level): Reflect API changes.
3093
2be7d702
PE
3094 * dbusbind.c (signature_cat): New function.
3095 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
3096 Do not overrun buffer; instead, report string overflow.
3097
9d1df220
PE
3098 * dispnew.c (add_window_display_history): Don't overrun buffer.
3099 Truncate instead; this is OK since it's just a log.
3100
33ef5c64
PE
3101 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
3102 even if the time zone offset is outlandishly large.
3103 Don't mishandle offset == INT_MIN.
3104
66c6fdd5
PE
3105 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
3106 when creating daemon; the previous buffer-overflow check was incorrect.
3107
d749b01b
PE
3108 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
3109 which has the guts of the old verror function.
3110
b5cd1905
PE
3111 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
3112 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
3113
6e1a67fb
PE
3114 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
3115 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 3116 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 3117 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
3118 length of string rather than counting it via multiple sprintfs;
3119 that's simpler and more reliable.
c21721cc
PE
3120 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
3121 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
3122 sprintf, in case result does not fit in int.
3123
c57b67fc
PE
3124 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
3125 (fontset_from_font): Print it.
3126
8a401434
PE
3127 * frame.c (tty_frame_count): Now printmax_t, not int.
3128 (make_terminal_frame, set_term_frame_name): Print it.
3129 (x_report_frame_params): In X, window IDs are unsigned long,
3130 not signed long, so print them as unsigned.
3131 (validate_x_resource_name): Check for implausibly long names,
3132 and don't assume name length fits in 'int'.
3133 (x_get_resource_string): Don't blindly alloca invocation name;
3134 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
3135 not fit in int.
3136
6e1a67fb
PE
3137 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
3138 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
3139 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
3140
0df02bf3
PE
3141 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
3142 Use esprintf, not sprintf, in case result does not fit in int.
3143
48e30793
PE
3144 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
3145 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
3146 it as a large positive number.
3147 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
3148 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
3149
a66ff6d8
PE
3150 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
3151 in case result does not fit in int.
3152
aca216ff
PE
3153 * print.c (float_to_string): Detect width overflow more reliably.
3154 (print_object): Make sprintf buffer a bit bigger, to avoid potential
3155 buffer overrun. Don't assume list length fits in 'int'. Treat
3156 print length of 0 as 0, not as infinity; to be consistent with other
3157 uses of print length in this function. Don't overflow print length
3158 index. Don't assume hash table size fits in 'long', or that
3159 vectorlike size fits in 'unsigned long'.
3160
31c286f7
PE
3161 * process.c (make_process): Use printmax_t, not int, to format
3162 process-name gensyms.
3163
55e5faa1
PE
3164 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
3165
80f2e268
PE
3166 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
3167 to avoid potential buffer overrun.
3168
670741ab
PE
3169 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
3170 if X resource line is longer than 512 bytes.
3171
b7163a50
PE
3172 * xfns.c (x_window): Make sprintf buffer a bit bigger
3173 to avoid potential buffer overrun.
3174
ae58ff1f
PE
3175 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
3176
c43c8a6a
PE
3177 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
3178
3f8236f4
PE
31792011-09-04 Paul Eggert <eggert@cs.ucla.edu>
3180
53e9fe90 3181 Integer overflow fixes for scrolling, etc.
6511acf2
PE
3182 Without these, Emacs silently mishandles large integers sometimes.
3183 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
3184 it were "C-u 1 M-x recenter" on a typical 64-bit host.
3185
6511acf2
PE
3186 * xdisp.c (try_window_id): Check Emacs fixnum range before
3187 converting to 'int'.
806add1d 3188
6511acf2 3189 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
3190 Check that an Emacs fixnum is in range before assigning it to 'int'.
3191 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
3192 values converted from Emacs fixnums.
3193 (Frecenter): Don't wrap around a line count if it is out of 'int'
3194 range; instead, treat it as an extreme value.
3195 (Fset_window_configuration, compare_window_configurations):
3196 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
3197
6511acf2
PE
3198 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
3199 that can exceed INT_MAX. Check that EMACS_INT value is in range
3200 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
3201 (match_limit): Don't assume that a fixnum can fit in 'int'.
3202
6511acf2 3203 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
3204 exceed INT_MAX.
3205
6511acf2 3206 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
3207 (Fvertical_motion): Don't wrap around LINES values that don't fit
3208 in 'int'. Instead, treat them as extreme values. This is good
3209 enough for windows, which can't have more than INT_MAX lines anyway.
3210
fcb901a7
LMI
32112011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
3212
0f2f6b6d
LMI
3213 * Require libxml/parser.h to avoid compilation warning.
3214
fcb901a7
LMI
3215 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
3216
3217 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
3218 since this reportedly can destroy thread storage.
3219
6e20a0d4
CY
32202011-08-30 Chong Yidong <cyd@stupidchicken.com>
3221
3222 * syntax.c (find_defun_start): Update all cache variables if
3223 exiting early (Bug#9401).
3224
148ae00e
EZ
32252011-08-30 Eli Zaretskii <eliz@gnu.org>
3226
f6cfbd8f
EZ
3227 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
3228
148ae00e
EZ
3229 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
3230 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
3231 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
3232
3233 * term.c (tty_append_glyph): New function.
3234 (produce_stretch_glyph): Static function and its prototype deleted.
3235
a66cfb1c
SM
3236 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
3237 Add prototypes.
148ae00e 3238
c4a07a4c
PE
32392011-08-29 Paul Eggert <eggert@cs.ucla.edu>
3240
3241 * image.c (parse_image_spec): Check for nonnegative, not for positive,
3242 when checking :margin (Bug#9390).
3243 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 3244 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
3245 so that the name doesn't mislead. All uses changed.
3246
6bc8cd65
JB
32472011-08-28 Johan Bockgård <bojohan@gnu.org>
3248
3249 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
3250 set_tty_hooks.
3251
dca4927e
EZ
32522011-08-27 Eli Zaretskii <eliz@gnu.org>
3253
3254 * xdisp.c (move_it_to): Don't bail out early when reaching
3255 position beyond to_charpos, if we are scanning backwards.
3256 (move_it_vertically_backward): When DY == 0, make sure we get to
3257 the first character in the line after the newline.
3258
f2cad773
PE
32592011-08-27 Paul Eggert <eggert@cs.ucla.edu>
3260
3261 * ccl.c: Improve and simplify overflow checking (Bug#9196).
3262 (ccl_driver): Do not generate an out-of-range pointer.
3263 (Fccl_execute_on_string): Remove unnecessary check for
3264 integer overflow, noted by Stefan Monnier in
3265 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
3266 Remove a FIXME that didn't need fixing.
3267 Simplify the newly-introduced buffer reallocation code.
3268
0cae2cdb
JB
32692011-08-27 Juanma Barranquero <lekktu@gmail.com>
3270
3271 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
3272
5fc295a4 32732011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 3274
70c60eb2 3275 Integer and memory overflow issues (Bug#9196).
726e0ab1 3276
d31850da
PE
3277 * doc.c (get_doc_string): Rework so that
3278 get_doc_string_buffer_size is the actual buffer size, rather than
3279 being 1 less than the actual buffer size; this makes xpalloc more
3280 convenient.
3281
a69fbedb
PE
3282 * image.c (x_allocate_bitmap_record, cache_image):
3283 * xselect.c (Fx_register_dnd_atom):
3284 Simplify previous changes by using xpalloc.
3285
fe5c5d37
PE
3286 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
3287 since either will do and ptrdiff_t is convenient with xpalloc.
3288
0065d054
PE
3289 * charset.c (charset_table_size)
3290 (struct charset_sort_data.priority): Now ptrdiff_t.
3291 (charset_compare): Don't overflow if priorities differ greatly.
3292 (Fsort_charsets): Don't assume list length fits in int.
3293 Check for size-calculation overflow when allocating sort data.
3294 (syms_of_charset): Allocate an initial charset table that is
3295 just under 64 KiB, to avoid problems with glibc malloc and mmap.
3296
3297 * cmds.c (internal_self_insert): Check for size-calculation overflow.
3298
3299 * composite.h (struct composition.glyph_len): Now int, not unsigned.
3300 The actual value is always <= INT_MAX, and leaving it unsigned made
3301 overflow checking harder.
3302
3303 * dispextern.h (struct glyph_matrix.rows_allocated)
3304 (struct face_cache.size): Now ptrdiff_t, for convenience in use
3305 with xpalloc. The values are still always <= INT_MAX.
3306
3307 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
3308
3309 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
3310 (SAFE_NALLOCA): New macro.
3311
3312 * region-cache.c (struct boundary.pos, find_cache_boundary)
3313 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
3314 (set_cache_region, invalidate_region_cache)
3315 (revalidate_region_cache, know_region_cache, region_cache_forward)
3316 (region_cache_backward, pp_cache):
3317 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
3318 so that ptrdiff_t * can be passed to xpalloc.
3319 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
3320 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
3321 (pp_cache): Don't assume cache_len fits in int.
3322 * region-cache.h: Adjust extern decls to match.
3323
3324 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
3325 EMACS_INT, since either will do, for xpalloc.
3326
3327 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
3328 (xnmalloc, xnrealloc, xpalloc): New functions.
3329
726e0ab1
PE
3330 * bidi.c (bidi_shelve_header_size): New constant.
3331 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
3332 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
3333
51f30bc5 3334 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
3335 * buffer.c (overlays_at, overlays_in, record_overlay_string)
3336 (overlay_strings):
3337 Don't update size of array until after memory allocation succeeds,
3338 because xmalloc/xrealloc may not return.
0065d054
PE
3339 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
3340 now that we have proper integer overflow checking.
3341 (record_overlay_string, overlay_strings): Catch overflows when
3342 calculating size of overlay_str_buf.
726e0ab1 3343
0065d054
PE
3344 * callproc.c (Fcall_process): Check for size overflow when
3345 calculating size of args2.
3346 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
3347 Normally we prefer signed values, but sticking with ptrdiff_t would
3348 require adding more-complicated checks.
726e0ab1
PE
3349
3350 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
3351 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
3352 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 3353 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
3354
3355 * character.c (Fstring): Check for size-calculation overflow.
3356
3357 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
3358 unnecessary integer overflow. Check for size overflow.
3359 (encode_coding_object): Don't update size until xmalloc succeeds.
3360
3361 * composite.c (get_composition_id): Check for overflow in glyph
3362 length calculations.
3363
3364 Integer and memory overflow fixes for display code.
3365 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
3366 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
3367 (scrolling_window): Check for overflow in size calculations.
3368 (line_draw_cost, realloc_glyph_pool, add_row_entry):
3369 Don't assume glyph table len fits in int.
3370 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
3371 (row_table_size): Now ptrdiff_t, not int.
3372 (scrolling_window): Avoid overflow in size calculations.
3373 Don't update size until allocation succeeds.
3374 * fns.c (concat): Check for overflow in size calculations.
3375 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
3376 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
3377 (NEXT_ALMOST_PRIME_LIMIT): New constant.
3378
3379 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
3380 (get_doc_string): Check for size calculation overflow.
3381 Don't update size until allocation succeeds.
3382 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
3383 EMACS_INT, where ptrdiff_t will do.
3384 (Fsubstitute_command_keys): Check for string overflow.
3385
3386 * editfns.c (set_time_zone_rule): Don't assume environment length
3387 fits in int.
3388 (message_length): Now ptrdiff_t, not int.
3389 (Fmessage_box): Don't update size until allocation succeeds.
3390 Don't assume message length fits in int.
3391 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
3392
0065d054
PE
3393 * emacs.c (main): Do not reallocate argv, since there is a null at
3394 the end that can be overwritten, and this way there's no need to
3395 worry about size-calculation overflow.
3396 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
3397
3398 * eval.c (init_eval_once, grow_specpdl): Don't update size until
3399 alloc succeeds.
3400 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
3401
3402 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
3403 (x_set_scroll_bar_width, x_figure_window_size):
3404 Check for integer overflow.
3405 (x_set_alpha): Do not assume XINT fits in int.
3406
3407 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
3408 This is for the members text_lines, text_cols, total_lines, total_cols,
3409 where the system imposes an 'int' limit.
3410
3411 * fringe.c (Fdefine_fringe_bitmap):
3412 Don't update size until alloc works.
3413
3414 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
3415 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
3416
3417 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
3418 Check for size-calculation overflow.
3419 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
3420 do, as we prefer signed integers.
3421 (id_to_widget.max_size, id_to_widget.used)
3422 (xg_store_widget_in_map, xg_remove_widget_from_map)
3423 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
3424 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
3425 Use and return ptrdiff_t, not int.
3426 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
3427 * gtkutil.h: Change prototypes to match the above.
3428
3429 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
3430 are duplicate now that they've been promoted to lisp.h.
3431 (x_allocate_bitmap_record, x_alloc_image_color)
3432 (make_image_cache, cache_image, xpm_load):
3433 Don't update size until alloc is done.
3434 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
3435 (x_detect_edges):
3256efce 3436 Check for size calculation overflow.
726e0ab1
PE
3437 (ct_colors_allocated_max): New constant.
3438 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
3439 overflow.
3256efce 3440
726e0ab1
PE
3441 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
3442 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
3443 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
3444 Use ptrdiff_t, not int, to count maps.
3445 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
3446 calculations. Don't update size until allocation succeeds.
3447 Redo calculations to avoid overflow.
726e0ab1
PE
3448 * keyboard.h: Change prototypes to match the above.
3449
3450 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
3451 to count maps.
3452 (current_minor_maps): Check for size calculation overflow.
3453 * keymap.h: Change prototypes to match the above.
3454
3455 * lread.c (read1, init_obarray): Don't update size until alloc done.
3456
3457 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
3458 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
3459
726e0ab1
PE
3460 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
3461 Now ptrdiff_t, not int.
3462 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
3463 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
3464
3465 * process.c (Fnetwork_interface_list): Check for overflow
3466 in size calculation.
3467
3468 * region-cache.c (move_cache_gap): Check for size calculation overflow.
3469
3470 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
3471 overflow. Don't bother calling xmalloc when xrealloc will do.
3472
3473 * search.c (Freplace_match): Check for size calculation overflow.
3474 (Fset_match_data): Don't assume list lengths fit in 'int'.
3475
3476 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
3477 for command line length. Do not attempt to address one before the
3478 beginning of an array, as that's not portable.
3479
3480 * term.c (max_frame_lines): Remove; unused.
3481 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
3482 not int.
3483 (encode_terminal_code, calculate_costs): Check for size
3484 calculation overflow.
3485 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
3486 table lengths and related sizes. Don't update size until alloc
3487 done. Redo calculations to avoid overflow.
3488 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
3489
3490 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
3491 subtracting pointers.
3492 (gobble_line): Check for overflow more carefully. Don't update size
3493 until alloc done.
3494
3495 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
3496 Don't update size until alloc done.
3497 Redo size calculations to avoid overflow.
3498 Check for size calculation overflow.
0065d054 3499 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
3500
3501 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
3502 Use ptrdiff_t, not int, for sizes.
3503 (store_mode_line_noprop_char): Don't update size until alloc done.
3504
0065d054
PE
3505 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
3506 Use ptrdiff_t, not int, for sizes.
3507 (Finternal_make_lisp_face, cache_face):
3508 Check for size calculation overflow.
3509 (cache_face): Treat size calculation overflows as if they were
3510 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
3511
3512 * xfns.c (x_encode_text, x_set_name_internal)
3513 (Fx_change_window_property): Use ptrdiff_t, not int, to count
3514 sizes, since they can exceed INT_MAX in size. Check for size
3515 calculation overflow.
3516
0065d054
PE
3517 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
3518 (xg_select): Check for size calculation overflow.
726e0ab1
PE
3519 Don't update size until alloc done.
3520
0065d054 3521 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 3522 as sprintf is limited to int lengths.
1d526e2f 3523
252c5ee1
PE
3524 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
3525 (X_LONG_MIN): New macros.
864d7ce7
PE
3526 Use them to make the following changes clearer.
3527 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
3528 This change doesn't affect the value now, but it may help remind
3529 future maintainers not to raise the value too much later.
3530 (SELECTION_QUANTUM): Remove, replacing with ...
3531 (selection_quantum): ... new function, which avoids overflow.
3532 All uses changed.
3533 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
3534 assumption that selection length fits in 'int'.
3535 (x_reply_selection_request, x_handle_selection_request)
3536 (x_get_window_property, receive_incremental_selection)
3537 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
3538 (lisp_data_to_selection_data, clean_local_selection_data):
3539 Use ptrdiff_t, not int, to record length of selection.
3540 (x_reply_selection_request, x_get_window_property)
3541 (receive_incremental_selection, x_property_data_to_lisp):
3542 Redo calculations to avoid overflow.
3543 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 3544 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
3545 something.
3546 (x_get_window_property, receive_incremental_selection)
3547 (lisp_data_to_selection_data, x_property_data_to_lisp):
3548 Check for size-calculation overflow.
3549 (x_get_window_property, receive_incremental_selection)
3550 (lisp_data_to_selection_data, Fx_register_dnd_atom):
3551 Don't store size until memory allocation succeeds.
3552 (x_get_window_property): Plug memory leak on memory exhaustion.
3553 Don't double-block input; malloc is safe here. Don't assume 2**34
3554 - 4 fits in unsigned long. Add an xassert to check
3555 XGetWindowProperty overflow. Be more careful about overflow
3556 calculations, and distinguish size from memory overflow better.
3557 (receive_incremental_selection): When tracing, don't assume
3558 unsigned int is less than INT_MAX.
3559 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
3560 harmful) conversions of unsigned short to int.
3561 (lisp_data_to_selection_data): Don't assume that integers
3562 in the range -65535 through -1 fit in an X unsigned short.
3563 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
3564 result parameters unless successful. Rely on cons_to_unsigned
3565 to report problems with elements; the old code wasn't right anyway.
3566 (x_check_property_data): Check for int overflow; we cannot use
3567 a wider type due to X limits.
3568 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
3569
726e0ab1 3570 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 3571
0065d054
PE
3572 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
3573 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
3574 (x_color_cells): Don't store size until memory allocation succeeds.
3575 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 3576 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
3577 (x_term_init): Don't assume length fits in int (sprintf is limited
3578 to int size).
bc18e09d 3579
ebfa62c0
PE
3580 Use ptrdiff_t for composition IDs.
3581 * character.c (lisp_string_width):
3582 * composite.c (composition_table_size, n_compositions)
3583 (get_composition_id, composition_gstring_from_id):
3584 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
3585 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
3586 * window.c (Frecenter):
3587 Use ptrdiff_t, not int, for composition IDs.
3588 * composite.c (get_composition_id): Check for integer overflow.
3589 * composite.h: Adjust prototypes to match the above changes.
3590
d3411f89
PE
3591 Use ptrdiff_t for hash table indexes.
3592 * category.c (hash_get_category_set):
3593 * ccl.c (ccl_driver):
3594 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
3595 * coding.c (coding_system_charset_list, detect_coding_system):
3596 * coding.h (struct coding_system.id):
3597 * composite.c (get_composition_id, gstring_lookup_cache):
3598 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
3599 * image.c (xpm_get_color_table_h):
3600 * lisp.h (hash_lookup, hash_put):
3601 * minibuf.c (Ftest_completion):
3602 Use ptrdiff_t for hash table indexes, not int (which is too
3603 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
3604 32-bit --with-wide-int hosts).
3605
e097a6fa
PE
3606 * charset.c (Fdefine_charset_internal): Check for integer overflow.
3607 Add a FIXME comment about memory leaks.
3608 (syms_of_charset): Don't assume xmalloc returns.
3609
5637687f
PE
3610 Don't assume that stated character widths fit in int.
3611 * character.c (Fchar_width, c_string_width, lisp_string_width):
3612 * character.h (CHAR_WIDTH):
3613 * indent.c (MULTIBYTE_BYTES_WIDTH):
3614 Use sanitize_char_width to avoid undefined and/or bad behavior
3615 with outlandish widths.
a66cfb1c 3616 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
3617 now that we have two such functions. All uses changed.
3618 (sanitize_char_width): New inline function.
3619
a2271ba2
PE
3620 Don't assume that tab-width fits in int.
3621 * character.h (sanitize_width): New inline function.
3622 (SANE_TAB_WIDTH): New macro.
3623 (ASCII_CHAR_WIDTH): Use it.
3624 * indent.c (sane_tab_width): Remove. All uses replaced by
3625 SANE_TAB_WIDTH (current_buffer).
3626 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
3627
18c52557
PE
3628 * fileio.c: Integer overflow issues with file modes.
3629 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
3630
caeeedc1
PE
3631 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
3632 Remove unreachable code.
3633 (read_hex, load_charset_map_from_file): Check for integer overflow.
3634
6df6ae42 3635 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
3636 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
3637 (x_send_scroll_bar_event): Likewise. Check that the size does not
3638 exceed limits imposed by XClientMessageEvent, as well as the usual
3639 ptrdiff_t and size_t limits.
3640
b13995db
PE
3641 * keyboard.c: Overflow, signedness and related fixes.
3642 (make_lispy_movement): Use same integer type in forward decl
3643 that is used in the definition.
3644 (read_key_sequence, keyremap_step):
3645 Change bufsize argument back to int, undoing my 2011-03-30 change.
3646 We prefer signed types, and int is wide enough here.
3647 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
3648 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
3649 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
3650 length, not size_t. Use ptrdiff_t for index, not int.
3651 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
3652 possibility of integer overflow.
3653
13464394
PE
3654 Overflow, signedness and related fixes for images.
3655
3656 * dispextern.h (struct it.stack[0].u.image.image_id)
3657 (struct_it.image_id, struct image.id, struct image_cache.size)
3658 (struct image_cache.used, struct image_cache.ref_count):
3659 * gtkutil.c (update_frame_tool_bar):
3660 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
3661 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
3662 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
3663 * nsmenu.m (update_frame_tool_bar):
3664 * xdisp.c (calc_pixel_width_or_height):
3665 * xfns.c (image_cache_refcount):
3666 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
3667 on typical 64-bit hosts.
3668
3669 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
3670 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
3671 Omit unnecessary casts to int.
3672 (parse_image_spec): Check that integers fall into 'int' range
3673 when the callers expect that.
3674 (image_ascent): Redo ascent calculation to avoid int overflow.
3675 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
3676 (lookup_image): Remove unnecessary tests.
3677 (xbm_image_p): Locals are now of int, not EMACS_INT,
3678 since parse_image_check makes sure they fit into int.
3679 (png_load, gif_load, svg_load_image):
3680 Prefer int to unsigned where either will do.
3681 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
3682 old tiff_error_handler and tiff_warning_handler.
3683 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
3684 stack buffer overflows. It uses only the features of vsnprintf
3685 that are common to both POSIX and native Microsoft.
3686 (tiff_error_handler, tiff_warning_handler): Use it.
3687 (tiff_load, gif_load, imagemagick_load_image):
3688 Don't assume :index value fits in 'int'.
3689 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
3690 (imagemagick_load_image): Check that crop parameters fit into
3691 the integer types that MagickCropImage accepts. Don't assume
3692 Vimagemagick_render_type has a nonnegative value. Don't assume
3693 size_t fits in 'long'.
3694 (gs_load): Use printmax_t to print the widest integers possible.
3695 Check for integer overflow when computing image height and width.
3696
c11821d4
EZ
36972011-08-26 Eli Zaretskii <eliz@gnu.org>
3698
3699 * xdisp.c (redisplay_window): Don't force window start if point
3700 will be invisible in the resulting window. (Bug#9324)
3701
0c95fcf7
EZ
37022011-08-25 Eli Zaretskii <eliz@gnu.org>
3703
3704 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
3705 the display spec is of the form `(space ...)'.
3706 (handle_display_spec): Return the value returned by
3707 handle_single_display_spec, not just 1 or zero.
3708 (handle_single_display_spec): If the display spec is of the form
3709 `(space ...)', and specifies display in the text area, return 2
3710 rather than 1.
fee65a97 3711 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
3712 accurately, and prefer exact match for point under bidi.
3713 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
3714
3715 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
3716 into disp_prop; all users changed.
3717
3718 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
3719 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
3720 for the text covered by the display property.
3721
e4ed06f1
CY
37222011-08-25 Chong Yidong <cyd@stupidchicken.com>
3723
3724 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
3725 Change return value to nil.
3726 (Frecord_buffer): Delete unused function.
3727
f67cdd7f
EZ
37282011-08-24 Eli Zaretskii <eliz@gnu.org>
3729
5980d4c6
EZ
3730 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
3731 buffers, return left-to-right.
8610fe8b
EZ
3732 (set_cursor_from_row): Consider candidate row a win if its glyph
3733 represents a newline and point is on that newline. Fixes cursor
3734 positioning on the newline at EOL of R2L text within L2R
3735 paragraph, and vice versa.
3736 (try_cursor_movement): Check continued rows, in addition to
3737 continuation rows. Fixes unwarranted scroll when point enters a
3738 continued line of R2L text within an L2R paragraph, or vice versa.
3739 (cursor_row_p): Consider the case of point being equal to
3740 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
3741 from the end of a short line to the beginning of a continued line
3742 of R2L text within L2R paragraph.
3743 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
3744 composed characters.
5980d4c6 3745
f67cdd7f
EZ
3746 * bidi.c (bidi_check_type): Use xassert.
3747 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
3748 members.
3749
bca633fb
EZ
37502011-08-23 Eli Zaretskii <eliz@gnu.org>
3751
3752 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
3753 a character.
3754
4a5885a7
CY
37552011-08-23 Chong Yidong <cyd@stupidchicken.com>
3756
3757 * nsfont.m (ns_otf_to_script): Fix typo.
3758
0902a04e
KH
37592011-08-22 Kenichi Handa <handa@m17n.org>
3760
3761 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
3762 extra slot even if the purpose is char-code-property-table.
3763
1a2e6670
EZ
37642011-08-23 Eli Zaretskii <eliz@gnu.org>
3765
8ddde651
EZ
3766 * xdisp.c (redisplay_window): When computing centering_position,
3767 account for the height of the header line. (Bug#8874)
3768
425cc014
EZ
3769 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
3770 instead of CHAR_TO_BYTE. Fixes a crash when a completion
3771 candidate is selected by the mouse, and that candidate has a
3772 composed character under the mouse.
3773
1a2e6670
EZ
3774 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
3775 coordinates reported by pos-visible-in-window-p for a composed
3776 character in column zero.
3777
8b76d6f8
SM
37782011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
3779
3780 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
3781
dac347dd
EZ
37822011-08-22 Eli Zaretskii <eliz@gnu.org>
3783
3784 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
3785 consider it a hit if to_charpos is anywhere in the range of the
3786 composed buffer positions.
3787
e013fb34
CY
37882011-08-22 Chong Yidong <cyd@stupidchicken.com>
3789
3790 * image.c (gif_load): Don't assume that each subimage has the same
3791 dimensions as the base image. Handle disposal method that is
3792 "undefined" by the gif spec (Bug#9335).
3793
bd1ba3e8
CY
37942011-08-20 Chong Yidong <cyd@stupidchicken.com>
3795
3796 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 3797 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 3798
54a1215b
EZ
37992011-08-19 Eli Zaretskii <eliz@gnu.org>
3800
823564e5
EZ
3801 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
3802 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
3803 from an Org mode buffer to a Speedbar frame.
3804
54a1215b
EZ
3805 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
3806 a composition, take its buffer position from IT->cmp_it.charpos.
3807 Fixes cursor positioning at the beginning of a line that begins
3808 with a composed character.
3809
9778ebcc
EZ
38102011-08-18 Eli Zaretskii <eliz@gnu.org>
3811
0be6ee06
EZ
3812 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
3813 character bidirectional type, use STRONG_L instead. Fixes crashes
3814 in a buffer produced by `describe-categories'.
3815
9778ebcc
EZ
3816 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
3817 members before the level stack, so they would be saved and
3818 restored when copying iterator state. Fixes incorrect reordering
3819 around TABs covered by display properties.
3820
156bffbe
AS
38212011-08-18 Andreas Schwab <schwab@linux-m68k.org>
3822
6b02f655 3823 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 3824
72ad093b
CY
38252011-08-17 Chong Yidong <cyd@stupidchicken.com>
3826
3827 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
3828 (internal_condition_case_2, internal_condition_case_n):
3829 Remove unnecessary aborts (Bug#9081).
72ad093b 3830
35774242
EZ
38312011-08-17 Eli Zaretskii <eliz@gnu.org>
3832
3833 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
3834 has no `load' handler, try opening the file locally. (Bug#9311)
3835
db76dd85
KB
38362011-08-16 Ken Brown <kbrown@cornell.edu>
3837
3838 * gmalloc.c: Expand comment.
3839
b215eee5
EZ
38402011-08-16 Eli Zaretskii <eliz@gnu.org>
3841
3842 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
3843 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
3844
a4579d33
KB
38452011-08-16 Ken Brown <kbrown@cornell.edu>
3846
3847 Fix memory allocation problems in Cygwin build (Bug#9273).
3848
3849 * unexcw.c ( __malloc_initialized): Declare external variable.
3850 (fixup_executable): Force the dumped emacs to reinitialize malloc.
3851
8b76d6f8
SM
3852 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
3853 New variables.
a4579d33
KB
3854 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
3855 dumped emacs.
3856 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
3857 in the static heap.
3858 [CYGWIN] (special_realloc): New function.
3859 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
3860 requests to realloc storage in the static heap.
3861
3ebec551
PE
38622011-08-15 Paul Eggert <eggert@cs.ucla.edu>
3863
3864 * bidi.c (bidi_initialize): Remove unused local.
3865
9fd8be00
EZ
38662011-08-15 Eli Zaretskii <eliz@gnu.org>
3867
6b02f655
SM
3868 * bidimirror.h:
3869 * biditype.h: Remove file.
3870 * makefile.w32-in ($(BLD)/bidi.$(O)):
3871 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
3872
3873 * dispextern.h: Fix a typo in the comment to bidi_type_t.
3874
3875 * chartab.c: Improve commentary for the uniprop_table API.
3876
32413314
EZ
3877 * bidi.c (bidi_paragraph_init): Support zero value of
3878 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
3879 (bidi_initialize): Use uniprop_table instead of including
3880 biditype.h and bidimirror.h.
32413314 3881
9fd8be00
EZ
3882 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
3883 coordinates of the iterator when restoring from ppos_it.
3884 (Bug#9296)
3885
5cf2b69b
KH
38862011-08-14 Kenichi Handa <handa@m17n.org>
3887
3888 * process.c (create_process): Call setup_process_coding_systems
72ad093b 3889 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 3890
daf17d00
EZ
38912011-08-14 Eli Zaretskii <eliz@gnu.org>
3892
3893 * xdisp.c (move_it_in_display_line_to): Don't invoke
3894 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
3895 ppos_it. Fixes vertical cursor motion when line beginning is
3896 covered by an image. (Bug#9296)
3897
08e3161a
JD
38982011-08-14 Jan Djärv <jan.h.d@swipnet.se>
3899
3900 * nsterm.h (ns_run_ascript): Declare.
3901 (NSAPP_DATA2_RUNASSCRIPT): Define.
3902
3903 * nsfns.m (as_script, as_result, as_status): New static variables.
3904 (ns_run_ascript): New function.
5e617bc2 3905 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
3906 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
3907 the event loop. Get status from as_status (Bug#7276).
3908
3909 * nsterm.m (sendEvent): If event is NSApplicationDefined and
3910 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
3911 the event loop (Bug#7276).
3912
a3720aa2
AS
39132011-08-14 Andreas Schwab <schwab@linux-m68k.org>
3914
3915 * gnutls.c (QCgnutls_bootprop_priority)
3916 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
3917 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
3918 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
3919 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
3920 (QCgnutls_bootprop_verify_hostname_error)
3921 (QCgnutls_bootprop_callbacks_verify): Rename from
3922 Qgnutls_bootprop_..., all uses changed.
3923
3924 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
3925 uses changed.
3926
0a0d27fb
PE
39272011-08-14 Paul Eggert <eggert@cs.ucla.edu>
3928
19d5c50c
PE
3929 * xfaces.c (Qframe_set_background_mode): Now static.
3930 * dispextern.h (Qframe_set_background_mode): Remove decl.
3931
0a0d27fb
PE
3932 * process.c (Fnetwork_interface_info): Declare local only if needed.
3933
377538cb
JD
39342011-08-13 Jan Djärv <jan.h.d@swipnet.se>
3935
3936 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
3937 (Fnetwork_interface_list): Allocate in increments of bytes instead
3938 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
3939 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
3940 sockaddr.
3941 (struct ifflag_def): notrailers is smart on OSX.
3942 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
3943 Get hardware address with getifaddrs if available.
3944
08fff70c
EZ
39452011-08-12 Eli Zaretskii <eliz@gnu.org>
3946
3947 * xdisp.c (iterate_out_of_display_property): xassert that
3948 IT->position is set to within IT->object's boundaries. Break from
3949 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
3950 when IT->position is set up wrongly due to some bug.
3951 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
3952 (push_display_prop): Allow GET_FROM_STRING as IT->method on
3953 entry. Force push_it to save on the stack the current
3954 buffer/string position, to be restored by pop_it. Fix flags in
3955 the iterator structure wrt the object coming from a display
3956 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
3957 properties. (Bug#9284)
3958
7be1c708 39592011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 3960
7be1c708
CY
3961 * fontset.c (fontset_get_font_group): Add proper type checks.
3962 (Bug#9172)
aac0c6e3 3963
7be1c708 39642011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 3965
7be1c708
CY
3966 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
3967 and LC_VERSION_MIN_MACOSX.
3968 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
3969 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 3970
97bb72a6
EZ
39712011-08-08 Eli Zaretskii <eliz@gnu.org>
3972
3973 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
3974 no-display-properties-and-no-overlays under bidi display.
3975 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 3976 properties and overlays.
97bb72a6 3977
d5617611
CY
39782011-08-08 Chong Yidong <cyd@stupidchicken.com>
3979
37e11a63
CY
3980 * editfns.c (Fset_time_zone_rule): Document relationship with the
3981 setenv function.
3982
d5617611
CY
3983 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
3984 the font entity extracted from the cache (Bug#8109).
3985
58872834
CY
39862011-08-07 Chong Yidong <cyd@stupidchicken.com>
3987
3988 * composite.c (autocmp_chars): Don't reset point. That is done by
3989 restore_point_unwind (Bug#5984).
3990
75bfc667
JL
39912011-08-07 Juri Linkov <juri@jurta.org>
3992
3993 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
3994 to show the arg `TIME' instead of `TIMEVAL'.
3995
d1410150
EZ
39962011-08-06 Eli Zaretskii <eliz@gnu.org>
3997
3998 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
3999 display property strides EOL and includes a newline, as in
4000 longlines-mode. (Bug#9254)
75b771e4
EZ
4001 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
4002 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
4003
4004 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
4005 is non-zero, even if the data buffer is NULL. Fixes a crash in
4006 vertical-motion with longlines-mode. (Bug#9254)
4007
35928349
EZ
40082011-08-05 Eli Zaretskii <eliz@gnu.org>
4009
ec7cc85b
EZ
4010 * bidi.c <bidi_cache_total_alloc>: Now static.
4011 (bidi_initialize): Initialize bidi_cache_total_alloc.
4012
8b76d6f8 4013 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
4014 cache. (Bug#9221)
4015
4016 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
4017 amount allocated this far in `bidi_cache_total_alloc'.
4018 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
4019 non-zero, only free the data buffer without restoring the cache
4020 contents. All callers changed.
4021
4022 * dispextern.h (bidi_unshelve_cache): Update prototype.
4023
4024 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
4025 (move_it_in_display_line, move_it_to)
4026 (move_it_vertically_backward, move_it_by_lines): Replace the call
4027 to xfree to an equivalent call to bidi_unshelve_cache.
4028 (move_it_in_display_line_to): Fix logic of returning
412b6358 4029 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 4030
e2e2423b
EZ
40312011-08-05 Eli Zaretskii <eliz@gnu.org>
4032
4033 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
4034 came from a string character with a `cursor' property. (Bug#9229)
4035
ae9e757a
JD
40362011-08-04 Jan Djärv <jan.h.d@swipnet.se>
4037
4038 * Makefile.in (LIB_PTHREAD): New variable.
4039 (LIBES): Add LIB_PTHREAD (Bug#9216).
4040
4041 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
4042 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
4043
213bd7f2
AS
40442011-08-04 Andreas Schwab <schwab@linux-m68k.org>
4045
6b02f655 4046 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 4047
99aaf75f
JD
40482011-08-04 Jan Djärv <jan.h.d@swipnet.se>
4049
4050 * xterm.c (x_find_topmost_parent): New function.
4051 (x_set_frame_alpha): Find topmost parent window with
4052 x_find_topmost_parent and set the property there also (bug#9181).
4053 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
4054
c74e9d86
PE
40552011-08-04 Paul Eggert <eggert@cs.ucla.edu>
4056
4057 * callproc.c (Fcall_process): Avoid vfork clobbering
4058 the local vars buffer, coding_systems, current_dir.
4059
640c8776
SM
40602011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
4061
4062 * keymap.c (Fmake_composed_keymap): Move to subr.el.
4063
f26d0e4c
PE
40642011-08-03 Paul Eggert <eggert@cs.ucla.edu>
4065
8a10d76c
PE
4066 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
4067 so that it is not optimized away.
4068
f26d0e4c
PE
4069 * xdisp.c (compute_display_string_pos): Remove unused local.
4070
55439c61
EZ
40712011-08-02 Eli Zaretskii <eliz@gnu.org>
4072
4073 Fix slow cursor motion and scrolling in large buffers with
4074 selective display, like Org Mode buffers. (Bug#9218)
4075
4076 * dispextern.h (struct bidi_it): New member disp_prop_p.
4077
4078 * xdisp.c: Remove one-slot cache of display string positions.
4079 (compute_display_string_pos): Accept an additional argument
5e617bc2 4080 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
4081 for a display string or property. If found, set DISP_PROP_P
4082 non-zero.
4083
4084 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
4085 DISP_PROP_P, and pass it to compute_display_string_pos.
4086 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
4087 non-zero. All callers of bidi_fetch_char changed.
4088
fb33fa43
SM
40892011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
4090
4091 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
4092
b099e063
DM
40932010-12-03 Don March <don@ohspite.net>
4094
4095 * keymap.c (Fdefine_key): Fix non-prefix key error message when
4096 last character M-[char] is translated to ESC [char] (bug#7541).
4097
5cc7f7af
KH
40982011-08-02 Kenichi Handa <handa@m17n.org>
4099
d0fffa3f 4100 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
4101
4102 * chartab.c (uniprop_table): Make it non-static.
4103
525d5e6e
EZ
41042011-08-01 Eli Zaretskii <eliz@gnu.org>
4105
4106 * xdisp.c (forward_to_next_line_start): Accept additional argument
4107 BIDI_IT_PREV, and store into it the state of the bidi iterator had
4108 on the newline.
4109 (reseat_at_next_visible_line_start): Use the bidi iterator state
4110 returned by forward_to_next_line_start to restore the state of
4111 it->bidi_it after backing up to previous newline. (Bug#9212)
4112
31011111
AS
41132011-07-30 Andreas Schwab <schwab@linux-m68k.org>
4114
4115 * regex.c (re_comp): Protoize.
4116 (re_exec): Fix return type.
4117 (regexec): Fix type of `ret'. (Bug#9203)
4118
476371c4
PE
41192011-07-28 Paul Eggert <eggert@cs.ucla.edu>
4120
e5d76069
PE
4121 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
4122 This is needed if max-image-size is a floating-point number.
4123
9a79b20c
AS
41242011-07-28 Andreas Schwab <schwab@linux-m68k.org>
4125
4126 * print.c (print_object): Print empty symbol as ##.
4127
4128 * lread.c (read1): Read ## as empty symbol.
4129
d8c2fa78
AA
41302011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4131
4132 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
4133 setting frame foreground color (Bug#9175).
4134 (x_set_background_color): Likewise.
4135
ffe57a7a
AA
4136 * nsmenu.m (-setText): Size tooltip dimensions precisely to
4137 contents (Bug#9176).
4138 (EmacsTooltip -init): Remove bezels and add shadows to
4139 tooltip windows.
4140
bf3492a5
AA
4141 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
4142 or scroll bar (Bug#8470).
4143
d55e9c53
AA
4144 * nsfont.m (nsfont_open): Remove assignment to voffset and
4145 unnecessary vars hshink, expand, hd, full_height, min_height.
4146 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
4147
4148 * nsterm.h (nsfont_info): Remove voffset field.
4149
d8c2fa78 41502011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
4151
4152 Implement strike-through and overline on NextStep (Bug#8863).
4153
4154 * nsfont.m (nsfont_open): Use underline position provided by font,
4155 instead of hard-coded value of 2.
4156 (nsfont_draw): Call ns_draw_text_decoration instead.
4157
4158 * nsterm.h: Add declaration for ns_draw_text_decoration.
4159
4160 * nsterm.m (ns_draw_text_decoration): New function for drawing
4161 underline, overline, and strike-through.
4162 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
4163 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 4164 accommodate underlining, etc.
4843aac3 4165
4cc60b9b
EZ
41662011-07-28 Eli Zaretskii <eliz@gnu.org>
4167
bc7ece87
EZ
4168 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
4169 default.
4cc60b9b 4170
476371c4
PE
41712011-07-28 Paul Eggert <eggert@cs.ucla.edu>
4172
66606eea
PE
4173 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
4174 Without this fix, if a signal arrives just after memory fills up,
4175 'malloc' might be invoked reentrantly.
4176
476371c4
PE
4177 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
4178 In other words, assume that every image size is allowed, on non-X
4179 hosts. This assumption is probably wrong, but it lets Emacs compile.
4180
f3fcc40d
AS
41812011-07-28 Andreas Schwab <schwab@linux-m68k.org>
4182
4183 * regex.c (re_iswctype): Convert return values to boolean.
4184
350c992f
EZ
41852011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
4186
4187 * xdisp.c (compute_display_string_pos): Don't use cached display
4188 string position if the buffer had its restriction changed.
4189 (Bug#9184)
4190
5266b4bb
PE
41912011-07-28 Paul Eggert <eggert@cs.ucla.edu>
4192
4193 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
4194
2573a837 41952011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 4196
41f55ccd 4197 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 4198
39e378da
PE
4199 * bidi.c: Integer size and overflow fixes.
4200 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
4201 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
4202 (bidi_cache_find_level_change, bidi_cache_ensure_space)
4203 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
4204 (bidi_find_other_level_edge):
4205 Use ptrdiff_t instead of EMACS_INT where either will do.
4206 This works better on 32-bit hosts configured --with-wide-int.
4207 (bidi_cache_ensure_space): Check for size-calculation overflow.
4208 Use % rather than repeated addition, for better worst-case speed.
4209 Don't set bidi_cache_size until after xrealloc returns, because it
4210 might not return.
4211 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
4212 (bidi_cache_ensure_space): Also check that the bidi cache size
4213 does not exceed that of the largest Lisp string or buffer. See Eli
4214 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 4215
5e927815
PE
4216 * alloc.c (__malloc_size_t): Remove.
4217 All uses replaced by size_t. See Andreas Schwab's note
4218 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
4219
ca4aa935
PE
4220 * image.c: Improve checking for integer overflow.
4221 (check_image_size): Assume that f is nonnull, since
4222 it is always nonnull in practice. This is one less thing to
4223 worry about when checking for integer overflow later.
4224 (x_check_image_size): New function, which checks for integer
4225 overflow issues inside X.
4226 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
4227 This removes the need for a memory_full check.
4228 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
4229 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
4230 (xbm_read_bitmap_data): Change locals back to 'int', since
4231 their values must fit in 'int'.
4232 (xpm_load_image, png_load, tiff_load):
4233 Invoke x_create_x_image_and_pixmap earlier,
4234 to avoid much needless work if the image is too large.
4235 (tiff_load): Treat overly large images as if
4236 x_create_x_image_and_pixmap failed, not as malloc failures.
4237 (gs_load): Use x_check_image_size.
4238
5f8f9cc2
PE
4239 * gtkutil.c: Omit integer casts.
4240 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
4241 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
4242
5adf60bc
PE
4243 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
4244
c8907a93
PE
4245 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
4246 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
4247 would wrongly return t on a 64-bit host.
4248
e3c25c68
PE
4249 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
4250 The plain *_OVERFLOW macros run afoul of GCC bug 49705
4251 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
4252 and therefore cause GCC to emit a bogus diagnostic in some cases.
4253
3f791afe
PE
4254 * image.c: Integer signedness and overflow and related fixes.
4255 This is not an exhaustive set of fixes, but it's time to
4256 record what I've got.
4257 (lookup_pixel_color, check_image_size): Remove redundant decls.
4258 (check_image_size): Don't assume that arbitrary EMACS_INT values
4259 fit in 'int', or that arbitrary 'double' values fit in 'int'.
4260 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
4261 (tiff_load, imagemagick_load_image):
4262 Check for overflow in size calculations.
4263 (x_create_x_image_and_pixmap): Remove unnecessary test for
4264 xmalloc returning NULL; that can't happen.
4265 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
4266 (xpm_color_bucket): Use better integer hashing function.
4267 (xpm_cache_color): Don't possibly over-allocate memory.
4268 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
4269 (gif_memory_source):
4270 Use ptrdiff_t, not int or size_t, to record sizes.
4271 (png_load): Don't assume values greater than 2**31 fit in 'int'.
4272 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
4273 either works, as we prefer signed integers.
4274 (tiff_read_from_memory, tiff_write_from_memory):
4275 Return tsize_t, not size_t, since that's what the TIFF API wants.
4276 (tiff_read_from_memory): Don't fail simply because the read would
4277 go past EOF; instead, return a short read.
4278 (tiff_load): Omit no-longer-needed casts.
4279 (Fimagemagick_types): Don't assume size fits into 'int'.
4280
3cc5a532
PE
4281 Improve hashing quality when configured --with-wide-int.
4282 * fns.c (hash_string): New function, taken from sxhash_string.
4283 Do not discard information about ASCII character case; this
4284 discarding is no longer needed.
4285 (sxhash-string): Use it. Change sig to match it. Caller changed.
4286 * lisp.h: Declare it.
4287 * lread.c (hash_string): Remove, since we now use fns.c's version.
4288 The fns.c version returns a wider integer if --with-wide-int is
4289 specified, so this should help the quality of the hashing a bit.
4290
b312a492
PE
4291 * emacs.c: Integer overflow minor fix.
4292 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
4293 Define only if GNU_LINUX.
4294 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
4295
dfd153ae
PE
4296 * dispnew.c: Integer signedness and overflow fixes.
4297 Remove unnecessary forward decls, that were a maintenance hassle.
4298 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
4299 All uses changed.
4300 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
4301 (scrolling_window): Use ptrdiff_t, not int, for byte count.
4302 (prepare_desired_row, line_draw_cost):
4303 Use int, not unsigned, where either works.
4304 (save_current_matrix, restore_current_matrix):
4305 Use ptrdiff_t, not size_t, where either works.
4306 (init_display): Check for overflow more accurately, and without
4307 relying on undefined behavior.
4308
a81d11a3
PE
4309 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
4310 Remove, replacing with the new symbols in lisp.h. All uses changed.
4311 * fileio.c (make_temp_name):
4312 * filelock.c (lock_file_1, lock_file):
4313 * xdisp.c (message_dolog):
4314 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
4315 Use pMd etc. instead.
4316 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
4317 replacing the pWIDE etc. symbols removed from editfns.c.
4318
3300e6fd
PE
4319 * keyboard.h (num_input_events): Now uintmax_t.
4320 This is (very slightly) less likely to mess up due to wraparound.
4321 All uses changed.
4322
fd05c7e9
PE
4323 * buffer.c: Integer signedness fixes.
4324 (alloc_buffer_text, enlarge_buffer_text):
4325 Use ptrdiff_t rather than size_t when either will do, as we prefer
4326 signed integers.
4327
903fe15d
PE
4328 * alloc.c: Integer signedness and overflow fixes.
4329 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
4330 (__malloc_size_t): Default to size_t, not to int.
4331 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
4332 (Fgarbage_collect, mark_object_loop_halt, mark_object):
4333 Prefer ptrdiff_t to size_t when either would do, as we prefer
4334 signed integers.
4335 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
4336 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
4337 Now const. Initialize with values that are in range even if char
4338 is signed.
4339 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
4340 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
4341 These functions do the right thing with sizes > 2**32.
4342 (check_depth): Now ptrdiff_t, not int.
4343 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
4344 Adjust to new way of storing sizes. Check for size overflow bugs
4345 in rest of code.
4346 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
4347 slightly wrong anyway, as it missed one instance of
4348 XMALLOC_OVERRUN_CHECK_OVERHEAD.
4349 (refill_memory_reserve): Omit needless cast to size_t.
4350 (mark_object_loop_halt): Mark as externally visible.
4351
ac82cc6a
PE
4352 * xselect.c: Integer signedness and overflow fixes.
4353 (Fx_register_dnd_atom, x_handle_dnd_message):
4354 Use ptrdiff_t, not size_t, since we prefer signed.
4355 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
4356 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
4357 x_dnd_atoms_size and x_dnd_atoms_length.
4358
c2d1e36d
PE
4359 * doprnt.c: Prefer signed to unsigned when either works.
4360 * eval.c (verror):
4361 * doprnt.c (doprnt):
4362 * lisp.h (doprnt):
4363 * xdisp.c (vmessage):
4364 Use ptrdiff_t, not size_t, when using or implementing doprnt,
4365 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
4366 prefer signed arithmetic to avoid comparison confusion.
4367 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
4368 but is a bit tricky.
4369
0e926e56
PE
4370 Assume freestanding C89 headers, string.h, stdlib.h.
4371 * data.c, doprnt.c, floatfns.c, print.c:
4372 Include float.h unconditionally.
4373 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
4374 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
4375 * regex.c: Likewise for stddef.h, string.h.
4376 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
4377 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
4378 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
4379 (STDC_HEADERS): Remove obsolete defines.
4380 * sysdep.c: Include limits.h unconditionally.
4381
9cfdb3ec
PE
4382 Assume support for memcmp, memcpy, memmove, memset.
4383 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
4384 * regex.c (memcmp, memcpy):
4385 Remove; we assume C89 now.
4386
4387 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
4388 (__malloc_safe_bcopy): Remove; no longer needed.
4389
cf950e6b 4390 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
4391 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
4392 well either way, and we prefer signed to unsigned.
4393
dbf38e02
LMI
43942011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
4395
4396 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
4397 closes the connection while we're reading (bug#9182).
4398
d6f0886c 43992011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 4400
d6f0886c
JD
4401 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
4402 are specified (Bug#9168).
24e0f6b1 4403
2eb1f9e6
PE
44042011-07-25 Paul Eggert <eggert@cs.ucla.edu>
4405
4406 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
4407 Found by GCC static checking and --with-wide-int on a 32-bit host.
4408
22381272 44092011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
4410
4411 * xdisp.c (compute_display_string_pos): Fix logic of caching
4412 previous display string position. Initialize cached_prev_pos to
4413 -1. Fixes slow-down at the beginning of a buffer.
4414
f25e39b4
EZ
44152011-07-24 Eli Zaretskii <eliz@gnu.org>
4416
4417 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
4418 for attrs[LFACE_FONTSET_INDEX].
4419
04c4b52e
PE
44202011-07-23 Paul Eggert <eggert@cs.ucla.edu>
4421
4422 * xml.c (parse_region): Remove unused local
4423 that was recently introduced.
4424
c1734fbd
EZ
44252011-07-23 Eli Zaretskii <eliz@gnu.org>
4426
be18c5a5
EZ
4427 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
4428 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
4429
c1734fbd
EZ
4430 * xdisp.c (move_it_in_display_line_to): Record the best matching
4431 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
4432 exit if none of the characters scanned was an exact match.
4433 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
4434 when exact match is impossible due to invisible text, and the
4435 lines are truncated.
4436
a258d627
JD
44372011-07-23 Jan Djärv <jan.h.d@swipnet.se>
4438
4439 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
4440 for OSX >= 10.7.
4441
b6d5a689
EZ
44422011-07-22 Eli Zaretskii <eliz@gnu.org>
4443
0f74f785
EZ
4444 Fix a significant slow-down of cursor motion with C-n, C-p,
4445 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
4446 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 4447 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
4448 (next_element_from_buffer): Call compute_stop_pos_backwards to
4449 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
4450 base_level_stop.
4451 (reseat): Don't look for prev_stop, as that could mean a very long
4452 run.
4453 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
4454 <cached_disp_overlay_modiff>: Cache for last found display string
4455 position.
551918c1 4456 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
4457 about the same buffer in the same area of character positions, and
4458 the buffer wasn't changed since the time the display string
4459 position was cached.
551918c1 4460
b2d0c91a
EZ
44612011-07-22 Eli Zaretskii <eliz@gnu.org>
4462
4463 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
4464 is an integer, which is important for empty lines. (Bug#9149)
4465
043604ee
CY
44662011-07-22 Chong Yidong <cyd@stupidchicken.com>
4467
4468 * frame.c (Fmodify_frame_parameters): In tty case, update the
4469 default face if necessary (Bug#4238).
4470
da4adb04
CY
44712011-07-21 Chong Yidong <cyd@stupidchicken.com>
4472
4473 * editfns.c (Fstring_to_char): No need to explain what a character
4474 is in the docstring (Bug#6576).
4475
9abd0532
LMI
44762011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
4477
4478 * xml.c (parse_region): Make sure we always return a tree.
4479
36881d16
HK
44802011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
4481
4482 * xml.c (parse_region): If a document contains only comments,
4483 return that, too.
4484
1e98674d
LMI
44852011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
4486
4487 * xml.c (make_dom): Return comments, too.
4488
590bd467
PE
44892011-07-19 Paul Eggert <eggert@cs.ucla.edu>
4490
4491 Port to OpenBSD.
4492 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
4493 and the surrounding thread.
4494 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
4495 rather than fgets, and retry after EINTR. Otherwise, 'emacs
4496 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
4497 timer goes off.
4498 * s/openbsd.h (BROKEN_SIGIO): Define.
4499 * unexelf.c (unexec) [__OpenBSD__]:
4500 Don't update the .mdebug section of the Alpha COFF symbol table.
4501
f41628b2
LMI
45022011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
4503
4504 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
4505 (bug#8460).
4506
b59b67c5
PE
45072011-07-18 Paul Eggert <eggert@cs.ucla.edu>
4508
15e3a074
PE
4509 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
4510 This fixes some race conditions on the permissions of any newly
4511 created file.
4512
41bed37d
PE
4513 * alloc.c (valid_pointer_p): Use pipe, not open.
4514 This fixes some permissions issues when debugging.
4515
b59b67c5
PE
4516 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
4517 If fchown fails to set both uid and gid, try to set just gid,
4518 as that is sometimes allowed. Adjust the file's mode to eliminate
4519 setuid or setgid bits that are inappropriate if fchown fails.
4520
925a6be7
SM
45212011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4522
4523 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
4524 to compare Lisp_Objects.
4525 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
4526 global_gnutls_log_level, don't mistake it for a Lisp_Object.
4527 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
4528
52968808
AS
45292011-07-17 Andreas Schwab <schwab@linux-m68k.org>
4530
0a6a104b
AS
4531 * lread.c (read_integer): Unread even EOF character.
4532 (read1): Likewise. Properly record start position of symbol.
4533
52968808
AS
4534 * lread.c (read1): Read `#:' as empty uninterned symbol if no
4535 symbol character follows.
4536
9e381cdd
PE
45372011-07-17 Paul Eggert <eggert@cs.ucla.edu>
4538
4539 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
4540 This works around a problem with the previous change to Fcopy_file.
4541 Recent glibc declares fchown with __attribute__((warn_unused_result)),
4542 and without this change, GCC might complain about discarding
4543 fchown's return value.
4544
b5641435
JB
45452011-07-16 Juanma Barranquero <lekktu@gmail.com>
4546
4547 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
4548
a8031457
PE
45492011-07-16 Paul Eggert <eggert@cs.ucla.edu>
4550
4551 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
4552
dd889327
LMI
45532011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
4554
750c33f7
LMI
4555 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
4556 it's used from the C level.
4557
dd889327
LMI
4558 * process.c: Use the same condition for POLL_FOR_INPUT in both
4559 keyboard.c and process.c (bug#1858).
4560
87e86684
LM
45612011-07-09 Lawrence Mitchell <wence@gmx.li>
4562
4563 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
4564 (Fgnutls_boot): Use it.
4565
64348f40
AS
45662011-07-15 Andreas Schwab <schwab@linux-m68k.org>
4567
4568 * doc.c (Fsubstitute_command_keys): Revert last change.
4569
1d698799
LMI
45702011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
4571
f863868c
LMI
4572 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
4573 quotes the next character, and doesn't affect other longer
4574 sequences (bug#8935).
4575
1d698799
LMI
4576 * lread.c (syms_of_lread): Clarify that is isn't only
4577 `eval-buffer' and `eval-defun' that's affected by
4578 `lexical-binding' (bug#8460).
4579
aa4b6df6
EZ
45802011-07-15 Eli Zaretskii <eliz@gnu.org>
4581
4582 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 4583 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 4584
5d856da6
PE
45852011-07-14 Paul Eggert <eggert@cs.ucla.edu>
4586
ad6042bb
PE
4587 Fix minor problems found by static checking.
4588 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
4589 (elsz): Now a signed constant, not a size_t var. We prefer signed
4590 types to unsigned, to avoid integer comparison confusion. Without
4591 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
4592 "cannot optimize loop, the loop counter may overflow", a symptom
4593 of the confusion.
f00bbb22 4594 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
4595 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
4596
6468f31c
LMI
45972011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
4598
49080b10
LMI
4599 * search.c (Fre_search_backward): Mention `case-fold-search' in
4600 all the re_search_* functions (bug#8138).
4601
6468f31c
LMI
4602 * keyboard.c (Fopen_dribble_file): Document when the file is
4603 closed (bug#8056).
4604
c965adc5
EZ
46052011-07-14 Eli Zaretskii <eliz@gnu.org>
4606
df9733bf
EZ
4607 * bidi.c (bidi_dump_cached_states): Fix format of displaying
4608 bidi_cache_idx.
4609
0bb23927
EZ
4610 Support bidi reordering of display and overlay strings.
4611 * xdisp.c (compute_display_string_pos)
4612 (compute_display_string_end): Accept additional argument STRING.
4613 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
4614 (reseat_to_string): Initialize bidi_it->string.s and
4615 bidi_it->string.schars.
4616 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
4617 NULL (avoids a crash in bidi_paragraph_init).
4618 Initialize itb.string.lstring.
0bb23927
EZ
4619 (init_iterator): Call bidi_init_it only of a valid
4620 buffer position was specified. Initialize paragraph_embedding to
4621 L2R.
4622 (reseat_to_string): Initialize the bidi iterator.
4623 (display_string): If we need to ignore text properties of
4624 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
4625 original value of -1 will not work with bidi.)
4626 (compute_display_string_pos): First arg is now struct
4627 `text_pos *'; all callers changed. Support display properties on
4628 Lisp strings.
4629 (compute_display_string_end): Support display properties on Lisp
4630 strings.
4631 (init_iterator, reseat_1, reseat_to_string): Initialize the
4632 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
4633 when iterating on a string not from display properties).
640c8776
SM
4634 (compute_display_string_pos, compute_display_string_end):
4635 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
4636 arrow keys.
4637 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
4638 base_level_stop; instead, set base_level_stop to BEGV.
4639 Fixes crashes in vertical-motion.
0bb23927
EZ
4640 (next_element_from_buffer): Improve commentary for when
4641 the iterator is before prev_stop.
4642 (init_iterator): Initialize bidi_p from the default value of
4643 bidi-display-reordering, not from buffer-local value. Use the
4644 buffer-local value only if initializing for buffer iteration.
4645 (handle_invisible_prop): Support invisible properties on strings
4646 that are being bidi-reordered.
4647 (set_iterator_to_next): Support bidi reordering of C strings and
4648 Lisp strings.
4649 (next_element_from_string): Support bidi reordering of Lisp
4650 strings.
4651 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
4652 (display_string): Support display of R2L glyph rows.
4653 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
4654 (init_iterator): Don't initialize it->bidi_p for strings
4655 here.
4656 (reseat_to_string): Initialize it->bidi_p for strings here.
4657 (next_element_from_string, next_element_from_c_string)
4658 (next_element_from_buffer): Add xassert's for correspondence
4659 between IT's object being iterated and it->bidi_it.string
4660 structure.
4661 (face_before_or_after_it_pos): Support bidi iteration.
4662 (next_element_from_c_string): Handle the case of the first string
4663 character that is not the first one in the visual order.
4664 (get_visually_first_element): New function, refactored from common
4665 parts of next_element_from_buffer, next_element_from_string, and
4666 next_element_from_c_string.
4667 (tool_bar_lines_needed, redisplay_tool_bar)
4668 (display_menu_bar): Force left-to-right direction. Add a FIXME
4669 comment for making that be controlled by a user option.
4670 (push_it, pop_it): Save and restore the state of the
4671 bidi iterator. Save and restore the bidi_p flag.
4672 (pop_it): Iterate out of display property for string iteration as
4673 well.
4674 (iterate_out_of_display_property): Support iteration over strings.
4675 (handle_single_display_spec): Set up it->bidi_it for iteration
4676 over a display string, and call bidi_init_it.
4677 (handle_single_display_spec, next_overlay_string)
4678 (get_overlay_strings_1, push_display_prop): Set up the bidi
4679 iterator for displaying display or overlay strings.
4680 (forward_to_next_line_start): Don't use the shortcut if
4681 bidi-iterating.
4682 (back_to_previous_visible_line_start): If handle_display_prop
4683 pushed the iterator stack, restore the internal state of the bidi
4684 iterator by calling bidi_pop_it same number of times.
4685 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
4686 and we are bidi-iterating, don't decrement the iterator position;
4687 instead, set the first_elt flag in the bidi iterator, to produce
4688 the same effect.
4689 (reseat_1): Remove redundant setting of string_from_display_prop_p.
4690 (push_display_prop): xassert that we are iterating a buffer.
4691 (push_it, pop_it): Save and restore paragraph_embedding member.
4692 (handle_single_display_spec, next_overlay_string)
4693 (get_overlay_strings_1, reseat_1, reseat_to_string)
4694 (push_display_prop): Set up the `unibyte' member of bidi_it.string
4695 correctly. Don't assume unibyte strings are not bidi-reordered.
4696 (compute_display_string_pos)
4697 (compute_display_string_end): Fix handling the case of C string.
4698 (push_it, pop_it): Save and restore from_disp_prop_p.
4699 (handle_single_display_spec, push_display_prop): Set the
4700 from_disp_prop_p flag.
4701 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
4702 (pop_it): Call iterate_out_of_display_property only if we are
4703 popping after iteration over a string that came from a display
4704 property. Fix a typo in popping stretch info. Add an assertion
4705 for verifying that the iterator position is in sync with the bidi
4706 iterator.
4707 (handle_single_display_spec, get_overlay_strings_1)
4708 (push_display_prop): Fix initialization of paragraph direction for
4709 string when that of the parent object is not yet determined.
4710 (reseat_1): Call bidi_init_it to resync the bidi
4711 iterator with IT's position. (Bug#7616)
4712 (find_row_edges): If ROW->start.pos gives position
4713 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
4714 (handle_stop, back_to_previous_visible_line_start, reseat_1):
4715 Reset the from_disp_prop_p flag.
4716 (SAVE_IT, RESTORE_IT): New macros.
4717 (pos_visible_p, face_before_or_after_it_pos)
4718 (back_to_previous_visible_line_start)
4719 (move_it_in_display_line_to, move_it_in_display_line)
4720 (move_it_to, move_it_vertically_backward, move_it_by_lines)
4721 (try_scrolling, redisplay_window, display_line): Use them when
4722 saving a temporary copy of the iterator and restoring it back.
4723 (back_to_previous_visible_line_start, reseat_1)
4724 (init_iterator): Empty the bidi cache "stack".
4725 (move_it_in_display_line_to): If iterator ended up at
4726 EOL, but we never saw any buffer positions smaller than
4727 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
4728 motion in bidi-reordered lines.
4729 (move_it_in_display_line_to): Record prev_method and prev_pos
4730 immediately before the call to set_iterator_to_next. Fixes cursor
4731 motion in bidi-reordered lines with stretch glyphs and strings
4732 displayed in margins. (Bug#8133) (Bug#8867)
4733 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
4734 TO_CHARPOS.
640c8776
SM
4735 (pos_visible_p): Support positions in bidi-reordered lines.
4736 Save and restore bidi cache.
0bb23927
EZ
4737
4738 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
4739 (bidi_paragraph_info): Delete unused struct.
4740 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
4741 (bidi_cache_start): New variable.
4742 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
4743 to zero.
4744 (bidi_cache_fetch_state, bidi_cache_search)
4745 (bidi_cache_find_level_change, bidi_cache_iterator_state)
4746 (bidi_cache_find, bidi_peek_at_next_level)
4747 (bidi_level_of_next_char, bidi_find_other_level_edge)
4748 (bidi_move_to_visually_next): Compare cache index with
4749 bidi_cache_start rather than with zero.
4750 (bidi_fetch_char): Accept new argument STRING; all callers
4751 changed. Support iteration over a string. Support strings with
4752 display properties. Support unibyte strings. Fix the type of
4753 `len' according to what STRING_CHAR_AND_LENGTH expects.
4754 (bidi_paragraph_init, bidi_resolve_explicit_1)
4755 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
4756 (bidi_level_of_next_char, bidi_move_to_visually_next):
4757 Support iteration over a string.
0bb23927
EZ
4758 (bidi_set_sor_type, bidi_resolve_explicit_1)
4759 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
4760 can now be zero (for strings); special values 0 and -1 were
4761 changed to -1 and -2, respectively.
4762 (bidi_char_at_pos): New function.
4763 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
4764 Call it instead of FETCH_MULTIBYTE_CHAR.
4765 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
4766 initialized to valid values.
4767 (bidi_init_it): Don't initialize charpos and bytepos with invalid
4768 values.
4769 (bidi_level_of_next_char): Allow the sentinel "position" to pass
4770 the test for valid cached positions. Fix the logic for looking up
4771 the sentinel state in the cache. GCPRO the Lisp string we are
4772 iterating.
4773 (bidi_push_it, bidi_pop_it): New functions.
4774 (bidi_initialize): Initialize the bidi cache start stack pointer.
4775 (bidi_cache_ensure_space): New function, refactored from part of
4776 bidi_cache_iterator_state. Don't assume the required size is just
4777 one BIDI_CACHE_CHUNK away.
4778 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
4779 (bidi_count_bytes, bidi_char_at_pos): New functions.
4780 (bidi_cache_search): Don't assume bidi_cache_last_idx is
4781 always valid if bidi_cache_idx is valid.
4782 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
4783 is valid if it's going to be used.
4784 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
4785 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
4786 (bidi_cache_find_level_change, bidi_cache_ensure_space)
4787 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
4788 (bidi_find_other_level_edge, bidi_cache_start_stack):
4789 All variables related to cache indices are now EMACS_INT.
c965adc5 4790
0bb23927
EZ
4791 * dispextern.h (struct bidi_string_data): New structure.
4792 (struct bidi_it): New member `string'. Make flag members be 1-bit
4793 fields, and put them last in the struct.
640c8776
SM
4794 (compute_display_string_pos, compute_display_string_end):
4795 Update prototypes.
0bb23927
EZ
4796 (bidi_push_it, bidi_pop_it): Add prototypes.
4797 (struct iterator_stack_entry): New members bidi_p,
4798 paragraph_embedding, and from_disp_prop_p.
4799 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
4800 (bidi_shelve_cache, bidi_unshelve_cache):
4801 Declare prototypes.
0bb23927
EZ
4802
4803 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
4804 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
4805 and vector-like objects.
4806
4807 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
4808 cache around display iteration.
4809
4810 * window.c (Fwindow_end, window_scroll_pixel_based)
4811 (displayed_window_lines, Frecenter): Save and restore the bidi
4812 cache around display iteration.
4813
3bbd2265
LMI
48142011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
4815
4816 * editfns.c (Fdelete_region): Clarify the use of the named
4817 parameters (bug#6788).
4818
adc47434
MR
48192011-07-14 Martin Rudalics <rudalics@gmx.at>
4820
4821 * indent.c (Fvertical_motion): Set and restore w->pointm when
4822 saving and restoring the window's buffer (Bug#9006).
4823
837c31f8
LMI
48242011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
4825
4826 * editfns.c (Fstring_to_char): Clarify just what is returned
4827 (bug#6576). Text by Eli Zaretskii.
4828
ac389d0c
JB
48292011-07-13 Juanma Barranquero <lekktu@gmail.com>
4830
4831 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
4832
0be0ce47
EZ
48332011-07-13 Eli Zaretskii <eliz@gnu.org>
4834
4835 * buffer.c (mmap_find): Fix a typo.
4836
cd18e7e3
JB
48372011-07-13 Johan Bockgård <bojohan@gnu.org>
4838
4839 Fix execution of x selection hooks.
4840 * xselect.c (Qx_lost_selection_functions)
4841 (Qx_sent_selection_functions): New vars.
4842 (syms_of_xselect): DEFSYM them.
4843 (x_handle_selection_request): Pass Qx_sent_selection_functions
4844 rather than Vx_sent_selection_functions to Frun_hook_with_args.
4845 (x_handle_selection_clear,x_clear_frame_selections):
4846 Pass Qx_lost_selection_functions rather than
4847 Vx_lost_selection_functions to Frun_hook_with_args.
4848
47ea7f44
PE
48492011-07-13 Paul Eggert <eggert@cs.ucla.edu>
4850
ac389d0c 4851 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
4852 The old code sometimes used this field without initializing it.
4853
47ea7f44
PE
4854 * alloc.c (gc_sweep): Don't read past end of array.
4855 In theory, the old code could also have corrupted Emacs internals,
4856 though it'd be very unlikely.
4857
bc985c87
AS
48582011-07-12 Andreas Schwab <schwab@linux-m68k.org>
4859
4860 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 4861 argument. (Bug#4026)
bc985c87 4862
0cf34688
LMI
48632011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
4864
b3dadd76
LMI
4865 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
4866 key" (bug#4257).
4867
0cf34688
LMI
4868 * window.c (Fset_window_start): Doc fix (bug#4199).
4869 (Fset_window_hscroll): Ditto.
4870
270768cd
PE
48712011-07-12 Paul Eggert <eggert@cs.ucla.edu>
4872
077e3dda 4873 Fix minor new problems caught by GCC 4.6.1.
270768cd 4874 * term.c (init_tty): Remove unused local.
490011a6 4875 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 4876 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 4877 not used otherwise.
270768cd 4878
b1f58454
CY
48792011-07-12 Chong Yidong <cyd@stupidchicken.com>
4880
4881 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
4882
22b9578d
LMI
48832011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
4884
6e70ab07
LMI
4885 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
4886 are the mini-buffer and the echo area (bug#3320).
4887
22b9578d
LMI
4888 * term.c (init_tty): Remove support for supdup, c10 and perq
4889 terminals, which are no longer supported (bug#1482).
4890
8974cc9f
JB
48912011-07-10 Johan Bockgård <bojohan@gnu.org>
4892
4893 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
4894
a560d974
JD
48952011-07-10 Jan Djärv <jan.h.d@swipnet.se>
4896
4897 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
4898 for non-popups (Bug#3642).
4899
1dae0f0a
AS
49002011-07-10 Andreas Schwab <schwab@linux-m68k.org>
4901
268c2c36 4902 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 4903 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
4904 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
4905 * cm.c (losecursor): Likewise.
1dae0f0a
AS
4906 * data.c (fmod): Likewise.
4907 * dispnew.c (swap_glyphs_in_rows): Likewise.
4908 * emacs.c (memory_warning_signal): Likewise.
4909 * floatfns.c (float_error): Likewise.
4910 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
4911 (otf_open, font_otf_capability, generate_otf_features)
4912 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
4913 Likewise.
4914 * image.c (pbm_read_file): Likewise.
4915 * indent.c (string_display_width): Likewise.
4916 * intervals.c (check_for_interval, search_for_interval)
4917 (inc_interval_count, count_intervals, root_interval)
4918 (adjust_intervals_for_insertion, make_new_interval): Likewise.
4919 * lread.c (defalias): Likewise.
268c2c36 4920 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
4921 * regex.c (set_image_of_range_1, set_image_of_range)
4922 (regex_grow_registers): Likewise.
4923 * sysdep.c (strerror): Likewise.
4924 * termcap.c (valid_filename_p, tprint, main): Likewise.
4925 * tparam.c (main): Likewise.
4926 * unexhp9k800.c (run_time_remap, save_data_space)
4927 (update_file_ptrs, read_header, write_header, calculate_checksum)
4928 (copy_file, copy_rest, display_header): Likewise.
4929 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
4930 Likewise.
4931 * xdisp.c (check_it): Likewise.
4932 * xfaces.c (register_color, unregister_color, unregister_colors):
4933 Likewise.
4934 * xfns.c (print_fontset_result): Likewise.
4935 * xrdb.c (member, fatal, main): Likewise.
4936
99033785
PE
49372011-07-10 Paul Eggert <eggert@cs.ucla.edu>
4938
4939 Fix minor problems found by static checking (Bug#9031).
4940 * chartab.c (char_table_set_range, map_sub_char_table):
4941 Remove unused locals.
4942 (uniprop_table): Now static.
4943 * composite.c (_work_char): Remove unused static var.
4944
9cb2ac56
JB
49452011-07-09 Juanma Barranquero <lekktu@gmail.com>
4946
4947 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
4948
f25661f0
JD
49492011-07-09 Jan Djärv <jan.h.d@swipnet.se>
4950
4951 * gtkutil.c (qttip_cb): Remove code without function.
4952
8278c4fe
EZ
49532011-07-09 Eli Zaretskii <eliz@gnu.org>
4954
4955 * w32.c (pthread_sigmask): New stub.
4956
1692ae2d 49572011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 4958
8a6ebd58 4959 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
4960 sigprocmask is portable only for single-threaded applications, and
4961 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
4962 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
4963 (LIBES): Use it.
4964 * callproc.c (Fcall_process):
4965 * process.c (create_process):
4966 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
4967 Use pthread_sigmask, not sigprocmask.
123403e4 4968
1b854618
JD
49692011-07-08 Jan Djärv <jan.h.d@swipnet.se>
4970
4971 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
4972 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
4973 wrong (Bug#8591).
4974
3fe4b549
JD
49752011-07-08 Jan Djärv <jan.h.d@swipnet.se>
4976
0ce7e563
JD
4977 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
4978 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
4979 (xg_hide_tooltip): Fix comment.
4980
3fe4b549
JD
4981 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
4982 in registerServicesMenuSendTypes.
4983 (validRequestorForSendType): Don't check ns_return_types.
4984
4985 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
4986 ns_return_type.
4987
5df75e47
JR
49882011-07-08 Jason Rumney <jasonr@gnu.org>
4989
22610910
JR
4990 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
4991 SH_SHOW for hidden windows (Bug#5482).
4992
5df75e47
JR
4993 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
4994 frame struct members of non-existent frames (Bug#6284).
4995
699c10bd
JD
49962011-07-08 Jan Djärv <jan.h.d@swipnet.se>
4997
4393663b
JD
4998 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
4999 variable firstTime not needed on OSX >= 10.6.
5000 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
5001 >= 10.5. Use setKnobProportion, setDoubleValue.
5002
5003 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
5004 (MAC_OS_X_VERSION_10_5): Define if not defined.
5005 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
5006 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
5007 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
5008
5009 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
5010 cString and lossyCString on OSX >= 10.4
5011
58179cce 5012 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
5013 sizeToFit on OSX >= 10.2.
5014
5015 * nsimage.m (allocInitFromFile): Don't use deprecated method
5016 bestRepresentationForDevice on OSX >= 10.6.
5017
5018 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
5019 to avoid warning.
5020
5021 * emacs.c: Declare unexec_init_emacs_zone.
5022
a63e0781
JD
5023 * nsgui.h: Fix compiler warning about gnulib redefining verify.
5024
699c10bd
JD
5025 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
5026
5027 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
5028 on svcsMenu (Bug#8842).
5029
5030 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
5031 ns_return_types.
5032 (Fns_list_services): Just return Qnil on 10.6, code not working there.
5033
5034 * nsterm.m (QUTF8_STRING): Declare.
5035 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
5036 (validRequestorForSendType): Return type is (id).
5037 Change indexOfObjectIdenticalTo to indexOfObject.
5038 Check if we have local selection before returning self (Bug#8842).
5039 (writeSelectionToPasteboard): Put local selection into paste board
5040 if we have a local selection (Bug#8842).
5041 (syms_of_nsterm): DEFSYM QUTF8_STRING.
5042
5043 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
5044 (ns_get_local_selection): Declare.
5045
54e10184
LMI
50462011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
5047
9888ff71
LMI
5048 * keymap.c (describe_map_tree): Don't insert a double newline at
5049 the end of the buffer (bug#1169) and return whether we inserted
5050 something.
5051
54e10184
LMI
5052 * callint.c (Fcall_interactively): Change "reading args" to
5053 "providing args" to try to clarify what it does (bug#1010).
5054
15fa4783
KH
50552011-07-07 Kenichi Handa <handa@m17n.org>
5056
5057 * composite.c (composition_compute_stop_pos): Ignore a static
5058 composition starting before CHARPOS (Bug#8915).
5059
5060 * xdisp.c (handle_composition_prop): Likewise.
5061
a8815b00
EZ
50622011-07-07 Eli Zaretskii <eliz@gnu.org>
5063
5064 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
5065 (Bug#9015)
5066
ef7b981d 50672011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
5068
5069 * character.h (unicode_category_t): New enum type.
5070
5071 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
5072 (Qchar_code_property_table): New variable.
5073 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
5074 (UNIPROP_COMPRESSED_FORM_P): New macros.
5075 (char_table_ascii): Uncompress the compressed values.
5076 (sub_char_table_ref): New arg is_uniprop. Callers changed.
5077 Uncompress the compressed values.
ac389d0c 5078 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
5079 (char_table_ref_and_range): Uncompress the compressed values.
5080 (sub_char_table_set): New arg is_uniprop. Callers changed.
5081 Uncompress the compressed values.
5082 (sub_char_table_set_range): Args changed. Callers changed.
5083 (char_table_set_range): Adjuted for the above change.
5084 (map_sub_char_table): Delete args default_val and parent. Add arg
5085 top. Give decoded values to a Lisp function.
640c8776 5086 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
5087 values to a Lisp function. Gcpro more variables.
5088 (uniprop_table_uncompress)
5089 (uniprop_decode_value_run_length): New functions.
5090 (uniprop_decoder, uniprop_decoder_count): New variables.
5091 (uniprop_get_decoder, uniprop_encode_value_character)
5092 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
5093 New functions.
5094 (uniprop_encoder, uniprop_encoder_count): New variables.
5095 (uniprop_get_encoder, uniprop_table)
5096 (Funicode_property_table_internal, Fget_unicode_property_internal)
5097 (Fput_unicode_property_internal): New functions.
5098 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
5099 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 5100 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
5101 char-code-property-alist.
5102
640c8776 5103 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
5104 Vunicode_category_table.
5105
640c8776 5106 * font.c (font_range): Adjust for the change of
c805dec0
KH
5107 Vunicode_category_table.
5108
76b397fb
DN
51092011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
5110
5111 * m/iris4d.h: Remove file, move contents ...
5112 * s/irix6-5.h: ... here.
5113
22b4128e
PE
51142011-07-06 Paul Eggert <eggert@cs.ucla.edu>
5115
5116 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
5117 * alloc.c (mark_buffer):
5118 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
5119 (clone_per_buffer_values): Don't assume that
22b4128e
PE
5120 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
5121 This isn't true in general, and it's particularly not true
5122 if Emacs is configured with --with-wide-int.
5123 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
5124 New macros, used in the buffer.c change.
5125
869795d6
JD
51262011-07-05 Jan Djärv <jan.h.d@swipnet.se>
5127
5128 * xsettings.c: Use both GConf and GSettings if both are available.
5129 (store_config_changed_event): Add comment.
5130 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
5131 (store_tool_bar_style_changed): New functions.
5e617bc2 5132 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
5133 (struct xsettings): Move font inside HAVE_XFT.
5134 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 5135 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 5136 Move inside HAVE_XFT.
640c8776 5137 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
5138 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
5139 also.
5140 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 5141 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 5142 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
5143 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
5144 (parse_settings): Move check for font inside HAVE_XFT.
5145 (read_settings, apply_xft_settings): Add comment.
5146 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
5147 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
5148 call store_font_name_changed.
5149 (xft_settings_event): Add comment.
5150 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
5151 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
5152 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
5153 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
5154 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
5155 (xsettings_get_system_font, xsettings_get_system_normal_font):
5156 Add comment.
869795d6 5157
d8ed26bd
PE
51582011-07-05 Paul Eggert <eggert@cs.ucla.edu>
5159
5160 Random fixes. E.g., (random) never returned negative values.
5161 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
5162 subseconds part to the entropy, as that's a bit more random.
5163 Prefer signed to unsigned, since the signedness doesn't matter and
5164 in general we prefer signed. When given a limit, use a
5165 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
5166 latter isn't right if USE_2_TAGS_FOR_INTS.
5167 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
5168 not 0..VALMASK. Don't discard "excess" bits that random () returns.
5169
cabf1cac
SM
51702011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5171
5172 * textprop.c (text_property_stickiness):
5173 Obey Vtext_property_default_nonsticky.
5174 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
5175 * w32fns.c (syms_of_w32fns):
5176 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
5177
6e9b2be9
PE
51782011-07-04 Paul Eggert <eggert@cs.ucla.edu>
5179
5180 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
5181 This is more efficient than Ffile_directory_p and avoids a minor race.
5182
90186c68
LMI
51832011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
5184
7c301272
LMI
5185 * buffer.c (Foverlay_put): Say what the return value is
5186 (bug#7835).
5187
c4f2d8d4
LMI
5188 * fileio.c (barf_or_query_if_file_exists): Check first if the file
5189 is a directory before asking whether to use the file name
5190 (bug#7564).
ad637907
LMI
5191 (barf_or_query_if_file_exists): Make the "File is a directory"
5192 error be more correct.
c4f2d8d4 5193
90186c68
LMI
5194 * fns.c (Frequire): Remove the mention of the .gz files, since
5195 that's installation-specific, but keep the mention of
5196 `get-load-suffixes'.
5197
da64016e
PE
51982011-07-04 Paul Eggert <eggert@cs.ucla.edu>
5199
5200 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
5201 Report string overflow if the output is too long.
5202
7d47b580
JB
52032011-07-04 Juanma Barranquero <lekktu@gmail.com>
5204
a555cb87
JB
5205 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
5206 (syms_of_gnutls): Remove duplicate DEFSYM for
5207 Qgnutls_bootprop_verify_hostname_error, an error for
5208 Qgnutls_bootprop_verify_error (which is no longer used).
5209
7d47b580
JB
5210 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
5211 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
5212 Also (re)move comments that are misplaced or no longer relevant.
5213
1e49bfab
LMI
52142011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
5215
5216 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
5217
1485f4c0
CY
52182011-07-03 Chong Yidong <cyd@stupidchicken.com>
5219
5220 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
5221 and background color parameters if they have been changed.
5222
a9ab721e
LMI
52232011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
5224
5225 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
5226
cf7cff57
PE
52272011-07-03 Paul Eggert <eggert@cs.ucla.edu>
5228
2e13213d
PE
5229 * xsettings.c (SYSTEM_FONT): Define only when used.
5230 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
5231
cf7cff57
PE
5232 * keymap.c (access_keymap_1): Now static.
5233
7a8e04f7
CY
52342011-07-02 Chong Yidong <cyd@stupidchicken.com>
5235
5236 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
5237 leave any prefix arg for the up event (Bug#1586).
5238
61352f62
LMI
52392011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
5240
69bb1ef7
LMI
5241 * lread.c (syms_of_lread): Mention single symbols defined by
5242 `defvar' or `defconst' (bug#7154).
5243
61352f62 5244 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 5245 (Frequire): Mention get-load-suffixes.
61352f62 5246
28545e04
MR
52472011-07-02 Martin Rudalics <rudalics@gmx.at>
5248
5249 * window.h (window): Remove clone_number slot.
5250 * window.c (Fwindow_clone_number, Fset_window_clone_number):
5251 Remove.
5252 (make_parent_window, make_window, saved_window)
5253 (Fset_window_configuration, save_window_save): Don't deal with
5254 clone numbers.
5255 * buffer.c (Qclone_number): Remove declaration.
5256 (sort_overlays, overlay_strings): Don't deal with clone numbers.
5257
3349e122
SM
52582011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
5259
5260 Add multiple inheritance to keymaps.
5261 * keymap.c (Fmake_composed_keymap): New function.
5262 (Fset_keymap_parent): Simplify.
5263 (fix_submap_inheritance): Remove.
5264 (access_keymap_1): New function extracted from access_keymap to handle
5265 embedded parents and handle lists of maps.
5266 (access_keymap): Use it.
5267 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
5268 (Fcopy_keymap): Handle embedded parents.
5269 (Fcommand_remapping, define_as_prefix): Simplify.
5270 (Fkey_binding): Simplify.
5271 (syms_of_keymap): Move minibuffer-local-completion-map,
5272 minibuffer-local-filename-completion-map,
5273 minibuffer-local-must-match-map, and
5274 minibuffer-local-filename-must-match-map to Elisp.
5275 (syms_of_keymap): Defsubr make-composed-keymap.
5276 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
5277 (parse_menu_item): Trivial simplification.
5278
3279eb87
GM
52792011-07-01 Glenn Morris <rgm@gnu.org>
5280
5281 * Makefile.in (SETTINGS_LIBS): Fix typo.
5282
4550efdf
KI
52832011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
5284
5285 * coding.c (Fencode_coding_string): Record the last coding system
5286 used, as the function doc string says (bug#8738).
5287
0949d2b6
JD
52882011-07-01 Jan Djärv <jan.h.d@swipnet.se>
5289
5290 * xsettings.c (store_monospaced_changed): Take new font as arg and
5291 check for change against current_mono_font.
5292 (EMACS_TYPE_SETTINGS): Remove this and related defines.
5293 (emacs_settings_constructor, emacs_settings_get_property)
5294 (emacs_settings_set_property, emacs_settings_class_init)
5295 (emacs_settings_init, gsettings_obj): Remove.
5296 (something_changedCB): New function for HAVE_GSETTINGS.
5297 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
5298 with value as argument.
5299 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
5300 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 5301 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
5302 "changed".
5303
5304 * xgselect.c: Add defined (HAVE_GSETTINGS).
5305 (xgselect_initialize): Ditto.
5306
5307 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
5308 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
5309 xg_select.
5310
bbc6b304
PE
53112011-07-01 Paul Eggert <eggert@cs.ucla.edu>
5312
5313 * eval.c (struct backtrace): Simplify and port the data structure.
5314 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
5315 signed bit field, as this assumption is not portable and it makes
5316 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
5317 "char debug_on_exit : 1" as this is not portable either; instead,
5318 use the portable "unsigned int debug_on_exit : 1". Remove unused
5319 member evalargs. Remove obsolete comments about cc bombing out.
5320
9851bfc5
JD
53212011-06-30 Jan Djärv <jan.h.d@swipnet.se>
5322
51bb811f 5323 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
5324 Let HAVE_GSETTINGS override HAVE_GCONF.
5325 (store_monospaced_changed): New function.
5326 (EMACS_SETTINGS): A new type derived from GObject to handle
5327 GSettings notifications.
5328 (emacs_settings_constructor, emacs_settings_get_property)
5329 (emacs_settings_set_property, emacs_settings_class_init):
5330 New functions.
5331 (gsettings_client, gsettings_obj): New variables.
5332 (GSETTINGS_SCHEMA): New define.
5333 (something_changedCB): Call store_monospaced_changed.
5334 (init_gsettings): New function.
5335 (xsettings_initialize): Call init_gsettings.
5336 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
5337 to NULL.
5338
640c8776 5339 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
5340 GCONF_CFLAGS/LIBS.
5341
5386012d
MR
53422011-06-29 Martin Rudalics <rudalics@gmx.at>
5343
5344 * window.c (resize_root_window, grow_mini_window)
5345 (shrink_mini_window): Rename Qresize_root_window to
5346 Qwindow_resize_root_window and Qresize_root_window_vertically to
5347 Qwindow_resize_root_window_vertically.
5348
f13e0b08
PE
53492011-06-28 Paul Eggert <eggert@cs.ucla.edu>
5350
5351 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
5352
94515237
JB
53532011-06-27 Juanma Barranquero <lekktu@gmail.com>
5354
5355 * makefile.w32-in: Redesign dependencies so they reflect more
5356 clearly which files are directly included by each source file,
5357 and not through other includes.
5358
e43b6e43
MR
53592011-06-27 Martin Rudalics <rudalics@gmx.at>
5360
5361 * buffer.c (Qclone_number): Declare static and DEFSYM it.
5362 (sort_overlays, overlay_strings): When an overlay's clone number
5363 matches the window's clone number process the overlay even if
5364 the overlay's window property doesn't match the current window.
5365
d68443dc
MR
5366 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
5367 (Fwindow_hchild): Rename to Fwindow_left_child.
5368 (Fwindow_next): Rename to Fwindow_next_sibling.
5369 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
5370 (resize_window_check): Rename to window_resize_check.
5371 (resize_window_apply): Rename to window_resize_apply.
5372 (Fresize_window_apply): Rename to Fwindow_resize_apply.
5373 (Fdelete_other_windows_internal, resize_frame_windows)
5374 (Fsplit_window_internal, Fdelete_window_internal)
5375 (grow_mini_window, shrink_mini_window)
5376 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 5377
c7e73be5
JD
53782011-06-26 Jan Djärv <jan.h.d@swipnet.se>
5379
5380 * emacsgtkfixed.h: State that this is only used with Gtk+3.
5381 (emacs_fixed_set_min_size): Remove.
5382 (emacs_fixed_new): Take frame as argument.
5383
5384 * emacsgtkfixed.c: State that this is only used with Gtk+3.
5385 (_EmacsFixedPrivate): Remove minwidth/height.
5386 Add struct frame *f.
5387 (emacs_fixed_init): Initialize priv->f.
5388 (get_parent_class, emacs_fixed_set_min_size): Remove.
5389 (emacs_fixed_new): Set priv->f to argument.
5390 (emacs_fixed_get_preferred_width)
5391 (emacs_fixed_get_preferred_height): Use min_width/height from
5392 frames size_hint to set minimum and natural (Bug#8919).
5393 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
5394 and use min_width/height from frames size_hint to set
5395 min_width/height (Bug#8919).
5396
5397 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
5398 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
5399 Fix indentation.
c7e73be5 5400
cf99dcf8
EZ
54012011-06-26 Eli Zaretskii <eliz@gnu.org>
5402
5403 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
5404 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
5405 called at ZV.
5406
029529ac
CY
54072011-06-26 Chong Yidong <cyd@stupidchicken.com>
5408
5409 * process.c (wait_reading_process_output): Bypass select if
5410 waiting for a cell while ignoring keyboard input, and input is
5411 pending. Suggested by Jan Djärv (Bug#8869).
5412
7a7ef429
PE
54132011-06-25 Paul Eggert <eggert@cs.ucla.edu>
5414
5415 Use gnulib's dup2 module instead of rolling our own.
5416 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
5417
11fdef7d 54182011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
5419
5420 * dispnew.c (scrolling_window): Before scrolling, turn off a
5421 mouse-highlight in the window being scrolled.
5422
cd3520a4
JB
54232011-06-24 Juanma Barranquero <lekktu@gmail.com>
5424
5425 Move DEFSYM to lisp.h and use everywhere.
5426
5427 * character.h (DEFSYM): Move declaration...
5428 * lisp.h (DEFSYM): ...here.
5429
5430 * gnutls.c:
5431 * minibuf.c:
5432 * w32menu.c:
5433 * w32proc.c:
5434 * w32select.c: Don't include character.h.
5435
5436 * alloc.c (syms_of_alloc):
5437 * buffer.c (syms_of_buffer):
5438 * bytecode.c (syms_of_bytecode):
5439 * callint.c (syms_of_callint):
5440 * casefiddle.c (syms_of_casefiddle):
5441 * casetab.c (init_casetab_once):
5442 * category.c (init_category_once, syms_of_category):
5443 * ccl.c (syms_of_ccl):
5444 * cmds.c (syms_of_cmds):
5445 * composite.c (syms_of_composite):
5446 * dbusbind.c (syms_of_dbusbind):
5447 * dired.c (syms_of_dired):
5448 * dispnew.c (syms_of_display):
5449 * doc.c (syms_of_doc):
5450 * editfns.c (syms_of_editfns):
5451 * emacs.c (syms_of_emacs):
5452 * eval.c (syms_of_eval):
5453 * fileio.c (syms_of_fileio):
5454 * fns.c (syms_of_fns):
5455 * frame.c (syms_of_frame):
5456 * fringe.c (syms_of_fringe):
5457 * insdel.c (syms_of_insdel):
5458 * keymap.c (syms_of_keymap):
5459 * lread.c (init_obarray, syms_of_lread):
5460 * macros.c (syms_of_macros):
5461 * msdos.c (syms_of_msdos):
5462 * print.c (syms_of_print):
5463 * process.c (syms_of_process):
5464 * search.c (syms_of_search):
5465 * sound.c (syms_of_sound):
5466 * syntax.c (init_syntax_once, syms_of_syntax):
5467 * terminal.c (syms_of_terminal):
5468 * textprop.c (syms_of_textprop):
5469 * undo.c (syms_of_undo):
5470 * w32.c (globals_of_w32):
5471 * window.c (syms_of_window):
5472 * xdisp.c (syms_of_xdisp):
5473 * xfaces.c (syms_of_xfaces):
5474 * xfns.c (syms_of_xfns):
5475 * xmenu.c (syms_of_xmenu):
5476 * xsettings.c (syms_of_xsettings):
5477 * xterm.c (syms_of_xterm): Use DEFSYM.
5478
4228cf16
TZ
54792011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
5480
cd3520a4 5481 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 5482
7fcccf1e
PE
54832011-06-23 Paul Eggert <eggert@cs.ucla.edu>
5484
7efb4e0e
PE
5485 Integer and buffer overflow fixes (Bug#8873).
5486
ff5844ad
PE
5487 * print.c (printchar, strout): Check for string overflow.
5488 (PRINTPREPARE, printchar, strout):
5489 Don't set size unless allocation succeeds.
5490
90532f02
PE
5491 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
5492 for sizes. Check for string overflow more accurately.
5493 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
5494
6d84508d
PE
5495 * macros.c: Integer and buffer overflow fixes.
5496 * keyboard.h (struct keyboard.kbd_macro_bufsize):
5497 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
5498 Use ptrdiff_t, not int, for sizes.
5499 Don't increment bufsize until after realloc succeeds.
5500 Check for size-calculation overflow.
5501 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
5502
437b2cb4
PE
5503 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
5504
8b9ac8b4
PE
5505 * lread.c: Integer overflow fixes.
5506 (read_integer): Radix is now EMACS_INT, not int,
5507 to improve quality of diagnostics for out-of-range radices.
5508 Calculate buffer size correctly for out-of-range radices.
5509 (read1): Check for integer overflow in radices, and in
5510 read-circle numbers.
82cb60d3
PE
5511 (read_escape): Avoid int overflow.
5512 (Fload, openp, read_buffer_size, read1)
5513 (substitute_object_recurse, read_vector, read_list, map_obarray):
5514 Use ptrdiff_t, not int, for sizes.
5515 (read1): Use EMACS_INT, not int, for sizes.
20270765 5516 Check for size overflow.
8b9ac8b4 5517
7fcccf1e
PE
5518 * image.c (cache_image): Check for size arithmetic overflow.
5519
bfbbd7e7
PE
5520 * lread.c: Integer overflow issues.
5521 (saved_doc_string_size, saved_doc_string_length)
5522 (prev_saved_doc_string_size, prev_saved_doc_string_length):
5523 Now ptrdiff_t, not int.
5524 (read1): Don't assume doc string length fits in int. Check for
5525 out-of-range doc string lengths.
5526 (read_list): Don't assume file position fits in int.
39019e54 5527 (read_escape): Check for hex character overflow.
bfbbd7e7 5528
4e323265
LL
55292011-06-22 Leo Liu <sdl.web@gmail.com>
5530
5531 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
5532 Move to minibuffer.el.
5533
85fece3e
PE
55342011-06-22 Paul Eggert <eggert@cs.ucla.edu>
5535
20b84ce9 5536 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
5537 The following patches are for when GLYPH_DEBUG && !XASSERT.
5538 * dispextern.h (trace_redisplay_p, dump_glyph_string):
5539 * dispnew.c (flush_stdout):
5540 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
5541 Mark as externally visible.
5542 * dispnew.c (check_window_matrix_pointers): Now static.
5543 * dispnew.c (window_to_frame_vpos):
5544 * xfns.c (unwind_create_frame):
5545 * xterm.c (x_check_font): Remove unused local.
5546 * scroll.c (CHECK_BOUNDS):
5547 * xfaces.c (cache_fache): Rename local to avoid shadowing.
5548 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
5549 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
5550 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
5551 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
5552 Now static.
5553 (debug_method_add): Use va_list and vsprintf rather than relying
5554 on undefined behavior with wrong number of arguments.
5555 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
5556 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
5557 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
5558 since we're not interested in debugging glyphs with old libraries.
5559 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
5560 GCC 4.6.0's static checking.
5561
0766b489
PE
55622011-06-22 Paul Eggert <eggert@cs.ucla.edu>
5563
31fd4b32
PE
5564 Integer overflow and signedness fixes (Bug#8873).
5565 A few related buffer overrun fixes, too.
5566
b79e8648
PE
5567 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
5568
0766b489
PE
5569 * dispextern.h (struct face.stipple):
5570 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
5571 (x_bitmap_mask, x_allocate_bitmap_record)
5572 (x_create_bitmap_from_data, x_create_bitmap_from_file)
5573 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
5574 (x_create_bitmap_from_xpm_data):
5575 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
5576 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
5577 (.bitmaps_last):
5578 * xfaces.c (load_pixmap):
5579 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
5580 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
5581 (.bitmaps_last, struct x_output.icon_bitmap):
5582 Use ptrdiff_t, not int, for bitmap indexes.
5583 (x_allocate_bitmap_record): Check for size overflow.
5584 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
5585
b081724f
PE
5586 Use ptrdiff_t, not int, for overlay counts.
5587 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
5588 * editfns.c (overlays_around, get_pos_property):
5589 * textprop.c (get_char_property_and_overlay):
5590 * xdisp.c (next_overlay_change, note_mouse_highlight):
5591 * xfaces.c (face_at_buffer_position):
21514da7
PE
5592 * buffer.c (OVERLAY_COUNT_MAX): New macro.
5593 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
5594 (Fnext_overlay_change, Fprevious_overlay_change)
5595 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 5596 Use ptrdiff_t, not int, for sizes.
21514da7 5597 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 5598
3de73e5e
PE
5599 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
5600
2606c57b
PE
5601 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
5602 (x_session_initialize): Do not assume string length fits in int.
5603
aaafe47a
PE
5604 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
5605 This is unlikely, but can occur if DPI is outlandish.
5606
2674ddc8 5607 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
5608 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
5609
28154962
PE
5610 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
5611 * xrdb.c (magic_file_p, search_magic_path):
5612 Omit last arg SUFFIX; it was always 0. All callers changed.
5613 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
5614
7de51af5
PE
5615 * xfont.c (xfont_match): Avoid need for strlen.
5616
25ed6cc3
PE
5617 * xfns.c: Don't assume strlen fits in int.
5618 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
5619
4eab31dd
PE
5620 * xdisp.c (message_log_check_duplicate): Return intmax_t,
5621 not unsigned long, as we prefer signed integers. All callers changed.
5622 Detect integer overflow in repeat count.
5623 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 5624 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 5625
171e2a58
PE
5626 * termcap.c: Don't assume sizes fit in int and never overflow.
5627 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
5628 (gobble_line): Check for size-calculation overflow.
5629
ad39faca 5630 * minibuf.c (Fread_buffer):
6e5bb2dc 5631 * lread.c (intern, intern_c_string):
74ca2eb3
PE
5632 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
5633 Don't assume string length fits in int.
5634
52c61c22 5635 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
5636 * gtkutil.c (style_changed_cb): Avoid need for strlen.
5637
b5b8c9e5
PE
5638 * font.c: Don't assume string length fits in int.
5639 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
5640 Use ptrdiff_t, not int.
ccd6111c
PE
5641 (font_intern_prop): Don't assume string length fits in int.
5642 Don't assume integer property fits in fixnum.
5643 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 5644
882f0d81 5645 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 5646 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
5647 Reformulate so as not to need the command string.
5648 Invoke gzip -cd rather than gunzip, as it's more portable.
5649 (lock_info_type, lock_file_1, lock_file):
5650 Don't assume pid_t and time_t fit in unsigned long.
5651 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
5652 (current_lock_owner): Prefer signed type for sizes.
5653 Use memcpy, not strncpy, where memcpy is what is really wanted.
5654 Don't assume (via atoi) that time_t and pid_t fit in int.
5655 Check for time_t and/or pid_t out of range, e.g., via a network share.
5656 Don't alloca where an auto var works fine.
5657
93f4cf88
PE
5658 * fileio.c: Fix some integer overflow issues.
5659 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
5660 Don't assume string length fits in int.
5661 (directory_file_name): Don't assume string length fits in long.
5662 (make_temp_name): Don't assume pid fits in int, or that its print
5663 length is less than 20.
5664
f3e92b69
PE
5665 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
5666
1bfdaf10
PE
5667 * coding.c (make_subsidiaries): Don't assume string length fits in int.
5668
35016e9a
PE
5669 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
5670
3d1e65a1
PE
5671 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
5672 We prefer signed integers, even for size calculations.
5673
0b963a93
PE
5674 * emacs.c: Don't assume string length fits in 'int'.
5675 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
5676 (main): Don't invoke strlen when not needed.
5677
573f4b54
PE
5678 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
5679 (XD_DEBUG_MESSAGE): Don't waste a byte.
5680
989f33ba
PE
5681 * callproc.c (getenv_internal_1, getenv_internal)
5682 (Fgetenv_internal):
965d34eb
PE
5683 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
5684
e4d29b33
PE
5685 * lread.c (invalid_syntax): Omit length argument.
5686 All uses changed. This doesn't fix a bug, but it simplifies the
5687 code away from its former Hollerith-constant appearance, and it's
5688 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 5689 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 5690
eb49b136
PE
5691 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
5692 This didn't break anything, but it didn't help either.
5693 It's confusing to put a bogus integer in a place where the actual
5694 value does not matter.
9f62aeb1 5695 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 5696 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 5697
15375a22
PE
5698 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
5699 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
5700 implementation.
b61cc01c
PE
5701 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
5702 We prefer signed types, and the value cannot exceed the EMACS_INT
5703 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
5704 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
5705 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
5706 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 5707
53b2623d
PE
5708 * indent.c (sane_tab_width): New function.
5709 (current_column, scan_for_column, Findent_to, position_indentation)
5710 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 5711 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 5712
51cab52b 5713 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 5714
f2ed8a70
PE
5715 * lisp.h (lint_assume): New macro.
5716 * composite.c (composition_gstring_put_cache):
5717 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
5718
abe80cc6
PE
5719 * editfns.c, insdel.c:
5720 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 5721
b02c740e
PE
5722 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
5723
ebc96716
PE
5724 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
5725
b4e50fa0 5726 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 5727 Use much-faster test for byte-length change.
311d5d7c 5728 Don't assume string byte-length fits in 'int'.
a4cf38e4 5729 Check that character arg fits in 'int'.
85461888 5730 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 5731
c0c1ee9f
PE
5732 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
5733
a498d7f4
PE
5734 * fns.c (concat): Catch string overflow earlier.
5735 Do not rely on integer wraparound.
5736
51cab52b
PE
5737 * dispextern.h (struct it.overlay_strings_charpos)
5738 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
5739 * xdisp.c (forward_to_next_line_start)
5740 (back_to_previous_visible_line_start)
5741 (reseat_at_next_visible_line_start, next_element_from_buffer):
5742 Don't arbitrarily truncate the value of 'selective' to int.
5743
76031fad
PE
5744 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
5745
5eb55db9
PE
5746 * composite.c: Don't truncate sizes to 'int'.
5747 (composition_gstring_p, composition_reseat_it)
5748 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
5749 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
5750 not EMACS_UINT, for indexes.
5eb55db9 5751
0703a717
PE
5752 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
5753
d6202519
PE
5754 * buffer.c: Include <verify.h>.
5755 (struct sortvec.priority, struct sortstr.priority):
8961a454 5756 Now EMACS_INT, not int.
c20998a7 5757 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
5758 (struct sortstr.size, record_overlay_string)
5759 (struct sortstrlist.size, struct sortlist.used):
5760 Don't truncate size to int.
5761 (record_overlay_string): Check for size-calculation overflow.
d6202519 5762 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 5763
d5a19415
JM
57642011-06-22 Jim Meyering <meyering@redhat.com>
5765
029529ac 5766 Don't leak an XBM-image-sized buffer
d5a19415
JM
5767 * image.c (xbm_load): Free the image buffer after using it.
5768
a9041e6c
PE
57692011-06-21 Paul Eggert <eggert@cs.ucla.edu>
5770
5771 Port to Sun C.
5772 * composite.c (find_automatic_composition): Omit needless 'return 0;'
5773 that Sun C diagnosed.
5774 * fns.c (secure_hash): Fix pointer signedness issue.
5775 * intervals.c (static_offset_intervals): New function.
5776 (offset_intervals): Use it.
5777
7f3f739f
LL
57782011-06-21 Leo Liu <sdl.web@gmail.com>
5779
5780 * deps.mk (fns.o):
5781 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
5782 sha512.h.
5783
5784 * fns.c (secure_hash): Rename from crypto_hash_function and change
5785 the first arg to accept symbols.
5b66d427 5786 (Fsecure_hash): New primitive.
7f3f739f
LL
5787 (syms_of_fns): New symbols.
5788
76147d94
DD
57892011-06-20 Deniz Dogan <deniz@dogan.se>
5790
5791 * process.c (Fset_process_buffer): Clarify return value in
5792 docstring.
5793
7d7d0045
CY
57942011-06-18 Chong Yidong <cyd@stupidchicken.com>
5795
5796 * dispnew.c (add_window_display_history): Use BVAR.
5797
5798 * xdisp.c (debug_method_add): Use BVAR.
5799 (check_window_end, dump_glyph_matrix, dump_glyph)
5800 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
5801
5802 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
5803 Likewise.
5804
5805 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
5806 check till after the cache is created in init_frame_faces.
5807
ff2bc410
SM
58082011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
5809
5810 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
5811
28177add
PE
58122011-06-16 Paul Eggert <eggert@cs.ucla.edu>
5813
dd3482fe
PE
5814 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
5815 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
5816 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
5817
393d71f3 5818 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
5819 * fileio.c (Finsert_file_contents):
5820 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
5821 Remove the old (too-loose) buffer overflow checks.
5822 They weren't needed, since make_gap checks for buffer overflow.
5823 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
5824 The old code merely checked for Emacs fixnum overflow, and relied
5825 on undefined (wraparound) behavior. The new code avoids undefined
5826 behavior, and also checks for ptrdiff_t and/or size_t overflow.
5827
2e6813b0 5828 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
5829 Tune. Don't use wider integers than needed. Don't use alloca.
5830 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 5831
599a9e4f
PE
5832 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
5833
99561444
PE
5834 * insdel.c, lisp.h (buffer_overflow): New function.
5835 (insert_from_buffer_1, replace_range, replace_range_2):
5836 * insdel.c (make_gap_larger):
5837 * editfns.c (Finsert_char):
5838 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
5839
28177add
PE
5840 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
5841
e69dafad
PE
58422011-06-15 Paul Eggert <eggert@cs.ucla.edu>
5843
4baa020d 5844 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 5845
b1c46f02
PE
5846 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
5847 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
5848
e69dafad
PE
5849 * fileio.c: Don't assume EMACS_INT fits in off_t.
5850 (emacs_lseek): New static function.
5851 (Finsert_file_contents, Fwrite_region): Use it.
5852 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
5853
566684ea
PE
5854 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
5855
e6966cd6
PE
5856 * fns.c: Don't overflow int when computing a list length.
5857 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
5858 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
5859 truncation on 64-bit hosts. Check for QUIT every
5860 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
5861 faster and is responsive enough.
5862 (Flength): Report an error instead of overflowing an integer.
5863 (Fsafe_length): Return a float if the value is not representable
5864 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 5865 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 5866 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 5867
dd0b0efb
PE
5868 * alloc.c: Check that resized vectors' lengths fit in fixnums.
5869 (header_size, word_size): New constants.
5870 (allocate_vectorlike): Don't check size overflow here.
5871 (allocate_vector): Check it here instead, since this is the only
5872 caller of allocate_vectorlike that could cause overflow.
5873 Check that the new vector's length is representable as a fixnum.
5874
86fe5cfe
PE
5875 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
5876 The previous code was bogus. For example, next_almost_prime (32)
5877 returned 39, which is undesirable as it is a multiple of 3; and
5878 next_almost_prime (24) returned 25, which is a multiple of 5 so
5879 why was the code bothering to check for multiples of 7?
5880
80e88859
PE
5881 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
5882
4a2f0ad6
PE
5883 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
5884
f66c7cf8
PE
5885 Variadic C functions now count arguments with ptrdiff_t.
5886 This partly undoes my 2011-03-30 change, which replaced int with size_t.
5887 Back then I didn't know that the Emacs coding style prefers signed int.
5888 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
5889 were being counted with int, which may truncate counts on 64-bit
5890 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
5891 * lisp.h (struct Lisp_Subr.function.aMANY)
5892 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
5893 Arg counts are now ptrdiff_t, not size_t.
5894 All variadic functions and their callers changed accordingly.
5895 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
5896 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
5897 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
5898 * callint.c (Fcall_interactively): Check arg count for overflow,
5899 to avoid potential buffer overrun. Use signed char, not 'int',
5900 for 'varies' array, so that we needn't bother to check its size
5901 calculation for overflow.
5902 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
5903 * eval.c (apply_lambda):
5904 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
5905 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
5906 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
5907
a1759b76
PE
5908 * callint.c (Fcall_interactively): Don't use index var as event count.
5909
d96be9fc
PE
5910 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
5911 * mem-limits.h (SIZE): Remove; no longer used.
5912
a690a978 5913 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 5914
578c21e6
PE
5915 Remove unnecessary casts.
5916 * xterm.c (x_term_init):
5917 * xfns.c (x_set_border_pixel):
5918 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
5919 These aren't needed now that we assume ANSI C.
5920
96f53c6c
PE
5921 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
5922 It's more likely to cause problems (due to unsigned overflow)
5923 than to cure them.
5924
83c77d31
PE
5925 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
5926
ee2079f1
PE
5927 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
5928
6da65536
PE
5929 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
5930
7147c4a4
PE
5931 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
5932
193e32d9
PE
5933 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
5934
e5533da6
PE
5935 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
5936
9910e595
PE
5937 GLYPH_CODE_FACE returns EMACS_INT, not int.
5938 * dispextern.h (merge_faces):
5939 * xfaces.c (merge_faces):
01103c44
PE
5940 * xdisp.c (get_next_display_element, next_element_from_display_vector):
5941 Don't assume EMACS_INT fits in int.
9910e595 5942
2638320e
PE
5943 * character.h (CHAR_VALID_P): Remove unused parameter.
5944 * fontset.c, lisp.h, xdisp.c: All uses changed.
5945
045eb8d9
PE
5946 * editfns.c (Ftranslate_region_internal): Omit redundant test.
5947
c1f134b5
PE
5948 * fns.c (concat): Minor tuning based on overflow analysis.
5949 This doesn't fix any bugs. Use int to hold character, instead
5950 of constantly refetching from Emacs object. Use XFASTINT, not
5951 XINT, for value known to be a character. Don't bother comparing
5952 a single byte to 0400, as it's always less.
5953
395fcb93 5954 * floatfns.c (Fexpt):
327eeec8
PE
5955 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
5956
abbd3d23
PE
5957 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
5958 for characters.
5959
684a03ef
PE
5960 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
5961
0fed43f3
PE
5962 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
5963 Without this fix, on a 64-bit host (aset S 0 4294967386) would
5964 incorrectly succeed when S was a string, because 4294967386 was
5965 truncated before it was used.
5966
8fd02eb7
PE
5967 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
5968 Otherwise, an out-of-range integer could cause undefined behavior
5969 on a 64-bit host.
5970
f8c86b69
PE
5971 * composite.c: Use int, not EMACS_INT, for characters.
5972 (fill_gstring_body, composition_compute_stop_pos): Use int, not
5973 EMACS_INT, for values that are known to be in character range.
5974 This doesn't fix any bugs but is the usual style inside Emacs and
5975 may generate better code on 32-bit machines.
5976
34206dd2
PE
5977 Make sure a 64-bit char is never passed to ENCODE_CHAR.
5978 This is for reasons similar to the recent CHAR_STRING fix.
5979 * charset.c (Fencode_char): Check that character arg is actually
5980 a character. Pass an int to ENCODE_CHAR.
5981 * charset.h (ENCODE_CHAR): Verify that the character argument is no
5982 wider than 'int', as a compile-time check to prevent future regressions
5983 in this area.
5984
c5958d4c 5985 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
5986
5987 Make sure a 64-bit char is never passed to CHAR_STRING.
5988 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
5989 by silently ignoring the top 32 bits, allowing some values
5990 that were far too large to be valid characters.
5991 * character.h: Include <verify.h>.
5992 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
5993 arguments are no wider than unsigned, as a compile-time check
5994 to prevent future regressions in this area.
5995 * data.c (Faset):
01103c44 5996 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
5997 (Fsubst_char_in_region):
5998 * fns.c (concat):
5999 * xdisp.c (decode_mode_spec_coding):
6000 Adjust to CHAR_STRING's new requirement.
6001 * editfns.c (Finsert_char, Fsubst_char_in_region):
6002 * fns.c (concat): Check that character args are actually
6003 characters. Without this test, these functions did the wrong
6004 thing with wildly out-of-range values on 64-bit hosts.
6005
d37ca623
PE
6006 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
6007 These casts should not be needed on 32-bit hosts, either.
6008 * keyboard.c (read_char):
6009 * lread.c (Fload): Remove casts to unsigned.
6010
ea204efb
PE
6011 * lisp.h (UNSIGNED_CMP): New macro.
6012 This fixes comparison bugs on 64-bit hosts.
6013 (ASCII_CHAR_P): Use it.
6014 * casefiddle.c (casify_object):
01103c44 6015 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
6016 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
6017 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
6018 * dispextern.h (FACE_FROM_ID):
6019 * keyboard.c (read_char): Use UNSIGNED_CMP.
6020
41cb286c
PE
6021 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
6022 not to EMACS_INT, to avoid GCC warning.
6023
4a1b9832
PE
6024 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
6025
55daad71
PE
6026 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
6027 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
6028 isn't needed on 32-bit machines.
8f95c75c 6029
01103c44
PE
6030 * buffer.c (Fgenerate_new_buffer_name):
6031 Use EMACS_INT for count, not int.
0ceccced 6032 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
6033
6034 * data.c (Qcompiled_function): Now static.
6035
c6f072e7
PE
6036 * window.c (window_body_lines): Now static.
6037
20ce5912
PE
6038 * image.c (gif_load): Rename local to avoid shadowing.
6039
9c4c5f81
PE
6040 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
6041 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
6042 * alloc.c (make_save_value): Integer argument is now of type
6043 ptrdiff_t, not int.
6044 (mark_object): Use ptrdiff_t, not int.
6045 * lisp.h (pD): New macro.
6046 * print.c (print_object): Use it.
6047
c0c5c8ae
PE
6048 * alloc.c: Use EMACS_INT, not int, to count objects.
6049 (total_conses, total_markers, total_symbols, total_vector_size)
6050 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
6051 (total_free_floats, total_floats, total_free_intervals)
6052 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
6053 Now EMACS_INT, not int. All uses changed.
6054 (Fgarbage_collect): Compute overall total using a double, so that
6055 integer overflow is less likely to be a problem. Check for overflow
6056 when converting back to an integer.
5a25e253
PE
6057 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
6058 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
6059 These were 'int' variables that could overflow on 64-bit hosts;
6060 they were never used, so remove them instead of repairing them.
211a0b2a 6061 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
6062 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
6063 Previously, this ceilinged at INT_MAX, but that doesn't work on
6064 64-bit machines.
e46bb31a 6065 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 6066
c78baabf 6067 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 6068 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
6069 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
6070 when a (possibly-narrower) signed value would do just as well.
6071 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 6072
c9d624c6
PE
6073 * alloc.c: Catch some string size overflows that we were missing.
6074 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
6075 for convenience in STRING_BYTES_MAX.
6076 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
6077 The definition here is exact; the one in lisp.h was approximate.
6078 (allocate_string_data): Check for string overflow. This catches
6079 some instances we weren't catching before. Also, it catches
6080 size_t overflow on (unusual) hosts where SIZE_MAX <= min
6081 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
6082 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 6083
c9d624c6
PE
6084 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
6085 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 6086 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 6087
353032ce
PE
6088 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
6089
2bccce07
PE
6090 * alloc.c (Fmake_string): Check for out-of-range init.
6091
0ac30604
SM
60922011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
6093
6094 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
6095
c195f2de
JD
60962011-06-14 Jan Djärv <jan.h.d@swipnet.se>
6097
6098 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
6099 xg_get_default_scrollbar_width.
6100
6101 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
6102 (int_gtk_range_get_value): Move to the scroll bar part of the file.
6103 (style_changed_cb): Call update_theme_scrollbar_width and call
6104 x_set_scroll_bar_default_width and xg_frame_set_char_size for
6105 all frames (Bug#8505).
6106 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
6107 Call gtk_window_set_resizable if HAVE_GTK3.
6108 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
6109 and height if HAVE_GTK3 (Bug#8505).
6110 (scroll_bar_width_for_theme): New variable.
6111 (update_theme_scrollbar_width): New function.
6112 (xg_get_default_scrollbar_width): Move code to
6113 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
6114 (xg_initialize): Call update_theme_scrollbar_width.
6115
6116 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
6117
6118 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
6119
e10ac9f1
MR
61202011-06-12 Martin Rudalics <rudalics@gmx.at>
6121
6122 * frame.c (make_frame): Call other_buffer_safely instead of
6123 other_buffer.
6124
6125 * window.c (temp_output_buffer_show): Call display_buffer with
6126 second argument Vtemp_buffer_show_specifiers and reset latter
6127 immediately after the call.
6128 (Vtemp_buffer_show_specifiers): New variable.
6129 (auto_window_vscroll_p, next_screen_context_lines)
6130 (Vscroll_preserve_screen_position): Remove leading asterisks from
6131 doc-strings.
6132
2d3c217e 61332011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 6134
7b7f97e8 6135 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
6136 * buffer.c (Qclone_number): Remove for now, as it's unused.
6137 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
6138 (record_buffer): Remove unused local.
6139 * frame.c (other_visible_frames, frame_buffer_list): Now static.
6140 (set_frame_buffer_list): Remove; unused.
6141 * frame.h (other_visible_frames): Remove decl.
6142 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
6143 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
6144 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
6145 if HAVE_GPM.
6146 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
6147 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
6148 Define only if HAVE_GPM.
6149 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
6150 (update_hints_inhibit): Remove; never set. All uses removed.
6151 * widgetprv.h (emacsFrameClassRec): Remove decl.
6152 * window.c (delete_deletable_window): Now returns void, since it
6153 wasn't returning anything.
6154 (compare_window_configurations): Remove unused locals.
6155 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
6156 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
6157 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
6158 the same widths as pointers. This follows up on the 2011-05-06 patch.
6159 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
6160 * xterm.h: Likewise.
6161 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
6162
1384b89e
JB
61632011-06-12 Juanma Barranquero <lekktu@gmail.com>
6164
6165 * makefile.w32-in: Update dependencies.
6166 (LISP_H): Add lib/intprops.h.
6167
1100a63c
CY
61682011-06-11 Chong Yidong <cyd@stupidchicken.com>
6169
6170 * image.c (gif_load): Add animation frame delay to the metadata.
6171 (syms_of_image): Use DEFSYM. New symbol `delay'.
6172
6198ccd0
MR
61732011-06-11 Martin Rudalics <rudalics@gmx.at>
6174
6175 * window.c (delete_deletable_window): Re-add.
6176 (Fset_window_configuration): Rewrite to handle dead buffers and
6177 consequently deletable windows.
6178 (window_tree, Fwindow_tree): Remove. Supply functionality in
6179 window.el.
6180 (compare_window_configurations): Simplify code.
6181
b6e3633c
AS
61822011-06-11 Andreas Schwab <schwab@linux-m68k.org>
6183
1ab0dee5
AS
6184 * image.c (imagemagick_load_image): Fix type mismatch.
6185 (Fimagemagick_types): Likewise.
6186
b6e3633c
AS
6187 * window.h (replace_buffer_in_windows): Declare.
6188
9397e56f
MR
61892011-06-11 Martin Rudalics <rudalics@gmx.at>
6190
6191 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
6192 Qclone_number. Remove external declaration of Qdelete_window.
6193 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
6194 code.
640c8776
SM
6195 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
6196 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
6197 (Fother_buffer): Rewrite doc-string. Major rewrite for new
6198 buffer list implementation.
6199 (other_buffer_safely): New function.
6200 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
6201 calls to replace_buffer_in_windows and
6202 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
6203 if allowed.
6204 (record_buffer): Inhibit quitting and rewrite using quittable
6205 functions. Run Qbuffer_list_update_hook if allowed.
6206 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
6207 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
6208 Move switch-to-buffer to window.el.
9397e56f
MR
6209 (bury-buffer): Move to window.el.
6210 (Vbuffer_list_update_hook): New variable.
6211
6212 * lisp.h (other_buffer_safely): Add prototype in buffer.c
6213 section.
6214
6215 * window.h (resize_frame_windows): Move up in code.
6216 (Fwindow_frame): Remove EXFUN.
6217 (replace_buffer_in_all_windows): Remove prototype.
6218 (replace_buffer_in_windows_safely): Add prototype.
6219
6220 * window.c: Declare Qdelete_window static again. Move down
6221 declaration of select_count.
6222 (Fnext_window, Fprevious_window): Rewrite doc-strings.
6223 (Fother_window): Move to window.el.
6224 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
6225 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
6226 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
6227 window.el.
6228 (replace_buffer_in_windows): Implement by calling
6229 Qreplace_buffer_in_windows.
6230 (replace_buffer_in_all_windows): Remove with some functionality
6231 moved into replace_buffer_in_windows_safely.
6232 (replace_buffer_in_windows_safely): New function.
6233 (select_window_norecord, select_frame_norecord): Move in front
6234 of run_window_configuration_change_hook. Remove now obsolete
6235 declarations.
640c8776
SM
6236 (Fset_window_buffer): Rewrite doc-string.
6237 Call Qrecord_window_buffer.
9397e56f
MR
6238 (keys_of_window): Move binding for other-window to window.el.
6239
b50691aa
CY
62402011-06-11 Chong Yidong <cyd@stupidchicken.com>
6241
6242 * dispextern.h (struct image): Replace data member, whose int_val
6243 and ptr_val fields were not used by anything, with a single
6244 lisp_val object.
6245
6246 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
6247 (gif_clear_image, gif_load, imagemagick_load_image)
6248 (gs_clear_image, gs_load): Callers changed.
6249
3f754b86
PE
62502011-06-10 Paul Eggert <eggert@cs.ucla.edu>
6251
cca69397
PE
6252 * buffer.h: Include <time.h>, for time_t.
6253 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
6254
109e28d0
PE
6255 Fix minor problems found by static checking.
6256
60737f02
PE
6257 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
6258
4b66faf3
PE
6259 Make identifiers static if they are not used in other modules.
6260 * data.c (Qcompiled_function, Qframe, Qvector):
6261 * image.c (QimageMagick, Qsvg):
6262 * minibuf.c (Qmetadata):
6263 * window.c (resize_window_check, resize_root_window): Now static.
6264 * window.h (resize_window_check, resize_root_window): Remove decls.
6265
109e28d0
PE
6266 * window.c (window_deletion_count, delete_deletable_window):
6267 Remove; unused.
46a4ce9e
PE
6268 (window_body_lines): Now static.
6269 (Fdelete_other_windows_internal): Mark vars as initialized.
6270 Make sure 'resize_failed' is initialized.
6271 (run_window_configuration_change_hook): Rename local to avoid shadowing.
6272 (resize_window_apply): Remove unused local.
6273 * window.h (delete_deletable_window): Remove decl.
6274
109e28d0 6275 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
6276 (imagemagick_load_image): Fix pointer signedness problem by changing
6277 last arg from unsigned char * to char *. All uses changed.
6278 Also, fix a local for similar reasons.
6279 Remove unused locals. Remove locals to avoid shadowing.
6280 (fn_rsvg_handle_free): Remove; unused.
6281 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 6282 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 6283
3f754b86
PE
6284 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
6285
2547adb1
CY
62862011-06-10 Chong Yidong <cyd@stupidchicken.com>
6287
6288 * image.c (gif_load): Fix omitted cast error introduced by
6289 2011-06-06 change.
6290
2c8e37d4
MR
62912011-06-10 Martin Rudalics <rudalics@gmx.at>
6292
6293 * window.h (resize_proportionally, orig_total_lines)
6294 (orig_top_line): Remove from window structure.
6295 (set_window_height, set_window_width, change_window_heights)
6296 (Fdelete_window): Remove prototypes.
6297 (resize_frame_windows): Remove duplicate declaration.
6298
440a42e3
EZ
62992011-06-10 Eli Zaretskii <eliz@gnu.org>
6300
6301 * window.h (resize_frame_windows, resize_window_check)
6302 (delete_deletable_window, resize_root_window)
6303 (resize_frame_windows): Declare prototypes.
6304
6305 * window.c (resize_window_apply): Make definition be "static" to
6306 match the prototype.
6307
562dd5e9
MR
63082011-06-10 Martin Rudalics <rudalics@gmx.at>
6309
6310 * window.c: Remove declarations of Qwindow_size_fixed,
6311 window_min_size_1, window_min_size_2, window_min_size,
6312 size_window, window_fixed_size_p, enlarge_window, delete_window.
6313 Remove static from declaration of Qdelete_window, it's
6314 temporarily needed by Fbury_buffer.
6315 (replace_window): Don't assign orig_top_line and
6316 orig_total_lines.
6317 (Fdelete_window, delete_window): Remove. Window deletion is
6318 handled by window.el.
640c8776
SM
6319 (window_loop): Remove DELETE_OTHER_WINDOWS case.
6320 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
6321 (Fdelete_other_windows): Remove. Deleting other windows is
6322 handled by window.el.
6323 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
6324 handled in window.el.
6325 (window_min_size_2, window_min_size_1, window_min_size): Remove.
6326 Window minimum sizes are handled in window.el.
6327 (shrink_windows, size_window, set_window_height)
6328 (set_window_width, change_window_heights, window_height)
6329 (window_width, CURBEG, CURSIZE, enlarge_window)
6330 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
6331 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
6332 handled in window.el.
6333 (make_dummy_parent): Rename to make_parent_window and give it a
6334 second argument horflag.
6335 (make_window): Don't set resize_proportionally any more.
6336 (Fsplit_window): Remove. Windows are split in window.el.
6337 (save_restore_action, save_restore_orig_size)
6338 (shrink_window_lowest_first, save_restore_orig_size): Remove.
6339 Resize mini windows in window.el.
6340 (grow_mini_window, shrink_mini_window): Implement by calling
6341 Qresize_root_window_vertically, resize_window_check and
6342 resize_window_apply.
640c8776
SM
6343 (saved_window, Fset_window_configuration, save_window_save):
6344 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
6345 resize_proportionally.
6346 (window_min_height, window_min_width): Move to window.el.
6347 (keys_of_window): Move bindings for delete-other-windows,
6348 split-window, delete-window and enlarge-window to window.el.
6349
6350 * buffer.c: Temporarily extern Qdelete_window.
6351 (Fbury_buffer): Temporarily call Qdelete_window instead of
6352 Fdelete_window (Fbury_buffer will move to window.el soon).
6353
6354 * frame.c (set_menu_bar_lines_1): Remove code handling
6355 orig_top_line and orig_total_lines.
6356
6357 * dispnew.c (adjust_frame_glyphs_initially): Don't use
6358 set_window_height but set heights directly.
6359 (change_frame_size_1): Use resize_frame_windows.
6360
6361 * xdisp.c (init_xdisp): Don't use set_window_height but set
6362 heights directly.
6363
640c8776
SM
6364 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
6365 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
6366 run_window_configuration_change_hook.
6367
6368 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
6369 instead of change_window_heights and run
6370 run_window_configuration_change_hook.
6371
1a13852e
MR
63722011-06-09 Martin Rudalics <rudalics@gmx.at>
6373
6374 * window.c (replace_window): Rename second argument REPLACEMENT to
6375 NEW. New third argument SETFLAG. Rewrite.
6376 (delete_window, make_dummy_parent): Call replace_window with
6377 third argument 1.
6378 (window_list_1): Move down in code.
6379 (run_window_configuration_change_hook): Move set_buffer part
6380 before select_frame_norecord part in order to unwind correctly.
6381 Rename count1 to count.
6382 (recombine_windows, delete_deletable_window, resize_root_window)
6383 (Fdelete_other_windows_internal)
6384 (Frun_window_configuration_change_hook, make_parent_window)
6385 (resize_window_check, resize_window_apply, Fresize_window_apply)
6386 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
6387 (Fdelete_window_internal, Fresize_mini_window_internal):
6388 New functions.
1a13852e
MR
6389 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
6390
f3d1777e
MR
63912011-06-08 Martin Rudalics <rudalics@gmx.at>
6392
496e208e
MR
6393 * window.h (window): Add some new members to window structure -
6394 normal_lines, normal_cols, new_total, new_normal, clone_number,
6395 splits, nest, prev_buffers, next_buffers.
6396 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 6397 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 6398
f3d1777e
MR
6399 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
6400 Remove.
496e208e
MR
6401 (make_dummy_parent): Set new members of windows structure.
6402 (make_window): Move down in code. Handle new members of window
6403 structure.
6404 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
6405 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
6406 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
6407 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
6408 (Fset_window_next_buffers, Fset_window_clone_number):
6409 New functions.
496e208e
MR
6410 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
6411 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
6412 Doc-string fixes.
6413 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
6414 Argument WINDOW can be now internal window too.
6415 (Fwindow_use_time): Move up in code.
6416 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
6417 Rewrite doc-string.
6418 (Fset_window_configuration, saved_window)
6419 (Fcurrent_window_configuration, save_window_save): Handle new
6420 members of window structure.
b9e809c2
MR
6421 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
6422 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
6423 (syms_of_window): New Lisp objects Qrecord_window_buffer,
6424 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
6425 Qget_mru_window, Qresize_root_window,
6426 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
6427 Qauto_buffer_name; staticpro them.
f3d1777e 6428
abde8f8c
MR
64292011-06-07 Martin Rudalics <rudalics@gmx.at>
6430
6431 * window.c (Fwindow_total_size, Fwindow_left_column)
6432 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
6433 (Fwindow_list_1): New functions.
6434 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
6435 (Fwindow_width, Fscroll_left, Fscroll_right):
6436 Use window_body_cols instead of window_box_text_cols.
6437 (delete_window, Fset_window_configuration):
6438 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
6439 (delete_all_subwindows): Take a window as argument and not a
6440 structure. Rewrite.
190b47e6
MR
6441 (window_loop): Remove handling of GET_LRU_WINDOW and
6442 GET_LARGEST_WINDOW.
6443 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
6444
6445 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
6446 window_box_text_cols. delete_all_subwindows now takes a
6447 Lisp_Object as argument.
abde8f8c 6448
640c8776
SM
6449 * indent.c (compute_motion, Fcompute_motion):
6450 Use window_body_cols instead of window_box_text_cols.
abde8f8c 6451
fa8a67e6
MR
6452 * frame.c (delete_frame): Call delete_all_subwindows with root
6453 window as argument.
6454
a54e3482
DC
64552011-06-07 Daniel Colascione <dan.colascione@gmail.com>
6456
6457 * fns.c (Fputhash): Document return value.
6458
60002bf5
CY
64592011-06-06 Chong Yidong <cyd@stupidchicken.com>
6460
6461 * image.c (gif_load): Implement gif89a spec "no disposal" method.
6462
0c671da6 64632011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 6464
b862a52a 6465 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 6466
be44ca6c
PE
6467 Check for overflow when converting integer to cons and back.
6468 * charset.c (Fdefine_charset_internal, Fdecode_char):
6469 Use cons_to_unsigned to catch overflow.
6470 (Fencode_char): Use INTEGER_TO_CONS.
6471 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
6472 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
6473 * data.c (long_to_cons, cons_to_long): Remove.
6474 (cons_to_unsigned, cons_to_signed): New functions.
6475 These signal an error for invalid or out-of-range values.
6476 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
6477 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
6478 * font.c (Ffont_variation_glyphs):
6479 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
6480 * lisp.h: Include <intprops.h>.
6481 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
6482 (cons_to_signed, cons_to_unsigned): New decls.
6483 (long_to_cons, cons_to_long): Remove decls.
6484 * undo.c (record_first_change): Use INTEGER_TO_CONS.
6485 (Fprimitive_undo): Use CONS_TO_INTEGER.
6486 * xfns.c (Fx_window_property): Likewise.
6487 * xselect.c: Include <limits.h>.
6488 (x_own_selection, selection_data_to_lisp_data):
6489 Use INTEGER_TO_CONS.
6490 (x_handle_selection_request, x_handle_selection_clear)
6491 (x_get_foreign_selection, Fx_disown_selection_internal)
6492 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
6493 (lisp_data_to_selection_data): Use cons_to_unsigned.
6494 (x_fill_property_data): Use cons_to_signed.
6495 Report values out of range.
6496
d1f3d2af
PE
6497 Check for buffer and string overflow more precisely.
6498 * buffer.h (BUF_BYTES_MAX): New macro.
6499 * lisp.h (STRING_BYTES_MAX): New macro.
6500 * alloc.c (Fmake_string):
6501 * character.c (string_escape_byte8):
6502 * coding.c (coding_alloc_by_realloc):
6503 * doprnt.c (doprnt):
6504 * editfns.c (Fformat):
6505 * eval.c (verror):
6506 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
6507 since they may not be the same number.
6508 * editfns.c (Finsert_char):
6509 * fileio.c (Finsert_file_contents):
6510 Likewise for BUF_BYTES_MAX.
6511
dd52fcea
PE
6512 * image.c: Use ptrdiff_t, not int, for sizes.
6513 (slurp_file): Switch from int to ptrdiff_t.
6514 All uses changed.
6515 (slurp_file): Check that file size fits in both size_t (for
6516 malloc) and ptrdiff_t (for sanity and safety).
6517
7f9bbdbb
PE
6518 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
6519 if b->modtime has its maximal value.
6520
dfe18f82
PE
6521 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
6522
84acfcf0
PE
6523 Don't assume time_t can fit into int.
6524 * buffer.h (struct buffer.modtime): Now time_t, not int.
6525 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
6526 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
6527
ccd9a01a
PE
6528 Minor fixes for signed vs unsigned integers.
6529 * character.h (MAYBE_UNIFY_CHAR):
6530 * charset.c (maybe_unify_char):
6531 * keyboard.c (read_char, reorder_modifiers):
6532 XINT -> XFASTINT, since the integer must be nonnegative.
6533 * ftfont.c (ftfont_spec_pattern):
6534 * keymap.c (access_keymap, silly_event_symbol_error):
6535 XUINT -> XFASTINT, since the integer must be nonnegative.
6536 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
6537 since it makes no difference and we prefer signed.
6538 * keyboard.c (record_char): Use XUINT when all the neighbors do.
6539 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
6540 nonnegative.
6541
d6d100dd
SM
65422011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
6543
6544 * window.h (Fwindow_frame): Declare.
6545
2b6148e4
PE
65462011-06-06 Paul Eggert <eggert@cs.ucla.edu>
6547
6548 * alloc.c: Simplify handling of large-request failures (Bug#8800).
6549 (SPARE_MEMORY): Always define.
6550 (LARGE_REQUEST): Remove.
6551 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
6552
f230ecc9
MR
65532011-06-06 Martin Rudalics <rudalics@gmx.at>
6554
727e958e
MR
6555 * lisp.h: Move EXFUNS for Fframe_root_window,
6556 Fframe_first_window and Fset_frame_selected_window to window.h.
6557
6558 * window.h: Move EXFUNS for Fframe_root_window,
6559 Fframe_first_window and Fset_frame_selected_window here from
6560 lisp.h.
6561
6562 * frame.c (Fwindow_frame, Fframe_first_window)
6563 (Fframe_root_window, Fframe_selected_window)
6564 (Fset_frame_selected_window): Move to window.c.
6565 (Factive_minibuffer_window): Move to minibuf.c.
6566 (Fother_visible_frames_p): New function.
6567
6568 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
6569
f230ecc9
MR
6570 * window.c (decode_window, decode_any_window): Move up in code.
6571 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
6572 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
6573 (Fwindow_buffer): Move up and rewrite doc-string.
6574 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
6575 (Fwindow_prev): New functions.
727e958e
MR
6576 (Fwindow_frame): Move here from frame.c. Accept any window as
6577 argument.
6578 (Fframe_root_window, Fframe_first_window)
6579 (Fframe_selected_window): Move here from frame.c. Accept frame
6580 or arbitrary window as argument. Update doc-strings.
6581 (Fminibuffer_window): Move up in code.
6582 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
6583 (Fset_frame_selected_window): Move here from frame.c.
6584 Marginal rewrite.
727e958e
MR
6585 (Fselected_window, select_window, Fselect_window): Move up in
6586 code. Minor doc-string fixes.
f230ecc9 6587
4d09bcf6
PE
65882011-06-06 Paul Eggert <eggert@cs.ucla.edu>
6589
6590 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
6591 Do not assume that spare memory exists; that assumption is valid
6592 only if SYSTEM_MALLOC.
6593 (LARGE_REQUEST): New macro, so that the issue of large requests
6594 is separated from the issue of spare memory.
6595
810928a2
AS
65962011-06-05 Andreas Schwab <schwab@linux-m68k.org>
6597
172418ad
AS
6598 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
6599 format. (Bug#8806)
6600
43f862f7
AS
6601 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
6602
810928a2
AS
6603 * xfns.c (x_set_scroll_bar_default_width): Move declarations
6604 before statements.
6605
a059fe24
JD
66062011-06-05 Jan Djärv <jan.h.d@swipnet.se>
6607
6608 * gtkutil.c (xg_get_default_scrollbar_width): New function.
6609
6610 * gtkutil.h: Declare xg_get_default_scrollbar_width.
6611
6612 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
6613 min width by calling x_set_scroll_bar_default_width (Bug#8505).
6614
989bf368
JB
66152011-06-05 Juanma Barranquero <lekktu@gmail.com>
6616
6617 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
6618
4b80f674
CY
66192011-06-04 Chong Yidong <cyd@stupidchicken.com>
6620
6621 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
6622 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
6623 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
6624 New error handlers.
4b80f674
CY
6625 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
6626 Obey Vx_select_enable_clipboard_manager. Catch errors in
6627 x_clipboard_manager_save (Bug#8779).
6628 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 6629 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 6630
99a33b77 66312011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
6632
6633 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
6634
99a33b77 66352011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
6636
6637 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
6638 in the current matrix if keep_current_p is non-zero.
6639
8264569d
EZ
66402011-06-04 Eli Zaretskii <eliz@gnu.org>
6641
6642 * bidi.c (bidi_level_of_next_char): Fix last change.
6643
57f97249
EZ
66442011-06-03 Eli Zaretskii <eliz@gnu.org>
6645
fec2107c 6646 Support bidi reordering of text covered by display properties.
57f97249 6647
fec2107c
EZ
6648 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
6649 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
6650 (bidi_cache_search, bidi_cache_iterator_state)
6651 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
6652 (bidi_level_of_next_char, bidi_move_to_visually_next):
6653 Support character positions inside a run of characters covered by a
fec2107c
EZ
6654 display string.
6655 (bidi_paragraph_init, bidi_resolve_explicit_1)
6656 (bidi_level_of_next_char): Call bidi_fetch_char and
6657 bidi_fetch_char_advance instead of FETCH_CHAR and
6658 FETCH_CHAR_ADVANCE.
6659 (bidi_init_it): Initialize new members.
6660 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
6661 definitions.
6662 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
6663 instead of using explicit *_CHAR codes.
d6d100dd
SM
6664 (bidi_resolve_explicit, bidi_resolve_weak):
6665 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
6666 bidirectional text is supported only in multibyte buffers.
6667 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
6668 it to initialize the frame_window_p member of struct bidi_it.
6669 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
6670 (bidi_resolve_explicit, bidi_resolve_weak)
6671 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
6672 bidi_it->nchars is non-positive.
6673 (bidi_level_of_next_char): Don't try to lookup the cache for the
6674 next/previous character if nothing is cached there yet, or if we
6675 were just reseat()'ed to a new position.
c40e2fb2 6676
0e14fe90
EZ
6677 * xdisp.c (set_cursor_from_row): Set start and stop points
6678 according to the row's direction when priming the loop that looks
6679 for the glyph on which to display cursor.
6680 (single_display_spec_intangible_p): Function deleted.
6681 (display_prop_intangible_p): Reimplement to call
6682 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
6683 Accept 3 additional arguments needed by handle_display_spec.
6684 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
6685 values: lists, `(when COND...)' forms, etc.
6686 (single_display_spec_string_p): Support property values that are
6687 lists with the argument STRING its top-level element.
6688 (display_prop_string_p): Fix the condition for processing a
6689 property that is a list to be consistent with handle_display_spec.
fec2107c 6690 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
6691 last portion of handle_display_prop.
6692 (compute_display_string_pos): Accept additional argument
6693 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
6694 value of a `display' property is a "replacing spec".
6695 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
6696 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
6697 the display property, but just return a value indicating whether
6698 the display property will replace the characters it covers.
6699 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
6700 frame_window_p members of struct bidi_it.
d6d100dd
SM
6701 (compute_display_string_pos, compute_display_string_end):
6702 New functions.
fec2107c
EZ
6703 (push_it): Accept second argument POSITION, where pop_it should
6704 jump to continue iteration.
6705 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 6706
fec2107c
EZ
6707 * keyboard.c (adjust_point_for_property): Adjust the call to
6708 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
6709
6710 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
6711 (bidi_init_it): Update prototypes.
6712 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
6713 (compute_display_string_pos, compute_display_string_end):
6714 Declare prototypes.
fec2107c
EZ
6715 (struct bidi_it): New members nchars and disp_pos. ch_len is now
6716 EMACS_INT.
fc6f18ce 6717
40087514 67182011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 6719
57f53182
PE
6720 Malloc failure behavior now depends on size of allocation.
6721 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
6722 * lisp.h: Change signatures accordingly.
6723 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
6724 All callers changed. (Bug#8762)
6725
6726 * gnutls.c: Use Emacs's memory allocators.
6727 Without this change, the gnutls library would invoke malloc etc.
6728 directly, which causes problems on non-SYNC_INPUT hosts, and which
6729 runs afoul of improving memory_full behavior. (Bug#8761)
6730 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
6731 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
6732 xfree instead of the default malloc, realloc, free.
6733 (Fgnutls_boot): No need to check for memory allocation failure,
6734 since xmalloc does that for us.
6735
ac32cd99 6736 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
6737 * category.c (hash_get_category_set):
6738 * ccl.c (ccl_driver):
6739 * charset.c (Fdefine_charset_internal):
6740 * charset.h (struct charset.hash_index):
6741 * composite.c (get_composition_id, gstring_lookup_cache)
6742 (composition_gstring_put_cache):
6743 * composite.h (struct composition.hash_index):
6744 * dispextern.h (struct image.hash):
6745 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
6746 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
6747 (hashfn_equal, hashfn_user_defined, make_hash_table)
6748 (maybe_resize_hash_table, hash_lookup, hash_put)
6749 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
6750 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
6751 (Fsxhash, Fgethash, Fputhash, Fmaphash):
6752 * image.c (make_image, search_image_cache, lookup_image)
6753 (xpm_put_color_table_h):
6754 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 6755 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 6756 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 6757 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
6758 * alloc.c (allocate_vectorlike):
6759 Check for overflow in vector size calculations.
6760 * ccl.c (ccl_driver):
6761 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
6762 * fns.c, image.c: Remove unnecessary static decls that would otherwise
6763 need to be updated by these changes.
40087514
PE
6764 * fns.c (make_hash_table, maybe_resize_hash_table):
6765 Check for integer overflow with large hash tables.
0de4bb68
PE
6766 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
6767 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
6768 (SXHASH_REDUCE): New macro.
6769 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
6770 Use it instead of discarding useful hash info with large hash values.
6771 (sxhash_float): New function.
6772 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
6773 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
6774 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
6775 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
6776 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
6777 Adjust signatures to match updated version of code.
6778 (consing_since_gc): Now EMACS_INT, since a single hash table can
6779 use more than INT_MAX bytes.
6780
698d32e2
DN
67812011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
6782
6783 Make it possible to build with GCC-4.6+ -O2 -flto.
6784
6785 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
6786
fd6fa53f
SM
67872011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
6788
6789 * minibuf.c (get_minibuffer, read_minibuf_unwind):
6790 Call minibuffer-inactive-mode.
6791
864db017
JB
67922011-05-31 Juanma Barranquero <lekktu@gmail.com>
6793
6794 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
6795 Update dependencies.
6796
2ad0baf4
DN
67972011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
6798
6799 * data.c (init_data): Remove code for UTS, this system is not
6800 supported anymore.
6801
4fcc2638
DN
68022011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
6803
6804 Don't force ./temacs to start in terminal mode.
6805
6806 * frame.c (make_initial_frame): Initialize faces in all cases, not
6807 only when CANNOT_DUMP is defined.
6808 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
6809
c56e0fd5
DN
68102011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
6811
6812 * dispnew.c (add_window_display_history): Use const for the string
6813 pointer. Remove declaration, not needed.
6814
333d54da 68152011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 6816
55d4c1b2 6817 Use 'inline', not 'INLINE'.
333d54da 6818 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
6819 * alloc.c, fontset.c (INLINE): Remove.
6820 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
6821 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
6822 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
6823 * gmalloc.c (register_heapinfo): Use inline unconditionally.
6824 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
6825
738db178
DN
68262011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
6827
6828 Make it possible to run ./temacs.
6829
6830 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
6831 syms_of_callproc does the same thing. Remove test for
6832 "initialized", do it in the caller.
6833 * emacs.c (main): Avoid calling set_initial_environment when dumping.
6834
620c53a6
SM
68352011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
6836
6837 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
6838 (read_minibuf): Use get_minibuffer.
6839 (syms_of_minibuf): Use DEFSYM.
6840 (Qmetadata): New var.
6841 * data.c (Qbuffer): Don't make it static.
6842 (syms_of_data): Use DEFSYM.
6843
e003a292
PE
68442011-05-31 Paul Eggert <eggert@cs.ucla.edu>
6845
6846 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
6847 (CCL_CODE_MIN): New macro.
6848
ed008a6d
PE
68492011-05-30 Paul Eggert <eggert@cs.ucla.edu>
6850
3687c2ef
PE
6851 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
6852
ed008a6d
PE
6853 * eval.c (Qdebug): Now static.
6854 * lisp.h (Qdebug): Remove decl. This reverts a part of the
6855 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
6856 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
6857
d66c4c7c
CY
68582011-05-29 Chong Yidong <cyd@stupidchicken.com>
6859
6860 * image.c: Various fixes to ImageMagick code comments.
6861 (Fimagemagick_types): Doc fix.
6862
5fbc2025
PE
68632011-05-29 Paul Eggert <eggert@cs.ucla.edu>
6864
0196f88a
PE
6865 Minor fixes prompted by GCC 4.6.0 warnings.
6866
6867 * xselect.c (converted_selections, conversion_fail_tag): Now static.
6868
5fbc2025
PE
6869 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
6870 (x_clipboard_manager_save_all): Move extern decl to ...
6871 * xterm.h: ... here, so that it can be checked for consistency.
6872
1dd3c2d9
CY
68732011-05-29 Chong Yidong <cyd@stupidchicken.com>
6874
6875 * xselect.c (x_clipboard_manager_save_frame)
6876 (x_clipboard_manager_save_all): New functions.
6877 (Fx_clipboard_manager_save): Lisp function deleted.
6878
6879 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
6880 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
6881
6882 * xterm.h: Update prototype.
6883
5ba6571d
WX
68842011-05-28 William Xu <william.xwl@gmail.com>
6885
6886 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
6887 exiting (Bug#8239).
6888
3eaff834
JM
68892011-05-28 Jim Meyering <meyering@redhat.com>
6890
e1900994 6891 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
6892 * fns.c (to_uchar): Define.
6893 (crypto_hash_function): Use it to convert some newly-signed
6894 variables to unsigned, to avoid sign-extension bugs. For example,
6895 without this change, (md5 "truc") would evaluate to
6896 45723a2aff78ff4fff7fff1114760e62 rather than the expected
6897 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 6898 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 6899
0f6990a7
PE
69002011-05-27 Paul Eggert <eggert@cs.ucla.edu>
6901
6902 Integer overflow fixes.
c8a9ca5a 6903
08686060
PE
6904 * dbusbind.c: Serial number integer overflow fixes.
6905 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
6906 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
6907 to hold a serial number that is too large for a fixnum.
6908 (Fdbus_method_return_internal, Fdbus_method_error_internal):
6909 Check for serial numbers out of range. Decode any serial number
59568bf0 6910 that was so large that it became a float. (Bug#8722)
08686060 6911
2d1fc3c7
PE
6912 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
6913 (Fdbus_call_method, Fdbus_call_method_asynchronously):
6914 Use XFASTINT rather than XUINT when numbers are nonnegative.
6915 (xd_append_arg, Fdbus_method_return_internal):
6916 (Fdbus_method_error_internal): Likewise. Also, for unsigned
6917 arguments, check that Lisp number is nonnegative, rather than
59568bf0 6918 silently wrapping negative numbers around. (Bug#8722)
30217ff0 6919 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 6920 (Bug#8722)
2d1fc3c7 6921
c8a9ca5a
PE
6922 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
6923
519e1d69
PE
6924 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
6925
6df6ae42 6926 ccl: Add integer overflow checks.
30569699
PE
6927 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
6928 (IN_INT_RANGE): New macros.
6929 (ccl_driver): Use them to check for integer overflow when
6930 decoding a CCL program. Many of the new checks are whether XINT (x)
6931 fits in int; it doesn't always, on 64-bit hosts. The new version
6932 doesn't catch all possible integer overflows, but it's an
847044ea 6933 improvement. (Bug#8719)
30569699 6934
c11285dc
PE
6935 * alloc.c (make_event_array): Use XINT, not XUINT.
6936 There's no need for unsigned here.
6937
fdccd48e
PE
6938 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
6939 This follows up to the 2011-05-06 change that substituted uintptr_t
6940 for EMACS_INT. This case wasn't caught back then.
6941
37910ab2
PE
6942 Rework Fformat to avoid integer overflow issues.
6943 * editfns.c: Include <float.h> unconditionally, as it's everywhere
6944 now (part of C89). Include <verify.h>.
6945 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
6946 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
6947 (Fformat): Avoid the prepass trying to compute sizes; it was only
6948 approximate and thus did not catch overflow reliably. Instead, walk
6949 through the format just once, formatting and computing sizes as we go,
6950 checking for integer overflow at every step, and allocating a larger
6951 buffer as needed. Keep track separately whether the format is
6952 multibyte. Keep only the most-recently calculated precision, rather
6953 than them all. Record whether each argument has been converted to
6954 string. Use EMACS_INT, not int, for byte and char and arg counts.
6955 Support field widths and precisions larger than INT_MAX. Avoid
6956 sprintf's undefined behavior with conversion specifications such as %#d
6957 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
6958 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
6959 formatting out-of-range floating point numbers with int
9173deec 6960 formats. (Bug#8668)
37910ab2 6961
2e6578fb
PE
6962 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
6963
0ae6bdee
PE
6964 * data.c: Avoid integer truncation in expressions involving floats.
6965 * data.c: Include <intprops.h>.
6966 (arith_driver): When there's an integer overflow in an expression
6967 involving floating point, convert the integers to floating point
6968 so that the resulting value does not suffer from catastrophic
6969 integer truncation. For example, on a 64-bit host (* 4
6970 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
6971 Do not rely on undefined behavior after integer overflow.
6972
de883a70
PE
6973 merge count_size_as_multibyte, parse_str_to_multibyte
6974 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 6975 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
6976 Check for integer overflow.
6977 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
6978 since it's now a duplicate of the other. This is more of
6979 a character than a buffer op, so better that it's in character.c.
6980 * fns.c, print.c: Adjust to above changes.
6981
2ff916cb
PE
69822011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
6983
6984 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
6985
f1b54466
PE
69862011-05-27 Paul Eggert <eggert@cs.ucla.edu>
6987
fb1ac845
PE
6988 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
6989 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
6990 (x_clipboard_manager_save): Now static.
6991 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
6992
f1b54466
PE
6993 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
6994 (crypto_hash_function): Now static.
6995 Fix pointer signedness problems. Avoid unnecessary initializations.
6996
a9f737ee
CY
69972011-05-27 Chong Yidong <cyd@stupidchicken.com>
6998
6999 * termhooks.h (Vselection_alist): Make it terminal-local.
7000
7001 * terminal.c (create_terminal): Initialize it.
7002
7003 * xselect.c: Support for clipboard managers.
7004 (Vselection_alist): Move to termhooks.h as terminal-local var.
7005 (LOCAL_SELECTION): New macro.
7006 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
7007 (symbol_to_x_atom): Remove gratuitous arg.
7008 (x_handle_selection_request, lisp_data_to_selection_data)
7009 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
7010 (x_own_selection, x_get_local_selection, x_convert_selection):
7011 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
7012 (some_frame_on_display): Delete unused function.
7013 (Fx_own_selection_internal, Fx_get_selection_internal)
7014 (Fx_disown_selection_internal, Fx_selection_owner_p)
7015 (Fx_selection_exists_p): New optional frame arg.
7016 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
7017 (x_handle_selection_clear): Don't treat other terminals with the
7018 same keyboard specially. Use the terminal-local Vselection_alist.
7019 (x_clear_frame_selections): Use Frun_hook_with_args.
7020
7021 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
7022
7023 * xterm.h: Add support for those atoms.
7024
e067f0c1
CY
70252011-05-26 Chong Yidong <cyd@stupidchicken.com>
7026
7027 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
7028 (converted_selections, conversion_fail_tag): New global variables.
7029 (x_selection_request_lisp_error): Free the above.
7030 (x_get_local_selection): Remove unnecessary code.
7031 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
7032 of converted selections stored in converted_selections.
7033 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
7034 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
7035 (x_convert_selection): New function.
7036 (x_handle_selection_event): Simplify.
7037 (x_get_foreign_selection): Don't ignore incoming requests while
7038 waiting for an answer; this will fail when we implement
7039 SAVE_TARGETS, and seems unnecessary anyway.
7040 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
7041 (Vx_sent_selection_functions): Doc fix.
7042
0f4aebc0
LL
70432011-05-26 Leo Liu <sdl.web@gmail.com>
7044
7045 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
7046
e61124cd
YM
70472011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7048
7049 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
7050
7051 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
7052 for fringe update if it has periodic bitmap.
ac389d0c 7053 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
7054 and fringe_bitmap_periodic_p.
7055
7056 * fringe.c (get_fringe_bitmap_data): New function.
7057 (draw_fringe_bitmap_1, update_window_fringes): Use it.
7058 (update_window_fringes): Record periodicity of fringe bitmap in glyph
7059 row. Mark glyph row for fringe update if periodicity changed.
7060
7061 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
7062 for fringe update unless it has periodic bitmap.
7063
f16d9837
KH
70642011-05-25 Kenichi Handa <handa@m17n.org>
7065
7066 * xdisp.c (get_next_display_element): Set correct it->face_id for
7067 a static composition.
7068
e1b90ef6
LL
70692011-05-24 Leo Liu <sdl.web@gmail.com>
7070
7071 * deps.mk (fns.o):
7072 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
7073
7074 * fns.c (crypto_hash_function, Fsha1): New function.
7075 (Fmd5): Use crypto_hash_function.
7076 (syms_of_fns): Add Ssha1.
7077
7400048f
PE
70782011-05-22 Paul Eggert <eggert@cs.ucla.edu>
7079
7080 * gnutls.c: Remove unused macros.
7081 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
7082 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
7083 Remove macros that are defined and never used.
7084 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
7085
abb71cf4
CY
70862011-05-22 Chong Yidong <cyd@stupidchicken.com>
7087
7088 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
7089 (Fx_get_selection_internal): Minor cleanup.
7090 (Fx_own_selection_internal): Rename arguments for consistency with
7091 select.el.
7092
6307db39
PE
70932011-05-22 Paul Eggert <eggert@cs.ucla.edu>
7094
7095 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
7096
f3d4e0a4
CY
70972011-05-22 Chong Yidong <cyd@stupidchicken.com>
7098
7099 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
7100
4d8ade89
YM
71012011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7102
7103 * dispnew.c (scrolling_window): Don't exclude the case that the
7104 last enabled row in the desired matrix touches the bottom boundary.
7105
32078c8d
GM
71062011-05-21 Glenn Morris <rgm@gnu.org>
7107
7108 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
7109 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
7110 and add some more files.
32078c8d 7111
7285dc67
EZ
71122011-05-20 Eli Zaretskii <eliz@gnu.org>
7113
7114 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
7115 report_file_error introduced by the change from 2011-05-07.
7116
89d1bd22
PE
71172011-05-20 Paul Eggert <eggert@cs.ucla.edu>
7118
7119 * systime.h (Time): Define only if emacs is defined.
7120 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
7121 where the include path doesn't have X11/X.h by default. See
7122 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
7123
cd394be1 71242011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
7125
7126 * composite.c (find_automatic_composition): Fix previous change.
7127
b9704ad9
GM
71282011-05-20 Glenn Morris <rgm@gnu.org>
7129
7130 * lisp.mk: New file, split from Makefile.in.
7131 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
7132 (shortlisp): Remove.
7133 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
7134
4a720484
GM
71352011-05-19 Glenn Morris <rgm@gnu.org>
7136
7137 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
7138 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
7139 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
7140 (lisp): Set the order to that of loadup.el.
7141 (shortlisp): Make it a copy of $lisp.
7142 (SOME_MACHINE_LISP): Remove.
7143 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
7144 Use just $shortlisp, not $SOME_MACHINE_LISP too.
7145
a28d4396
KH
71462011-05-18 Kenichi Handa <handa@m17n.org>
7147
7148 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
7149 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
7150 (find_automatic_composition): Mostly rewrite for efficiency.
7151
a2b1fa8e
JB
71522011-05-18 Juanma Barranquero <lekktu@gmail.com>
7153
7154 * makefile.w32-in: Update dependencies.
7155
8e1f5610
CS
71562011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
7157
7158 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 7159 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 7160
7025ee00 71612011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 7162
cdfa6eab
PE
7163 Fix some integer overflow issues, such as string length overflow.
7164
06d6db33
PE
7165 * insdel.c (count_size_as_multibyte): Check for string overflow.
7166
2b4560a8
PE
7167 * character.c (lisp_string_width): Check for string overflow.
7168 Use EMACS_INT, not int, for string indexes and lengths; in
7169 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
7170 the resulting string length overflows an EMACS_INT; instead,
7171 report a string overflow if no precision given. When checking for
7172 precision exhaustion, use a check that cannot possibly have
7173 integer overflow. (Bug#8675)
7174 * character.h (lisp_string_width): Adjust to new signature.
7175
cb93f9be
PE
7176 * alloc.c (string_overflow): New function.
7177 (Fmake_string): Use it. This doesn't change behavior, but saves
7178 a few bytes and will simplify future changes.
7179 * character.c (string_escape_byte8): Likewise.
7180 * lisp.h (string_overflow): New decl.
7181
1a1f3366
PE
7182 Fixups, following up to the user-interface timestamp change.
7183 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
7184 for UI timestamps, instead of unsigned long.
9fbd6841
PE
7185 * msdos.c (mouse_get_pos): Likewise.
7186 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
7187 * w32gui.h (Time): Define by including "systime.h" rather than by
7188 declaring it ourselves. (Bug#8664)
7189
d4e3e4d3
PE
7190 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
7191 * image.c (clear_image_cache): Likewise.
7192
f6a24d19
PE
7193 * term.c (term_mouse_position): Don't assume time_t wraparound.
7194
08dc5ae6
PE
7195 Be more systematic about user-interface timestamps.
7196 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
7197 and sometimes 'EMACS_UINT', to represent these timestamps.
7198 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
7199 This makes the code easier to follow, and makes it easier to catch
7200 integer overflow bugs such as Bug#8664.
7201 * frame.c (Fmouse_position, Fmouse_pixel_position):
7202 Use Time, not unsigned long, for user-interface timestamps.
7203 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
7204 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
7205 * keyboard.h (last_event_timestamp): Likewise.
7206 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
7207 * menu.h (xmenu_show): Likewise.
7208 * term.c (term_mouse_position): Likewise.
7209 * termhooks.h (struct input_event.timestamp): Likewise.
7210 (struct terminal.mouse_position_hook): Likewise.
7211 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
7212 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
7213 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
7214 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
7215 what it was before.
7216 * menu.h, termhooks.h: Include "systime.h", for Time.
7217
8e55734a
PE
7218 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
7219 Don't assume that the difference between two unsigned long values
7220 can fit into an integer. At this point, we know button_down_time
7221 <= event->timestamp, so the difference must be nonnegative, so
7222 there's no need to cast the result if double-click-time is
7223 nonnegative, as it should be; check that it's nonnegative, just in
7224 case. This bug is triggered when events are more than 2**31 ms
86db42d2 7225 apart (about 25 days). (Bug#8664)
8e55734a 7226
841f1b75 7227 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 7228 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 7229
3e26f69c
PE
7230 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
7231 that always fit in int. Use a sentinel instead of a counter, to
7232 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
7233 * frame.h (struct frame): Use int for menu_bar_items_used
7234 instead of EMACS_INT, since it always fits in int.
3e26f69c 7235
5cc152c0
PE
7236 * menu.c (grow_menu_items): Check for int overflow.
7237
d89eb65e
PE
7238 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
7239
5235bd3e
PE
7240 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
7241 Before, the code was not consistent. These values cannot exceed
7242 2**31 - 1 so there's no need to make them unsigned.
7243 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
7244 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
7245 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
7246 as modifiers.
7247 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
7248
bc827e23
PE
7249 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
7250 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
7251 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
7252 presumably because the widths might not match.
7253
78eb494e
PE
7254 * window.c (size_window): Avoid needless test at loop start.
7255
04f2d78b
CB
72562011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
7257
7258 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
7259
d2fc7e3d 72602011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
7261
7262 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
7263
d2fc7e3d 72642011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
7265
7266 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
7267 `width' to `bar_area_x' and `bar_area_width', respectively.
7268 (x_scroll_run): Take account of fringe background extension.
7269
04f2d78b
CB
7270 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
7271 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
7272 `bar_area_width', respectively.
7273 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
7274 background extension.
7275
79b70037
GM
72762011-05-10 Jim Meyering <meyering@redhat.com>
7277
7278 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
7279
2f142cc5
JB
72802011-05-10 Juanma Barranquero <lekktu@gmail.com>
7281
7282 * image.c (Finit_image_library): Return t for built-in image types,
7283 like pbm and xbm. (Bug#8640)
7284
57679c86
AS
72852011-05-09 Andreas Schwab <schwab@linux-m68k.org>
7286
7287 * w32menu.c (set_frame_menubar): Fix submenu allocation.
7288
888c9e86
EZ
72892011-05-07 Eli Zaretskii <eliz@gnu.org>
7290
b0512a1d
EZ
7291 * w32console.c (Fset_screen_color): Doc fix.
7292 (Fget_screen_color): New function.
7293 (syms_of_ntterm): Defsubr it.
7294
7285dc67
EZ
7295 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
7296 unlink the temporary file if Fcall_process didn't create it in the
7297 first place.
7298 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
7299 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
7300 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
7301 cue to call_process_cleanup not to close that handle.
7302
4d3fcc8e
BK
73032011-05-07 Ben Key <bkey76@gmail.com>
7304
7305 * makefile.w32-in: The bootstrap-temacs rule now makes use of
7306 one of two shell specific rules, either bootstrap-temacs-CMD or
7307 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
7308 to the previous implementation of the bootstrap-temacs rule.
7309 The bootstrap-temacs-CMD rule is similar to the previous
7310 implementation of the bootstrap-temacs rule except that it
7311 makes use of the ESC_CFLAGS variable instead of the CFLAGS
7312 variable.
7313
7314 These changes, along with some changes to nt/configure.bat,
7315 nt/gmake.defs, and nt/nmake.defs, are required to extend my
7316 earlier fix to add support for --cflags and --ldflags options
7317 that include quotes so that it works whether make uses cmd or
7318 sh as the shell.
7319
b4289b64
MA
73202011-05-06 Michael Albinus <michael.albinus@gmx.de>
7321
7322 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
7323 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
7324 is a constant.
7325 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
7326 a string. Handle both cases.
7327 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
7328 (Fdbus_register_method): Use Qinvalid_function.
7329
af4c0e28
JB
73302011-05-06 Juanma Barranquero <lekktu@gmail.com>
7331
7332 * makefile.w32-in: Update dependencies.
7333 (LISP_H): Add inttypes.h and stdin.h.
7334 (PROCESS_H): Add unistd.h.
7335
c51453d9
EZ
73362011-05-06 Eli Zaretskii <eliz@gnu.org>
7337
7338 * lread.c: Include limits.h (fixes the MS-Windows build broken by
7339 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
7340
8ff0ac3c 73412011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 7342
4c4b566b
PE
7343 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
7344
aab2b9b5
PE
7345 * term.c (vfatal): Remove stray call to va_end.
7346 It's not needed and the C Standard doesn't allow it here anyway.
7347
c378da0b
PE
7348 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
7349 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
7350
288b08c7
PE
7351 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
7352 bytes.
7353
e3601888
PE
7354 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
7355
db6c0e74
PE
7356 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
7357
dd5963ea
PE
7358 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
7359
88c9450f
PE
7360 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
7361
2f9442b8
PE
7362 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
7363
c032b5f8
PE
7364 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
7365 * charset.c (Fdefine_charset_internal): Don't initialize
7366 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 7367 32-bit int (Bug#8600).
a108c10b
PE
7368
7369 * lread.c (read_integer): Be more consistent with string-to-number.
7370 Use string_to_number to do the actual conversion; this avoids
7371 rounding errors and fixes some other screwups. Without this fix,
7372 for example, #x1fffffffffffffff was misread as -2305843009213693952.
7373 (digit_to_number): Move earlier, for benefit of read_integer.
7374 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 7375 not a digit in any supported base. (Bug#8602)
a108c10b 7376
ad5f9eea
PE
7377 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
7378
aec1708a
PE
7379 * dispnew.c (scrolling_window): Return 1 if we scrolled,
7380 to match comment at start of function. This also removes a
7381 GCC warning about overflow in a 32+64-bit port.
7382
47be4ab5
PE
7383 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
7384
371cac43
PE
7385 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
7386 Reported by Stefan Monnier in
7387 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
7388 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
7389 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 7390
d01a7826
PE
7391 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
7392 (EMACS_UINTPTR): Likewise, with uintptr_t.
7393
7fd47d5c
PE
7394 * lisp.h: Prefer 64-bit EMACS_INT if available.
7395 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
7396 on 32-bit hosts that have 64-bit int, so that they can access
7397 large files.
122b0c86
PE
7398 However, temporarily disable this change unless the temporary
7399 symbol WIDE_EMACS_INT is defined.
7fd47d5c 7400
8727937b
PE
7401 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
7402
8ac068ac
PE
7403 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
7404 This removes an assumption that EMACS_INT and long are the same
7405 width as pointers. The assumption is true for Emacs porting targets
7406 now, but we want to make other targets possible.
7407 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
7408 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
7409 In the rest of the code, change types of integers that hold casted
7410 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
7411 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
7412 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
7413 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
7414 No need to cast type when ORing.
7415 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
7416 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
7417 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
7418 assume EMACS_INT is the same width as char *.
7419 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
7420 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
7421 Remove no-longer-needed casts.
7422 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
7423 (xg_tool_bar_help_callback, xg_make_tool_item):
7424 Use EMACS_INTPTR to hold an integer
7425 that will be cast to void *; this can avoid a GCC warning
7426 if EMACS_INT is not the same width as void *.
7427 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
7428 * xdisp.c (display_echo_area_1, resize_mini_window_1):
7429 (current_message_1, set_message_1):
7430 Use a local to convert to proper width without a cast.
7431 * xmenu.c (dialog_selection_callback): Likewise.
7432
ede49d71
PE
7433 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
7434 Also, don't assume VALBITS / RAND_BITS is less than 5,
7435 and don't rely on undefined behavior when shifting a 1 left into
7436 the sign bit.
7437 * lisp.h (get_random): Change signature to match.
7438
2f30ecd0
PE
7439 * lread.c (hash_string): Use size_t, not int, for hash computation.
7440 Normally we prefer signed values; but hashing is special, because
7441 it's better to use unsigned division on hash table sizes so that
7442 the remainder is nonnegative. Also, size_t is the natural width
7443 for hashing into memory. The previous code used 'int', which doesn't
7444 retain enough info to hash well into very large tables.
7445 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
7446
2a866e7b
PE
7447 * dbusbind.c: Don't possibly lose pointer info when converting.
7448 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
7449 Use XPNTR rather than XHASH, so that the high-order bits of
7450 the pointer aren't lost when converting through void *.
7451
51639eac
PE
7452 * eval.c (Fautoload): Don't double-shift a pointer.
7453
92394119
PE
7454 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
7455
dbdb9a7c
JB
74562011-05-06 Juanma Barranquero <lekktu@gmail.com>
7457
7458 * gnutls.c (DEF_GNUTLS_FN):
7459 * image.c (DEF_IMGLIB_FN): Make function pointers static.
7460
db7a0b4f
AS
74612011-05-05 Andreas Schwab <schwab@linux-m68k.org>
7462
7463 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
7464 marker. (Bug#8610)
7465
cd394be1 74662011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
7467
7468 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
7469 New version that can reserve upto 2GB of heap space.
7470
f7ff1b0f 74712011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
7472
7473 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
7474
639c109b
TZ
74752011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
7476
7477 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
7478 `gnutls_certificate_set_x509_key_file'.
7479
d2127135
JB
74802011-05-05 Juanma Barranquero <lekktu@gmail.com>
7481
7482 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
7483 Update dependencies.
7484
e968f4f3
JB
74852011-05-04 Juanma Barranquero <lekktu@gmail.com>
7486
7487 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
7488 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7489 Remove unused parameter `fildes'.
7490 * process.c (read_process_output, send_process): Don't pass it.
7491
84d358f0
JB
74922011-05-04 Juanma Barranquero <lekktu@gmail.com>
7493
7494 Fix previous change: the library cache is defined in w32.c.
7495 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
7496 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
7497
0898ca10
JB
74982011-05-04 Juanma Barranquero <lekktu@gmail.com>
7499
7500 Implement dynamic loading of GnuTLS on Windows.
7501
7502 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
7503 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
7504 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
7505 Declare.
7506
7507 * gnutls.c (Qgnutls_dll): Define.
7508 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
7509 (gnutls_*): Declare function pointers.
7510 (init_gnutls_functions): New function to initialize function pointers.
7511 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
7512 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
7513 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
7514 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
7515 (emacs_gnutls_write, emacs_gnutls_read)
7516 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
7517 (Fgnutls_available_p): New function.
7518 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
7519 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
7520 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
7521
7522 * image.c: Include w32.h.
7523 (Vimage_type_cache): Delete.
7524 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
7525 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
7526 (w32_delayed_load): Move to w32.c.
7527
7528 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
7529
7530 * w32.c (QCloaded_from, Vlibrary_cache): Define.
7531 (w32_delayed_load): Move from image.c. When loading a library, record
7532 its filename in the :loaded-from property of the library id.
7533 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
7534 Initialize and staticpro them.
7535 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
7536
7537 * process.c: Include lisp.h before w32.h, not after.
7538 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
7539 instead of gnutls_record_check_pending.
7540
7541 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
7542
ff4de4aa
TZ
75432011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
7544
7545 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
7546 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
7547 as passed in.
7548
abe95abb
JD
75492011-05-03 Jan Djärv <jan.h.d@swipnet.se>
7550
7551 * xterm.c (x_set_frame_alpha): Do not set property on anything
7552 else than FRAME_X_OUTER_WINDOW (Bug#8608).
7553
e16e55d4
JB
75542011-05-02 Juanma Barranquero <lekktu@gmail.com>
7555
7556 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
7557
bafcf6a5
JB
75582011-05-02 Juanma Barranquero <lekktu@gmail.com>
7559
7560 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
7561 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
7562 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
7563 (gnutls_global_initialized, Qgnutls_bootprop_priority)
7564 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
7565 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
7566 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
7567 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
7568 (Qgnutls_bootprop_callbacks_verify): Make static.
7569
e7a6747f
AS
75702011-05-01 Andreas Schwab <schwab@linux-m68k.org>
7571
19ed11ba
AS
7572 * callproc.c: Indentation fixup.
7573
e7a6747f 7574 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
7575 (wait_for_termination, interruptible_wait_for_termination):
7576 Move after wait_for_termination_1.
e7a6747f 7577
1ef14cb4
LMI
75782011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
7579
7580 * sysdep.c (interruptible_wait_for_termination): New function
7581 which is like wait_for_termination, but allows keyboard
7582 interruptions.
7583
7584 * callproc.c (Fcall_process): Add (:file "file") as an option for
7585 the STDOUT buffer.
7586 (Fcall_process_region): Ditto.
7587
330d880c
EZ
75882011-04-30 Eli Zaretskii <eliz@gnu.org>
7589
8db90b73
EZ
7590 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
7591 rather than `XVECTOR (FOO)->size'.
7592
330d880c
EZ
7593 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
7594 inttypes.h, as a gnulib replacement is used if it not available in
7595 system headers.
7596
15cbd324
EZ
75972011-04-21 Eli Zaretskii <eliz@gnu.org>
7598
7599 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
7600 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
7601 of MOST_POSITIVE_FIXNUM. (Bug#8528)
7602
7603 * coding.c (coding_alloc_by_realloc): Error out if destination
7604 will grow beyond MOST_POSITIVE_FIXNUM.
7605 (decode_coding_emacs_mule): Abort if there isn't enough place in
7606 charbuf for the composition carryover bytes. Reserve an extra
7607 space for up to 2 characters produced in a loop.
7608 (decode_coding_iso_2022): Abort if there isn't enough place in
7609 charbuf for the composition carryover bytes.
7610
76112011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 7612
ae940cca
EZ
7613 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
7614 aborting when %lld or %lll format is passed.
7615 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
7616 %llo or %llx format is passed. (Bug#8545)
7617
03ab8921
EZ
7618 * window.c (window_scroll_line_based): Use a marker instead of
7619 simple variables to record original value of point. (Bug#7952)
7620
afda1437
EZ
7621 * doprnt.c (doprnt): Fix the case where a multibyte sequence
7622 produced by %s or %c overflows available buffer space. (Bug#8545)
7623
f76dee0c
PE
76242011-04-28 Paul Eggert <eggert@cs.ucla.edu>
7625
7626 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 7627 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 7628
fdc5744d
JB
76292011-04-28 Juanma Barranquero <lekktu@gmail.com>
7630
7631 * w32.c (init_environment): Warn about defaulting HOME to C:\.
7632
638f053a
JB
76332011-04-28 Juanma Barranquero <lekktu@gmail.com>
7634
7635 * keyboard.c (Qdelayed_warnings_hook): Define.
7636 (command_loop_1): Run `delayed-warnings-hook'
7637 if Vdelayed_warnings_list is non-nil.
7638 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
7639 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
7640
d178f871
EZ
76412011-04-28 Eli Zaretskii <eliz@gnu.org>
7642
7643 * doprnt.c (doprnt): Don't return value smaller than the buffer
7644 size if the message was truncated. (Bug#8545).
7645
b124fd93
JB
76462011-04-28 Juanma Barranquero <lekktu@gmail.com>
7647
7648 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
7649 (Fx_window_property): #if-0 the whole functions, not just the bodies.
7650
e810457d
PE
76512011-04-27 Paul Eggert <eggert@cs.ucla.edu>
7652
7653 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
7654
ea51cceb
JB
76552011-04-27 Juanma Barranquero <lekktu@gmail.com>
7656
7657 * makefile.w32-in: Update dependencies.
7658
94dcfacf
EZ
76592011-04-27 Eli Zaretskii <eliz@gnu.org>
7660
7661 Improve `doprnt' and its usage. (Bug#8545)
7662 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
7663 `format_end'. Remove support for %l as a conversion specifier.
7664 Don't use xrealloc. Improve diagnostics when the %l size modifier
7665 is used. Update the commentary.
7666
7667 * eval.c (verror): Simplify calculation of size_t.
7668
7669 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
7670 messages.
7671
f61f41d7
PE
76722011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
7673
7674 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
7675 change.
7676
96fb4434
PE
76772011-04-27 Paul Eggert <eggert@cs.ucla.edu>
7678
7679 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
7680 This makes this file independent of the recent pseudovector change.
7681
671875da 76822011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 7683
69e9b5a3
PE
7684 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
7685
b5f869a7 7686 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 7687 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 7688 Remove unused local.
c8926152 7689 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 7690
841a1577 7691 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
7692 GCC 4.6.0 optimizes based on type-based alias analysis.
7693 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
7694 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
7695 != &v->size, and therefore "v->size = 1; b->size = 2; return
7696 v->size;" must therefore return 1. This assumption is incorrect
7697 for Emacs, since it type-puns struct Lisp_Vector * with many other
7698 types. To fix this problem, this patch adds a new type struct
f904488f 7699 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
7700 and pseudovectors, and helps optimizing compilers not get fooled
7701 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
7702 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
7703 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
7704 the size member.
eab3844f
PE
7705 (XSETPVECTYPE): Rewrite in terms of new macro.
7706 (XSETPVECTYPESIZE): New macro, specifying both type and size.
7707 This is a bit clearer, and further avoids the possibility of
7708 undesirable aliasing.
7709 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 7710 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
7711 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
7712 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
7713 (ASIZE): Now uses header.size rather than size.
7714 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
7715 to avoid the hassle of writing XVECTOR (foo)->header.size.
7716 (struct vectorlike_header): New type.
eab3844f
PE
7717 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
7718 object, to help avoid aliasing.
7719 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
7720 (SUBRP): Likewise, since Lisp_Subr is a special case.
7721 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
7722 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
7723 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 7724 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
7725 changed to be "header.size" and "header.next".
7726 * buffer.h (struct buffer): Likewise.
7727 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
7728 * frame.h (struct frame): Likewise.
7729 * process.h (struct Lisp_Process): Likewise.
7730 * termhooks.h (struct terminal): Likewise.
7731 * window.c (struct save_window_data, struct saved_window): Likewise.
7732 * window.h (struct window): Likewise.
7733 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
7734 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
7735 * buffer.c (init_buffer_once): Likewise.
7736 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
7737 special case.
7738 * process.c (Fformat_network_address): Use local var for size,
7739 for brevity.
7740
0df1eac5
PE
7741 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
7742
847ab9d1 7743 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
7744 * data.c (atof): Remove decl; no longer used or needed.
7745 (digit_to_number): Move to lread.c.
7746 (Fstring_to_number): Use new string_to_number function, to be
7747 consistent with how the Lisp reader treats infinities and NaNs.
7748 Do not assume that floating-point numbers represent EMACS_INT
7749 without losing information; this is not true on most 64-bit hosts.
7750 Avoid double-rounding errors, by insisting on integers when
7751 parsing non-base-10 numbers, as the documentation specifies.
7752 * lisp.h (string_to_number): New decl, replacing ...
7753 (isfloat_string): Remove.
bc0a5c13 7754 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 7755 (read1): Do not accept +. and -. as integers; this
452f4150
PE
7756 appears to have been a coding error. Similarly, do not accept
7757 strings like +-1e0 as floating point numbers. Do not report
7758 overflow for integer overflows unless the base is not 10 which
7759 means we have no simple and reliable way to continue.
7760 Break out the floating-point parsing into a new
7761 function string_to_number, so that Fstring_to_number parses
7762 floating point numbers consistently with the Lisp reader.
04f2d78b 7763 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
7764 (E_CHAR, EXP_INT): Remove, replacing with ...
7765 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
7766 (string_to_number): New function, replacing isfloat_string.
7767 This function checks for valid syntax and produces the resulting
7768 Lisp float number too. Rework it so that string-to-number
bc0a5c13 7769 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
7770 so that overflow for non-base-10 numbers is reported only when
7771 there's no portable and simple way to convert to floating point.
452f4150 7772
67769ffc
PE
7773 * textprop.c (set_text_properties_1): Rewrite for clarity,
7774 and to avoid GCC warning about integer overflow.
7775
c20db43f
PE
7776 * intervals.h (struct interval): Use EMACS_INT for members
7777 where EMACS_UINT might cause problems. See
7778 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
7779 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
7780 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
7781 All uses changed.
37aa2f85
PE
7782 (offset_intervals): Tell GCC not to worry about length overflow
7783 when negating a negative length.
c20db43f 7784
2538aa2f
PE
7785 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
7786 (overrun_check_free): Likewise.
7787
f2d3008d
PE
7788 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
7789 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
7790 word size.
7791
ec8df744
PE
7792 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
7793 (gnutls_make_error): Rename local to avoid shadowing.
7794 (gnutls_emacs_global_deinit): ifdef out; not used.
7795 (Fgnutls_boot): Use const for pointer to readonly storage.
7796 Comment out unused local. Fix pointer signedness problems.
7797
640ee02d
PE
7798 * lread.c (openp): Don't stuff size_t into an 'int'.
7799 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
7800 about possible signed overflow.
7801
6048fb2a
PE
7802 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
7803 (GDK_KEY_g): Don't define if already defined.
7804 (xg_prepare_tooltip): Avoid pointer signedness problem.
7805 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
7806
fa3c87e1
PE
7807 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
7808 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
7809
2172544b
PE
7810 * xfns.c (Fx_window_property): Simplify a bit,
7811 to make a bit faster and to avoid GCC 4.6.0 warning.
7812 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
7813
9b821a21
PE
7814 * fns.c (internal_equal): Don't assume size_t fits in int.
7815
3c616cfa
PE
7816 * alloc.c (compact_small_strings): Tighten assertion a little.
7817
c2982e87
PE
7818 Replace pEd with more-general pI, and fix some printf arg casts.
7819 * lisp.h (pI): New macro, generalizing old pEd macro to other
7820 conversion specifiers. For example, use "...%"pI"d..." rather
7821 than "...%"pEd"...".
7822 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 7823 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
7824 * alloc.c (check_pure_size): Don't overflow by converting size to int.
7825 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
7826 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
7827 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
7828 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
7829 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
7830 64-bit hosts.
7831 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
7832 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
7833 * print.c (safe_debug_print, print_object): Likewise.
7834 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
7835 to int.
6f04d126
PE
7836 Use pI instead of if-then-else-abort. Use %p to avoid casts,
7837 avoiding the 0 flag, which is not portable.
c2982e87
PE
7838 * process.c (Fmake_network_process): Use pI to avoid cast.
7839 * region-cache.c (pp_cache): Likewise.
7840 * xdisp.c (decode_mode_spec): Likewise.
7841 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
7842 behavior on 64-bit hosts with printf arg.
6f04d126 7843 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
7844 (x_stop_queuing_selection_requests): Likewise.
7845 (x_get_window_property): Don't truncate byte count to an 'int'
7846 when tracing.
0b432f21 7847
5e073ec7
PE
7848 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
7849 here, since it parses constructs like leading '-' and spaces,
7850 which are not wanted; and it overflows with large numbers.
7851 Instead, simply match F[0-9]+, which is what is wanted anyway.
7852
36372bf9
PE
7853 * alloc.c: Remove unportable assumptions about struct layout.
7854 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
7855 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
7856 (allocate_vectorlike, make_pure_vector): Use the new macros,
7857 plus offsetof, to remove unportable assumptions about struct layout.
7858 These assumptions hold on all porting targets that I know of, but
7859 they are not guaranteed, they're easy to remove, and removing them
7860 makes further changes easier.
7861
0b432f21
PE
7862 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
7863 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
7864 (string_overrun_cookie): Now const. Use initializers that
7865 don't formally overflow signed char, to avoid warnings.
000098c1
PE
7866 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
7867 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
7868 (allocate_buffer): Don't assume sizeof (struct buffer) is a
7869 multiple of sizeof (EMACS_INT); it need not be, if
7870 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 7871 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 7872
895009e1
JB
78732011-04-26 Juanma Barranquero <lekktu@gmail.com>
7874
7875 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
7876
6a7a1b0b
TZ
78772011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
7878
7879 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 7880 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
7881 Reported by Paul Eggert <eggert@cs.ucla.edu>.
7882
841a1577 78832011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
7884
7885 * lisp.h (Qdebug): List symbol.
895009e1 7886 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
7887 * keyboard.c (debug-on-event): New variable.
7888 (handle_user_signal): Break into debugger when debug-on-event
7889 matches the current signal symbol.
7890
f2d3ba6f
DN
78912011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
7892
7893 * alloc.c (check_sblock, check_string_bytes)
7894 (check_string_free_list): Convert to standard C.
7895
42ce4c63
TZ
78962011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
7897
7898 * w32.c (emacs_gnutls_push): Fix typo.
7899
825cd63c
EZ
79002011-04-25 Eli Zaretskii <eliz@gnu.org>
7901
fb11d64d
EZ
7902 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
7903 "cast to pointer from integer of different size".
7904
825cd63c
EZ
7905 Improve doprnt and its use in verror. (Bug#8545)
7906 * doprnt.c (doprnt): Document the set of format control sequences
7907 supported by the function. Use SAFE_ALLOCA instead of always
7908 using `alloca'.
7909
7910 * eval.c (verror): Don't limit the buffer size at size_max-1, that
7911 is one byte too soon. Don't use xrealloc; instead xfree and
7912 xmalloc anew.
7913
e061a11b
TZ
79142011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
7915
7916 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
7917 callbacks stage.
7918
7919 * gnutls.c: Renamed global_initialized to
7920 gnutls_global_initialized. Added internals for the
7921 :verify-hostname-error, :verify-error, and :verify-flags
7922 parameters of `gnutls-boot' and documented those parameters in the
7923 docstring. Start callback support.
9173deec
JB
7924 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
7925 unless a fatal error occurred. Call gnutls_alert_send_appropriate
7926 on error. Return error code.
e061a11b
TZ
7927 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
7928 (emacs_gnutls_read): Likewise.
7929 (Fgnutls_boot): Return handshake error code.
7930 (emacs_gnutls_handle_error): New function.
7931 (wsaerror_to_errno): Likewise.
7932
7933 * w32.h (emacs_gnutls_pull): Add prototype.
7934 (emacs_gnutls_push): Likewise.
7935
7936 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
7937 (emacs_gnutls_push): Likewise.
7938
79392011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
7940
7941 * process.c (wait_reading_process_output): Check if GnuTLS
7942 buffered some data internally if no FDs are set for TLS
7943 connections.
7944
7945 * makefile.w32-in (OBJ2): Add gnutls.$(O).
7946 (LIBS): Link to USER_LIBS.
7947 ($(BLD)/gnutls.$(0)): New target.
7948
fa6996bc
EZ
79492011-04-24 Eli Zaretskii <eliz@gnu.org>
7950
eb35682e
EZ
7951 * xdisp.c (handle_single_display_spec): Rename the
7952 display_replaced_before_p argument into display_replaced_p, to
7953 make it consistent with the commentary. Fix typos in the
7954 commentary.
7955
e2ad650c
EZ
7956 * textprop.c (syms_of_textprop): Remove dead code.
7957 (copy_text_properties): Delete obsolete commentary about an
7958 interface that was deleted long ago. Fix typos in the description
7959 of arguments.
7960
1b2de274
EZ
7961 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
7962 to changes in oldXMenu/XMenu.h from 2011-04-16.
7963 <menu_help_message, prev_menu_help_message>: Constify.
7964 (IT_menu_make_room): menu->help_text is now `const char **';
7965 adjust.
7966
7967 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
7968 to changes in oldXMenu/XMenu.h from 2011-04-16.
7969 (struct XMenu): Declare `help_text' `const char **'.
7970
7971 * xfaces.c <Qunspecified>: Make extern again.
7972
7973 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 7974 required by POSIX.
1b2de274 7975
762b15be
EZ
7976 * doc.c (get_doc_string): Improve the format passed to `error'.
7977
7978 * doprnt.c (doprnt): Improve commentary.
7979
7980 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
7981
7982 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
7983 them with etags.
7984
f1052e5d
EZ
7985 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
7986 changes in globals.h immediately force recompilation.
762b15be
EZ
7987 (TAGS): Depend on $(CURDIR)/m/intel386.h and
7988 $(CURDIR)/s/ms-w32.h.
7989 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 7990
fa6996bc
EZ
7991 * character.c (Fchar_direction): Function deleted.
7992 (syms_of_character): Don't defsubr it.
7993 <char-direction-table>: Deleted.
7994
e6c3da20
EZ
79952011-04-23 Eli Zaretskii <eliz@gnu.org>
7996
7997 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
7998 * doprnt.c: Include limits.h.
7999 (SIZE_MAX): New macro.
04f2d78b
CB
8000 (doprnt): Return a size_t value. 2nd arg is now size_t.
8001 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
8002 Improve overflow protection. Support `l' modifier for integer
8003 conversions. Support %l conversion. Don't assume an EMACS_INT
8004 argument for integer conversions and for %c.
8005
8006 * lisp.h (doprnt): Restore prototype.
8007
8008 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
8009 $(SRC)/character.h.
8010
8011 * Makefile.in (base_obj): Add back doprnt.o.
8012
8013 * deps.mk (doprnt.o): Add back prerequisites.
8014 (callint.o): Depend on character.h.
8015
8016 * eval.c (internal_lisp_condition_case): Include the handler
8017 representation in the error message.
8018 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
8019 when breaking from the loop.
8020
8021 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
8022
8023 * callint.c (Fcall_interactively): When displaying error message
8024 about invalid control letter, pass the character's codepoint, not
8025 a pointer to its multibyte form. Improve display of the character
8026 in octal and display also its hex code.
8027
8028 * character.c (char_string): Use %x to display the (unsigned)
8029 codepoint of an invalid character, to avoid displaying a bogus
8030 negative value.
8031
8032 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
8033 `error', not SYMBOL_NAME itself.
8034
8035 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
8036 character arguments to `error'.
8037
8038 * charset.c (check_iso_charset_parameter): Fix incorrect argument
8039 to `error' in error message about FINAL_CHAR argument. Make sure
8040 FINAL_CHAR is a character, and use %c when it is passed as
8041 argument to `error'.
8042
4ffd0d6b 80432011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
8044
8045 * s/ms-w32.h (localtime): Redirect to sys_localtime.
8046
8047 * w32.c: Include <time.h>.
8048 (sys_localtime): New function.
8049
4ffd0d6b 80502011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
8051
8052 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
8053
4ffd0d6b 8054 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 8055
4ffd0d6b 80562011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 8057
4ffd0d6b
GM
8058 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
8059 zombies (Bug#8467).
aac0c6e3 8060
04c56954
EZ
80612011-04-19 Eli Zaretskii <eliz@gnu.org>
8062
8063 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
8064 gl_state.e_property when gl_state.object is Qt.
8065
8066 * insdel.c (make_gap_larger): Remove limitation of buffer size
8067 to <= INT_MAX.
8068
16a43933
CY
80692011-04-18 Chong Yidong <cyd@stupidchicken.com>
8070
8071 * xdisp.c (lookup_glyphless_char_display)
8072 (produce_glyphless_glyph): Handle cons cell entry in
8073 glyphless-char-display.
8074 (Vglyphless_char_display): Document it.
8075
8076 * term.c (produce_glyphless_glyph): Handle cons cell entry in
8077 glyphless-char-display.
8078
4581706e
CY
80792011-04-17 Chong Yidong <cyd@stupidchicken.com>
8080
8081 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
8082
8083 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
8084
8085 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
8086 definition for no-X builds.
8087
4887c6e2 80882011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 8089
fd35b6f9
PE
8090 Static checks with GCC 4.6.0 and non-default toolkits.
8091
5c1ccb01
PE
8092 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
8093
006c5daa
PE
8094 * process.c (keyboard_bit_set): Define only if SIGIO.
8095 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
8096 (send_process): Repair possible setjmp clobbering.
8097
efc736d3
PE
8098 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
8099
4e2fe2e6
PE
8100 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
8101
f97334a2
PE
8102 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
8103
4e75f29d
PE
8104 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
8105 Define only if needed.
8106
90efadd1
PE
8107 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
8108 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 8109 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 8110
3c647824
PE
8111 * dispextern.h (struct redisplay_interface): Rename param
8112 to avoid shadowing.
e264f262 8113 * termhooks.h (struct terminal): Likewise.
761383f4 8114 * xterm.c (xembed_send_message): Likewise.
3c647824 8115
b58c5c4a
PE
8116 * insdel.c (make_gap_smaller): Define only if
8117 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
8118
cad59032
PE
8119 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
8120 it.
8121
c339dc2e
PE
8122 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
8123 so that we aren't warned about unused symbols.
8124
91a3e27b
PE
8125 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
8126
399c71d3 8127 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 8128
8ffc96f5
PE
8129 * xfns.c (x_real_positions): Mark locals as initialized.
8130
eef9bc79
PE
8131 * xmenu.c (xmenu_show): Don't use uninitialized vars.
8132
098db9dd
PE
8133 * xterm.c: Fix problems found by static analysis with other toolkits.
8134 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
8135 (x_dispatch_event): Declare static if USE_GTK, and
8136 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 8137 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 8138 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
8139 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
8140 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 8141
eb18f6cc
PE
8142 * xmenu.c (menu_help_callback): Pointer type fixes.
8143 Use const pointers when pointing at readonly data. Avoid pointer
8144 signedness clashes.
8145 (FALSE): Remove unused macro.
8146 (update_frame_menubar): Remove unused decl.
8147
1fe72bf8
PE
8148 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
8149
60d9e1db
PE
8150 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
8151 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
8152 (single_menu_item): Rename local to avoid shadowing.
8153
39261c26
PE
8154 * keyboard.c (make_lispy_event): Remove unused local var.
8155
018c5e19
PE
8156 * frame.c, frame.h (x_get_resource_string): Bring this back, but
8157 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
8158
63d2b86e
PE
8159 * bitmaps: Change bitmaps from unsigned char back to the X11
8160 compatible char. Avoid the old compiler warnings about
8161 out-of-range initializers by using, for example, '\xab' rather
8162 than 0xab.
8163
aefd87e1
PE
8164 * xgselect.c (xgselect_initialize): Check vs interface
8165 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
8166
bf501fb9
PE
8167 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
8168
e9829fdf
PE
8169 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
8170 to read-only memory.
8171
1086c095
PE
8172 * fns.c (vector): Remove; this old hack is no longer needed.
8173
2baccd04 8174 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 8175 Remove unused var.
dde42981 8176 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 8177
72391843 8178 * xrdb.c (x_load_resources): Omit unused local.
3565b346 8179
436c16df 8180 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 8181 (x_window): Rename locals to avoid shadowing.
dc5ddd85 8182 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 8183
92bb796d 8184 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 8185 (x_term_init): Remove local to avoid shadowing.
92bb796d 8186
764430a3 8187 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
8188
8189 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
8190 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
8191
d1dfb56c
EZ
81922011-04-16 Eli Zaretskii <eliz@gnu.org>
8193
c4354cb4
EZ
8194 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
8195
d1dfb56c
EZ
8196 Fix regex.c, syntax.c and friends for buffers > 2GB.
8197 * syntax.h (struct gl_state_s): Declare character position members
8198 EMACS_INT.
8199
8200 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
8201
04f2d78b
CB
8202 * textprop.c (verify_interval_modification, interval_of):
8203 Declare arguments EMACS_INT.
d1dfb56c
EZ
8204
8205 * intervals.c (adjust_intervals_for_insertion): Declare arguments
8206 EMACS_INT.
8207
8208 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
8209
8210 * indent.c (Fvertical_motion): Local variable it_start is now
8211 EMACS_INT.
8212
8213 * regex.c (re_match, re_match_2, re_match_2_internal)
8214 (bcmp_translate, regcomp, regexec, print_double_string)
8215 (group_in_compile_stack, re_search, re_search_2, regex_compile)
8216 (re_compile_pattern, re_exec): Declare arguments and local
8217 variables `size_t' and `ssize_t' and return values `regoff_t', as
8218 appropriate.
8219 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
8220 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
8221 <compile_stack_type>: `size' and `avail' are now `size_t'.
8222
8223 * regex.h <regoff_t>: Use ssize_t, not int.
8224 (re_search, re_search_2, re_match, re_match_2): Arguments that
8225 specify buffer/string position and length are now ssize_t and
8226 size_t. Return type is regoff_t.
8227
613052cd
BK
82282011-04-16 Ben Key <bkey76@gmail.com>
8229
8230 * nsfont.m: Fixed bugs in ns_get_family and
8231 ns_descriptor_to_entity that were caused by using free to
8232 deallocate memory blocks that were allocated by xmalloc (via
8233 xstrdup). This caused Emacs to crash when compiled with
8234 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
8235 --enable-checking=xmallocoverrun). xfree is now used to
8236 deallocate these memory blocks.
8237
4170f62f 82382011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 8239
71b41406
PE
8240 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
8241
9587a89d
PE
8242 emacs_write: Accept and return EMACS_INT for sizes.
8243 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
8244 et seq.
8245 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
8246 Accept and return EMACS_INT.
8247 (emacs_gnutls_write): Return the number of bytes written on
8248 partial writes.
8249 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
8250 (emacs_read, emacs_write): Remove check for negative size, as the
8251 Emacs source code has been audited now.
9587a89d
PE
8252 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
8253 (emacs_read, emacs_write): Use it.
273a5f82
PE
8254 * process.c (send_process): Adjust to the new signatures of
8255 emacs_write and emacs_gnutls_write. Do not attempt to store
8256 a byte offset into an 'int'; it might overflow.
9587a89d 8257 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 8258
3e047f51
PE
8259 * sound.c: Don't assume sizes fit in 'int'.
8260 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 8261 Return EMACS_INT, not int.
3e047f51 8262 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
8263 Accept EMACS_INT, not int.
8264 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
8265 record read return values.
8266
cc39a9db
BK
82672011-04-15 Ben Key <bkey76@gmail.com>
8268
c9d0ec6d
JB
8269 * keyboard.c (Qundefined): Don't declare static since it is used
8270 in nsfns.m.
8271 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
8272 static since they are used in nsfont.m.
cc39a9db 8273
6c60eb9f
SM
82742011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
8275
8276 * process.c (Qprocessp): Don't declare static.
8277 * lisp.h (Qprocessp): Declare again.
8278
7990b61a
JB
82792011-04-15 Juanma Barranquero <lekktu@gmail.com>
8280
8281 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
8282
5d4cb038
PE
82832011-04-14 Paul Eggert <eggert@cs.ucla.edu>
8284
8bd7b830 8285 Improve C-level modularity by making more things 'static'.
cd64ea1d 8286
e3b27b31
PE
8287 Don't publish debugger-only interfaces to other modules.
8288 * lisp.h (safe_debug_print, debug_output_compilation_hack):
8289 (verify_bytepos, count_markers): Move decls to the only modules
8290 that need them.
8291 * region-cache.h (pp_cache): Likewise.
8292 * window.h (check_all_windows): Likewise.
8293 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
8294
5d4cb038
PE
8295 * sysdep.c (croak): Now static, if
8296 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
8297 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
8298
8299 * alloc.c (refill_memory_reserve): Now static if
8300 !defined REL_ALLOC || defined SYSTEM_MALLOC.
8301 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 8302
e87b6180
PE
8303 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
8304 Define only if USE_LUCID.
8305
ac64929e
PE
8306 * xrdb.c (x_customization_string, x_rm_string): Now static.
8307
6f37259d
PE
8308 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
8309 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
8310
1683e3ab
PE
8311 * xdisp.c (draw_row_with_mouse_face): Now static.
8312 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
8313
de9c2632
PE
8314 * window.h (check_all_windows): Mark externally visible.
8315
2b96acb7
PE
8316 * window.c (window_deletion_count): Now static.
8317
8318 * undo.c: Make symbols static if they're not exported.
8319 (last_undo_buffer, last_boundary_position, pending_boundary):
8320 Now static.
8321
50436f33
PE
8322 * textprop.c (interval_insert_behind_hooks): Now static.
8323 (interval_insert_in_front_hooks): Likewise.
8324
64520e5c
PE
8325 * term.c: Make symbols static if they're not exported.
8326 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
8327 (max_frame_lines, tty_set_terminal_modes):
8328 (tty_reset_terminal_modes, tty_turn_off_highlight):
8329 (get_tty_terminal): Now static.
8330 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
8331 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 8332 HAVE_WINDOW_SYSTEM.
64520e5c
PE
8333 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
8334 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
8335
1fa53021
PE
8336 * sysdep.c: Make symbols static if they're not exported.
8337 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
8338 Now static.
8339 (sigprocmask_set, full_mask): Remove; unused.
8340 (wait_debugging): Mark as visible.
8341 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
8342 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
8343
d4b43b22
PE
8344 * syntax.c (syntax_temp): Define only if !__GNUC__.
8345
b7c513d0
PE
8346 * sound.c (current_sound_device, current_sound): Now static.
8347
989b29ad
PE
8348 * search.c (searchbufs, searchbuf_head): Now static.
8349
13a55a78
PE
8350 * scroll.c (scroll_cost): Remove; unused.
8351 * dispextern.h (scroll_cost): Remove decl.
8352
de68a1fc
PE
8353 * region-cache.h (pp_cache): Mark as externally visible.
8354
40ccffa6
PE
8355 * process.c: Make symbols static if they're not exported.
8356 (process_tick, update_tick, create_process, chan_process):
8357 (Vprocess_alist, proc_buffered_char, datagram_access):
8358 (fd_callback_data, send_process_frame, process_sent_to): Now static.
8359 (deactivate_process): Mark defn as static, as well as decl.
8360 * lisp.h (create_process): Remove decl.
8361 * process.h (chan_process, Vprocess_alist): Remove decls.
8362
ad64fc97
PE
8363 * print.c: Make symbols static if they're not exported.
8364 (print_depth, new_backquote_output, being_printed, print_buffer):
8365 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
8366 (print_interval, print_number_index, initial_stderr_stream):
8367 Now static.
8368 * lisp.h (Fprinc): Remove decl.
8369 (debug_output_compilation_hack): Mark as externally visible.
8370
adddb265
PE
8371 * sysdep.c (croak): Move decl from here to syssignal.h.
8372 * syssignal.h (croak): Put it here, so the API can be checked when
8373 'croak' is called from dissociate_if_controlling_tty.
8374
1717ede2
PE
8375 * minibuf.c: Make symbols static if they're not exported.
8376 (minibuf_save_list, choose_minibuf_frame): Now static.
8377 * lisp.h (choose_minibuf_frame): Remove decl.
8378
fa5fb2bc
PE
8379 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
8380
1e3890d1
PE
8381 * lread.c: Make symbols static if they're not exported.
8382 (read_objects, initial_obarray, oblookup_last_bucket_number):
8383 Now static.
8384 (make_symbol): Remove; unused.
8385 * lisp.h (initial_obarray, make_symbol): Remove decls.
8386
8a1414fa
PE
8387 * keyboard.c: Make symbols static if they're not exported.
8388 (single_kboard, recent_keys_index, total_keys, recent_keys):
8389 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
8390 (this_single_command_key_start, echoing, last_auto_save):
8391 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
8392 (command_loop, echo_now, keyboard_init_hook, help_char_p):
8393 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
8394 (Vlispy_mouse_stem, double_click_count):
8395 Now static.
8396 (force_auto_save_soon): Define only if SIGDANGER.
8397 (ignore_mouse_drag_p): Now static if
8398 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
8399 (print_help): Remove; unused.
8400 (stop_character, last_timer_event): Mark as externally visible.
8401 * keyboard.h (ignore_mouse_drag_p): Declare only if
8402 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
8403 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
8404 * lisp.h (echoing): Remove decl.
8405 (force_auto_save_soon): Declare only if SIGDANGER.
8406 * xdisp.c (redisplay_window): Simplify code, to make it more
8407 obvious that ignore_mouse_drag_p is not accessed if !defined
8408 USE_GTK && !defined HAVE_NS.
8409
93ea6e8f
PE
8410 * intervals.c: Make symbols static if they're not exported.
8411 (merge_properties_sticky, merge_interval_right, delete_interval):
8412 Now static.
8413 * intervals.h (merge_interval_right, delete_interval): Remove decls.
8414
77382fcc
PE
8415 * insdel.c: Make symbols static if they're not exported.
8416 However, leave prepare_to_modify_buffer alone. It's never
8417 called from outside this function, but that appears to be a bug.
8418 (combine_after_change_list, combine_after_change_buffer):
4889fc82 8419 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
8420 (adjust_after_replace_noundo): Remove; unused.
8421 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 8422 (signal_before_change): Remove decls.
77382fcc 8423
9306c32e
PE
8424 * indent.c (val_compute_motion, val_vmotion): Now static.
8425
cd44d2eb
PE
8426 * image.c: Make symbols static if they're not exported.
8427 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
8428 if USE_GTK.
8429 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
8430 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
8431
ad9a7a06
PE
8432 * fringe.c (standard_bitmaps): Now static.
8433 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
8434
81626931
PE
8435 * frame.c: Make symbols static if they're not exported.
8436 (x_report_frame_params, make_terminal_frame): Now static.
8437 (get_frame_param): Now static, unless HAVE_NS.
8438 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
8439 (x_get_resource_string): Remove; not used.
8440 * frame.h (make_terminal_frame, x_report_frame_params):
8441 (x_get_resource_string); Remove decls.
8442 (x_fullscreen_adjust): Declare only if WINDOWSNT.
8443 * lisp.h (get_frame_param): Declare only if HAVE_NS.
8444
239f9db9
PE
8445 * font.c, fontset.c: Make symbols static if they're not exported.
8446 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
8447 (FACE_SUITABLE_FOR_CHAR_P): Use it.
8448 * font.c (font_close_object): Now static.
8449 * font.h (font_close_object): Remove.
8450 * fontset.c (FONTSET_OBJLIST): Remove.
8451 (free_realized_fontset) #if-0 the body, which does nothing.
8452 (face_suitable_for_char_p): #if-0, as it's never called.
8453 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
8454 * xfaces.c (face_at_string_position):
8455 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
8456 since 0 is always ASCII.
8457
dfcf3579
PE
8458 * fns.c (weak_hash_tables): Now static.
8459
5045092b
PE
8460 * fileio.c: Make symbols static if they're not exported.
8461 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
8462 (Vwrite_region_annotation_buffers): Now static.
8463
57a96f5c
PE
8464 * eval.c: Make symbols static if they're not exported.
8465 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
8466 * lisp.h (backtrace_list): Remove decl.
8467
35f08c38
PE
8468 * emacs.c: Make symbols static if they're not exported.
8469 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
8470 (fatal_error_code, fatal_error_signal_hook, standard_args):
8471 Now static.
8472 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
8473 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
8474 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
8475 * lisp.h (fatal_error_signal_hook): Remove decl.
8476 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
8477
f44bd759
PE
8478 * editfns.c: Move a (normally-unused) function to its only use.
8479 * editfns.c, lisp.h (get_operating_system_release): Remove.
8480 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
8481 worth the hassle of breaking this out.
8482
b532497d
PE
8483 * xterm.c: Make symbols static if they're not exported.
8484 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
8485 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
8486 (x_destroy_window, x_delete_display):
8487 Now static.
8488 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
8489 (x_mouse_leave): Remove; unused.
8490 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
8491 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
8492 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
8493 Remove decls.
8494 (x_mouse_leave): Declare only if WINDOWSNT.
8495 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
8496 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
8497 USE_X_TOOLKIT.
8498
1675728f
PE
8499 * ftxfont.c: Make symbols static if they're not exported.
8500 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
8501 HAVE_FREETYPE.
8502 * font.h (ftxfont_driver): Likewise.
8503
e4cebfca
PE
8504 * xfns.c: Make symbols static if they're not exported.
8505 (x_last_font_name, x_display_info_for_name):
8506 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
8507 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
8508 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
8509 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
8510 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
8511 (last_show_tip_args): Now static.
8512 (xic_defaut_fontset, xic_create_fontsetname): Define only if
8513 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
8514 (x_screen_planes): Remove; unused.
8515 * dispextern.h (x_screen_planes): Remove decl.
8516
5bf46f05
PE
8517 * dispnew.c: Make symbols static if they're not exported.
8518 * dispextern.h (redraw_garbaged_frames, scrolling):
8519 (increment_row_positions): Remove.
8520 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
8521 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
8522 Now static.
8523 (redraw_garbaged_frames): Remove; unused.
8524
435f4c28
PE
8525 * xfaces.c: Make symbols static if they're not exported.
8526 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
8527 Remove decls.
8528 * xterm.h (defined_color): Remove decls.
8529 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
8530 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
8531 (menu_face_changed_default, defined_color, free_realized_face):
8532 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
8533 (ascii_face_of_lisp_face): Remove; unused.
8534
8524aef3
PE
8535 * xdisp.c: Make symbols static if they're not exported.
8536 * dispextern.h (scratch_glyph_row, window_box_edges):
8537 (glyph_to_pixel_coords, set_cursor_from_row):
8538 (get_next_display_element, set_iterator_to_next):
8539 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
8540 (show_mouse_face): Remove decls
8541 * frame.h (message_buf_print): Likewise.
8542 * lisp.h (pop_message, set_message, check_point_in_composition):
8543 Likewise.
8544 * xterm.h (set_vertical_scroll_bar): Likewise.
8545 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
8546 (message_buf_print, scratch_glyph_row, displayed_buffer):
8547 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
8548 (get_next_display_element, show_mouse_face, window_box_edges):
8549 (frame_to_window_pixel_xy, check_point_in_composition):
8550 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
8551 (glyph_to_pixel_coords): Remove; unused.
8552
16390cd2
PE
8553 * dired.c (file_name_completion): Now static.
8554
8555 * dbusbind.c (xd_in_read_queued_messages): Now static.
8556
a25f4dfa
PE
8557 * lisp.h (circular_list_error, FOREACH): Remove; unused.
8558 * data.c (circular_list_error): Remove.
8559
14a9c8df
PE
8560 * commands.h (last_point_position, last_point_position_buffer):
8561 (last_point_position_window): Remove decls.
8562 * keyboard.c: Make these variables static.
8563
04f2d78b
CB
8564 * coding.h (coding, code_convert_region, encode_coding_gap):
8565 Remove decls.
74ab6df5
PE
8566 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
8567 (iso_code_class, detect_coding, code_convert_region): Now static.
8568 (encode_coding_gap): Remove; unused.
8569
38dfbee1
PE
8570 * chartab.c (chartab_chars, chartab_bits): Now static.
8571
a2cb4e63
PE
8572 * charset.h (charset_iso_8859_1): Remove decl.
8573 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
8574 Now static.
8575
127198fd
PE
8576 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
8577 * ccl.c (Vccl_program_table): Now static.
8578 (check_ccl_update): Remove; unused.
8579
d85b608f
PE
8580 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
8581 * category.h: ... from here.
8582 * category.c (check_category_table, set_category_set): Now static.
8583
31cd66f3
PE
8584 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
8585 * lisp.h: Remove these decls.
8586
c358e587
PE
8587 * buffer.c (buffer_count): Remove unused var.
8588
e78aecca
PE
8589 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
8590 so that it's not optimized away.
8591 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
8592 * dispextern.h (bidi_dump_cached_states): Remove, since it's
8593 exported only to the debugger.
8594
e192d7d3 8595 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 8596 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 8597
92470028
PE
8598 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
8599 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
8600 was inaccessible from Lisp.
8601 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
8602 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
8603
244ed907
PE
8604 alloc.c: Import and export fewer symbols, and remove unused items.
8605 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
8606 is defined.
8607 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
8608 it's not optimized away by whole-program optimization.
8609 (message_enable_multibyte, free_misc): Remove.
8610 (catchlist, handlerlist, mark_backtrace):
8611 Declare only if BYTE_MARK_STACK.
8612 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
8613 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
8614 (message_enable_multibyte): Remove decl.
8615 (free_misc, interval_free_list, float_block, float_block_index):
8616 (n_float_blocks, float_free_list, cons_block, cons_block_index):
8617 (cons_free_list, last_marked_index):
8618 Now static.
8619 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
8620 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
8621 (mark_backtrace): Define only if BYTE_MARK_STACK.
8622 * xdisp.c (message_enable_multibyte): Now static.
8623
61c2b50e 8624 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
8625 This makes it easier for human readers (and static analyzers)
8626 to see whether these variables are used from other modules.
8627 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
8628 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
8629 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
8630 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
8631 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
8632 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
8633 * xmenu.c, xselect.c:
8634 Declare Q* vars static if they are not used in other modules.
8635 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
8636 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
8637 Remove decls of unexported vars.
8638 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
8639
95c82688
PE
8640 * lisp.h (DEFINE_FUNC): Make sname 'static'.
8641
16a97296
PE
8642 Make Emacs functions such as Fatom 'static' by default.
8643 This makes it easier for human readers (and static analyzers)
8644 to see whether these functions can be called from other modules.
8645 DEFUN now defines a static function. To make the function external
8646 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
8647 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
8648 (Finit_image_library):
16a97296
PE
8649 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
8650 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
8651 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
8652 Remove decls, since these functions are now static.
8653 (Funintern, Fget_internal_run_time): New decls, since these functions
8654 were already external.
95c82688 8655
16a97296
PE
8656 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
8657 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
8658 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
8659 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
8660 * keyboard.c, keymap.c, lread.c:
8661 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
8662 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
8663 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
8664 Mark functions with DEFUE instead of DEFUN,
8665 if they are used in other modules.
8666 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
8667 decls for now-static functions.
8668 * buffer.h (Fdelete_overlay): Remove decl.
8669 * callproc.c (Fgetenv_internal): Mark as internal.
8670 * composite.c (Fremove_list_of_text_properties): Remove decl.
8671 (Fcomposition_get_gstring): New forward static decl.
8672 * composite.h (Fcomposite_get_gstring): Remove decl.
8673 * dired.c (Ffile_attributes): New forward static decl.
8674 * doc.c (Fdocumntation_property): New forward static decl.
8675 * eval.c (Ffetch_bytecode): New forward static decl.
8676 (Funintern): Remove extern decl; now in .h file where it belongs.
8677 * fileio.c (Fmake_symbolic_link): New forward static decl.
8678 * image.c (Finit_image_library): New forward static decl.
8679 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
8680 * intervals.h (Fprevious_property_change):
8681 (Fremove_list_of_text_properties): Remove decls.
8682 * keyboard.c (Fthis_command_keys): Remove decl.
8683 (Fcommand_execute): New forward static decl.
8684 * keymap.c (Flookup_key): New forward static decl.
8685 (Fcopy_keymap): Now static.
8686 * keymap.h (Flookup_key): Remove decl.
8687 * process.c (Fget_process): New forward static decl.
8688 (Fprocess_datagram_address): Mark as internal.
8689 * syntax.c (Fsyntax_table_p): New forward static decl.
8690 (skip_chars): Remove duplicate decl.
8691 * textprop.c (Fprevious_property_change): New forward static decl.
8692 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
8693 Now internal.
8694 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
8695 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
8696
785bbd42
PE
8697 * editfns.c (Fformat): Remove unreachable code.
8698
8b913b57
AS
86992011-04-14 Andreas Schwab <schwab@linux-m68k.org>
8700
8701 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
8702 change. (Bug#8496)
8703
a6744a35
EZ
87042011-04-13 Eli Zaretskii <eliz@gnu.org>
8705
8706 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
8707 when at ZV. (Bug#8487)
8708
e7974947
AS
87092011-04-12 Andreas Schwab <schwab@linux-m68k.org>
8710
baad03f0
AS
8711 * charset.c (Fclear_charset_maps): Use xfree instead of free.
8712 (Bug#8437)
8713 * keyboard.c (parse_tool_bar_item): Likewise.
8714 * sound.c (sound_cleanup, alsa_close): Likewise.
8715 * termcap.c (tgetent): Likewise.
8716 * xfns.c (x_default_font_parameter): Likewise.
8717 * xsettings.c (read_and_apply_settings): Likewise.
8718
e7974947
AS
8719 * alloc.c (overrun_check_malloc, overrun_check_realloc)
8720 (overrun_check_free): Protoize.
8721
28272684
PE
87222011-04-12 Paul Eggert <eggert@cs.ucla.edu>
8723
8724 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
8725 since callers should never pass a negative size.
8726 Change the signature to match that of plain 'read' and 'write'; see
8727 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
8728 * lisp.h: Update prototypes of emacs_write and emacs_read.
8729
11997c76
EZ
87302011-04-11 Eli Zaretskii <eliz@gnu.org>
8731
8732 * xdisp.c (redisplay_window): Don't try to determine the character
8733 position of the scroll margin if the window start point w->startp
e896f03c 8734 is outside the buffer's accessible region. (Bug#8468)
11997c76 8735
8a2cbd72
EZ
87362011-04-10 Eli Zaretskii <eliz@gnu.org>
8737
8738 Fix write-region and its subroutines for buffers > 2GB.
8739 * fileio.c (a_write, e_write): Modify declaration of arguments and
8740 local variables to support buffers larger than 2GB.
8741 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
8742
8743 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
8744 argument, local variables, and return value.
8745
8746 * lisp.h: Update prototypes of emacs_write and emacs_read.
8747
8748 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
8749
4073e537 87502011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 8751
1ebfdcb6
PE
8752 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
8753
b2ded58d
PE
8754 Fix more problems found by GCC 4.6.0's static checks.
8755
7d66342c
PE
8756 * xdisp.c (vmessage): Use a better test for character truncation.
8757
bbf47d44
PE
8758 * charset.c (load_charset_map): <, not <=, for optimization,
8759 and to avoid potential problems with integer overflow.
9248994d 8760 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 8761 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 8762 * editfns.c (Fformat): Likewise.
1e69125e 8763 * syntax.c (skip_chars): Likewise.
3befa583 8764
e3019616
PE
8765 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
8766 This also lets GCC 4.6.0 generate slightly better loop code.
8767
becfa255
PE
8768 * callint.c (Fcall_interactively): <, not <=, for optimization.
8769 (Fcall_interactively): Count the number of arguments produced,
8770 not the number of arguments given. This is simpler and lets GCC
8771 4.6.0 generate slightly better code.
8772
dae0cd48
PE
8773 * ftfont.c: Distingish more carefully between FcChar8 and char.
8774 The previous code passed unsigned char * to a functions like
8775 strlen and xstrcasecmp that expect char *, which does not
8776 conform to the C standard.
8777 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
8778 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
8779 char * when the C standard requires it.
8780
76032d70
PE
8781 * keyboard.c (read_char): Remove unused var.
8782
eb3f1cc8
PE
8783 * eval.c: Port to Windows vsnprintf (Bug#8435).
8784 Include <limits.h>.
8785 (SIZE_MAX): Define if the headers do not.
8786 (verror): Do not give up if vsnprintf returns a negative count.
8787 Instead, grow the buffer. This ports to Windows vsnprintf, which
8788 does not conform to C99. Problem reported by Eli Zaretskii.
8789 Also, simplify the allocation scheme, by avoiding the need for
8790 calling realloc, and removing the ALLOCATED variable.
8791
70476b54
PE
8792 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
8793
12020a9e
PE
8794 Remove invocations of doprnt, as Emacs now uses vsnprintf.
8795 But keep the doprint source code for now, as we might revamp it
8796 and use it again (Bug#8435).
ea6c7ae6
PE
8797 * lisp.h (doprnt): Remove.
8798 * Makefile.in (base_obj): Remove doprnt.o.
8799 * deps.mk (doprnt.o): Remove.
8800
5fdb398c
PE
8801 error: Print 32- and 64-bit integers portably (Bug#8435).
8802 Without this change, on typical 64-bit hosts error ("...%d...", N)
8803 was used to print both 32- and 64-bit integers N, which relied on
8804 undefined behavior.
61bdb816 8805 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
8806 * lisp.h (error, verror): Mark as printf-like functions.
8807 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
8808 Report overflow in size calculations when allocating printf buffer.
8809 Do not truncate output string at its first null byte.
8810 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
8811 Truncate the output at a character boundary, since vsnprintf does not
8812 do that.
8813 * charset.c (check_iso_charset_parameter): Convert internal
8814 character to string before calling 'error', since %c now has the
8815 printf meaning.
8816 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
8817 overflow when computing char to be passed to 'error'. Do not
8818 pass Lisp_Object to 'error'; pass the integer instead.
8819 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
8820 formatted with plain %d.
8821
b189fa66
PE
8822 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
8823
bff87ef0
PE
8824 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
8825
7e2cac20
PE
8826 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
8827
ce4d90b5
PE
8828 * xterm.c (x_catch_errors): Remove duplicate declaration.
8829
266c9547
PE
8830 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
8831
79c49ad2
PE
8832 * xdisp.c, lisp.h (message_nolog): Remove; unused.
8833
368f4090
JM
88342011-04-10 Jim Meyering <meyering@redhat.com>
8835
8836 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
8837 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
8838 return ssize_t not "int", and use size_t as the buffer length.
8839 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
8840 * gnutls.h: Update declarations.
8841 * process.c (read_process_output): Use ssize_t, to match.
8842 (send_process): Likewise.
8843
a32d4040
CY
88442011-04-09 Chong Yidong <cyd@stupidchicken.com>
8845
8846 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
8847
8546720e 88482011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 8849
04f2d78b
CB
8850 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
8851 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 8852
8546720e
GM
8853 * xterm.c (handle_one_xevent):
8854 * xmenu.c (create_and_show_popup_menu):
8855 * xselect.c (x_decline_selection_request)
8856 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 8857
0a2f5c1a 88582011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
8859
8860 Fix some uses of `int' instead of EMACS_INT.
8861 * search.c (string_match_1, fast_string_match)
8862 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
8863 (scan_buffer, find_next_newline_no_quit)
8864 (find_before_next_newline, search_command, Freplace_match)
8865 (Fmatch_data): Make some `int' variables be EMACS_INT.
8866
8867 * xdisp.c (display_count_lines): 3rd argument and return value now
8868 EMACS_INT. All callers changed.
8869 (pint2hrstr): Last argument is now EMACS_INT.
8870
8871 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
8872 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
8873 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
8874 (decode_coding_utf_16, decode_coding_emacs_mule)
8875 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
8876 (decode_coding_ccl, decode_coding_charset)
8877 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
8878 (decode_coding_iso_2022, decode_coding_emacs_mule)
8879 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
8880 <char_offset, last_offset>: Declare EMACS_INT.
8881 (encode_coding_utf_8, encode_coding_utf_16)
8882 (encode_coding_emacs_mule, encode_invocation_designation)
8883 (encode_designation_at_bol, encode_coding_iso_2022)
8884 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
8885 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
8886 Declare EMACS_INT.
8887 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
8888 (encode_invocation_designation): Last argument P_NCHARS is now
8889 EMACS_INT.
8890 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
8891 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
8892
8893 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
8894 All users changed.
8895
8896 * ccl.c (Fccl_execute_on_string): Declare some variables
8897 EMACS_INT.
8898
8546720e 88992011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
8900
8901 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
8902
4e19a977
CS
89032011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
8904
8905 * process.c (Fformat_network_address): Doc fix.
8906
87302331
R
89072011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
8908
ee7683eb 8909 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 8910
cbb59342
CY
89112011-04-08 Chong Yidong <cyd@stupidchicken.com>
8912
8913 * keyboard.c (read_char): Call Lisp function help-form-show,
8914 instead of using internal_with_output_to_temp_buffer.
8915 (Qhelp_form_show): New var.
e0d38eeb 8916 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
8917
8918 * print.c (internal_with_output_to_temp_buffer): Function deleted.
8919
8920 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
8921
e67a13ab
CY
89222011-04-06 Chong Yidong <cyd@stupidchicken.com>
8923
04f2d78b
CB
8924 * process.c (Flist_processes): Remove to Lisp.
8925 (list_processes_1): Delete.
e67a13ab 8926
973f782d
EZ
89272011-04-06 Eli Zaretskii <eliz@gnu.org>
8928
7c106b1e
EZ
8929 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
8930
973f782d
EZ
8931 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
8932
41cf7d1a 89332011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 8934
ca23cc88
PE
8935 Fix more problems found by GCC 4.6.0's static checks.
8936
f390e2d5
PE
8937 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
8938
42eea0d0
PE
8939 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
8940
b69769da 8941 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 8942
f9541e84
PE
8943 * xdisp.c (vmessage): Mark as a printf-like function.
8944
13841b55
PE
8945 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
8946
c136c10f
PE
8947 * sound.c (sound_warning): Don't crash if arg contains a printf format.
8948
5e2d4a30
PE
8949 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
8950 printf-like functions.
8951 (tiff_load): Add casts to remove these marks before passing them
8952 to system-supplied API.
8953
583f48b9
PE
8954 * eval.c (Fsignal): Remove excess argument to 'fatal'.
8955
b25d760e
PE
8956 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
8957 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
8958 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
8959 directly, rather than having caller test rule sign. This avoids
8960 some unnecessary tests.
8961 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
8962 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
8963 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 8964
bc7b6697 8965 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 8966 (xfont_open): Avoid unnecessary tests.
bc7b6697 8967
27ccc379
PE
8968 * composite.c (composition_gstring_put_cache): Use unsigned integer.
8969
dcd5c89a
PE
8970 * composite.h, composite.c (composition_gstring_put_cache):
8971 Use EMACS_INT, not int, for length.
8972
b13a45c6
PE
8973 * composite.h (COMPOSITION_DECODE_REFS): New macro,
8974 breaking out part of COMPOSITION_DECODE_RULE.
8975 (COMPOSITION_DECODE_RULE): Use it.
8976 * composite.c (get_composition_id): Remove unused local vars,
8977 by using the new macro.
8978
1e792e4d
PE
8979 * textprop.c (set_text_properties_1): Change while to do-while,
8980 since the condition is always true at first.
8981
dc6c6455 8982 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
8983 (interval_deletion_adjustment): Return unsigned value.
8984 All uses changed.
dc6c6455 8985
aba7731a
PE
8986 * process.c (list_processes_1, create_pty, read_process_output):
8987 (exec_sentinel): Remove vars that were set but not used.
afd4052b 8988 (create_pty): Remove unnecessary "volatile"s.
bc57d757 8989 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 8990 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 8991 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 8992
fdfc4bf3
PE
8993 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
8994
fca8fe46 8995 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 8996 (update_syntax_table): Use unsigned instead of int.
fca8fe46 8997
06a0259a 8998 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 8999 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 9000 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 9001
e7b9e80f
PE
9002 * print.c (print_error_message): Avoid int overflow.
9003
56201685
PE
9004 * font.c (font_list_entities): Redo for clarity,
9005 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
9006
78834453 9007 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 9008 (font_score): Avoid potential overflow in diff calculation.
78834453 9009
0bc0b309 9010 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 9011 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 9012
e610eaca
PE
9013 * eval.c (funcall_lambda): Rename local to avoid shadowing.
9014
b895abce
PE
9015 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
9016 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
9017 can always succeed if overflow has undefined behavior.
9018
1f1d9321 9019 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 9020 (wordify): Omit three unnecessary tests.
1f1d9321 9021
c59478bc
PE
9022 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
9023 All callers changed. This avoids the need for an unused var.
9024
79b73827
PE
9025 * casefiddle.c (casify_region): Remove var that is set but not used.
9026
a4db5dfe
PE
9027 * dired.c (file_name_completion): Remove var that is set but not used.
9028
43aae36e
PE
9029 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
9030
2a47c44d 9031 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 9032 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 9033
a37c69bf
PE
9034 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
9035 Check for integer overflow on size calculations.
9036
328ab8e7
PE
9037 * buffer.c (Fprevious_overlay_change): Remove var that is set
9038 but not used.
9039
e5a2a5cb
PE
9040 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
9041 Remove vars that are set but not used.
8d84a6eb 9042 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 9043 (timer_check_2): Mark vars as initialized.
e5a2a5cb 9044
a60e5f68
PE
9045 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
9046
f661cb61 9047 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 9048 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 9049
f0397f5a
PE
9050 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
9051 that are set but not used.
9052
8664db06 9053 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 9054 if XCreateBitmapFromData fails (Bug#8410).
8664db06 9055
6abdaa4a
PE
9056 * xselect.c (x_get_local_selection, x_handle_property_notify):
9057 Remove vars that are set but not used.
9058
0ce7538d 9059 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 9060 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 9061
9ae848fc
PE
9062 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
9063 Remove var that is set but not used.
0b918413
PE
9064 (scroll_bar_windows_size): Now size_t, not int.
9065 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
9066 Check for overflow.
9ae848fc 9067
a5a62657
PE
9068 * xfaces.c (realize_named_face): Remove vars that are set but not used.
9069 (map_tty_color) [!defined MSDOS]: Likewise.
9070
5c5cdd39
PE
9071 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
9072
66ebf983
PE
9073 * coding.c: Remove vars that are set but not used.
9074 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
9075 All callers changed.
9076 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
9077 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
9078 (decode_coding_charset): Remove vars that are set but not used.
9079
1be4d761
PE
9080 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
9081 that is set but not used.
9082
47553fa8
PE
9083 * print.c (print_object): Remove var that is set but not used.
9084
1f7196bf 9085 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
9086 The gnulib version avoids calling malloc in the usual case,
9087 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
9088 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
9089 * filelock.c (current_lock_owner): Likewise.
9090 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
9091 * sysdep.c: Include allocator.h, careadlinkat.h.
9092 (emacs_no_realloc_allocator): New static constant.
9093 (emacs_readlink): New function.
fdb61804
PE
9094 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
9095 ../lib/careadlinkat.h.
d1fdcab7 9096
f84c17c7
SM
90972011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
9098
9099 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
9100 first non-nil return value).
9101
ef3862ad
JD
91022011-04-03 Jan Djärv <jan.h.d@swipnet.se>
9103
9104 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
9105 if not defined (Bug#8403).
9106
376a7006
JB
91072011-04-02 Juanma Barranquero <lekktu@gmail.com>
9108
9109 * xdisp.c (display_count_lines): Remove parameter `start',
9110 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
9111 (get_char_face_and_encoding): Remove parameter `multibyte_p',
9112 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
9113 (fill_stretch_glyph_string): Remove parameters `row' and `area',
9114 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
9115 and thereabouts. All callers changed.
9116 (get_per_char_metric): Remove parameter `f', unused since
9117 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
9118
6ca3801d
JM
91192011-04-02 Jim Meyering <meyering@redhat.com>
9120
9121 do not dereference NULL upon failed strdup
9122 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
9123 (ns_get_family): Likewise.
9124
d8e2b5ba
JB
91252011-04-02 Juanma Barranquero <lekktu@gmail.com>
9126
9127 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
9128
8c74fcbd
JD
91292011-04-02 Jan Djärv <jan.h.d@swipnet.se>
9130
9131 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
9132 later (Bug#8403).
9133
7200d79c
SM
91342011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
9135
03408648 9136 Add lexical binding.
7200d79c 9137
03408648
SM
9138 * window.c (Ftemp_output_buffer_show): New fun.
9139 (Fsave_window_excursion):
9140 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
9141
9142 * lread.c (lisp_file_lexically_bound_p): New function.
9143 (Fload): Bind Qlexical_binding.
9144 (readevalloop): Remove `evalfun' arg.
9145 Bind Qinternal_interpreter_environment.
9146 (Feval_buffer): Bind Qlexical_binding.
9147 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
9148 Mark as dynamic.
9149 (syms_of_lread): Declare `lexical-binding'.
9150
9151 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
9152
9153 * keyboard.c (eval_dyn): New fun.
9154 (menu_item_eval_property): Use it.
ca105506
SM
9155
9156 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 9157
03408648
SM
9158 * fns.c (concat, mapcar1): Accept byte-code-functions.
9159
9160 * eval.c (Fsetq): Handle lexical vars.
9161 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
9162 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
9163 (FletX, Flet): Obey lexical binding.
9164 (Fcommandp): Handle closures.
9165 (Feval): New `lexical' arg.
9166 (eval_sub): New function extracted from Feval. Use it almost
9167 everywhere where Feval was used. Look up vars in lexical env.
9168 Handle closures.
9169 (Ffunctionp): Move from subr.el.
9170 (Ffuncall): Handle closures.
9171 (apply_lambda): Remove `eval_flags'.
9172 (funcall_lambda): Handle closures and new byte-code-functions.
9173 (Fspecial_variable_p): New function.
9174 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
9175 but without exporting it to Lisp.
23aba0ea 9176
23aba0ea 9177 * doc.c (Fdocumentation, store_function_docstring):
03408648 9178 * data.c (Finteractive_form): Handle closures.
23aba0ea 9179
03408648
SM
9180 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
9181 interactive spec.
ba83908c 9182
04f2d78b
CB
9183 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
9184 New byte-codes.
03408648
SM
9185 (exec_byte_code): New function extracted from Fbyte_code to handle new
9186 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 9187
03408648 9188 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 9189
03408648 9190 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 9191
e2abce01
JB
91922011-03-31 Juanma Barranquero <lekktu@gmail.com>
9193
9194 * xdisp.c (redisplay_internal): Fix prototype.
9195
63696a73 91962011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 9197
63696a73 9198 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
9199 (try_scrolling): Use it when setting scroll_limit.
9200 Limit scrolling to 100 screen lines.
63696a73
EZ
9201 (redisplay_window): Even when falling back on "recentering",
9202 position point in the window according to scroll-conservatively,
9203 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
9204
9205 (try_scrolling): When point is above the window, allow searching
9206 as far as scroll_max, or one screenful, to compute vertical
9207 distance from PT to the scroll margin position. This prevents
9208 try_scrolling from unnecessarily failing when
9209 scroll-conservatively is set to a value slightly larger than the
9210 window height. Clean up the case of PT below the margin at bottom
9211 of window: scroll_max can no longer be INT_MAX. When aggressive
9212 scrolling is in use, don't let point enter the opposite scroll
9213 margin as result of the scroll.
9214 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
9215 threshold of 100 lines for never-recentering scrolling.
9216
e4cc2dfc
JB
92172011-03-31 Juanma Barranquero <lekktu@gmail.com>
9218
9219 * dispextern.h (move_it_by_lines):
9220 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
9221 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
9222 (message_log_check_duplicate): Remove parameters `prev_bol' and
9223 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
9224 (redisplay_internal): Remove parameter `preserve_echo_area',
9225 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
9226
9227 * indent.c (Fvertical_motion):
9228 * window.c (window_scroll_pixel_based, Frecenter):
9229 Don't pass `need_y_p' to `move_it_by_lines'.
9230
1c470562
SM
92312011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
9232
44f230aa
SM
9233 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
9234 steal a few bits to be more compact.
9235 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
9236 Remove unneeded casts.
9237
1c470562
SM
9238 * bytecode.c (Fbyte_code): CAR and CDR can GC.
9239
888adce9
ZK
92402011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
9241
9242 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
9243 binding" message (bug#7967).
9244
f838ed7b
PE
92452011-03-30 Paul Eggert <eggert@cs.ucla.edu>
9246
77861b95
PE
9247 Fix more problems found by GCC 4.6.0's static checks.
9248
de6dbc14
PE
9249 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
9250 Remove unused local var.
9251
f838ed7b
PE
9252 * editfns.c (Fmessage_box): Remove unused local var.
9253
792c7b2b
PE
9254 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
9255 (note_mode_line_or_margin_highlight, note_mouse_highlight):
9256 Omit unused local vars.
c499e557 9257 * window.c (shrink_windows): Omit unused local var.
b01a1c29 9258 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
9259 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
9260 Omit unused local var.
9261
ba0165e1
PE
9262 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
9263 Don't assume string length fits in int.
32ad8845 9264 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 9265 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 9266
3c59b4c9
PE
9267 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
9268 instead of alloca (Bug#8344).
9269
a3eed478 9270 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 9271 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 9272
eb4d412d
PE
9273 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
9274
1658b401
PE
9275 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
9276 concerns.
9277
9278 * term.c (produce_glyphless_glyph): Remove unnecessary test.
9279
9280 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 9281
9a2c6e05
PE
9282 * keyboard.c (syms_of_keyboard): Use the same style as later
9283 in this function when indexing through an array. This also
9284 works around GCC bug 48267.
9285
03d0a109
PE
9286 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
9287
44f730c8
PE
9288 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
9289
fe75f926
PE
9290 * chartab.c (sub_char_table_ref_and_range): Redo for slight
9291 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
9292
ffa8c828
PE
9293 * keyboard.c, keyboard.h (num_input_events): Now size_t.
9294 This avoids undefined behavior on integer overflow, and is a bit
9295 more convenient anyway since it is compared to a size_t variable.
9296
c5101a77
PE
9297 Variadic C functions now count arguments with size_t, not int.
9298 This avoids an unnecessary limitation on 64-bit machines, which
9299 caused (substring ...) to crash on large vectors (Bug#8344).
9300 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
9301 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 9302 All variadic functions and their callers changed accordingly.
c5101a77
PE
9303 (struct gcpro.nvars): Now size_t, not int. All uses changed.
9304 * data.c (arith_driver, float_arith_driver): Likewise.
9305 * editfns.c (general_insert_function): Likewise.
9306 * eval.c (struct backtrace.nargs, interactive_p)
9307 (internal_condition_case_n, run_hook_with_args, apply_lambda)
9308 (funcall_lambda, mark_backtrace): Likewise.
9309 * fns.c (concat): Likewise.
9310 * frame.c (x_set_frame_parameters): Likewise.
9311 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
9312 0 if not found, not -1. All callers changed.
9313
dd3f25f7
PE
9314 * alloc.c (garbage_collect): Don't assume stack size fits in int.
9315 (stack_copy_size): Now size_t, not int.
9316 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
9317
461c2ab9
JB
93182011-03-28 Juanma Barranquero <lekktu@gmail.com>
9319
9320 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
9321 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
9322 All callers changed.
9323
9324 * lisp.h (multibyte_char_to_unibyte):
9325 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
9326 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
9327 * character.h (CHAR_TO_BYTE8):
9328 * cmds.c (internal_self_insert):
9329 * editfns.c (general_insert_function):
9330 * keymap.c (push_key_description):
9331 * search.c (Freplace_match):
9332 * xdisp.c (message_dolog, set_message_1): All callers changed.
9333
f6d62986
SM
93342011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
9335
9336 * keyboard.c (safe_run_hook_funcall): New function.
9337 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
9338 don't set the hook to nil, but remove the offending function instead.
9339 (Qcommand_hook_internal): Remove, unused.
9340 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
9341 Vcommand_hook_internal.
9342
9343 * eval.c (enum run_hooks_condition): Remove.
9344 (funcall_nil, funcall_not): New functions.
9345 (run_hook_with_args): Call each function through a `funcall' argument.
9346 Remove `cond' argument, now redundant.
9347 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
9348 (Frun_hook_with_args_until_failure): Adjust accordingly.
9349 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
9350
1db5b1ad
JB
93512011-03-28 Juanma Barranquero <lekktu@gmail.com>
9352
9353 * dispextern.h (string_buffer_position): Remove declaration.
9354
9355 * print.c (strout): Remove parameter `multibyte', unused since
9356 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
9357
9358 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
9359 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
9360 All callers changed.
9361
9362 * w32.c (_wsa_errlist): Use braces for struct initializers.
9363
9364 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
9365 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
9366 All callers changed.
9367 (string_buffer_position): Likewise. Also, make static (it's never
9368 used outside xdisp.c).
9369 (cursor_row_p): Remove parameter `w', unused since
9370 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
9371 (decode_mode_spec): Remove parameter `precision', introduced during
9372 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
9373 All callers changed.
9374
5ffb62aa
JD
93752011-03-27 Jan Djärv <jan.h.d@swipnet.se>
9376
9377 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
9378
461c2ab9 93792011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
9380
9381 * nsterm.m (ns_menu_bar_is_hidden): New variable.
9382 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
9383 (ns_update_auto_hide_menu_bar): New functions.
9384 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
9385 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
9386 ns_constrain_all_frames.
9387 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
9388 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
9389
5c380ffb
JD
93902011-03-27 Jan Djärv <jan.h.d@swipnet.se>
9391
9392 * nsmenu.m (runDialogAt): Remove argument to timer_check.
9393
9af30bdf
GM
93942011-03-27 Glenn Morris <rgm@gnu.org>
9395
9396 * syssignal.h: Replace RETSIGTYPE with void.
9397 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
9398 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
9399 Replace SIGTYPE with void everywhere.
9400 * s/usg5-4-common.h (SIGTYPE): Remove definition.
9401 * s/template.h (SIGTYPE): Remove commented out definition.
9402
e2abce01
JB
94032011-03-26 Eli Zaretskii <eliz@gnu.org>
9404
9405 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
9406 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
9407
f868cd8a
JB
94082011-03-26 Juanma Barranquero <lekktu@gmail.com>
9409
59eb0929
JB
9410 * w32.c (read_unc_volume): Use parameter `henum', instead of
9411 global variable `wget_enum_handle'.
9412
9413 * keymap.c (describe_vector): Remove parameters `indices' and
9414 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
9415 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
9416
f868cd8a
JB
9417 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
9418
9419 * keyboard.c (timer_check): Remove parameter `do_it_now',
9420 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
9421 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
9422 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
9423
9424 * keyboard.c (read_char):
9425 * w32menu.c (w32_menu_display_help):
9426 * xmenu.c (show_help_event, menu_help_callback):
9427 Adjust calls to `show_help_echo'.
9428
9429 * gtkutil.c (xg_maybe_add_timer):
9430 * keyboard.c (readable_events):
9431 * process.c (wait_reading_process_output):
9432 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
9433
9434 * insdel.c (adjust_markers_gap_motion):
9435 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
9436 (gap_left, gap_right): Don't call it.
9437
2ecf6fdb
CY
94382011-03-25 Chong Yidong <cyd@stupidchicken.com>
9439
9440 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
9441 incurred during fontification.
9442
6b1f9ba4
JB
94432011-03-25 Juanma Barranquero <lekktu@gmail.com>
9444
9445 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
9446 (DEFVAR_PER_BUFFER): Don't pass it.
9447
9448 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
9449 (scrolling_window): Don't pass it.
9450
0f4a96b5
JB
94512011-03-25 Juanma Barranquero <lekktu@gmail.com>
9452
9453 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
9454
9455 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
9456 and `suffix'.
9457 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
9458 of variables specific to SELinux and computation of `encoded_absname'.
9459
9460 * image.c (XPutPixel): Remove unused variable `height'.
9461
9462 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
9463
9464 * unexw32.c (get_section_info): Remove unused variable `section'.
9465
9466 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
9467 (system_process_attributes): Remove unused variable `sess'.
9468 (sys_read): Remove unused variable `err'.
9469
9470 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
9471 (w32_wnd_proc): Remove unused variable `isdead'.
9472 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
9473 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
9474 (x_create_tip_frame): Remove unused variable `tem'.
9475
9476 * w32inevt.c (w32_console_read_socket):
9477 Remove unused variable `no_events'.
9478
9479 * w32term.c (x_draw_composite_glyph_string_foreground):
9480 Remove unused variable `width'.
9481
1149507c
JB
94822011-03-24 Juanma Barranquero <lekktu@gmail.com>
9483
9484 * w32term.c (x_set_glyph_string_clipping):
9485 Don't pass uninitialized region to CombineRgn.
9486
9c88f339
JB
94872011-03-23 Juanma Barranquero <lekktu@gmail.com>
9488
9489 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
9490 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
9491 (Fx_close_connection): Remove unused variable `i'.
9492
9493 * w32font.c (w32font_draw): Return number of glyphs.
9494 (w32font_open_internal): Remove unused variable `i'.
9495 (w32font_driver): Add missing initializer.
9496
9497 * w32menu.c (utf8to16): Remove unused variable `utf16'.
9498 (fill_in_menu): Remove unused variable `items_added'.
9499
9500 * w32term.c (last_mouse_press_frame): Remove static global variable.
9501 (w32_clip_to_row): Remove unused variable `f'.
9502 (x_delete_terminal): Remove unused variable `i'.
9503
9504 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
9505 (NOTHING): Remove unused static global variable.
9506 (uniscribe_check_otf): Remove unused variable `table'.
9507 (uniscribe_font_driver): Add missing initializers.
9508
dee091a3
JD
95092011-03-23 Julien Danjou <julien@danjou.info>
9510
9511 * term.c (Fsuspend_tty, Fresume_tty):
9512 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
9513 * window.c (temp_output_buffer_show):
9514 * insdel.c (signal_before_change):
9515 * frame.c (Fhandle_switch_frame):
9516 * fileio.c (Fdo_auto_save):
9517 * emacs.c (Fkill_emacs):
9518 * editfns.c (save_excursion_restore):
9519 * cmds.c (internal_self_insert):
9520 * callint.c (Fcall_interactively):
9521 * buffer.c (Fkill_all_local_variables):
9522 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
9523 Use Frun_hooks.
0f4a96b5 9524 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 9525 unconditionally since it does the check itself.
dee091a3 9526
2c520ab5 95272011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 9528
c9c49752
PE
9529 Fix more problems found by GCC 4.5.2's static checks.
9530
8abc3f12
PE
9531 * coding.c (encode_coding_raw_text): Avoid unnecessary test
9532 the first time through the loop, since we know p0 < p1 then.
9533 This also avoids a gcc -Wstrict-overflow warning.
9534
a2d26660
PE
9535 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
9536 leading to a memory leak, possible in functions like
9537 load_charset_map_from_file that can allocate an unbounded number
b12ef411 9538 of objects (Bug#8318).
a2d26660 9539
916c72e9
PE
9540 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
9541 that could (at least in theory) be that large.
9542
19ab8a18
PE
9543 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
9544 This is less likely to overflow, and avoids undefined behavior if
9545 overflow does occur. All callers changed. Use strtoul to scan
9546 for the unsigned long integer.
b7cbbd6f
PE
9547 (pint2hrstr): Simplify and tune code slightly.
9548 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 9549
f0641eff
PE
9550 * scroll.c (do_scrolling): Work around GCC bug 48228.
9551 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
9552
7f650bb9
PE
9553 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
9554 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
9555 (validate_x_resource_name): Simplify count usage.
9556 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 9557
37dd57d1
PE
9558 * fileio.c (Fcopy_file): Report error if fchown or fchmod
9559 fail (Bug#8306).
81e56e61 9560
699979fc 9561 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 9562
401bf9b4
PE
9563 * process.c (Fmake_network_process): Use socklen_t, not int,
9564 where POSIX says socklen_t is required in portable programs.
9565 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 9566 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
9567 (Fmake_network_process, server_accept_connection):
9568 (wait_reading_process_output, read_process_output):
9569 Likewise.
9570
b93aacde
PE
9571 * process.c: Rename or move locals to avoid shadowing.
9572 (list_processes_1, Fmake_network_process):
9573 (read_process_output_error_handler, exec_sentinel_error_handler):
9574 Rename or move locals.
4dc343ee 9575 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 9576 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 9577 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 9578 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 9579 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 9580
af8a867c 9581 Make tparam.h and terminfo.c consistent.
44f230aa
SM
9582 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
9583 Include tparam.h instead, since it declares them.
af8a867c
PE
9584 * cm.h (PC): Remove extern decl; tparam.h now does this.
9585 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
9586 * terminfo.c: Include tparam.h, to check interfaces.
9587 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
9588 (tparam): Adjust signature to match interface in tparam.h;
9589 this removes some undefined behavior. Check that outstring and len
9590 are zero, which they always are with Emacs.
9591 * tparam.h (PC, BC, UP): New extern decls.
9592
0248044d 9593 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 9594 (xftfont_open): Rename locals to avoid shadowing.
0248044d 9595
8ff096c1 9596 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
9597 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
9598 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 9599 (ftfont_list): Remove unused local.
49eaafba
PE
9600 (get_adstyle_property, ftfont_pattern_entity):
9601 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
9602 Rename locals to avoid shadowing.
8ff096c1 9603
e2be39f6
PE
9604 * xfont.c (xfont_list_family): Mark var as initialized.
9605
c9735e30
PE
9606 * xml.c (make_dom): Now static.
9607
8f5201ae
PE
9608 * composite.c (composition_compute_stop_pos): Rename local to
9609 avoid shadowing.
b246f932
PE
9610 (composition_reseat_it): Remove unused locals.
9611 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 9612 (composition_update_it): Mark var as initialized.
11b61122
PE
9613 (find_automatic_composition): Mark vars as initialized,
9614 with a FIXME (Bug#8290).
8f5201ae 9615
760fbc2c
PE
9616 character.h: Rename locals to avoid shadowing.
9617 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
9618 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
9619 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
9620 (BUF_DEC_POS): Be more systematic about renaming local temporaries
9621 to avoid shadowing.
9622
ff08eb85
PE
9623 * textprop.c (property_change_between_p): Remove; unused.
9624
fc7bf025
PE
9625 * intervals.c (interval_start_pos): Now static.
9626
235d7abc
PE
9627 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
9628
44f230aa
SM
9629 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
9630 Rename locals to avoid shadowing.
3e7d6594 9631
50060332
PE
9632 * sound.c (wav_play, au_play, Fplay_sound_internal):
9633 Fix pointer signedness.
d01f234b 9634 (alsa_choose_format): Remove unused local var.
c83b8872
PE
9635 (wav_play): Initialize a variable to 0, to prevent undefined
9636 behavior (Bug#8278).
50060332 9637
c4fc4e30
PE
9638 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
9639
918436ed
PE
9640 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
9641
c939f91b
PE
9642 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
9643 clobbering (Bug#8298).
b9c7f648
PE
9644 * sysdep.c (sys_subshell): Likewise.
9645 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 9646
6bd8c144
PE
9647 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
9648 This should get cleaned up, so that child_setup has the
9649 same signature on all platforms.
9650
7710357c 9651 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 9652 (relocate_fd): Rename locals to avoid shadowing.
7710357c 9653
c59da222
CY
96542011-03-22 Chong Yidong <cyd@stupidchicken.com>
9655
9656 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
9657 not to be necessary, and produces flickering.
9658
66b87493
GM
96592011-03-20 Glenn Morris <rgm@gnu.org>
9660
9661 * config.in: Remove file.
9662
45b6f6d5
JB
96632011-03-20 Juanma Barranquero <lekktu@gmail.com>
9664
9665 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
9666 are now in src/globals.h.
9667 (syms_of_minibuf): Remove spurious & from previous change.
9668
cd394be1 96692011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
9670
9671 * minibuf.c (completing-read-function): New variable.
9672 (completing-read-default): Rename from completing-read.
9673 (completing-read): Call completing-read-function.
9674
b14e3e21
CY
96752011-03-19 Juanma Barranquero <lekktu@gmail.com>
9676
9677 * xfaces.c (Fx_load_color_file):
9678 Read color file from absolute filename (bug#8250).
9679
f2b726e6
JB
96802011-03-19 Juanma Barranquero <lekktu@gmail.com>
9681
9682 * makefile.w32-in: Update dependencies.
9683
09f6ff02
EZ
96842011-03-17 Eli Zaretskii <eliz@gnu.org>
9685
9686 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
9687
29a6015a
PE
96882011-03-17 Paul Eggert <eggert@cs.ucla.edu>
9689
a3a6c54e
PE
9690 Fix more problems found by GCC 4.5.2's static checks.
9691
b766f867
PE
9692 * process.c (make_serial_process_unwind, send_process_trap):
9693 (sigchld_handler): Now static.
9694
be02381c
PE
9695 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
9696 That way, the code declares only the vars that it needs.
9697 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
9698 * s/cygwin.h (PTY_ITERATION): Likewise.
9699 * s/darwin.h (PTY_ITERATION): Likewise.
9700 * s/gnu-linux.h (PTY_ITERATION): Likewise.
9701
57048744
PE
9702 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
9703 * process.c (allocate_pty): Don't declare stb unless it's needed.
9704
7914961c 9705 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
9706 (CONSTANTLIM): Remove; unused.
9707 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
9708 Define only if needed.
7914961c 9709
b3967b18
PE
9710 * unexelf.c (unexec): Name an expression,
9711 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
9712 Use a different way to cause a compilation error if anyone uses
9713 n rather than nn, a way that does not involve shadowing.
73366a00 9714 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 9715
29a6015a
PE
9716 * deps.mk (unexalpha.o): Remove; unused.
9717
43cfc33e 9718 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 9719 * unexec.h: New file.
ce701a33
PE
9720 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
9721 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
9722 Depend on unexec.h.
9723 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
9724 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
9725 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 9726 Change as necessary to match prototype in unexec.h.
ce701a33 9727
01f44d5a
PE
9728 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
9729 shadowing.
4f63c6bb 9730 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 9731
a6670b0b
PE
9732 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
9733 Rename locals to avoid shadowing.
9734
cef2010d 9735 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 9736 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 9737
d4d7173a
PE
9738 * print.c (Fredirect_debugging_output): Fix pointer signedess.
9739
f08b802a
PE
9740 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
9741 warning when compiling print.c.
9742
3ddb0639
PE
9743 * font.c (font_unparse_fcname): Abort in an "impossible" situation
9744 instead of using an uninitialized var.
5ad03b97 9745 (font_sort_entities): Mark var as initialized.
3ddb0639 9746
170a2692
PE
9747 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
9748
e663c700
PE
9749 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
9750 pointers to constants.
89bc529a 9751 (font_parse_fcname): Remove unused vars.
7b81e2d0 9752 (font_delete_unmatched): Now static.
ea838e10 9753 (font_get_spec): Remove; unused.
13a547c6
PE
9754 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
9755 (font_update_drivers, Ffont_get_glyphs, font_add_log):
9756 Rename or move locals to avoid shadowing.
e663c700 9757
2a80c887 9758 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 9759 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 9760
1384fa33 9761 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 9762 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 9763
8b2c52e9
PE
9764 * alloc.c (mark_backtrace): Move decl from here ...
9765 * lisp.h: ... to here, so that it can be checked.
9766
475545b5 9767 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 9768 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
9769 (lisp_indirect_variable): Name an expression,
9770 to avoid gcc -Wbad-function-cast warning.
1faed8ae 9771 (Fdefvar): Rename locals to avoid shadowing.
475545b5 9772
b1349114 9773 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 9774 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 9775 Use const pointer when appropriate.
b1349114 9776
a2928364
PE
9777 * lisp.h (get_system_name, get_operating_system_release):
9778 Move decls here, to check interfaces.
9779 * process.c (get_operating_system_release): Move decl to lisp.h.
9780 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
9781 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
9782 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
9783 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
9784 (Fformat_time_string, Fencode_time, Finsert_char):
9785 (Ftranslate_region_internal, Fformat):
9786 Rename or remove local vars to avoid shadowing.
9710023e 9787 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 9788
a415e694
PE
9789 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
9790 avoid shadowing.
9791
8ef4622d
PE
9792 * lisp.h (eassert): Check that the argument compiles, even if
9793 ENABLE_CHECKING is not defined.
9794
946f9a5b
PE
9795 * data.c (Findirect_variable): Name an expression, to avoid
9796 gcc -Wbad-function-cast warning.
112396d6 9797 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 9798 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
9799 (Fmake_variable_buffer_local, Fmake_local_variable):
9800 Mark variables as initialized.
52746918 9801 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 9802
e5aab7e7 9803 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
9804 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
9805 Rename locals to avoid shadowing.
dff45157
PE
9806 (mark_stack): Move local variables into the #ifdef region where
9807 they're used.
7bc26fdb
PE
9808 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
9809 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
9810 needed otherwise.
9811 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
9812 (GC_STRING_CHARS): Remove; not used.
d40d4be1 9813 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 9814
e5aab7e7
PE
9815 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
9816 avoids undefined behavior in theory.
9817
4da60324
PE
9818 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
9819
88043301
PE
9820 Use functions, not macros, for up- and down-casing (Bug#8254).
9821 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
9822 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
9823 to use the following functions instead of these macros.
9824 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
9825 EMACS_INT, since callers assume the returned value fits in int.
9826 (upcase1): Likewise, for UPCASE_TABLE.
9827 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 9828 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 9829 the race-condition problem in the old DOWNCASE.
88043301 9830
19ed5445
PE
9831 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
9832 Rename locals to avoid shadowing.
9833 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
9834 (regex_compile, re_search_2, re_match_2_internal):
9835 Remove unused local vars.
952db0d7
PE
9836 (FREE_VAR): Rewrite so as not to use empty "else",
9837 which gcc can warn about.
da053e48 9838 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
9839 (RETALLOC_IF): Define only if needed.
9840 (WORDCHAR_P): Likewise. This one is never needed, but is used
9841 only in a comment talking about a compiler bug, so put inside
9842 the #if 0 of that comment.
9843 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
9844 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
9845 Remove; unused.
19ed5445 9846
1f3561e4 9847 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
9848 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
9849 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 9850
ded6f8f7
PE
9851 * search.c (simple_search): Remove unused var.
9852
dbd37a95
PE
9853 * dired.c (compile_pattern): Move decl from here ...
9854 * lisp.h: ... to here, so that it can be checked.
9855 (struct re_registers): New forward decl.
9856
7e47afad
PE
9857 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
9858
85f24f61
PE
9859 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
9860 All uses changed.
9861 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
9862 Rename locals to avoid shadowing.
5671df8f 9863 (Fvertical_motion): Mark locals as initialized.
85f24f61 9864
181aa2be 9865 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 9866 (casify_region): Mark local as initialized.
181aa2be 9867
930d429c
PE
9868 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
9869
7082eac6
PE
9870 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
9871 New macros, so that the caller can use some names other than
9872 gcpro1, gcpro2, etc.
9873 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
9874 of the new macros.
9875 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
9876 argument, for consistency with GCPRO2_VAR, etc: it is now the
9877 prefix of the variable, not the variable itself. All uses
9878 changed.
38b2c076
PE
9879 * dired.c (directory_files_internal, file_name_completion):
9880 Rename locals to avoid shadowing.
9881
15206ed9
PE
9882 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
9883 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
9884 dired.c's scmp function, had undefined behavior.
9885 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
9886 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
9887 * buffer.h: ... to here, because these macros use current_buffer,
9888 and the new implementation with inline functions needs to have
9889 current_buffer in scope now, rather than later when the macros
9890 are used.
9891 (downcase, upcase1): New static inline functions.
9892 (DOWNCASE, UPCASE1): Reimplement using these functions.
9893 This avoids undefined behavior in expressions like
9894 DOWNCASE (x) == DOWNCASE (y), which previously suffered
9895 from race conditions in accessing the global variables
9896 case_temp1 and case_temp2.
9897 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
9898 * lisp.h (case_temp1, case_temp2): Remove their decls.
9899 * character.h (ASCII_CHAR_P): Move from here ...
9900 * lisp.h: ... to here, so that the inline functions mentioned
9901 above can use them.
9902
4a6bea26
PE
9903 * dired.c (directory_files_internal_unwind): Now static.
9904
f14b7e14
PE
9905 * fileio.c (file_name_as_directory, directory_file_name):
9906 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
9907 Now static.
2893f146
PE
9908 (file_name_as_directory): Use const pointers when appropriate.
9909 (Fexpand_file_name): Likewise. In particular, newdir might
9910 point at constant storage, so make it a const pointer.
fd4ead52 9911 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
9912 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
9913 signedness issues.
f839df0c
PE
9914 (Fset_file_times, Finsert_file_contents, auto_save_error):
9915 Rename locals to avoid shadowing.
f14b7e14 9916
5716756e 9917 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
9918 (Ftry_completion, Fall_completions): Rename or remove locals
9919 to avoid shadowing.
5716756e 9920
b4c3046a
PE
9921 * marker.c (bytepos_to_charpos): Remove; unused.
9922
b45db522
PE
9923 * lisp.h (verify_bytepos, count_markers): New decls,
9924 so that gcc does not warn that these functions aren't declared.
9925
85876d07
PE
9926 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
9927 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 9928 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 9929 (copy_text): Remove unused local var.
85876d07 9930
03d78a21 9931 * filelock.c (within_one_second): Now static.
b3dd38ab 9932 (lock_file_1): Rename local to avoid shadowing.
03d78a21 9933
5df8f01b
PE
9934 * buffer.c (fix_overlays_before): Mark locals as initialized.
9935 (fix_start_end_in_overlays): Likewise. This function should be
9936 simplified by using pointers-to-pointers, but that's a different
9937 matter.
b1d876f1 9938 (switch_to_buffer_1): Now static.
8f54f30a
PE
9939 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
9940 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 9941
a70072c9 9942 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 9943 Fix pointer signedness issue.
edced198
PE
9944 (sys_subshell): Mark local as volatile if checking for lint,
9945 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 9946 (MAXPATHLEN): Define only if needed.
a70072c9 9947
a0977c44
PE
9948 * process.c (serial_open, serial_configure): Move decls from here ...
9949 * systty.h: ... to here, so that they can be checked.
9950
a884fdcc
PE
9951 * fns.c (get_random, seed_random): Move extern decls from here ...
9952 * lisp.h: ... to here, so that they can be checked.
9953
604efe86 9954 * sysdep.c (reset_io): Now static.
b8950c94 9955 (wait_for_termination_signal): Remove; unused.
604efe86 9956
38fc62d9
PE
9957 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
9958 (copy_keymap_item, append_key, push_text_char_description):
9959 Now static.
1004a21a 9960 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 9961 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
9962 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
9963 (describe_map_tree):
9964 Rename locals to avoid shadowing.
38fc62d9 9965
2f2650da
PE
9966 * keyboard.c: Declare functions static if they are not used elsewhere.
9967 (echo_char, echo_dash, cmd_error, top_level_2):
9968 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
9969 (read_char, kbd_buffer_get_event, make_lispy_position):
9970 (make_lispy_event, make_lispy_movement, apply_modifiers):
9971 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
9972 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
9973 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 9974 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 9975 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 9976
a053e86c 9977 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
9978 (mark_kboards): Move decl here ...
9979 * alloc.c (mark_kboards): ... from here.
a053e86c 9980
4752793e
PE
9981 * lisp.h (force_auto_save_soon): New decl.
9982
74f10ca7 9983 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
9984 (DEFINE_DUMMY_FUNCTION): New macro.
9985 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
9986 Use it.
c03cd23f
PE
9987 (main): Add casts to avoid warnings
9988 if GCC considers string literals to be constants.
74f10ca7 9989
022e70d4
PE
9990 * lisp.h (fatal_error_signal): Add decl, since it's exported.
9991
59d6fe83
PE
9992 * dbusbind.c: Pointer signedness fixes.
9993 (xd_signature, xd_append_arg, xd_initialize):
9994 (Fdbus_call_method, Fdbus_call_method_asynchronously):
9995 (Fdbus_method_return_internal, Fdbus_method_error_internal):
9996 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
9997 (Fdbus_register_signal): Use SSDATA when the context wants char *.
9998
78320123
PE
9999 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
10000 if GCC considers string literals to be constants.
49cebcca 10001 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 10002
35ac2a97
SM
100032011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
10004
fb103ca9
SM
10005 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
10006 (print_preprocess, print_object): New macro to fix last change.
10007
35ac2a97
SM
10008 * print.c (print_preprocess): Don't forget font objects.
10009
62973b41
JB
100102011-03-16 Juanma Barranquero <lekktu@gmail.com>
10011
10012 * emacs.c (USAGE3): Doc fixes.
10013
0e48bb22
AS
100142011-03-15 Andreas Schwab <schwab@linux-m68k.org>
10015
10016 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
10017 structure.
10018
7684e57b
JB
100192011-03-14 Juanma Barranquero <lekktu@gmail.com>
10020
10021 * lisp.h (VWindow_system, Qfile_name_history):
10022 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
10023 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
10024 (w32_system_caret_x, w32_system_caret_y): Declare extern.
10025
10026 * w32select.c: Don't #include "keyboard.h".
c96bbc66 10027 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
10028
10029 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
10030 * w32console.c (detect_input_pending, read_input_pending)
10031 (encode_terminal_code):
10032 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
10033 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
10034 (w32_system_caret_y, Qfile_name_history):
10035 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
10036 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
10037 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
10038 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
10039 * w32proc.c (Qlocal, report_file_error):
10040 * w32term.c (Vwindow_system, updating_frame):
10041 * w32uniscribe.c (initialized, uniscribe_font_driver):
10042 Remove unneeded extern declarations.
10043
2aa46d6c
CY
100442011-03-14 Chong Yidong <cyd@stupidchicken.com>
10045
c96bbc66 10046 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 10047
cffc6f3b
CY
100482011-03-13 Chong Yidong <cyd@stupidchicken.com>
10049
10050 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
10051 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
10052 These macros can no longer be used for assignment.
10053
44f230aa
SM
10054 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
10055 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
10056 (record_buffer_markers, fetch_buffer_markers): New functions for
10057 recording and fetching special buffer markers.
10058 (set_buffer_internal_1, set_buffer_temp): Use them.
10059
10060 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
10061
10062 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
10063
10064 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
10065 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
10066
10067 * xdisp.c (hscroll_window_tree):
10068 (reconsider_clip_changes): Use PT instead of BUF_PT.
10069
d251f04b
EZ
100702011-03-13 Eli Zaretskii <eliz@gnu.org>
10071
10072 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
10073 $(EMACS_ROOT)/lib/intprops.h.
10074
f0c77cd1
PE
100752011-03-13 Paul Eggert <eggert@cs.ucla.edu>
10076
3eca4629
PE
10077 Fix more problems found by GCC 4.5.2's static checks.
10078
7c86ee98
PE
10079 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
10080 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
10081 (xg_free_frame_widgets): Make it clear that a local variable is
10082 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
10083 (gdk_window_get_screen): Make it clear that this macro is needed
10084 only if USE_GTK_TOOLTIP.
1e5524e7
PE
10085 (int_gtk_range_get_value): New function, which avoids a diagnostic
10086 from gcc -Wbad-function-cast.
10087 (xg_set_toolkit_scroll_bar_thumb): Use it.
10088 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
10089 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
10090 (get_utf8_string, xg_get_file_with_chooser):
10091 Rename locals to avoid shadowing.
10092 (create_dialog): Move locals to avoid shadowing.
7c86ee98 10093
41729b81
PE
10094 * xgselect.c (xg_select): Remove unused var.
10095
f0c77cd1
PE
10096 * image.c (four_corners_best): Mark locals as initialized.
10097 (gif_load): Initialize transparent_p to zero (Bug#8238).
10098 Mark another local as initialized.
ec6cf4c6 10099 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 10100
ce0ad53d 10101 * image.c (clear_image_cache): Now static.
d5d5a617 10102 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 10103 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
10104 (x_edge_detection): Remove unnecessary cast that
10105 gcc -Wbad-function-cast diagnoses.
2037898d 10106 (gif_load): Fix pointer signedness.
6ae141d6
PE
10107 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
10108 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 10109
33383987 101102011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 10111
d32df629
PE
10112 Improve quality of tests for time stamp overflow.
10113 For example, without this patch (encode-time 0 0 0 1 1
10114 1152921504606846976) returns the obviously-bogus value (-948597
10115 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
10116 reports time overflow. See
10117 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
10118 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
10119 * editfns.c: Include limits.h and intprops.h.
10120 (TIME_T_MIN, TIME_T_MAX): New macros.
10121 (time_overflow): Move earlier, to before first use.
10122 (hi_time, lo_time): New functions, for an accurate test for
10123 out-of-range times.
10124 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
10125 (Fget_internal_run_time): Don't assume time_t fits in int.
10126 (make_time): Use list2 instead of Fcons twice.
10127 (Fdecode_time): More accurate test for out-of-range times.
10128 (check_tm_member): New function.
10129 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
10130 (lisp_time_argument): Don't rely on undefined left-shift and
10131 right-shift behavior when checking for time stamp overflow.
8be6f318 10132
fe31d94c
PE
10133 * editfns.c (time_overflow): New function, refactoring common code.
10134 (Fformat_time_string, Fdecode_time, Fencode_time):
10135 (Fcurrent_time_string): Use it.
10136
8be6f318
PE
10137 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
10138 * dired.c (make_time): Move to ...
10139 * editfns.c (make_time): ... here.
10140 * systime.h: Note the move.
10141
09d9db2c 101422011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 10143
126bc0dc
YM
10144 * fringe.c (update_window_fringes): Remove unused variables.
10145
c47cbdfd
YM
10146 * unexmacosx.c (copy_data_segment): Also copy __got section.
10147 (Bug#8223)
10148
7ac80be9
EZ
101492011-03-12 Eli Zaretskii <eliz@gnu.org>
10150
c96bbc66 10151 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
10152 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
10153 Constify `char *' arguments and their references according to
10154 prototypes in tparam.h.
10155
ecb0f94d 10156 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 10157
7ac80be9
EZ
10158 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
10159 Adapt all references accordingly.
10160
10161 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
10162
ef1fd07e
TT
101632011-03-11 Tom Tromey <tromey@redhat.com>
10164
10165 * buffer.c (syms_of_buffer): Remove obsolete comment.
10166
7ef4b50c
EZ
101672011-03-11 Eli Zaretskii <eliz@gnu.org>
10168
10169 * termhooks.h (encode_terminal_code): Declare prototype.
10170
10171 * msdos.c (encode_terminal_code): Don't declare prototype.
10172
10173 * term.c (encode_terminal_code): Now external again, used by
10174 w32console.c and msdos.c.
10175
44f230aa
SM
10176 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
10177 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 10178
4b1ec863 101792011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 10180
1714f52b 10181 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 10182
4b1ec863
PE
10183 * fringe.c (update_window_fringes): Mark locals as initialized
10184 (Bug#8227).
10185 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 10186
524c7aa6
PE
10187 * alloc.c (mark_fringe_data): Move decl from here ...
10188 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
10189 to check its interface.
10190 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
10191
a5c0af81 10192 * fontset.c (free_realized_fontset): Now static.
7519b8cd 10193 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 10194 (fontset_font): Mark local as initialized.
a9a06e0b 10195 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 10196
b4716021
PE
10197 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
10198
811e9bac 10199 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 10200 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
10201 (x_own_selection, Fx_disown_selection_internal): Rename locals
10202 to avoid shadowing.
10203 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 10204
7e3ab302
PE
10205 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
10206 so that the caller can use some name other than gcpro1.
10207 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
10208 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
10209 (Fx_backspace_delete_keys_p):
10210 Use them to avoid shadowing, and rename vars to avoid shadowing.
10211 (x_decode_color, x_set_name, x_window): Now static.
6b437900 10212 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 10213 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
10214 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
10215 Remove unused locals.
7e3ab302
PE
10216 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
10217 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
10218 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
10219 macros.
f78faa98 10220
e2b13473
PE
10221 * xterm.h (x_mouse_leave): New decl.
10222
77f23912
PE
10223 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
10224 Remove unused functions.
cdf4ba58
PE
10225 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
10226 (x_calc_absolute_position): Now static.
7411c686 10227 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 10228 Don't declare local "event" unless it's used.
ed7bf3a5
PE
10229 (x_iconify_frame, x_free_frame_resources): Don't declare locals
10230 unless they are used.
38d0b34a
PE
10231 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
10232 (x_fatal_error_signal): Remove; not used.
a6067996
PE
10233 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
10234 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
10235 (x_error_catcher, x_connection_closed, x_error_handler):
10236 (x_error_quitter, xembed_send_message, x_iconify_frame):
10237 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 10238 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 10239 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 10240
44f230aa
SM
10241 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
10242 Rename or move locals to avoid shadowing.
6b463e58 10243 (tty_defined_color, merge_face_heights): Now static.
5967d051 10244 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
10245 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
10246 does not deduce is never used uninitialized.
73719eba
PE
10247 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
10248 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 10249
426994c3 10250 * terminal.c (store_terminal_param): Now static.
5489860b 10251
032f1620 10252 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 10253 (set_frame_menubar): Remove unused local.
d4323972 10254 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
10255 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
10256 since they might point to immutable storage.
281585b0
PE
10257 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
10258 since it's unused otherwise.
032f1620 10259
367c19e5 10260 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 10261 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
10262 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
10263 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 10264 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
10265 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
10266 does not deduce are never used uninitialized.
70739cbe 10267
07b48fa9
PE
10268 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
10269
8868a238 10270 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
10271 * window.c (window_loop, size_window):
10272 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 10273
7e5cf297 10274 * window.c (display_buffer): Now static.
d6550a9f
PE
10275 (size_window): Mark variables that gcc -Wuninitialized
10276 does not deduce are never used uninitialized.
a586633d
PE
10277 * window.h (check_all_windows): New decl, to forestall
10278 gcc -Wmissing-prototypes diagnostic.
5b555da1 10279 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 10280
f6095868
PE
10281 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
10282 shadowing.
10283 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
10284 Include <limits.h>.
10285 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
10286 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
10287 (load_charset_map): Mark variables that gcc -Wuninitialized
10288 does not deduce are never used uninitialized.
53df7c11 10289 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 10290
f38b440c
PE
10291 * coding.c (coding_set_source, coding_set_destination):
10292 Use "else { /* comment */ }" rather than "else /* comment */;"
10293 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
10294 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
10295 a block, when the outer 'i' will do.
10296 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
10297 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
10298 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
10299 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
10300 (Fdecode_sjis_char, Fdefine_coding_system_internal):
10301 Rename locals to avoid shadowing.
10302 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
10303 * coding.c (emacs_mule_char, encode_invocation_designation):
10304 Now static, since they're not used elsewhere.
413bb2db 10305 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 10306 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
10307 (decode_coding_emacs_mule): Mark variables that gcc
10308 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
10309 (detect_coding_iso_2022): Initialize a local variable that might
10310 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 10311 this initialization is needed. (Bug#8211)
5f58e762
PE
10312 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
10313 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
10314 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
10315 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
10316 Remove unused macros.
f38b440c 10317
232b38b9 10318 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 10319 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 10320 * character.c (string_count_byte8): Likewise.
232b38b9 10321
fb90da1b
PE
10322 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
10323 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
10324
fb93dbc2
PE
10325 * chartab.c (copy_sub_char_table): Now static, since it's not used
10326 elsewhere.
5c156ace
PE
10327 (sub_char_table_ref_and_range, char_table_ref_and_range):
10328 Rename locals to avoid shadowing.
bbcd0949 10329 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 10330
7d3b3862 10331 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 10332 (BIDI_BOB): Remove unused macro.
7d3b3862 10333
6be7d3da
PE
10334 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
10335 deduce are never used uninitialized.
c2ed9c8b 10336 * term.c (encode_terminal_code): Likewise.
6be7d3da 10337
75f8807f 10338 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 10339
50938595
PE
10340 * tparam.h: New file.
10341 * term.c, tparam.h: Include it.
10342 * deps.mk (term.o, tparam.o): Depend on tparam.h.
10343 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
10344 Move these decls to tparam.h, and make them agree with what
10345 is actually in tparam.c. The previous trick of using incompatible
10346 decls in different modules does not conform to the C standard.
10347 All callers of tparam changed to use tparam's actual API.
10348 * tparam.c (tparam1, tparam, tgoto):
10349 Use const pointers where appropriate.
10350
fbceeba2
PE
10351 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
10352 * cm.h (struct cm): Likewise.
10353 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
10354 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
10355 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
10356 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
10357 (turn_on_face, init_tty): Likewise.
10358 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 10359
7f3f1250
PE
10360 * term.c (term_mouse_position): Rename local to avoid shadowing.
10361
e6ca6543
PE
10362 * alloc.c (mark_ttys): Move decl from here ...
10363 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
10364
c40f8d15
AS
103652011-03-11 Andreas Schwab <schwab@linux-m68k.org>
10366
10367 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
10368
cfe0661d
JB
103692011-03-09 Juanma Barranquero <lekktu@gmail.com>
10370
10371 * search.c (compile_pattern_1): Remove argument regp, unused since
10372 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
10373 (compile_pattern): Don't pass it.
10374
0afb4571
J
103752011-03-08 Jan Djärv <jan.h.d@swipnet.se>
10376
10377 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
10378 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
10379 for ! HAVE_GTK3.
10380 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
10381
10382 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
10383
10384 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
10385 gdk_window_get_screen, gdk_window_get_geometry,
10386 gdk_x11_window_lookup_for_display and GDK_KEY_g.
10387 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
10388 (xg_get_pixbuf_from_pixmap): New function.
10389 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
10390 to Pixmap, take frame as parameter, remove GdkColormap parameter.
10391 Call xg_get_pixbuf_from_pixmap instead of
10392 gdk_pixbuf_get_from_drawable.
10393 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
10394 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
10395 (xg_check_special_colors): Use GtkStyleContext and its functions
10396 for HAVE_GTK3.
10397 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
10398 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
10399 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
10400 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
10401 Call gtk_widget_get_preferred_size.
0afb4571
J
10402 (xg_frame_resized): gdk_window_get_geometry only takes 5
10403 parameters.
44f230aa
SM
10404 (xg_win_to_widget, xg_event_is_for_menubar):
10405 Call gdk_x11_window_lookup_for_display.
0afb4571
J
10406 (xg_set_widget_bg): New function.
10407 (delete_cb): New function.
895009e1 10408 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 10409 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
10410 (xg_set_background_color): Call xg_set_widget_bg.
10411 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
10412 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
10413 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
10414 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
10415 if ! HAVE_GTK3.
10416 (update_frame_tool_bar): Call gtk_widget_hide.
10417 (xg_initialize): Use GDK_KEY_g.
10418
10419 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
10420 if ! HAVE_GTK3
10421 (x_session_initialize): Call gdk_x11_set_sm_client_id.
10422
10423 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
10424 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
10425 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
10426
1c2cc4ef
JB
104272011-03-08 Juanma Barranquero <lekktu@gmail.com>
10428
10429 * w32xfns.c (select_palette): Check success of RealizePalette against
10430 GDI_ERROR, not zero.
10431
33383987 10432See ChangeLog.11 for earlier changes.
aac0c6e3
MR
10433
10434;; Local Variables:
10435;; coding: utf-8
aac0c6e3
MR
10436;; End:
10437
2f097256 10438 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
10439
10440 This file is part of GNU Emacs.
10441
10442 GNU Emacs is free software: you can redistribute it and/or modify
10443 it under the terms of the GNU General Public License as published by
10444 the Free Software Foundation, either version 3 of the License, or
10445 (at your option) any later version.
10446
10447 GNU Emacs is distributed in the hope that it will be useful,
10448 but WITHOUT ANY WARRANTY; without even the implied warranty of
10449 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10450 GNU General Public License for more details.
10451
10452 You should have received a copy of the GNU General Public License
10453 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.