* dbusbind.c (xd_registered_buses): New internal Lisp object.
[bpt/emacs.git] / src / ChangeLog
1 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
2
3 * dbusbind.c (xd_registered_buses): New internal Lisp object.
4 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
5 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
6 Initialize xd_registered_buses.
7
8 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
9
10 Untag more efficiently if USE_LSB_TAG.
11 This is based on a proposal by YAMAMOTO Mitsuharu in
12 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
13 For an admittedly artificial (nth 8000 longlist) benchmark on
14 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
15 Emacs's overall text size by 1%.
16 * lisp.h (XUNTAG): New macro.
17 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
18 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
19 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
20 * eval.c (Fautoload):
21 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
22 * frame.h (XFRAME): Use XUNTAG.
23
24 Port recent dbusbind.c changes to 32-bit --with-wide-int.
25 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
26 Remove unportable assumptions about print widths of types like
27 dbus_uint32_t.
28 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
29 intptr_t when converting between pointer and integer, to avoid GCC
30 warnings about wrong width.
31
32 2012-05-09 Eli Zaretskii <eliz@gnu.org>
33
34 * w32proc.c (new_child): Force Windows to reserve only 64KB of
35 stack for each reader_thread, instead of defaulting to 8MB
36 determined by the linker. This avoids failures in creating
37 subprocesses on Windows 7, see the discussion in this thread:
38 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
39
40 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
41
42 Fix up display of the *Minibuf-0* buffer in the mini window.
43 * keyboard.c (read_char): Don't clear the echo area if there's no
44 message to clear.
45 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
46 contents of *Minibuf-0*) if there's no message displayed in its stead.
47
48 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
49
50 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
51 batch mode.
52
53 2012-05-06 Chong Yidong <cyd@gnu.org>
54
55 * lisp.mk (lisp): Update.
56
57 2012-05-05 Jim Meyering <meyering@redhat.com>
58
59 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
60
61 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
62
63 * data.c (PUT_ERROR): New macro.
64 (syms_of_data): Use it. Add new error type `user-error'.
65 * undo.c (user_error): New function.
66 (Fprimitive_undo): Use it.
67 * print.c (print_error_message): Adjust print style for `user-error'.
68 * keyboard.c (user_error): New function.
69 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
70
71 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
72
73 Do not limit current-time-string to years 1000..9999.
74 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
75 (Fcurrent_time_string): Support any year that is supported by the
76 underlying localtime representation. Don't use asctime, as it
77 has undefined behavior for years outside the range -999..9999.
78
79 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
80
81 Fix race conditions involving setenv, gmtime, localtime, asctime.
82 Without this fix, interrupts could mess up code that uses these
83 nonreentrant functions, since setting TZ invalidates existing
84 tm_zone or tzname values, and since most of these functions return
85 pointers to static storage.
86 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
87 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
88 Grow the critical sections to include not just invoking
89 localtime/gmtime, but also accessing these functions' results
90 including their tm_zone values if any, and any related TZ setting.
91 (format_time_string): Last arg is now struct tm *, not struct tm **,
92 so that the struct tm is saved in the critical section.
93 All callers changed. Simplify allocation of initial buffer, partly
94 motivated by the fact that memory allocation needs to be outside
95 the critical section.
96
97 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
98
99 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
100 with RESET_INTERVAL.
101
102 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
103 Remove duplicated buffer name initialization.
104
105 2012-05-02 Jim Meyering <jim@meyering.net>
106
107 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
108
109 * xfns.c (x_window): Use xstrdup (Bug#11375).
110
111 2012-05-02 Eli Zaretskii <eliz@gnu.org>
112
113 * xdisp.c (pos_visible_p): If already at a newline from the
114 display string before the 'while' loop, don't walk back the glyphs
115 from it3.glyph_row. Solves assertion violation when the display
116 string begins with a newline (egg.el). (Bug#11367)
117
118 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
119
120 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
121 Move to simple.el.
122
123 2012-05-01 Glenn Morris <rgm@gnu.org>
124
125 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
126 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
127 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
128 All were removed before 23.1.
129
130 * dispnew.c: Remove HAVE_LIBNCURSES test;
131 it is always true on relevant platforms.
132
133 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
134 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
135
136 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
137
138 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
139
140 * .gdbinit (xpr): Remove checks for no longer existing misc types.
141 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
142 Remove.
143
144 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
145
146 Do not avoid creating empty evaporating overlays (Bug#9642).
147 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
148 That is, do not delete an evaporating overlay if it becomes
149 empty after its bounds are adjusted to fit within its buffer.
150 This fix caused other problems, and I'm reverting it until we get
151 to the bottom of them.
152
153 2012-04-27 Chong Yidong <cyd@gnu.org>
154
155 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
156
157 2012-04-27 Eli Zaretskii <eliz@gnu.org>
158
159 * xdisp.c (pos_visible_p): If the window start position is beyond
160 ZV, start the display from buffer beginning. Prevents assertion
161 violation in init_iterator when the minibuffer window is scrolled
162 via the scroll bar.
163
164 * window.c (window_scroll_pixel_based): Likewise.
165
166 2012-04-27 Chong Yidong <cyd@gnu.org>
167
168 * keymap.c (where_is_internal): Doc fix (Bug#10872).
169
170 2012-04-27 Glenn Morris <rgm@gnu.org>
171
172 * fileio.c (Fcopy_file, Fset_file_selinux_context):
173 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
174
175 2012-04-27 Eli Zaretskii <eliz@gnu.org>
176
177 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
178 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
179
180 2012-04-26 Eli Zaretskii <eliz@gnu.org>
181
182 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
183 display element, check also the underlying string or buffer
184 character. (Bug#11341)
185
186 * w32menu.c: Include w32heap.h.
187 (add_menu_item): If the call to AppendMenuW (via
188 unicode_append_menu) fails, disable Unicode menus only if we are
189 running on Windows 9X/Me.
190
191 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
192
193 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
194 (xgetint): Add missing shift for LSB tags.
195
196 2012-04-24 Martin Rudalics <rudalics@gmx.at>
197
198 * keyboard.c (read_char): Don't wipe echo area for select window
199 events: These might get delayed via `mouse-autoselect-window'
200 (Bug#11304).
201
202 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
203
204 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
205 manipulation of :loaded-from data.
206
207 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
208
209 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
210 now a cons (bug#11311).
211
212 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
213
214 Do not create empty overlays with the evaporate property (Bug#9642).
215 * buffer.c (Fmove_overlay): Delete an evaporating overlay
216 if it becomes empty after its bounds are adjusted to fit within
217 its buffer. Without this fix, in a nonempty buffer (let ((o
218 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
219 yields an empty overlay that has the evaporate property, which is
220 not supposed to happen.
221
222 Fix minor GTK3 problems found by static checking.
223 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
224 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
225 (struct _EmacsFixedClass, emacs_fixed_get_type):
226 Move decls here from emacsgtkfixed.h, since they needn't be public.
227 (emacs_fixed_get_type): Now static.
228 (emacs_fixed_class_init): Omit unused local.
229 (emacs_fixed_child_type): Remove; unused.
230 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
231 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
232 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
233 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
234 (EMACS_FIXED_GET_CLASS): Remove; unused.
235 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
236
237 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
238 Problem reported by Juanma Barranquero for Windows -Wunused-function.
239
240 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
241
242 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
243 * gmalloc.c: (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
244 (__malloc_size_t, __malloc_ptrdiff_t):
245 Remove. All uses removed, replaced by the definiens if needed,
246 since we can assume C89 or better now.
247 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
248 (protect_malloc_state, align, get_contiguous_space)
249 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
250 (malloc_atfork_handler_child, malloc_enable_thread)
251 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
252 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
253 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
254 (special_realloc, _realloc_internal_nolock, _realloc_internal)
255 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
256 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
257 Define using prototypes, not old style.
258 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
259 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
260 (align): Don't assume that signed integer overflow wraps around.
261 Omit unused local var.
262 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
263 (_free_internal_nolock, memalign, mallochook, reallochook):
264 Omit no-longer-needed casts.
265 (valloc): Use getpagesize, not __getpagesize.
266 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
267 (struct hdr): The 'magic' member is now size_t, not unsigned long.
268
269 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
270
271 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
272
273 Move functions from C to Lisp. Make non-blocking method calls
274 the default. Implement further D-Bus standard interfaces.
275
276 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
277 (QCdbus_request_name_allow_replacement)
278 (QCdbus_request_name_replace_existing)
279 (QCdbus_request_name_do_not_queue)
280 (QCdbus_request_name_reply_primary_owner)
281 (QCdbus_request_name_reply_in_queue)
282 (QCdbus_request_name_reply_exists)
283 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
284 (QCdbus_registered_serial, QCdbus_registered_method)
285 (QCdbus_registered_signal): New Lisp objects.
286 (XD_DEBUG_MESSAGE): Use sizeof.
287 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
288 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
289 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
290 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
291 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
292 (xd_signature, xd_append_arg): Allow float for integer types.
293 (xd_get_connection_references): New function.
294 (xd_get_connection_address): Rename from xd_initialize.
295 Return cached address.
296 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
297 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
298 level.
299 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
300 Return number of refcounts.
301 (Fdbus_get_unique_name): Make stronger parameter check.
302 (Fdbus_message_internal): New defun.
303 (Fdbus_call_method, Fdbus_call_method_asynchronously)
304 (Fdbus_method_return_internal, Fdbus_method_error_internal)
305 (Fdbus_send_signal, Fdbus_register_service)
306 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
307 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
308 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
309 (Vdbus_compiled_version, Vdbus_runtime_version)
310 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
311 (Vdbus_message_type_method_return, Vdbus_message_type_error)
312 (Vdbus_message_type_signal): New defvars.
313 (Vdbus_registered_buses, Vdbus_registered_objects_table):
314 Adapt docstring.
315
316 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
317
318 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
319 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
320 Do not assume ptrdiff_t is the same width as 'int'.
321
322 * alloc.c: Handle unusual debugging option combinations.
323 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
324 since the two debugging options are incompatible.
325 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
326 is defined.
327 (mem_init, mem_insert, mem_insert_fixup):
328 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
329 (NEED_MEM_INSERT): Remove; no longer needed.
330
331 2012-04-22 Leo Liu <sdl.web@gmail.com>
332
333 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
334
335 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
336
337 * sysdep.c [__FreeBSD__]: Minor cleanups.
338 (list_system_processes, system_process_attributes) [__FreeBSD__]:
339 Use Emacs indenting style more consistently. Avoid some casts.
340 Use 'double' consistently rather than mixing 'float' and 'double'.
341
342 2012-04-21 Eduard Wiebe <usenet@pusto.de>
343
344 * sysdep.c (list_system_processes, system_process_attributes):
345 Add implementation for FreeBSD (Bug#5243).
346
347 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
348
349 * lisp.mk (lisp): Update.
350
351 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
352
353 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
354 It is never used otherwise.
355
356 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
357
358 * print.c (print_preprocess): Only check print_depth if print-circle
359 is nil.
360 (print_object): Check for cycles even when print-circle is nil and
361 print-gensym is t, but only check print_depth if print-circle is nil.
362
363 2012-04-20 Chong Yidong <cyd@gnu.org>
364
365 * process.c (wait_reading_process_output): If EIO occurs on a pty,
366 set the status to "failed" and ensure that sentinel is run.
367
368 2012-04-20 Glenn Morris <rgm@gnu.org>
369
370 * process.c (Fset_process_inherit_coding_system_flag)
371 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
372 (Fmake_network_process, Fmake_serial_process): Doc fix.
373
374 2012-04-20 Eli Zaretskii <eliz@gnu.org>
375
376 * xdisp.c (string_buffer_position_lim): Limit starting position to
377 BEGV.
378 (set_cursor_from_row): If called for a mode-line or header-line
379 row, return zero immediately.
380 (try_cursor_movement): If inside continuation line, don't back up
381 farther than the first row after the header line, if any.
382 Don't consider the header-line row as "partially visible", even if
383 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
384
385 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
386
387 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
388 (bug#11238).
389
390 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
391 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
392
393 configure: new option --enable-gcc-warnings (Bug#11207)
394 * Makefile.in (C_WARNINGS_SWITCH): Remove.
395 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
396 (ALL_CFLAGS): Use new macros rather than old.
397 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
398 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
399 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
400 -Wunused-result, -Wunused-variable. This should go away once
401 the Emacs and Gnulib regex code is merged.
402 (xmalloc, xrealloc): Now static.
403
404 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
405
406 * dired.c (Fsystem_groups): Remove unused local.
407
408 2012-04-17 Glenn Morris <rgm@gnu.org>
409
410 * dired.c (Fsystem_users): Doc fix.
411
412 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
413
414 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
415 (syms_of_dired): Add them.
416
417 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
418
419 Fix minor alloc.c problems found by static checking.
420 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
421 New extern decls, to avoid calling undeclared functions.
422 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
423 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
424 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
425 (NEED_MEM_INSERT): New macro.
426 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
427 Remove one incorrect comment and fix another.
428
429 Fix minor ralloc.c problems found by static checking.
430 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
431 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
432 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
433 (r_alloc_sbrk): Now static.
434
435 Improve ralloc.c interface checking.
436 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
437 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
438 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
439 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
440 [REL_ALLOC]: ... to here, to check interface.
441 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
442 Remove decls. This fixes an "It stinks!".
443
444 * alloc.c (which_symbols): Fix alignment issue / type clash.
445
446 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
447
448 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
449 (struct Lisp_Misc_Any): Likewise.
450 (struct Lisp_Free): Likewise.
451 * alloc.c (union aligned_Lisp_Symbol): Define.
452 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
453 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
454 (union aligned_Lisp_Misc): Define.
455 (MARKER_BLOCK_SIZE, struct marker_block): Use union
456 aligned_Lisp_Misc instead of union Lisp_Misc.
457 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
458
459 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
460
461 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
462 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
463 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
464 * s/netbsd.h, s/sol2-6.h:
465 Remove definition of GC_MARK_STACK, since the default now works.
466 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
467 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
468 no longer the default.
469 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
470
471 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
472
473 * lread.c (lisp_file_lexically_bound_p):
474 Fix hang at ";-*-\n" (bug#11238).
475
476 2012-04-14 Eli Zaretskii <eliz@gnu.org>
477
478 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
479 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
480
481 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
482
483 * nsterm.m (constrainFrameRect): Always constrain when there is only
484 one screen (Bug#10962).
485
486 2012-04-13 Ken Brown <kbrown@cornell.edu>
487
488 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
489
490 2012-04-13 Reuben Thomas <rrt@sc3d.org>
491
492 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
493
494 2012-04-11 Daniel Colascione <dancol@dancol.org>
495
496 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
497 against is gone. It's better to use vfork now so that when Cygwin
498 gains a new, working vfork, we use it automatically (bug#10398).
499
500 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
501
502 * window.c (save_window_save): Obey window-point-insertion-type.
503
504 2012-04-11 Glenn Morris <rgm@gnu.org>
505
506 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
507
508 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
509
510 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
511
512 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
513
514 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
515 (force_quit_count): New var.
516 (handle_interrupt): Use it.
517
518 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
519
520 * w32.c (w32_delayed_load): Record the full path of the library
521 being loaded (bug#10424).
522
523 2012-04-09 Glenn Morris <rgm@gnu.org>
524
525 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
526 not just in the obarray, before snarfing them. (Bug#11036)
527
528 * Makefile.in ($(leimdir)/leim-list.el):
529 Pass EMACS rather than BUILT_EMACS.
530
531 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
532
533 * process.c (make_process):
534 * process.h: Add integer `gnutls_handshakes_tried' member to
535 process struct.
536
537 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
538 Add convenience `GNUTLS_LOG2i' macro.
539
540 * gnutls.c (gnutls_log_function2i): Convenience log function.
541 (emacs_gnutls_read): Use new log functions,
542 `gnutls_handshakes_tried' process member, and
543 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
544 attempts per process (connection).
545
546 2012-04-09 Chong Yidong <cyd@gnu.org>
547
548 * eval.c (Fuser_variable_p, user_variable_p_eh)
549 (lisp_indirect_variable): Functions deleted.
550 (Fdefvar): Caller changed.
551
552 * callint.c (Finteractive, Fcall_interactively):
553 * minibuf.c (Fread_variable): Callers changed.
554
555 2012-04-09 Eli Zaretskii <eliz@gnu.org>
556
557 * xdisp.c (set_cursor_from_row): If the display string appears in
558 the buffer at position that is closer to point than the position
559 after the display string, display the cursor on the first glyph of
560 the display string. Fixes cursor display when a 'display' text
561 property immediately follows invisible text. (Bug#11094)
562
563 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
564
565 composite.c: use 'double' consistently
566 * composite.c (get_composition_id): Use 'double' consistently
567 instead of converting 'float' to 'double' and vice versa; this is
568 easier to understand and avoids a GCC warning.
569
570 2012-04-09 Glenn Morris <rgm@gnu.org>
571
572 * Makefile.in: Generate leim-list with bootstrap-emacs, in
573 preparation for dumping it with emacs. (Bug#4789)
574 (leimdir): New variable.
575 ($(leimdir)/leim-list.el): New rule.
576 (emacs$(EXEEXT)): Depend on leim-list.el.
577
578 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
579 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
580 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
581
582 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
583
584 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
585 proper alignment.
586
587 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
588
589 * xml.c (init_libxml2_functions) [WINDOWSNT]:
590 Remove unused local variable.
591
592 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
593
594 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
595 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
596 (mark_memory): Mark Lisp_Objects only if pointers might hide in
597 objects, as mark_maybe_pointer will catch them otherwise.
598 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
599 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
600
601 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
602
603 Fix typo that broke non-Windows builds.
604 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
605
606 2012-04-07 Eli Zaretskii <eliz@gnu.org>
607
608 Support building on MS-Windows with libxml2.
609
610 * makefile.w32-in (OBJ2): Add xml.$(O).
611 (GLOBAL_SOURCES): Add xml.c.
612 ($(BLD)/xml.$(O)): New dependency list.
613
614 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
615 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
616 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
617 [!WINDOWSNT]: New macros.
618 (init_libxml2_functions, libxml2_loaded_p): New functions.
619 (parse_region): Call fn_xmlCheckVersion instead of using the macro
620 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
621 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
622 Calls xmlCleanupParser only if libxml2 was loaded (or statically
623 linked in).
624 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
625 Call init_libxml2_functions before calling libxml2 functions.
626 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
627
628 * emacs.c: Don't include libxml/parser.h.
629 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
630 xmlCleanupParser directly.
631
632 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
633
634 2012-04-07 Eli Zaretskii <eliz@gnu.org>
635
636 * indent.c (Fvertical_motion): If there is a display string at
637 point, use it.vpos to compute how many lines to backtrack after
638 move_it_to point. (Bug#11133)
639
640 2012-04-06 Eli Zaretskii <eliz@gnu.org>
641
642 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
643 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
644 about subtle differences between FETCH_CHAR* and STRING_CHAR*
645 macros related to unification of CJK characters. For the details,
646 see the discussion following the message here:
647 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
648
649 2012-04-04 Chong Yidong <cyd@gnu.org>
650
651 * keyboard.c (Vdelayed_warnings_list): Doc fix.
652
653 2012-04-01 Eli Zaretskii <eliz@gnu.org>
654
655 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
656 instead of alloca. (Bug#11138)
657
658 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
659
660 * w32menu.c (is_simple_dialog): Properly check lisp types.
661 (Bug#11141)
662
663 2012-03-31 Eli Zaretskii <eliz@gnu.org>
664
665 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
666 position we get to after a call to move_it_to fails the
667 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
668 only if we wind up in a string from display property. (Bug#11063)
669
670 * window.c (Fdelete_other_windows_internal): Invalidate the row
671 and column information about mouse highlight, so that redisplay
672 restores it after reallocating the glyph matrices. (Bug#7464)
673
674 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
675 string comes from a `display' text property, use the buffer
676 position of that property as if we actually saw that position in
677 the row's glyphs.
678 (move_it_by_lines): Remove the assertion that
679 "it->current_x == 0 && it->hpos == 0" which can be legitimately
680 violated when there's a before-string at the beginning of a line.
681 (Bug#11063)
682
683 2012-03-30 Eli Zaretskii <eliz@gnu.org>
684
685 * xdisp.c (append_space_for_newline): If the default face was
686 remapped, use the remapped face for the appended newline.
687 (extend_face_to_end_of_line): Use the remapped default face for
688 extending the face to the end of the line.
689 (display_line): Call extend_face_to_end_of_line when the default
690 face was remapped. (Bug#11068)
691
692 2012-03-29 Eli Zaretskii <eliz@gnu.org>
693
694 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
695
696 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
697
698 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
699
700 2012-03-27 Glenn Morris <rgm@gnu.org>
701
702 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
703 Doc fixes.
704
705 2012-03-26 Kenichi Handa <handa@m17n.org>
706
707 * dispextern.h (struct glyph): Fix previous change. Change the
708 bit length of glyphless.ch to 25 (Bug#11082).
709
710 2012-03-26 Chong Yidong <cyd@gnu.org>
711
712 * keyboard.c (Vselection_inhibit_update_commands): New variable.
713 (command_loop_1): Use it; inhibit selection update for
714 handle-select-window too (Bug#8996).
715
716 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
717
718 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
719
720 2012-03-25 Kenichi Handa <handa@m17n.org>
721
722 * dispextern.h (struct glyph): Change the bit length of
723 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
724
725 2012-03-24 Eli Zaretskii <eliz@gnu.org>
726
727 * s/ms-w32.h (tzname): Include time.h before redirecting to
728 _tzname. Fixes the MSVC build. (Bug#9960)
729
730 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
731
732 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
733 characters.
734
735 * xterm.c (XTread_socket): Only modify handling_signal if
736 !SYNC_INPUT. (Bug#11080)
737
738 2012-03-23 Eli Zaretskii <eliz@gnu.org>
739
740 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
741 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
742 when fetching a multibyte character consumes more bytes than
743 CHAR_BYTES returns, due to unification of CJK characters in
744 string_char. (Bug#11073)
745
746 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
747
748 * process.c (wait_reading_process_output): Handle pty disconnect
749 by refraining from sending oneself a SIGCHLD (bug#10933).
750
751 2012-03-22 Chong Yidong <cyd@gnu.org>
752
753 * dispextern.h (struct it): New member string_from_prefix_prop_p.
754
755 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
756 Mark string as coming from a prefix property.
757 (handle_face_prop): Use default face for prefix strings (Bug#4281).
758 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
759
760 2012-03-21 Chong Yidong <cyd@gnu.org>
761
762 * xfaces.c (Vface_remapping_alist): Doc fix.
763
764 2012-03-20 Eli Zaretskii <eliz@gnu.org>
765
766 * w32proc.c (Fw32_set_console_codepage)
767 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
768 Doc fixes.
769
770 2012-03-20 Chong Yidong <cyd@gnu.org>
771
772 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
773 to reflect default non-nil value of redisplay-dont-pause.
774
775 2012-03-19 Kenichi Handa <handa@m17n.org>
776
777 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
778 it fit in a valid range (Bug#11003).
779
780 2012-03-18 Eli Zaretskii <eliz@gnu.org>
781
782 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
783 that is not from display property, accept the row as a "cursor
784 row" if one of the string's character has a non-nil `cursor'
785 property. Fixes cursor positioning when there are newlines in
786 overlay strings, e.g. in icomplete.el. (Bug#11035)
787
788 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
789
790 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
791
792 2012-03-12 Chong Yidong <cyd@gnu.org>
793
794 * eval.c (inhibit_lisp_code): Rename from
795 inhibit_window_configuration_change_hook; move from window.c.
796
797 * xfns.c (unwind_create_frame_1, Fx_create_frame):
798 * window.c (run_window_configuration_change_hook)
799 (syms_of_window): Callers changed.
800
801 2012-03-11 Chong Yidong <cyd@gnu.org>
802
803 * keymap.c (Fkey_description): Doc fix (Bug#9700).
804
805 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
806
807 2012-03-10 Chong Yidong <cyd@gnu.org>
808
809 * frame.c (other_visible_frames): Don't assume the selected frame
810 is visible (Bug#10955).
811
812 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
813
814 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
815
816 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
817
818 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
819 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
820 zero (Bug#10954).
821
822 2012-03-03 Glenn Morris <rgm@gnu.org>
823
824 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
825
826 2012-03-02 Eli Zaretskii <eliz@gnu.org>
827
828 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
829 position past the first glyph_row that ends at ZV. (Bug#10902)
830 (redisplay_window, next_element_from_string): Fix typos in
831 comments.
832 (redisplay_window): Pass to move_it_vertically the margin in
833 pixels, not in screen lines.
834
835 2012-03-02 Glenn Morris <rgm@gnu.org>
836
837 * buffer.c (buffer-list-update-hook): Doc fix.
838
839 2012-02-29 Eli Zaretskii <eliz@gnu.org>
840
841 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
842 push_it before setting up the iterator for the first overlay
843 string, even if we have an empty string loaded.
844 (next_overlay_string): If there's an empty string on the iterator
845 stack, pop the stack. (Bug#10903)
846
847 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
848
849 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
850 Suggested by Stefan Monnier in
851 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
852 * alloc.c (widen_to_Lisp_Object): New static function.
853 (mark_memory): Also mark Lisp_Objects by fetching pointer words
854 and widening them to Lisp_Objects. This would work even if
855 USE_LSB_TAG is defined and wide integers are used, which might
856 happen in a future version of Emacs.
857
858 2012-02-25 Chong Yidong <cyd@gnu.org>
859
860 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
861 Doc fix.
862
863 * xselect.c (Fx_selection_exists_p): Doc fix.
864 (x_clipboard_manager_save_all): Print an informative message
865 before saving to clipboard manager.
866
867 2012-02-24 Chong Yidong <cyd@gnu.org>
868
869 * keyboard.c (process_special_events): Handle all X selection
870 requests in kbd_buffer, not just the next one (Bug#8869).
871
872 2012-02-23 Chong Yidong <cyd@gnu.org>
873
874 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
875 call when setting menu-bar-lines and tool-bar-lines parameters.
876 (unwind_create_frame_1): New helper function.
877
878 * window.c (inhibit_window_configuration_change_hook): New var.
879 (run_window_configuration_change_hook): Obey it.
880 (syms_of_window): Initialize it.
881
882 2012-02-22 Chong Yidong <cyd@gnu.org>
883
884 * xterm.c (x_draw_image_relief): Add missing type check for
885 Vtool_bar_button_margin (Bug#10743).
886
887 2012-02-21 Chong Yidong <cyd@gnu.org>
888
889 * fileio.c (Vfile_name_handler_alist): Doc fix.
890
891 * buffer.c (Fget_file_buffer): Protect against invalid file
892 handler return value.
893
894 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
895
896 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
897 when computing $valmask.
898
899 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
900 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
901 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
902 It's useless in that case, and it can cause problems on hosts
903 that allocate halves of EMACS_INT values separately.
904 Reported by Dan Horák. Diagnosed by Andreas Schwab in
905 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
906 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
907 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
908 it avoids undefined behavior on hosts where shifting right by more
909 than the word width has undefined behavior.
910
911 2012-02-19 Chong Yidong <cyd@gnu.org>
912
913 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
914 (Funhandled_file_name_directory, Ffile_name_as_directory)
915 (Fdirectory_file_name, Fexpand_file_name)
916 (Fsubstitute_in_file_name): Protect against invalid file handler
917 return values (Bug#10845).
918
919 2012-02-18 Eli Zaretskii <eliz@gnu.org>
920
921 * .gdbinit (pitx): Fix incorrect references to fields of the
922 iterator stack.
923
924 2012-02-17 Chong Yidong <cyd@gnu.org>
925
926 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
927
928 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
929
930 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
931 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
932
933 2012-02-15 Chong Yidong <cyd@gnu.org>
934
935 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
936 marked as special. Also, starting docstrings with * is obsolete.
937
938 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
939
940 * gnutls.c (emacs_gnutls_write): Fix last change.
941
942 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
943
944 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
945 send_process.
946
947 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
948
949 * keymap.c (Fsingle_key_description): Handle char ranges.
950
951 2012-02-12 Chong Yidong <cyd@gnu.org>
952
953 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
954 as that creates a dangerous corner case.
955
956 * window.c (Fdelete_window_internal): Invalidate the mouse
957 highlight (Bug#9904).
958
959 2012-02-12 Glenn Morris <rgm@gnu.org>
960
961 * xselect.c (Fx_own_selection_internal)
962 (Fx_get_selection_internal, Fx_disown_selection_internal)
963 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
964 * nsselect.m (Fx_own_selection_internal)
965 (Fx_disown_selection_internal, Fx_selection_exists_p)
966 (Fx_selection_owner_p, Fx_get_selection_internal):
967 Sync docs and argument specs with the xselect.c versions.
968
969 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
970
971 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
972
973 2012-02-11 Eli Zaretskii <eliz@gnu.org>
974
975 * w32select.c (Fx_selection_exists_p): Sync doc string and
976 argument list with xselect.c. (Bug#10783)
977
978 * w16select.c (Fx_selection_exists_p): Sync doc string and
979 argument list with xselect.c. (Bug#10783)
980
981 2012-02-10 Glenn Morris <rgm@gnu.org>
982
983 * fns.c (Fsecure_hash): Doc fix.
984
985 2012-02-09 Kenichi Handa <handa@m17n.org>
986
987 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
988
989 2012-02-07 Chong Yidong <cyd@gnu.org>
990
991 * buffer.c (Fbuffer_local_variables)
992 (buffer_lisp_local_variables): Handle unbound vars correctly;
993 don't let Qunbound leak into Lisp.
994
995 2012-02-07 Glenn Morris <rgm@gnu.org>
996
997 * image.c (Fimagemagick_types): Doc fix.
998
999 * image.c (imagemagick-render-type): Change it from a lisp object
1000 to an integer. Move the doc here from the lisp manual.
1001 Treat all values not equal to 0 the same.
1002
1003 2012-02-06 Chong Yidong <cyd@gnu.org>
1004
1005 * doc.c (store_function_docstring): Avoid applying docstring of
1006 alias to base function (Bug#2603).
1007
1008 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
1009
1010 * .gdbinit (pp1, pv1): Remove redundant defines.
1011 (pr): Use pp.
1012
1013 2012-02-04 Chong Yidong <cyd@gnu.org>
1014
1015 * nsterm.m: Declare a global (Bug#10694).
1016
1017 2012-02-04 Eli Zaretskii <eliz@gnu.org>
1018
1019 * w32.c (get_emacs_configuration_options):
1020 Include --enable-checking, if specified, in the return value.
1021
1022 2012-02-04 Martin Rudalics <rudalics@gmx.at>
1023
1024 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
1025 after rounding frame sizes. (Bug#9723)
1026
1027 2012-02-04 Eli Zaretskii <eliz@gnu.org>
1028
1029 * keyboard.c (adjust_point_for_property): Don't position point
1030 before BEGV. (Bug#10696)
1031
1032 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
1033
1034 Handle overflow when computing char display width (Bug#9496).
1035 * character.c (char_width): Return EMACS_INT, not int.
1036 (char_width, c_string_width): Check for overflow when
1037 computing the width; this is possible now that individual
1038 characters can have unbounded width. Problem introduced
1039 by merge from Emacs 23 on 2012-01-19.
1040
1041 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
1042
1043 * dbusbind.c (Fdbus_register_method): Mention the return value
1044 :ignore in the docstring.
1045
1046 2012-02-02 Glenn Morris <rgm@gnu.org>
1047
1048 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
1049
1050 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
1051 Unconditionally set to t. (Bug#10673)
1052 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
1053 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
1054 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
1055
1056 2012-02-02 Kenichi Handa <handa@m17n.org>
1057
1058 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
1059 0, do not call append_composite_glyph.
1060
1061 2012-02-02 Kenichi Handa <handa@m17n.org>
1062
1063 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
1064 NULL (Bug#6988).
1065 (x_produce_glyphs): If the component of a composition is a null
1066 string, set it->pixel_width to 1 to avoid zero-width glyph.
1067
1068 2012-02-01 Eli Zaretskii <eliz@gnu.org>
1069
1070 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
1071 first 2 arguments are identical. This makes inserting large
1072 output from a subprocess an order of magnitude faster on
1073 MS-Windows, where all sbrk'ed memory is always contiguous.
1074
1075 2012-01-31 Glenn Morris <rgm@gnu.org>
1076
1077 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
1078 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
1079 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
1080
1081 2012-01-29 Glenn Morris <rgm@gnu.org>
1082
1083 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
1084
1085 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
1086
1087 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
1088
1089 2012-01-28 Chong Yidong <cyd@gnu.org>
1090
1091 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
1092
1093 2012-01-26 Chong Yidong <cyd@gnu.org>
1094
1095 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
1096
1097 * search.c (Fsearch_forward, Fsearch_backward): Document negative
1098 repeat counts (Bug#10507).
1099
1100 2012-01-26 Glenn Morris <rgm@gnu.org>
1101
1102 * lread.c (syms_of_lread): Doc fix.
1103
1104 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
1105
1106 * coding.c (encode_designation_at_bol): Change return value to
1107 EMACS_INT.
1108
1109 2012-01-25 Chong Yidong <cyd@gnu.org>
1110
1111 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
1112
1113 2012-01-21 Chong Yidong <cyd@gnu.org>
1114
1115 * floatfns.c (Fcopysign): Make the second argument non-optional,
1116 since nil is not allowed anyway.
1117
1118 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
1119
1120 * process.c (read_process_output): Use p instead of XPROCESS (proc).
1121 (send_process): Likewise.
1122
1123 2012-01-19 Martin Rudalics <rudalics@gmx.at>
1124
1125 * window.c (save_window_save, Fcurrent_window_configuration)
1126 (Vwindow_persistent_parameters): Do not use Qstate.
1127 Rewrite doc-strings.
1128
1129 2012-01-19 Kenichi Handa <handa@m17n.org>
1130
1131 * character.c (char_width): New function.
1132 (Fchar_width, c_string_width, lisp_string_width):
1133 Use char_width (Bug#9496).
1134
1135 2012-01-16 Martin Rudalics <rudalics@gmx.at>
1136
1137 * window.c (Vwindow_persistent_parameters): New variable.
1138 (Fset_window_configuration, save_window_save): Handle persistent
1139 window parameters.
1140
1141 2012-01-14 Eli Zaretskii <eliz@gnu.org>
1142
1143 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
1144 thrashing the stack of the thread. (Bug#9087)
1145
1146 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
1147
1148 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
1149
1150 2012-01-11 Eli Zaretskii <eliz@gnu.org>
1151
1152 * xdisp.c (rows_from_pos_range): Handle the case where the
1153 highlight ends on a newline. (Bug#10464)
1154 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
1155 he end column for display of highlight that ends on a newline
1156 before a R2L line.
1157
1158 2012-01-11 Glenn Morris <rgm@gnu.org>
1159
1160 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
1161 from load-path also when installation-directory is nil. (Bug#10208)
1162
1163 2012-01-10 Glenn Morris <rgm@gnu.org>
1164
1165 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
1166
1167 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
1168 Update template values to be closer to their typical values these days.
1169
1170 2012-01-09 Eli Zaretskii <eliz@gnu.org>
1171
1172 * xdisp.c (rows_from_pos_range): Accept additional argument
1173 DISP_STRING, and accept any glyph in a row whose object is that
1174 string as eligible for mouse highlight. Fixes mouse highlight of
1175 display strings from overlays. (Bug#10464)
1176
1177 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
1178
1179 emacs: fix an auto-save permissions race condition (Bug#10400)
1180 * fileio.c (auto_saving_dir_umask): New static var.
1181 (Fmake_directory_internal): Use it.
1182 (do_auto_save_make_dir): Set it, instead of invoking chmod after
1183 creating the directory. The old code temporarily assigns
1184 too-generous permissions to the directory.
1185 (do_auto_save_eh): Clear it.
1186 (Fdo_auto_save): Catch all errors, not just file errors, so
1187 that the var is always cleared.
1188
1189 2012-01-07 Eli Zaretskii <eliz@gnu.org>
1190
1191 * search.c (scan_buffer): Pass character positions to
1192 know_region_cache, not byte positions. (Bug#6540)
1193
1194 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
1195
1196 * w32.c (sys_rename): Report EXDEV when rename of a directory
1197 fails because the target is on another logical disk. (Bug#10284)
1198
1199 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
1200
1201 * xterm.c (x_embed_request_focus): New function.
1202
1203 * xterm.h: Add prototype.
1204
1205 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
1206
1207 2012-01-05 Glenn Morris <rgm@gnu.org>
1208
1209 * emacs.c (emacs_copyright): Update short copyright year to 2012.
1210
1211 2012-01-01 Eli Zaretskii <eliz@gnu.org>
1212
1213 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
1214 Load gnutls_transport_set_lowat only if GnuTLS version is below
1215 2.11.1.
1216 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
1217 GnuTLS versions below 2.11.1.
1218
1219 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
1220
1221 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
1222 to the doc string advising against its use for altering the way
1223 windows are scrolled.
1224
1225 2011-12-28 Kenichi Handa <handa@m17n.org>
1226
1227 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
1228 coding-system ASCII compatible only when it does not produce BOM
1229 on encoding (Bug#10383).
1230
1231 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
1232
1233 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
1234 can scroll.
1235 (create_and_show_popup_menu): Always use menu_position_func for
1236 Gtk3 (Bug#10361).
1237
1238 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
1239
1240 * callint.c (Fcall_interactively): Don't truncate prompt string.
1241
1242 2011-12-23 Eli Zaretskii <eliz@gnu.org>
1243
1244 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
1245 property that ends at ZV, so that the bidi iteration could be
1246 resumed from there (after widening). (Bug#10360)
1247
1248 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
1249
1250 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
1251
1252 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
1253
1254 * nsterm.m (x_free_frame_resources):
1255 Release f->output_data.ns->miniimage.
1256 (ns_index_color): Fix indentation. Do not retain
1257 color_table->colors[i].
1258
1259 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
1260 before returning.
1261
1262 * nsfns.m (x_set_background_color): Assign return value from
1263 ns_index_color to face-background instead of NSColor*.
1264 (ns_implicitly_set_icon_type): Fix indentation.
1265 Change assignment in for loop to comparison.
1266
1267 * emacs.c (ns_pool): New variable.
1268 (main): Assign ns_pool.
1269 (Fkill_emacs): Call ns_release_autorelease_pool.
1270
1271 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
1272 autorelease fdesc, release fdAttrs and tdict.
1273 (ns_get_covering_families): Release charset.
1274 (ns_findfonts): Release NSFontDescriptor created with new.
1275 (ns_uni_to_glyphs): Fix indentation.
1276 (setString): Release attrStr before assigning new value.
1277
1278 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
1279
1280 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
1281 and NS_IMPL_COCOA.
1282 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
1283 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
1284
1285 2011-12-18 David Reitter <reitter@cmu.edu>
1286
1287 * nsterm.m (ns_term_init): Subscribe for notifications
1288 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
1289 to method trackingNotification in EmacsMenu.
1290
1291 * nsmenu.m (trackingMenu): New variable.
1292 (trackingNotification): New method (from Aquamacs).
1293 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
1294 from Aquamacs (Bug#7030).
1295
1296 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
1297
1298 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
1299 (symbol_to_nsstring): Fix indentation.
1300 (ns_symbol_to_pb): New function.
1301 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
1302 (Fns_rotate_cut_buffers_internal): Remove.
1303 (Fns_store_selection_internal): Rename from
1304 Fns_store_cut_buffer_internal.
1305 (ns_get_foreign_selection, Fx_own_selection_internal)
1306 (Fx_disown_selection_internal, Fx_selection_exists_p)
1307 (Fns_get_selection_internal, Fns_store_selection_internal):
1308 Use ns_symbol_to_pb and check if return value is nil.
1309 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
1310 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
1311 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
1312 renamed to Sns_store_selection_internal.
1313 (ns_handle_selection_request): Move code to Fx_own_selection_internal
1314 and remove this function.
1315 (ns_handle_selection_clear): Remove, never used.
1316 (Fx_own_selection_internal): Move code from ns_handle_selection_request
1317 here.
1318
1319 2011-12-17 Ken Brown <kbrown@cornell.edu>
1320
1321 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
1322 GID is unknown (Bug#10257).
1323
1324 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
1325
1326 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
1327 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
1328 which caused a build failure on GNU/Linux IA-64. This problem was
1329 introduced by my 2011-10-07 patch.
1330
1331 2011-12-15 Juri Linkov <juri@jurta.org>
1332
1333 * image.c (imagemagick_error): New function. (Bug#10112)
1334 (imagemagick_load_image): Comment out `MagickSetResolution' call.
1335 Use `imagemagick_error' where ImageMagick functions return
1336 `MagickFalse'.
1337 (Fimagemagick_types): Add `Fnreverse' to return the list in the
1338 proper order.
1339
1340 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1341
1342 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
1343 fill background (Bug#8992).
1344
1345 2011-12-13 Martin Rudalics <rudalics@gmx.at>
1346
1347 * window.c (Vwindow_combination_resize)
1348 (Vwindow_combination_limit): Use t instead of non-nil in
1349 doc-strings.
1350 (Vrecenter_redisplay): Add first sentence of doc-string on
1351 separate line.
1352 (Frecenter): Fix doc-string typo.
1353
1354 2011-12-11 Kenichi Handa <handa@m17n.org>
1355
1356 * coding.c (Funencodable_char_position): Pay attention to the
1357 buffer text relocation (Bug#9389).
1358
1359 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
1360
1361 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
1362 gtk_init (Bug#10100).
1363
1364 2011-12-10 Eli Zaretskii <eliz@gnu.org>
1365
1366 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
1367 IT->string is nil. (Bug#10263)
1368
1369 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
1370
1371 * nsterm.h (x_free_frame_resources): Declare.
1372
1373 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
1374 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
1375
1376 * nsterm.h (ns_get_defaults_value): Declare.
1377
1378 * nsterm.m (ns_default): Call ns_get_defaults_value.
1379
1380 2011-12-09 Eli Zaretskii <eliz@gnu.org>
1381
1382 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
1383 (Bug#10170)
1384
1385 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1386
1387 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
1388 that where the value of an _OBJC_* symbol points to is in the .bss
1389 section (Bug#10240).
1390
1391 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
1392
1393 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
1394 after the loop to call ccl_driver at least once (Bug#8619).
1395
1396 2011-12-08 Kenichi Handa <handa@m17n.org>
1397
1398 * ftfont.c (get_adstyle_property): Fix previous change
1399 (Bug#10233).
1400
1401 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
1402
1403 * w32.c (init_environment): If no_site_lisp, remove site-lisp
1404 dirs from the default value of EMACSLOADPATH (bug#10208).
1405
1406 2011-12-07 Glenn Morris <rgm@gnu.org>
1407
1408 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
1409 installation and source directories as well. (Bug#10208)
1410
1411 2011-12-06 Chong Yidong <cyd@gnu.org>
1412
1413 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
1414
1415 2011-12-06 Glenn Morris <rgm@gnu.org>
1416
1417 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
1418 as an error, not just -1. (Bug#10217)
1419
1420 2011-12-05 Chong Yidong <cyd@gnu.org>
1421
1422 * keyboard.c (process_special_events): New function.
1423 (swallow_events, Finput_pending_p): Use it (Bug#10195).
1424
1425 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
1426
1427 * coding.c (encode_designation_at_bol): Don't use uninitialized
1428 local variable (Bug#9318).
1429
1430 2011-12-05 Kenichi Handa <handa@m17n.org>
1431
1432 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
1433 return Qnil (Bug#8046, Bug#10193).
1434
1435 2011-12-05 Kenichi Handa <handa@m17n.org>
1436
1437 * coding.c (encode_designation_at_bol): New args charbuf_end and
1438 dst. Return the number of produced bytes. Callers changed.
1439 (coding_set_source): Return how many bytes coding->source was
1440 relocated.
1441 (coding_set_destination): Return how many bytes
1442 coding->destination was relocated.
1443 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
1444 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
1445
1446 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
1447
1448 * coding.c (CODING_CHAR_CHARSET_P): New macro.
1449 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
1450 macro (Bug#9318).
1451
1452 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
1453
1454 The following changes are to fix Bug#9318.
1455
1456 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
1457 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
1458 (encode_coding_iso_2022, encode_coding_sjis)
1459 (encode_coding_big5, encode_coding_charset): Use the above macros.
1460
1461 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
1462
1463 * lisp.h (process_quit_flag): Fix external declaration.
1464
1465 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
1466
1467 Don't macro-inline non-performance-critical code.
1468 * eval.c (process_quit_flag): New function.
1469 * lisp.h (QUIT): Use it.
1470
1471 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
1472
1473 * nsfns.m (get_geometry_from_preferences): New function.
1474 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
1475
1476 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
1477
1478 * emacs.c (Qkill_emacs): Define.
1479 (syms_of_emacs): Initialize it.
1480 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
1481 Qquit_flag to `kill-emacs' instead.
1482 (quit_throw_to_read_char): Add parameter `from_signal'.
1483 All callers changed. Call Fkill_emacs if requested and safe.
1484 * lisp.h (QUIT): Call Fkill_emacs if requested.
1485
1486 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
1487
1488 * widget.c (update_wm_hints): Return if wmshell is null.
1489 (widget_update_wm_size_hints): New function.
1490
1491 * widget.h (widget_update_wm_size_hints): Declare.
1492
1493 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
1494 widget_update_wm_size_hints (Bug#10104).
1495
1496 2011-12-03 Eli Zaretskii <eliz@gnu.org>
1497
1498 * xdisp.c (handle_invisible_prop): If the invisible text ends just
1499 before a newline, prepare the bidi iterator for consuming the
1500 newline, and keep the current paragraph direction. (Bug#10183)
1501 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
1502
1503 2011-12-02 Juri Linkov <juri@jurta.org>
1504
1505 * search.c (Fword_search_regexp): New Lisp function created from
1506 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
1507 (Fword_search_backward, Fword_search_forward)
1508 (Fword_search_backward_lax, Fword_search_forward_lax):
1509 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
1510 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
1511
1512 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
1513
1514 * fileio.c (Finsert_file_contents): Move after-change-function call
1515 to before the "handled:" label, since all "goto handled" appear in
1516 cases where the *-change-functions have already been properly called
1517 (bug#10117).
1518
1519 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
1520
1521 * keyboard.c (interrupt_signal): Don't call kill-emacs when
1522 waiting for input. (Bug#10169)
1523
1524 2011-11-30 Eli Zaretskii <eliz@gnu.org>
1525
1526 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
1527 verifies glyph row's hash code--we have just reallocated the
1528 glyphs, so their contents can be complete garbage. (Bug#10164)
1529
1530 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
1531
1532 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
1533
1534 2011-11-30 Eli Zaretskii <eliz@gnu.org>
1535
1536 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
1537 attributes are tested _before_ calling verify_row_hash, to protect
1538 against GCC re-ordering of the tests. (Bug#10164)
1539
1540 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
1541
1542 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
1543
1544 * xterm.c (handle_one_xevent): Only set async_visible and friends
1545 if net_wm_state_hidden_seen is non-zero (Bug#10002)
1546 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
1547 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
1548
1549 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
1550
1551 Remove GCPRO-related macros that exist only to avoid shadowing locals.
1552 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
1553 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
1554 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
1555 All uses changed to use GCPRO1 etc.
1556 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
1557 Revert to old implementation (i.e., before 2011-03-11).
1558
1559 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1560
1561 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
1562 of scroll runs so as to avoid assigning disabled bogus rows and
1563 unnecessary graphics copy operations.
1564
1565 2011-11-27 Eli Zaretskii <eliz@gnu.org>
1566
1567 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
1568 (snprintf) [_MSC_VER]: Redirect to _snprintf.
1569 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
1570 (malloc, free, realloc, calloc): Redirect to e_* only when
1571 compiling Emacs.
1572
1573 * lisp.h (GCTYPEBITS): Move before first use.
1574 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
1575 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
1576 this macro definition.
1577
1578 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
1579 _MSC_VER.
1580
1581 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
1582
1583 * gtkutil.c (xg_create_frame_widgets):
1584 Call gtk_window_set_has_resize_grip (FALSE) if that function is
1585 present with Gtk+ 2.0.
1586
1587 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
1588
1589 * fileio.c (Finsert_file_contents): Undo previous change; see
1590 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
1591
1592 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
1593
1594 Rename locals to avoid shadowing.
1595 * fileio.c (Finsert_file_contents):
1596 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
1597 * process.c (wait_reading_process_output):
1598 Rename inner 'proc' to 'p' to avoid shadowing.
1599 Indent for consistency with usual Emacs style.
1600
1601 2011-11-25 Eli Zaretskii <eliz@gnu.org>
1602
1603 * xdisp.c (redisplay_window): If cursor row is not fully visible
1604 after recentering, and scroll-conservatively is set to a large
1605 number, scroll window by a few more lines to make the cursor fully
1606 visible and out of scroll-margin. (Bug#10105)
1607 (start_display): Don't move to the next line if the display should
1608 start at a newline that is part of a display vector or an overlay
1609 string. (Bug#10119)
1610
1611 2011-11-24 Juri Linkov <juri@jurta.org>
1612
1613 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
1614 after the `MagickPingImage' call. (Bug#10112)
1615
1616 2011-11-23 Chong Yidong <cyd@gnu.org>
1617
1618 * window.c (Fcoordinates_in_window_p): Accept only live windows.
1619
1620 2011-11-23 Martin Rudalics <rudalics@gmx.at>
1621
1622 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
1623 making another buffer current. (Bug#10114)
1624
1625 2011-11-23 Glenn Morris <rgm@gnu.org>
1626
1627 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
1628
1629 2011-11-23 Chong Yidong <cyd@gnu.org>
1630
1631 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
1632 using it (Bug#5984).
1633
1634 2011-11-22 Eli Zaretskii <eliz@gnu.org>
1635
1636 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
1637 and header-lines, as they don't have one computed for them.
1638 (Bug#10098)
1639
1640 * .gdbinit (prow): Make displayed values more self-explaining.
1641 Add row's hash code.
1642
1643 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
1644
1645 * process.c (wait_reading_process_output): Fix asynchrounous
1646 GnuTLS socket handling on some versions of the GnuTLS library.
1647 (wait_reading_process_output): Add comment and URL.
1648
1649 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
1650
1651 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
1652
1653 2011-11-21 Chong Yidong <cyd@gnu.org>
1654
1655 * window.c (Fnext_window, Fprevious_window): Doc fix.
1656
1657 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
1658
1659 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
1660
1661 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
1662
1663 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
1664
1665 2011-11-20 Martin Rudalics <rudalics@gmx.at>
1666
1667 * window.c (Fset_window_combination_limit): Rename argument
1668 STATUS to LIMIT.
1669 (Vwindow_combination_limit): Remove "status" from doc-string.
1670
1671 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
1672
1673 * m/ibms390.h: Remove.
1674 * m/ibms390x.h: Don't include "ibms390.h".
1675
1676 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
1677
1678 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
1679 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
1680
1681 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
1682
1683 * casetab.c (Fset_case_table):
1684 * charset.c (Fcharset_after): Fix typos.
1685
1686 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
1687
1688 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
1689 Otherwise, valgrind does not work on some platforms.
1690 Problem reported by Andreas Schwab in
1691 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
1692 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
1693 is set, removing the need for VIRT_ADDRESS_VARIES.
1694 (PURE_P): Use a more-efficient implementation that needs just one
1695 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
1696 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
1697 to 4 (xorl, subq, cmpq, setbe).
1698 * alloc.c (pure): Always extern now, since that's the
1699 VIRT_ADDR_VARIES behavior.
1700 (PURE_POINTER_P): Use a single comparison, not two, for
1701 consistency with the new puresize.h.
1702 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
1703 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
1704 Remove VIRT_ADDR_VARIES no longer needed.
1705
1706 2011-11-19 Eli Zaretskii <eliz@gnu.org>
1707
1708 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
1709 (erase_phys_cursor, update_window_cursor, show_mouse_face)
1710 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
1711 behave as if the cursor position were at the window margin.
1712
1713 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
1714 and the cursor position is out of bounds, behave as if the cursor
1715 position were at the window margin. (Bug#10075)
1716
1717 2011-11-18 Chong Yidong <cyd@gnu.org>
1718
1719 * window.c (Fwindow_combination_limit): Make first argument
1720 non-optional, since it is meaningless for live windows like the
1721 selected window.
1722
1723 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
1724
1725 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
1726
1727 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
1728
1729 * intervals.c: Fix grafting over the whole buffer (bug#10071).
1730 (graft_intervals_into_buffer): Simplify.
1731
1732 2011-11-18 Eli Zaretskii <eliz@gnu.org>
1733
1734 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
1735 hash values of the two rows.
1736 (copy_row_except_pointers): Preserve the used[] arrays and the
1737 hash values of the two rows. (Bug#10035)
1738 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
1739
1740 * xdisp.c (row_hash): New function, body extracted from
1741 compute_line_metrics.
1742 (compute_line_metrics): Call row_hash, instead of computing the
1743 hash code inline.
1744
1745 * dispnew.c (verify_row_hash): Call row_hash for computing the
1746 hash code of a row, instead of duplicating code from xdisp.c.
1747
1748 * dispextern.h (row_hash): Add prototype.
1749
1750 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
1751
1752 * frame.c (delete_frame): Don't delete the terminal when the last
1753 X frame is closed if emacs is built with GTK toolkit.
1754
1755 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
1756
1757 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
1758
1759 2011-11-17 Martin Rudalics <rudalics@gmx.at>
1760
1761 * window.c (Vwindow_splits): Rename to
1762 Vwindow_combination_resize. Suggested by Juri Linkov.
1763 (Fsplit_window_internal): Use Vwindow_combination_resize instead
1764 of Vwindow_splits.
1765
1766 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
1767
1768 * nsfns.m (Fns_font_name):
1769 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
1770
1771 2011-11-16 Martin Rudalics <rudalics@gmx.at>
1772
1773 * window.h (window): Rename slot "nest" to "combination_limit".
1774 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
1775 (Fset_window_nest): Rename to Fset_window_combination_limit.
1776 (Vwindow_nest): Rename to Vwindow_combination_limit.
1777 (recombine_windows, make_parent_window, make_window)
1778 (Fsplit_window_internal, saved_window)
1779 (Fset_window_configuration, save_window_save): Rename all
1780 occurrences of window_nest to window_combination_limit.
1781
1782 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
1783
1784 * image.c (imagemagick_load_image): Fix typo.
1785
1786 2011-11-14 Eli Zaretskii <eliz@gnu.org>
1787
1788 * xdisp.c (display_line): Move the call to
1789 highlight_trailing_whitespace before the call to
1790 compute_line_metrics, since the latter needs to see the final
1791 faces of all the glyphs to compute ROW's hash value.
1792 Fixes assertion violations in row_equal_p. (Bug#10035)
1793
1794 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
1795
1796 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
1797 just return (bug#10044).
1798
1799 2011-11-12 Eli Zaretskii <eliz@gnu.org>
1800
1801 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
1802 with user-defined heap size. Bump the default size of the temacs
1803 heap to 27MB, to avoid memory warning when running temacs.
1804 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
1805
1806 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
1807 current_matrix and desired_matrix. (Bug#9990)
1808 (verify_row_hash) [XASSERTS]: New function.
1809 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
1810 that the hash value of glyph rows is correct.
1811
1812 2011-11-12 Martin Rudalics <rudalics@gmx.at>
1813
1814 * window.h (window): Remove splits slot.
1815 * window.c (Fwindow_splits, Fset_window_splits): Remove.
1816 (Fdelete_other_windows_internal, make_parent_window)
1817 (make_window, Fsplit_window_internal, Fdelete_window_internal)
1818 (Fset_window_configuration, save_window_save): Don't deal with
1819 split status of windows.
1820 (saved_window): Remove splits slot.
1821 (Vwindow_splits): Rewrite doc-string.
1822
1823 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
1824
1825 * xfns.c (unwind_create_frame):
1826 * nsfns.m (unwind_create_frame):
1827 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
1828 Vframe_list (Bug#9999).
1829
1830 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
1831
1832 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
1833
1834 2011-11-11 Kenichi Handa <handa@m17n.org>
1835
1836 * callproc.c (Fcall_process): Set the member dst_multibyte of
1837 process_coding.
1838
1839 2011-11-11 Johan Bockgård <bojohan@gnu.org>
1840
1841 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
1842 avoid a crash (bug#9496).
1843
1844 2011-11-09 Chong Yidong <cyd@gnu.org>
1845
1846 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
1847 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
1848
1849 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
1850
1851 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
1852
1853 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
1854
1855 Avoid some portability problems by eschewing 'extern inline' functions.
1856 The trivial performance wins aren't worth the portability hassles; see
1857 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
1858 et seq.
1859 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
1860 (window_box_width, window_box_left, window_box_left_offset)
1861 (window_box_right, window_box_right_offset): Undo previous change,
1862 by removing the "extern"s.
1863 * intervals.c (adjust_intervals_for_insertion)
1864 (adjust_intervals_for_deletion): Undo previous change,
1865 making these static again.
1866 (offset_intervals, temp_set_point_both, temp_set_point)
1867 (copy_intervals_to_string): No longer inline.
1868 * xdisp.c (window_text_bottom_y, window_box_width)
1869 (window_box_height, window_box_left_offset)
1870 (window_box_right_offset, window_box_left, window_box_right)
1871 (window_box): No longer inline.
1872
1873 2011-11-08 Chong Yidong <cyd@gnu.org>
1874
1875 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
1876 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
1877 Signal an error if not a live window.
1878 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
1879 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
1880
1881 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
1882
1883 * lisp.h (syms_of_abbrev): Remove declaration.
1884 Reported by CHENG Gao <chenggao@royau.me>.
1885
1886 2011-11-07 Eli Zaretskii <eliz@gnu.org>
1887
1888 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
1889 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
1890 of temacs in GUI mode.
1891
1892 2011-11-07 Martin Rudalics <rudalics@gmx.at>
1893
1894 * window.h: Declare delete_all_child_windows instead of
1895 delete_all_subwindows.
1896 * window.c (Fwindow_nest, Fset_window_nest)
1897 (Fset_window_new_total, Fset_window_new_normal)
1898 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
1899 (delete_all_subwindows): Rename to delete_all_child_windows.
1900 (Fdelete_other_windows_internal, Fset_window_configuration):
1901 Call delete_all_child_windows instead of delete_all_subwindows.
1902 * frame.c (delete_frame): Call delete_all_child_windows instead
1903 of delete_all_subwindows.
1904
1905 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
1906
1907 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
1908 This is also needed for porting to any host where GC_MARK_STACK is
1909 not GC_MAKE_GCPROS_NOOPS.
1910 (which_symbols): Use it.
1911
1912 2011-11-07 Kenichi Handa <handa@m17n.org>
1913
1914 * coding.c (coding_set_destination): Check coding->src_pos only
1915 when coding->src_object is a buffer (bug#9910).
1916
1917 * process.c (send_process): Set the member src_multibyte of coding
1918 to 0 (bug#9911) when sending a unibyte text.
1919
1920 * callproc.c (Fcall_process): Set the member src_multibyte of
1921 process_coding to 0 (bug#9912).
1922
1923 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1924
1925 * xmenu.c (cleanup_widget_value_tree): New function.
1926 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
1927 calling free_menubar_widget_value_tree directly (Bug#9830).
1928
1929 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
1930
1931 Fix some portability problems with 'inline'.
1932 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
1933 (window_box_width, window_box_left, window_box_left_offset)
1934 (window_box_right, window_box_right_offset): Declare extern.
1935 Otherwise, these inline functions do not conform to C99 and
1936 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
1937 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
1938 * intervals.c (adjust_intervals_for_insertion)
1939 (adjust_intervals_for_deletion): Now extern, because otherwise the
1940 extern inline functions 'offset_intervals' couldn't refer to it.
1941 (static_offset_intervals): Remove.
1942 (offset_intervals): Rewrite using the old contents of
1943 static_offset_intervals. The old version didn't conform to C99
1944 because an extern inline function contained a reference to an
1945 identifier with static linkage.
1946
1947 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
1948
1949 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
1950 GC.
1951
1952 2011-11-06 Eli Zaretskii <eliz@gnu.org>
1953
1954 * xdisp.c (init_iterator, reseat_to_string): Don't set the
1955 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
1956 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
1957 return Qleft_to_right.
1958
1959 2011-11-06 Chong Yidong <cyd@gnu.org>
1960
1961 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
1962 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
1963 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
1964 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
1965 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
1966 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
1967 (Fwindow_vscroll): Doc fix.
1968 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
1969 argument, since it makes no sense to pass a live window and for
1970 consistency with window-child.
1971
1972 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
1973
1974 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
1975 support MSVC.
1976
1977 2011-11-05 Jason Rumney <jasonr@gnu.org>
1978
1979 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
1980 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
1981 fonts (Bug#6029).
1982 (add_font_entity_to_list): Fix logic errors in mixed boolean and
1983 bitwise arithmetic preventing use of unicode-sip and non-truetype
1984 opentype fonts.
1985
1986 2011-11-05 Eli Zaretskii <eliz@gnu.org>
1987
1988 * s/ms-w32.h (fstat, stat, utime): Move redirections to
1989 "emacs"-only part.
1990
1991 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
1992 initialization code to keep similarity to xfns.c after changes
1993 from 2011-11-05.
1994
1995 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
1996
1997 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
1998 (unwind_create_frame): New function (Bug#9943).
1999 (Fx_create_frame): Restructure code to be more similar to the one in
2000 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
2001 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
2002 Move terminal->reference_count++ just before making the frame official
2003 (Bug#9943).
2004
2005 * nsterm.m (x_free_frame_resources): New function.
2006 (x_destroy_window): Move code to x_free_frame_resources.
2007
2008 * xfns.c (unwind_create_frame): Fix comment.
2009 (Fx_create_frame, x_create_tip_frame):
2010 Move terminal->reference_count++ just before making the frame
2011 official. Move initialization of image_cache_refcount and
2012 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
2013
2014 2011-11-05 Eli Zaretskii <eliz@gnu.org>
2015
2016 Support MSVC build with newer versions of Visual Studio.
2017 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
2018 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
2019 nt/gmake.defs.
2020
2021 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
2022 which are not supported by MSVC.
2023 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
2024 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
2025 bitfields.
2026 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
2027 types in bitfields.
2028 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
2029
2030 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
2031
2032 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
2033
2034 Support MSVC build with newer versions of Visual Studio.
2035 * w32.c: Don't include w32api.h for MSVC.
2036 (init_environment) [_MSC_VER]: Call sys_access, not _access.
2037
2038 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
2039 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
2040 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
2041 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
2042 e_* cousins.
2043 (alloca) [_MSC_VER]: Define to _alloca.
2044
2045 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
2046
2047 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
2048
2049 2011-11-04 Eli Zaretskii <eliz@gnu.org>
2050
2051 * xdisp.c (note_mouse_highlight): If either of
2052 previous/next-single-property-change returns nil, treat that as
2053 the beginning or the end of the buffer. (Bug#9955)
2054
2055 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
2056
2057 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
2058 label is not null (Bug#9951).
2059 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
2060 may be NULL.
2061
2062 2011-11-04 Eli Zaretskii <eliz@gnu.org>
2063
2064 * window.c (Fwindow_body_size): Mention in the doc string that the
2065 return value is in frame's canonical units. (Bug#9949)
2066
2067 2011-11-03 Eli Zaretskii <eliz@gnu.org>
2068
2069 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
2070
2071 * w32fns.c (unwind_create_frame): If needed, free the glyph
2072 matrices of the partially constructed frame. (Bug#9943)
2073 * xfns.c (unwind_create_frame): Likewise.
2074
2075 2011-11-01 Eli Zaretskii <eliz@gnu.org>
2076
2077 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
2078 Don't stop backward scan on the continuation glyph, even though
2079 its CHARPOS is positive.
2080 (mouse_face_from_buffer_pos, note_mouse_highlight):
2081 Rename cover_string to disp_string.
2082
2083 2011-11-01 Martin Rudalics <rudalics@gmx.at>
2084
2085 * window.c (temp_output_buffer_show): Don't use
2086 Vtemp_buffer_show_specifiers.
2087 (Vtemp_buffer_show_specifiers): Remove unused variable.
2088
2089 2011-10-30 Eli Zaretskii <eliz@gnu.org>
2090
2091 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
2092 past the beginning of the current glyph matrix.
2093
2094 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
2095
2096 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
2097 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
2098 HAVE_GTK3 (Bug#9869).
2099
2100 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
2101 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
2102
2103 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
2104
2105 * xterm.c: Declare x_handle_net_wm_state to return int.
2106 (handle_one_xevent): Check if we are iconified but don't have
2107 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
2108 (get_current_wm_state): Return non-zero if not hidden,
2109 check for _NET_WM_STATE_HIDDEN (Bug#9893).
2110 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
2111 (x_handle_net_wm_state): Return what get_current_wm_state returns.
2112 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
2113
2114 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
2115
2116 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
2117 so that this new function doesn't get optimized away by a
2118 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
2119
2120 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
2121
2122 * frame.h (MOUSE_HL_INFO): Remove excess parens.
2123
2124 2011-10-29 Eli Zaretskii <eliz@gnu.org>
2125
2126 Fix the `xbytecode' command.
2127 * .gdbinit (xprintbytestr): New command.
2128 (xwhichsymbols): Rename from `which'; all callers changed.
2129 (xbytecode): Print the byte-code string as well.
2130
2131 2011-10-29 Kim Storm <storm@cua.dk>
2132
2133 * alloc.c (which_symbols): New function.
2134
2135 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
2136
2137 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
2138 line. (Bug#9903)
2139
2140 2011-10-29 Glenn Morris <rgm@gnu.org>
2141
2142 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
2143 Not clear what it was for, and it causes various bugs. (Bug#9839)
2144
2145 2011-10-28 Eli Zaretskii <eliz@gnu.org>
2146
2147 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
2148 possible random value that matches one of those tested as
2149 condition to clear the mouse face.
2150
2151 2011-10-28 Chong Yidong <cyd@gnu.org>
2152
2153 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
2154
2155 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
2156
2157 * window.c (make_window): Initialize phys_cursor_on_p.
2158
2159 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
2160
2161 * lisp.h (struct Lisp_Symbol): Update comments.
2162
2163 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
2164
2165 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
2166
2167 2011-10-28 Eli Zaretskii <eliz@gnu.org>
2168
2169 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
2170 <oslsachem@gmail.com> for helping to debug this.
2171
2172 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
2173 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
2174 (g_b_init_get_glyph_outline_w): New static variables.
2175 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
2176 (GetGlyphOutlineW_Proc): New typedefs.
2177 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
2178 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
2179 New functions.
2180 (w32font_open_internal, compute_metrics):
2181 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
2182 instead of calling the "wide" APIs directly.
2183
2184 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
2185
2186 * w32.h (syms_of_w32font): Add prototype.
2187
2188 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
2189
2190 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
2191 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
2192 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
2193 (Fmove_to_window_line): Doc fix.
2194
2195 2011-10-27 Chong Yidong <cyd@gnu.org>
2196
2197 * process.c (make_process): Set gnutls_state to NULL.
2198
2199 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
2200 non-NULL, regardless of GNUTLS_INITSTAGE.
2201 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
2202 an error. Set process slots as soon as we allocate them.
2203
2204 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
2205
2206 2011-10-27 Chong Yidong <cyd@gnu.org>
2207
2208 * gnutls.c (emacs_gnutls_deinit): New function.
2209 Deallocate credentials structures as well as calling gnutls_deinit.
2210 (Fgnutls_deinit, Fgnutls_boot): Use it.
2211
2212 * process.c (make_process): Initialize GnuTLS credentials to NULL.
2213 (deactivate_process): Call emacs_gnutls_deinit.
2214
2215 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
2216
2217 * image.c (x_create_x_image_and_pixmap):
2218 * w32.c (sys_rename, w32_delayed_load):
2219 * w32font.c (fill_in_logfont):
2220 * w32reg.c (x_get_string_resource): Silence compiler warnings.
2221
2222 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
2223
2224 * w32fns.c (w32_default_color_map): New function,
2225 extracted from Fw32_default_color_map.
2226 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
2227
2228 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
2229
2230 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
2231
2232 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
2233
2234 * keyboard.c (test_undefined): New function (bug#9751).
2235 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
2236
2237 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
2238
2239 * sysdep.c (init_sys_modes): Fix the check for the controlling
2240 terminal (Bug#6649).
2241
2242 2011-10-20 Eli Zaretskii <eliz@gnu.org>
2243
2244 * dispextern.h (struct bidi_it): New member next_en_type.
2245
2246 * bidi.c (bidi_line_init): Initialize the next_en_type member.
2247 (bidi_resolve_explicit_1): When next_en_pos is valid for the
2248 current character, check also for next_en_type being WEAK_EN.
2249 (bidi_resolve_weak): Don't enter the expensive loop if the current
2250 position is before next_en_pos. Record the bidi type of the first
2251 non-ET, non-BN character we find, in addition to its position.
2252 (bidi_level_of_next_char): Invalidate next_en_type when
2253 next_en_pos is over-stepped.
2254
2255 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
2256
2257 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
2258 * editfns.c: Rewrite current-time-zone so that it invokes
2259 the equivalent of (format-time-string "%Z") to get the time zone name.
2260 This fixes a bug when the time zone name contains characters that
2261 need converting from the system time locale to Emacs internal format.
2262 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
2263 that patch fixed format-time-string to do the conversion, but
2264 I forgot to fix current-time-zone.
2265 (format_time_string): New function, containing most of
2266 what Fformat_time_string used to contain.
2267 (Fformat_time_string): Rewrite in terms of format_time_string.
2268 This doesn't change this function's behavior.
2269 (current-time-zone): Rewrite to use format_time_string.
2270 This fixes the bug reported by Michael Schierl in
2271 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
2272 Jason Rumney's 2007-06-07 change worked around this bug, but
2273 didn't fix it.
2274 * systime.h (tzname, timezone): Remove no-longer-used declarations.
2275
2276 2011-10-19 Eli Zaretskii <eliz@gnu.org>
2277
2278 * xdisp.c (start_display): If the character at POS is displayed
2279 via a display vector, reset IT->current.dpvec_index to zero.
2280 (try_window_reusing_current_matrix): If a line ends in a display
2281 vector or the next line starts in a display vector, continue
2282 redrawing the window even though the character position of
2283 start_row was reached.
2284 (Bug#9771, part 2)
2285
2286 2011-10-18 Chong Yidong <cyd@gnu.org>
2287
2288 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
2289 with nobreak-char-display too.
2290
2291 2011-10-18 Eli Zaretskii <eliz@gnu.org>
2292
2293 Fix part 3 of bug#9771.
2294 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
2295 (bidi_resolve_neutral): Don't enter the expensive loop looking for
2296 non-neutral characters if the current character is a paragraph
2297 separator (a.k.a. Newline). This avoids running the same
2298 expensive loop twice, once when we consume the preceding newline
2299 and the other time when the line actually needs to be displayed.
2300 Avoid the loop when we see neutrals on the base embedding level
2301 following a character whose directionality is the same as the
2302 paragraph's. This avoids running the expensive loop when a line
2303 ends in a long sequence of neutrals, like control characters.
2304 Add assertion against STRONG_AL type. Slightly rearrange code
2305 that determines the type of a neutral given the first non-neutral
2306 that follows it.
2307 (bidi_level_of_next_char): Set next_en_pos to zero when
2308 invalidating its info.
2309
2310 2011-10-17 Eli Zaretskii <eliz@gnu.org>
2311
2312 * xdisp.c (push_display_prop): Determine whether to record string
2313 or buffer position by IT->string, not by IT->method. Allow
2314 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
2315 (move_it_vertically_backward): Don't look for character position
2316 immediately after the newline when in a continuation line.
2317 (Bug#9771, part 1)
2318
2319 2011-10-15 Martin Rudalics <rudalics@gmx.at>
2320
2321 * window.c (coordinates_in_window): Rewrite and delabelize
2322 vertical border check. (Bug#5357) (Bug#9618)
2323
2324 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
2325
2326 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
2327 errors in XSetWindowBorder (bug#9310).
2328
2329 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
2330
2331 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
2332 avoid crash when xmalloc overrun checking is enabled.
2333
2334 2011-10-13 Eli Zaretskii <eliz@gnu.org>
2335
2336 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
2337 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
2338 cursor motion with <left> and <right> arrow keys.
2339
2340 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
2341 some callers set that themselves.
2342
2343 2011-10-12 Eli Zaretskii <eliz@gnu.org>
2344
2345 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
2346 display string and the previous row comes from the same string and
2347 is empty. (Bug#9739) (Bug#9738)
2348
2349 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
2350
2351 * doc.c (get_doc_string): Encode file name (bug#9735).
2352
2353 2011-10-12 Eli Zaretskii <eliz@gnu.org>
2354
2355 * bidi.c (bidi_level_of_next_char):
2356 * xdisp.c (get_visually_first_element): Remove old incorrect
2357 comments regarding the Unicode Line Separator character.
2358
2359 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
2360
2361 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
2362
2363 * alloc.c (Fgc_status): Do not access beyond zombies array
2364 boundary if nzombies > MAX_ZOMBIES.
2365 * alloc.c (dump_zombies): Add missing format specifier.
2366
2367 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
2368
2369 * xdisp.c (set_cursor_from_row): Simplify conditionals,
2370 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
2371
2372 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
2373 Some packages use them to denote characters with modifiers.
2374
2375 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
2376
2377 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
2378 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
2379 matching a pp-number. Rename parameter var to var1.
2380
2381 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
2382
2383 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
2384
2385 2011-10-08 Glenn Morris <rgm@gnu.org>
2386
2387 * callint.c (Fcall_interactively): Give a more explicit error for the
2388 'c' case with a non-character input. (Bug#8479)
2389
2390 2011-10-08 Eli Zaretskii <eliz@gnu.org>
2391
2392 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
2393 lines.
2394 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
2395 lines that are hscrolled on the left.
2396
2397 * dispnew.c (buffer_posn_from_coords): Account for a possible
2398 presence of header-line. (Bug#4426)
2399
2400 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
2401
2402 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
2403 Don't advertise functionality which we discourage or doesn't work.
2404
2405 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
2406
2407 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
2408 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
2409 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
2410 this makes Emacs dump core during garbage collection on rare
2411 occasions. sizeof is obviously inferior to offsetof here, so
2412 stick with offsetof.
2413 (GC_POINTER_ALIGNMENT): New macro.
2414 (mark_memory): Omit 3rd (offset) arg; caller changed.
2415 Don't assume EMACS_INT alignment is the same as pointer alignment.
2416
2417 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
2418
2419 * keyboard.c (read_key_sequence_remapped): New var.
2420 (read_key_sequence): Compute remapping in the right buffer.
2421 (command_loop_1): Use read_key_sequence's remapping directly.
2422
2423 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
2424
2425 * dired.c (file_name_completion): Don't expand file name.
2426 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
2427 before checking file name handler.
2428
2429 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
2430 they've been requested explicitly (bug#9591).
2431
2432 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
2433
2434 * keymap.c (Fsingle_key_description): Use make_specified_string
2435 instead of build_string to build string from push_key_description.
2436 (Bug#5193)
2437
2438 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
2439
2440 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
2441 This fixes a Y2038 bug on 64-bit hosts.
2442 * buffer.c (reset_buffer):
2443 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
2444 (Fclear_buffer_auto_save_failure):
2445 Use 0, not -1, to represent an unset failure time, since time_t
2446 might not be signed.
2447
2448 Remove dependency on glibc malloc internals.
2449 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
2450 Move back here from lisp.h, but with their new implementations.
2451 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
2452 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
2453 * charset.c (charset_table_init): New static var.
2454 (syms_of_charset): Use it instead of xmalloc. This removes a
2455 dependency on glibc malloc internals. See Eli Zaretskii's comment in
2456 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
2457 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
2458 Move back to alloc.c.
2459 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
2460 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
2461
2462 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
2463
2464 * nsterm.m (windowDidResize): Call x_set_window_size only when
2465 ns_in_resize is true. Otherwise set pixelwidth/height and
2466 call change_frame_size (Bug#9628).
2467
2468 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
2469
2470 Port --enable-checking=all to Fedora 14 x86-64.
2471 * charset.c (syms_of_charset): Also account for glibc malloc's
2472 internal overhead when calculating the initial malloc maximum.
2473
2474 Port --enable-checking=all to Fedora 14 x86.
2475 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
2476 Move to lisp.h.
2477 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
2478 (overrun_check_realloc, overrun_check_free):
2479 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
2480 That way, xmalloc returns a properly-aligned pointer even if
2481 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
2482 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
2483 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
2484 into account when calculating the initial malloc maximum.
2485 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
2486 Move here from alloc.c, so that charset.c can use it too.
2487 Properly align; the old code wasn't right for common 32-bit hosts
2488 when configured with --enable-checking=all.
2489 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
2490 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
2491
2492 2011-09-29 Eli Zaretskii <eliz@gnu.org>
2493
2494 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
2495 use EDOM.
2496
2497 2011-09-28 Eli Zaretskii <eliz@gnu.org>
2498
2499 * xdisp.c (compute_display_string_end): If there's no display
2500 string at CHARPOS, return -1.
2501
2502 * bidi.c (bidi_fetch_char): When compute_display_string_end
2503 returns a negative value, treat the character as a normal
2504 character not covered by a display string. (Bug#9624)
2505
2506 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
2507
2508 * lread.c (Fread_from_string): Fix typo in docstring.
2509
2510 2011-09-27 Eli Zaretskii <eliz@gnu.org>
2511
2512 * xdisp.c (handle_invisible_prop): If invisible text ends on a
2513 newline, reseat the iterator instead of bidi-iterating there one
2514 character at a time. (Bug#9610)
2515 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
2516 TO_CHARPOS if the bidi iterator is at base embedding level.
2517
2518 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
2519
2520 * lread.c (readevalloop): Use correct code for NBSP.
2521 (read1): Likewise. (Bug#9608)
2522
2523 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
2524
2525 * dbusbind.c (Fdbus_register_signal): When service is not
2526 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
2527
2528 2011-09-25 Glenn Morris <rgm@gnu.org>
2529
2530 * buffer.c (truncate-lines): Doc fix.
2531
2532 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
2533
2534 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
2535 (Fset_window_next_buffers): Doc fix.
2536
2537 2011-09-24 Glenn Morris <rgm@gnu.org>
2538
2539 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
2540
2541 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
2542
2543 Fix minor problems found by static checking.
2544 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
2545 * indent.c (Fvertical_motion): Fix == vs = typo.
2546
2547 2011-09-24 Eli Zaretskii <eliz@gnu.org>
2548
2549 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
2550 Default value is now t. Doc fix.
2551
2552 * indent.c (Fvertical_motion): Compute and apply the overshoot
2553 logic when moving up, not only when moving down. Fix the
2554 confusing name and values of the it_overshoot_expected variable;
2555 logic changes accordingly. (Bug#9254) (Bug#9549)
2556
2557 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
2558 CHARPOS is covered by a display string which includes newlines.
2559 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
2560 is covered by a display string with embedded newlines.
2561
2562 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
2563
2564 * dbusbind.c (Fdbus_register_signal): Add match rule to
2565 Vdbus_registered_objects_table. (Bug#9581)
2566 (Fdbus_register_method, Vdbus_registered_objects_table):
2567 Fix docstring.
2568
2569 2011-09-24 Jim Meyering <meyering@redhat.com>
2570
2571 do not ignore write error for any output size
2572 The previous change was incomplete.
2573 While it makes emacs --batch detect the vast majority of stdout
2574 write failures, errors were still ignored whenever the output size is
2575 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
2576 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
2577 && echo FAIL: ignored write error
2578 FAIL: ignored write error
2579 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
2580 && echo FAIL: ignored write error
2581 FAIL: ignored write error
2582 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
2583
2584 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
2585
2586 * emacs.c (Fkill_emacs): In noninteractive mode exit
2587 non-successfully if a write error occurred on stdout. (Bug#9574)
2588
2589 2011-09-21 Eli Zaretskii <eliz@gnu.org>
2590
2591 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
2592 the xassert test.
2593
2594 * dispextern.h (struct it): Update the comment documenting what
2595 can it->OBJECT be.
2596
2597 2011-09-20 Eli Zaretskii <eliz@gnu.org>
2598
2599 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
2600 a display string, extend search for cursor position to end of row.
2601 (find_row_edges): If the row ends in a newline from a display
2602 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
2603 Handle the case of a display string with multiple newlines.
2604 (Fcurrent_bidi_paragraph_direction): Fix search for previous
2605 non-empty line. Fixes confusing cursor motion with arrow keys at
2606 the beginning of a line that starts with whitespace.
2607
2608 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
2609
2610 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
2611 (bug#9493).
2612
2613 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
2614
2615 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
2616 boolean (Bug#9154).
2617
2618 2011-09-18 Eli Zaretskii <eliz@gnu.org>
2619
2620 * xdisp.c (display_line): Record maximum and minimum buffer
2621 positions even if no glyphs were produced (e.g., by a zero-width
2622 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
2623 buffer positions that will be removed from the glyph row because
2624 they don't fit.
2625 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
2626 column is beyond frame width: don't subtract 1 "pixel" when
2627 computing width of the stretch.
2628 (reseat_at_next_visible_line_start): Undo the change made on
2629 2011-09-17 that saved paragraph information and restored it after
2630 the call to `reseat'. (Bug#9545)
2631
2632 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2633
2634 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
2635 and turn window cursor on if cleared (Bug#9415).
2636
2637 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
2638
2639 * search.c (boyer_moore): Take unibyte characters from pattern
2640 literally. (Bug#9458)
2641
2642 2011-09-18 Eli Zaretskii <eliz@gnu.org>
2643
2644 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
2645
2646 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
2647
2648 Fix minor problem found by static checking.
2649 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
2650 initialized, to pacify gcc -Wuninitialized.
2651
2652 * fileio.c: Report proper errno when syscall falls.
2653 (Finsert_file_contents): Save and restore errno,
2654 so that report_file_error outputs the correct diagnostic.
2655 (Fwrite_region) [CLASH_DETECTION]: Likewise.
2656
2657 2011-09-18 Eli Zaretskii <eliz@gnu.org>
2658
2659 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
2660
2661 2011-09-17 Eli Zaretskii <eliz@gnu.org>
2662
2663 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
2664 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
2665
2666 2011-09-17 Eli Zaretskii <eliz@gnu.org>
2667
2668 * xdisp.c (reseat_at_next_visible_line_start): Keep information
2669 about the current paragraph and restore it after the call to reseat.
2670
2671 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
2672 (bidi_find_paragraph_start): Search back for paragraph beginning
2673 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
2674 (bidi_move_to_visually_next): Only trigger paragraph-related
2675 computations when the last character is a newline or at EOB, not
2676 just any NEUTRAL_B. (Bug#9470)
2677
2678 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
2679 truncated lines if point is covered by a display string. (Bug#9524)
2680
2681 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
2682
2683 * xselect.c: Relax test for outgoing X longs (Bug#9498).
2684 (cons_to_x_long): New function.
2685 (lisp_data_to_selection_data): Use it. Correct the test for
2686 short-versus-long data; it was negated. Break out of vector
2687 loop, for efficiency, when a long datum is discovered.
2688
2689 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
2690
2691 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
2692
2693 2011-09-16 Eli Zaretskii <eliz@gnu.org>
2694
2695 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
2696 GCC PR/17406) by declaring this function with external scope.
2697
2698 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
2699
2700 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
2701 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
2702
2703 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
2704
2705 * editfns.c (Fformat): Correctly handle text properties on "%%".
2706
2707 2011-09-15 Eli Zaretskii <eliz@gnu.org>
2708
2709 * xterm.c (x_draw_composite_glyph_string_foreground):
2710 * w32term.c (x_draw_composite_glyph_string_foreground):
2711 * term.c (encode_terminal_code):
2712 * composite.c (composition_update_it, get_composition_id):
2713 * xdisp.c (get_next_display_element)
2714 (fill_composite_glyph_string): Add comments about special meaning
2715 of TAB characters in a composition.
2716
2717 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
2718
2719 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
2720 This occurs when processing a multibyte format.
2721 Problem reported by Wolfgang Jenker.
2722
2723 2011-09-15 Johan Bockgård <bojohan@gnu.org>
2724
2725 * xdisp.c (try_cursor_movement): Only check for exact match if
2726 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
2727
2728 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
2729
2730 Remove unused external symbols.
2731 * dispextern.h (calc_pixel_width_or_height): Remove decl.
2732 * xdisp.c (calc_pixel_width_or_height): Now static.
2733 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
2734 * indent.c (check_display_width):
2735 * w32term.c: Fix comment to match code.
2736 * xterm.c, xterm.h (x_catching_errors): Remove.
2737
2738 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
2739
2740 * xselect.c: Use signed conversions more consistently (Bug#9498).
2741 (selection_data_to_lisp_data): Assume incoming selection data are
2742 signed integers, not unsigned. This is to be consistent with
2743 outgoing selection data, which was modified to use signed integers
2744 in as part of the fix to Bug#9196 in response to Jan D.'s comment
2745 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
2746 expects long, not unsigned long.
2747
2748 2011-09-14 Eli Zaretskii <eliz@gnu.org>
2749
2750 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
2751 computation of loop end. Reported by Johan Bockgård
2752 <bojohan@gnu.org>.
2753
2754 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
2755
2756 * frame.c (Fother_visible_frames_p): Function deleted.
2757
2758 2011-09-12 Eli Zaretskii <eliz@gnu.org>
2759
2760 * indent.c (compute_motion): Process display vector front to back
2761 rather than the other way around. (Bug#2496)
2762
2763 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2764
2765 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
2766
2767 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
2768
2769 * minibuf.c (Fread_from_minibuffer): Doc fix.
2770
2771 2011-09-11 Eli Zaretskii <eliz@gnu.org>
2772
2773 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
2774 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
2775
2776 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
2777
2778 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
2779 value for non-existent files.
2780
2781 2011-09-11 Eli Zaretskii <eliz@gnu.org>
2782
2783 * fileio.c (Finsert_file_contents): If the file cannot be opened,
2784 set its "size" to -1. This will set the modtime_size field of
2785 the corresponding buffer to -1, which is what
2786 verify-visited-file-modtime expects for files that do not exist.
2787 (Bug#9139)
2788
2789 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
2790
2791 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
2792 here ...
2793 * lisp.h: ... from here. push_key_description is no longer
2794 defined in keyboard.c, so its declaration should not be in
2795 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
2796 logically belongs with push_key_description.
2797
2798 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
2799
2800 * buffer.h: Include <sys/types.h> instead of <time.h>.
2801 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
2802 Problem reported by Herbert J. Skuhra.
2803
2804 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
2805
2806 * xml.c (parse_region): Make the parsing work for
2807 non-comment-starting XML files again (bug#9144).
2808
2809 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
2810
2811 * image.c (gif_load): Fix calculation of bottom and right corner.
2812 (Bug#9468)
2813
2814 2011-09-10 Eli Zaretskii <eliz@gnu.org>
2815
2816 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
2817 redisplay in small windows.
2818
2819 2011-09-09 Eli Zaretskii <eliz@gnu.org>
2820
2821 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
2822
2823 2011-09-08 Martin Rudalics <rudalics@gmx.at>
2824
2825 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
2826 Operate on live windows only.
2827
2828 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
2829
2830 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
2831
2832 2011-09-07 Eli Zaretskii <eliz@gnu.org>
2833
2834 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
2835 only under bidi iteration.
2836
2837 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
2838
2839 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
2840
2841 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
2842
2843 isnan: Fix porting problem to Solaris 10 with bundled gcc.
2844 Without this fix, the command to link temacs failed due to an
2845 undefined symbol __builtin_isnan. This is because
2846 /usr/include/iso/math_c99.h #defines isnan(x) to
2847 __builtin_isnan(x), but the bundled gcc, which identifies itself
2848 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
2849 a __builtin_isnan.
2850 * floatfns.c (isnan): #undef, and then #define to a clone of
2851 what's in data.c.
2852 (Fisnan): Always define, since it's always available now.
2853 (syms_of_floatfns): Always define isnan at the Lisp level.
2854
2855 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
2856
2857 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
2858
2859 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
2860
2861 * fileio.c: Fix bugs with large file offsets (Bug#9428).
2862 The previous code assumed that file offsets (off_t values) fit in
2863 EMACS_INT variables, which is not true on typical 32-bit hosts.
2864 The code messed up by falsely reporting buffer overflow in cases
2865 such as (insert-file-contents "big" nil 1 2) into an empty buffer
2866 when "big" contains more than 2**29 bytes, even though this
2867 inserts just one byte and does not overflow the buffer.
2868 (Finsert_file_contents): Store file offsets as off_t
2869 values, not as EMACS_INT values. Check for overflow when
2870 converting between EMACS_INT and off_t. When checking for
2871 buffer overflow or for overlap, take the offsets into account.
2872 Don't use EMACS_INT for small values where int suffices.
2873 When checking for overlap, fix a typo: ZV was used where
2874 ZV_BYTE was intended.
2875 (Fwrite_region): Don't assume off_t fits into 'long'.
2876 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
2877
2878 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
2879
2880 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
2881
2882 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
2883
2884 sprintf-related integer and memory overflow issues (Bug#9412).
2885
2886 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
2887 (esprintf, exprintf, evxprintf): New functions.
2888 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
2889 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
2890 (modify_event_symbol): Do not assume that the length of
2891 name_alist_or_stem is safe to alloca and fits in int.
2892 (Fexecute_extended_command): Likewise for function name and binding.
2893 (Frecursion_depth): Wrap around reliably on integer overflow.
2894 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
2895 since some callers pass EMACS_INT values.
2896 (Fsingle_key_description): Don't crash if symbol name contains more
2897 than MAX_ALLOCA bytes.
2898 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
2899 (get_minibuffer): Arg is now EMACS_INT, not int.
2900 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
2901 (esprintf, exprintf, evxprintf): New decls.
2902 * window.h (command_loop_level, minibuf_level): Reflect API changes.
2903
2904 * dbusbind.c (signature_cat): New function.
2905 (xd_signature, Fdbus_register_signal):
2906 Do not overrun buffer; instead, report string overflow.
2907
2908 * dispnew.c (add_window_display_history): Don't overrun buffer.
2909 Truncate instead; this is OK since it's just a log.
2910
2911 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
2912 even if the time zone offset is outlandishly large.
2913 Don't mishandle offset == INT_MIN.
2914
2915 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
2916 when creating daemon; the previous buffer-overflow check was incorrect.
2917
2918 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
2919 which has the guts of the old verror function.
2920
2921 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
2922 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
2923
2924 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
2925 (font_unparse_xlfd): Don't blindly alloca long strings.
2926 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
2927 fits in int, when using sprintf. Use single snprintf to count
2928 length of string rather than counting it via multiple sprintfs;
2929 that's simpler and more reliable.
2930 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
2931 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
2932 sprintf, in case result does not fit in int.
2933
2934 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
2935 (fontset_from_font): Print it.
2936
2937 * frame.c (tty_frame_count): Now printmax_t, not int.
2938 (make_terminal_frame, set_term_frame_name): Print it.
2939 (x_report_frame_params): In X, window IDs are unsigned long,
2940 not signed long, so print them as unsigned.
2941 (validate_x_resource_name): Check for implausibly long names,
2942 and don't assume name length fits in 'int'.
2943 (x_get_resource_string): Don't blindly alloca invocation name;
2944 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
2945 not fit in int.
2946
2947 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
2948 (xg_check_special_colors, xg_set_geometry):
2949 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
2950
2951 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
2952 Use esprintf, not sprintf, in case result does not fit in int.
2953
2954 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
2955 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
2956 it as a large positive number.
2957 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
2958 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
2959
2960 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
2961 in case result does not fit in int.
2962
2963 * print.c (float_to_string): Detect width overflow more reliably.
2964 (print_object): Make sprintf buffer a bit bigger, to avoid potential
2965 buffer overrun. Don't assume list length fits in 'int'. Treat
2966 print length of 0 as 0, not as infinity; to be consistent with other
2967 uses of print length in this function. Don't overflow print length
2968 index. Don't assume hash table size fits in 'long', or that
2969 vectorlike size fits in 'unsigned long'.
2970
2971 * process.c (make_process): Use printmax_t, not int, to format
2972 process-name gensyms.
2973
2974 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
2975
2976 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
2977 to avoid potential buffer overrun.
2978
2979 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
2980 if X resource line is longer than 512 bytes.
2981
2982 * xfns.c (x_window): Make sprintf buffer a bit bigger
2983 to avoid potential buffer overrun.
2984
2985 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
2986
2987 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
2988
2989 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
2990
2991 Integer overflow fixes for scrolling, etc.
2992 Without these, Emacs silently mishandles large integers sometimes.
2993 For example, "C-u 4294967297 M-x recenter" was treated as if
2994 it were "C-u 1 M-x recenter" on a typical 64-bit host.
2995
2996 * xdisp.c (try_window_id): Check Emacs fixnum range before
2997 converting to 'int'.
2998
2999 * window.c (window_scroll_line_based, Frecenter):
3000 Check that an Emacs fixnum is in range before assigning it to 'int'.
3001 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
3002 values converted from Emacs fixnums.
3003 (Frecenter): Don't wrap around a line count if it is out of 'int'
3004 range; instead, treat it as an extreme value.
3005 (Fset_window_configuration, compare_window_configurations):
3006 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
3007
3008 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
3009 that can exceed INT_MAX. Check that EMACS_INT value is in range
3010 before assigning it to the (possibly-narrower) index.
3011 (match_limit): Don't assume that a fixnum can fit in 'int'.
3012
3013 * print.c (print_object): Use ptrdiff_t, not int, for index that can
3014 exceed INT_MAX.
3015
3016 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3017 (Fvertical_motion): Don't wrap around LINES values that don't fit
3018 in 'int'. Instead, treat them as extreme values. This is good
3019 enough for windows, which can't have more than INT_MAX lines anyway.
3020
3021 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
3022
3023 * Require libxml/parser.h to avoid compilation warning.
3024
3025 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
3026
3027 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
3028 since this reportedly can destroy thread storage.
3029
3030 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
3031
3032 * syntax.c (find_defun_start): Update all cache variables if
3033 exiting early (Bug#9401).
3034
3035 2011-08-30 Eli Zaretskii <eliz@gnu.org>
3036
3037 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
3038
3039 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
3040 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
3041 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
3042
3043 * term.c (tty_append_glyph): New function.
3044 (produce_stretch_glyph): Static function and its prototype deleted.
3045
3046 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
3047 Add prototypes.
3048
3049 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
3050
3051 * image.c (parse_image_spec): Check for nonnegative, not for positive,
3052 when checking :margin (Bug#9390).
3053 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
3054 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
3055 so that the name doesn't mislead. All uses changed.
3056
3057 2011-08-28 Johan Bockgård <bojohan@gnu.org>
3058
3059 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
3060 set_tty_hooks.
3061
3062 2011-08-27 Eli Zaretskii <eliz@gnu.org>
3063
3064 * xdisp.c (move_it_to): Don't bail out early when reaching
3065 position beyond to_charpos, if we are scanning backwards.
3066 (move_it_vertically_backward): When DY == 0, make sure we get to
3067 the first character in the line after the newline.
3068
3069 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
3070
3071 * ccl.c: Improve and simplify overflow checking (Bug#9196).
3072 (ccl_driver): Do not generate an out-of-range pointer.
3073 (Fccl_execute_on_string): Remove unnecessary check for
3074 integer overflow, noted by Stefan Monnier in
3075 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
3076 Remove a FIXME that didn't need fixing.
3077 Simplify the newly-introduced buffer reallocation code.
3078
3079 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
3080
3081 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
3082
3083 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
3084
3085 Integer and memory overflow issues (Bug#9196).
3086
3087 * doc.c (get_doc_string): Rework so that
3088 get_doc_string_buffer_size is the actual buffer size, rather than
3089 being 1 less than the actual buffer size; this makes xpalloc more
3090 convenient.
3091
3092 * image.c (x_allocate_bitmap_record, cache_image):
3093 * xselect.c (Fx_register_dnd_atom):
3094 Simplify previous changes by using xpalloc.
3095
3096 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
3097 since either will do and ptrdiff_t is convenient with xpalloc.
3098
3099 * charset.c (charset_table_size)
3100 (struct charset_sort_data.priority): Now ptrdiff_t.
3101 (charset_compare): Don't overflow if priorities differ greatly.
3102 (Fsort_charsets): Don't assume list length fits in int.
3103 Check for size-calculation overflow when allocating sort data.
3104 (syms_of_charset): Allocate an initial charset table that is
3105 just under 64 KiB, to avoid problems with glibc malloc and mmap.
3106
3107 * cmds.c (internal_self_insert): Check for size-calculation overflow.
3108
3109 * composite.h (struct composition.glyph_len): Now int, not unsigned.
3110 The actual value is always <= INT_MAX, and leaving it unsigned made
3111 overflow checking harder.
3112
3113 * dispextern.h (struct glyph_matrix.rows_allocated)
3114 (struct face_cache.size): Now ptrdiff_t, for convenience in use
3115 with xpalloc. The values are still always <= INT_MAX.
3116
3117 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
3118
3119 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
3120 (SAFE_NALLOCA): New macro.
3121
3122 * region-cache.c (struct boundary.pos, find_cache_boundary)
3123 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
3124 (set_cache_region, invalidate_region_cache)
3125 (revalidate_region_cache, know_region_cache, region_cache_forward)
3126 (region_cache_backward, pp_cache):
3127 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
3128 so that ptrdiff_t * can be passed to xpalloc.
3129 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
3130 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
3131 (pp_cache): Don't assume cache_len fits in int.
3132 * region-cache.h: Adjust extern decls to match.
3133
3134 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
3135 EMACS_INT, since either will do, for xpalloc.
3136
3137 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
3138 (xnmalloc, xnrealloc, xpalloc): New functions.
3139
3140 * bidi.c (bidi_shelve_header_size): New constant.
3141 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
3142 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
3143
3144 * bidi.c (bidi_cache_shrink):
3145 * buffer.c (overlays_at, overlays_in, record_overlay_string)
3146 (overlay_strings):
3147 Don't update size of array until after memory allocation succeeds,
3148 because xmalloc/xrealloc may not return.
3149 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
3150 now that we have proper integer overflow checking.
3151 (record_overlay_string, overlay_strings): Catch overflows when
3152 calculating size of overlay_str_buf.
3153
3154 * callproc.c (Fcall_process): Check for size overflow when
3155 calculating size of args2.
3156 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
3157 Normally we prefer signed values, but sticking with ptrdiff_t would
3158 require adding more-complicated checks.
3159
3160 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
3161 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
3162 Redo buffer-overflow calculations to avoid integer overflow.
3163 Add a FIXME comment where memory seems to be over-allocated.
3164
3165 * character.c (Fstring): Check for size-calculation overflow.
3166
3167 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
3168 unnecessary integer overflow. Check for size overflow.
3169 (encode_coding_object): Don't update size until xmalloc succeeds.
3170
3171 * composite.c (get_composition_id): Check for overflow in glyph
3172 length calculations.
3173
3174 Integer and memory overflow fixes for display code.
3175 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
3176 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
3177 (scrolling_window): Check for overflow in size calculations.
3178 (line_draw_cost, realloc_glyph_pool, add_row_entry):
3179 Don't assume glyph table len fits in int.
3180 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
3181 (row_table_size): Now ptrdiff_t, not int.
3182 (scrolling_window): Avoid overflow in size calculations.
3183 Don't update size until allocation succeeds.
3184 * fns.c (concat): Check for overflow in size calculations.
3185 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
3186 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
3187 (NEXT_ALMOST_PRIME_LIMIT): New constant.
3188
3189 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
3190 (get_doc_string): Check for size calculation overflow.
3191 Don't update size until allocation succeeds.
3192 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
3193 EMACS_INT, where ptrdiff_t will do.
3194 (Fsubstitute_command_keys): Check for string overflow.
3195
3196 * editfns.c (set_time_zone_rule): Don't assume environment length
3197 fits in int.
3198 (message_length): Now ptrdiff_t, not int.
3199 (Fmessage_box): Don't update size until allocation succeeds.
3200 Don't assume message length fits in int.
3201 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
3202
3203 * emacs.c (main): Do not reallocate argv, since there is a null at
3204 the end that can be overwritten, and this way there's no need to
3205 worry about size-calculation overflow.
3206 (sort_args): Check for size-calculation overflow.
3207
3208 * eval.c (init_eval_once, grow_specpdl): Don't update size until
3209 alloc succeeds.
3210 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
3211
3212 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
3213 (x_set_scroll_bar_width, x_figure_window_size):
3214 Check for integer overflow.
3215 (x_set_alpha): Do not assume XINT fits in int.
3216
3217 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
3218 This is for the members text_lines, text_cols, total_lines, total_cols,
3219 where the system imposes an 'int' limit.
3220
3221 * fringe.c (Fdefine_fringe_bitmap):
3222 Don't update size until alloc works.
3223
3224 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
3225 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
3226
3227 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
3228 Check for size-calculation overflow.
3229 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
3230 do, as we prefer signed integers.
3231 (id_to_widget.max_size, id_to_widget.used)
3232 (xg_store_widget_in_map, xg_remove_widget_from_map)
3233 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
3234 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
3235 Use and return ptrdiff_t, not int.
3236 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
3237 * gtkutil.h: Change prototypes to match the above.
3238
3239 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
3240 are duplicate now that they've been promoted to lisp.h.
3241 (x_allocate_bitmap_record, x_alloc_image_color)
3242 (make_image_cache, cache_image, xpm_load):
3243 Don't update size until alloc is done.
3244 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
3245 (x_detect_edges):
3246 Check for size calculation overflow.
3247 (ct_colors_allocated_max): New constant.
3248 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
3249 overflow.
3250
3251 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
3252 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
3253 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
3254 Use ptrdiff_t, not int, to count maps.
3255 (read_char_minibuf_menu_prompt): Check for overflow in size
3256 calculations. Don't update size until allocation succeeds.
3257 Redo calculations to avoid overflow.
3258 * keyboard.h: Change prototypes to match the above.
3259
3260 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
3261 to count maps.
3262 (current_minor_maps): Check for size calculation overflow.
3263 * keymap.h: Change prototypes to match the above.
3264
3265 * lread.c (read1, init_obarray): Don't update size until alloc done.
3266
3267 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
3268 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
3269
3270 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
3271 Now ptrdiff_t, not int.
3272 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
3273 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
3274
3275 * process.c (Fnetwork_interface_list): Check for overflow
3276 in size calculation.
3277
3278 * region-cache.c (move_cache_gap): Check for size calculation overflow.
3279
3280 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
3281 overflow. Don't bother calling xmalloc when xrealloc will do.
3282
3283 * search.c (Freplace_match): Check for size calculation overflow.
3284 (Fset_match_data): Don't assume list lengths fit in 'int'.
3285
3286 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
3287 for command line length. Do not attempt to address one before the
3288 beginning of an array, as that's not portable.
3289
3290 * term.c (max_frame_lines): Remove; unused.
3291 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
3292 not int.
3293 (encode_terminal_code, calculate_costs): Check for size
3294 calculation overflow.
3295 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
3296 table lengths and related sizes. Don't update size until alloc
3297 done. Redo calculations to avoid overflow.
3298 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
3299
3300 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
3301 subtracting pointers.
3302 (gobble_line): Check for overflow more carefully. Don't update size
3303 until alloc done.
3304
3305 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
3306 Don't update size until alloc done.
3307 Redo size calculations to avoid overflow.
3308 Check for size calculation overflow.
3309 (main) [DEBUG]: Fix typo in invoking tparam1.
3310
3311 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
3312 Use ptrdiff_t, not int, for sizes.
3313 (store_mode_line_noprop_char): Don't update size until alloc done.
3314
3315 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
3316 Use ptrdiff_t, not int, for sizes.
3317 (Finternal_make_lisp_face, cache_face):
3318 Check for size calculation overflow.
3319 (cache_face): Treat size calculation overflows as if they were
3320 memory exhaustion (the usual treatment), rather than aborting.
3321
3322 * xfns.c (x_encode_text, x_set_name_internal)
3323 (Fx_change_window_property): Use ptrdiff_t, not int, to count
3324 sizes, since they can exceed INT_MAX in size. Check for size
3325 calculation overflow.
3326
3327 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
3328 (xg_select): Check for size calculation overflow.
3329 Don't update size until alloc done.
3330
3331 * xrdb.c (get_environ_db): Don't assume path length fits in int,
3332 as sprintf is limited to int lengths.
3333
3334 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
3335 (X_LONG_MIN): New macros.
3336 Use them to make the following changes clearer.
3337 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
3338 This change doesn't affect the value now, but it may help remind
3339 future maintainers not to raise the value too much later.
3340 (SELECTION_QUANTUM): Remove, replacing with ...
3341 (selection_quantum): ... new function, which avoids overflow.
3342 All uses changed.
3343 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
3344 assumption that selection length fits in 'int'.
3345 (x_reply_selection_request, x_handle_selection_request)
3346 (x_get_window_property, receive_incremental_selection)
3347 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
3348 (lisp_data_to_selection_data, clean_local_selection_data):
3349 Use ptrdiff_t, not int, to record length of selection.
3350 (x_reply_selection_request, x_get_window_property)
3351 (receive_incremental_selection, x_property_data_to_lisp):
3352 Redo calculations to avoid overflow.
3353 (x_reply_selection_request): When sending hint, ceiling it at
3354 X_LONG_MAX rather than relying on wraparound overflow to send
3355 something.
3356 (x_get_window_property, receive_incremental_selection)
3357 (lisp_data_to_selection_data, x_property_data_to_lisp):
3358 Check for size-calculation overflow.
3359 (x_get_window_property, receive_incremental_selection)
3360 (lisp_data_to_selection_data, Fx_register_dnd_atom):
3361 Don't store size until memory allocation succeeds.
3362 (x_get_window_property): Plug memory leak on memory exhaustion.
3363 Don't double-block input; malloc is safe here. Don't assume 2**34
3364 - 4 fits in unsigned long. Add an xassert to check
3365 XGetWindowProperty overflow. Be more careful about overflow
3366 calculations, and distinguish size from memory overflow better.
3367 (receive_incremental_selection): When tracing, don't assume
3368 unsigned int is less than INT_MAX.
3369 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
3370 harmful) conversions of unsigned short to int.
3371 (lisp_data_to_selection_data): Don't assume that integers
3372 in the range -65535 through -1 fit in an X unsigned short.
3373 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
3374 result parameters unless successful. Rely on cons_to_unsigned
3375 to report problems with elements; the old code wasn't right anyway.
3376 (x_check_property_data): Check for int overflow; we cannot use
3377 a wider type due to X limits.
3378 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
3379
3380 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
3381
3382 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
3383 (x_term_init): Check for size calculation overflow.
3384 (x_color_cells): Don't store size until memory allocation succeeds.
3385 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
3386 Don't assume alloca size is less than MAX_ALLOCA.
3387 (x_term_init): Don't assume length fits in int (sprintf is limited
3388 to int size).
3389
3390 Use ptrdiff_t for composition IDs.
3391 * character.c (lisp_string_width):
3392 * composite.c (composition_table_size, n_compositions)
3393 (get_composition_id, composition_gstring_from_id):
3394 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
3395 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
3396 * window.c (Frecenter):
3397 Use ptrdiff_t, not int, for composition IDs.
3398 * composite.c (get_composition_id): Check for integer overflow.
3399 * composite.h: Adjust prototypes to match the above changes.
3400
3401 Use ptrdiff_t for hash table indexes.
3402 * category.c (hash_get_category_set):
3403 * ccl.c (ccl_driver):
3404 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
3405 * coding.c (coding_system_charset_list, detect_coding_system):
3406 * coding.h (struct coding_system.id):
3407 * composite.c (get_composition_id, gstring_lookup_cache):
3408 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
3409 * image.c (xpm_get_color_table_h):
3410 * lisp.h (hash_lookup, hash_put):
3411 * minibuf.c (Ftest_completion):
3412 Use ptrdiff_t for hash table indexes, not int (which is too
3413 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
3414 32-bit --with-wide-int hosts).
3415
3416 * charset.c (Fdefine_charset_internal): Check for integer overflow.
3417 Add a FIXME comment about memory leaks.
3418 (syms_of_charset): Don't assume xmalloc returns.
3419
3420 Don't assume that stated character widths fit in int.
3421 * character.c (Fchar_width, c_string_width, lisp_string_width):
3422 * character.h (CHAR_WIDTH):
3423 * indent.c (MULTIBYTE_BYTES_WIDTH):
3424 Use sanitize_char_width to avoid undefined and/or bad behavior
3425 with outlandish widths.
3426 * character.h (sanitize_tab_width): Rename from sanitize_width,
3427 now that we have two such functions. All uses changed.
3428 (sanitize_char_width): New inline function.
3429
3430 Don't assume that tab-width fits in int.
3431 * character.h (sanitize_width): New inline function.
3432 (SANE_TAB_WIDTH): New macro.
3433 (ASCII_CHAR_WIDTH): Use it.
3434 * indent.c (sane_tab_width): Remove. All uses replaced by
3435 SANE_TAB_WIDTH (current_buffer).
3436 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
3437
3438 * fileio.c: Integer overflow issues with file modes.
3439 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
3440
3441 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
3442 Remove unreachable code.
3443 (read_hex, load_charset_map_from_file): Check for integer overflow.
3444
3445 * xterm.c: Don't go over XClientMessageEvent limit.
3446 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
3447 (x_send_scroll_bar_event): Likewise. Check that the size does not
3448 exceed limits imposed by XClientMessageEvent, as well as the usual
3449 ptrdiff_t and size_t limits.
3450
3451 * keyboard.c: Overflow, signedness and related fixes.
3452 (make_lispy_movement): Use same integer type in forward decl
3453 that is used in the definition.
3454 (read_key_sequence, keyremap_step):
3455 Change bufsize argument back to int, undoing my 2011-03-30 change.
3456 We prefer signed types, and int is wide enough here.
3457 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
3458 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
3459 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
3460 length, not size_t. Use ptrdiff_t for index, not int.
3461 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
3462 possibility of integer overflow.
3463
3464 Overflow, signedness and related fixes for images.
3465
3466 * dispextern.h (struct it.stack[0].u.image.image_id)
3467 (struct_it.image_id, struct image.id, struct image_cache.size)
3468 (struct image_cache.used, struct image_cache.ref_count):
3469 * gtkutil.c (update_frame_tool_bar):
3470 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
3471 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
3472 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
3473 * nsmenu.m (update_frame_tool_bar):
3474 * xdisp.c (calc_pixel_width_or_height):
3475 * xfns.c (image_cache_refcount):
3476 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
3477 on typical 64-bit hosts.
3478
3479 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
3480 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
3481 Omit unnecessary casts to int.
3482 (parse_image_spec): Check that integers fall into 'int' range
3483 when the callers expect that.
3484 (image_ascent): Redo ascent calculation to avoid int overflow.
3485 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
3486 (lookup_image): Remove unnecessary tests.
3487 (xbm_image_p): Locals are now of int, not EMACS_INT,
3488 since parse_image_check makes sure they fit into int.
3489 (png_load, gif_load, svg_load_image):
3490 Prefer int to unsigned where either will do.
3491 (tiff_handler): New function, combining the cores of the
3492 old tiff_error_handler and tiff_warning_handler.
3493 This function is rewritten to use vsnprintf and thereby avoid
3494 stack buffer overflows. It uses only the features of vsnprintf
3495 that are common to both POSIX and native Microsoft.
3496 (tiff_error_handler, tiff_warning_handler): Use it.
3497 (tiff_load, gif_load, imagemagick_load_image):
3498 Don't assume :index value fits in 'int'.
3499 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
3500 (imagemagick_load_image): Check that crop parameters fit into
3501 the integer types that MagickCropImage accepts. Don't assume
3502 Vimagemagick_render_type has a nonnegative value. Don't assume
3503 size_t fits in 'long'.
3504 (gs_load): Use printmax_t to print the widest integers possible.
3505 Check for integer overflow when computing image height and width.
3506
3507 2011-08-26 Eli Zaretskii <eliz@gnu.org>
3508
3509 * xdisp.c (redisplay_window): Don't force window start if point
3510 will be invisible in the resulting window. (Bug#9324)
3511
3512 2011-08-25 Eli Zaretskii <eliz@gnu.org>
3513
3514 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
3515 the display spec is of the form `(space ...)'.
3516 (handle_display_spec): Return the value returned by
3517 handle_single_display_spec, not just 1 or zero.
3518 (handle_single_display_spec): If the display spec is of the form
3519 `(space ...)', and specifies display in the text area, return 2
3520 rather than 1.
3521 (try_cursor_movement): Check for the need to scroll more
3522 accurately, and prefer exact match for point under bidi.
3523 Don't advance `row' beyond the last row of the window.
3524
3525 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
3526 into disp_prop; all users changed.
3527
3528 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
3529 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
3530 for the text covered by the display property.
3531
3532 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
3533
3534 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
3535 Change return value to nil.
3536 (Frecord_buffer): Delete unused function.
3537
3538 2011-08-24 Eli Zaretskii <eliz@gnu.org>
3539
3540 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
3541 buffers, return left-to-right.
3542 (set_cursor_from_row): Consider candidate row a win if its glyph
3543 represents a newline and point is on that newline. Fixes cursor
3544 positioning on the newline at EOL of R2L text within L2R
3545 paragraph, and vice versa.
3546 (try_cursor_movement): Check continued rows, in addition to
3547 continuation rows. Fixes unwarranted scroll when point enters a
3548 continued line of R2L text within an L2R paragraph, or vice versa.
3549 (cursor_row_p): Consider the case of point being equal to
3550 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
3551 from the end of a short line to the beginning of a continued line
3552 of R2L text within L2R paragraph.
3553 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
3554 composed characters.
3555
3556 * bidi.c (bidi_check_type): Use xassert.
3557 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
3558 members.
3559
3560 2011-08-23 Eli Zaretskii <eliz@gnu.org>
3561
3562 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
3563 a character.
3564
3565 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
3566
3567 * nsfont.m (ns_otf_to_script): Fix typo.
3568
3569 2011-08-22 Kenichi Handa <handa@m17n.org>
3570
3571 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
3572 extra slot even if the purpose is char-code-property-table.
3573
3574 2011-08-23 Eli Zaretskii <eliz@gnu.org>
3575
3576 * xdisp.c (redisplay_window): When computing centering_position,
3577 account for the height of the header line. (Bug#8874)
3578
3579 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
3580 instead of CHAR_TO_BYTE. Fixes a crash when a completion
3581 candidate is selected by the mouse, and that candidate has a
3582 composed character under the mouse.
3583
3584 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
3585 coordinates reported by pos-visible-in-window-p for a composed
3586 character in column zero.
3587
3588 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
3589
3590 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
3591
3592 2011-08-22 Eli Zaretskii <eliz@gnu.org>
3593
3594 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
3595 consider it a hit if to_charpos is anywhere in the range of the
3596 composed buffer positions.
3597
3598 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
3599
3600 * image.c (gif_load): Don't assume that each subimage has the same
3601 dimensions as the base image. Handle disposal method that is
3602 "undefined" by the gif spec (Bug#9335).
3603
3604 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
3605
3606 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
3607 (Fcondition_case): Document `debug' symbol in error handler.
3608
3609 2011-08-19 Eli Zaretskii <eliz@gnu.org>
3610
3611 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
3612 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
3613 from an Org mode buffer to a Speedbar frame.
3614
3615 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
3616 a composition, take its buffer position from IT->cmp_it.charpos.
3617 Fixes cursor positioning at the beginning of a line that begins
3618 with a composed character.
3619
3620 2011-08-18 Eli Zaretskii <eliz@gnu.org>
3621
3622 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
3623 character bidirectional type, use STRONG_L instead. Fixes crashes
3624 in a buffer produced by `describe-categories'.
3625
3626 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
3627 members before the level stack, so they would be saved and
3628 restored when copying iterator state. Fixes incorrect reordering
3629 around TABs covered by display properties.
3630
3631 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
3632
3633 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
3634
3635 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
3636
3637 * eval.c (internal_condition_case, internal_condition_case_1)
3638 (internal_condition_case_2, internal_condition_case_n):
3639 Remove unnecessary aborts (Bug#9081).
3640
3641 2011-08-17 Eli Zaretskii <eliz@gnu.org>
3642
3643 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
3644 has no `load' handler, try opening the file locally. (Bug#9311)
3645
3646 2011-08-16 Ken Brown <kbrown@cornell.edu>
3647
3648 * gmalloc.c: Expand comment.
3649
3650 2011-08-16 Eli Zaretskii <eliz@gnu.org>
3651
3652 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
3653 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
3654
3655 2011-08-16 Ken Brown <kbrown@cornell.edu>
3656
3657 Fix memory allocation problems in Cygwin build (Bug#9273).
3658
3659 * unexcw.c ( __malloc_initialized): Declare external variable.
3660 (fixup_executable): Force the dumped emacs to reinitialize malloc.
3661
3662 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
3663 New variables.
3664 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
3665 dumped emacs.
3666 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
3667 in the static heap.
3668 [CYGWIN] (special_realloc): New function.
3669 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
3670 requests to realloc storage in the static heap.
3671
3672 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
3673
3674 * bidi.c (bidi_initialize): Remove unused local.
3675
3676 2011-08-15 Eli Zaretskii <eliz@gnu.org>
3677
3678 * bidimirror.h:
3679 * biditype.h: Remove file.
3680 * makefile.w32-in ($(BLD)/bidi.$(O)):
3681 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
3682
3683 * dispextern.h: Fix a typo in the comment to bidi_type_t.
3684
3685 * chartab.c: Improve commentary for the uniprop_table API.
3686
3687 * bidi.c (bidi_paragraph_init): Support zero value of
3688 bidi_ignore_explicit_marks_for_paragraph_level.
3689 (bidi_initialize): Use uniprop_table instead of including
3690 biditype.h and bidimirror.h.
3691
3692 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
3693 coordinates of the iterator when restoring from ppos_it.
3694 (Bug#9296)
3695
3696 2011-08-14 Kenichi Handa <handa@m17n.org>
3697
3698 * process.c (create_process): Call setup_process_coding_systems
3699 after the pid of the process is set to -1 (Bug#8162).
3700
3701 2011-08-14 Eli Zaretskii <eliz@gnu.org>
3702
3703 * xdisp.c (move_it_in_display_line_to): Don't invoke
3704 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
3705 ppos_it. Fixes vertical cursor motion when line beginning is
3706 covered by an image. (Bug#9296)
3707
3708 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
3709
3710 * nsterm.h (ns_run_ascript): Declare.
3711 (NSAPP_DATA2_RUNASSCRIPT): Define.
3712
3713 * nsfns.m (as_script, as_result, as_status): New static variables.
3714 (ns_run_ascript): New function.
3715 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
3716 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
3717 the event loop. Get status from as_status (Bug#7276).
3718
3719 * nsterm.m (sendEvent): If event is NSApplicationDefined and
3720 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
3721 the event loop (Bug#7276).
3722
3723 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
3724
3725 * gnutls.c (QCgnutls_bootprop_priority)
3726 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
3727 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
3728 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
3729 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
3730 (QCgnutls_bootprop_verify_hostname_error)
3731 (QCgnutls_bootprop_callbacks_verify): Rename from
3732 Qgnutls_bootprop_..., all uses changed.
3733
3734 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
3735 uses changed.
3736
3737 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
3738
3739 * xfaces.c (Qframe_set_background_mode): Now static.
3740 * dispextern.h (Qframe_set_background_mode): Remove decl.
3741
3742 * process.c (Fnetwork_interface_info): Declare local only if needed.
3743
3744 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
3745
3746 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
3747 (Fnetwork_interface_list): Allocate in increments of bytes instead
3748 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
3749 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
3750 sockaddr.
3751 (struct ifflag_def): notrailers is smart on OSX.
3752 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
3753 Get hardware address with getifaddrs if available.
3754
3755 2011-08-12 Eli Zaretskii <eliz@gnu.org>
3756
3757 * xdisp.c (iterate_out_of_display_property): xassert that
3758 IT->position is set to within IT->object's boundaries. Break from
3759 the loop as soon as EOB is reached; avoids infloops in redisplay
3760 when IT->position is set up wrongly due to some bug.
3761 Set IT->current to match the bidi iterator unconditionally.
3762 (push_display_prop): Allow GET_FROM_STRING as IT->method on
3763 entry. Force push_it to save on the stack the current
3764 buffer/string position, to be restored by pop_it. Fix flags in
3765 the iterator structure wrt the object coming from a display
3766 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
3767 properties. (Bug#9284)
3768
3769 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
3770
3771 * fontset.c (fontset_get_font_group): Add proper type checks.
3772 (Bug#9172)
3773
3774 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3775
3776 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
3777 and LC_VERSION_MIN_MACOSX.
3778 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
3779 (dump_it) [LC_FUNCTION_STARTS]: Use it.
3780
3781 2011-08-08 Eli Zaretskii <eliz@gnu.org>
3782
3783 * xdisp.c (forward_to_next_line_start): Allow to use the
3784 no-display-properties-and-no-overlays under bidi display.
3785 Set disp_pos in the bidi iterator to avoid searches for display
3786 properties and overlays.
3787
3788 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
3789
3790 * editfns.c (Fset_time_zone_rule): Document relationship with the
3791 setenv function.
3792
3793 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
3794 the font entity extracted from the cache (Bug#8109).
3795
3796 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
3797
3798 * composite.c (autocmp_chars): Don't reset point. That is done by
3799 restore_point_unwind (Bug#5984).
3800
3801 2011-08-07 Juri Linkov <juri@jurta.org>
3802
3803 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
3804 to show the arg `TIME' instead of `TIMEVAL'.
3805
3806 2011-08-06 Eli Zaretskii <eliz@gnu.org>
3807
3808 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
3809 display property strides EOL and includes a newline, as in
3810 longlines-mode. (Bug#9254)
3811 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
3812 word-wrap under bidirectional display. (Bug#9224)
3813
3814 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
3815 is non-zero, even if the data buffer is NULL. Fixes a crash in
3816 vertical-motion with longlines-mode. (Bug#9254)
3817
3818 2011-08-05 Eli Zaretskii <eliz@gnu.org>
3819
3820 * bidi.c <bidi_cache_total_alloc>: Now static.
3821 (bidi_initialize): Initialize bidi_cache_total_alloc.
3822
3823 * xdisp.c (display_line): Release buffer allocated for shelved bidi
3824 cache. (Bug#9221)
3825
3826 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
3827 amount allocated this far in `bidi_cache_total_alloc'.
3828 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
3829 non-zero, only free the data buffer without restoring the cache
3830 contents. All callers changed.
3831
3832 * dispextern.h (bidi_unshelve_cache): Update prototype.
3833
3834 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
3835 (move_it_in_display_line, move_it_to)
3836 (move_it_vertically_backward, move_it_by_lines): Replace the call
3837 to xfree to an equivalent call to bidi_unshelve_cache.
3838 (move_it_in_display_line_to): Fix logic of returning
3839 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
3840
3841 2011-08-05 Eli Zaretskii <eliz@gnu.org>
3842
3843 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
3844 came from a string character with a `cursor' property. (Bug#9229)
3845
3846 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
3847
3848 * Makefile.in (LIB_PTHREAD): New variable.
3849 (LIBES): Add LIB_PTHREAD (Bug#9216).
3850
3851 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
3852 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
3853
3854 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
3855
3856 * regex.c (re_iswctype): Remove some redundant boolean conversions.
3857
3858 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
3859
3860 * xterm.c (x_find_topmost_parent): New function.
3861 (x_set_frame_alpha): Find topmost parent window with
3862 x_find_topmost_parent and set the property there also (bug#9181).
3863 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
3864
3865 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
3866
3867 * callproc.c (Fcall_process): Avoid vfork clobbering
3868 the local vars buffer, coding_systems, current_dir.
3869
3870 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
3871
3872 * keymap.c (Fmake_composed_keymap): Move to subr.el.
3873
3874 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
3875
3876 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
3877 so that it is not optimized away.
3878
3879 * xdisp.c (compute_display_string_pos): Remove unused local.
3880
3881 2011-08-02 Eli Zaretskii <eliz@gnu.org>
3882
3883 Fix slow cursor motion and scrolling in large buffers with
3884 selective display, like Org Mode buffers. (Bug#9218)
3885
3886 * dispextern.h (struct bidi_it): New member disp_prop_p.
3887
3888 * xdisp.c: Remove one-slot cache of display string positions.
3889 (compute_display_string_pos): Accept an additional argument
3890 DISP_PROP_P; callers changed. Scan at most 5K characters forward
3891 for a display string or property. If found, set DISP_PROP_P
3892 non-zero.
3893
3894 * bidi.c (bidi_fetch_char): Accept an additional argument
3895 DISP_PROP_P, and pass it to compute_display_string_pos.
3896 Only handle text covered by a display string if DISP_PROP_P is returned
3897 non-zero. All callers of bidi_fetch_char changed.
3898
3899 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
3900
3901 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
3902
3903 2010-12-03 Don March <don@ohspite.net>
3904
3905 * keymap.c (Fdefine_key): Fix non-prefix key error message when
3906 last character M-[char] is translated to ESC [char] (bug#7541).
3907
3908 2011-08-02 Kenichi Handa <handa@m17n.org>
3909
3910 * lisp.h (uniprop_table): Extern it.
3911
3912 * chartab.c (uniprop_table): Make it non-static.
3913
3914 2011-08-01 Eli Zaretskii <eliz@gnu.org>
3915
3916 * xdisp.c (forward_to_next_line_start): Accept additional argument
3917 BIDI_IT_PREV, and store into it the state of the bidi iterator had
3918 on the newline.
3919 (reseat_at_next_visible_line_start): Use the bidi iterator state
3920 returned by forward_to_next_line_start to restore the state of
3921 it->bidi_it after backing up to previous newline. (Bug#9212)
3922
3923 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
3924
3925 * regex.c (re_comp): Protoize.
3926 (re_exec): Fix return type.
3927 (regexec): Fix type of `ret'. (Bug#9203)
3928
3929 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
3930
3931 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
3932 This is needed if max-image-size is a floating-point number.
3933
3934 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
3935
3936 * print.c (print_object): Print empty symbol as ##.
3937
3938 * lread.c (read1): Read ## as empty symbol.
3939
3940 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
3941
3942 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
3943 setting frame foreground color (Bug#9175).
3944 (x_set_background_color): Likewise.
3945
3946 * nsmenu.m (-setText): Size tooltip dimensions precisely to
3947 contents (Bug#9176).
3948 (EmacsTooltip -init): Remove bezels and add shadows to
3949 tooltip windows.
3950
3951 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
3952 or scroll bar (Bug#8470).
3953
3954 * nsfont.m (nsfont_open): Remove assignment to voffset and
3955 unnecessary vars hshink, expand, hd, full_height, min_height.
3956 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
3957
3958 * nsterm.h (nsfont_info): Remove voffset field.
3959
3960 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
3961
3962 Implement strike-through and overline on NextStep (Bug#8863).
3963
3964 * nsfont.m (nsfont_open): Use underline position provided by font,
3965 instead of hard-coded value of 2.
3966 (nsfont_draw): Call ns_draw_text_decoration instead.
3967
3968 * nsterm.h: Add declaration for ns_draw_text_decoration.
3969
3970 * nsterm.m (ns_draw_text_decoration): New function for drawing
3971 underline, overline, and strike-through.
3972 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
3973 ns_draw_text_decoration. Change treatment of cursor drawing to
3974 accommodate underlining, etc.
3975
3976 2011-07-28 Eli Zaretskii <eliz@gnu.org>
3977
3978 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
3979 default.
3980
3981 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
3982
3983 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
3984 Without this fix, if a signal arrives just after memory fills up,
3985 'malloc' might be invoked reentrantly.
3986
3987 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
3988 In other words, assume that every image size is allowed, on non-X
3989 hosts. This assumption is probably wrong, but it lets Emacs compile.
3990
3991 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
3992
3993 * regex.c (re_iswctype): Convert return values to boolean.
3994
3995 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
3996
3997 * xdisp.c (compute_display_string_pos): Don't use cached display
3998 string position if the buffer had its restriction changed.
3999 (Bug#9184)
4000
4001 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
4002
4003 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
4004
4005 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
4006
4007 Integer signedness and overflow and related fixes. (Bug#9079)
4008
4009 * bidi.c: Integer size and overflow fixes.
4010 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
4011 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
4012 (bidi_cache_find_level_change, bidi_cache_ensure_space)
4013 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
4014 (bidi_find_other_level_edge):
4015 Use ptrdiff_t instead of EMACS_INT where either will do.
4016 This works better on 32-bit hosts configured --with-wide-int.
4017 (bidi_cache_ensure_space): Check for size-calculation overflow.
4018 Use % rather than repeated addition, for better worst-case speed.
4019 Don't set bidi_cache_size until after xrealloc returns, because it
4020 might not return.
4021 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
4022 (bidi_cache_ensure_space): Also check that the bidi cache size
4023 does not exceed that of the largest Lisp string or buffer. See Eli
4024 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
4025
4026 * alloc.c (__malloc_size_t): Remove.
4027 All uses replaced by size_t. See Andreas Schwab's note
4028 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
4029
4030 * image.c: Improve checking for integer overflow.
4031 (check_image_size): Assume that f is nonnull, since
4032 it is always nonnull in practice. This is one less thing to
4033 worry about when checking for integer overflow later.
4034 (x_check_image_size): New function, which checks for integer
4035 overflow issues inside X.
4036 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
4037 This removes the need for a memory_full check.
4038 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
4039 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
4040 (xbm_read_bitmap_data): Change locals back to 'int', since
4041 their values must fit in 'int'.
4042 (xpm_load_image, png_load, tiff_load):
4043 Invoke x_create_x_image_and_pixmap earlier,
4044 to avoid much needless work if the image is too large.
4045 (tiff_load): Treat overly large images as if
4046 x_create_x_image_and_pixmap failed, not as malloc failures.
4047 (gs_load): Use x_check_image_size.
4048
4049 * gtkutil.c: Omit integer casts.
4050 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
4051 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
4052
4053 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
4054
4055 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
4056 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
4057 would wrongly return t on a 64-bit host.
4058
4059 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
4060 The plain *_OVERFLOW macros run afoul of GCC bug 49705
4061 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
4062 and therefore cause GCC to emit a bogus diagnostic in some cases.
4063
4064 * image.c: Integer signedness and overflow and related fixes.
4065 This is not an exhaustive set of fixes, but it's time to
4066 record what I've got.
4067 (lookup_pixel_color, check_image_size): Remove redundant decls.
4068 (check_image_size): Don't assume that arbitrary EMACS_INT values
4069 fit in 'int', or that arbitrary 'double' values fit in 'int'.
4070 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
4071 (tiff_load, imagemagick_load_image):
4072 Check for overflow in size calculations.
4073 (x_create_x_image_and_pixmap): Remove unnecessary test for
4074 xmalloc returning NULL; that can't happen.
4075 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
4076 (xpm_color_bucket): Use better integer hashing function.
4077 (xpm_cache_color): Don't possibly over-allocate memory.
4078 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
4079 (gif_memory_source):
4080 Use ptrdiff_t, not int or size_t, to record sizes.
4081 (png_load): Don't assume values greater than 2**31 fit in 'int'.
4082 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
4083 either works, as we prefer signed integers.
4084 (tiff_read_from_memory, tiff_write_from_memory):
4085 Return tsize_t, not size_t, since that's what the TIFF API wants.
4086 (tiff_read_from_memory): Don't fail simply because the read would
4087 go past EOF; instead, return a short read.
4088 (tiff_load): Omit no-longer-needed casts.
4089 (Fimagemagick_types): Don't assume size fits into 'int'.
4090
4091 Improve hashing quality when configured --with-wide-int.
4092 * fns.c (hash_string): New function, taken from sxhash_string.
4093 Do not discard information about ASCII character case; this
4094 discarding is no longer needed.
4095 (sxhash-string): Use it. Change sig to match it. Caller changed.
4096 * lisp.h: Declare it.
4097 * lread.c (hash_string): Remove, since we now use fns.c's version.
4098 The fns.c version returns a wider integer if --with-wide-int is
4099 specified, so this should help the quality of the hashing a bit.
4100
4101 * emacs.c: Integer overflow minor fix.
4102 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
4103 Define only if GNU_LINUX.
4104 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
4105
4106 * dispnew.c: Integer signedness and overflow fixes.
4107 Remove unnecessary forward decls, that were a maintenance hassle.
4108 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
4109 All uses changed.
4110 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
4111 (scrolling_window): Use ptrdiff_t, not int, for byte count.
4112 (prepare_desired_row, line_draw_cost):
4113 Use int, not unsigned, where either works.
4114 (save_current_matrix, restore_current_matrix):
4115 Use ptrdiff_t, not size_t, where either works.
4116 (init_display): Check for overflow more accurately, and without
4117 relying on undefined behavior.
4118
4119 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
4120 Remove, replacing with the new symbols in lisp.h. All uses changed.
4121 * fileio.c (make_temp_name):
4122 * filelock.c (lock_file_1, lock_file):
4123 * xdisp.c (message_dolog):
4124 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
4125 Use pMd etc. instead.
4126 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
4127 replacing the pWIDE etc. symbols removed from editfns.c.
4128
4129 * keyboard.h (num_input_events): Now uintmax_t.
4130 This is (very slightly) less likely to mess up due to wraparound.
4131 All uses changed.
4132
4133 * buffer.c: Integer signedness fixes.
4134 (alloc_buffer_text, enlarge_buffer_text):
4135 Use ptrdiff_t rather than size_t when either will do, as we prefer
4136 signed integers.
4137
4138 * alloc.c: Integer signedness and overflow fixes.
4139 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
4140 (__malloc_size_t): Default to size_t, not to int.
4141 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
4142 (Fgarbage_collect, mark_object_loop_halt, mark_object):
4143 Prefer ptrdiff_t to size_t when either would do, as we prefer
4144 signed integers.
4145 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
4146 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
4147 Now const. Initialize with values that are in range even if char
4148 is signed.
4149 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
4150 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
4151 These functions do the right thing with sizes > 2**32.
4152 (check_depth): Now ptrdiff_t, not int.
4153 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
4154 Adjust to new way of storing sizes. Check for size overflow bugs
4155 in rest of code.
4156 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
4157 slightly wrong anyway, as it missed one instance of
4158 XMALLOC_OVERRUN_CHECK_OVERHEAD.
4159 (refill_memory_reserve): Omit needless cast to size_t.
4160 (mark_object_loop_halt): Mark as externally visible.
4161
4162 * xselect.c: Integer signedness and overflow fixes.
4163 (Fx_register_dnd_atom, x_handle_dnd_message):
4164 Use ptrdiff_t, not size_t, since we prefer signed.
4165 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
4166 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
4167 x_dnd_atoms_size and x_dnd_atoms_length.
4168
4169 * doprnt.c: Prefer signed to unsigned when either works.
4170 * eval.c (verror):
4171 * doprnt.c (doprnt):
4172 * lisp.h (doprnt):
4173 * xdisp.c (vmessage):
4174 Use ptrdiff_t, not size_t, when using or implementing doprnt,
4175 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
4176 prefer signed arithmetic to avoid comparison confusion.
4177 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
4178 but is a bit tricky.
4179
4180 Assume freestanding C89 headers, string.h, stdlib.h.
4181 * data.c, doprnt.c, floatfns.c, print.c:
4182 Include float.h unconditionally.
4183 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
4184 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
4185 * regex.c: Likewise for stddef.h, string.h.
4186 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
4187 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
4188 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
4189 (STDC_HEADERS): Remove obsolete defines.
4190 * sysdep.c: Include limits.h unconditionally.
4191
4192 Assume support for memcmp, memcpy, memmove, memset.
4193 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
4194 * regex.c (memcmp, memcpy):
4195 Remove; we assume C89 now.
4196
4197 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
4198 (__malloc_safe_bcopy): Remove; no longer needed.
4199
4200 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
4201 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
4202 well either way, and we prefer signed to unsigned.
4203
4204 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
4205
4206 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
4207 closes the connection while we're reading (bug#9182).
4208
4209 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
4210
4211 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
4212 are specified (Bug#9168).
4213
4214 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
4215
4216 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
4217 Found by GCC static checking and --with-wide-int on a 32-bit host.
4218
4219 2011-07-25 Eli Zaretskii <eliz@gnu.org>
4220
4221 * xdisp.c (compute_display_string_pos): Fix logic of caching
4222 previous display string position. Initialize cached_prev_pos to
4223 -1. Fixes slow-down at the beginning of a buffer.
4224
4225 2011-07-24 Eli Zaretskii <eliz@gnu.org>
4226
4227 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
4228 for attrs[LFACE_FONTSET_INDEX].
4229
4230 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
4231
4232 * xml.c (parse_region): Remove unused local
4233 that was recently introduced.
4234
4235 2011-07-23 Eli Zaretskii <eliz@gnu.org>
4236
4237 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
4238 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
4239
4240 * xdisp.c (move_it_in_display_line_to): Record the best matching
4241 position for TO_CHARPOS while scanning the line, and restore it on
4242 exit if none of the characters scanned was an exact match.
4243 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
4244 when exact match is impossible due to invisible text, and the
4245 lines are truncated.
4246
4247 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
4248
4249 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
4250 for OSX >= 10.7.
4251
4252 2011-07-22 Eli Zaretskii <eliz@gnu.org>
4253
4254 Fix a significant slow-down of cursor motion with C-n, C-p,
4255 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
4256 auto-repeat under bidi redisplay in fontified buffers.
4257 * xdisp.c (compute_stop_pos_backwards): New function.
4258 (next_element_from_buffer): Call compute_stop_pos_backwards to
4259 find a suitable prev_stop when we find ourselves before
4260 base_level_stop.
4261 (reseat): Don't look for prev_stop, as that could mean a very long
4262 run.
4263 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
4264 <cached_disp_overlay_modiff>: Cache for last found display string
4265 position.
4266 (compute_display_string_pos): Return the cached position if asked
4267 about the same buffer in the same area of character positions, and
4268 the buffer wasn't changed since the time the display string
4269 position was cached.
4270
4271 2011-07-22 Eli Zaretskii <eliz@gnu.org>
4272
4273 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
4274 is an integer, which is important for empty lines. (Bug#9149)
4275
4276 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
4277
4278 * frame.c (Fmodify_frame_parameters): In tty case, update the
4279 default face if necessary (Bug#4238).
4280
4281 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
4282
4283 * editfns.c (Fstring_to_char): No need to explain what a character
4284 is in the docstring (Bug#6576).
4285
4286 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
4287
4288 * xml.c (parse_region): Make sure we always return a tree.
4289
4290 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
4291
4292 * xml.c (parse_region): If a document contains only comments,
4293 return that, too.
4294
4295 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
4296
4297 * xml.c (make_dom): Return comments, too.
4298
4299 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
4300
4301 Port to OpenBSD.
4302 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
4303 and the surrounding thread.
4304 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
4305 rather than fgets, and retry after EINTR. Otherwise, 'emacs
4306 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
4307 timer goes off.
4308 * s/openbsd.h (BROKEN_SIGIO): Define.
4309 * unexelf.c (unexec) [__OpenBSD__]:
4310 Don't update the .mdebug section of the Alpha COFF symbol table.
4311
4312 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
4313
4314 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
4315 (bug#8460).
4316
4317 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
4318
4319 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
4320 This fixes some race conditions on the permissions of any newly
4321 created file.
4322
4323 * alloc.c (valid_pointer_p): Use pipe, not open.
4324 This fixes some permissions issues when debugging.
4325
4326 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
4327 If fchown fails to set both uid and gid, try to set just gid,
4328 as that is sometimes allowed. Adjust the file's mode to eliminate
4329 setuid or setgid bits that are inappropriate if fchown fails.
4330
4331 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4332
4333 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
4334 to compare Lisp_Objects.
4335 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
4336 global_gnutls_log_level, don't mistake it for a Lisp_Object.
4337 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
4338
4339 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
4340
4341 * lread.c (read_integer): Unread even EOF character.
4342 (read1): Likewise. Properly record start position of symbol.
4343
4344 * lread.c (read1): Read `#:' as empty uninterned symbol if no
4345 symbol character follows.
4346
4347 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
4348
4349 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
4350 This works around a problem with the previous change to Fcopy_file.
4351 Recent glibc declares fchown with __attribute__((warn_unused_result)),
4352 and without this change, GCC might complain about discarding
4353 fchown's return value.
4354
4355 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
4356
4357 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
4358
4359 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
4360
4361 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
4362
4363 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
4364
4365 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
4366 it's used from the C level.
4367
4368 * process.c: Use the same condition for POLL_FOR_INPUT in both
4369 keyboard.c and process.c (bug#1858).
4370
4371 2011-07-09 Lawrence Mitchell <wence@gmx.li>
4372
4373 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
4374 (Fgnutls_boot): Use it.
4375
4376 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
4377
4378 * doc.c (Fsubstitute_command_keys): Revert last change.
4379
4380 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
4381
4382 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
4383 quotes the next character, and doesn't affect other longer
4384 sequences (bug#8935).
4385
4386 * lread.c (syms_of_lread): Clarify that is isn't only
4387 `eval-buffer' and `eval-defun' that's affected by
4388 `lexical-binding' (bug#8460).
4389
4390 2011-07-15 Eli Zaretskii <eliz@gnu.org>
4391
4392 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
4393 bidi redisplay when a line includes both an image and is truncated.
4394
4395 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
4396
4397 Fix minor problems found by static checking.
4398 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
4399 (elsz): Now a signed constant, not a size_t var. We prefer signed
4400 types to unsigned, to avoid integer comparison confusion. Without
4401 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
4402 "cannot optimize loop, the loop counter may overflow", a symptom
4403 of the confusion.
4404 * indent.c (Fvertical_motion): Mark locals as initialized.
4405 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
4406
4407 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
4408
4409 * search.c (Fre_search_backward): Mention `case-fold-search' in
4410 all the re_search_* functions (bug#8138).
4411
4412 * keyboard.c (Fopen_dribble_file): Document when the file is
4413 closed (bug#8056).
4414
4415 2011-07-14 Eli Zaretskii <eliz@gnu.org>
4416
4417 * bidi.c (bidi_dump_cached_states): Fix format of displaying
4418 bidi_cache_idx.
4419
4420 Support bidi reordering of display and overlay strings.
4421 * xdisp.c (compute_display_string_pos)
4422 (compute_display_string_end): Accept additional argument STRING.
4423 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
4424 (reseat_to_string): Initialize bidi_it->string.s and
4425 bidi_it->string.schars.
4426 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
4427 NULL (avoids a crash in bidi_paragraph_init).
4428 Initialize itb.string.lstring.
4429 (init_iterator): Call bidi_init_it only of a valid
4430 buffer position was specified. Initialize paragraph_embedding to
4431 L2R.
4432 (reseat_to_string): Initialize the bidi iterator.
4433 (display_string): If we need to ignore text properties of
4434 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
4435 original value of -1 will not work with bidi.)
4436 (compute_display_string_pos): First arg is now struct
4437 `text_pos *'; all callers changed. Support display properties on
4438 Lisp strings.
4439 (compute_display_string_end): Support display properties on Lisp
4440 strings.
4441 (init_iterator, reseat_1, reseat_to_string): Initialize the
4442 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
4443 when iterating on a string not from display properties).
4444 (compute_display_string_pos, compute_display_string_end):
4445 Fix calculation of the object to scan. Fixes an error when using
4446 arrow keys.
4447 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
4448 base_level_stop; instead, set base_level_stop to BEGV.
4449 Fixes crashes in vertical-motion.
4450 (next_element_from_buffer): Improve commentary for when
4451 the iterator is before prev_stop.
4452 (init_iterator): Initialize bidi_p from the default value of
4453 bidi-display-reordering, not from buffer-local value. Use the
4454 buffer-local value only if initializing for buffer iteration.
4455 (handle_invisible_prop): Support invisible properties on strings
4456 that are being bidi-reordered.
4457 (set_iterator_to_next): Support bidi reordering of C strings and
4458 Lisp strings.
4459 (next_element_from_string): Support bidi reordering of Lisp
4460 strings.
4461 (handle_stop_backwards): Support Lisp strings as well.
4462 (display_string): Support display of R2L glyph rows.
4463 Use IT_STRING_CHARPOS when displaying from a Lisp string.
4464 (init_iterator): Don't initialize it->bidi_p for strings
4465 here.
4466 (reseat_to_string): Initialize it->bidi_p for strings here.
4467 (next_element_from_string, next_element_from_c_string)
4468 (next_element_from_buffer): Add xassert's for correspondence
4469 between IT's object being iterated and it->bidi_it.string
4470 structure.
4471 (face_before_or_after_it_pos): Support bidi iteration.
4472 (next_element_from_c_string): Handle the case of the first string
4473 character that is not the first one in the visual order.
4474 (get_visually_first_element): New function, refactored from common
4475 parts of next_element_from_buffer, next_element_from_string, and
4476 next_element_from_c_string.
4477 (tool_bar_lines_needed, redisplay_tool_bar)
4478 (display_menu_bar): Force left-to-right direction. Add a FIXME
4479 comment for making that be controlled by a user option.
4480 (push_it, pop_it): Save and restore the state of the
4481 bidi iterator. Save and restore the bidi_p flag.
4482 (pop_it): Iterate out of display property for string iteration as
4483 well.
4484 (iterate_out_of_display_property): Support iteration over strings.
4485 (handle_single_display_spec): Set up it->bidi_it for iteration
4486 over a display string, and call bidi_init_it.
4487 (handle_single_display_spec, next_overlay_string)
4488 (get_overlay_strings_1, push_display_prop): Set up the bidi
4489 iterator for displaying display or overlay strings.
4490 (forward_to_next_line_start): Don't use the shortcut if
4491 bidi-iterating.
4492 (back_to_previous_visible_line_start): If handle_display_prop
4493 pushed the iterator stack, restore the internal state of the bidi
4494 iterator by calling bidi_pop_it same number of times.
4495 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
4496 and we are bidi-iterating, don't decrement the iterator position;
4497 instead, set the first_elt flag in the bidi iterator, to produce
4498 the same effect.
4499 (reseat_1): Remove redundant setting of string_from_display_prop_p.
4500 (push_display_prop): xassert that we are iterating a buffer.
4501 (push_it, pop_it): Save and restore paragraph_embedding member.
4502 (handle_single_display_spec, next_overlay_string)
4503 (get_overlay_strings_1, reseat_1, reseat_to_string)
4504 (push_display_prop): Set up the `unibyte' member of bidi_it.string
4505 correctly. Don't assume unibyte strings are not bidi-reordered.
4506 (compute_display_string_pos)
4507 (compute_display_string_end): Fix handling the case of C string.
4508 (push_it, pop_it): Save and restore from_disp_prop_p.
4509 (handle_single_display_spec, push_display_prop): Set the
4510 from_disp_prop_p flag.
4511 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
4512 (pop_it): Call iterate_out_of_display_property only if we are
4513 popping after iteration over a string that came from a display
4514 property. Fix a typo in popping stretch info. Add an assertion
4515 for verifying that the iterator position is in sync with the bidi
4516 iterator.
4517 (handle_single_display_spec, get_overlay_strings_1)
4518 (push_display_prop): Fix initialization of paragraph direction for
4519 string when that of the parent object is not yet determined.
4520 (reseat_1): Call bidi_init_it to resync the bidi
4521 iterator with IT's position. (Bug#7616)
4522 (find_row_edges): If ROW->start.pos gives position
4523 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
4524 (handle_stop, back_to_previous_visible_line_start, reseat_1):
4525 Reset the from_disp_prop_p flag.
4526 (SAVE_IT, RESTORE_IT): New macros.
4527 (pos_visible_p, face_before_or_after_it_pos)
4528 (back_to_previous_visible_line_start)
4529 (move_it_in_display_line_to, move_it_in_display_line)
4530 (move_it_to, move_it_vertically_backward, move_it_by_lines)
4531 (try_scrolling, redisplay_window, display_line): Use them when
4532 saving a temporary copy of the iterator and restoring it back.
4533 (back_to_previous_visible_line_start, reseat_1)
4534 (init_iterator): Empty the bidi cache "stack".
4535 (move_it_in_display_line_to): If iterator ended up at
4536 EOL, but we never saw any buffer positions smaller than
4537 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
4538 motion in bidi-reordered lines.
4539 (move_it_in_display_line_to): Record prev_method and prev_pos
4540 immediately before the call to set_iterator_to_next. Fixes cursor
4541 motion in bidi-reordered lines with stretch glyphs and strings
4542 displayed in margins. (Bug#8133) (Bug#8867)
4543 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
4544 TO_CHARPOS.
4545 (pos_visible_p): Support positions in bidi-reordered lines.
4546 Save and restore bidi cache.
4547
4548 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
4549 (bidi_paragraph_info): Delete unused struct.
4550 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
4551 (bidi_cache_start): New variable.
4552 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
4553 to zero.
4554 (bidi_cache_fetch_state, bidi_cache_search)
4555 (bidi_cache_find_level_change, bidi_cache_iterator_state)
4556 (bidi_cache_find, bidi_peek_at_next_level)
4557 (bidi_level_of_next_char, bidi_find_other_level_edge)
4558 (bidi_move_to_visually_next): Compare cache index with
4559 bidi_cache_start rather than with zero.
4560 (bidi_fetch_char): Accept new argument STRING; all callers
4561 changed. Support iteration over a string. Support strings with
4562 display properties. Support unibyte strings. Fix the type of
4563 `len' according to what STRING_CHAR_AND_LENGTH expects.
4564 (bidi_paragraph_init, bidi_resolve_explicit_1)
4565 (bidi_resolve_explicit, bidi_resolve_weak)
4566 (bidi_level_of_next_char, bidi_move_to_visually_next):
4567 Support iteration over a string.
4568 (bidi_set_sor_type, bidi_resolve_explicit_1)
4569 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
4570 can now be zero (for strings); special values 0 and -1 were
4571 changed to -1 and -2, respectively.
4572 (bidi_char_at_pos): New function.
4573 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
4574 Call it instead of FETCH_MULTIBYTE_CHAR.
4575 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
4576 initialized to valid values.
4577 (bidi_init_it): Don't initialize charpos and bytepos with invalid
4578 values.
4579 (bidi_level_of_next_char): Allow the sentinel "position" to pass
4580 the test for valid cached positions. Fix the logic for looking up
4581 the sentinel state in the cache. GCPRO the Lisp string we are
4582 iterating.
4583 (bidi_push_it, bidi_pop_it): New functions.
4584 (bidi_initialize): Initialize the bidi cache start stack pointer.
4585 (bidi_cache_ensure_space): New function, refactored from part of
4586 bidi_cache_iterator_state. Don't assume the required size is just
4587 one BIDI_CACHE_CHUNK away.
4588 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
4589 (bidi_count_bytes, bidi_char_at_pos): New functions.
4590 (bidi_cache_search): Don't assume bidi_cache_last_idx is
4591 always valid if bidi_cache_idx is valid.
4592 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
4593 is valid if it's going to be used.
4594 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
4595 (bidi_cache_fetch_state, bidi_cache_search)
4596 (bidi_cache_find_level_change, bidi_cache_ensure_space)
4597 (bidi_cache_iterator_state, bidi_cache_find)
4598 (bidi_find_other_level_edge, bidi_cache_start_stack):
4599 All variables related to cache indices are now EMACS_INT.
4600
4601 * dispextern.h (struct bidi_string_data): New structure.
4602 (struct bidi_it): New member `string'. Make flag members be 1-bit
4603 fields, and put them last in the struct.
4604 (compute_display_string_pos, compute_display_string_end):
4605 Update prototypes.
4606 (bidi_push_it, bidi_pop_it): Add prototypes.
4607 (struct iterator_stack_entry): New members bidi_p,
4608 paragraph_embedding, and from_disp_prop_p.
4609 (struct it): Member bidi_p is now a bit field 1 bit wide.
4610 (bidi_shelve_cache, bidi_unshelve_cache):
4611 Declare prototypes.
4612
4613 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
4614 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
4615 and vector-like objects.
4616
4617 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
4618 cache around display iteration.
4619
4620 * window.c (Fwindow_end, window_scroll_pixel_based)
4621 (displayed_window_lines, Frecenter): Save and restore the bidi
4622 cache around display iteration.
4623
4624 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
4625
4626 * editfns.c (Fdelete_region): Clarify the use of the named
4627 parameters (bug#6788).
4628
4629 2011-07-14 Martin Rudalics <rudalics@gmx.at>
4630
4631 * indent.c (Fvertical_motion): Set and restore w->pointm when
4632 saving and restoring the window's buffer (Bug#9006).
4633
4634 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
4635
4636 * editfns.c (Fstring_to_char): Clarify just what is returned
4637 (bug#6576). Text by Eli Zaretskii.
4638
4639 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
4640
4641 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
4642
4643 2011-07-13 Eli Zaretskii <eliz@gnu.org>
4644
4645 * buffer.c (mmap_find): Fix a typo.
4646
4647 2011-07-13 Johan Bockgård <bojohan@gnu.org>
4648
4649 Fix execution of x selection hooks.
4650 * xselect.c (Qx_lost_selection_functions)
4651 (Qx_sent_selection_functions): New vars.
4652 (syms_of_xselect): DEFSYM them.
4653 (x_handle_selection_request): Pass Qx_sent_selection_functions
4654 rather than Vx_sent_selection_functions to Frun_hook_with_args.
4655 (x_handle_selection_clear,x_clear_frame_selections):
4656 Pass Qx_lost_selection_functions rather than
4657 Vx_lost_selection_functions to Frun_hook_with_args.
4658
4659 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
4660
4661 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
4662 The old code sometimes used this field without initializing it.
4663
4664 * alloc.c (gc_sweep): Don't read past end of array.
4665 In theory, the old code could also have corrupted Emacs internals,
4666 though it'd be very unlikely.
4667
4668 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
4669
4670 * character.c (Fcharacterp): Don't advertise optional ignored
4671 argument. (Bug#4026)
4672
4673 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
4674
4675 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
4676 key" (bug#4257).
4677
4678 * window.c (Fset_window_start): Doc fix (bug#4199).
4679 (Fset_window_hscroll): Ditto.
4680
4681 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
4682
4683 Fix minor new problems caught by GCC 4.6.1.
4684 * term.c (init_tty): Remove unused local.
4685 * xsettings.c (store_monospaced_changed): Define this function only
4686 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
4687 not used otherwise.
4688
4689 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
4690
4691 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
4692
4693 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
4694
4695 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
4696 are the mini-buffer and the echo area (bug#3320).
4697
4698 * term.c (init_tty): Remove support for supdup, c10 and perq
4699 terminals, which are no longer supported (bug#1482).
4700
4701 2011-07-10 Johan Bockgård <bojohan@gnu.org>
4702
4703 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
4704
4705 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
4706
4707 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
4708 for non-popups (Bug#3642).
4709
4710 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
4711
4712 * alloc.c (reset_malloc_hooks): Protoize.
4713 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
4714 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
4715 * cm.c (losecursor): Likewise.
4716 * data.c (fmod): Likewise.
4717 * dispnew.c (swap_glyphs_in_rows): Likewise.
4718 * emacs.c (memory_warning_signal): Likewise.
4719 * floatfns.c (float_error): Likewise.
4720 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
4721 (otf_open, font_otf_capability, generate_otf_features)
4722 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
4723 Likewise.
4724 * image.c (pbm_read_file): Likewise.
4725 * indent.c (string_display_width): Likewise.
4726 * intervals.c (check_for_interval, search_for_interval)
4727 (inc_interval_count, count_intervals, root_interval)
4728 (adjust_intervals_for_insertion, make_new_interval): Likewise.
4729 * lread.c (defalias): Likewise.
4730 * ralloc.c (r_alloc_check): Likewise.
4731 * regex.c (set_image_of_range_1, set_image_of_range)
4732 (regex_grow_registers): Likewise.
4733 * sysdep.c (strerror): Likewise.
4734 * termcap.c (valid_filename_p, tprint, main): Likewise.
4735 * tparam.c (main): Likewise.
4736 * unexhp9k800.c (run_time_remap, save_data_space)
4737 (update_file_ptrs, read_header, write_header, calculate_checksum)
4738 (copy_file, copy_rest, display_header): Likewise.
4739 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
4740 Likewise.
4741 * xdisp.c (check_it): Likewise.
4742 * xfaces.c (register_color, unregister_color, unregister_colors):
4743 Likewise.
4744 * xfns.c (print_fontset_result): Likewise.
4745 * xrdb.c (member, fatal, main): Likewise.
4746
4747 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
4748
4749 Fix minor problems found by static checking (Bug#9031).
4750 * chartab.c (char_table_set_range, map_sub_char_table):
4751 Remove unused locals.
4752 (uniprop_table): Now static.
4753 * composite.c (_work_char): Remove unused static var.
4754
4755 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
4756
4757 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
4758
4759 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
4760
4761 * gtkutil.c (qttip_cb): Remove code without function.
4762
4763 2011-07-09 Eli Zaretskii <eliz@gnu.org>
4764
4765 * w32.c (pthread_sigmask): New stub.
4766
4767 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
4768
4769 Use pthread_sigmask, not sigprocmask (Bug#9010).
4770 sigprocmask is portable only for single-threaded applications, and
4771 Emacs can be multi-threaded when it uses GTK.
4772 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
4773 (LIBES): Use it.
4774 * callproc.c (Fcall_process):
4775 * process.c (create_process):
4776 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
4777 Use pthread_sigmask, not sigprocmask.
4778
4779 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
4780
4781 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
4782 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
4783 wrong (Bug#8591).
4784
4785 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
4786
4787 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
4788 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
4789 (xg_hide_tooltip): Fix comment.
4790
4791 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
4792 in registerServicesMenuSendTypes.
4793 (validRequestorForSendType): Don't check ns_return_types.
4794
4795 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
4796 ns_return_type.
4797
4798 2011-07-08 Jason Rumney <jasonr@gnu.org>
4799
4800 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
4801 SH_SHOW for hidden windows (Bug#5482).
4802
4803 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
4804 frame struct members of non-existent frames (Bug#6284).
4805
4806 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
4807
4808 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
4809 variable firstTime not needed on OSX >= 10.6.
4810 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
4811 >= 10.5. Use setKnobProportion, setDoubleValue.
4812
4813 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
4814 (MAC_OS_X_VERSION_10_5): Define if not defined.
4815 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
4816 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
4817 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
4818
4819 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
4820 cString and lossyCString on OSX >= 10.4
4821
4822 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4823 sizeToFit on OSX >= 10.2.
4824
4825 * nsimage.m (allocInitFromFile): Don't use deprecated method
4826 bestRepresentationForDevice on OSX >= 10.6.
4827
4828 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
4829 to avoid warning.
4830
4831 * emacs.c: Declare unexec_init_emacs_zone.
4832
4833 * nsgui.h: Fix compiler warning about gnulib redefining verify.
4834
4835 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
4836
4837 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
4838 on svcsMenu (Bug#8842).
4839
4840 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
4841 ns_return_types.
4842 (Fns_list_services): Just return Qnil on 10.6, code not working there.
4843
4844 * nsterm.m (QUTF8_STRING): Declare.
4845 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
4846 (validRequestorForSendType): Return type is (id).
4847 Change indexOfObjectIdenticalTo to indexOfObject.
4848 Check if we have local selection before returning self (Bug#8842).
4849 (writeSelectionToPasteboard): Put local selection into paste board
4850 if we have a local selection (Bug#8842).
4851 (syms_of_nsterm): DEFSYM QUTF8_STRING.
4852
4853 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
4854 (ns_get_local_selection): Declare.
4855
4856 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
4857
4858 * keymap.c (describe_map_tree): Don't insert a double newline at
4859 the end of the buffer (bug#1169) and return whether we inserted
4860 something.
4861
4862 * callint.c (Fcall_interactively): Change "reading args" to
4863 "providing args" to try to clarify what it does (bug#1010).
4864
4865 2011-07-07 Kenichi Handa <handa@m17n.org>
4866
4867 * composite.c (composition_compute_stop_pos): Ignore a static
4868 composition starting before CHARPOS (Bug#8915).
4869
4870 * xdisp.c (handle_composition_prop): Likewise.
4871
4872 2011-07-07 Eli Zaretskii <eliz@gnu.org>
4873
4874 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
4875 (Bug#9015)
4876
4877 2011-07-07 Kenichi Handa <handa@m17n.org>
4878
4879 * character.h (unicode_category_t): New enum type.
4880
4881 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
4882 (Qchar_code_property_table): New variable.
4883 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
4884 (UNIPROP_COMPRESSED_FORM_P): New macros.
4885 (char_table_ascii): Uncompress the compressed values.
4886 (sub_char_table_ref): New arg is_uniprop. Callers changed.
4887 Uncompress the compressed values.
4888 (sub_char_table_ref_and_range): Likewise.
4889 (char_table_ref_and_range): Uncompress the compressed values.
4890 (sub_char_table_set): New arg is_uniprop. Callers changed.
4891 Uncompress the compressed values.
4892 (sub_char_table_set_range): Args changed. Callers changed.
4893 (char_table_set_range): Adjuted for the above change.
4894 (map_sub_char_table): Delete args default_val and parent. Add arg
4895 top. Give decoded values to a Lisp function.
4896 (map_char_table): Adjust for the above change. Give decoded
4897 values to a Lisp function. Gcpro more variables.
4898 (uniprop_table_uncompress)
4899 (uniprop_decode_value_run_length): New functions.
4900 (uniprop_decoder, uniprop_decoder_count): New variables.
4901 (uniprop_get_decoder, uniprop_encode_value_character)
4902 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
4903 New functions.
4904 (uniprop_encoder, uniprop_encoder_count): New variables.
4905 (uniprop_get_encoder, uniprop_table)
4906 (Funicode_property_table_internal, Fget_unicode_property_internal)
4907 (Fput_unicode_property_internal): New functions.
4908 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
4909 Sunicode_property_table_internal, Sget_unicode_property_internal,
4910 and Sput_unicode_property_internal. Defvar_lisp
4911 char-code-property-alist.
4912
4913 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
4914 Vunicode_category_table.
4915
4916 * font.c (font_range): Adjust for the change of
4917 Vunicode_category_table.
4918
4919 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
4920
4921 * m/iris4d.h: Remove file, move contents ...
4922 * s/irix6-5.h: ... here.
4923
4924 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
4925
4926 Remove unportable assumption about struct layout (Bug#8884).
4927 * alloc.c (mark_buffer):
4928 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
4929 (clone_per_buffer_values): Don't assume that
4930 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
4931 This isn't true in general, and it's particularly not true
4932 if Emacs is configured with --with-wide-int.
4933 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
4934 New macros, used in the buffer.c change.
4935
4936 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
4937
4938 * xsettings.c: Use both GConf and GSettings if both are available.
4939 (store_config_changed_event): Add comment.
4940 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
4941 (store_tool_bar_style_changed): New functions.
4942 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
4943 (struct xsettings): Move font inside HAVE_XFT.
4944 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
4945 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
4946 Move inside HAVE_XFT.
4947 (something_changed_gsettingsCB): Rename from something_changedCB.
4948 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
4949 also.
4950 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
4951 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
4952 (something_changed_gconfCB): Rename from something_changedCB.
4953 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
4954 (parse_settings): Move check for font inside HAVE_XFT.
4955 (read_settings, apply_xft_settings): Add comment.
4956 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
4957 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
4958 call store_font_name_changed.
4959 (xft_settings_event): Add comment.
4960 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
4961 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
4962 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
4963 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
4964 (xsettings_initialize): Call init_gsettings last.
4965 (xsettings_get_system_font, xsettings_get_system_normal_font):
4966 Add comment.
4967
4968 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
4969
4970 Random fixes. E.g., (random) never returned negative values.
4971 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
4972 subseconds part to the entropy, as that's a bit more random.
4973 Prefer signed to unsigned, since the signedness doesn't matter and
4974 in general we prefer signed. When given a limit, use a
4975 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
4976 latter isn't right if USE_2_TAGS_FOR_INTS.
4977 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
4978 not 0..VALMASK. Don't discard "excess" bits that random () returns.
4979
4980 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
4981
4982 * textprop.c (text_property_stickiness):
4983 Obey Vtext_property_default_nonsticky.
4984 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
4985 * w32fns.c (syms_of_w32fns):
4986 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
4987
4988 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
4989
4990 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
4991 This is more efficient than Ffile_directory_p and avoids a minor race.
4992
4993 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
4994
4995 * buffer.c (Foverlay_put): Say what the return value is
4996 (bug#7835).
4997
4998 * fileio.c (barf_or_query_if_file_exists): Check first if the file
4999 is a directory before asking whether to use the file name
5000 (bug#7564).
5001 (barf_or_query_if_file_exists): Make the "File is a directory"
5002 error be more correct.
5003
5004 * fns.c (Frequire): Remove the mention of the .gz files, since
5005 that's installation-specific, but keep the mention of
5006 `get-load-suffixes'.
5007
5008 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
5009
5010 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
5011 Report string overflow if the output is too long.
5012
5013 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
5014
5015 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
5016 (syms_of_gnutls): Remove duplicate DEFSYM for
5017 Qgnutls_bootprop_verify_hostname_error, an error for
5018 Qgnutls_bootprop_verify_error (which is no longer used).
5019
5020 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
5021 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
5022 Also (re)move comments that are misplaced or no longer relevant.
5023
5024 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
5025
5026 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
5027
5028 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
5029
5030 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
5031 and background color parameters if they have been changed.
5032
5033 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
5034
5035 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
5036
5037 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
5038
5039 * xsettings.c (SYSTEM_FONT): Define only when used.
5040 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
5041
5042 * keymap.c (access_keymap_1): Now static.
5043
5044 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
5045
5046 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
5047 leave any prefix arg for the up event (Bug#1586).
5048
5049 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
5050
5051 * lread.c (syms_of_lread): Mention single symbols defined by
5052 `defvar' or `defconst' (bug#7154).
5053
5054 * fns.c (Frequire): Mention .el.gz files (bug#7314).
5055 (Frequire): Mention get-load-suffixes.
5056
5057 2011-07-02 Martin Rudalics <rudalics@gmx.at>
5058
5059 * window.h (window): Remove clone_number slot.
5060 * window.c (Fwindow_clone_number, Fset_window_clone_number):
5061 Remove.
5062 (make_parent_window, make_window, saved_window)
5063 (Fset_window_configuration, save_window_save): Don't deal with
5064 clone numbers.
5065 * buffer.c (Qclone_number): Remove declaration.
5066 (sort_overlays, overlay_strings): Don't deal with clone numbers.
5067
5068 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
5069
5070 Add multiple inheritance to keymaps.
5071 * keymap.c (Fmake_composed_keymap): New function.
5072 (Fset_keymap_parent): Simplify.
5073 (fix_submap_inheritance): Remove.
5074 (access_keymap_1): New function extracted from access_keymap to handle
5075 embedded parents and handle lists of maps.
5076 (access_keymap): Use it.
5077 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
5078 (Fcopy_keymap): Handle embedded parents.
5079 (Fcommand_remapping, define_as_prefix): Simplify.
5080 (Fkey_binding): Simplify.
5081 (syms_of_keymap): Move minibuffer-local-completion-map,
5082 minibuffer-local-filename-completion-map,
5083 minibuffer-local-must-match-map, and
5084 minibuffer-local-filename-must-match-map to Elisp.
5085 (syms_of_keymap): Defsubr make-composed-keymap.
5086 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
5087 (parse_menu_item): Trivial simplification.
5088
5089 2011-07-01 Glenn Morris <rgm@gnu.org>
5090
5091 * Makefile.in (SETTINGS_LIBS): Fix typo.
5092
5093 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
5094
5095 * coding.c (Fencode_coding_string): Record the last coding system
5096 used, as the function doc string says (bug#8738).
5097
5098 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
5099
5100 * xsettings.c (store_monospaced_changed): Take new font as arg and
5101 check for change against current_mono_font.
5102 (EMACS_TYPE_SETTINGS): Remove this and related defines.
5103 (emacs_settings_constructor, emacs_settings_get_property)
5104 (emacs_settings_set_property, emacs_settings_class_init)
5105 (emacs_settings_init, gsettings_obj): Remove.
5106 (something_changedCB): New function for HAVE_GSETTINGS.
5107 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
5108 with value as argument.
5109 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
5110 g_settings_new (Bug#8967). Do not create gsettings_obj.
5111 Remove calls to g_settings_bind. Connect something_changedCB to
5112 "changed".
5113
5114 * xgselect.c: Add defined (HAVE_GSETTINGS).
5115 (xgselect_initialize): Ditto.
5116
5117 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
5118 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
5119 xg_select.
5120
5121 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
5122
5123 * eval.c (struct backtrace): Simplify and port the data structure.
5124 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
5125 signed bit field, as this assumption is not portable and it makes
5126 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
5127 "char debug_on_exit : 1" as this is not portable either; instead,
5128 use the portable "unsigned int debug_on_exit : 1". Remove unused
5129 member evalargs. Remove obsolete comments about cc bombing out.
5130
5131 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
5132
5133 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
5134 Let HAVE_GSETTINGS override HAVE_GCONF.
5135 (store_monospaced_changed): New function.
5136 (EMACS_SETTINGS): A new type derived from GObject to handle
5137 GSettings notifications.
5138 (emacs_settings_constructor, emacs_settings_get_property)
5139 (emacs_settings_set_property, emacs_settings_class_init):
5140 New functions.
5141 (gsettings_client, gsettings_obj): New variables.
5142 (GSETTINGS_SCHEMA): New define.
5143 (something_changedCB): Call store_monospaced_changed.
5144 (init_gsettings): New function.
5145 (xsettings_initialize): Call init_gsettings.
5146 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
5147 to NULL.
5148
5149 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
5150 GCONF_CFLAGS/LIBS.
5151
5152 2011-06-29 Martin Rudalics <rudalics@gmx.at>
5153
5154 * window.c (resize_root_window, grow_mini_window)
5155 (shrink_mini_window): Rename Qresize_root_window to
5156 Qwindow_resize_root_window and Qresize_root_window_vertically to
5157 Qwindow_resize_root_window_vertically.
5158
5159 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
5160
5161 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
5162
5163 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
5164
5165 * makefile.w32-in: Redesign dependencies so they reflect more
5166 clearly which files are directly included by each source file,
5167 and not through other includes.
5168
5169 2011-06-27 Martin Rudalics <rudalics@gmx.at>
5170
5171 * buffer.c (Qclone_number): Declare static and DEFSYM it.
5172 (sort_overlays, overlay_strings): When an overlay's clone number
5173 matches the window's clone number process the overlay even if
5174 the overlay's window property doesn't match the current window.
5175
5176 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
5177 (Fwindow_hchild): Rename to Fwindow_left_child.
5178 (Fwindow_next): Rename to Fwindow_next_sibling.
5179 (Fwindow_prev): Rename to Fwindow_prev_sibling.
5180 (resize_window_check): Rename to window_resize_check.
5181 (resize_window_apply): Rename to window_resize_apply.
5182 (Fresize_window_apply): Rename to Fwindow_resize_apply.
5183 (Fdelete_other_windows_internal, resize_frame_windows)
5184 (Fsplit_window_internal, Fdelete_window_internal)
5185 (grow_mini_window, shrink_mini_window)
5186 (Fresize_mini_window_internal): Fix callers accordingly.
5187
5188 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
5189
5190 * emacsgtkfixed.h: State that this is only used with Gtk+3.
5191 (emacs_fixed_set_min_size): Remove.
5192 (emacs_fixed_new): Take frame as argument.
5193
5194 * emacsgtkfixed.c: State that this is only used with Gtk+3.
5195 (_EmacsFixedPrivate): Remove minwidth/height.
5196 Add struct frame *f.
5197 (emacs_fixed_init): Initialize priv->f.
5198 (get_parent_class, emacs_fixed_set_min_size): Remove.
5199 (emacs_fixed_new): Set priv->f to argument.
5200 (emacs_fixed_get_preferred_width)
5201 (emacs_fixed_get_preferred_height): Use min_width/height from
5202 frames size_hint to set minimum and natural (Bug#8919).
5203 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
5204 and use min_width/height from frames size_hint to set
5205 min_width/height (Bug#8919).
5206
5207 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
5208 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
5209 Fix indentation.
5210
5211 2011-06-26 Eli Zaretskii <eliz@gnu.org>
5212
5213 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
5214 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
5215 called at ZV.
5216
5217 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
5218
5219 * process.c (wait_reading_process_output): Bypass select if
5220 waiting for a cell while ignoring keyboard input, and input is
5221 pending. Suggested by Jan Djärv (Bug#8869).
5222
5223 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
5224
5225 Use gnulib's dup2 module instead of rolling our own.
5226 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
5227
5228 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5229
5230 * dispnew.c (scrolling_window): Before scrolling, turn off a
5231 mouse-highlight in the window being scrolled.
5232
5233 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
5234
5235 Move DEFSYM to lisp.h and use everywhere.
5236
5237 * character.h (DEFSYM): Move declaration...
5238 * lisp.h (DEFSYM): ...here.
5239
5240 * gnutls.c:
5241 * minibuf.c:
5242 * w32menu.c:
5243 * w32proc.c:
5244 * w32select.c: Don't include character.h.
5245
5246 * alloc.c (syms_of_alloc):
5247 * buffer.c (syms_of_buffer):
5248 * bytecode.c (syms_of_bytecode):
5249 * callint.c (syms_of_callint):
5250 * casefiddle.c (syms_of_casefiddle):
5251 * casetab.c (init_casetab_once):
5252 * category.c (init_category_once, syms_of_category):
5253 * ccl.c (syms_of_ccl):
5254 * cmds.c (syms_of_cmds):
5255 * composite.c (syms_of_composite):
5256 * dbusbind.c (syms_of_dbusbind):
5257 * dired.c (syms_of_dired):
5258 * dispnew.c (syms_of_display):
5259 * doc.c (syms_of_doc):
5260 * editfns.c (syms_of_editfns):
5261 * emacs.c (syms_of_emacs):
5262 * eval.c (syms_of_eval):
5263 * fileio.c (syms_of_fileio):
5264 * fns.c (syms_of_fns):
5265 * frame.c (syms_of_frame):
5266 * fringe.c (syms_of_fringe):
5267 * insdel.c (syms_of_insdel):
5268 * keymap.c (syms_of_keymap):
5269 * lread.c (init_obarray, syms_of_lread):
5270 * macros.c (syms_of_macros):
5271 * msdos.c (syms_of_msdos):
5272 * print.c (syms_of_print):
5273 * process.c (syms_of_process):
5274 * search.c (syms_of_search):
5275 * sound.c (syms_of_sound):
5276 * syntax.c (init_syntax_once, syms_of_syntax):
5277 * terminal.c (syms_of_terminal):
5278 * textprop.c (syms_of_textprop):
5279 * undo.c (syms_of_undo):
5280 * w32.c (globals_of_w32):
5281 * window.c (syms_of_window):
5282 * xdisp.c (syms_of_xdisp):
5283 * xfaces.c (syms_of_xfaces):
5284 * xfns.c (syms_of_xfns):
5285 * xmenu.c (syms_of_xmenu):
5286 * xsettings.c (syms_of_xsettings):
5287 * xterm.c (syms_of_xterm): Use DEFSYM.
5288
5289 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
5290
5291 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
5292
5293 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
5294
5295 Integer and buffer overflow fixes (Bug#8873).
5296
5297 * print.c (printchar, strout): Check for string overflow.
5298 (PRINTPREPARE, printchar, strout):
5299 Don't set size unless allocation succeeds.
5300
5301 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
5302 for sizes. Check for string overflow more accurately.
5303 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
5304
5305 * macros.c: Integer and buffer overflow fixes.
5306 * keyboard.h (struct keyboard.kbd_macro_bufsize):
5307 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
5308 Use ptrdiff_t, not int, for sizes.
5309 Don't increment bufsize until after realloc succeeds.
5310 Check for size-calculation overflow.
5311 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
5312
5313 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
5314
5315 * lread.c: Integer overflow fixes.
5316 (read_integer): Radix is now EMACS_INT, not int,
5317 to improve quality of diagnostics for out-of-range radices.
5318 Calculate buffer size correctly for out-of-range radices.
5319 (read1): Check for integer overflow in radices, and in
5320 read-circle numbers.
5321 (read_escape): Avoid int overflow.
5322 (Fload, openp, read_buffer_size, read1)
5323 (substitute_object_recurse, read_vector, read_list, map_obarray):
5324 Use ptrdiff_t, not int, for sizes.
5325 (read1): Use EMACS_INT, not int, for sizes.
5326 Check for size overflow.
5327
5328 * image.c (cache_image): Check for size arithmetic overflow.
5329
5330 * lread.c: Integer overflow issues.
5331 (saved_doc_string_size, saved_doc_string_length)
5332 (prev_saved_doc_string_size, prev_saved_doc_string_length):
5333 Now ptrdiff_t, not int.
5334 (read1): Don't assume doc string length fits in int. Check for
5335 out-of-range doc string lengths.
5336 (read_list): Don't assume file position fits in int.
5337 (read_escape): Check for hex character overflow.
5338
5339 2011-06-22 Leo Liu <sdl.web@gmail.com>
5340
5341 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
5342 Move to minibuffer.el.
5343
5344 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
5345
5346 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
5347 The following patches are for when GLYPH_DEBUG && !XASSERT.
5348 * dispextern.h (trace_redisplay_p, dump_glyph_string):
5349 * dispnew.c (flush_stdout):
5350 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
5351 Mark as externally visible.
5352 * dispnew.c (check_window_matrix_pointers): Now static.
5353 * dispnew.c (window_to_frame_vpos):
5354 * xfns.c (unwind_create_frame):
5355 * xterm.c (x_check_font): Remove unused local.
5356 * scroll.c (CHECK_BOUNDS):
5357 * xfaces.c (cache_fache): Rename local to avoid shadowing.
5358 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
5359 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
5360 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
5361 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
5362 Now static.
5363 (debug_method_add): Use va_list and vsprintf rather than relying
5364 on undefined behavior with wrong number of arguments.
5365 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
5366 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
5367 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
5368 since we're not interested in debugging glyphs with old libraries.
5369 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
5370 GCC 4.6.0's static checking.
5371
5372 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
5373
5374 Integer overflow and signedness fixes (Bug#8873).
5375 A few related buffer overrun fixes, too.
5376
5377 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
5378
5379 * dispextern.h (struct face.stipple):
5380 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
5381 (x_bitmap_mask, x_allocate_bitmap_record)
5382 (x_create_bitmap_from_data, x_create_bitmap_from_file)
5383 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
5384 (x_create_bitmap_from_xpm_data):
5385 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
5386 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
5387 (.bitmaps_last):
5388 * xfaces.c (load_pixmap):
5389 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
5390 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
5391 (.bitmaps_last, struct x_output.icon_bitmap):
5392 Use ptrdiff_t, not int, for bitmap indexes.
5393 (x_allocate_bitmap_record): Check for size overflow.
5394 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
5395
5396 Use ptrdiff_t, not int, for overlay counts.
5397 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
5398 * editfns.c (overlays_around, get_pos_property):
5399 * textprop.c (get_char_property_and_overlay):
5400 * xdisp.c (next_overlay_change, note_mouse_highlight):
5401 * xfaces.c (face_at_buffer_position):
5402 * buffer.c (OVERLAY_COUNT_MAX): New macro.
5403 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
5404 (Fnext_overlay_change, Fprevious_overlay_change)
5405 (mouse_face_overlay_overlaps, Foverlays_in):
5406 Use ptrdiff_t, not int, for sizes.
5407 (overlays_at, overlays_in): Check for size-calculation overflow.
5408
5409 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
5410
5411 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
5412 (x_session_initialize): Do not assume string length fits in int.
5413
5414 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
5415 This is unlikely, but can occur if DPI is outlandish.
5416
5417 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
5418 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
5419
5420 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
5421 * xrdb.c (magic_file_p, search_magic_path):
5422 Omit last arg SUFFIX; it was always 0. All callers changed.
5423 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
5424
5425 * xfont.c (xfont_match): Avoid need for strlen.
5426
5427 * xfns.c: Don't assume strlen fits in int.
5428 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
5429
5430 * xdisp.c (message_log_check_duplicate): Return intmax_t,
5431 not unsigned long, as we prefer signed integers. All callers changed.
5432 Detect integer overflow in repeat count.
5433 (message_dolog): Don't assume print length fits in 39 bytes.
5434 (display_mode_element): Don't assume strlen fits in int.
5435
5436 * termcap.c: Don't assume sizes fit in int and never overflow.
5437 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
5438 (gobble_line): Check for size-calculation overflow.
5439
5440 * minibuf.c (Fread_buffer):
5441 * lread.c (intern, intern_c_string):
5442 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
5443 Don't assume string length fits in int.
5444
5445 * keyboard.c (parse_tool_bar_item):
5446 * gtkutil.c (style_changed_cb): Avoid need for strlen.
5447
5448 * font.c: Don't assume string length fits in int.
5449 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
5450 Use ptrdiff_t, not int.
5451 (font_intern_prop): Don't assume string length fits in int.
5452 Don't assume integer property fits in fixnum.
5453 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
5454
5455 * filelock.c: Fix some buffer overrun and integer overflow issues.
5456 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
5457 Reformulate so as not to need the command string.
5458 Invoke gzip -cd rather than gunzip, as it's more portable.
5459 (lock_info_type, lock_file_1, lock_file):
5460 Don't assume pid_t and time_t fit in unsigned long.
5461 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
5462 (current_lock_owner): Prefer signed type for sizes.
5463 Use memcpy, not strncpy, where memcpy is what is really wanted.
5464 Don't assume (via atoi) that time_t and pid_t fit in int.
5465 Check for time_t and/or pid_t out of range, e.g., via a network share.
5466 Don't alloca where an auto var works fine.
5467
5468 * fileio.c: Fix some integer overflow issues.
5469 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
5470 Don't assume string length fits in int.
5471 (directory_file_name): Don't assume string length fits in long.
5472 (make_temp_name): Don't assume pid fits in int, or that its print
5473 length is less than 20.
5474
5475 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
5476
5477 * coding.c (make_subsidiaries): Don't assume string length fits in int.
5478
5479 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
5480
5481 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
5482 We prefer signed integers, even for size calculations.
5483
5484 * emacs.c: Don't assume string length fits in 'int'.
5485 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
5486 (main): Don't invoke strlen when not needed.
5487
5488 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
5489 (XD_DEBUG_MESSAGE): Don't waste a byte.
5490
5491 * callproc.c (getenv_internal_1, getenv_internal)
5492 (Fgetenv_internal):
5493 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
5494
5495 * lread.c (invalid_syntax): Omit length argument.
5496 All uses changed. This doesn't fix a bug, but it simplifies the
5497 code away from its former Hollerith-constant appearance, and it's
5498 one less 'int' to worry about when looking at integer-overflow issues.
5499 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
5500
5501 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
5502 This didn't break anything, but it didn't help either.
5503 It's confusing to put a bogus integer in a place where the actual
5504 value does not matter.
5505 (LIST_END_P): Remove unused macro and its bogus comment.
5506 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
5507
5508 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
5509 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
5510 implementation.
5511 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
5512 We prefer signed types, and the value cannot exceed the EMACS_INT
5513 range anyway (because otherwise the length would not be representable).
5514 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
5515 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
5516 This avoids a GCC warning when WIDE_EMACS_INT.
5517
5518 * indent.c (sane_tab_width): New function.
5519 (current_column, scan_for_column, Findent_to, position_indentation)
5520 (compute_motion): Use it. This is just for clarity.
5521 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
5522
5523 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
5524
5525 * lisp.h (lint_assume): New macro.
5526 * composite.c (composition_gstring_put_cache):
5527 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
5528
5529 * editfns.c, insdel.c:
5530 Omit unnecessary forward decls, to simplify future changes.
5531
5532 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
5533
5534 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
5535
5536 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
5537 Use much-faster test for byte-length change.
5538 Don't assume string byte-length fits in 'int'.
5539 Check that character arg fits in 'int'.
5540 (mapcar1): Declare byte as byte, for clarity.
5541
5542 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
5543
5544 * fns.c (concat): Catch string overflow earlier.
5545 Do not rely on integer wraparound.
5546
5547 * dispextern.h (struct it.overlay_strings_charpos)
5548 (struct it.selective): Now EMACS_INT, not int.
5549 * xdisp.c (forward_to_next_line_start)
5550 (back_to_previous_visible_line_start)
5551 (reseat_at_next_visible_line_start, next_element_from_buffer):
5552 Don't arbitrarily truncate the value of 'selective' to int.
5553
5554 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
5555
5556 * composite.c: Don't truncate sizes to 'int'.
5557 (composition_gstring_p, composition_reseat_it)
5558 (composition_adjust_point): Use EMACS_INT, not int.
5559 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
5560 not EMACS_UINT, for indexes.
5561
5562 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
5563
5564 * buffer.c: Include <verify.h>.
5565 (struct sortvec.priority, struct sortstr.priority):
5566 Now EMACS_INT, not int.
5567 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
5568 (struct sortstr.size, record_overlay_string)
5569 (struct sortstrlist.size, struct sortlist.used):
5570 Don't truncate size to int.
5571 (record_overlay_string): Check for size-calculation overflow.
5572 (init_buffer_once): Check at compile-time, not run-time.
5573
5574 2011-06-22 Jim Meyering <meyering@redhat.com>
5575
5576 Don't leak an XBM-image-sized buffer
5577 * image.c (xbm_load): Free the image buffer after using it.
5578
5579 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
5580
5581 Port to Sun C.
5582 * composite.c (find_automatic_composition): Omit needless 'return 0;'
5583 that Sun C diagnosed.
5584 * fns.c (secure_hash): Fix pointer signedness issue.
5585 * intervals.c (static_offset_intervals): New function.
5586 (offset_intervals): Use it.
5587
5588 2011-06-21 Leo Liu <sdl.web@gmail.com>
5589
5590 * deps.mk (fns.o):
5591 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
5592 sha512.h.
5593
5594 * fns.c (secure_hash): Rename from crypto_hash_function and change
5595 the first arg to accept symbols.
5596 (Fsecure_hash): New primitive.
5597 (syms_of_fns): New symbols.
5598
5599 2011-06-20 Deniz Dogan <deniz@dogan.se>
5600
5601 * process.c (Fset_process_buffer): Clarify return value in
5602 docstring.
5603
5604 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
5605
5606 * dispnew.c (add_window_display_history): Use BVAR.
5607
5608 * xdisp.c (debug_method_add): Use BVAR.
5609 (check_window_end, dump_glyph_matrix, dump_glyph)
5610 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
5611
5612 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
5613 Likewise.
5614
5615 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
5616 check till after the cache is created in init_frame_faces.
5617
5618 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
5619
5620 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
5621
5622 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
5623
5624 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
5625 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
5626 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
5627
5628 Improve buffer-overflow checking (Bug#8873).
5629 * fileio.c (Finsert_file_contents):
5630 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
5631 Remove the old (too-loose) buffer overflow checks.
5632 They weren't needed, since make_gap checks for buffer overflow.
5633 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
5634 The old code merely checked for Emacs fixnum overflow, and relied
5635 on undefined (wraparound) behavior. The new code avoids undefined
5636 behavior, and also checks for ptrdiff_t and/or size_t overflow.
5637
5638 * editfns.c (Finsert_char): Don't dump core with very negative counts.
5639 Tune. Don't use wider integers than needed. Don't use alloca.
5640 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
5641
5642 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
5643
5644 * insdel.c, lisp.h (buffer_overflow): New function.
5645 (insert_from_buffer_1, replace_range, replace_range_2):
5646 * insdel.c (make_gap_larger):
5647 * editfns.c (Finsert_char):
5648 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
5649
5650 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
5651
5652 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
5653
5654 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
5655
5656 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
5657 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
5658
5659 * fileio.c: Don't assume EMACS_INT fits in off_t.
5660 (emacs_lseek): New static function.
5661 (Finsert_file_contents, Fwrite_region): Use it.
5662 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
5663
5664 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
5665
5666 * fns.c: Don't overflow int when computing a list length.
5667 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
5668 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
5669 truncation on 64-bit hosts. Check for QUIT every
5670 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
5671 faster and is responsive enough.
5672 (Flength): Report an error instead of overflowing an integer.
5673 (Fsafe_length): Return a float if the value is not representable
5674 as a fixnum. This shouldn't happen except in contrived situations.
5675 (Fnthcdr, Fsort): Don't assume list length fits in int.
5676 (Fcopy_sequence): Don't assume vector length fits in int.
5677
5678 * alloc.c: Check that resized vectors' lengths fit in fixnums.
5679 (header_size, word_size): New constants.
5680 (allocate_vectorlike): Don't check size overflow here.
5681 (allocate_vector): Check it here instead, since this is the only
5682 caller of allocate_vectorlike that could cause overflow.
5683 Check that the new vector's length is representable as a fixnum.
5684
5685 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
5686 The previous code was bogus. For example, next_almost_prime (32)
5687 returned 39, which is undesirable as it is a multiple of 3; and
5688 next_almost_prime (24) returned 25, which is a multiple of 5 so
5689 why was the code bothering to check for multiples of 7?
5690
5691 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
5692
5693 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
5694
5695 Variadic C functions now count arguments with ptrdiff_t.
5696 This partly undoes my 2011-03-30 change, which replaced int with size_t.
5697 Back then I didn't know that the Emacs coding style prefers signed int.
5698 Also, in the meantime I found a few more instances where arguments
5699 were being counted with int, which may truncate counts on 64-bit
5700 machines, or EMACS_INT, which may be unnecessarily wide.
5701 * lisp.h (struct Lisp_Subr.function.aMANY)
5702 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
5703 Arg counts are now ptrdiff_t, not size_t.
5704 All variadic functions and their callers changed accordingly.
5705 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
5706 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
5707 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
5708 * callint.c (Fcall_interactively): Check arg count for overflow,
5709 to avoid potential buffer overrun. Use signed char, not 'int',
5710 for 'varies' array, so that we needn't bother to check its size
5711 calculation for overflow.
5712 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
5713 * eval.c (apply_lambda):
5714 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
5715 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
5716 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
5717
5718 * callint.c (Fcall_interactively): Don't use index var as event count.
5719
5720 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
5721 * mem-limits.h (SIZE): Remove; no longer used.
5722
5723 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5724
5725 Remove unnecessary casts.
5726 * xterm.c (x_term_init):
5727 * xfns.c (x_set_border_pixel):
5728 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
5729 These aren't needed now that we assume ANSI C.
5730
5731 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
5732 It's more likely to cause problems (due to unsigned overflow)
5733 than to cure them.
5734
5735 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
5736
5737 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
5738
5739 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
5740
5741 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
5742
5743 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
5744
5745 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
5746
5747 GLYPH_CODE_FACE returns EMACS_INT, not int.
5748 * dispextern.h (merge_faces):
5749 * xfaces.c (merge_faces):
5750 * xdisp.c (get_next_display_element, next_element_from_display_vector):
5751 Don't assume EMACS_INT fits in int.
5752
5753 * character.h (CHAR_VALID_P): Remove unused parameter.
5754 * fontset.c, lisp.h, xdisp.c: All uses changed.
5755
5756 * editfns.c (Ftranslate_region_internal): Omit redundant test.
5757
5758 * fns.c (concat): Minor tuning based on overflow analysis.
5759 This doesn't fix any bugs. Use int to hold character, instead
5760 of constantly refetching from Emacs object. Use XFASTINT, not
5761 XINT, for value known to be a character. Don't bother comparing
5762 a single byte to 0400, as it's always less.
5763
5764 * floatfns.c (Fexpt):
5765 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
5766
5767 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
5768 for characters.
5769
5770 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
5771
5772 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
5773 Without this fix, on a 64-bit host (aset S 0 4294967386) would
5774 incorrectly succeed when S was a string, because 4294967386 was
5775 truncated before it was used.
5776
5777 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
5778 Otherwise, an out-of-range integer could cause undefined behavior
5779 on a 64-bit host.
5780
5781 * composite.c: Use int, not EMACS_INT, for characters.
5782 (fill_gstring_body, composition_compute_stop_pos): Use int, not
5783 EMACS_INT, for values that are known to be in character range.
5784 This doesn't fix any bugs but is the usual style inside Emacs and
5785 may generate better code on 32-bit machines.
5786
5787 Make sure a 64-bit char is never passed to ENCODE_CHAR.
5788 This is for reasons similar to the recent CHAR_STRING fix.
5789 * charset.c (Fencode_char): Check that character arg is actually
5790 a character. Pass an int to ENCODE_CHAR.
5791 * charset.h (ENCODE_CHAR): Verify that the character argument is no
5792 wider than 'int', as a compile-time check to prevent future regressions
5793 in this area.
5794
5795 * character.c (char_string): Remove unnecessary casts.
5796
5797 Make sure a 64-bit char is never passed to CHAR_STRING.
5798 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
5799 by silently ignoring the top 32 bits, allowing some values
5800 that were far too large to be valid characters.
5801 * character.h: Include <verify.h>.
5802 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
5803 arguments are no wider than unsigned, as a compile-time check
5804 to prevent future regressions in this area.
5805 * data.c (Faset):
5806 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
5807 (Fsubst_char_in_region):
5808 * fns.c (concat):
5809 * xdisp.c (decode_mode_spec_coding):
5810 Adjust to CHAR_STRING's new requirement.
5811 * editfns.c (Finsert_char, Fsubst_char_in_region):
5812 * fns.c (concat): Check that character args are actually
5813 characters. Without this test, these functions did the wrong
5814 thing with wildly out-of-range values on 64-bit hosts.
5815
5816 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
5817 These casts should not be needed on 32-bit hosts, either.
5818 * keyboard.c (read_char):
5819 * lread.c (Fload): Remove casts to unsigned.
5820
5821 * lisp.h (UNSIGNED_CMP): New macro.
5822 This fixes comparison bugs on 64-bit hosts.
5823 (ASCII_CHAR_P): Use it.
5824 * casefiddle.c (casify_object):
5825 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
5826 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
5827 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
5828 * dispextern.h (FACE_FROM_ID):
5829 * keyboard.c (read_char): Use UNSIGNED_CMP.
5830
5831 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
5832 not to EMACS_INT, to avoid GCC warning.
5833
5834 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
5835
5836 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
5837 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
5838 isn't needed on 32-bit machines.
5839
5840 * buffer.c (Fgenerate_new_buffer_name):
5841 Use EMACS_INT for count, not int.
5842 (advance_to_char_boundary): Return EMACS_INT, not int.
5843
5844 * data.c (Qcompiled_function): Now static.
5845
5846 * window.c (window_body_lines): Now static.
5847
5848 * image.c (gif_load): Rename local to avoid shadowing.
5849
5850 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
5851 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
5852 * alloc.c (make_save_value): Integer argument is now of type
5853 ptrdiff_t, not int.
5854 (mark_object): Use ptrdiff_t, not int.
5855 * lisp.h (pD): New macro.
5856 * print.c (print_object): Use it.
5857
5858 * alloc.c: Use EMACS_INT, not int, to count objects.
5859 (total_conses, total_markers, total_symbols, total_vector_size)
5860 (total_free_conses, total_free_markers, total_free_symbols)
5861 (total_free_floats, total_floats, total_free_intervals)
5862 (total_intervals, total_strings, total_free_strings):
5863 Now EMACS_INT, not int. All uses changed.
5864 (Fgarbage_collect): Compute overall total using a double, so that
5865 integer overflow is less likely to be a problem. Check for overflow
5866 when converting back to an integer.
5867 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
5868 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
5869 These were 'int' variables that could overflow on 64-bit hosts;
5870 they were never used, so remove them instead of repairing them.
5871 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
5872 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
5873 Previously, this ceilinged at INT_MAX, but that doesn't work on
5874 64-bit machines.
5875 (allocate_pseudovector): Don't use EMACS_INT when int would do.
5876
5877 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
5878 (allocate_vectorlike): Check for ptrdiff_t overflow.
5879 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
5880 when a (possibly-narrower) signed value would do just as well.
5881 We prefer using signed arithmetic, to avoid comparison confusion.
5882
5883 * alloc.c: Catch some string size overflows that we were missing.
5884 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
5885 for convenience in STRING_BYTES_MAX.
5886 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
5887 The definition here is exact; the one in lisp.h was approximate.
5888 (allocate_string_data): Check for string overflow. This catches
5889 some instances we weren't catching before. Also, it catches
5890 size_t overflow on (unusual) hosts where SIZE_MAX <= min
5891 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
5892 and ptrdiff_t and EMACS_INT are both 64 bits.
5893
5894 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
5895 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
5896 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
5897
5898 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
5899
5900 * alloc.c (Fmake_string): Check for out-of-range init.
5901
5902 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
5903
5904 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
5905
5906 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
5907
5908 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
5909 xg_get_default_scrollbar_width.
5910
5911 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
5912 (int_gtk_range_get_value): Move to the scroll bar part of the file.
5913 (style_changed_cb): Call update_theme_scrollbar_width and call
5914 x_set_scroll_bar_default_width and xg_frame_set_char_size for
5915 all frames (Bug#8505).
5916 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
5917 Call gtk_window_set_resizable if HAVE_GTK3.
5918 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
5919 and height if HAVE_GTK3 (Bug#8505).
5920 (scroll_bar_width_for_theme): New variable.
5921 (update_theme_scrollbar_width): New function.
5922 (xg_get_default_scrollbar_width): Move code to
5923 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
5924 (xg_initialize): Call update_theme_scrollbar_width.
5925
5926 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
5927
5928 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
5929
5930 2011-06-12 Martin Rudalics <rudalics@gmx.at>
5931
5932 * frame.c (make_frame): Call other_buffer_safely instead of
5933 other_buffer.
5934
5935 * window.c (temp_output_buffer_show): Call display_buffer with
5936 second argument Vtemp_buffer_show_specifiers and reset latter
5937 immediately after the call.
5938 (Vtemp_buffer_show_specifiers): New variable.
5939 (auto_window_vscroll_p, next_screen_context_lines)
5940 (Vscroll_preserve_screen_position): Remove leading asterisks from
5941 doc-strings.
5942
5943 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
5944
5945 Fix minor problems found by GCC 4.6.0 static checking.
5946 * buffer.c (Qclone_number): Remove for now, as it's unused.
5947 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
5948 (record_buffer): Remove unused local.
5949 * frame.c (other_visible_frames, frame_buffer_list): Now static.
5950 (set_frame_buffer_list): Remove; unused.
5951 * frame.h (other_visible_frames): Remove decl.
5952 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
5953 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
5954 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
5955 if HAVE_GPM.
5956 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
5957 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
5958 Define only if HAVE_GPM.
5959 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
5960 (update_hints_inhibit): Remove; never set. All uses removed.
5961 * widgetprv.h (emacsFrameClassRec): Remove decl.
5962 * window.c (delete_deletable_window): Now returns void, since it
5963 wasn't returning anything.
5964 (compare_window_configurations): Remove unused locals.
5965 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
5966 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
5967 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
5968 the same widths as pointers. This follows up on the 2011-05-06 patch.
5969 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
5970 * xterm.h: Likewise.
5971 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
5972
5973 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
5974
5975 * makefile.w32-in: Update dependencies.
5976 (LISP_H): Add lib/intprops.h.
5977
5978 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
5979
5980 * image.c (gif_load): Add animation frame delay to the metadata.
5981 (syms_of_image): Use DEFSYM. New symbol `delay'.
5982
5983 2011-06-11 Martin Rudalics <rudalics@gmx.at>
5984
5985 * window.c (delete_deletable_window): Re-add.
5986 (Fset_window_configuration): Rewrite to handle dead buffers and
5987 consequently deletable windows.
5988 (window_tree, Fwindow_tree): Remove. Supply functionality in
5989 window.el.
5990 (compare_window_configurations): Simplify code.
5991
5992 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
5993
5994 * image.c (imagemagick_load_image): Fix type mismatch.
5995 (Fimagemagick_types): Likewise.
5996
5997 * window.h (replace_buffer_in_windows): Declare.
5998
5999 2011-06-11 Martin Rudalics <rudalics@gmx.at>
6000
6001 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
6002 Qclone_number. Remove external declaration of Qdelete_window.
6003 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
6004 code.
6005 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
6006 Run Qbuffer_list_update_hook if allowed.
6007 (Fother_buffer): Rewrite doc-string. Major rewrite for new
6008 buffer list implementation.
6009 (other_buffer_safely): New function.
6010 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
6011 calls to replace_buffer_in_windows and
6012 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
6013 if allowed.
6014 (record_buffer): Inhibit quitting and rewrite using quittable
6015 functions. Run Qbuffer_list_update_hook if allowed.
6016 (Frecord_buffer, Funrecord_buffer): New functions.
6017 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
6018 Move switch-to-buffer to window.el.
6019 (bury-buffer): Move to window.el.
6020 (Vbuffer_list_update_hook): New variable.
6021
6022 * lisp.h (other_buffer_safely): Add prototype in buffer.c
6023 section.
6024
6025 * window.h (resize_frame_windows): Move up in code.
6026 (Fwindow_frame): Remove EXFUN.
6027 (replace_buffer_in_all_windows): Remove prototype.
6028 (replace_buffer_in_windows_safely): Add prototype.
6029
6030 * window.c: Declare Qdelete_window static again. Move down
6031 declaration of select_count.
6032 (Fnext_window, Fprevious_window): Rewrite doc-strings.
6033 (Fother_window): Move to window.el.
6034 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
6035 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
6036 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
6037 window.el.
6038 (replace_buffer_in_windows): Implement by calling
6039 Qreplace_buffer_in_windows.
6040 (replace_buffer_in_all_windows): Remove with some functionality
6041 moved into replace_buffer_in_windows_safely.
6042 (replace_buffer_in_windows_safely): New function.
6043 (select_window_norecord, select_frame_norecord): Move in front
6044 of run_window_configuration_change_hook. Remove now obsolete
6045 declarations.
6046 (Fset_window_buffer): Rewrite doc-string.
6047 Call Qrecord_window_buffer.
6048 (keys_of_window): Move binding for other-window to window.el.
6049
6050 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
6051
6052 * dispextern.h (struct image): Replace data member, whose int_val
6053 and ptr_val fields were not used by anything, with a single
6054 lisp_val object.
6055
6056 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
6057 (gif_clear_image, gif_load, imagemagick_load_image)
6058 (gs_clear_image, gs_load): Callers changed.
6059
6060 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
6061
6062 * buffer.h: Include <time.h>, for time_t.
6063 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
6064
6065 Fix minor problems found by static checking.
6066
6067 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
6068
6069 Make identifiers static if they are not used in other modules.
6070 * data.c (Qcompiled_function, Qframe, Qvector):
6071 * image.c (QimageMagick, Qsvg):
6072 * minibuf.c (Qmetadata):
6073 * window.c (resize_window_check, resize_root_window): Now static.
6074 * window.h (resize_window_check, resize_root_window): Remove decls.
6075
6076 * window.c (window_deletion_count, delete_deletable_window):
6077 Remove; unused.
6078 (window_body_lines): Now static.
6079 (Fdelete_other_windows_internal): Mark vars as initialized.
6080 Make sure 'resize_failed' is initialized.
6081 (run_window_configuration_change_hook): Rename local to avoid shadowing.
6082 (resize_window_apply): Remove unused local.
6083 * window.h (delete_deletable_window): Remove decl.
6084
6085 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
6086 (imagemagick_load_image): Fix pointer signedness problem by changing
6087 last arg from unsigned char * to char *. All uses changed.
6088 Also, fix a local for similar reasons.
6089 Remove unused locals. Remove locals to avoid shadowing.
6090 (fn_rsvg_handle_free): Remove; unused.
6091 (svg_load, svg_load_image): Fix pointer signedness problem.
6092 (imagemagick_load_image): Don't use garbage pointer image_wand.
6093
6094 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
6095
6096 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
6097
6098 * image.c (gif_load): Fix omitted cast error introduced by
6099 2011-06-06 change.
6100
6101 2011-06-10 Martin Rudalics <rudalics@gmx.at>
6102
6103 * window.h (resize_proportionally, orig_total_lines)
6104 (orig_top_line): Remove from window structure.
6105 (set_window_height, set_window_width, change_window_heights)
6106 (Fdelete_window): Remove prototypes.
6107 (resize_frame_windows): Remove duplicate declaration.
6108
6109 2011-06-10 Eli Zaretskii <eliz@gnu.org>
6110
6111 * window.h (resize_frame_windows, resize_window_check)
6112 (delete_deletable_window, resize_root_window)
6113 (resize_frame_windows): Declare prototypes.
6114
6115 * window.c (resize_window_apply): Make definition be "static" to
6116 match the prototype.
6117
6118 2011-06-10 Martin Rudalics <rudalics@gmx.at>
6119
6120 * window.c: Remove declarations of Qwindow_size_fixed,
6121 window_min_size_1, window_min_size_2, window_min_size,
6122 size_window, window_fixed_size_p, enlarge_window, delete_window.
6123 Remove static from declaration of Qdelete_window, it's
6124 temporarily needed by Fbury_buffer.
6125 (replace_window): Don't assign orig_top_line and
6126 orig_total_lines.
6127 (Fdelete_window, delete_window): Remove. Window deletion is
6128 handled by window.el.
6129 (window_loop): Remove DELETE_OTHER_WINDOWS case.
6130 Replace Fdelete_window calls with calls to Qdelete_window.
6131 (Fdelete_other_windows): Remove. Deleting other windows is
6132 handled by window.el.
6133 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
6134 handled in window.el.
6135 (window_min_size_2, window_min_size_1, window_min_size): Remove.
6136 Window minimum sizes are handled in window.el.
6137 (shrink_windows, size_window, set_window_height)
6138 (set_window_width, change_window_heights, window_height)
6139 (window_width, CURBEG, CURSIZE, enlarge_window)
6140 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
6141 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
6142 handled in window.el.
6143 (make_dummy_parent): Rename to make_parent_window and give it a
6144 second argument horflag.
6145 (make_window): Don't set resize_proportionally any more.
6146 (Fsplit_window): Remove. Windows are split in window.el.
6147 (save_restore_action, save_restore_orig_size)
6148 (shrink_window_lowest_first, save_restore_orig_size): Remove.
6149 Resize mini windows in window.el.
6150 (grow_mini_window, shrink_mini_window): Implement by calling
6151 Qresize_root_window_vertically, resize_window_check and
6152 resize_window_apply.
6153 (saved_window, Fset_window_configuration, save_window_save):
6154 Do not handle orig_top_line, orig_total_lines, and
6155 resize_proportionally.
6156 (window_min_height, window_min_width): Move to window.el.
6157 (keys_of_window): Move bindings for delete-other-windows,
6158 split-window, delete-window and enlarge-window to window.el.
6159
6160 * buffer.c: Temporarily extern Qdelete_window.
6161 (Fbury_buffer): Temporarily call Qdelete_window instead of
6162 Fdelete_window (Fbury_buffer will move to window.el soon).
6163
6164 * frame.c (set_menu_bar_lines_1): Remove code handling
6165 orig_top_line and orig_total_lines.
6166
6167 * dispnew.c (adjust_frame_glyphs_initially): Don't use
6168 set_window_height but set heights directly.
6169 (change_frame_size_1): Use resize_frame_windows.
6170
6171 * xdisp.c (init_xdisp): Don't use set_window_height but set
6172 heights directly.
6173
6174 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
6175 Use resize_frame_windows instead of change_window_heights and run
6176 run_window_configuration_change_hook.
6177
6178 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
6179 instead of change_window_heights and run
6180 run_window_configuration_change_hook.
6181
6182 2011-06-09 Martin Rudalics <rudalics@gmx.at>
6183
6184 * window.c (replace_window): Rename second argument REPLACEMENT to
6185 NEW. New third argument SETFLAG. Rewrite.
6186 (delete_window, make_dummy_parent): Call replace_window with
6187 third argument 1.
6188 (window_list_1): Move down in code.
6189 (run_window_configuration_change_hook): Move set_buffer part
6190 before select_frame_norecord part in order to unwind correctly.
6191 Rename count1 to count.
6192 (recombine_windows, delete_deletable_window, resize_root_window)
6193 (Fdelete_other_windows_internal)
6194 (Frun_window_configuration_change_hook, make_parent_window)
6195 (resize_window_check, resize_window_apply, Fresize_window_apply)
6196 (resize_frame_windows, Fsplit_window_internal)
6197 (Fdelete_window_internal, Fresize_mini_window_internal):
6198 New functions.
6199 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
6200
6201 2011-06-08 Martin Rudalics <rudalics@gmx.at>
6202
6203 * window.h (window): Add some new members to window structure -
6204 normal_lines, normal_cols, new_total, new_normal, clone_number,
6205 splits, nest, prev_buffers, next_buffers.
6206 (WINDOW_TOTAL_SIZE): Move here from window.c.
6207 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
6208
6209 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
6210 Remove.
6211 (make_dummy_parent): Set new members of windows structure.
6212 (make_window): Move down in code. Handle new members of window
6213 structure.
6214 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
6215 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
6216 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
6217 (Fset_window_prev_buffers, Fwindow_next_buffers)
6218 (Fset_window_next_buffers, Fset_window_clone_number):
6219 New functions.
6220 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
6221 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
6222 Doc-string fixes.
6223 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
6224 Argument WINDOW can be now internal window too.
6225 (Fwindow_use_time): Move up in code.
6226 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
6227 Rewrite doc-string.
6228 (Fset_window_configuration, saved_window)
6229 (Fcurrent_window_configuration, save_window_save): Handle new
6230 members of window structure.
6231 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
6232 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
6233 (syms_of_window): New Lisp objects Qrecord_window_buffer,
6234 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
6235 Qget_mru_window, Qresize_root_window,
6236 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
6237 Qauto_buffer_name; staticpro them.
6238
6239 2011-06-07 Martin Rudalics <rudalics@gmx.at>
6240
6241 * window.c (Fwindow_total_size, Fwindow_left_column)
6242 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
6243 (Fwindow_list_1): New functions.
6244 (window_box_text_cols): Replace with window_body_cols.
6245 (Fwindow_width, Fscroll_left, Fscroll_right):
6246 Use window_body_cols instead of window_box_text_cols.
6247 (delete_window, Fset_window_configuration):
6248 Call delete_all_subwindows with window as argument.
6249 (delete_all_subwindows): Take a window as argument and not a
6250 structure. Rewrite.
6251 (window_loop): Remove handling of GET_LRU_WINDOW and
6252 GET_LARGEST_WINDOW.
6253 (Fget_lru_window, Fget_largest_window): Move to window.el.
6254
6255 * window.h: Extern window_body_cols instead of
6256 window_box_text_cols. delete_all_subwindows now takes a
6257 Lisp_Object as argument.
6258
6259 * indent.c (compute_motion, Fcompute_motion):
6260 Use window_body_cols instead of window_box_text_cols.
6261
6262 * frame.c (delete_frame): Call delete_all_subwindows with root
6263 window as argument.
6264
6265 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
6266
6267 * fns.c (Fputhash): Document return value.
6268
6269 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
6270
6271 * image.c (gif_load): Implement gif89a spec "no disposal" method.
6272
6273 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
6274
6275 Cons<->int and similar integer overflow fixes (Bug#8794).
6276
6277 Check for overflow when converting integer to cons and back.
6278 * charset.c (Fdefine_charset_internal, Fdecode_char):
6279 Use cons_to_unsigned to catch overflow.
6280 (Fencode_char): Use INTEGER_TO_CONS.
6281 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
6282 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
6283 * data.c (long_to_cons, cons_to_long): Remove.
6284 (cons_to_unsigned, cons_to_signed): New functions.
6285 These signal an error for invalid or out-of-range values.
6286 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
6287 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
6288 * font.c (Ffont_variation_glyphs):
6289 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
6290 * lisp.h: Include <intprops.h>.
6291 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
6292 (cons_to_signed, cons_to_unsigned): New decls.
6293 (long_to_cons, cons_to_long): Remove decls.
6294 * undo.c (record_first_change): Use INTEGER_TO_CONS.
6295 (Fprimitive_undo): Use CONS_TO_INTEGER.
6296 * xfns.c (Fx_window_property): Likewise.
6297 * xselect.c: Include <limits.h>.
6298 (x_own_selection, selection_data_to_lisp_data):
6299 Use INTEGER_TO_CONS.
6300 (x_handle_selection_request, x_handle_selection_clear)
6301 (x_get_foreign_selection, Fx_disown_selection_internal)
6302 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
6303 (lisp_data_to_selection_data): Use cons_to_unsigned.
6304 (x_fill_property_data): Use cons_to_signed.
6305 Report values out of range.
6306
6307 Check for buffer and string overflow more precisely.
6308 * buffer.h (BUF_BYTES_MAX): New macro.
6309 * lisp.h (STRING_BYTES_MAX): New macro.
6310 * alloc.c (Fmake_string):
6311 * character.c (string_escape_byte8):
6312 * coding.c (coding_alloc_by_realloc):
6313 * doprnt.c (doprnt):
6314 * editfns.c (Fformat):
6315 * eval.c (verror):
6316 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
6317 since they may not be the same number.
6318 * editfns.c (Finsert_char):
6319 * fileio.c (Finsert_file_contents):
6320 Likewise for BUF_BYTES_MAX.
6321
6322 * image.c: Use ptrdiff_t, not int, for sizes.
6323 (slurp_file): Switch from int to ptrdiff_t.
6324 All uses changed.
6325 (slurp_file): Check that file size fits in both size_t (for
6326 malloc) and ptrdiff_t (for sanity and safety).
6327
6328 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
6329 if b->modtime has its maximal value.
6330
6331 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
6332
6333 Don't assume time_t can fit into int.
6334 * buffer.h (struct buffer.modtime): Now time_t, not int.
6335 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
6336 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
6337
6338 Minor fixes for signed vs unsigned integers.
6339 * character.h (MAYBE_UNIFY_CHAR):
6340 * charset.c (maybe_unify_char):
6341 * keyboard.c (read_char, reorder_modifiers):
6342 XINT -> XFASTINT, since the integer must be nonnegative.
6343 * ftfont.c (ftfont_spec_pattern):
6344 * keymap.c (access_keymap, silly_event_symbol_error):
6345 XUINT -> XFASTINT, since the integer must be nonnegative.
6346 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
6347 since it makes no difference and we prefer signed.
6348 * keyboard.c (record_char): Use XUINT when all the neighbors do.
6349 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
6350 nonnegative.
6351
6352 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
6353
6354 * window.h (Fwindow_frame): Declare.
6355
6356 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
6357
6358 * alloc.c: Simplify handling of large-request failures (Bug#8800).
6359 (SPARE_MEMORY): Always define.
6360 (LARGE_REQUEST): Remove.
6361 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
6362
6363 2011-06-06 Martin Rudalics <rudalics@gmx.at>
6364
6365 * lisp.h: Move EXFUNS for Fframe_root_window,
6366 Fframe_first_window and Fset_frame_selected_window to window.h.
6367
6368 * window.h: Move EXFUNS for Fframe_root_window,
6369 Fframe_first_window and Fset_frame_selected_window here from
6370 lisp.h.
6371
6372 * frame.c (Fwindow_frame, Fframe_first_window)
6373 (Fframe_root_window, Fframe_selected_window)
6374 (Fset_frame_selected_window): Move to window.c.
6375 (Factive_minibuffer_window): Move to minibuf.c.
6376 (Fother_visible_frames_p): New function.
6377
6378 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
6379
6380 * window.c (decode_window, decode_any_window): Move up in code.
6381 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
6382 (inhibit_frame_unsplittable): Remove unused variable.
6383 (Fwindow_buffer): Move up and rewrite doc-string.
6384 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
6385 (Fwindow_prev): New functions.
6386 (Fwindow_frame): Move here from frame.c. Accept any window as
6387 argument.
6388 (Fframe_root_window, Fframe_first_window)
6389 (Fframe_selected_window): Move here from frame.c. Accept frame
6390 or arbitrary window as argument. Update doc-strings.
6391 (Fminibuffer_window): Move up in code.
6392 (Fwindow_minibuffer_p): Move up in code and simplify.
6393 (Fset_frame_selected_window): Move here from frame.c.
6394 Marginal rewrite.
6395 (Fselected_window, select_window, Fselect_window): Move up in
6396 code. Minor doc-string fixes.
6397
6398 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
6399
6400 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
6401 Do not assume that spare memory exists; that assumption is valid
6402 only if SYSTEM_MALLOC.
6403 (LARGE_REQUEST): New macro, so that the issue of large requests
6404 is separated from the issue of spare memory.
6405
6406 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
6407
6408 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
6409 format. (Bug#8806)
6410
6411 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
6412
6413 * xfns.c (x_set_scroll_bar_default_width): Move declarations
6414 before statements.
6415
6416 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
6417
6418 * gtkutil.c (xg_get_default_scrollbar_width): New function.
6419
6420 * gtkutil.h: Declare xg_get_default_scrollbar_width.
6421
6422 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
6423 min width by calling x_set_scroll_bar_default_width (Bug#8505).
6424
6425 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
6426
6427 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
6428
6429 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
6430
6431 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
6432 (x_clipboard_manager_save): Add return value.
6433 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
6434 New error handlers.
6435 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
6436 Obey Vx_select_enable_clipboard_manager. Catch errors in
6437 x_clipboard_manager_save (Bug#8779).
6438 (Vx_select_enable_clipboard_manager): New variable.
6439 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
6440
6441 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
6442
6443 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
6444
6445 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6446
6447 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
6448 in the current matrix if keep_current_p is non-zero.
6449
6450 2011-06-04 Eli Zaretskii <eliz@gnu.org>
6451
6452 * bidi.c (bidi_level_of_next_char): Fix last change.
6453
6454 2011-06-03 Eli Zaretskii <eliz@gnu.org>
6455
6456 Support bidi reordering of text covered by display properties.
6457
6458 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
6459 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
6460 (bidi_cache_search, bidi_cache_iterator_state)
6461 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
6462 (bidi_level_of_next_char, bidi_move_to_visually_next):
6463 Support character positions inside a run of characters covered by a
6464 display string.
6465 (bidi_paragraph_init, bidi_resolve_explicit_1)
6466 (bidi_level_of_next_char): Call bidi_fetch_char and
6467 bidi_fetch_char_advance instead of FETCH_CHAR and
6468 FETCH_CHAR_ADVANCE.
6469 (bidi_init_it): Initialize new members.
6470 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
6471 definitions.
6472 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
6473 instead of using explicit *_CHAR codes.
6474 (bidi_resolve_explicit, bidi_resolve_weak):
6475 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
6476 bidirectional text is supported only in multibyte buffers.
6477 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
6478 it to initialize the frame_window_p member of struct bidi_it.
6479 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
6480 (bidi_resolve_explicit, bidi_resolve_weak)
6481 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
6482 bidi_it->nchars is non-positive.
6483 (bidi_level_of_next_char): Don't try to lookup the cache for the
6484 next/previous character if nothing is cached there yet, or if we
6485 were just reseat()'ed to a new position.
6486
6487 * xdisp.c (set_cursor_from_row): Set start and stop points
6488 according to the row's direction when priming the loop that looks
6489 for the glyph on which to display cursor.
6490 (single_display_spec_intangible_p): Function deleted.
6491 (display_prop_intangible_p): Reimplement to call
6492 handle_display_spec instead of single_display_spec_intangible_p.
6493 Accept 3 additional arguments needed by handle_display_spec.
6494 This fixes incorrect cursor motion across display property with complex
6495 values: lists, `(when COND...)' forms, etc.
6496 (single_display_spec_string_p): Support property values that are
6497 lists with the argument STRING its top-level element.
6498 (display_prop_string_p): Fix the condition for processing a
6499 property that is a list to be consistent with handle_display_spec.
6500 (handle_display_spec): New function, refactored from the
6501 last portion of handle_display_prop.
6502 (compute_display_string_pos): Accept additional argument
6503 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
6504 value of a `display' property is a "replacing spec".
6505 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
6506 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
6507 the display property, but just return a value indicating whether
6508 the display property will replace the characters it covers.
6509 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
6510 frame_window_p members of struct bidi_it.
6511 (compute_display_string_pos, compute_display_string_end):
6512 New functions.
6513 (push_it): Accept second argument POSITION, where pop_it should
6514 jump to continue iteration.
6515 (reseat_1): Initialize bidi_it.disp_pos.
6516
6517 * keyboard.c (adjust_point_for_property): Adjust the call to
6518 display_prop_intangible_p to its new signature.
6519
6520 * dispextern.h (struct bidi_it): New member frame_window_p.
6521 (bidi_init_it): Update prototypes.
6522 (display_prop_intangible_p): Update prototype.
6523 (compute_display_string_pos, compute_display_string_end):
6524 Declare prototypes.
6525 (struct bidi_it): New members nchars and disp_pos. ch_len is now
6526 EMACS_INT.
6527
6528 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
6529
6530 Malloc failure behavior now depends on size of allocation.
6531 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
6532 * lisp.h: Change signatures accordingly.
6533 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
6534 All callers changed. (Bug#8762)
6535
6536 * gnutls.c: Use Emacs's memory allocators.
6537 Without this change, the gnutls library would invoke malloc etc.
6538 directly, which causes problems on non-SYNC_INPUT hosts, and which
6539 runs afoul of improving memory_full behavior. (Bug#8761)
6540 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
6541 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
6542 xfree instead of the default malloc, realloc, free.
6543 (Fgnutls_boot): No need to check for memory allocation failure,
6544 since xmalloc does that for us.
6545
6546 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
6547 * category.c (hash_get_category_set):
6548 * ccl.c (ccl_driver):
6549 * charset.c (Fdefine_charset_internal):
6550 * charset.h (struct charset.hash_index):
6551 * composite.c (get_composition_id, gstring_lookup_cache)
6552 (composition_gstring_put_cache):
6553 * composite.h (struct composition.hash_index):
6554 * dispextern.h (struct image.hash):
6555 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
6556 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
6557 (hashfn_equal, hashfn_user_defined, make_hash_table)
6558 (maybe_resize_hash_table, hash_lookup, hash_put)
6559 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
6560 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
6561 (Fsxhash, Fgethash, Fputhash, Fmaphash):
6562 * image.c (make_image, search_image_cache, lookup_image)
6563 (xpm_put_color_table_h):
6564 * lisp.h (struct Lisp_Hash_Table):
6565 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
6566 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
6567 for hashes and hash indexes, instead of 'unsigned' and 'int'.
6568 * alloc.c (allocate_vectorlike):
6569 Check for overflow in vector size calculations.
6570 * ccl.c (ccl_driver):
6571 Check for overflow when converting EMACS_INT to int.
6572 * fns.c, image.c: Remove unnecessary static decls that would otherwise
6573 need to be updated by these changes.
6574 * fns.c (make_hash_table, maybe_resize_hash_table):
6575 Check for integer overflow with large hash tables.
6576 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
6577 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
6578 (SXHASH_REDUCE): New macro.
6579 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
6580 Use it instead of discarding useful hash info with large hash values.
6581 (sxhash_float): New function.
6582 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
6583 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
6584 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
6585 Rewrite to use FIXNUM_BITS, as this simplifies things.
6586 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
6587 Adjust signatures to match updated version of code.
6588 (consing_since_gc): Now EMACS_INT, since a single hash table can
6589 use more than INT_MAX bytes.
6590
6591 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
6592
6593 Make it possible to build with GCC-4.6+ -O2 -flto.
6594
6595 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
6596
6597 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
6598
6599 * minibuf.c (get_minibuffer, read_minibuf_unwind):
6600 Call minibuffer-inactive-mode.
6601
6602 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
6603
6604 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
6605 Update dependencies.
6606
6607 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
6608
6609 * data.c (init_data): Remove code for UTS, this system is not
6610 supported anymore.
6611
6612 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
6613
6614 Don't force ./temacs to start in terminal mode.
6615
6616 * frame.c (make_initial_frame): Initialize faces in all cases, not
6617 only when CANNOT_DUMP is defined.
6618 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
6619
6620 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
6621
6622 * dispnew.c (add_window_display_history): Use const for the string
6623 pointer. Remove declaration, not needed.
6624
6625 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
6626
6627 Use 'inline', not 'INLINE'.
6628 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
6629 * alloc.c, fontset.c (INLINE): Remove.
6630 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
6631 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
6632 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
6633 * gmalloc.c (register_heapinfo): Use inline unconditionally.
6634 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
6635
6636 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
6637
6638 Make it possible to run ./temacs.
6639
6640 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
6641 syms_of_callproc does the same thing. Remove test for
6642 "initialized", do it in the caller.
6643 * emacs.c (main): Avoid calling set_initial_environment when dumping.
6644
6645 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
6646
6647 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
6648 (read_minibuf): Use get_minibuffer.
6649 (syms_of_minibuf): Use DEFSYM.
6650 (Qmetadata): New var.
6651 * data.c (Qbuffer): Don't make it static.
6652 (syms_of_data): Use DEFSYM.
6653
6654 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
6655
6656 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
6657 (CCL_CODE_MIN): New macro.
6658
6659 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
6660
6661 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
6662
6663 * eval.c (Qdebug): Now static.
6664 * lisp.h (Qdebug): Remove decl. This reverts a part of the
6665 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
6666 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
6667
6668 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
6669
6670 * image.c: Various fixes to ImageMagick code comments.
6671 (Fimagemagick_types): Doc fix.
6672
6673 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
6674
6675 Minor fixes prompted by GCC 4.6.0 warnings.
6676
6677 * xselect.c (converted_selections, conversion_fail_tag): Now static.
6678
6679 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
6680 (x_clipboard_manager_save_all): Move extern decl to ...
6681 * xterm.h: ... here, so that it can be checked for consistency.
6682
6683 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
6684
6685 * xselect.c (x_clipboard_manager_save_frame)
6686 (x_clipboard_manager_save_all): New functions.
6687 (Fx_clipboard_manager_save): Lisp function deleted.
6688
6689 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
6690 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
6691
6692 * xterm.h: Update prototype.
6693
6694 2011-05-28 William Xu <william.xwl@gmail.com>
6695
6696 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
6697 exiting (Bug#8239).
6698
6699 2011-05-28 Jim Meyering <meyering@redhat.com>
6700
6701 Avoid a sign-extension bug in crypto_hash_function.
6702 * fns.c (to_uchar): Define.
6703 (crypto_hash_function): Use it to convert some newly-signed
6704 variables to unsigned, to avoid sign-extension bugs. For example,
6705 without this change, (md5 "truc") would evaluate to
6706 45723a2aff78ff4fff7fff1114760e62 rather than the expected
6707 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
6708 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
6709
6710 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
6711
6712 Integer overflow fixes.
6713
6714 * dbusbind.c: Serial number integer overflow fixes.
6715 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
6716 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
6717 to hold a serial number that is too large for a fixnum.
6718 (Fdbus_method_return_internal, Fdbus_method_error_internal):
6719 Check for serial numbers out of range. Decode any serial number
6720 that was so large that it became a float. (Bug#8722)
6721
6722 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
6723 (Fdbus_call_method, Fdbus_call_method_asynchronously):
6724 Use XFASTINT rather than XUINT when numbers are nonnegative.
6725 (xd_append_arg, Fdbus_method_return_internal):
6726 (Fdbus_method_error_internal): Likewise. Also, for unsigned
6727 arguments, check that Lisp number is nonnegative, rather than
6728 silently wrapping negative numbers around. (Bug#8722)
6729 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
6730 (Bug#8722)
6731
6732 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
6733
6734 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
6735
6736 ccl: Add integer overflow checks.
6737 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
6738 (IN_INT_RANGE): New macros.
6739 (ccl_driver): Use them to check for integer overflow when
6740 decoding a CCL program. Many of the new checks are whether XINT (x)
6741 fits in int; it doesn't always, on 64-bit hosts. The new version
6742 doesn't catch all possible integer overflows, but it's an
6743 improvement. (Bug#8719)
6744
6745 * alloc.c (make_event_array): Use XINT, not XUINT.
6746 There's no need for unsigned here.
6747
6748 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
6749 This follows up to the 2011-05-06 change that substituted uintptr_t
6750 for EMACS_INT. This case wasn't caught back then.
6751
6752 Rework Fformat to avoid integer overflow issues.
6753 * editfns.c: Include <float.h> unconditionally, as it's everywhere
6754 now (part of C89). Include <verify.h>.
6755 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
6756 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
6757 (Fformat): Avoid the prepass trying to compute sizes; it was only
6758 approximate and thus did not catch overflow reliably. Instead, walk
6759 through the format just once, formatting and computing sizes as we go,
6760 checking for integer overflow at every step, and allocating a larger
6761 buffer as needed. Keep track separately whether the format is
6762 multibyte. Keep only the most-recently calculated precision, rather
6763 than them all. Record whether each argument has been converted to
6764 string. Use EMACS_INT, not int, for byte and char and arg counts.
6765 Support field widths and precisions larger than INT_MAX. Avoid
6766 sprintf's undefined behavior with conversion specifications such as %#d
6767 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
6768 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
6769 formatting out-of-range floating point numbers with int
6770 formats. (Bug#8668)
6771
6772 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
6773
6774 * data.c: Avoid integer truncation in expressions involving floats.
6775 * data.c: Include <intprops.h>.
6776 (arith_driver): When there's an integer overflow in an expression
6777 involving floating point, convert the integers to floating point
6778 so that the resulting value does not suffer from catastrophic
6779 integer truncation. For example, on a 64-bit host (* 4
6780 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
6781 Do not rely on undefined behavior after integer overflow.
6782
6783 merge count_size_as_multibyte, parse_str_to_multibyte
6784 * character.c, character.h (count_size_as_multibyte):
6785 Rename from parse_str_to_multibyte; all uses changed.
6786 Check for integer overflow.
6787 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
6788 since it's now a duplicate of the other. This is more of
6789 a character than a buffer op, so better that it's in character.c.
6790 * fns.c, print.c: Adjust to above changes.
6791
6792 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
6793
6794 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
6795
6796 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
6797
6798 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
6799 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
6800 (x_clipboard_manager_save): Now static.
6801 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
6802
6803 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
6804 (crypto_hash_function): Now static.
6805 Fix pointer signedness problems. Avoid unnecessary initializations.
6806
6807 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
6808
6809 * termhooks.h (Vselection_alist): Make it terminal-local.
6810
6811 * terminal.c (create_terminal): Initialize it.
6812
6813 * xselect.c: Support for clipboard managers.
6814 (Vselection_alist): Move to termhooks.h as terminal-local var.
6815 (LOCAL_SELECTION): New macro.
6816 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
6817 (symbol_to_x_atom): Remove gratuitous arg.
6818 (x_handle_selection_request, lisp_data_to_selection_data)
6819 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
6820 (x_own_selection, x_get_local_selection, x_convert_selection):
6821 New arg, specifying work frame. Use terminal-local Vselection_alist.
6822 (some_frame_on_display): Delete unused function.
6823 (Fx_own_selection_internal, Fx_get_selection_internal)
6824 (Fx_disown_selection_internal, Fx_selection_owner_p)
6825 (Fx_selection_exists_p): New optional frame arg.
6826 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
6827 (x_handle_selection_clear): Don't treat other terminals with the
6828 same keyboard specially. Use the terminal-local Vselection_alist.
6829 (x_clear_frame_selections): Use Frun_hook_with_args.
6830
6831 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
6832
6833 * xterm.h: Add support for those atoms.
6834
6835 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
6836
6837 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
6838 (converted_selections, conversion_fail_tag): New global variables.
6839 (x_selection_request_lisp_error): Free the above.
6840 (x_get_local_selection): Remove unnecessary code.
6841 (x_reply_selection_request): Args changed; handle arbitrary array
6842 of converted selections stored in converted_selections.
6843 Separate the XChangeProperty and SelectionNotify steps.
6844 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
6845 (x_convert_selection): New function.
6846 (x_handle_selection_event): Simplify.
6847 (x_get_foreign_selection): Don't ignore incoming requests while
6848 waiting for an answer; this will fail when we implement
6849 SAVE_TARGETS, and seems unnecessary anyway.
6850 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
6851 (Vx_sent_selection_functions): Doc fix.
6852
6853 2011-05-26 Leo Liu <sdl.web@gmail.com>
6854
6855 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
6856
6857 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6858
6859 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
6860
6861 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
6862 for fringe update if it has periodic bitmap.
6863 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
6864 and fringe_bitmap_periodic_p.
6865
6866 * fringe.c (get_fringe_bitmap_data): New function.
6867 (draw_fringe_bitmap_1, update_window_fringes): Use it.
6868 (update_window_fringes): Record periodicity of fringe bitmap in glyph
6869 row. Mark glyph row for fringe update if periodicity changed.
6870
6871 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
6872 for fringe update unless it has periodic bitmap.
6873
6874 2011-05-25 Kenichi Handa <handa@m17n.org>
6875
6876 * xdisp.c (get_next_display_element): Set correct it->face_id for
6877 a static composition.
6878
6879 2011-05-24 Leo Liu <sdl.web@gmail.com>
6880
6881 * deps.mk (fns.o):
6882 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
6883
6884 * fns.c (crypto_hash_function, Fsha1): New function.
6885 (Fmd5): Use crypto_hash_function.
6886 (syms_of_fns): Add Ssha1.
6887
6888 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
6889
6890 * gnutls.c: Remove unused macros.
6891 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
6892 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
6893 Remove macros that are defined and never used.
6894 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
6895
6896 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
6897
6898 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
6899 (Fx_get_selection_internal): Minor cleanup.
6900 (Fx_own_selection_internal): Rename arguments for consistency with
6901 select.el.
6902
6903 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
6904
6905 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
6906
6907 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
6908
6909 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
6910
6911 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6912
6913 * dispnew.c (scrolling_window): Don't exclude the case that the
6914 last enabled row in the desired matrix touches the bottom boundary.
6915
6916 2011-05-21 Glenn Morris <rgm@gnu.org>
6917
6918 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
6919 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
6920 and add some more files.
6921
6922 2011-05-20 Eli Zaretskii <eliz@gnu.org>
6923
6924 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
6925 report_file_error introduced by the change from 2011-05-07.
6926
6927 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
6928
6929 * systime.h (Time): Define only if emacs is defined.
6930 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
6931 where the include path doesn't have X11/X.h by default. See
6932 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
6933
6934 2011-05-20 Kenichi Handa <handa@m17n.org>
6935
6936 * composite.c (find_automatic_composition): Fix previous change.
6937
6938 2011-05-20 Glenn Morris <rgm@gnu.org>
6939
6940 * lisp.mk: New file, split from Makefile.in.
6941 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
6942 (shortlisp): Remove.
6943 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
6944
6945 2011-05-19 Glenn Morris <rgm@gnu.org>
6946
6947 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
6948 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
6949 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
6950 (lisp): Set the order to that of loadup.el.
6951 (shortlisp): Make it a copy of $lisp.
6952 (SOME_MACHINE_LISP): Remove.
6953 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
6954 Use just $shortlisp, not $SOME_MACHINE_LISP too.
6955
6956 2011-05-18 Kenichi Handa <handa@m17n.org>
6957
6958 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
6959 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
6960 (find_automatic_composition): Mostly rewrite for efficiency.
6961
6962 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
6963
6964 * makefile.w32-in: Update dependencies.
6965
6966 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
6967
6968 * menu.c: Include limits.h (fixes the MS-Windows build broken by
6969 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
6970
6971 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
6972
6973 Fix some integer overflow issues, such as string length overflow.
6974
6975 * insdel.c (count_size_as_multibyte): Check for string overflow.
6976
6977 * character.c (lisp_string_width): Check for string overflow.
6978 Use EMACS_INT, not int, for string indexes and lengths; in
6979 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
6980 the resulting string length overflows an EMACS_INT; instead,
6981 report a string overflow if no precision given. When checking for
6982 precision exhaustion, use a check that cannot possibly have
6983 integer overflow. (Bug#8675)
6984 * character.h (lisp_string_width): Adjust to new signature.
6985
6986 * alloc.c (string_overflow): New function.
6987 (Fmake_string): Use it. This doesn't change behavior, but saves
6988 a few bytes and will simplify future changes.
6989 * character.c (string_escape_byte8): Likewise.
6990 * lisp.h (string_overflow): New decl.
6991
6992 Fixups, following up to the user-interface timestamp change.
6993 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
6994 for UI timestamps, instead of unsigned long.
6995 * msdos.c (mouse_get_pos): Likewise.
6996 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
6997 * w32gui.h (Time): Define by including "systime.h" rather than by
6998 declaring it ourselves. (Bug#8664)
6999
7000 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
7001 * image.c (clear_image_cache): Likewise.
7002
7003 * term.c (term_mouse_position): Don't assume time_t wraparound.
7004
7005 Be more systematic about user-interface timestamps.
7006 Before, the code sometimes used 'Time', sometimes 'unsigned long',
7007 and sometimes 'EMACS_UINT', to represent these timestamps.
7008 This change causes it to use 'Time' uniformly, as that's what X uses.
7009 This makes the code easier to follow, and makes it easier to catch
7010 integer overflow bugs such as Bug#8664.
7011 * frame.c (Fmouse_position, Fmouse_pixel_position):
7012 Use Time, not unsigned long, for user-interface timestamps.
7013 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
7014 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
7015 * keyboard.h (last_event_timestamp): Likewise.
7016 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
7017 * menu.h (xmenu_show): Likewise.
7018 * term.c (term_mouse_position): Likewise.
7019 * termhooks.h (struct input_event.timestamp): Likewise.
7020 (struct terminal.mouse_position_hook): Likewise.
7021 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
7022 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
7023 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
7024 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
7025 what it was before.
7026 * menu.h, termhooks.h: Include "systime.h", for Time.
7027
7028 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
7029 Don't assume that the difference between two unsigned long values
7030 can fit into an integer. At this point, we know button_down_time
7031 <= event->timestamp, so the difference must be nonnegative, so
7032 there's no need to cast the result if double-click-time is
7033 nonnegative, as it should be; check that it's nonnegative, just in
7034 case. This bug is triggered when events are more than 2**31 ms
7035 apart (about 25 days). (Bug#8664)
7036
7037 * xselect.c (last_event_timestamp): Remove duplicate decl.
7038 (x_own_selection): Remove needless cast to unsigned long.
7039
7040 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
7041 that always fit in int. Use a sentinel instead of a counter, to
7042 avoid a temp and to allay GCC's concerns about possible int overflow.
7043 * frame.h (struct frame): Use int for menu_bar_items_used
7044 instead of EMACS_INT, since it always fits in int.
7045
7046 * menu.c (grow_menu_items): Check for int overflow.
7047
7048 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
7049
7050 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
7051 Before, the code was not consistent. These values cannot exceed
7052 2**31 - 1 so there's no need to make them unsigned.
7053 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
7054 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
7055 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
7056 as modifiers.
7057 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
7058
7059 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
7060 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
7061 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
7062 presumably because the widths might not match.
7063
7064 * window.c (size_window): Avoid needless test at loop start.
7065
7066 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
7067
7068 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
7069
7070 2011-05-12 Drew Adams <drew.adams@oracle.com>
7071
7072 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
7073
7074 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7075
7076 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
7077 `width' to `bar_area_x' and `bar_area_width', respectively.
7078 (x_scroll_run): Take account of fringe background extension.
7079
7080 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
7081 Rename local vars `left' and `width' to `bar_area_x' and
7082 `bar_area_width', respectively.
7083 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
7084 background extension.
7085
7086 2011-05-10 Jim Meyering <meyering@redhat.com>
7087
7088 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
7089
7090 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
7091
7092 * image.c (Finit_image_library): Return t for built-in image types,
7093 like pbm and xbm. (Bug#8640)
7094
7095 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
7096
7097 * w32menu.c (set_frame_menubar): Fix submenu allocation.
7098
7099 2011-05-07 Eli Zaretskii <eliz@gnu.org>
7100
7101 * w32console.c (Fset_screen_color): Doc fix.
7102 (Fget_screen_color): New function.
7103 (syms_of_ntterm): Defsubr it.
7104
7105 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
7106 unlink the temporary file if Fcall_process didn't create it in the
7107 first place.
7108 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
7109 child process will be redirected to a file specified with `:file'.
7110 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
7111 cue to call_process_cleanup not to close that handle.
7112
7113 2011-05-07 Ben Key <bkey76@gmail.com>
7114
7115 * makefile.w32-in: The bootstrap-temacs rule now makes use of
7116 one of two shell specific rules, either bootstrap-temacs-CMD or
7117 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
7118 to the previous implementation of the bootstrap-temacs rule.
7119 The bootstrap-temacs-CMD rule is similar to the previous
7120 implementation of the bootstrap-temacs rule except that it
7121 makes use of the ESC_CFLAGS variable instead of the CFLAGS
7122 variable.
7123
7124 These changes, along with some changes to nt/configure.bat,
7125 nt/gmake.defs, and nt/nmake.defs, are required to extend my
7126 earlier fix to add support for --cflags and --ldflags options
7127 that include quotes so that it works whether make uses cmd or
7128 sh as the shell.
7129
7130 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
7131
7132 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
7133 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
7134 is a constant.
7135 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
7136 a string. Handle both cases.
7137 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
7138 (Fdbus_register_method): Use Qinvalid_function.
7139
7140 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
7141
7142 * makefile.w32-in: Update dependencies.
7143 (LISP_H): Add inttypes.h and stdin.h.
7144 (PROCESS_H): Add unistd.h.
7145
7146 2011-05-06 Eli Zaretskii <eliz@gnu.org>
7147
7148 * lread.c: Include limits.h (fixes the MS-Windows build broken by
7149 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
7150
7151 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
7152
7153 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
7154
7155 * term.c (vfatal): Remove stray call to va_end.
7156 It's not needed and the C Standard doesn't allow it here anyway.
7157
7158 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
7159 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
7160
7161 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
7162 bytes.
7163
7164 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
7165
7166 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
7167
7168 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
7169
7170 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
7171
7172 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
7173
7174 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
7175 * charset.c (Fdefine_charset_internal): Don't initialize
7176 charset.code_space[15]. The value was garbage, on hosts with
7177 32-bit int (Bug#8600).
7178
7179 * lread.c (read_integer): Be more consistent with string-to-number.
7180 Use string_to_number to do the actual conversion; this avoids
7181 rounding errors and fixes some other screwups. Without this fix,
7182 for example, #x1fffffffffffffff was misread as -2305843009213693952.
7183 (digit_to_number): Move earlier, for benefit of read_integer.
7184 Return -1 if the digit is out of range for the base, -2 if it is
7185 not a digit in any supported base. (Bug#8602)
7186
7187 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
7188
7189 * dispnew.c (scrolling_window): Return 1 if we scrolled,
7190 to match comment at start of function. This also removes a
7191 GCC warning about overflow in a 32+64-bit port.
7192
7193 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
7194
7195 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
7196 Reported by Stefan Monnier in
7197 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
7198 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
7199 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
7200
7201 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
7202 (EMACS_UINTPTR): Likewise, with uintptr_t.
7203
7204 * lisp.h: Prefer 64-bit EMACS_INT if available.
7205 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
7206 on 32-bit hosts that have 64-bit int, so that they can access
7207 large files.
7208 However, temporarily disable this change unless the temporary
7209 symbol WIDE_EMACS_INT is defined.
7210
7211 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
7212
7213 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
7214 This removes an assumption that EMACS_INT and long are the same
7215 width as pointers. The assumption is true for Emacs porting targets
7216 now, but we want to make other targets possible.
7217 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
7218 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
7219 In the rest of the code, change types of integers that hold casted
7220 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
7221 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
7222 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
7223 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
7224 No need to cast type when ORing.
7225 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
7226 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
7227 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
7228 assume EMACS_INT is the same width as char *.
7229 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
7230 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
7231 Remove no-longer-needed casts.
7232 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
7233 (xg_tool_bar_help_callback, xg_make_tool_item):
7234 Use EMACS_INTPTR to hold an integer
7235 that will be cast to void *; this can avoid a GCC warning
7236 if EMACS_INT is not the same width as void *.
7237 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
7238 * xdisp.c (display_echo_area_1, resize_mini_window_1):
7239 (current_message_1, set_message_1):
7240 Use a local to convert to proper width without a cast.
7241 * xmenu.c (dialog_selection_callback): Likewise.
7242
7243 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
7244 Also, don't assume VALBITS / RAND_BITS is less than 5,
7245 and don't rely on undefined behavior when shifting a 1 left into
7246 the sign bit.
7247 * lisp.h (get_random): Change signature to match.
7248
7249 * lread.c (hash_string): Use size_t, not int, for hash computation.
7250 Normally we prefer signed values; but hashing is special, because
7251 it's better to use unsigned division on hash table sizes so that
7252 the remainder is nonnegative. Also, size_t is the natural width
7253 for hashing into memory. The previous code used 'int', which doesn't
7254 retain enough info to hash well into very large tables.
7255 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
7256
7257 * dbusbind.c: Don't possibly lose pointer info when converting.
7258 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
7259 Use XPNTR rather than XHASH, so that the high-order bits of
7260 the pointer aren't lost when converting through void *.
7261
7262 * eval.c (Fautoload): Don't double-shift a pointer.
7263
7264 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
7265
7266 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
7267
7268 * gnutls.c (DEF_GNUTLS_FN):
7269 * image.c (DEF_IMGLIB_FN): Make function pointers static.
7270
7271 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
7272
7273 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
7274 marker. (Bug#8610)
7275
7276 2011-05-05 Eli Zaretskii <eliz@gnu.org>
7277
7278 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
7279 New version that can reserve upto 2GB of heap space.
7280
7281 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
7282
7283 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
7284
7285 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
7286
7287 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
7288 `gnutls_certificate_set_x509_key_file'.
7289
7290 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
7291
7292 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
7293 Update dependencies.
7294
7295 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
7296
7297 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
7298 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7299 Remove unused parameter `fildes'.
7300 * process.c (read_process_output, send_process): Don't pass it.
7301
7302 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
7303
7304 Fix previous change: the library cache is defined in w32.c.
7305 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
7306 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
7307
7308 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
7309
7310 Implement dynamic loading of GnuTLS on Windows.
7311
7312 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
7313 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
7314 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
7315 Declare.
7316
7317 * gnutls.c (Qgnutls_dll): Define.
7318 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
7319 (gnutls_*): Declare function pointers.
7320 (init_gnutls_functions): New function to initialize function pointers.
7321 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
7322 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
7323 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
7324 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
7325 (emacs_gnutls_write, emacs_gnutls_read)
7326 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
7327 (Fgnutls_available_p): New function.
7328 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
7329 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
7330 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
7331
7332 * image.c: Include w32.h.
7333 (Vimage_type_cache): Delete.
7334 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
7335 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
7336 (w32_delayed_load): Move to w32.c.
7337
7338 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
7339
7340 * w32.c (QCloaded_from, Vlibrary_cache): Define.
7341 (w32_delayed_load): Move from image.c. When loading a library, record
7342 its filename in the :loaded-from property of the library id.
7343 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
7344 Initialize and staticpro them.
7345 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
7346
7347 * process.c: Include lisp.h before w32.h, not after.
7348 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
7349 instead of gnutls_record_check_pending.
7350
7351 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
7352
7353 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
7354
7355 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
7356 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
7357 as passed in.
7358
7359 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
7360
7361 * xterm.c (x_set_frame_alpha): Do not set property on anything
7362 else than FRAME_X_OUTER_WINDOW (Bug#8608).
7363
7364 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
7365
7366 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
7367
7368 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
7369
7370 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
7371 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
7372 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
7373 (gnutls_global_initialized, Qgnutls_bootprop_priority)
7374 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
7375 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
7376 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
7377 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
7378 (Qgnutls_bootprop_callbacks_verify): Make static.
7379
7380 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
7381
7382 * callproc.c: Indentation fixup.
7383
7384 * sysdep.c (wait_for_termination_1): Make static.
7385 (wait_for_termination, interruptible_wait_for_termination):
7386 Move after wait_for_termination_1.
7387
7388 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
7389
7390 * sysdep.c (interruptible_wait_for_termination): New function
7391 which is like wait_for_termination, but allows keyboard
7392 interruptions.
7393
7394 * callproc.c (Fcall_process): Add (:file "file") as an option for
7395 the STDOUT buffer.
7396 (Fcall_process_region): Ditto.
7397
7398 2011-04-30 Eli Zaretskii <eliz@gnu.org>
7399
7400 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
7401 rather than `XVECTOR (FOO)->size'.
7402
7403 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
7404 inttypes.h, as a gnulib replacement is used if it not available in
7405 system headers.
7406
7407 2011-04-21 Eli Zaretskii <eliz@gnu.org>
7408
7409 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
7410 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
7411 of MOST_POSITIVE_FIXNUM. (Bug#8528)
7412
7413 * coding.c (coding_alloc_by_realloc): Error out if destination
7414 will grow beyond MOST_POSITIVE_FIXNUM.
7415 (decode_coding_emacs_mule): Abort if there isn't enough place in
7416 charbuf for the composition carryover bytes. Reserve an extra
7417 space for up to 2 characters produced in a loop.
7418 (decode_coding_iso_2022): Abort if there isn't enough place in
7419 charbuf for the composition carryover bytes.
7420
7421 2011-04-21 Eli Zaretskii <eliz@gnu.org>
7422
7423 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
7424 aborting when %lld or %lll format is passed.
7425 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
7426 %llo or %llx format is passed. (Bug#8545)
7427
7428 * window.c (window_scroll_line_based): Use a marker instead of
7429 simple variables to record original value of point. (Bug#7952)
7430
7431 * doprnt.c (doprnt): Fix the case where a multibyte sequence
7432 produced by %s or %c overflows available buffer space. (Bug#8545)
7433
7434 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
7435
7436 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
7437 (SIZE_MAX): Move defn after all includes, as they might #define it.
7438
7439 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
7440
7441 * w32.c (init_environment): Warn about defaulting HOME to C:\.
7442
7443 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
7444
7445 * keyboard.c (Qdelayed_warnings_hook): Define.
7446 (command_loop_1): Run `delayed-warnings-hook'
7447 if Vdelayed_warnings_list is non-nil.
7448 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
7449 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
7450
7451 2011-04-28 Eli Zaretskii <eliz@gnu.org>
7452
7453 * doprnt.c (doprnt): Don't return value smaller than the buffer
7454 size if the message was truncated. (Bug#8545).
7455
7456 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
7457
7458 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
7459 (Fx_window_property): #if-0 the whole functions, not just the bodies.
7460
7461 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
7462
7463 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
7464
7465 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
7466
7467 * makefile.w32-in: Update dependencies.
7468
7469 2011-04-27 Eli Zaretskii <eliz@gnu.org>
7470
7471 Improve `doprnt' and its usage. (Bug#8545)
7472 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
7473 `format_end'. Remove support for %l as a conversion specifier.
7474 Don't use xrealloc. Improve diagnostics when the %l size modifier
7475 is used. Update the commentary.
7476
7477 * eval.c (verror): Simplify calculation of size_t.
7478
7479 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
7480 messages.
7481
7482 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
7483
7484 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
7485 change.
7486
7487 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
7488
7489 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
7490 This makes this file independent of the recent pseudovector change.
7491
7492 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
7493
7494 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
7495
7496 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7497 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
7498 Remove unused local.
7499 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
7500
7501 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
7502 GCC 4.6.0 optimizes based on type-based alias analysis.
7503 For example, if b is of type struct buffer * and v of type struct
7504 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
7505 != &v->size, and therefore "v->size = 1; b->size = 2; return
7506 v->size;" must therefore return 1. This assumption is incorrect
7507 for Emacs, since it type-puns struct Lisp_Vector * with many other
7508 types. To fix this problem, this patch adds a new type struct
7509 vectorlike_header that documents the constraints on layout of vectors
7510 and pseudovectors, and helps optimizing compilers not get fooled
7511 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
7512 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
7513 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
7514 the size member.
7515 (XSETPVECTYPE): Rewrite in terms of new macro.
7516 (XSETPVECTYPESIZE): New macro, specifying both type and size.
7517 This is a bit clearer, and further avoids the possibility of
7518 undesirable aliasing.
7519 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
7520 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
7521 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
7522 since Lisp_Subr is a special case (no "next" field).
7523 (ASIZE): Now uses header.size rather than size.
7524 All previous uses of XVECTOR (foo)->size replaced to use this macro,
7525 to avoid the hassle of writing XVECTOR (foo)->header.size.
7526 (struct vectorlike_header): New type.
7527 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
7528 object, to help avoid aliasing.
7529 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
7530 (SUBRP): Likewise, since Lisp_Subr is a special case.
7531 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
7532 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
7533 (struct Lisp_Hash_Table): Combine first two members into a single
7534 struct vectorlike_header member. All uses of "size" and "next" members
7535 changed to be "header.size" and "header.next".
7536 * buffer.h (struct buffer): Likewise.
7537 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
7538 * frame.h (struct frame): Likewise.
7539 * process.h (struct Lisp_Process): Likewise.
7540 * termhooks.h (struct terminal): Likewise.
7541 * window.c (struct save_window_data, struct saved_window): Likewise.
7542 * window.h (struct window): Likewise.
7543 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
7544 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
7545 * buffer.c (init_buffer_once): Likewise.
7546 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
7547 special case.
7548 * process.c (Fformat_network_address): Use local var for size,
7549 for brevity.
7550
7551 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
7552
7553 Make the Lisp reader and string-to-float more consistent (Bug#8525)
7554 * data.c (atof): Remove decl; no longer used or needed.
7555 (digit_to_number): Move to lread.c.
7556 (Fstring_to_number): Use new string_to_number function, to be
7557 consistent with how the Lisp reader treats infinities and NaNs.
7558 Do not assume that floating-point numbers represent EMACS_INT
7559 without losing information; this is not true on most 64-bit hosts.
7560 Avoid double-rounding errors, by insisting on integers when
7561 parsing non-base-10 numbers, as the documentation specifies.
7562 * lisp.h (string_to_number): New decl, replacing ...
7563 (isfloat_string): Remove.
7564 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
7565 (read1): Do not accept +. and -. as integers; this
7566 appears to have been a coding error. Similarly, do not accept
7567 strings like +-1e0 as floating point numbers. Do not report
7568 overflow for integer overflows unless the base is not 10 which
7569 means we have no simple and reliable way to continue.
7570 Break out the floating-point parsing into a new
7571 function string_to_number, so that Fstring_to_number parses
7572 floating point numbers consistently with the Lisp reader.
7573 (digit_to_number): Move here from data.c. Make it static inline.
7574 (E_CHAR, EXP_INT): Remove, replacing with ...
7575 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
7576 (string_to_number): New function, replacing isfloat_string.
7577 This function checks for valid syntax and produces the resulting
7578 Lisp float number too. Rework it so that string-to-number
7579 no longer mishandles examples like "1.0e+". Use strtoumax,
7580 so that overflow for non-base-10 numbers is reported only when
7581 there's no portable and simple way to convert to floating point.
7582
7583 * textprop.c (set_text_properties_1): Rewrite for clarity,
7584 and to avoid GCC warning about integer overflow.
7585
7586 * intervals.h (struct interval): Use EMACS_INT for members
7587 where EMACS_UINT might cause problems. See
7588 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
7589 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
7590 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
7591 All uses changed.
7592 (offset_intervals): Tell GCC not to worry about length overflow
7593 when negating a negative length.
7594
7595 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
7596 (overrun_check_free): Likewise.
7597
7598 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
7599 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
7600 word size.
7601
7602 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
7603 (gnutls_make_error): Rename local to avoid shadowing.
7604 (gnutls_emacs_global_deinit): ifdef out; not used.
7605 (Fgnutls_boot): Use const for pointer to readonly storage.
7606 Comment out unused local. Fix pointer signedness problems.
7607
7608 * lread.c (openp): Don't stuff size_t into an 'int'.
7609 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
7610 about possible signed overflow.
7611
7612 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
7613 (GDK_KEY_g): Don't define if already defined.
7614 (xg_prepare_tooltip): Avoid pointer signedness problem.
7615 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
7616
7617 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
7618 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
7619
7620 * xfns.c (Fx_window_property): Simplify a bit,
7621 to make a bit faster and to avoid GCC 4.6.0 warning.
7622 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
7623
7624 * fns.c (internal_equal): Don't assume size_t fits in int.
7625
7626 * alloc.c (compact_small_strings): Tighten assertion a little.
7627
7628 Replace pEd with more-general pI, and fix some printf arg casts.
7629 * lisp.h (pI): New macro, generalizing old pEd macro to other
7630 conversion specifiers. For example, use "...%"pI"d..." rather
7631 than "...%"pEd"...".
7632 (pEd): Remove. All uses replaced with similar uses of pI.
7633 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
7634 * alloc.c (check_pure_size): Don't overflow by converting size to int.
7635 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
7636 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
7637 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
7638 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
7639 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
7640 64-bit hosts.
7641 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
7642 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
7643 * print.c (safe_debug_print, print_object): Likewise.
7644 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
7645 to int.
7646 Use pI instead of if-then-else-abort. Use %p to avoid casts,
7647 avoiding the 0 flag, which is not portable.
7648 * process.c (Fmake_network_process): Use pI to avoid cast.
7649 * region-cache.c (pp_cache): Likewise.
7650 * xdisp.c (decode_mode_spec): Likewise.
7651 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
7652 behavior on 64-bit hosts with printf arg.
7653 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
7654 (x_stop_queuing_selection_requests): Likewise.
7655 (x_get_window_property): Don't truncate byte count to an 'int'
7656 when tracing.
7657
7658 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
7659 here, since it parses constructs like leading '-' and spaces,
7660 which are not wanted; and it overflows with large numbers.
7661 Instead, simply match F[0-9]+, which is what is wanted anyway.
7662
7663 * alloc.c: Remove unportable assumptions about struct layout.
7664 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
7665 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
7666 (allocate_vectorlike, make_pure_vector): Use the new macros,
7667 plus offsetof, to remove unportable assumptions about struct layout.
7668 These assumptions hold on all porting targets that I know of, but
7669 they are not guaranteed, they're easy to remove, and removing them
7670 makes further changes easier.
7671
7672 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
7673 This doesn't fix a bug but makes the code clearer.
7674 (string_overrun_cookie): Now const. Use initializers that
7675 don't formally overflow signed char, to avoid warnings.
7676 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
7677 can cause Emacs to crash when string overrun checking is enabled.
7678 (allocate_buffer): Don't assume sizeof (struct buffer) is a
7679 multiple of sizeof (EMACS_INT); it need not be, if
7680 alignof(EMACS_INT) < sizeof (EMACS_INT).
7681 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
7682
7683 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
7684
7685 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
7686
7687 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
7688
7689 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
7690 supposed to be handshaking. (Bug#8556)
7691 Reported by Paul Eggert <eggert@cs.ucla.edu>.
7692
7693 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
7694
7695 * lisp.h (Qdebug): List symbol.
7696 * eval.c (Qdebug): Restore global linkage.
7697 * keyboard.c (debug-on-event): New variable.
7698 (handle_user_signal): Break into debugger when debug-on-event
7699 matches the current signal symbol.
7700
7701 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
7702
7703 * alloc.c (check_sblock, check_string_bytes)
7704 (check_string_free_list): Convert to standard C.
7705
7706 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
7707
7708 * w32.c (emacs_gnutls_push): Fix typo.
7709
7710 2011-04-25 Eli Zaretskii <eliz@gnu.org>
7711
7712 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
7713 "cast to pointer from integer of different size".
7714
7715 Improve doprnt and its use in verror. (Bug#8545)
7716 * doprnt.c (doprnt): Document the set of format control sequences
7717 supported by the function. Use SAFE_ALLOCA instead of always
7718 using `alloca'.
7719
7720 * eval.c (verror): Don't limit the buffer size at size_max-1, that
7721 is one byte too soon. Don't use xrealloc; instead xfree and
7722 xmalloc anew.
7723
7724 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
7725
7726 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
7727 callbacks stage.
7728
7729 * gnutls.c: Renamed global_initialized to
7730 gnutls_global_initialized. Added internals for the
7731 :verify-hostname-error, :verify-error, and :verify-flags
7732 parameters of `gnutls-boot' and documented those parameters in the
7733 docstring. Start callback support.
7734 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
7735 unless a fatal error occurred. Call gnutls_alert_send_appropriate
7736 on error. Return error code.
7737 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
7738 (emacs_gnutls_read): Likewise.
7739 (Fgnutls_boot): Return handshake error code.
7740 (emacs_gnutls_handle_error): New function.
7741 (wsaerror_to_errno): Likewise.
7742
7743 * w32.h (emacs_gnutls_pull): Add prototype.
7744 (emacs_gnutls_push): Likewise.
7745
7746 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
7747 (emacs_gnutls_push): Likewise.
7748
7749 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
7750
7751 * process.c (wait_reading_process_output): Check if GnuTLS
7752 buffered some data internally if no FDs are set for TLS
7753 connections.
7754
7755 * makefile.w32-in (OBJ2): Add gnutls.$(O).
7756 (LIBS): Link to USER_LIBS.
7757 ($(BLD)/gnutls.$(0)): New target.
7758
7759 2011-04-24 Eli Zaretskii <eliz@gnu.org>
7760
7761 * xdisp.c (handle_single_display_spec): Rename the
7762 display_replaced_before_p argument into display_replaced_p, to
7763 make it consistent with the commentary. Fix typos in the
7764 commentary.
7765
7766 * textprop.c (syms_of_textprop): Remove dead code.
7767 (copy_text_properties): Delete obsolete commentary about an
7768 interface that was deleted long ago. Fix typos in the description
7769 of arguments.
7770
7771 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
7772 to changes in oldXMenu/XMenu.h from 2011-04-16.
7773 <menu_help_message, prev_menu_help_message>: Constify.
7774 (IT_menu_make_room): menu->help_text is now `const char **';
7775 adjust.
7776
7777 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
7778 to changes in oldXMenu/XMenu.h from 2011-04-16.
7779 (struct XMenu): Declare `help_text' `const char **'.
7780
7781 * xfaces.c <Qunspecified>: Make extern again.
7782
7783 * syntax.c: Include sys/types.h before including regex.h, as
7784 required by POSIX.
7785
7786 * doc.c (get_doc_string): Improve the format passed to `error'.
7787
7788 * doprnt.c (doprnt): Improve commentary.
7789
7790 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
7791
7792 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
7793 them with etags.
7794
7795 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
7796 changes in globals.h immediately force recompilation.
7797 (TAGS): Depend on $(CURDIR)/m/intel386.h and
7798 $(CURDIR)/s/ms-w32.h.
7799 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
7800
7801 * character.c (Fchar_direction): Function deleted.
7802 (syms_of_character): Don't defsubr it.
7803 <char-direction-table>: Deleted.
7804
7805 2011-04-23 Eli Zaretskii <eliz@gnu.org>
7806
7807 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
7808 * doprnt.c: Include limits.h.
7809 (SIZE_MAX): New macro.
7810 (doprnt): Return a size_t value. 2nd arg is now size_t.
7811 Many local variables are now size_t instead of int or unsigned.
7812 Improve overflow protection. Support `l' modifier for integer
7813 conversions. Support %l conversion. Don't assume an EMACS_INT
7814 argument for integer conversions and for %c.
7815
7816 * lisp.h (doprnt): Restore prototype.
7817
7818 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
7819 $(SRC)/character.h.
7820
7821 * Makefile.in (base_obj): Add back doprnt.o.
7822
7823 * deps.mk (doprnt.o): Add back prerequisites.
7824 (callint.o): Depend on character.h.
7825
7826 * eval.c (internal_lisp_condition_case): Include the handler
7827 representation in the error message.
7828 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
7829 when breaking from the loop.
7830
7831 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
7832
7833 * callint.c (Fcall_interactively): When displaying error message
7834 about invalid control letter, pass the character's codepoint, not
7835 a pointer to its multibyte form. Improve display of the character
7836 in octal and display also its hex code.
7837
7838 * character.c (char_string): Use %x to display the (unsigned)
7839 codepoint of an invalid character, to avoid displaying a bogus
7840 negative value.
7841
7842 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
7843 `error', not SYMBOL_NAME itself.
7844
7845 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
7846 character arguments to `error'.
7847
7848 * charset.c (check_iso_charset_parameter): Fix incorrect argument
7849 to `error' in error message about FINAL_CHAR argument. Make sure
7850 FINAL_CHAR is a character, and use %c when it is passed as
7851 argument to `error'.
7852
7853 2011-04-23 Eli Zaretskii <eliz@gnu.org>
7854
7855 * s/ms-w32.h (localtime): Redirect to sys_localtime.
7856
7857 * w32.c: Include <time.h>.
7858 (sys_localtime): New function.
7859
7860 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
7861
7862 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
7863
7864 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
7865
7866 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
7867
7868 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
7869 zombies (Bug#8467).
7870
7871 2011-04-19 Eli Zaretskii <eliz@gnu.org>
7872
7873 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
7874 gl_state.e_property when gl_state.object is Qt.
7875
7876 * insdel.c (make_gap_larger): Remove limitation of buffer size
7877 to <= INT_MAX.
7878
7879 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
7880
7881 * xdisp.c (lookup_glyphless_char_display)
7882 (produce_glyphless_glyph): Handle cons cell entry in
7883 glyphless-char-display.
7884 (Vglyphless_char_display): Document it.
7885
7886 * term.c (produce_glyphless_glyph): Handle cons cell entry in
7887 glyphless-char-display.
7888
7889 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
7890
7891 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
7892
7893 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
7894
7895 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
7896 definition for no-X builds.
7897
7898 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
7899
7900 Static checks with GCC 4.6.0 and non-default toolkits.
7901
7902 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
7903
7904 * process.c (keyboard_bit_set): Define only if SIGIO.
7905 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
7906 (send_process): Repair possible setjmp clobbering.
7907
7908 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
7909
7910 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
7911
7912 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
7913
7914 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
7915 Define only if needed.
7916
7917 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
7918 by pacifying GCC about it. Maybe it's time to retire it?
7919 * xfaces.c (USG, __TIMEVAL__): Likewise.
7920
7921 * dispextern.h (struct redisplay_interface): Rename param
7922 to avoid shadowing.
7923 * termhooks.h (struct terminal): Likewise.
7924 * xterm.c (xembed_send_message): Likewise.
7925
7926 * insdel.c (make_gap_smaller): Define only if
7927 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
7928
7929 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
7930 it.
7931
7932 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
7933 so that we aren't warned about unused symbols.
7934
7935 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
7936
7937 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7938
7939 * xfns.c (x_real_positions): Mark locals as initialized.
7940
7941 * xmenu.c (xmenu_show): Don't use uninitialized vars.
7942
7943 * xterm.c: Fix problems found by static analysis with other toolkits.
7944 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
7945 (x_dispatch_event): Declare static if USE_GTK, and
7946 define if USE_GTK || USE_X_TOOLKIT.
7947 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
7948 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
7949 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
7950 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
7951
7952 * xmenu.c (menu_help_callback): Pointer type fixes.
7953 Use const pointers when pointing at readonly data. Avoid pointer
7954 signedness clashes.
7955 (FALSE): Remove unused macro.
7956 (update_frame_menubar): Remove unused decl.
7957
7958 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
7959
7960 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
7961 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
7962 (single_menu_item): Rename local to avoid shadowing.
7963
7964 * keyboard.c (make_lispy_event): Remove unused local var.
7965
7966 * frame.c, frame.h (x_get_resource_string): Bring this back, but
7967 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
7968
7969 * bitmaps: Change bitmaps from unsigned char back to the X11
7970 compatible char. Avoid the old compiler warnings about
7971 out-of-range initializers by using, for example, '\xab' rather
7972 than 0xab.
7973
7974 * xgselect.c (xgselect_initialize): Check vs interface
7975 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
7976
7977 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
7978
7979 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
7980 to read-only memory.
7981
7982 * fns.c (vector): Remove; this old hack is no longer needed.
7983
7984 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
7985 Remove unused var.
7986 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
7987
7988 * xrdb.c (x_load_resources): Omit unused local.
7989
7990 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
7991 (x_window): Rename locals to avoid shadowing.
7992 (USG): Use the kludged USG macro, to pacify gcc.
7993
7994 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
7995 (x_term_init): Remove local to avoid shadowing.
7996
7997 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
7998
7999 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
8000 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
8001
8002 2011-04-16 Eli Zaretskii <eliz@gnu.org>
8003
8004 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
8005
8006 Fix regex.c, syntax.c and friends for buffers > 2GB.
8007 * syntax.h (struct gl_state_s): Declare character position members
8008 EMACS_INT.
8009
8010 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
8011
8012 * textprop.c (verify_interval_modification, interval_of):
8013 Declare arguments EMACS_INT.
8014
8015 * intervals.c (adjust_intervals_for_insertion): Declare arguments
8016 EMACS_INT.
8017
8018 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
8019
8020 * indent.c (Fvertical_motion): Local variable it_start is now
8021 EMACS_INT.
8022
8023 * regex.c (re_match, re_match_2, re_match_2_internal)
8024 (bcmp_translate, regcomp, regexec, print_double_string)
8025 (group_in_compile_stack, re_search, re_search_2, regex_compile)
8026 (re_compile_pattern, re_exec): Declare arguments and local
8027 variables `size_t' and `ssize_t' and return values `regoff_t', as
8028 appropriate.
8029 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
8030 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
8031 <compile_stack_type>: `size' and `avail' are now `size_t'.
8032
8033 * regex.h <regoff_t>: Use ssize_t, not int.
8034 (re_search, re_search_2, re_match, re_match_2): Arguments that
8035 specify buffer/string position and length are now ssize_t and
8036 size_t. Return type is regoff_t.
8037
8038 2011-04-16 Ben Key <bkey76@gmail.com>
8039
8040 * nsfont.m: Fixed bugs in ns_get_family and
8041 ns_descriptor_to_entity that were caused by using free to
8042 deallocate memory blocks that were allocated by xmalloc (via
8043 xstrdup). This caused Emacs to crash when compiled with
8044 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
8045 --enable-checking=xmallocoverrun). xfree is now used to
8046 deallocate these memory blocks.
8047
8048 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
8049
8050 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
8051
8052 emacs_write: Accept and return EMACS_INT for sizes.
8053 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
8054 et seq.
8055 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
8056 Accept and return EMACS_INT.
8057 (emacs_gnutls_write): Return the number of bytes written on
8058 partial writes.
8059 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
8060 (emacs_read, emacs_write): Remove check for negative size, as the
8061 Emacs source code has been audited now.
8062 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
8063 (emacs_read, emacs_write): Use it.
8064 * process.c (send_process): Adjust to the new signatures of
8065 emacs_write and emacs_gnutls_write. Do not attempt to store
8066 a byte offset into an 'int'; it might overflow.
8067 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
8068
8069 * sound.c: Don't assume sizes fit in 'int'.
8070 (struct sound_device.period_size, alsa_period_size):
8071 Return EMACS_INT, not int.
8072 (struct sound_device.write, vox_write, alsa_write):
8073 Accept EMACS_INT, not int.
8074 (wav_play, au_play): Use EMACS_INT to store sizes and to
8075 record read return values.
8076
8077 2011-04-15 Ben Key <bkey76@gmail.com>
8078
8079 * keyboard.c (Qundefined): Don't declare static since it is used
8080 in nsfns.m.
8081 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
8082 static since they are used in nsfont.m.
8083
8084 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
8085
8086 * process.c (Qprocessp): Don't declare static.
8087 * lisp.h (Qprocessp): Declare again.
8088
8089 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
8090
8091 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
8092
8093 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
8094
8095 Improve C-level modularity by making more things 'static'.
8096
8097 Don't publish debugger-only interfaces to other modules.
8098 * lisp.h (safe_debug_print, debug_output_compilation_hack):
8099 (verify_bytepos, count_markers): Move decls to the only modules
8100 that need them.
8101 * region-cache.h (pp_cache): Likewise.
8102 * window.h (check_all_windows): Likewise.
8103 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
8104
8105 * sysdep.c (croak): Now static, if
8106 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
8107 * syssignal.h (croak): Declare only if not static.
8108
8109 * alloc.c (refill_memory_reserve): Now static if
8110 !defined REL_ALLOC || defined SYSTEM_MALLOC.
8111 * lisp.h (refill_memory_reserve): Declare only if not static.
8112
8113 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
8114 Define only if USE_LUCID.
8115
8116 * xrdb.c (x_customization_string, x_rm_string): Now static.
8117
8118 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
8119 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
8120
8121 * xdisp.c (draw_row_with_mouse_face): Now static.
8122 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
8123
8124 * window.h (check_all_windows): Mark externally visible.
8125
8126 * window.c (window_deletion_count): Now static.
8127
8128 * undo.c: Make symbols static if they're not exported.
8129 (last_undo_buffer, last_boundary_position, pending_boundary):
8130 Now static.
8131
8132 * textprop.c (interval_insert_behind_hooks): Now static.
8133 (interval_insert_in_front_hooks): Likewise.
8134
8135 * term.c: Make symbols static if they're not exported.
8136 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
8137 (max_frame_lines, tty_set_terminal_modes):
8138 (tty_reset_terminal_modes, tty_turn_off_highlight):
8139 (get_tty_terminal): Now static.
8140 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
8141 * termhooks.h (term_mouse_moveto): Do not declare if
8142 HAVE_WINDOW_SYSTEM.
8143 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
8144 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
8145
8146 * sysdep.c: Make symbols static if they're not exported.
8147 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
8148 Now static.
8149 (sigprocmask_set, full_mask): Remove; unused.
8150 (wait_debugging): Mark as visible.
8151 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
8152 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
8153
8154 * syntax.c (syntax_temp): Define only if !__GNUC__.
8155
8156 * sound.c (current_sound_device, current_sound): Now static.
8157
8158 * search.c (searchbufs, searchbuf_head): Now static.
8159
8160 * scroll.c (scroll_cost): Remove; unused.
8161 * dispextern.h (scroll_cost): Remove decl.
8162
8163 * region-cache.h (pp_cache): Mark as externally visible.
8164
8165 * process.c: Make symbols static if they're not exported.
8166 (process_tick, update_tick, create_process, chan_process):
8167 (Vprocess_alist, proc_buffered_char, datagram_access):
8168 (fd_callback_data, send_process_frame, process_sent_to): Now static.
8169 (deactivate_process): Mark defn as static, as well as decl.
8170 * lisp.h (create_process): Remove decl.
8171 * process.h (chan_process, Vprocess_alist): Remove decls.
8172
8173 * print.c: Make symbols static if they're not exported.
8174 (print_depth, new_backquote_output, being_printed, print_buffer):
8175 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
8176 (print_interval, print_number_index, initial_stderr_stream):
8177 Now static.
8178 * lisp.h (Fprinc): Remove decl.
8179 (debug_output_compilation_hack): Mark as externally visible.
8180
8181 * sysdep.c (croak): Move decl from here to syssignal.h.
8182 * syssignal.h (croak): Put it here, so the API can be checked when
8183 'croak' is called from dissociate_if_controlling_tty.
8184
8185 * minibuf.c: Make symbols static if they're not exported.
8186 (minibuf_save_list, choose_minibuf_frame): Now static.
8187 * lisp.h (choose_minibuf_frame): Remove decl.
8188
8189 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
8190
8191 * lread.c: Make symbols static if they're not exported.
8192 (read_objects, initial_obarray, oblookup_last_bucket_number):
8193 Now static.
8194 (make_symbol): Remove; unused.
8195 * lisp.h (initial_obarray, make_symbol): Remove decls.
8196
8197 * keyboard.c: Make symbols static if they're not exported.
8198 (single_kboard, recent_keys_index, total_keys, recent_keys):
8199 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
8200 (this_single_command_key_start, echoing, last_auto_save):
8201 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
8202 (command_loop, echo_now, keyboard_init_hook, help_char_p):
8203 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
8204 (Vlispy_mouse_stem, double_click_count):
8205 Now static.
8206 (force_auto_save_soon): Define only if SIGDANGER.
8207 (ignore_mouse_drag_p): Now static if
8208 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
8209 (print_help): Remove; unused.
8210 (stop_character, last_timer_event): Mark as externally visible.
8211 * keyboard.h (ignore_mouse_drag_p): Declare only if
8212 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
8213 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
8214 * lisp.h (echoing): Remove decl.
8215 (force_auto_save_soon): Declare only if SIGDANGER.
8216 * xdisp.c (redisplay_window): Simplify code, to make it more
8217 obvious that ignore_mouse_drag_p is not accessed if !defined
8218 USE_GTK && !defined HAVE_NS.
8219
8220 * intervals.c: Make symbols static if they're not exported.
8221 (merge_properties_sticky, merge_interval_right, delete_interval):
8222 Now static.
8223 * intervals.h (merge_interval_right, delete_interval): Remove decls.
8224
8225 * insdel.c: Make symbols static if they're not exported.
8226 However, leave prepare_to_modify_buffer alone. It's never
8227 called from outside this function, but that appears to be a bug.
8228 (combine_after_change_list, combine_after_change_buffer):
8229 (adjust_after_replace, signal_before_change): Now static.
8230 (adjust_after_replace_noundo): Remove; unused.
8231 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
8232 (signal_before_change): Remove decls.
8233
8234 * indent.c (val_compute_motion, val_vmotion): Now static.
8235
8236 * image.c: Make symbols static if they're not exported.
8237 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
8238 if USE_GTK.
8239 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
8240 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
8241
8242 * fringe.c (standard_bitmaps): Now static.
8243 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
8244
8245 * frame.c: Make symbols static if they're not exported.
8246 (x_report_frame_params, make_terminal_frame): Now static.
8247 (get_frame_param): Now static, unless HAVE_NS.
8248 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
8249 (x_get_resource_string): Remove; not used.
8250 * frame.h (make_terminal_frame, x_report_frame_params):
8251 (x_get_resource_string); Remove decls.
8252 (x_fullscreen_adjust): Declare only if WINDOWSNT.
8253 * lisp.h (get_frame_param): Declare only if HAVE_NS.
8254
8255 * font.c, fontset.c: Make symbols static if they're not exported.
8256 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
8257 (FACE_SUITABLE_FOR_CHAR_P): Use it.
8258 * font.c (font_close_object): Now static.
8259 * font.h (font_close_object): Remove.
8260 * fontset.c (FONTSET_OBJLIST): Remove.
8261 (free_realized_fontset) #if-0 the body, which does nothing.
8262 (face_suitable_for_char_p): #if-0, as it's never called.
8263 * fontset.h (face_suitable_for_char_p): Remove decl.
8264 * xfaces.c (face_at_string_position):
8265 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
8266 since 0 is always ASCII.
8267
8268 * fns.c (weak_hash_tables): Now static.
8269
8270 * fileio.c: Make symbols static if they're not exported.
8271 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
8272 (Vwrite_region_annotation_buffers): Now static.
8273
8274 * eval.c: Make symbols static if they're not exported.
8275 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
8276 * lisp.h (backtrace_list): Remove decl.
8277
8278 * emacs.c: Make symbols static if they're not exported.
8279 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
8280 (fatal_error_code, fatal_error_signal_hook, standard_args):
8281 Now static.
8282 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
8283 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
8284 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
8285 * lisp.h (fatal_error_signal_hook): Remove decl.
8286 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
8287
8288 * editfns.c: Move a (normally-unused) function to its only use.
8289 * editfns.c, lisp.h (get_operating_system_release): Remove.
8290 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
8291 worth the hassle of breaking this out.
8292
8293 * xterm.c: Make symbols static if they're not exported.
8294 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
8295 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
8296 (x_destroy_window, x_delete_display):
8297 Now static.
8298 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
8299 (x_mouse_leave): Remove; unused.
8300 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
8301 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
8302 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
8303 Remove decls.
8304 (x_mouse_leave): Declare only if WINDOWSNT.
8305 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
8306 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
8307 USE_X_TOOLKIT.
8308
8309 * ftxfont.c: Make symbols static if they're not exported.
8310 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
8311 HAVE_FREETYPE.
8312 * font.h (ftxfont_driver): Likewise.
8313
8314 * xfns.c: Make symbols static if they're not exported.
8315 (x_last_font_name, x_display_info_for_name):
8316 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
8317 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
8318 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
8319 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
8320 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
8321 (last_show_tip_args): Now static.
8322 (xic_defaut_fontset, xic_create_fontsetname): Define only if
8323 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
8324 (x_screen_planes): Remove; unused.
8325 * dispextern.h (x_screen_planes): Remove decl.
8326
8327 * dispnew.c: Make symbols static if they're not exported.
8328 * dispextern.h (redraw_garbaged_frames, scrolling):
8329 (increment_row_positions): Remove.
8330 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
8331 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
8332 Now static.
8333 (redraw_garbaged_frames): Remove; unused.
8334
8335 * xfaces.c: Make symbols static if they're not exported.
8336 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
8337 Remove decls.
8338 * xterm.h (defined_color): Remove decls.
8339 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
8340 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
8341 (menu_face_changed_default, defined_color, free_realized_face):
8342 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
8343 (ascii_face_of_lisp_face): Remove; unused.
8344
8345 * xdisp.c: Make symbols static if they're not exported.
8346 * dispextern.h (scratch_glyph_row, window_box_edges):
8347 (glyph_to_pixel_coords, set_cursor_from_row):
8348 (get_next_display_element, set_iterator_to_next):
8349 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
8350 (show_mouse_face): Remove decls
8351 * frame.h (message_buf_print): Likewise.
8352 * lisp.h (pop_message, set_message, check_point_in_composition):
8353 Likewise.
8354 * xterm.h (set_vertical_scroll_bar): Likewise.
8355 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
8356 (message_buf_print, scratch_glyph_row, displayed_buffer):
8357 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
8358 (get_next_display_element, show_mouse_face, window_box_edges):
8359 (frame_to_window_pixel_xy, check_point_in_composition):
8360 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
8361 (glyph_to_pixel_coords): Remove; unused.
8362
8363 * dired.c (file_name_completion): Now static.
8364
8365 * dbusbind.c (xd_in_read_queued_messages): Now static.
8366
8367 * lisp.h (circular_list_error, FOREACH): Remove; unused.
8368 * data.c (circular_list_error): Remove.
8369
8370 * commands.h (last_point_position, last_point_position_buffer):
8371 (last_point_position_window): Remove decls.
8372 * keyboard.c: Make these variables static.
8373
8374 * coding.h (coding, code_convert_region, encode_coding_gap):
8375 Remove decls.
8376 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
8377 (iso_code_class, detect_coding, code_convert_region): Now static.
8378 (encode_coding_gap): Remove; unused.
8379
8380 * chartab.c (chartab_chars, chartab_bits): Now static.
8381
8382 * charset.h (charset_iso_8859_1): Remove decl.
8383 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
8384 Now static.
8385
8386 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
8387 * ccl.c (Vccl_program_table): Now static.
8388 (check_ccl_update): Remove; unused.
8389
8390 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
8391 * category.h: ... from here.
8392 * category.c (check_category_table, set_category_set): Now static.
8393
8394 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
8395 * lisp.h: Remove these decls.
8396
8397 * buffer.c (buffer_count): Remove unused var.
8398
8399 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
8400 so that it's not optimized away.
8401 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
8402 * dispextern.h (bidi_dump_cached_states): Remove, since it's
8403 exported only to the debugger.
8404
8405 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
8406 * atimer.h (run_all_atimers): Remove; not exported.
8407
8408 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
8409 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
8410 was inaccessible from Lisp.
8411 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
8412 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
8413
8414 alloc.c: Import and export fewer symbols, and remove unused items.
8415 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
8416 is defined.
8417 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
8418 it's not optimized away by whole-program optimization.
8419 (message_enable_multibyte, free_misc): Remove.
8420 (catchlist, handlerlist, mark_backtrace):
8421 Declare only if BYTE_MARK_STACK.
8422 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
8423 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
8424 (message_enable_multibyte): Remove decl.
8425 (free_misc, interval_free_list, float_block, float_block_index):
8426 (n_float_blocks, float_free_list, cons_block, cons_block_index):
8427 (cons_free_list, last_marked_index):
8428 Now static.
8429 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
8430 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
8431 (mark_backtrace): Define only if BYTE_MARK_STACK.
8432 * xdisp.c (message_enable_multibyte): Now static.
8433
8434 Declare Lisp_Object Q* variables to be 'static' if not exported.
8435 This makes it easier for human readers (and static analyzers)
8436 to see whether these variables are used from other modules.
8437 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
8438 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
8439 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
8440 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
8441 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
8442 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
8443 * xmenu.c, xselect.c:
8444 Declare Q* vars static if they are not used in other modules.
8445 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
8446 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
8447 Remove decls of unexported vars.
8448 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
8449
8450 * lisp.h (DEFINE_FUNC): Make sname 'static'.
8451
8452 Make Emacs functions such as Fatom 'static' by default.
8453 This makes it easier for human readers (and static analyzers)
8454 to see whether these functions can be called from other modules.
8455 DEFUN now defines a static function. To make the function external
8456 so that it can be used in other C modules, use the new macro DEFUE.
8457 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
8458 (Finit_image_library):
8459 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
8460 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
8461 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
8462 Remove decls, since these functions are now static.
8463 (Funintern, Fget_internal_run_time): New decls, since these functions
8464 were already external.
8465
8466 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
8467 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
8468 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
8469 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
8470 * keyboard.c, keymap.c, lread.c:
8471 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
8472 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
8473 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
8474 Mark functions with DEFUE instead of DEFUN,
8475 if they are used in other modules.
8476 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
8477 decls for now-static functions.
8478 * buffer.h (Fdelete_overlay): Remove decl.
8479 * callproc.c (Fgetenv_internal): Mark as internal.
8480 * composite.c (Fremove_list_of_text_properties): Remove decl.
8481 (Fcomposition_get_gstring): New forward static decl.
8482 * composite.h (Fcomposite_get_gstring): Remove decl.
8483 * dired.c (Ffile_attributes): New forward static decl.
8484 * doc.c (Fdocumntation_property): New forward static decl.
8485 * eval.c (Ffetch_bytecode): New forward static decl.
8486 (Funintern): Remove extern decl; now in .h file where it belongs.
8487 * fileio.c (Fmake_symbolic_link): New forward static decl.
8488 * image.c (Finit_image_library): New forward static decl.
8489 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
8490 * intervals.h (Fprevious_property_change):
8491 (Fremove_list_of_text_properties): Remove decls.
8492 * keyboard.c (Fthis_command_keys): Remove decl.
8493 (Fcommand_execute): New forward static decl.
8494 * keymap.c (Flookup_key): New forward static decl.
8495 (Fcopy_keymap): Now static.
8496 * keymap.h (Flookup_key): Remove decl.
8497 * process.c (Fget_process): New forward static decl.
8498 (Fprocess_datagram_address): Mark as internal.
8499 * syntax.c (Fsyntax_table_p): New forward static decl.
8500 (skip_chars): Remove duplicate decl.
8501 * textprop.c (Fprevious_property_change): New forward static decl.
8502 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
8503 Now internal.
8504 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
8505 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
8506
8507 * editfns.c (Fformat): Remove unreachable code.
8508
8509 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
8510
8511 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
8512 change. (Bug#8496)
8513
8514 2011-04-13 Eli Zaretskii <eliz@gnu.org>
8515
8516 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
8517 when at ZV. (Bug#8487)
8518
8519 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
8520
8521 * charset.c (Fclear_charset_maps): Use xfree instead of free.
8522 (Bug#8437)
8523 * keyboard.c (parse_tool_bar_item): Likewise.
8524 * sound.c (sound_cleanup, alsa_close): Likewise.
8525 * termcap.c (tgetent): Likewise.
8526 * xfns.c (x_default_font_parameter): Likewise.
8527 * xsettings.c (read_and_apply_settings): Likewise.
8528
8529 * alloc.c (overrun_check_malloc, overrun_check_realloc)
8530 (overrun_check_free): Protoize.
8531
8532 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
8533
8534 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
8535 since callers should never pass a negative size.
8536 Change the signature to match that of plain 'read' and 'write'; see
8537 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
8538 * lisp.h: Update prototypes of emacs_write and emacs_read.
8539
8540 2011-04-11 Eli Zaretskii <eliz@gnu.org>
8541
8542 * xdisp.c (redisplay_window): Don't try to determine the character
8543 position of the scroll margin if the window start point w->startp
8544 is outside the buffer's accessible region. (Bug#8468)
8545
8546 2011-04-10 Eli Zaretskii <eliz@gnu.org>
8547
8548 Fix write-region and its subroutines for buffers > 2GB.
8549 * fileio.c (a_write, e_write): Modify declaration of arguments and
8550 local variables to support buffers larger than 2GB.
8551 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
8552
8553 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
8554 argument, local variables, and return value.
8555
8556 * lisp.h: Update prototypes of emacs_write and emacs_read.
8557
8558 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
8559
8560 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
8561
8562 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
8563
8564 Fix more problems found by GCC 4.6.0's static checks.
8565
8566 * xdisp.c (vmessage): Use a better test for character truncation.
8567
8568 * charset.c (load_charset_map): <, not <=, for optimization,
8569 and to avoid potential problems with integer overflow.
8570 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
8571 * casetab.c (set_identity, shuffle): Likewise.
8572 * editfns.c (Fformat): Likewise.
8573 * syntax.c (skip_chars): Likewise.
8574
8575 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
8576 This also lets GCC 4.6.0 generate slightly better loop code.
8577
8578 * callint.c (Fcall_interactively): <, not <=, for optimization.
8579 (Fcall_interactively): Count the number of arguments produced,
8580 not the number of arguments given. This is simpler and lets GCC
8581 4.6.0 generate slightly better code.
8582
8583 * ftfont.c: Distingish more carefully between FcChar8 and char.
8584 The previous code passed unsigned char * to a functions like
8585 strlen and xstrcasecmp that expect char *, which does not
8586 conform to the C standard.
8587 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
8588 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
8589 char * when the C standard requires it.
8590
8591 * keyboard.c (read_char): Remove unused var.
8592
8593 * eval.c: Port to Windows vsnprintf (Bug#8435).
8594 Include <limits.h>.
8595 (SIZE_MAX): Define if the headers do not.
8596 (verror): Do not give up if vsnprintf returns a negative count.
8597 Instead, grow the buffer. This ports to Windows vsnprintf, which
8598 does not conform to C99. Problem reported by Eli Zaretskii.
8599 Also, simplify the allocation scheme, by avoiding the need for
8600 calling realloc, and removing the ALLOCATED variable.
8601
8602 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
8603
8604 Remove invocations of doprnt, as Emacs now uses vsnprintf.
8605 But keep the doprint source code for now, as we might revamp it
8606 and use it again (Bug#8435).
8607 * lisp.h (doprnt): Remove.
8608 * Makefile.in (base_obj): Remove doprnt.o.
8609 * deps.mk (doprnt.o): Remove.
8610
8611 error: Print 32- and 64-bit integers portably (Bug#8435).
8612 Without this change, on typical 64-bit hosts error ("...%d...", N)
8613 was used to print both 32- and 64-bit integers N, which relied on
8614 undefined behavior.
8615 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
8616 * lisp.h (error, verror): Mark as printf-like functions.
8617 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
8618 Report overflow in size calculations when allocating printf buffer.
8619 Do not truncate output string at its first null byte.
8620 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
8621 Truncate the output at a character boundary, since vsnprintf does not
8622 do that.
8623 * charset.c (check_iso_charset_parameter): Convert internal
8624 character to string before calling 'error', since %c now has the
8625 printf meaning.
8626 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
8627 overflow when computing char to be passed to 'error'. Do not
8628 pass Lisp_Object to 'error'; pass the integer instead.
8629 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
8630 formatted with plain %d.
8631
8632 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
8633
8634 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
8635
8636 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
8637
8638 * xterm.c (x_catch_errors): Remove duplicate declaration.
8639
8640 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
8641
8642 * xdisp.c, lisp.h (message_nolog): Remove; unused.
8643
8644 2011-04-10 Jim Meyering <meyering@redhat.com>
8645
8646 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
8647 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
8648 return ssize_t not "int", and use size_t as the buffer length.
8649 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
8650 * gnutls.h: Update declarations.
8651 * process.c (read_process_output): Use ssize_t, to match.
8652 (send_process): Likewise.
8653
8654 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
8655
8656 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
8657
8658 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
8659
8660 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
8661 Use unsigned char, to match FcChar8 type definition.
8662
8663 * xterm.c (handle_one_xevent):
8664 * xmenu.c (create_and_show_popup_menu):
8665 * xselect.c (x_decline_selection_request)
8666 (x_reply_selection_request): Avoid type-punned deref of X events.
8667
8668 2011-04-09 Eli Zaretskii <eliz@gnu.org>
8669
8670 Fix some uses of `int' instead of EMACS_INT.
8671 * search.c (string_match_1, fast_string_match)
8672 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
8673 (scan_buffer, find_next_newline_no_quit)
8674 (find_before_next_newline, search_command, Freplace_match)
8675 (Fmatch_data): Make some `int' variables be EMACS_INT.
8676
8677 * xdisp.c (display_count_lines): 3rd argument and return value now
8678 EMACS_INT. All callers changed.
8679 (pint2hrstr): Last argument is now EMACS_INT.
8680
8681 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
8682 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
8683 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
8684 (decode_coding_utf_16, decode_coding_emacs_mule)
8685 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
8686 (decode_coding_ccl, decode_coding_charset)
8687 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
8688 (decode_coding_iso_2022, decode_coding_emacs_mule)
8689 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
8690 <char_offset, last_offset>: Declare EMACS_INT.
8691 (encode_coding_utf_8, encode_coding_utf_16)
8692 (encode_coding_emacs_mule, encode_invocation_designation)
8693 (encode_designation_at_bol, encode_coding_iso_2022)
8694 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
8695 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
8696 Declare EMACS_INT.
8697 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
8698 (encode_invocation_designation): Last argument P_NCHARS is now
8699 EMACS_INT.
8700 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
8701 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
8702
8703 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
8704 All users changed.
8705
8706 * ccl.c (Fccl_execute_on_string): Declare some variables
8707 EMACS_INT.
8708
8709 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
8710
8711 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
8712
8713 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
8714
8715 * process.c (Fformat_network_address): Doc fix.
8716
8717 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
8718
8719 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
8720
8721 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
8722
8723 * keyboard.c (read_char): Call Lisp function help-form-show,
8724 instead of using internal_with_output_to_temp_buffer.
8725 (Qhelp_form_show): New var.
8726 (syms_of_keyboard): Use DEFSYM macro.
8727
8728 * print.c (internal_with_output_to_temp_buffer): Function deleted.
8729
8730 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
8731
8732 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
8733
8734 * process.c (Flist_processes): Remove to Lisp.
8735 (list_processes_1): Delete.
8736
8737 2011-04-06 Eli Zaretskii <eliz@gnu.org>
8738
8739 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
8740
8741 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
8742
8743 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
8744
8745 Fix more problems found by GCC 4.6.0's static checks.
8746
8747 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
8748
8749 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
8750
8751 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
8752
8753 * xdisp.c (vmessage): Mark as a printf-like function.
8754
8755 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
8756
8757 * sound.c (sound_warning): Don't crash if arg contains a printf format.
8758
8759 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
8760 printf-like functions.
8761 (tiff_load): Add casts to remove these marks before passing them
8762 to system-supplied API.
8763
8764 * eval.c (Fsignal): Remove excess argument to 'fatal'.
8765
8766 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
8767 This avoids several warnings with gcc -Wstrict-overflow.
8768 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
8769 directly, rather than having caller test rule sign. This avoids
8770 some unnecessary tests.
8771 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
8772 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
8773 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
8774
8775 * xfont.c (xfont_text_extents): Remove var that was set but not used.
8776 (xfont_open): Avoid unnecessary tests.
8777
8778 * composite.c (composition_gstring_put_cache): Use unsigned integer.
8779
8780 * composite.h, composite.c (composition_gstring_put_cache):
8781 Use EMACS_INT, not int, for length.
8782
8783 * composite.h (COMPOSITION_DECODE_REFS): New macro,
8784 breaking out part of COMPOSITION_DECODE_RULE.
8785 (COMPOSITION_DECODE_RULE): Use it.
8786 * composite.c (get_composition_id): Remove unused local vars,
8787 by using the new macro.
8788
8789 * textprop.c (set_text_properties_1): Change while to do-while,
8790 since the condition is always true at first.
8791
8792 * intervals.c (graft_intervals_into_buffer): Mark var as used.
8793 (interval_deletion_adjustment): Return unsigned value.
8794 All uses changed.
8795
8796 * process.c (list_processes_1, create_pty, read_process_output):
8797 (exec_sentinel): Remove vars that were set but not used.
8798 (create_pty): Remove unnecessary "volatile"s.
8799 (Fnetwork_interface_info): Avoid possibility of int overflow.
8800 (read_process_output): Do adaptive read buffering even if carryover.
8801 (read_process_output): Simplify nbytes computation if buffered.
8802
8803 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
8804
8805 * syntax.c (scan_words): Remove var that was set but not used.
8806 (update_syntax_table): Use unsigned instead of int.
8807
8808 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
8809 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
8810 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
8811
8812 * print.c (print_error_message): Avoid int overflow.
8813
8814 * font.c (font_list_entities): Redo for clarity,
8815 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
8816
8817 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
8818 (font_score): Avoid potential overflow in diff calculation.
8819
8820 * fns.c (substring_both): Remove var that is set but not used.
8821 (sxhash): Redo loop for clarity and to avoid wraparound warning.
8822
8823 * eval.c (funcall_lambda): Rename local to avoid shadowing.
8824
8825 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
8826 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
8827 can always succeed if overflow has undefined behavior.
8828
8829 * search.c (boyer_moore, wordify): Remove vars set but not used.
8830 (wordify): Omit three unnecessary tests.
8831
8832 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
8833 All callers changed. This avoids the need for an unused var.
8834
8835 * casefiddle.c (casify_region): Remove var that is set but not used.
8836
8837 * dired.c (file_name_completion): Remove var that is set but not used.
8838
8839 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
8840
8841 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
8842 (Finsert_file_contents): Remove unnecessary code checking fd.
8843
8844 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
8845 Check for integer overflow on size calculations.
8846
8847 * buffer.c (Fprevious_overlay_change): Remove var that is set
8848 but not used.
8849
8850 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
8851 Remove vars that are set but not used.
8852 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
8853 (timer_check_2): Mark vars as initialized.
8854
8855 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
8856
8857 * image.c (lookup_image): Remove var that is set but not used.
8858 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
8859
8860 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
8861 that are set but not used.
8862
8863 * xfns.c (make_invisible_cursor): Don't return garbage
8864 if XCreateBitmapFromData fails (Bug#8410).
8865
8866 * xselect.c (x_get_local_selection, x_handle_property_notify):
8867 Remove vars that are set but not used.
8868
8869 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
8870 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
8871
8872 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
8873 Remove var that is set but not used.
8874 (scroll_bar_windows_size): Now size_t, not int.
8875 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
8876 Check for overflow.
8877
8878 * xfaces.c (realize_named_face): Remove vars that are set but not used.
8879 (map_tty_color) [!defined MSDOS]: Likewise.
8880
8881 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
8882
8883 * coding.c: Remove vars that are set but not used.
8884 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
8885 All callers changed.
8886 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
8887 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
8888 (decode_coding_charset): Remove vars that are set but not used.
8889
8890 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
8891 that is set but not used.
8892
8893 * print.c (print_object): Remove var that is set but not used.
8894
8895 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
8896 The gnulib version avoids calling malloc in the usual case,
8897 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
8898 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
8899 * filelock.c (current_lock_owner): Likewise.
8900 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
8901 * sysdep.c: Include allocator.h, careadlinkat.h.
8902 (emacs_no_realloc_allocator): New static constant.
8903 (emacs_readlink): New function.
8904 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
8905 ../lib/careadlinkat.h.
8906
8907 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
8908
8909 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
8910 first non-nil return value).
8911
8912 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
8913
8914 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
8915 if not defined (Bug#8403).
8916
8917 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
8918
8919 * xdisp.c (display_count_lines): Remove parameter `start',
8920 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
8921 (get_char_face_and_encoding): Remove parameter `multibyte_p',
8922 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
8923 (fill_stretch_glyph_string): Remove parameters `row' and `area',
8924 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
8925 and thereabouts. All callers changed.
8926 (get_per_char_metric): Remove parameter `f', unused since
8927 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
8928
8929 2011-04-02 Jim Meyering <meyering@redhat.com>
8930
8931 do not dereference NULL upon failed strdup
8932 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
8933 (ns_get_family): Likewise.
8934
8935 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
8936
8937 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
8938
8939 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
8940
8941 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
8942 later (Bug#8403).
8943
8944 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
8945
8946 Add lexical binding.
8947
8948 * window.c (Ftemp_output_buffer_show): New fun.
8949 (Fsave_window_excursion):
8950 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
8951
8952 * lread.c (lisp_file_lexically_bound_p): New function.
8953 (Fload): Bind Qlexical_binding.
8954 (readevalloop): Remove `evalfun' arg.
8955 Bind Qinternal_interpreter_environment.
8956 (Feval_buffer): Bind Qlexical_binding.
8957 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
8958 Mark as dynamic.
8959 (syms_of_lread): Declare `lexical-binding'.
8960
8961 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
8962
8963 * keyboard.c (eval_dyn): New fun.
8964 (menu_item_eval_property): Use it.
8965
8966 * image.c (parse_image_spec): Use Ffunctionp.
8967
8968 * fns.c (concat, mapcar1): Accept byte-code-functions.
8969
8970 * eval.c (Fsetq): Handle lexical vars.
8971 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
8972 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
8973 (FletX, Flet): Obey lexical binding.
8974 (Fcommandp): Handle closures.
8975 (Feval): New `lexical' arg.
8976 (eval_sub): New function extracted from Feval. Use it almost
8977 everywhere where Feval was used. Look up vars in lexical env.
8978 Handle closures.
8979 (Ffunctionp): Move from subr.el.
8980 (Ffuncall): Handle closures.
8981 (apply_lambda): Remove `eval_flags'.
8982 (funcall_lambda): Handle closures and new byte-code-functions.
8983 (Fspecial_variable_p): New function.
8984 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
8985 but without exporting it to Lisp.
8986
8987 * doc.c (Fdocumentation, store_function_docstring):
8988 * data.c (Finteractive_form): Handle closures.
8989
8990 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
8991 interactive spec.
8992
8993 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
8994 New byte-codes.
8995 (exec_byte_code): New function extracted from Fbyte_code to handle new
8996 calling convention for byte-code-functions. Add new byte-codes.
8997
8998 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
8999
9000 * alloc.c (Fmake_symbol): Init new `declared_special' field.
9001
9002 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
9003
9004 * xdisp.c (redisplay_internal): Fix prototype.
9005
9006 2011-03-31 Eli Zaretskii <eliz@gnu.org>
9007
9008 * xdisp.c (SCROLL_LIMIT): New macro.
9009 (try_scrolling): Use it when setting scroll_limit.
9010 Limit scrolling to 100 screen lines.
9011 (redisplay_window): Even when falling back on "recentering",
9012 position point in the window according to scroll-conservatively,
9013 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
9014
9015 (try_scrolling): When point is above the window, allow searching
9016 as far as scroll_max, or one screenful, to compute vertical
9017 distance from PT to the scroll margin position. This prevents
9018 try_scrolling from unnecessarily failing when
9019 scroll-conservatively is set to a value slightly larger than the
9020 window height. Clean up the case of PT below the margin at bottom
9021 of window: scroll_max can no longer be INT_MAX. When aggressive
9022 scrolling is in use, don't let point enter the opposite scroll
9023 margin as result of the scroll.
9024 (syms_of_xdisp) <scroll-conservatively>: Document the
9025 threshold of 100 lines for never-recentering scrolling.
9026
9027 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
9028
9029 * dispextern.h (move_it_by_lines):
9030 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
9031 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
9032 (message_log_check_duplicate): Remove parameters `prev_bol' and
9033 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
9034 (redisplay_internal): Remove parameter `preserve_echo_area',
9035 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
9036
9037 * indent.c (Fvertical_motion):
9038 * window.c (window_scroll_pixel_based, Frecenter):
9039 Don't pass `need_y_p' to `move_it_by_lines'.
9040
9041 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
9042
9043 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
9044 steal a few bits to be more compact.
9045 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
9046 Remove unneeded casts.
9047
9048 * bytecode.c (Fbyte_code): CAR and CDR can GC.
9049
9050 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
9051
9052 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
9053 binding" message (bug#7967).
9054
9055 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
9056
9057 Fix more problems found by GCC 4.6.0's static checks.
9058
9059 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
9060 Remove unused local var.
9061
9062 * editfns.c (Fmessage_box): Remove unused local var.
9063
9064 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
9065 (note_mode_line_or_margin_highlight, note_mouse_highlight):
9066 Omit unused local vars.
9067 * window.c (shrink_windows): Omit unused local var.
9068 * menu.c (digest_single_submenu): Omit unused local var.
9069 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
9070 Omit unused local var.
9071
9072 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
9073 Don't assume string length fits in int.
9074 (keyremap_step, read_key_sequence): Use size_t for sizes.
9075 (read_key_sequence): Don't check last_real_key_start redundantly.
9076
9077 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
9078 instead of alloca (Bug#8344).
9079
9080 * eval.c (Fbacktrace): Don't assume nargs fits in int.
9081 (Fbacktrace_frame): Don't assume nframes fits in int.
9082
9083 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
9084
9085 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
9086 concerns.
9087
9088 * term.c (produce_glyphless_glyph): Remove unnecessary test.
9089
9090 * cm.c (calccost): Turn while-do into do-while, for clarity.
9091
9092 * keyboard.c (syms_of_keyboard): Use the same style as later
9093 in this function when indexing through an array. This also
9094 works around GCC bug 48267.
9095
9096 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
9097
9098 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
9099
9100 * chartab.c (sub_char_table_ref_and_range): Redo for slight
9101 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
9102
9103 * keyboard.c, keyboard.h (num_input_events): Now size_t.
9104 This avoids undefined behavior on integer overflow, and is a bit
9105 more convenient anyway since it is compared to a size_t variable.
9106
9107 Variadic C functions now count arguments with size_t, not int.
9108 This avoids an unnecessary limitation on 64-bit machines, which
9109 caused (substring ...) to crash on large vectors (Bug#8344).
9110 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
9111 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
9112 All variadic functions and their callers changed accordingly.
9113 (struct gcpro.nvars): Now size_t, not int. All uses changed.
9114 * data.c (arith_driver, float_arith_driver): Likewise.
9115 * editfns.c (general_insert_function): Likewise.
9116 * eval.c (struct backtrace.nargs, interactive_p)
9117 (internal_condition_case_n, run_hook_with_args, apply_lambda)
9118 (funcall_lambda, mark_backtrace): Likewise.
9119 * fns.c (concat): Likewise.
9120 * frame.c (x_set_frame_parameters): Likewise.
9121 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
9122 0 if not found, not -1. All callers changed.
9123
9124 * alloc.c (garbage_collect): Don't assume stack size fits in int.
9125 (stack_copy_size): Now size_t, not int.
9126 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
9127
9128 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
9129
9130 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
9131 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
9132 All callers changed.
9133
9134 * lisp.h (multibyte_char_to_unibyte):
9135 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
9136 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
9137 * character.h (CHAR_TO_BYTE8):
9138 * cmds.c (internal_self_insert):
9139 * editfns.c (general_insert_function):
9140 * keymap.c (push_key_description):
9141 * search.c (Freplace_match):
9142 * xdisp.c (message_dolog, set_message_1): All callers changed.
9143
9144 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
9145
9146 * keyboard.c (safe_run_hook_funcall): New function.
9147 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
9148 don't set the hook to nil, but remove the offending function instead.
9149 (Qcommand_hook_internal): Remove, unused.
9150 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
9151 Vcommand_hook_internal.
9152
9153 * eval.c (enum run_hooks_condition): Remove.
9154 (funcall_nil, funcall_not): New functions.
9155 (run_hook_with_args): Call each function through a `funcall' argument.
9156 Remove `cond' argument, now redundant.
9157 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
9158 (Frun_hook_with_args_until_failure): Adjust accordingly.
9159 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
9160
9161 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
9162
9163 * dispextern.h (string_buffer_position): Remove declaration.
9164
9165 * print.c (strout): Remove parameter `multibyte', unused since
9166 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
9167
9168 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
9169 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
9170 All callers changed.
9171
9172 * w32.c (_wsa_errlist): Use braces for struct initializers.
9173
9174 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
9175 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
9176 All callers changed.
9177 (string_buffer_position): Likewise. Also, make static (it's never
9178 used outside xdisp.c).
9179 (cursor_row_p): Remove parameter `w', unused since
9180 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
9181 (decode_mode_spec): Remove parameter `precision', introduced during
9182 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
9183 All callers changed.
9184
9185 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
9186
9187 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
9188
9189 2011-03-27 Anders Lindgren <andlind@gmail.com>
9190
9191 * nsterm.m (ns_menu_bar_is_hidden): New variable.
9192 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
9193 (ns_update_auto_hide_menu_bar): New functions.
9194 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
9195 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
9196 ns_constrain_all_frames.
9197 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
9198 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
9199
9200 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
9201
9202 * nsmenu.m (runDialogAt): Remove argument to timer_check.
9203
9204 2011-03-27 Glenn Morris <rgm@gnu.org>
9205
9206 * syssignal.h: Replace RETSIGTYPE with void.
9207 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
9208 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
9209 Replace SIGTYPE with void everywhere.
9210 * s/usg5-4-common.h (SIGTYPE): Remove definition.
9211 * s/template.h (SIGTYPE): Remove commented out definition.
9212
9213 2011-03-26 Eli Zaretskii <eliz@gnu.org>
9214
9215 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
9216 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
9217
9218 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
9219
9220 * w32.c (read_unc_volume): Use parameter `henum', instead of
9221 global variable `wget_enum_handle'.
9222
9223 * keymap.c (describe_vector): Remove parameters `indices' and
9224 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
9225 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
9226
9227 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
9228
9229 * keyboard.c (timer_check): Remove parameter `do_it_now',
9230 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
9231 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
9232 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
9233
9234 * keyboard.c (read_char):
9235 * w32menu.c (w32_menu_display_help):
9236 * xmenu.c (show_help_event, menu_help_callback):
9237 Adjust calls to `show_help_echo'.
9238
9239 * gtkutil.c (xg_maybe_add_timer):
9240 * keyboard.c (readable_events):
9241 * process.c (wait_reading_process_output):
9242 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
9243
9244 * insdel.c (adjust_markers_gap_motion):
9245 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
9246 (gap_left, gap_right): Don't call it.
9247
9248 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
9249
9250 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
9251 incurred during fontification.
9252
9253 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
9254
9255 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
9256 (DEFVAR_PER_BUFFER): Don't pass it.
9257
9258 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
9259 (scrolling_window): Don't pass it.
9260
9261 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
9262
9263 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
9264
9265 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
9266 and `suffix'.
9267 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
9268 of variables specific to SELinux and computation of `encoded_absname'.
9269
9270 * image.c (XPutPixel): Remove unused variable `height'.
9271
9272 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
9273
9274 * unexw32.c (get_section_info): Remove unused variable `section'.
9275
9276 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
9277 (system_process_attributes): Remove unused variable `sess'.
9278 (sys_read): Remove unused variable `err'.
9279
9280 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
9281 (w32_wnd_proc): Remove unused variable `isdead'.
9282 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
9283 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
9284 (x_create_tip_frame): Remove unused variable `tem'.
9285
9286 * w32inevt.c (w32_console_read_socket):
9287 Remove unused variable `no_events'.
9288
9289 * w32term.c (x_draw_composite_glyph_string_foreground):
9290 Remove unused variable `width'.
9291
9292 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
9293
9294 * w32term.c (x_set_glyph_string_clipping):
9295 Don't pass uninitialized region to CombineRgn.
9296
9297 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
9298
9299 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
9300 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
9301 (Fx_close_connection): Remove unused variable `i'.
9302
9303 * w32font.c (w32font_draw): Return number of glyphs.
9304 (w32font_open_internal): Remove unused variable `i'.
9305 (w32font_driver): Add missing initializer.
9306
9307 * w32menu.c (utf8to16): Remove unused variable `utf16'.
9308 (fill_in_menu): Remove unused variable `items_added'.
9309
9310 * w32term.c (last_mouse_press_frame): Remove static global variable.
9311 (w32_clip_to_row): Remove unused variable `f'.
9312 (x_delete_terminal): Remove unused variable `i'.
9313
9314 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
9315 (NOTHING): Remove unused static global variable.
9316 (uniscribe_check_otf): Remove unused variable `table'.
9317 (uniscribe_font_driver): Add missing initializers.
9318
9319 2011-03-23 Julien Danjou <julien@danjou.info>
9320
9321 * term.c (Fsuspend_tty, Fresume_tty):
9322 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
9323 * window.c (temp_output_buffer_show):
9324 * insdel.c (signal_before_change):
9325 * frame.c (Fhandle_switch_frame):
9326 * fileio.c (Fdo_auto_save):
9327 * emacs.c (Fkill_emacs):
9328 * editfns.c (save_excursion_restore):
9329 * cmds.c (internal_self_insert):
9330 * callint.c (Fcall_interactively):
9331 * buffer.c (Fkill_all_local_variables):
9332 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
9333 Use Frun_hooks.
9334 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
9335 unconditionally since it does the check itself.
9336
9337 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
9338
9339 Fix more problems found by GCC 4.5.2's static checks.
9340
9341 * coding.c (encode_coding_raw_text): Avoid unnecessary test
9342 the first time through the loop, since we know p0 < p1 then.
9343 This also avoids a gcc -Wstrict-overflow warning.
9344
9345 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
9346 leading to a memory leak, possible in functions like
9347 load_charset_map_from_file that can allocate an unbounded number
9348 of objects (Bug#8318).
9349
9350 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
9351 that could (at least in theory) be that large.
9352
9353 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
9354 This is less likely to overflow, and avoids undefined behavior if
9355 overflow does occur. All callers changed. Use strtoul to scan
9356 for the unsigned long integer.
9357 (pint2hrstr): Simplify and tune code slightly.
9358 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
9359
9360 * scroll.c (do_scrolling): Work around GCC bug 48228.
9361 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
9362
9363 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
9364 This also avoids a warning with gcc -Wstrict-overflow.
9365 (validate_x_resource_name): Simplify count usage.
9366 This also avoids a warning with gcc -Wstrict-overflow.
9367
9368 * fileio.c (Fcopy_file): Report error if fchown or fchmod
9369 fail (Bug#8306).
9370
9371 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
9372
9373 * process.c (Fmake_network_process): Use socklen_t, not int,
9374 where POSIX says socklen_t is required in portable programs.
9375 This fixes a porting bug on hosts like 64-bit HP-UX, where
9376 socklen_t is wider than int (Bug#8277).
9377 (Fmake_network_process, server_accept_connection):
9378 (wait_reading_process_output, read_process_output):
9379 Likewise.
9380
9381 * process.c: Rename or move locals to avoid shadowing.
9382 (list_processes_1, Fmake_network_process):
9383 (read_process_output_error_handler, exec_sentinel_error_handler):
9384 Rename or move locals.
9385 (Fmake_network_process): Define label "retry_connect" only if needed.
9386 (Fnetwork_interface_info): Fix pointer signedness.
9387 (process_send_signal): Add cast to avoid pointer signedness problem.
9388 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
9389 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
9390
9391 Make tparam.h and terminfo.c consistent.
9392 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
9393 Include tparam.h instead, since it declares them.
9394 * cm.h (PC): Remove extern decl; tparam.h now does this.
9395 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
9396 * terminfo.c: Include tparam.h, to check interfaces.
9397 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
9398 (tparam): Adjust signature to match interface in tparam.h;
9399 this removes some undefined behavior. Check that outstring and len
9400 are zero, which they always are with Emacs.
9401 * tparam.h (PC, BC, UP): New extern decls.
9402
9403 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
9404 (xftfont_open): Rename locals to avoid shadowing.
9405
9406 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
9407 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
9408 (OTF_TAG_SYM): Omit macro if not needed.
9409 (ftfont_list): Remove unused local.
9410 (get_adstyle_property, ftfont_pattern_entity):
9411 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
9412 Rename locals to avoid shadowing.
9413
9414 * xfont.c (xfont_list_family): Mark var as initialized.
9415
9416 * xml.c (make_dom): Now static.
9417
9418 * composite.c (composition_compute_stop_pos): Rename local to
9419 avoid shadowing.
9420 (composition_reseat_it): Remove unused locals.
9421 (find_automatic_composition, composition_adjust_point): Likewise.
9422 (composition_update_it): Mark var as initialized.
9423 (find_automatic_composition): Mark vars as initialized,
9424 with a FIXME (Bug#8290).
9425
9426 character.h: Rename locals to avoid shadowing.
9427 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
9428 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
9429 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
9430 (BUF_DEC_POS): Be more systematic about renaming local temporaries
9431 to avoid shadowing.
9432
9433 * textprop.c (property_change_between_p): Remove; unused.
9434
9435 * intervals.c (interval_start_pos): Now static.
9436
9437 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
9438
9439 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
9440 Rename locals to avoid shadowing.
9441
9442 * sound.c (wav_play, au_play, Fplay_sound_internal):
9443 Fix pointer signedness.
9444 (alsa_choose_format): Remove unused local var.
9445 (wav_play): Initialize a variable to 0, to prevent undefined
9446 behavior (Bug#8278).
9447
9448 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
9449
9450 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
9451
9452 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
9453 clobbering (Bug#8298).
9454 * sysdep.c (sys_subshell): Likewise.
9455 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
9456
9457 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
9458 This should get cleaned up, so that child_setup has the
9459 same signature on all platforms.
9460
9461 * callproc.c (call_process_cleanup): Now static.
9462 (relocate_fd): Rename locals to avoid shadowing.
9463
9464 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
9465
9466 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
9467 not to be necessary, and produces flickering.
9468
9469 2011-03-20 Glenn Morris <rgm@gnu.org>
9470
9471 * config.in: Remove file.
9472
9473 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
9474
9475 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
9476 are now in src/globals.h.
9477 (syms_of_minibuf): Remove spurious & from previous change.
9478
9479 2011-03-20 Leo Liu <sdl.web@gmail.com>
9480
9481 * minibuf.c (completing-read-function): New variable.
9482 (completing-read-default): Rename from completing-read.
9483 (completing-read): Call completing-read-function.
9484
9485 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
9486
9487 * xfaces.c (Fx_load_color_file):
9488 Read color file from absolute filename (bug#8250).
9489
9490 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
9491
9492 * makefile.w32-in: Update dependencies.
9493
9494 2011-03-17 Eli Zaretskii <eliz@gnu.org>
9495
9496 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
9497
9498 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
9499
9500 Fix more problems found by GCC 4.5.2's static checks.
9501
9502 * process.c (make_serial_process_unwind, send_process_trap):
9503 (sigchld_handler): Now static.
9504
9505 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
9506 That way, the code declares only the vars that it needs.
9507 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
9508 * s/cygwin.h (PTY_ITERATION): Likewise.
9509 * s/darwin.h (PTY_ITERATION): Likewise.
9510 * s/gnu-linux.h (PTY_ITERATION): Likewise.
9511
9512 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
9513 * process.c (allocate_pty): Don't declare stb unless it's needed.
9514
9515 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
9516 (CONSTANTLIM): Remove; unused.
9517 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
9518 Define only if needed.
9519
9520 * unexelf.c (unexec): Name an expression,
9521 to avoid gcc -Wbad-function-cast warning.
9522 Use a different way to cause a compilation error if anyone uses
9523 n rather than nn, a way that does not involve shadowing.
9524 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
9525
9526 * deps.mk (unexalpha.o): Remove; unused.
9527
9528 New file unexec.h, the (simple) interface for unexec (Bug#8267).
9529 * unexec.h: New file.
9530 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
9531 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
9532 Depend on unexec.h.
9533 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
9534 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
9535 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
9536 Change as necessary to match prototype in unexec.h.
9537
9538 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
9539 shadowing.
9540 (back_comment, skip_chars): Mark vars as initialized.
9541
9542 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
9543 Rename locals to avoid shadowing.
9544
9545 * lread.c (read1): Rewrite so as not to use empty "else".
9546 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
9547
9548 * print.c (Fredirect_debugging_output): Fix pointer signedess.
9549
9550 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
9551 warning when compiling print.c.
9552
9553 * font.c (font_unparse_fcname): Abort in an "impossible" situation
9554 instead of using an uninitialized var.
9555 (font_sort_entities): Mark var as initialized.
9556
9557 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
9558
9559 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
9560 pointers to constants.
9561 (font_parse_fcname): Remove unused vars.
9562 (font_delete_unmatched): Now static.
9563 (font_get_spec): Remove; unused.
9564 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
9565 (font_update_drivers, Ffont_get_glyphs, font_add_log):
9566 Rename or move locals to avoid shadowing.
9567
9568 * fns.c (require_nesting_list, require_unwind): Now static.
9569 (Ffillarray): Rename locals to avoid shadowing.
9570
9571 * floatfns.c (domain_error2): Define only if needed.
9572 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
9573
9574 * alloc.c (mark_backtrace): Move decl from here ...
9575 * lisp.h: ... to here, so that it can be checked.
9576
9577 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
9578 (Fdefvar): Rewrite so as not to use empty "else".
9579 (lisp_indirect_variable): Name an expression,
9580 to avoid gcc -Wbad-function-cast warning.
9581 (Fdefvar): Rename locals to avoid shadowing.
9582
9583 * callint.c (quotify_arg, quotify_args): Now static.
9584 (Fcall_interactively): Rename locals to avoid shadowing.
9585 Use const pointer when appropriate.
9586
9587 * lisp.h (get_system_name, get_operating_system_release):
9588 Move decls here, to check interfaces.
9589 * process.c (get_operating_system_release): Move decl to lisp.h.
9590 * xrdb.c (get_system_name): Likewise.
9591 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
9592 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
9593 some of which prompt warnings from gcc -Wbad-function-cast.
9594 (Fformat_time_string, Fencode_time, Finsert_char):
9595 (Ftranslate_region_internal, Fformat):
9596 Rename or remove local vars to avoid shadowing.
9597 (Ftranslate_region_internal): Mark var as initialized.
9598
9599 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
9600 avoid shadowing.
9601
9602 * lisp.h (eassert): Check that the argument compiles, even if
9603 ENABLE_CHECKING is not defined.
9604
9605 * data.c (Findirect_variable): Name an expression, to avoid
9606 gcc -Wbad-function-cast warning.
9607 (default_value, arithcompare, arith_driver, arith_error): Now static.
9608 (store_symval_forwarding): Rename local to avoid shadowing.
9609 (Fmake_variable_buffer_local, Fmake_local_variable):
9610 Mark variables as initialized.
9611 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
9612
9613 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
9614 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
9615 Rename locals to avoid shadowing.
9616 (mark_stack): Move local variables into the #ifdef region where
9617 they're used.
9618 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
9619 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
9620 needed otherwise.
9621 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
9622 (GC_STRING_CHARS): Remove; not used.
9623 (Fmemory_limit): Cast sbrk's returned value to char *.
9624
9625 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
9626 avoids undefined behavior in theory.
9627
9628 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
9629
9630 Use functions, not macros, for up- and down-casing (Bug#8254).
9631 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
9632 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
9633 to use the following functions instead of these macros.
9634 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
9635 EMACS_INT, since callers assume the returned value fits in int.
9636 (upcase1): Likewise, for UPCASE_TABLE.
9637 (uppercasep, lowercasep, upcase): New static inline functions.
9638 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
9639 the race-condition problem in the old DOWNCASE.
9640
9641 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
9642 Rename locals to avoid shadowing.
9643 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
9644 (regex_compile, re_search_2, re_match_2_internal):
9645 Remove unused local vars.
9646 (FREE_VAR): Rewrite so as not to use empty "else",
9647 which gcc can warn about.
9648 (regex_compile, re_match_2_internal): Mark locals as initialized.
9649 (RETALLOC_IF): Define only if needed.
9650 (WORDCHAR_P): Likewise. This one is never needed, but is used
9651 only in a comment talking about a compiler bug, so put inside
9652 the #if 0 of that comment.
9653 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
9654 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
9655 Remove; unused.
9656
9657 * search.c (boyer_moore): Rename locals to avoid shadowing.
9658 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
9659 (PREV_CHAR_BOUNDARY): Likewise.
9660
9661 * search.c (simple_search): Remove unused var.
9662
9663 * dired.c (compile_pattern): Move decl from here ...
9664 * lisp.h: ... to here, so that it can be checked.
9665 (struct re_registers): New forward decl.
9666
9667 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
9668
9669 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
9670 All uses changed.
9671 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
9672 Rename locals to avoid shadowing.
9673 (Fvertical_motion): Mark locals as initialized.
9674
9675 * casefiddle.c (casify_object, casify_region): Now static.
9676 (casify_region): Mark local as initialized.
9677
9678 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
9679
9680 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
9681 New macros, so that the caller can use some names other than
9682 gcpro1, gcpro2, etc.
9683 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
9684 of the new macros.
9685 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
9686 argument, for consistency with GCPRO2_VAR, etc: it is now the
9687 prefix of the variable, not the variable itself. All uses
9688 changed.
9689 * dired.c (directory_files_internal, file_name_completion):
9690 Rename locals to avoid shadowing.
9691
9692 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
9693 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
9694 dired.c's scmp function, had undefined behavior.
9695 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
9696 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
9697 * buffer.h: ... to here, because these macros use current_buffer,
9698 and the new implementation with inline functions needs to have
9699 current_buffer in scope now, rather than later when the macros
9700 are used.
9701 (downcase, upcase1): New static inline functions.
9702 (DOWNCASE, UPCASE1): Reimplement using these functions.
9703 This avoids undefined behavior in expressions like
9704 DOWNCASE (x) == DOWNCASE (y), which previously suffered
9705 from race conditions in accessing the global variables
9706 case_temp1 and case_temp2.
9707 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
9708 * lisp.h (case_temp1, case_temp2): Remove their decls.
9709 * character.h (ASCII_CHAR_P): Move from here ...
9710 * lisp.h: ... to here, so that the inline functions mentioned
9711 above can use them.
9712
9713 * dired.c (directory_files_internal_unwind): Now static.
9714
9715 * fileio.c (file_name_as_directory, directory_file_name):
9716 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
9717 Now static.
9718 (file_name_as_directory): Use const pointers when appropriate.
9719 (Fexpand_file_name): Likewise. In particular, newdir might
9720 point at constant storage, so make it a const pointer.
9721 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
9722 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
9723 signedness issues.
9724 (Fset_file_times, Finsert_file_contents, auto_save_error):
9725 Rename locals to avoid shadowing.
9726
9727 * minibuf.c (choose_minibuf_frame_1): Now static.
9728 (Ftry_completion, Fall_completions): Rename or remove locals
9729 to avoid shadowing.
9730
9731 * marker.c (bytepos_to_charpos): Remove; unused.
9732
9733 * lisp.h (verify_bytepos, count_markers): New decls,
9734 so that gcc does not warn that these functions aren't declared.
9735
9736 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
9737 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
9738 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
9739 (copy_text): Remove unused local var.
9740
9741 * filelock.c (within_one_second): Now static.
9742 (lock_file_1): Rename local to avoid shadowing.
9743
9744 * buffer.c (fix_overlays_before): Mark locals as initialized.
9745 (fix_start_end_in_overlays): Likewise. This function should be
9746 simplified by using pointers-to-pointers, but that's a different
9747 matter.
9748 (switch_to_buffer_1): Now static.
9749 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
9750 (report_overlay_modification): Rename locals to avoid shadowing.
9751
9752 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
9753 Fix pointer signedness issue.
9754 (sys_subshell): Mark local as volatile if checking for lint,
9755 to suppress a gcc -Wclobbered warning that does not seem to be right.
9756 (MAXPATHLEN): Define only if needed.
9757
9758 * process.c (serial_open, serial_configure): Move decls from here ...
9759 * systty.h: ... to here, so that they can be checked.
9760
9761 * fns.c (get_random, seed_random): Move extern decls from here ...
9762 * lisp.h: ... to here, so that they can be checked.
9763
9764 * sysdep.c (reset_io): Now static.
9765 (wait_for_termination_signal): Remove; unused.
9766
9767 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
9768 (copy_keymap_item, append_key, push_text_char_description):
9769 Now static.
9770 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
9771 (DENSE_TABLE_SIZE): Remove; unused.
9772 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
9773 (describe_map_tree):
9774 Rename locals to avoid shadowing.
9775
9776 * keyboard.c: Declare functions static if they are not used elsewhere.
9777 (echo_char, echo_dash, cmd_error, top_level_2):
9778 (poll_for_input, handle_async_input): Now static.
9779 (read_char, kbd_buffer_get_event, make_lispy_position):
9780 (make_lispy_event, make_lispy_movement, apply_modifiers):
9781 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
9782 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
9783 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
9784 (read_key_sequence, read_char): Mark locals as initialized.
9785 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
9786
9787 * keyboard.h (make_ctrl_char): New decl.
9788 (mark_kboards): Move decl here ...
9789 * alloc.c (mark_kboards): ... from here.
9790
9791 * lisp.h (force_auto_save_soon): New decl.
9792
9793 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
9794 (DEFINE_DUMMY_FUNCTION): New macro.
9795 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
9796 Use it.
9797 (main): Add casts to avoid warnings
9798 if GCC considers string literals to be constants.
9799
9800 * lisp.h (fatal_error_signal): Add decl, since it's exported.
9801
9802 * dbusbind.c: Pointer signedness fixes.
9803 (xd_signature, xd_append_arg, xd_initialize):
9804 (Fdbus_call_method, Fdbus_call_method_asynchronously):
9805 (Fdbus_method_return_internal, Fdbus_method_error_internal):
9806 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
9807 (Fdbus_register_signal): Use SSDATA when the context wants char *.
9808
9809 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
9810 if GCC considers string literals to be constants.
9811 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
9812
9813 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
9814
9815 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
9816 (print_preprocess, print_object): New macro to fix last change.
9817
9818 * print.c (print_preprocess): Don't forget font objects.
9819
9820 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
9821
9822 * emacs.c (USAGE3): Doc fixes.
9823
9824 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
9825
9826 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
9827 structure.
9828
9829 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
9830
9831 * lisp.h (VWindow_system, Qfile_name_history):
9832 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
9833 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
9834 (w32_system_caret_x, w32_system_caret_y): Declare extern.
9835
9836 * w32select.c: Don't #include "keyboard.h".
9837 (run_protected): Add extern declaration for waiting_for_input.
9838
9839 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
9840 * w32console.c (detect_input_pending, read_input_pending)
9841 (encode_terminal_code):
9842 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
9843 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
9844 (w32_system_caret_y, Qfile_name_history):
9845 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
9846 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
9847 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
9848 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
9849 * w32proc.c (Qlocal, report_file_error):
9850 * w32term.c (Vwindow_system, updating_frame):
9851 * w32uniscribe.c (initialized, uniscribe_font_driver):
9852 Remove unneeded extern declarations.
9853
9854 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
9855
9856 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
9857
9858 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
9859
9860 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
9861 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
9862 These macros can no longer be used for assignment.
9863
9864 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
9865 Assign struct members directly, instead of using BUF_BEGV etc.
9866 (record_buffer_markers, fetch_buffer_markers): New functions for
9867 recording and fetching special buffer markers.
9868 (set_buffer_internal_1, set_buffer_temp): Use them.
9869
9870 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
9871
9872 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
9873
9874 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
9875 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
9876
9877 * xdisp.c (hscroll_window_tree):
9878 (reconsider_clip_changes): Use PT instead of BUF_PT.
9879
9880 2011-03-13 Eli Zaretskii <eliz@gnu.org>
9881
9882 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
9883 $(EMACS_ROOT)/lib/intprops.h.
9884
9885 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
9886
9887 Fix more problems found by GCC 4.5.2's static checks.
9888
9889 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
9890 to unsigned char * to avoid compiler diagnostic.
9891 (xg_free_frame_widgets): Make it clear that a local variable is
9892 needed only if USE_GTK_TOOLTIP.
9893 (gdk_window_get_screen): Make it clear that this macro is needed
9894 only if USE_GTK_TOOLTIP.
9895 (int_gtk_range_get_value): New function, which avoids a diagnostic
9896 from gcc -Wbad-function-cast.
9897 (xg_set_toolkit_scroll_bar_thumb): Use it.
9898 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
9899 diagnostic from gcc -Wbad-function-cast.
9900 (get_utf8_string, xg_get_file_with_chooser):
9901 Rename locals to avoid shadowing.
9902 (create_dialog): Move locals to avoid shadowing.
9903
9904 * xgselect.c (xg_select): Remove unused var.
9905
9906 * image.c (four_corners_best): Mark locals as initialized.
9907 (gif_load): Initialize transparent_p to zero (Bug#8238).
9908 Mark another local as initialized.
9909 (my_png_error, my_error_exit): Mark with NO_RETURN.
9910
9911 * image.c (clear_image_cache): Now static.
9912 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
9913 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
9914 (x_edge_detection): Remove unnecessary cast that
9915 gcc -Wbad-function-cast diagnoses.
9916 (gif_load): Fix pointer signedness.
9917 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
9918 (jpeg_load, gif_load): Rename locals to avoid shadowing.
9919
9920 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
9921
9922 Improve quality of tests for time stamp overflow.
9923 For example, without this patch (encode-time 0 0 0 1 1
9924 1152921504606846976) returns the obviously-bogus value (-948597
9925 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
9926 reports time overflow. See
9927 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
9928 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
9929 * editfns.c: Include limits.h and intprops.h.
9930 (TIME_T_MIN, TIME_T_MAX): New macros.
9931 (time_overflow): Move earlier, to before first use.
9932 (hi_time, lo_time): New functions, for an accurate test for
9933 out-of-range times.
9934 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
9935 (Fget_internal_run_time): Don't assume time_t fits in int.
9936 (make_time): Use list2 instead of Fcons twice.
9937 (Fdecode_time): More accurate test for out-of-range times.
9938 (check_tm_member): New function.
9939 (Fencode_time): Use it, to test for out-of-range times.
9940 (lisp_time_argument): Don't rely on undefined left-shift and
9941 right-shift behavior when checking for time stamp overflow.
9942
9943 * editfns.c (time_overflow): New function, refactoring common code.
9944 (Fformat_time_string, Fdecode_time, Fencode_time):
9945 (Fcurrent_time_string): Use it.
9946
9947 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
9948 * dired.c (make_time): Move to ...
9949 * editfns.c (make_time): ... here.
9950 * systime.h: Note the move.
9951
9952 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9953
9954 * fringe.c (update_window_fringes): Remove unused variables.
9955
9956 * unexmacosx.c (copy_data_segment): Also copy __got section.
9957 (Bug#8223)
9958
9959 2011-03-12 Eli Zaretskii <eliz@gnu.org>
9960
9961 * termcap.c [MSDOS]: Include "msdos.h".
9962 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
9963 Constify `char *' arguments and their references according to
9964 prototypes in tparam.h.
9965
9966 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
9967
9968 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
9969 Adapt all references accordingly.
9970
9971 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
9972
9973 2011-03-11 Tom Tromey <tromey@redhat.com>
9974
9975 * buffer.c (syms_of_buffer): Remove obsolete comment.
9976
9977 2011-03-11 Eli Zaretskii <eliz@gnu.org>
9978
9979 * termhooks.h (encode_terminal_code): Declare prototype.
9980
9981 * msdos.c (encode_terminal_code): Don't declare prototype.
9982
9983 * term.c (encode_terminal_code): Now external again, used by
9984 w32console.c and msdos.c.
9985
9986 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
9987 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
9988
9989 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
9990
9991 Fix some minor problems found by GCC 4.5.2's static checks.
9992
9993 * fringe.c (update_window_fringes): Mark locals as initialized
9994 (Bug#8227).
9995 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
9996
9997 * alloc.c (mark_fringe_data): Move decl from here ...
9998 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
9999 to check its interface.
10000 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
10001
10002 * fontset.c (free_realized_fontset): Now static.
10003 (Fset_fontset_font): Rename local to avoid shadowing.
10004 (fontset_font): Mark local as initialized.
10005 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
10006
10007 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
10008
10009 * xselect.c (x_disown_buffer_selections): Remove; not used.
10010 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
10011 (x_own_selection, Fx_disown_selection_internal): Rename locals
10012 to avoid shadowing.
10013 (x_handle_dnd_message): Remove local to avoid shadowing.
10014
10015 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
10016 so that the caller can use some name other than gcpro1.
10017 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
10018 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
10019 (Fx_backspace_delete_keys_p):
10020 Use them to avoid shadowing, and rename vars to avoid shadowing.
10021 (x_decode_color, x_set_name, x_window): Now static.
10022 (Fx_create_frame): Add braces to silence GCC warning.
10023 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
10024 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
10025 Remove unused locals.
10026 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
10027 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
10028 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
10029 macros.
10030
10031 * xterm.h (x_mouse_leave): New decl.
10032
10033 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
10034 Remove unused functions.
10035 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
10036 (x_calc_absolute_position): Now static.
10037 (XTread_socket): Don't define label "out" unless it's used.
10038 Don't declare local "event" unless it's used.
10039 (x_iconify_frame, x_free_frame_resources): Don't declare locals
10040 unless they are used.
10041 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
10042 (x_fatal_error_signal): Remove; not used.
10043 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
10044 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
10045 (x_error_catcher, x_connection_closed, x_error_handler):
10046 (x_error_quitter, xembed_send_message, x_iconify_frame):
10047 (my_log_handler): Rename locals to avoid shadowing.
10048 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
10049 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
10050
10051 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
10052 Rename or move locals to avoid shadowing.
10053 (tty_defined_color, merge_face_heights): Now static.
10054 (free_realized_faces_for_fontset): Remove; not used.
10055 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
10056 does not deduce is never used uninitialized.
10057 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
10058 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
10059
10060 * terminal.c (store_terminal_param): Now static.
10061
10062 * xmenu.c (menu_highlight_callback): Now static.
10063 (set_frame_menubar): Remove unused local.
10064 (xmenu_show): Rename parameter to avoid shadowing.
10065 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
10066 since they might point to immutable storage.
10067 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
10068 since it's unused otherwise.
10069
10070 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
10071 Add a FIXME, since the code still doesn't look right. (Bug#8215)
10072 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
10073 avoids a gcc -Wuninitialized diagnostic.
10074 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
10075 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
10076 does not deduce are never used uninitialized.
10077
10078 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
10079
10080 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
10081 * window.c (window_loop, size_window):
10082 (run_window_configuration_change_hook, enlarge_window): Likewise.
10083
10084 * window.c (display_buffer): Now static.
10085 (size_window): Mark variables that gcc -Wuninitialized
10086 does not deduce are never used uninitialized.
10087 * window.h (check_all_windows): New decl, to forestall
10088 gcc -Wmissing-prototypes diagnostic.
10089 * dispextern.h (bidi_dump_cached_states): Likewise.
10090
10091 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
10092 shadowing.
10093 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
10094 Include <limits.h>.
10095 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
10096 and to avoid gcc -Wuninitialized warning.
10097 (load_charset_map): Mark variables that gcc -Wuninitialized
10098 does not deduce are never used uninitialized.
10099 (load_charset): Abort instead of using uninitialized var (Bug#8229).
10100
10101 * coding.c (coding_set_source, coding_set_destination):
10102 Use "else { /* comment */ }" rather than "else /* comment */;"
10103 for clarity, and to avoid gcc -Wempty-body warning.
10104 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
10105 a block, when the outer 'i' will do.
10106 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
10107 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
10108 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
10109 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
10110 (Fdecode_sjis_char, Fdefine_coding_system_internal):
10111 Rename locals to avoid shadowing.
10112 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
10113 * coding.c (emacs_mule_char, encode_invocation_designation):
10114 Now static, since they're not used elsewhere.
10115 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
10116 (decode_coding_object, encode_coding_object, detect_coding_system):
10117 (decode_coding_emacs_mule): Mark variables that gcc
10118 -Wuninitialized does not deduce are never used uninitialized.
10119 (detect_coding_iso_2022): Initialize a local variable that might
10120 be used uninitialized. Leave a FIXME because it's not clear that
10121 this initialization is needed. (Bug#8211)
10122 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
10123 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
10124 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
10125 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
10126 Remove unused macros.
10127
10128 * category.c (hash_get_category_set): Remove unused local var.
10129 (copy_category_table): Now static, since it's not used elsewhere.
10130 * character.c (string_count_byte8): Likewise.
10131
10132 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
10133 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
10134
10135 * chartab.c (copy_sub_char_table): Now static, since it's not used
10136 elsewhere.
10137 (sub_char_table_ref_and_range, char_table_ref_and_range):
10138 Rename locals to avoid shadowing.
10139 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
10140
10141 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
10142 (BIDI_BOB): Remove unused macro.
10143
10144 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
10145 deduce are never used uninitialized.
10146 * term.c (encode_terminal_code): Likewise.
10147
10148 * term.c (encode_terminal_code): Now static. Remove unused local.
10149
10150 * tparam.h: New file.
10151 * term.c, tparam.h: Include it.
10152 * deps.mk (term.o, tparam.o): Depend on tparam.h.
10153 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
10154 Move these decls to tparam.h, and make them agree with what
10155 is actually in tparam.c. The previous trick of using incompatible
10156 decls in different modules does not conform to the C standard.
10157 All callers of tparam changed to use tparam's actual API.
10158 * tparam.c (tparam1, tparam, tgoto):
10159 Use const pointers where appropriate.
10160
10161 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
10162 * cm.h (struct cm): Likewise.
10163 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
10164 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
10165 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
10166 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
10167 (turn_on_face, init_tty): Likewise.
10168 * termchar.h (struct tty_display_info): Likewise.
10169
10170 * term.c (term_mouse_position): Rename local to avoid shadowing.
10171
10172 * alloc.c (mark_ttys): Move decl from here ...
10173 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
10174
10175 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
10176
10177 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
10178
10179 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
10180
10181 * search.c (compile_pattern_1): Remove argument regp, unused since
10182 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
10183 (compile_pattern): Don't pass it.
10184
10185 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
10186
10187 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
10188 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
10189 for ! HAVE_GTK3.
10190 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
10191
10192 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
10193
10194 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
10195 gdk_window_get_screen, gdk_window_get_geometry,
10196 gdk_x11_window_lookup_for_display and GDK_KEY_g.
10197 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
10198 (xg_get_pixbuf_from_pixmap): New function.
10199 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
10200 to Pixmap, take frame as parameter, remove GdkColormap parameter.
10201 Call xg_get_pixbuf_from_pixmap instead of
10202 gdk_pixbuf_get_from_drawable.
10203 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
10204 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
10205 (xg_check_special_colors): Use GtkStyleContext and its functions
10206 for HAVE_GTK3.
10207 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
10208 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
10209 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
10210 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
10211 Call gtk_widget_get_preferred_size.
10212 (xg_frame_resized): gdk_window_get_geometry only takes 5
10213 parameters.
10214 (xg_win_to_widget, xg_event_is_for_menubar):
10215 Call gdk_x11_window_lookup_for_display.
10216 (xg_set_widget_bg): New function.
10217 (delete_cb): New function.
10218 (xg_create_frame_widgets): Connect delete-event to delete_cb.
10219 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
10220 (xg_set_background_color): Call xg_set_widget_bg.
10221 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
10222 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
10223 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
10224 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
10225 if ! HAVE_GTK3.
10226 (update_frame_tool_bar): Call gtk_widget_hide.
10227 (xg_initialize): Use GDK_KEY_g.
10228
10229 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
10230 if ! HAVE_GTK3
10231 (x_session_initialize): Call gdk_x11_set_sm_client_id.
10232
10233 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
10234 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
10235 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
10236
10237 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
10238
10239 * w32xfns.c (select_palette): Check success of RealizePalette against
10240 GDI_ERROR, not zero.
10241
10242 See ChangeLog.11 for earlier changes.
10243
10244 ;; Local Variables:
10245 ;; coding: utf-8
10246 ;; End:
10247
10248 Copyright (C) 2011-2012 Free Software Foundation, Inc.
10249
10250 This file is part of GNU Emacs.
10251
10252 GNU Emacs is free software: you can redistribute it and/or modify
10253 it under the terms of the GNU General Public License as published by
10254 the Free Software Foundation, either version 3 of the License, or
10255 (at your option) any later version.
10256
10257 GNU Emacs is distributed in the hope that it will be useful,
10258 but WITHOUT ANY WARRANTY; without even the implied warranty of
10259 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10260 GNU General Public License for more details.
10261
10262 You should have received a copy of the GNU General Public License
10263 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.