* src/conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
[bpt/emacs.git] / src / ChangeLog
1 2012-07-31 Glenn Morris <rgm@gnu.org>
2
3 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
4
5 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
6 Move to configure.ac.
7
8 2012-07-31 Eli Zaretskii <eliz@gnu.org>
9
10 * .gdbinit (xframe): Adapt to introduction of FVAR and the
11 resulting renaming of 'struct frame' members.
12
13 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
14
15 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
16 after introduction of FVAR.
17
18 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
19
20 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
21
22 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
23 instead of compositeToPoint.
24 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
25
26 * nsfns.m, nsmenu.m, msterm.m: Adopt to struct frame/FVAR changes.
27
28 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
29
30 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
31 * lisp.h (INTERNAL_FIELD): New macro.
32 * buffer.h (BUFFER_INTERNAL_FIELD): Removed.
33 (BVAR): Change to use INTERNAL_FIELD.
34 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
35 (KVAR): Change to use INTERNAL_FIELD.
36 * frame.h (FVAR): New macro.
37 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
38 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c
39 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c
40 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h,
41 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
42
43 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
44
45 Miscellaneous fixes for non-default X toolkits.
46 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
47 * xterm.c (x_frame_of_widget): Remove redundant prototype.
48 Move under #ifdef USE_LUCID.
49 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
50 definition and usage to avoid warnings.
51
52 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
53
54 * nsterm.m (openFiles): Fix previous checkin.
55
56 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
57
58 * indent.c (compute_motion): Remove unused local.
59
60 2012-07-31 Glenn Morris <rgm@gnu.org>
61
62 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
63
64 * conf_post.h [USG5_4]:
65 Move remaining contents of s/usg5-4-common.h here.
66 * s/usg5-4-common.h: Remove file.
67
68 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
69 * s/irix6-5.h: Remove file.
70
71 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
72 * s/darwin.h: Remove file.
73
74 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
75 * s/hpux10-20.h: Remove file, which is now empty.
76
77 2012-07-30 Glenn Morris <rgm@gnu.org>
78
79 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
80 * Makefile.in (config_h): Add conf_post.h.
81 * makefile.w32-in (CONFIG_H): Add conf_post.h.
82
83 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
84
85 * nsterm.m (ns_do_open_file): New variable.
86 (ns_term_init): Set ns_do_open_file to YES after run returns.
87 (openFile, openTempFile, openFileWithoutUI, openFiles): Open
88 files only if ns_do_open_file.
89
90 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
91
92 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
93 This no-op macro hasn't been needed for many years.
94 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
95
96 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
97 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
98 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
99 gdb_make_enums_visible.
100 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
101 (DIRECTORY_SEP): Now a constant, not a macro.
102
103 2012-07-30 Eli Zaretskii <eliz@gnu.org>
104
105 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
106 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
107
108 * w32term.c <w32_keyboard_codepage>: Renamed from
109 keyboard_codepage and now external. All users changed.
110
111 * w32term.h: Add declaration of w32_keyboard_codepage.
112
113 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
114 the codepage to translate keys to Unicode. If this argument is
115 -1, use the value returned by GetConsoleCP. All callers changed.
116
117 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
118
119 Update .PHONY listings in makefiles.
120 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
121 bootstrap-clean, distclean, maintainer-clean, versioclean,
122 extraclean, frc.
123
124 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
125 This is a bit clearer. Fix some commentary typos.
126
127 2012-07-30 Glenn Morris <rgm@gnu.org>
128
129 * s/netbsd.h: Let configure include signal.h if needed.
130 Remove file, which is now empty.
131
132 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
133 Let configure set them.
134 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
135 No more need to undefine.
136
137 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
138
139 * keymap.c (Fkey_description): Don't remove 0x80 bit from
140 non-single-byte char when adding meta modifier. (Bug#12090)
141
142 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
143
144 Convert safe_call to use variable number of arguments.
145 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
146 (safe_call2): Fix comment.
147 * lisp.h (safe_call): Adjust prototype.
148 * coding.c (encode_coding_object): Change to use safe_call2.
149 * xfaces.c (merge_face_heights): Change to use safe_call1.
150
151 2012-07-30 Glenn Morris <rgm@gnu.org>
152
153 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
154 does that unconditionally. Remove file, which is now empty.
155
156 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
157 Remove empty files.
158
159 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
160
161 Export to GDB most of lisp.h's remaining object-like macros.
162 * lisp.h (min, max): Move earlier, because they're used earlier now.
163 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
164 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
165 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
166 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
167 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
168 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
169 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
170 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
171 Now constants, for GDB. They need not be macros.
172 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
173 Now constants, for GDB, as well as macros, for static initializers.
174 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
175 Move to after the definition of struct Lisp_Char_Table,
176 since the former now needs that type defined.
177 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
178 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
179 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
180 New enums, for gdb_make_enums_visible.
181 (GLYPH_MODE_LINE_FACE): Remove; unused.
182 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
183 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
184 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
185 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
186 enum maxargs, enum MAX_ALLOCA.
187 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
188 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
189 no longer needed, now that they are done in lisp.h.
190
191 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
192
193 Cleanup string bytes checking.
194 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
195 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
196 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
197 (check_sblock, compact_small_strings): Simplify.
198
199 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
200
201 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
202 These macros are confusing and no longer need to be defined, as
203 the enum values now suffice. All uses replaced with definiens.
204 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
205
206 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
207
208 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
209 ($(BLD)/w32console.$(O)): Update dependencies.
210
211 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
212
213 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
214 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
215 time. Adjust users.
216 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
217
218 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
219
220 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
221 setting sitelisp (Bug#12010).
222
223 2012-07-29 Eli Zaretskii <eliz@gnu.org>
224
225 * w32heap.h (OS_9X): Renamed from OS_WINDOWS_95.
226
227 * w32heap.c (cache_system_info):
228 * w32.c (sys_rename):
229 * w32proc.c (find_child_console, sys_kill): All users changed.
230
231 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
232
233 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
234
235 2012-07-29 Eli Zaretskii <eliz@gnu.org>
236
237 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
238
239 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
240
241 Cleanup statistics calculation in Fgarbage_collect.
242 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start. Fix
243 zombies percentage calculation. Simplify elapsed time calculation.
244
245 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
246
247 Generalize marker debugging code under MARKER_DEBUG and use eassert.
248 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
249 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
250 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
251 (replace_range, replace_range_2, del_range_2): Change to eassert.
252 * marker.c (byte_char_debug_check): Adjust style.
253
254 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
255
256 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
257 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
258 long-ago-commented-out code that talks about "WIN32".
259 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
260 All uses changed.
261
262 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
263
264 Use Gnulib stdalign module (Bug#9772, Bug#9960).
265 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
266 Simplify by using alignof.
267 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
268 * lisp.h: Include <stdalign.h>.
269 (GCALIGNMENT): New macro and constant.
270 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
271 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
272 (stdalign): New macro, if not already defined.
273
274 2012-07-28 Eli Zaretskii <eliz@gnu.org>
275
276 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
277 * w32inevt.c: Include w32inevt.h.
278 (w32_read_console_input): New inline function, calls either
279 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
280 w32_console_unicode_input.
281 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
282 (w32_kbd_patch_key, key_event): Use the codepage returned by
283 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
284 (key_event): use uChar.UnicodeChar only if
285 w32_console_unicode_input is non-zero.
286
287 * w32console.c: Include w32heap.h.
288 <w32_console_unicode_input>: New global variable.
289 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
290 family of Windows, zero otherwise.
291
292 * w32inevt.h: Declare w32_console_unicode_input.
293
294 * xdisp.c (init_iterator): Don't reference tip_frame in a build
295 --without-x. (Bug#11742)
296
297 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
298
299 Adjust GDB to reflect pvec_type changes (Bug#12036).
300 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
301 2012-07-04 changes to pseudovector representation. Problem
302 reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
303
304 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
305
306 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
307 bus address.
308 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
309
310 2012-07-27 Eli Zaretskii <eliz@gnu.org>
311
312 * alloc.c (listn): Fix the order the arguments are consed onto the
313 list.
314
315 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
316 enumeration constants, as PURE and HEAP are too general, and clash
317 with other headers and sources, such as gmalloc.c and the
318 MS-Windows system headers. All users changed.
319
320 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
321
322 Revert last save_excursion_save and save_excursion_restore changes.
323 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
324 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
325
326 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
327
328 Fix recently-introduced typos in Windows port.
329 Reported by Martin Rudalics <rudalics@gmx.at>.
330 * w32.c (init_environment): Replace comma with semicolon.
331 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
332
333 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
334
335 Improve GDB symbol export (Bug#12036).
336 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
337 arms of an 'if', not using conditional expressions; otherwise GDB
338 complains about the types in the unevaluated arm when the argument
339 is an integer literal.
340 (xgetint): Simplify expression.
341 * alloc.c (gdb_make_enums_visible): New constant. This ports to
342 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
343 Zaretskii in <http://bugs.gnu.org/12036#13>.
344 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
345 needed now that we have gdb_make_enums_visible.
346 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
347 (enum enum_USE_LSB_TAG):
348 New enum types, packaging up enums that need to be exported to GDB.
349
350 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
351
352 Utility function to make a list from specified amount of objects.
353 * lisp.h (enum constype): New datatype.
354 (listn): New prototype.
355 * alloc.c (listn): New function.
356 (Fmemory_use_count, syms_of_alloc): Use it.
357 * buffer.c (syms_of_buffer): Likewise.
358 * callint.c (syms_of_callint): Likewise.
359 * charset.c (define_charset_internal): Likewise.
360 * coding.c (syms_of_coding): Likewise.
361 * keymap.c (syms_of_keymap): Likewise.
362 * search.c (syms_of_search): Likewise.
363 * syntax.c (syms_of_syntax): Likewise.
364 * w32.c (init_environment): Likewise.
365 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
366 * xdisp.c (syms_of_xdisp): Likewise.
367 * xfns.c (syms_of_xfns): Likewise.
368
369 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
370
371 Fast save_excursion_save and save_excursion_restore.
372 * lisp.h (struct Lisp_Excursion): New data type.
373 (PVEC_EXCURSION): New pseudovector type.
374 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
375 to deal with it. Adjust comments.
376 (init_marker, attach_marker): New prototype.
377 (unchain_marker): Adjust prototype.
378 * marker.c (attach_marker): Change to global.
379 (init_marker): New function.
380 * alloc.c (Fmake_marker, build_marker): Use it.
381 (build_marker): More easserts.
382 (mark_object): Handle struct Lisp_Excursion.
383 * editfns.c (save_excursion_save, save_excursion_restore):
384 Reimplement to use struct Lisp_Excursion. Add comments.
385
386 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
387
388 Fix export of symbols to GDB (Bug#12036).
389 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
390 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
391 emacs.c, as this is a more-suitable home. Had this been done earlier
392 the fix for 12036 would have avoided some of the problems noted in
393 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
394 would have been more obvious.
395 * emacs.c: Do not include <verify.h>; no longer needed.
396 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
397 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
398 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
399 Remove; now done in lisp.h.
400 * lisp.h (PUBLISH_TO_GDB): New macro.
401 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
402 (DATA_SEG_BITS): Use it.
403 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
404 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
405 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
406 not be usable in #if. This simplifies things.
407
408 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
409
410 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
411
412 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
413
414 Simplify export of symbols to GDB (Bug#12036).
415 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
416 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
417 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
418 Adjust to changes in lisp.h and emacs.c, by using
419 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
420 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
421 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
422 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
423 instead of gdb_valbits.
424 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
425 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
426 instead of gdb_array_mark_flag.
427 (xboolvector): Get size from $->size, not $->header.size.
428 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
429 (xreload, hook-run, hookpost-run): Remove.
430 * emacs.c: Include <verify.h>.
431 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
432 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
433 Remove.
434 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
435 (gdb_USE_LSB_TAG): New enum constants.
436 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
437 Also define these as enum constants, so they're visible to GDB.
438 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
439 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
440 as constants, so they're visible to GDB.
441 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
442 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
443 Now enum constants, not macros, so they're visible to GDB.
444 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
445 more convenient now. All uses changed.
446 (VALMASK) [USE_LSB_TAG]: Also define in this case.
447 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
448
449 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
450
451 Explicitly free restriction data that are not needed anymore.
452 * editfns.c (save_restriction_restore): Free restriction data.
453
454 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
455
456 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
457 add argument, tune behavior, and adjust all callers.
458
459 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
460
461 Use typedef for EMACS_INT, EMACS_UINT.
462 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
463 than macros. This simplifies debugging in the usual case, since
464 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
465 and it allows expressions involving EMACS_INT casts.
466 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
467
468 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
469
470 * nsterm.m (ns_read_socket): Return early if there is a modal
471 window (Bug#12043).
472
473 2012-07-25 Martin Rudalics <rudalics@gmx.at>
474
475 * frame.c (Fredirect_frame_focus): In doc-string don't mention
476 that FOCUS-FRAME can be omitted.
477
478 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
479
480 Adjust buffer text indirection counters at the end of Fkill_buffer.
481 * buffer.c (Fkill_buffer): Adjust indirection counters when the
482 buffer is definitely dead. This should really fix an issue reported
483 by Christoph Scholtes again. (Bug#12007).
484 (init_buffer_once): Initialize indirection counters of
485 buffer_defaults and buffer_local_symbols (for sanity and safety).
486
487 2012-07-24 Eli Zaretskii <eliz@gnu.org>
488
489 * xdisp.c (init_iterator): Don't compute dimensions of truncation
490 and continuation glyphs on tooltip frames, leave them at zero.
491 Avoids continued lines in tooltips. (Bug#11832)
492
493 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
494
495 Simplify copy_overlay.
496 * buffer.c (copy_overlay): Simplify. Use build_marker.
497 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
498
499 2012-07-23 Eli Zaretskii <eliz@gnu.org>
500
501 * print.c (print_object): Don't crash when a frame's name is nil
502 or invalid. (Bug#12025)
503
504 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
505 it signals an error when a tooltip frame is being created.
506
507 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
508
509 Cleanup miscellaneous objects allocation and initialization.
510 * alloc.c (allocate_misc): Change to static. Add argument to
511 specify the subtype. Adjust comment and users.
512 (build_overlay): New function.
513 * buffer.c (copy_overlays, Fmake_overlay): Use it.
514 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
515 (allocate_misc): Remove prototype.
516 (build_overlay): Add prototype.
517
518 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
519
520 Swap buffer text indirection counters in Fbuffer_swap_text.
521 * buffer.c (Fbuffer_swap_text): Swap indirections too.
522 This avoids crash reported by Christoph Scholtes at
523 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
524
525 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
526
527 * nsmenu.m (Popdown_data): New struct.
528 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
529 free Popdown_data.
530 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
531 (initWithContentRect): Make imgView and contentView non-static
532 and autorelease them. Also autorelease img and matrix (Bug#12005).
533 (dealloc): Remove (Bug#12005).
534
535 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
536
537 Adjust consing_since_gc when objects are explicitly freed.
538 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
539 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
540 (free_cons, free_misc): Subtract object size from consing_since_gc.
541
542 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
543
544 Simplify and cleanup markers positioning code.
545 * marker.c (attach_marker): More useful eassert.
546 (live_buffer, set_marker_internal): New function.
547 (Fset_marker, set_marker_restricted): Use set_marker_internal.
548 (set_marker_both, set_marker_restricted_both): Use live_buffer.
549
550 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
551
552 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
553 as it's limited by the amount of memory, not by INT_MAX.
554
555 2012-07-21 Eli Zaretskii <eliz@gnu.org>
556
557 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
558 in special-event-map. See the discussion at
559 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
560 for the reasons.
561
562 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
563 info.dwItemData. Fixes crashes on 64-bit Windows. Suggested by
564 Fabrice Popineau <fabrice.popineau@supelec.fr>.
565
566 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
567
568 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
569 (conversationIdentifier): Return value is NSInteger.
570 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
571
572 2012-07-21 Chong Yidong <cyd@gnu.org>
573
574 * window.c (decode_any_window): Signal an error if the window is
575 on a dead frame (Bug#11984).
576
577 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
578
579 Add indirection counting to speed up Fkill_buffer.
580 * buffer.h (struct buffer): New member.
581 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
582 (Fmake_indirect_buffer): Set indirection counter to -1, increment
583 base buffer indirection counter.
584 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
585 (Fkill_buffer): Adjust indirection counters as needed, don't walk
586 through buffer list if indirection counter is 0.
587
588 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
589
590 Extend the value returned by Fgarbage_collect with heap statistics.
591 * alloc.c (Qheap): New symbol.
592 (syms_of_alloc): DEFSYM it.
593 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
594 (Fmemory_free): Remove.
595 (syms_of_alloc): Don't defsubr it.
596 * buffer.c (Fcompact_buffer): Remove.
597 (syms_of_buffer): Don't defsubr it.
598
599 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
600
601 Make maybe_gc inline.
602 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
603 * lisp.h (consing_since_gc, gc_relative_threshold)
604 (memory_full_cons_threshold): Revert declaration.
605 (maybe_gc): Remove prototype, define as inline.
606 * alloc.c: Remove old commented-out code.
607 (consing_since_gc, gc_relative_threshold)
608 (memory_full_cons_threshold): Revert to global.
609 (maybe_gc): Remove.
610
611 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
612
613 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
614 * lisp.h (build_unibyte_string): New function.
615 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
616 * sysdep.c, w32fns.c, xfns.c: Use it.
617 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
618 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
619 Adjust users accordingly.
620 * font.h (font_open_by_name): Adjust prototype.
621
622 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
623
624 Cleanup calls to Fgarbage_collect.
625 * lisp.h (maybe_gc): New prototype.
626 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
627 Remove declarations.
628 * alloc.c (maybe_gc): New function.
629 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
630 Make them static.
631 * bytecode.c (MAYBE_GC): Use maybe_gc.
632 * eval.c (eval_sub, Ffuncall): Likewise.
633 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
634 to avoid dependency from auto-save feature.
635
636 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
637
638 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
639 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
640 'for_each_per_buffer_object_at'.
641 All uses changed. It's better to use upper-case for macros that
642 cannot be implemented as functions, to give the reader a clue
643 that they're special.
644
645 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
646
647 * alloc.c (Fgarbage_collect): Tweak docstring.
648
649 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
650
651 Tweak the value returned from Fgarbage_collect again.
652 * alloc.c (Fgarbage_collect): New return value, as confirmed in
653 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
654 Adjust documentation.
655 (total_vector_bytes): Rename to total_vector_slots, adjust
656 accounting.
657 (total_free_vector_bytes): Rename to total_free_vector_slots,
658 adjust accounting.
659 (Qstring_bytes, Qvector_slots): New symbols.
660 (syms_of_alloc): DEFSYM them.
661
662 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
663
664 Buffer compaction primitive which may be used from Lisp.
665 * buffer.c (compact_buffer, Fcompact_buffer): New function.
666 (syms_of_buffer): Register Fcompact_buffer.
667 * alloc.c (Fgarbage_collect): Use compact_buffer.
668 * buffer.h (compact_buffer): New prototype.
669 (struct buffer_text): New member.
670
671 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
672
673 New macro to iterate over all buffers, miscellaneous cleanups.
674 * lisp.h (all_buffers): Remove declaration.
675 * buffer.h (all_buffers): Add declaration, with comment.
676 (for_each_buffer): New macro.
677 * alloc.c (Fgarbage_collect, mark_object): Use it.
678 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
679 (init_buffer): Likewise.
680 * data.c (Fset_default): Likewise.
681 * coding.c (code_conversion_restore): Remove redundant check
682 for dead buffer.
683 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
684
685 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
686
687 Fix bug that created negative-length intervals.
688 * intervals.c (merge_interval_right, merge_interval_left):
689 Do not zero out this interval if it is absorbed by its children,
690 as this interval's total length doesn't change in that case. See
691 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
692
693 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
694
695 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
696 when invoking (make-bool-vector N t) and N is a positive
697 multiple of 8 -- the last 8 bits were mistakenly cleared.
698
699 Remove some struct layout assumptions in bool vectors.
700 * alloc.c (bool_header_size): New constant.
701 (header_size, word_size): Move earlier, as they're now used earlier.
702 Use 'word_size' in a few more places, where it's appropriate.
703 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
704 padding before the data member of a bool vector.
705 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
706 than doing the check by hand with an abort ().
707
708 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
709
710 * eval.c (Fdefvar): Don't check constants since we only set the var if
711 it's not yet defined anyway (bug#11904).
712
713 * lisp.h (last_undo_boundary): Declare new var.
714 * keyboard.c (command_loop_1): Set it.
715 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
716 were auto-added by the command loop (bug#11774).
717
718 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
719
720 * w32font.c (Qsymbol): Remove local definition.
721 (syms_of_w32font): Don't DEFSYM it.
722
723 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
724
725 Fix sweep_vectors to handle large bool vectors correctly.
726 * alloc.c (sweep_vectors): Account total_vector_bytes for
727 bool vectors larger than VBLOCK_BYTES_MAX.
728
729 2012-07-18 Chong Yidong <cyd@gnu.org>
730
731 * frame.c (x_set_frame_parameters): Revert bogus change introduced
732 in 2012-05-25 commit by Paul Eggert (Bug#11738).
733
734 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
735
736 Return more descriptive data from Fgarbage_collect.
737 Suggested by Stefan Monnier in
738 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
739 * alloc.c (bounded_number): New function.
740 (total_buffers, total_vectors): New variable.
741 (total_string_size): Rename to total_string_bytes, adjust users.
742 (total_vector_size): Rename to total_vector_bytes, adjust users.
743 (sweep_vectors): Account total_vectors and total_vector_bytes.
744 (Fgarbage_collect): New return value. Adjust documentation.
745 (gc_sweep): Account total_buffers.
746 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
747 (VECTOR_SIZE): Remove.
748 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
749 (Qinterval, Qmisc): New symbols.
750 (syms_of_data): Initialize them.
751 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
752 (Qcons, Qbuffer): New declarations.
753
754 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
755
756 * alloc.c (Fmemory_free): Account for memory-free's own storage.
757 Round up, not down. Improve doc.
758
759 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
760
761 Restore old code in allocate_string_data to avoid Faset breakage.
762 Reported by Julien Danjou <julien@danjou.info> in
763 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
764 * alloc.c (allocate_string_data): Restore old code with minor
765 adjustments, fix comment to explain this subtle issue.
766
767 2012-07-17 Eli Zaretskii <eliz@gnu.org>
768
769 Remove FILE_SYSTEM_CASE.
770 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
771
772 * fileio.c (FILE_SYSTEM_CASE): Don't define.
773 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
774 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
775 call-process-region passes it through expand-file-name.
776
777 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
778
779 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
780
781 Fix crash when creating indirect buffer (Bug#11917)
782 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
783 Don't handle unbound variables specially if non-zero.
784 (Fbuffer_local_variables): Pass zero.
785 (clone_per_buffer_values): Pass non-zero.
786
787 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
788
789 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
790 to make the loop interruptible.
791
792 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
793
794 * gnutls.c (emacs_gnutls_handshake): Only retry if
795 GNUTLS_E_INTERRUPTED.
796
797 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
798
799 Cleanup and convert miscellaneous checks to eassert.
800 * alloc.c (mark_interval): Fix comment, partially rephrase
801 old comment from intervals.h (see below).
802 * intervals.c (find_interval, adjust_intervals_for_insertion)
803 (delete_interval, adjust_intervals_for_deletion)
804 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
805 Convert to eassert.
806 (adjust_intervals_for_insertion, make_new_interval):
807 Remove obsolete and unused code.
808 * intervals.h (struct interval): Remove obsolete comment.
809 * textprotp.c (erase_properties): Remove unused code.
810 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
811 (Fremove_list_of_text_properties): Convert to eassert.
812
813 2012-07-17 Chong Yidong <cyd@gnu.org>
814
815 * editfns.c (Finsert_char): Doc fix.
816
817 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
818
819 Fix previous change to make Fmemory_free always accurate.
820 * alloc.c (make_interval): Update total_free_intervals.
821 (make_float): Likewise for total_free_floats.
822 (free_cons, Fcons): Likewise for total_free_conses.
823 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
824 Likewise for total_free_vector_bytes.
825 (Fmake_symbol): Likewise for total_free_symbols.
826 (bytes_free): Remove.
827
828 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
829
830 Simple free memory accounting feature.
831 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
832 (sweep_vectors): Accumulate size of free vectors.
833 (Fgarbage_collect): Setup bytes_free.
834 (Fmemory_free): New function.
835 (syms_of_alloc): Register it.
836
837 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
838
839 Cleanup overlays checking.
840 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
841 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
842 eassert and OVERLAYP.
843 (sort_overlays): Change to use OVERLAYP.
844
845 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
846
847 * editfns.c (Finsert_char): Make it interactive, and make the
848 second arg optional. Copy interactive spec and docstring from
849 ucs-insert.
850
851 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
852
853 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
854 Unlike the other wrapped functions, fabs has an unspecified
855 effect on errno.
856
857 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
858
859 * nsterm.m (keyDown): Interpret flags without left/right bits
860 as the left key (Bug#11670).
861
862 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
863
864 Remove empty and useless init functions.
865 * lisp.h (init_character_once, init_fns, init_image)
866 (init_filelock, init_sound): Remove prototype.
867 * character.c (init_character_once): Remove.
868 * filelock.c (init_filelock): Likewise.
869 * fns.c (init_fns): Likewise.
870 * image.c (init_image): Likewise.
871 * sound.c (init_sound): Likewise.
872 * emacs.c (main): Adjust accordingly.
873
874 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
875
876 * gtkutil.h: Tiny cleanups.
877 (use_old_gtk_file_dialog): Remove useless declaration.
878 (xg_uses_old_file_dialog): Add suggested const attribute.
879
880 2012-07-15 Eli Zaretskii <eliz@gnu.org>
881
882 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
883 (bidi_paragraph_init): Use it to limit search forward for a strong
884 directional character in abnormally large paragraphs full of
885 neutral or weak characters. (Bug#11943)
886
887 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
888
889 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
890 the toolbar (Bug#9451).
891 (xg_make_tool_item): Give the widget event box a transparent
892 background.
893
894 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
895
896 Cleanup basic allocation variables and functions.
897 * alloc.c (ignore_warnings, init_intervals, init_float)
898 (init_cons, init_symbol, init_marker): Remove.
899 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
900 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
901 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
902 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
903 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
904 (staticidx, init_alloc_once, init_strings, free_ablock):
905 Remove redundant initialization.
906 * fns.c (init_weak_hash_tables): Remove.
907 * lisp.h (init_weak_hash_tables): Remove prototype.
908
909 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
910
911 Use zero_vector where appropriate.
912 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
913 accordingly.
914 * lisp.h (zero_vector): New declaration.
915 * font.c (null_vector): Remove.
916 (syms_of_font): Remove initialization and staticpro.
917 (font_list_entities, font_find_for_lface): Change to use zero_vector.
918 * keymap.c (Faccessible_keymaps): Likewise.
919
920 2012-07-15 Leo Liu <sdl.web@gmail.com>
921
922 * fringe.c: Fix typo in comments.
923
924 2012-07-14 Leo Liu <sdl.web@gmail.com>
925
926 * fringe.c: Add a new bitmap exclamation-mark.
927
928 2012-07-14 Eli Zaretskii <eliz@gnu.org>
929
930 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
931
932 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
933 (HAVE_MENUS): Don't define, defined by editing config.in with
934 msdos/sed2v2.inp.
935 (GMALLOC_INHIBIT_VALLOC): Don't define.
936 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
937
938 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
939
940 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
941
942 2012-07-14 Glenn Morris <rgm@gnu.org>
943
944 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
945 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
946 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
947
948 2012-07-13 Glenn Morris <rgm@gnu.org>
949
950 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
951
952 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
953 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
954
955 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
956
957 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
958 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
959 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
960 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
961 where appropriate.
962 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
963 as boolean expression.
964 (x_set_window_size): Remove unused variable toolbar.
965 (ns_get_color_default, ns_mod_to_lisp): Remove.
966 (ns_mouse_position): Remove unused variables xchar and ychar.
967 (ns_compute_glyph_string_overhangs): Remove unused variable face.
968 (ns_set_vertical_scroll_bar): Remove unused variable count.
969 (ns_delete_terminal): Remove unused variable i.
970 (ns_term_init): Remove unused variables r, g and b.
971 (mouseDown): Remove unused variable window.
972 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
973 (initFrameFromEmacs): Remove unused variable vbextra.
974 (mouseEntered): Remove unused variables p and dpyinfo.
975 (mouseExited): Remove unused variables p and r.
976 (ns_define_frame_cursor, ns_clear_frame_area)
977 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
978 (menuDown): Assign [sender tag] to variable and cast the variable.
979
980 * nsterm.h (menuDown): Add id as type to argument sender.
981 (ns_display_info_for_name): Add Lisp_Object argument.
982 (ns_term_init): Add Lisp_Object argument.
983 (ns_map_event_to_object): Add void argument.
984 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
985 prototype with arguments and only declare if __OBJC__.
986 (nxatoms_of_nsselect): Add void argument.
987 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
988 (ns_alloc_autorelease_pool): Add void argument.
989 (ns_release_autorelease_pool): Add void* argument.
990 (ns_get_defaults_value): Add const char* argument.
991
992 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
993 (initFromContents): Use SSDATA where appropriate.
994 (ns_update_menubar): Add braces to ambigous if-else.
995 (initWithTitle): Put () around assignment in if statement.
996 (ns_menu_show): Remove unused variables window and keymap.
997 (update_frame_tool_bar): Remove unused variable selected_p.
998 (initWithContentRect): Remove unused variable this_cmd_name.
999
1000 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
1001 appropriate.
1002 (setXBMColor): Remove unused variable len.
1003 (setPixmapData): Put () around assignment in loop statement.
1004
1005 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
1006 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
1007 where appropriate.
1008 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
1009 around assignment in loop statement.
1010 (nsfont_open): Remove unused variable i.
1011 (nsfont_open): Remove unused variable len.
1012 (nsfont_draw): Remove unused variable cs.
1013
1014 * nsfns.m (x_set_icon_name, ns_set_name_internal)
1015 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
1016 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
1017 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
1018 (Fns_font_name, Fns_perform_service)
1019 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
1020 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
1021 (ns_set_name): Remove unused variable view.
1022 (x_set_menu_bar_lines): Remove unused variable olines.
1023 (x_set_tool_bar_lines): Remove unused variable root_window.
1024 (Fns_list_colors): Put () around assignment in while statement.
1025 (Fns_perform_service): Remove unused variable len.
1026 (Fns_display_usable_bounds): Remove unused variable top.
1027 (syms_of_nsfns): Remove unused variable i.
1028
1029 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
1030 memcpy (Bug#11907).
1031
1032 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
1033
1034 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
1035 and free it with DestroyExceptionInfo (Bug#11558).
1036
1037 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
1038
1039 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
1040 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
1041 Set here, not in nt/config.nt.
1042
1043 2012-07-13 Eli Zaretskii <eliz@gnu.org>
1044
1045 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
1046 cursor overflow into the last glyph on display line when the right
1047 fringe is off. (Bug#11832)
1048
1049 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
1050
1051 * xdisp.c (produce_special_glyphs): Now static.
1052 * dispextern.h (produce_special_glyphs): Remove decl.
1053
1054 2012-07-13 Glenn Morris <rgm@gnu.org>
1055
1056 * s/bsd-common, s/cygwin.h: Remove empty files.
1057 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
1058
1059 * s/usg5-4-common.h (USG, USG5):
1060 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
1061 * s/sol2-6.h (SOLARIS2):
1062 * s/irix6-5.h (IRIX6_5):
1063 * s/hpux10-20.h (USG, USG5, HPUX):
1064 * s/gnu-linux.h (USG, GNU_LINUX):
1065 * s/freebsd.h (BSD_SYSTEM):
1066 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
1067 * s/cygwin.h (CYGWIN):
1068 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
1069 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
1070
1071 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
1072
1073 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
1074
1075 2012-07-13 Glenn Morris <rgm@gnu.org>
1076
1077 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
1078
1079 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
1080
1081 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
1082 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
1083
1084 2012-07-12 Glenn Morris <rgm@gnu.org>
1085
1086 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
1087
1088 * process.c (init_process_emacs): Rename from init_process.
1089 The old name is also the name of a Mach system call.
1090 * lisp.h, emacs.c: Update for this name change.
1091 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
1092 longer needed.
1093
1094 2012-07-12 Eli Zaretskii <eliz@gnu.org>
1095
1096 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
1097 memmove call that removes glyphs covered by the left truncation
1098 glyph. Improve commentary.
1099 (display_line): Fix display of continuation glyphs on GUI frames
1100 when the right fringe is turned off and variable-size fonts are
1101 used in the window. Move the code that appends a stretch glyph to
1102 produce_special_glyphs, so that it could be used for truncation
1103 and continuation glyphs alike.
1104 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
1105 glyph of a suitably computed width, to align the special glyphs at
1106 the window margin. Code moved from display_line. (Bug#11832)
1107
1108 2012-07-12 Glenn Morris <rgm@gnu.org>
1109
1110 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
1111
1112 * s/gnu-linux.h, s/hpux10-20.h:
1113 Do not unconditionally define HAVE_XRMSETDATABASE.
1114
1115 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
1116
1117 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
1118
1119 Fix typos that broke OS X build.
1120 Reported by Randal L. Schwartz in
1121 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
1122 * nsterm.m (ns_timeout): Add missing local decl.
1123 (ns_get_color): snprintf -> sprintf, to fix typo.
1124
1125 2012-07-12 Glenn Morris <rgm@gnu.org>
1126
1127 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
1128 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
1129 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
1130 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
1131
1132 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
1133 Move PTY_OPEN to configure.
1134
1135 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
1136 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
1137 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
1138
1139 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
1140
1141 Use empty_unibyte_string where applicable.
1142 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
1143 * lread.c (read1): Likewise.
1144 * xsettings.c (syms_of_xsettings): Likewise.
1145
1146 2012-07-12 Glenn Morris <rgm@gnu.org>
1147
1148 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
1149 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
1150 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
1151 * s/hpux10-20.h (RUN_TIME_REMAP):
1152 * s/bsd-common.h (TABDLY): Move to configure.
1153
1154 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
1155
1156 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
1157
1158 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
1159 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
1160
1161 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
1162
1163 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
1164 * s/template.h: Move NARROWPROTO to configure.
1165
1166 2012-07-11 Glenn Morris <rgm@gnu.org>
1167
1168 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
1169 unused since 2011-01-17 change to systty.h.
1170
1171 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
1172 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
1173 Move HAVE_PTYS and HAVE_SOCKETS to configure.
1174
1175 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
1176
1177 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
1178
1179 2012-07-11 Glenn Morris <rgm@gnu.org>
1180
1181 * s/darwin.h, s/gnu-linux.h, s/template.h:
1182 Move INTERRUPT_INPUT to configure.
1183
1184 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
1185
1186 Minor adjustments to interning code.
1187 * lisp.h (intern, intern_c_string): Redefine as static inline
1188 wrappers for intern_1 and intern_c_string_1, respectively.
1189 (intern_1, intern_c_string_1): Rename prototypes.
1190 * lread.c (intern_1, intern_c_string_1, oblookup): Simplify
1191 Vobarray checking.
1192 * font.c (font_intern_prop): Likewise. Adjust comment.
1193 * w32font.c (intern_font_name): Likewise.
1194
1195 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
1196
1197 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
1198
1199 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
1200 of Fcar/Fcdr if possible.
1201 * font.c (check_otf_features): Likewise.
1202 * fontset.c (Fnew_fontset): Likewise.
1203 * gnutls.c (Fgnutls_boot): Likewise.
1204 * minibuf.c (read_minibuf): Likewise.
1205 * msdos.c (IT_set_frame_parameters): Likewise.
1206 * xmenu.c (Fx_popup_dialog): Likewise.
1207 * w32menu.c (Fx_popup_dialog): Likewise.
1208
1209 2012-07-11 Glenn Morris <rgm@gnu.org>
1210
1211 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
1212 since nothing has defined it on these platforms.
1213
1214 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
1215 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
1216
1217 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
1218 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
1219 Move CLASH_DETECTION to configure.
1220
1221 * s/gnu.h: Remove file, which is now empty.
1222
1223 * s/gnu.h, s/gnu-linux.h:
1224 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
1225
1226 2012-07-11 John Wiegley <johnw@newartisans.com>
1227
1228 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
1229 function attribute, so we only use it if it exists in the
1230 compiler.
1231
1232 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
1233
1234 Avoid call to strlen in fast_c_string_match_ignore_case.
1235 * search.c (fast_c_string_match_ignore_case): Change to use
1236 length argument. Adjust users accordingly.
1237 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
1238
1239 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
1240
1241 Assume mkdir, rmdir.
1242 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
1243 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
1244
1245 Assume rename.
1246 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
1247
1248 Assume perror.
1249 * s/hpux10-20.h (HAVE_PERROR): Remove.
1250 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
1251 Remove dummy definition, as this problem was obsolete long ago.
1252
1253 Assume strerror.
1254 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
1255
1256 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
1257
1258 Avoid calls to strlen in font processing functions.
1259 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
1260 (font_open_by_name): Change to use length argument. Adjust
1261 users accordingly.
1262 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
1263 Adjust prototypes.
1264 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
1265 Change to return ptrdiff_t.
1266 (xfont_list_pattern, xfont_match): Use length returned by
1267 xfont_decode_coding_xlfd.
1268 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
1269
1270 2012-07-11 Glenn Morris <rgm@gnu.org>
1271
1272 * s/darwin.h, s/freebsd.h, s/netbsd.h:
1273 Move DONT_REOPEN_PTY to configure.
1274
1275 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
1276 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
1277
1278 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
1279
1280 Remove "#define unix" that is no longer needed (Bug#11905).
1281 * s/aix4-2.h (unix): Remove; no longer needed.
1282
1283 EMACS_TIME simplification (Bug#11875).
1284 This replaces macros (which typically do not work in GDB)
1285 with functions, typedefs and enums, making the code easier to debug.
1286 The functional style also makes code easier to read and maintain.
1287 * systime.h: Include <sys/time.h> on all hosts, not just if
1288 WINDOWSNT, since 'struct timeval' is needed in general.
1289 (EMACS_TIME): Now a typedef, not a macro.
1290 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
1291 not macros.
1292 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
1293 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
1294 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
1295 (EMACS_TIME_LE): Now functions, not macros.
1296 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
1297 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
1298 which are not functions. All uses rewritten to use:
1299 (make_emacs_time): New function.
1300 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
1301 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
1302 not functions. All uses rewritten to use the following, respectively:
1303 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
1304 (add_emacs_time, sub_emacs_time): New functions.
1305 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
1306 * fileio.c (Fcopy_file):
1307 * xterm.c (XTflash): Get the current time closer to when it's used.
1308 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
1309
1310 * bytecode.c (targets): Suppress -Woverride-init warnings.
1311
1312 Simplify by avoiding confusing use of strncpy etc.
1313 * doc.c (Fsnarf_documentation):
1314 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
1315 * frame.c (Fmake_terminal_frame):
1316 * gtkutil.c (get_utf8_string):
1317 * lread.c (openp):
1318 * nsmenu.m (ns_update_menubar):
1319 * regex.c (regerror):
1320 Prefer memcpy to strncpy and strncat when either will do.
1321 * fileio.c (Fsubstitute_in_file_name):
1322 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
1323 (menu_separator_name_p):
1324 * nsmenu.m (ns_update_menubar):
1325 Prefer memcmp to strncmp when either will do.
1326 * nsterm.m: Include <ftoastr.h>.
1327 (ns_get_color):
1328 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
1329 Prefer snprintf to strncpy.
1330 * nsterm.m (ns_term_init):
1331 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
1332 * nsterm.m (ns_term_init):
1333 Avoid the need for strncpy, by using build_string or
1334 make_unibyte_string directly. Use dtoastr, not snprintf.
1335 * process.c (Fmake_network_process): Diagnose service names that
1336 are too long, rather than silently truncating them or creating
1337 non-null-terminated names.
1338 (Fnetwork_interface_info): Likewise, for interface names.
1339 * sysdep.c (system_process_attributes) [GNU_LINUX]:
1340 Prefer sprintf to strncat.
1341 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
1342 Prefer vsnprintf to vsprintf + strncpy.
1343
1344 2012-07-10 Glenn Morris <rgm@gnu.org>
1345
1346 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
1347 Clarify fallback case.
1348
1349 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
1350
1351 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
1352 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
1353 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
1354 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
1355 where argument type is known to be a Lisp_Cons.
1356
1357 2012-07-10 Tom Tromey <tromey@redhat.com>
1358
1359 * bytecode.c (BYTE_CODE_THREADED): New macro.
1360 (BYTE_CODES): New macro. Replaces all old byte-code defines.
1361 (enum byte_code_op): New type.
1362 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
1363 (exec_byte_code): Use them. Use token threading when applicable.
1364
1365 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
1366
1367 Optimize pure C strings initialization.
1368 * lisp.h (make_pure_string): Fix prototype.
1369 (build_pure_c_string): New function, defined as static inline. This
1370 provides a better opportunity to optimize away calls to strlen when
1371 the function is called with compile-time constant argument.
1372 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
1373 argument, adjust users accordingly. Use build_pure_c_string where
1374 appropriate.
1375 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
1376 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
1377 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
1378
1379 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
1380
1381 Avoid calls to strlen in miscellaneous functions.
1382 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
1383 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
1384 * lread.c (openp): Likewise.
1385
1386 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
1387
1388 Avoid calls to strlen in path processing functions.
1389 * fileio.c (file_name_as_directory): Add comment. Change to add
1390 srclen argument and return the length of result. Adjust users
1391 accordingly.
1392 (directory_file_name): Fix comment. Change to add srclen argument,
1393 swap 1st and 2nd arguments to obey the common convention. Adjust
1394 users accordingly.
1395 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
1396
1397 2012-07-10 Glenn Morris <rgm@gnu.org>
1398
1399 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
1400 Move PENDING_OUTPUT_COUNT definition to configure.
1401
1402 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
1403 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
1404 * s/gnu.h (DATA_START): Move definitions to configure.
1405
1406 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
1407 We include usg5-4-common.h, which defines them both.
1408
1409 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
1410 O_RDONLY already includes it).
1411
1412 Stop ns builds setting the EMACSLOADPATH environment variable.
1413 * nsterm.m (ns_load_path): Rename from ns_init_paths.
1414 Now it does not set EMACSLOADPATH, just returns the load-path string.
1415 * nsterm.h: Update accordingly.
1416 * lread.c [HAVE_NS]: Include nsterm.h.
1417 (init_lread) [HAVE_NS]: Use ns_load_path.
1418 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
1419
1420 2012-07-09 Glenn Morris <rgm@gnu.org>
1421
1422 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
1423 since the included bsd-common.h does so.
1424
1425 Stop ns builds setting the EMACSPATH environment variable.
1426 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
1427 (ns_init_paths): Do not set EMACSPATH.
1428 * nsterm.h (ns_exec_path): Add it.
1429 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
1430 Use ns_exec_path.
1431
1432 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
1433
1434 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
1435
1436 * process.c (wait_reading_process_output): 'waitchannels' was unset
1437 when read_kbd || !NILP (wait_for_cell); fix this.
1438
1439 Add GCC-style 'const' attribute to functions that can use it.
1440 * character.h (char_resolve_modifier_mask):
1441 * keyboard.h (make_ctrl_char):
1442 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
1443 (init_character_once, next_almost_prime, init_fns, init_image)
1444 (flush_pending_output, init_sound):
1445 * mem-limits.h (start_of_data):
1446 * menu.h (finish_menu_items):
1447 Add ATTRIBUTE_CONST.
1448 * emacs.c (DEFINE_DUMMY_FUNCTION):
1449 Declare the dummy function with ATTRIBUTE_CONST.
1450 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
1451 Add decls with ATTRIBUTE_CONST.
1452
1453 Minor improvements to make_formatted_string.
1454 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
1455 where int is good enough, as vsprintf returns an int.
1456 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
1457
1458 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
1459
1460 Use make_formatted_string to avoid double length calculation.
1461 * lisp.h (make_formatted_string): New prototype.
1462 * alloc.c (make_formatted_string): New function.
1463 * buffer.c (Fgenerate_new_buffer_name): Use it.
1464 * dbus.c (syms_of_dbusbind): Likewise.
1465 * editfns.c (Fcurrent_time_zone): Likewise.
1466 * filelock.c (get_boot_time): Likewise.
1467 * frame.c (make_terminal_frame, set_term_frame_name)
1468 (x_report_frame_params): Likewise.
1469 * image.c (gs_load): Likewise.
1470 * minibuf.c (get_minibuffer): Likewise.
1471 * msdos.c (dos_set_window_size): Likewise.
1472 * process.c (make_process): Likewise.
1473 * xdisp.c (ensure_echo_area_buffers): Likewise.
1474 * xsettings.c (apply_xft_settings): Likewise.
1475
1476 2012-07-09 Glenn Morris <rgm@gnu.org>
1477
1478 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
1479 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
1480 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
1481 * nsterm.h (ns_etc_directory): Add it.
1482 * callproc.c [HAVE_NS]: Include nsterm.h.
1483 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
1484
1485 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
1486
1487 Move marker debugging code under MARKER_DEBUG.
1488 * marker.c (MARKER_DEBUG): Move marker debugging code under
1489 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
1490 for bootstrap with --enable-checking (~3x slowdown reported
1491 by Juanma Barranquero <lekktu@gmail.com>).
1492 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
1493
1494 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
1495
1496 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
1497 See <http://bugs.gnu.org/11825#29>.
1498
1499 2012-07-08 Eli Zaretskii <eliz@gnu.org>
1500
1501 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
1502 has no font, use the frame's font. (Bug#11813)
1503 (display_line): Add commentary about displaying truncation glyphs
1504 on GUI frames.
1505 (produce_special_glyphs): Move here from term.c.
1506
1507 * term.c (produce_special_glyphs): Move to xdisp.c.
1508
1509 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
1510 section.
1511
1512 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
1513
1514 * xdisp.c (display_line): Avoid warning about implicit declaration
1515 of FRAME_FONT.
1516
1517 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
1518
1519 * lisp.h: Remove empty conditional.
1520
1521 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
1522
1523 * lread.c (load_path_check): Now static.
1524
1525 Fix some minor --with-ns problems found by static checking.
1526 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
1527 (x_set_font) [!HAVE_X_WINDOWS]:
1528 * image.c (xpm_load_image) [HAVE_NS]:
1529 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
1530 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
1531 Remove unused local.
1532 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
1533 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
1534 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
1535 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
1536 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
1537 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
1538 Fix pointer signedness problem.
1539 * xfaces.c (FRAME_X_FONT_TABLE):
1540 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
1541
1542 2012-07-07 Glenn Morris <rgm@gnu.org>
1543
1544 * lread.c (load_path_check): New function, split from init_lread.
1545 (init_lread): Reorganize. Motivation:
1546 If EMACSLOADPATH is set, check/warn about that rather than the
1547 defaults, which we are not going to use. Hence we can remove
1548 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
1549 Don't warn if site-lisp directories are missing.
1550 If not installed, start from a blank load-path, since
1551 PATH_LOADSEARCH refers to the eventual installation directories.
1552
1553 2012-07-07 Eli Zaretskii <eliz@gnu.org>
1554
1555 Support truncation and continuation glyphs on GUI frames, when
1556 fringes are disabled. (Bug#11832)
1557 * xdisp.c (init_iterator): Get dimensions of truncation and
1558 continuation glyphs even if on GUI frames. Adjust
1559 it->last_visible_x on GUI frames when the left or right fringes,
1560 or both, are absent.
1561 (start_display, move_it_in_display_line_to): Handle the case of a
1562 GUI frame without a fringe to display continuation or truncation
1563 glyphs.
1564 (insert_left_trunc_glyphs): Support GUI frames: make sure
1565 truncation glyphs overwrite enough glyphs from the current line to
1566 have sufficient space in pixels.
1567 (display_line): Support truncation and continuation glyphs on GUI
1568 frames. If some spare pixels are left on the line after inserting
1569 the truncation glyphs, fill that space with a stretch glyph of a
1570 suitably computed width.
1571
1572 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
1573 produce_glyphs, to support GUI sessions.
1574
1575 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
1576
1577 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
1578
1579 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
1580
1581 Do not require float-time's arg to fit in time_t (Bug#11825).
1582 This works better on hosts where time_t is unsigned, and where
1583 float-time is applied to the (negative) difference between two times.
1584 * editfns.c (decode_time_components): Last arg is now double *,
1585 not int *, and means to store all the result as a double, without
1586 worrying about whether the seconds part fits in time_t.
1587 All callers changed.
1588 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
1589 All callers changed.
1590 (Ffloat_time): Do not fail merely because the specified time falls
1591 outside of time_t range.
1592
1593 2012-07-07 Glenn Morris <rgm@gnu.org>
1594
1595 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
1596 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
1597 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
1598
1599 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
1600
1601 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
1602 Update dependencies.
1603
1604 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
1605
1606 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
1607
1608 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
1609 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
1610 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
1611 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
1612 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
1613 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
1614
1615 * xfont.c (compare_font_names): Redo to omit the need for casts.
1616
1617 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
1618
1619 * xfns.c (Fx_change_window_property): Doc fix.
1620 * w32fns.c (Fx_change_window_property): Doc fix.
1621
1622 * w32fns.c (Fx_window_property): Accept the same arguments as the
1623 X Windows version. Doc fix.
1624 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
1625
1626 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
1627 Eli Zaretskii <eliz@gnu.org>
1628
1629 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
1630 Windows-specific code from nt/config.nt moved here.
1631 Obsolete settings removed.
1632
1633 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
1634
1635 * process.c: Avoid unnecessary calls to gettime.
1636 (wait_reading_process_output): Don't get the time of day
1637 when gobbling data immediately and not waiting, as there's no need
1638 for it in that case. This removes a FIXME.
1639
1640 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
1641
1642 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
1643 is defined (Bug#11768).
1644
1645 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
1646
1647 Fix marker debugging code.
1648 * marker.c (byte_char_debug_check): Do not perform the check
1649 if buffer is not multibyte.
1650 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
1651 Call byte_char_debug_check with correct arguments.
1652
1653 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
1654
1655 Compile marker debugging code only if ENABLE_CHECKING is defined.
1656 * marker.c (byte_char_debug_check, count_markers):
1657 Use only if ENABLE_CHECKING is defined.
1658 (byte_debug_flag): Remove.
1659 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
1660 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
1661
1662 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
1663
1664 Avoid code repetition in marker-related functions.
1665 * marker.c (attach_marker): New function.
1666 (Fset_marker, set_marker_restricted, set_marker_both)
1667 (set_marker_restricted_both): Use it.
1668 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
1669 Consistently rename charno to charpos.
1670 (marker_position): Add eassert.
1671 (marker_byte_position): Convert to eassert.
1672
1673 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
1674
1675 Simplify list operations in unchain_overlay and unchain_marker.
1676 * buffer.c (unchain_overlay): Simplify. Add comment.
1677 * marker.c (unchain_marker): Simplify. Fix comments.
1678
1679 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
1680
1681 Introduce fast path for the widely used marker operation.
1682 * alloc.c (build_marker): New function.
1683 * lisp.h (build_marker): New prototype.
1684 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
1685 * composite.c (autocmp_chars): Likewise.
1686 * editfns.c (buildmark): Remove.
1687 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
1688 (save_restriction_save): Use build_marker.
1689 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
1690 * window.c (save_window_save): Likewise.
1691
1692 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
1693
1694 Do not use Fdelete_overlay in delete_all_overlays
1695 to avoid redundant calls to unchain_overlay.
1696 * buffer.c (drop_overlay): New function.
1697 (delete_all_overlays, Fdelete_overlay): Use it.
1698 * minibuf.c (get_minibuffer): Fix comment.
1699
1700 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
1701
1702 Port to OpenBSD 5.1 amd64.
1703 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
1704 This is needed for OpenBSD, and should be harmless on all BSD systems.
1705 Also, include <sys/sysctl.h>, as it should be available on all
1706 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
1707 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
1708 use p_pid member, not kp_proc.pid.
1709
1710 2012-07-06 Glenn Morris <rgm@gnu.org>
1711
1712 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
1713
1714 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
1715
1716 More xmalloc and related cleanup.
1717 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
1718 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
1719 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
1720 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
1721 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
1722 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
1723 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
1724 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
1725 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
1726 * xterm.c:
1727 Omit needless casts involving void * pointers and allocation.
1728 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
1729 as the former is more robust if P's type is changed.
1730 Prefer xzalloc to xmalloc + memset 0.
1731 Simplify malloc-or-realloc to realloc.
1732 Don't worry about xmalloc returning a null pointer.
1733 Prefer xstrdup to xmalloc + strcpy.
1734 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
1735 growing it.
1736 * keyboard.c (apply_modifiers_uncached): Prefer local array to
1737 alloca of a constant.
1738
1739 2012-07-05 Eli Zaretskii <eliz@gnu.org>
1740
1741 * xdisp.c (display_line): Fix horizontal pixel coordinates when
1742 hscroll is larger than the line width. Fixes long and futile
1743 looping inside extend_face_to_end_of_line (on a TTY) producing
1744 glyphs that are not needed and thrown away.
1745
1746 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
1747
1748 * marker.c (set_marker_restricted_both): Simplify by using
1749 clip_to_bounds.
1750
1751 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
1752
1753 * editfns.c (region_limit): Simplify by using clip_to_bounds.
1754
1755 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
1756
1757 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
1758 not defined (Bug#11768).
1759 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
1760 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
1761 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
1762 followed by gtk_box_set_homogeneous (Bug#11768).
1763 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
1764 (update_theme_scrollbar_width, xg_create_scroll_bar):
1765 Use gtk_scrollbar_new (Bug#11768).
1766 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
1767 (is_box_type): New function (Bug#11768).
1768 (xg_tool_item_stale_p): Call is_box_type.
1769 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
1770 with default display (Bug#11768).
1771
1772 2012-07-05 Eli Zaretskii <eliz@gnu.org>
1773
1774 * xdisp.c (window_hscroll_limited): New function.
1775 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
1776 coordinates when window's hscroll is set to insanely large
1777 values. (Bug#11857)
1778
1779 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
1780
1781 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
1782 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
1783
1784 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
1785
1786 Cleanup xmalloc.
1787 * lisp.h (xzalloc): New prototype. Omit needless casts.
1788 * alloc.c (xzalloc): New function. Omit needless casts.
1789 * charset.c: Omit needless casts. Convert all calls to
1790 xmalloc with following memset to xzalloc.
1791 * dispnew.c: Likewise.
1792 * fringe.c: Likewise.
1793 * image.c: Likewise.
1794 * sound.c: Likewise.
1795 * term.c: Likewise.
1796 * w32fns.c: Likewise.
1797 * w32font.c: Likewise.
1798 * w32term.c: Likewise.
1799 * xfaces.c: Likewise.
1800 * xfns.c: Likewise.
1801 * xterm.c: Likewise.
1802 * atimer.c: Omit needless casts.
1803 * buffer.c: Likewise.
1804 * callproc.c: Likewise.
1805 * ccl.c: Likewise.
1806 * coding.c: Likewise.
1807 * composite.c: Likewise.
1808 * doc.c: Likewise.
1809 * doprnt.c: Likewise.
1810 * editfns.c: Likewise.
1811 * emacs.c: Likewise.
1812 * eval.c: Likewise.
1813 * filelock.c: Likewise.
1814 * fns.c: Likewise.
1815 * gtkutil.c: Likewise.
1816 * keyboard.c: Likewise.
1817 * lisp.h: Likewise.
1818 * lread.c: Likewise.
1819 * minibuf.c: Likewise.
1820 * msdos.c: Likewise.
1821 * print.c: Likewise.
1822 * process.c: Likewise.
1823 * region-cache.c: Likewise.
1824 * search.c: Likewise.
1825 * sysdep.c: Likewise.
1826 * termcap.c: Likewise.
1827 * terminal.c: Likewise.
1828 * tparam.c: Likewise.
1829 * w16select.c: Likewise.
1830 * w32.c: Likewise.
1831 * w32reg.c: Likewise.
1832 * w32select.c: Likewise.
1833 * w32uniscribe.c: Likewise.
1834 * widget.c: Likewise.
1835 * xdisp.c: Likewise.
1836 * xmenu.c: Likewise.
1837 * xrdb.c: Likewise.
1838 * xselect.c: Likewise.
1839
1840 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
1841
1842 * fileio.c (time_error_value): Check the right error number.
1843 Problem reported by Troels Nielsen in
1844 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
1845
1846 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
1847
1848 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
1849 This should be fixed in a better way; see Eli Zaretskii in
1850 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
1851 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
1852
1853 * fileio.c (time_error_value): Rename from special_mtime.
1854 The old name's problems were noted by Eli Zaretskii in
1855 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
1856
1857 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
1858 This variable's comment says Emacs needs at least one GDB-visible
1859 symbol of type enum pvec_type, to work around GDB problems.
1860 The symbol's value doesn't matter.
1861
1862 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
1863 that causes compilation to fail on pre-C99 compilers.
1864
1865 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
1866
1867 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
1868 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
1869
1870 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
1871
1872 * buffer.c (init_buffer_once): Fix initialization of
1873 headers for buffer_defaults and buffer_local_symbols.
1874 Reported by Juanma Barranquero <lekktu@gmail.com>.
1875
1876 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
1877
1878 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
1879 * lisp.h (enum pvec_type): Use fewer bits.
1880 (PSEUDOVECTOR_SIZE_BITS): New constant.
1881 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
1882 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
1883 change in pvec_type.
1884 (PSEUDOVECTOR_TYPEP): New macro.
1885 (TYPED_PSEUDOVECTORP): Use it.
1886 * fns.c (internal_equal): Adapt code to extract pvectype.
1887 * emacs.c (gdb_pvec_type): Update type.
1888 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
1889 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
1890 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
1891 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
1892 (sweep_vectors): Use it. Use local var `total_bytes' instead of
1893 abusing vector->header.next.nbytes.
1894 (live_vector_p): Use PVEC_TYPE.
1895 (mark_object): Adapt code to extract pvectype. Use switch.
1896
1897 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
1898
1899 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
1900 Tighten new eassert a bit.
1901
1902 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
1903
1904 Fix compilation with --enable-gcc-warnings and -O1
1905 optimization level.
1906 * doprnt.c (doprnt): Change type of tem to int, initialize
1907 to avoid compiler warning. Add eassert.
1908 * search.c (simple_search): Initialize match_byte to avoid
1909 compiler warning. Add eassert.
1910
1911 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
1912
1913 Avoid weird behavior with large horizontal scrolls.
1914 Without this change, for example, large hscroll values would
1915 mess up Emacs's display on Fedora 15 x86, presumably due to
1916 overflows in int calculations in the display code.
1917 Also, if buffers had long lines, Emacs would freeze.
1918 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
1919 (set_window_hscroll): New function, containing the old guts of
1920 Fset_window_hscroll. Return the clipped value.
1921 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
1922 This avoids the need to check against PTRDIFF_MAX.
1923
1924 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
1925
1926 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
1927
1928 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
1929
1930 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
1931
1932 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
1933 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
1934 since GCC 4.4.6 issues a bogus warning for them.
1935
1936 Fix bugs in file timestamp newness comparisons.
1937 * fileio.c (Ffile_newer_than_file_p):
1938 * lread.c (Fload): Use full timestamp resolution of files,
1939 not just the 1-second resolution, so that files that are only
1940 slightly newer still count as newer.
1941 * fileio.c (Ffile_newer_than_file_p): Don't assume file
1942 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
1943
1944 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
1945
1946 * fileio.c: Improve handling of file time marker. (Bug#11852)
1947 (special_mtime): New function.
1948 (Finsert_file_contents, Fverify_visited_file_modtime):
1949 Use it to set special mtime values consistently.
1950
1951 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
1952
1953 * fileio.c (Finsert_file_contents): Properly handle st_mtime
1954 marker for non-existing file. (Bug#11852)
1955
1956 2012-07-03 Glenn Morris <rgm@gnu.org>
1957
1958 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
1959 and did not make it into globals.h).
1960
1961 2012-07-03 Tom Tromey <tromey@redhat.com>
1962
1963 * window.c (Fset_window_margins, Fset_window_fringes)
1964 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
1965 * textprop.c (Fprevious_property_change): No longer static.
1966 * syntax.c (Fsyntax_table_p): No longer static.
1967 * process.c (Fget_process, Fprocess_datagram_address): No longer
1968 static.
1969 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
1970 * keyboard.c (Fcommand_execute): No longer static.
1971 Remove EXFUN.
1972 * insdel.c (Fcombine_after_change_execute): No longer static.
1973 * image.c (Finit_image_library): No longer static.
1974 * fileio.c (Fmake_symbolic_link): No longer static.
1975 * eval.c (Ffetch_bytecode): No longer static.
1976 * editfns.c (Fuser_full_name): No longer static.
1977 * doc.c (Fdocumentation_property, Fsnarf_documentation):
1978 No longer static.
1979 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
1980 static.
1981 * dired.c (Ffile_attributes): No longer static.
1982 * composite.c (Fcomposition_get_gstring): No longer static.
1983 * callproc.c (Fgetenv_internal): No longer static.
1984
1985 * ccl.h: Remove EXFUNs.
1986 * buffer.h: Remove EXFUNs.
1987 * dispextern.h: Remove EXFUNs.
1988 * intervals.h: Remove EXFUNs.
1989 * fontset.h: Remove EXFUN.
1990 * font.h: Remove EXFUNs.
1991 * dosfns.c (system_process_attributes): Remove EXFUN.
1992 * keymap.h: Remove EXFUNs.
1993 * lisp.h: Remove EXFUNs.
1994 * w32term.h: Remove EXFUNs.
1995 * window.h: Remove EXFUNs.
1996 * xsettings.h: Remove EXFUN.
1997 * xterm.h: Remove EXFUN.
1998
1999 2012-07-03 Glenn Morris <rgm@gnu.org>
2000
2001 * lisp.h (Frandom): Make it visible to C.
2002 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
2003 buffer for invisible buffers. (Bug#1229)
2004
2005 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
2006
2007 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
2008 values which aren't power of 2.
2009 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro. Verify
2010 it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
2011 accordingly.
2012
2013 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
2014
2015 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
2016
2017 * alloc.c (mark_object): Revert part of last patch to use `switch'.
2018
2019 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
2020
2021 * alloc.c (allocate_vector_block): Remove redundant
2022 calls to mallopt if DOUG_LEA_MALLOC is defined.
2023 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
2024 avoid calls to mallopt if zero_vector is returned.
2025
2026 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
2027
2028 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
2029 is enabled, avoid dereferencing NULL current_sblock if
2030 running undumped.
2031
2032 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
2033
2034 Cleanup basic buffer management.
2035 * buffer.h (struct buffer): Change layout to use generic vector
2036 marking code. Fix some comments. Change type of 'clip_changed'
2037 to bitfield. Remove unused #ifndef old.
2038 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
2039 (GET_OVERLAYS_AT): Fix indentation.
2040 (for_each_per_buffer_object_at): New macro.
2041 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
2042 (Fbuffer_local_variables): Use it.
2043 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
2044 * alloc.c (allocate_buffer): Adjust to match new layout of
2045 struct buffer. Fix comment.
2046 (mark_overlay): New function.
2047 (mark_buffer): Use it. Use mark_vectorlike to mark normal
2048 Lisp area of struct buffer.
2049 (mark_object): Use it. Adjust marking of misc objects
2050 and related comments.
2051
2052 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
2053
2054 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
2055 wrapper that is not needed because the wrapped code is a no-op (zero
2056 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
2057 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
2058
2059 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
2060
2061 * alloc.c (mark_buffer): Simplify. Remove prototype.
2062 (mark_object): Add comment. Reorganize marking of vector-like
2063 objects. Use CHECK_LIVE for all vector-like objects except buffers
2064 and subroutines when GC_CHECK_MARKED_OBJECTS is defined. Avoid
2065 redundant calls to mark_vectorlike for bool vectors.
2066
2067 2012-06-30 Glenn Morris <rgm@gnu.org>
2068
2069 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
2070
2071 * epaths.in (PATH_SITELOADSEARCH): New.
2072 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
2073 This is rather than relying on --enable-locallisppath elements
2074 having "site-lisp" in their names. (Bug#10208#25, 11658)
2075
2076 2012-06-30 Eli Zaretskii <eliz@gnu.org>
2077
2078 * w32proc.c (sys_select): Accept and ignore one more argument.
2079
2080 * w32.c (emacs_gnutls_pull): Call select with one more argument.
2081
2082 * sysselect.h [DOS_NT]: Don't include sys/select.h.
2083 (pselect) [!MS_DOS]: Redirect to sys_select.
2084
2085 * sysdep.c: Don't include dos.h and dosfns.h.
2086
2087 * process.c (sys_select):
2088 * msdos.c (sys_select): Accept one more argument and ignore it.
2089
2090 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
2091 adapt data types and code to that.
2092
2093 * dosfns.c:
2094 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
2095 which clashes with the gnulib function of the same name.
2096
2097 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
2098
2099 * font.c (font_style_to_value, font_style_symbolic)
2100 (font_prop_validate_style): Add type checks for values in
2101 font_style_table.
2102
2103 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
2104 argument.
2105 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
2106 uses.
2107
2108 2012-06-29 Eli Zaretskii <eliz@gnu.org>
2109
2110 * xdisp.c (try_window_id): Undo last change.
2111
2112 * w32.c (getwd): Adjust commentary about startup_dir.
2113 (init_environment): Always call sys_access, even in non-MSVC
2114 builds. Don't chdir to the directory of the Emacs executable.
2115 This undoes code from 1997 which was justified by the need to
2116 "avoid conflicts when removing and renaming directories". But its
2117 downside was that every relative file name was being interpreted
2118 relative to the directory of the Emacs executable, which can never
2119 be TRT. In particular, it broke sys_access when called with
2120 relative file names.
2121 (sys_access): Map GetLastError to errno.
2122
2123 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
2124
2125 * window.h (struct window): Change type of 'fringes_outside_margins'
2126 to bitfield. Fix comment. Adjust users accordingly.
2127 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2128 Adjust comment.
2129 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
2130 to ptrdiff_t.
2131
2132 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
2133
2134 * gnutls.c (emacs_gnutls_handshake):
2135 Add QUIT to make the loop interruptible.
2136
2137 2012-06-29 Glenn Morris <rgm@gnu.org>
2138
2139 * charset.c (init_charset): Make lack of etc/charsets fatal.
2140
2141 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
2142
2143 * editfns.c (region_limit): Fix type mismatch.
2144
2145 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
2146
2147 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
2148 undefined. Convert from xassert to eassert.
2149 * nsmenu.m: Convert from xassert to eassert.
2150 * nsterm.m: Likewise.
2151
2152 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
2153
2154 * editfns.c (region_limit): Clip to narrowing (bug#11770).
2155
2156 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
2157
2158 Avoid integer overflow on scroll-left and scroll-right.
2159 * window.c (HSCROLL_MAX): New macro.
2160 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
2161 overflow when requested scroll falls outside ptrdiff_t range.
2162
2163 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
2164
2165 * window.h (struct window): Change type of 'hscroll',
2166 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
2167 'last_modified' and 'last_overlay_modified' to EMACS_INT.
2168 Adjust users accordingly.
2169 * xdisp.c (try_cursor_movement): Replace type check with eassert.
2170 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
2171 from EMACS_INT to ptrdiff_t.
2172 (make_window): Omit redundant initialization.
2173
2174 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
2175
2176 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
2177
2178 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
2179
2180 * window.h (struct window): Change type of 'use_time' and
2181 'sequence_number' from Lisp_Object to int.
2182 * frame.c (make_frame): Adjust users accordingly.
2183 * print.c (print_object): Likewise.
2184 * window.c (select_window, Fwindow_use_time, make_parent_window)
2185 (make_window): Likewise.
2186
2187 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
2188
2189 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
2190 enabled with --enable-checking=[all,glyphs] configure option.
2191 Fix GLYPH_DEBUG usage assuming that it may be undefined,
2192 adjust comments accordingly.
2193 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
2194 undefined, adjust comments accordingly.
2195 * image.c: Likewise.
2196 * scroll.c: Likewise.
2197 * w32fns.c: Likewise.
2198 * w32term.c: Likewise.
2199 * xdisp.c: Likewise.
2200 * xfaces.c: Likewise.
2201 * xfns.c: Likewise.
2202 * xterm.c: Likewise.
2203
2204 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
2205
2206 Generalize run-time debugging checks.
2207 * dispextern.h (XASSERTS): Remove.
2208 * fontset.c (xassert): Remove.
2209 Convert from xassert to eassert.
2210 * alloc.c: Convert from xassert to eassert.
2211 * bidi.c: Likewise.
2212 * dispnew.c: Likewise.
2213 * fns.c: Likewise.
2214 * fringe.c: Likewise.
2215 * ftfont.c: Likewise.
2216 * gtkutil.c: Likewise.
2217 * image.c: Likewise.
2218 * keyboard.c: Likewise.
2219 * menu.c: Likewise.
2220 * process.c: Likewise.
2221 * scroll.c: Likewise.
2222 * sound.c: Likewise.
2223 * term.c: Likewise.
2224 * w32console.c: Likewise.
2225 * w32fns.c: Likewise.
2226 * w32term.c: Likewise.
2227 * window.c: Likewise.
2228 * xdisp.c: Likewise.
2229 * xfaces.c: Likewise.
2230 * xfns.c: Likewise.
2231 * xselect.c: Likewise.
2232 * xterm.c: Likewise.
2233
2234 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
2235
2236 * fns.c (maybe_resize_hash_table): Output message when growing the
2237 purify-hashtable.
2238
2239 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2240
2241 * alloc.c (allocate_string_data): Remove dead code.
2242 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
2243 avoid GCC warning about unused macro.
2244
2245 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2246
2247 * alloc.c (allocate_string): Omit intervals initialization.
2248 * alloc.c (make_uninit_multibyte_string): Initialize intervals
2249 as in make_pure_string and make_pure_c_string.
2250
2251 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2252
2253 * alloc.c (allocate_string): Fix last change.
2254
2255 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2256
2257 * alloc.c (allocate_string): Remove two redundant calls
2258 to memset, add explicit initialization where appropriate.
2259
2260 2012-06-27 Glenn Morris <rgm@gnu.org>
2261
2262 * lisp.mk (lisp): Remove paths.elc.
2263
2264 2012-06-27 Chong Yidong <cyd@gnu.org>
2265
2266 * doc.c (Fsubstitute_command_keys): Fix punctuation.
2267
2268 2012-06-26 John Wiegley <johnw@newartisans.com>
2269
2270 * unexmacosx.c (copy_data_segment): Add two section names used
2271 on Mac OS X Lion: __mod_init_func and __mod_term_func.
2272
2273 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
2274 when building with Clang.
2275
2276 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
2277
2278 * eval.c (Fapply): Allow calling it with a single argument.
2279
2280 2012-06-26 Eli Zaretskii <eliz@gnu.org>
2281
2282 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
2283 _stricmp and _strnicmp.
2284 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
2285
2286 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
2287
2288 * alloc.c (allocate_window): Zero out non-Lisp part of newly
2289 allocated window.
2290 (allocate_process): Likewise for new process.
2291 (allocate_terminal): Change to use offsetof.
2292 (allocate_frame): Likewise.
2293 * frame.c (make_frame): Omit redundant initialization.
2294 * window.c (make_parent_window): Use memset.
2295 (make_window): Omit redundant initialization.
2296 * process.c (make_process): Omit redundant initialization.
2297 * terminal.c (create_terminal): Likewise.
2298
2299 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
2300
2301 * term.c (delete_tty): Remove redundant call to memset.
2302
2303 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
2304
2305 * alloc.c: Remove build_string.
2306 * lisp.h: Define build_string as static inline. This provides
2307 a better opportunity to optimize away calls to strlen when the
2308 function is called with compile-time constant argument.
2309 * image.c (imagemagick_error): Convert to build_string.
2310 * w32proc.c (sys_spawnve): Likewise.
2311 * xterm.c (x_term_init): Likewise.
2312
2313 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
2314
2315 Use sprintf return value instead of invoking strlen on result.
2316 In the old days this wasn't portable, since some sprintf
2317 implementations returned char *. But they died out years ago and
2318 Emacs already assumes sprintf returns int.
2319 Similarly for float_to_string.
2320 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
2321 * ccl.c (ccl_driver):
2322 * character.c (string_escape_byte8):
2323 * data.c (Fnumber_to_string):
2324 * doprnt.c (doprnt):
2325 * print.c (print_object):
2326 * xdisp.c (message_dolog):
2327 * xfns.c (syms_of_xfns):
2328 Use sprintf or float_to_string result to avoid need to call strlen.
2329 * data.c (Fnumber_to_string):
2330 Use make_unibyte_string, since the string must be ASCII.
2331 * lisp.h, print.c (float_to_string): Now returns int length.
2332 * term.c (produce_glyphless_glyph):
2333 Use sprintf result rather than recomputing it.
2334
2335 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
2336 * Makefile.in (ALL_CFLAGS):
2337 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
2338 * gmalloc.c, regex.c: Include <config.h> unconditionally.
2339
2340 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
2341
2342 * dispextern.h (xstrcasecmp): Define to library function
2343 strcasecmp if available.
2344 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
2345
2346 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
2347
2348 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
2349 Avoid comma operator.
2350 * menu.c (push_submenu_start, push_submenu_end)
2351 (push_left_right_boundary, push_menu_pane): Likewise.
2352 * msdos.c (dos_rawgetc): Likewise.
2353
2354 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
2355
2356 * xfns.c (xic_create_fontsetname): Remove redundant calls
2357 to memset.
2358
2359 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
2360
2361 * gtkutil.c (get_utf8_string): Remove redundant assignment.
2362 sprintf already null-terminates its output.
2363
2364 * xfns.c (x_window): Remove redundant cast.
2365
2366 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
2367
2368 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
2369 `const char *' to `char *' to avoid compiler warning.
2370
2371 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
2372
2373 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
2374 instead of truncating it to 63 (admittedly a generous limit).
2375
2376 * process.c: Fix spelling and caps in comments.
2377
2378 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
2379
2380 * emacs.c (setpgrp): Remove definition, unused.
2381 * sysdep.c (setpgrp): Remove definition, not used in this file.
2382
2383 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
2384
2385 * makefile.w32-in: Update dependencies.
2386
2387 2012-06-24 Eli Zaretskii <eliz@gnu.org>
2388
2389 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
2390 (SYSTIME_H): Add nt/inc/sys/time.h.
2391
2392 * systime.h [WINDOWSNT]: Include sys/time.h.
2393
2394 * s/ms-w32.h (struct timespec): Definition moved from
2395 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
2396
2397 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
2398
2399 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
2400 * buffer.h (buffer_slot_type_mismatch):
2401 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
2402 * eval.c (unwind_to_catch):
2403 * image.c (my_png_error, my_error_exit):
2404 * keyboard.c (quit_throw_to_read_char, user_error)
2405 (Fexit_recursive_edit, Fabort_recursive_edit):
2406 * lisp.h (die, args_out_of_range, args_out_of_range_3)
2407 (wrong_type_argument, buffer_overflow, __executable_start)
2408 (memory_full, buffer_memory_full, string_overflow, Fthrow)
2409 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
2410 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
2411 (fatal):
2412 (child_setup) [!DOS_NT]:
2413 * lread.c (end_of_file_error, invalid_syntax):
2414 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
2415 * puresize.h (pure_write_error):
2416 * search.c (matcher_overflow):
2417 * sound.c (sound_perror, alsa_sound_perror):
2418 * sysdep.c, syssignal.h (croak):
2419 * term.c (maybe_fatal, vfatal):
2420 * textprop.c (text_read_only):
2421 * undo.c (user_error):
2422 * unexmacosx.c (unexec_error):
2423 * xterm.c (x_ins_del_lines, x_delete_glyphs):
2424 Use _Noreturn rather than NO_RETURN.
2425 No need for separate decl merely because of _Noreturn.
2426 * sound.c (sound_warning, parse_sound):
2427 Remove unnecessary forward decls.
2428
2429 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
2430
2431 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
2432 * lisp.h (WAIT_READING_MAX): New macro.
2433 * dispnew.c (Fsleep_for, sit_for):
2434 * keyboard.c (kbd_buffer_get_event):
2435 * process.c (Faccept_process_output):
2436 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
2437 This improves on the previous patch, which introduced a bug
2438 when time_t is unsigned and as wide as intmax_t.
2439 See <http://bugs.gnu.org/9000#51>.
2440
2441 2012-06-23 Eli Zaretskii <eliz@gnu.org>
2442
2443 * dispnew.c (sit_for, Fsleep_for):
2444 * keyboard.c (kbd_buffer_get_event):
2445 * process.c (Faccept_process_output): Avoid compiler warnings when
2446 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
2447
2448 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
2449
2450 * makefile.w32-in: Update dependencies.
2451
2452 * w32.c (ltime): Add return type and declare static.
2453 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
2454
2455 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
2456
2457 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
2458 Privately reported by Herbert J. Skuhra.
2459 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
2460 All uses changed.
2461 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
2462 not make_lisp_timeval, when the argument is of type EMACS_TIME.
2463
2464 2012-06-23 Eli Zaretskii <eliz@gnu.org>
2465
2466 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
2467 last argument of make_unibyte_string.
2468
2469 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
2470 language ID in the event parameters.
2471
2472 * w32term.c (w32_read_socket): Put the new keyboard codepage into
2473 event.code, not the obscure "character set ID".
2474
2475 2012-06-23 Chong Yidong <cyd@gnu.org>
2476
2477 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
2478
2479 2012-06-23 Eli Zaretskii <eliz@gnu.org>
2480
2481 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
2482 * w32.c (fdutimens): New function.
2483
2484 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
2485
2486 * s/ms-w32.h (pselect): Redirect to sys_select.
2487
2488 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
2489
2490 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
2491 in the logic of incrementing and decrementing the value of
2492 use_relocatable_buffers.
2493
2494 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
2495
2496 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
2497 Privately reported by Herbert J. Skuhra.
2498 [__FreeBSD__]: Remove "*/" typo after "#include".
2499 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
2500 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
2501 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
2502 Don't assume EMACS_TIME and struct timeval are the same type.
2503
2504 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
2505
2506 Support higher-resolution time stamps (Bug#9000).
2507 The time stamps are only nanosecond-resolution at the C level,
2508 since that's the best that any real-world system supports now.
2509 But they are picosecond-resolution at the Lisp level, as that's
2510 easy, and leaves room for future OS improvements.
2511
2512 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
2513 (LIBES): Use it.
2514
2515 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
2516 Don't get current time unless it's needed.
2517
2518 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
2519 now provides it if it's absent.
2520 (start_atimer): Port to higher-res time stamps.
2521 Check for time stamp overflow. Don't get current time more
2522 often than is needed.
2523
2524 * buffer.h (struct buffer): Buffer modtime now has high resolution.
2525 Include systime.h, not time.h.
2526 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
2527
2528 * dired.c: Include stat-time.h.
2529 (Ffile-attributes): File times now have higher resolution.
2530
2531 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
2532 (struct image): Timestamp now has higher resolution.
2533
2534 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
2535 has at least microseconds now. All uses removed.
2536 (update_frame, update_single_window, update_window, update_frame_1)
2537 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
2538
2539 * editfns.c (time_overflow): Now extern.
2540 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
2541 (float-time, Fformat_time_string, Fcurrent_time_string)
2542 (Fcurrent_time_zone): Accept and generate higher-resolution
2543 time stamps.
2544 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
2545 (decode_time_components, lisp_seconds_argument): New functions.
2546 (make_time): Now static.
2547 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
2548 Report an error if the time is invalid, rather than having the caller
2549 do that.
2550
2551 * fileio.c: Include <stat-time.h>
2552 (Fcopy_file): Copy higher-resolution time stamps.
2553 Prefer to set the time stamp via a file descriptor if that works.
2554 (Fset_file_times, Finsert_file_contents, Fwrite_region)
2555 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
2556 (Fvisited_file_modtime, Fset_visited_file_modtime):
2557 Support higher-resolution time stamps.
2558
2559 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
2560
2561 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
2562
2563 * image.c (prepare_image_for_display, clear_image_cache)
2564 (lookup_image): Port to higer-resolution time stamps.
2565
2566 * keyboard.c (start_polling, bind_polling_period):
2567 Check for time stamp overflow.
2568 (read_char, kbd_buffer_get_event, timer_start_idle)
2569 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
2570 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
2571 Port to higher-resolution time stamps. Do not assume time_t is signed.
2572 (decode_timer): New function. Timers are now vectors of length 9,
2573 not 8, to accommodate the picosecond component.
2574 (timer_check_2): Use it.
2575
2576 * nsterm.m (select_timeout, timeval_subtract): Remove.
2577 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
2578 as they're a bit more accurate and handle overflow better.
2579 (ns_select): Change prototype to be compatible with pselect.
2580 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
2581 * nsterm.h (ns_select): Adjust prototype.
2582
2583 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
2584 us-resolution time stamps.
2585 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
2586
2587 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
2588
2589 * lisp.h (time_overflow): New decl.
2590 (wait_reading_process_output): First arg is now intmax_t, not int,
2591 to accommodate larger waits.
2592
2593 * process.h (struct Lisp_Process.read_output_delay):
2594 Now counts nanoseconds, not microseconds.
2595 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
2596 EMACS_HAS_USECS.
2597 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
2598 (wait_reading_process_output):
2599 Port to ns-resolution time stamps.
2600 (Faccept_process_output, wait_reading_process_output):
2601 Check for time stamp overflow. Do not assume time_t is signed.
2602 (select_wrapper): Remove; we now use pselect.
2603 (Fprocess_attributes): Now generates ns-resolution time stamps.
2604
2605 * sysdep.c: Include utimens.h. Don't include utime.h
2606 or worry about struct utimbuf; gnulib does that for us now.
2607 (gettimeofday): Remove; gnulib provides a substitute.
2608 (make_timeval): New function.
2609 (set_file_times): Now sets ns-resolution time stamps.
2610 New arg FD; all uses changed.
2611 (time_from_jiffies, ltime_from_jiffies, get_up_time)
2612 (system_process_attributes):
2613 Now returns ns-resolution time stamp. All uses changed.
2614 Check for time stamp overflow.
2615
2616 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
2617 provides a substitute now.
2618
2619 * systime.h: Include timespec.h rather than sys/time.h and time.h,
2620 since it guarantees struct timespec.
2621 (EMACS_TIME): Now struct timespec, so that we can support
2622 ns-resolution time stamps.
2623 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
2624 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
2625 (EMACS_USECS): Remove.
2626 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
2627 so multiply the arg by 1000 before storing it.
2628 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
2629 New macros.
2630 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
2631 Port to ns-resolution time stamps.
2632 (EMACS_TIME_NEG_P): Remove; replaced by....
2633 (EMACS_TIME_SIGN): New macro.
2634 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
2635 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
2636 (set_file_times, make_time, lisp_time_argument): Adjust signature.
2637 (make_timeval, make_lisp_time, decode_time_components): New decls.
2638 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
2639 that it mishandled time_t overflow. You can't compare by subtracting!
2640 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
2641 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
2642
2643 * term.c: Include <sys/time.h>.
2644 (timeval_to_Time): New function, for proper overflow wraparound.
2645 (term_mouse_position, term_mouse_click): Use it.
2646
2647 * undo.c (record_first_change): Support higher-resolution time stamps
2648 in the undo buffer.
2649 (Fprimitive_undo): Use them when restoring time stamps.
2650
2651 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
2652 (w32_get_internal_run_time):
2653 Port to higher-resolution Emacs time stamps.
2654 (ltime): Now accepts single 64-bit integer, as that's more convenient
2655 for callers.
2656
2657 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
2658
2659 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
2660 for compatibility with pselect. Support ns-resolution time stamps.
2661
2662 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
2663
2664 * xselect.c (wait_for_property_change, x_get_foreign_selection):
2665 Check for time stamp overflow, and support ns-resolution time stamps.
2666
2667 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
2668 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
2669 (timeval_subtract): Remove; no longer needed.
2670 (XTflash, XTring_bell, x_wait_for_event):
2671 Port to ns-resolution time stamps. Don't assume time_t is signed.
2672
2673 2012-06-22 Chong Yidong <cyd@gnu.org>
2674
2675 * xdisp.c (x_consider_frame_title): Revert last change.
2676
2677 2012-06-22 Eli Zaretskii <eliz@gnu.org>
2678
2679 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
2680 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
2681 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
2682 staticidx goes up to 1597 out of 1600 = 0x640.)
2683
2684 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
2685
2686 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
2687 Otherwise, the umask might be mistakenly 0 while handling input signals.
2688
2689 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
2690
2691 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
2692
2693 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
2694
2695 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
2696 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
2697 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
2698 access to `contents' member of Lisp_Vector objects with AREF and ASET
2699 where appropriate.
2700
2701 2012-06-19 Chong Yidong <cyd@gnu.org>
2702
2703 * frame.c (delete_frame): When selecting a frame on a different
2704 text terminal, do not alter the terminal's top-frame.
2705
2706 * xdisp.c (format_mode_line_unwind_data): Record the target
2707 frame's selected window and its terminal's top-frame.
2708 (unwind_format_mode_line): Restore them.
2709 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
2710 Callers changed.
2711 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
2712 since tty frames can be explicitly named.
2713 (prepare_menu_bars): Likewise.
2714
2715 * term.c (Ftty_top_frame): New function.
2716
2717 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
2718
2719 Port byte-code-meter to modern targets.
2720 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
2721 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
2722 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
2723 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
2724 (METER_1, METER_2): Simplify.
2725
2726 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
2727
2728 * data.c (Fdefalias): Return `symbol' (bug#11686).
2729
2730 2012-06-18 Martin Rudalics <rudalics@gmx.at>
2731
2732 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
2733 gets killed during executing of this function (Bug#11665).
2734 Try to always return Qt when the buffer has been actually killed.
2735 (Vkill_buffer_query_functions): In doc-string say that functions
2736 run by this hook should not change the current buffer.
2737
2738 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
2739
2740 Fix recently-introduced process.c problems found by static checking.
2741 * process.c (write_queue_push, write_queue_pop, send_process):
2742 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
2743 (write_queue_pop): Fix pointer signedness problem.
2744 (send_process): Remove unused local.
2745
2746 2012-06-17 Chong Yidong <cyd@gnu.org>
2747
2748 * xdisp.c (redisplay_internal): No need to redisplay terminal
2749 frames that are not on top.
2750
2751 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
2752
2753 * process.c (make_process): Initialize write_queue.
2754 (write_queue_push, write_queue_pop): New functions.
2755 (send_process): Use them to maintain correct ordering of process
2756 writes (Bug#10815).
2757
2758 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
2759
2760 * lisp.h (eassert): Assume C89 or later.
2761 This removes the need for CHECK.
2762 (CHECK): Remove. Its comments about always evaluating its
2763 argument were confusing, as 'eassert' typically does not evaluate
2764 its argument.
2765
2766 * coding.c (produce_chars): Use ptrdiff_t, not int.
2767
2768 * xterm.c (x_draw_underwave): Check for integer overflow.
2769 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
2770
2771 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
2772
2773 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
2774 referenced (Bug#11583).
2775
2776 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
2777
2778 Implement wave-style variant of underlining.
2779 * dispextern.h (face_underline_type): New enum.
2780 (face): Add field for underline type.
2781 * nsterm.m (ns_draw_underwave): New function.
2782 (ns_draw_text_decoration): Use it.
2783 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
2784 New functions.
2785 (x_draw_glyph_string): Use them.
2786 * xfaces.c (Qline, Qwave): New Lisp objects.
2787 (check_lface_attrs, merge_face_ref)
2788 (Finternal_set_lisp_face_attribute, realize_x_face):
2789 Handle wave-style underline face attributes.
2790 * xterm.c (x_draw_underwave): New function.
2791 (x_draw_glyph_string): Use it.
2792
2793 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
2794
2795 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
2796 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
2797 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
2798 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
2799 ($(BLD)/w32select.$(O)): Update dependencies.
2800
2801 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
2802
2803 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
2804 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
2805 * character.c (_fetch_multibyte_char_p): Remove.
2806 * alloc.c: Include "character.h" before "buffer.h".
2807 * bidi.c: Likewise.
2808 * buffer.c: Likewise.
2809 * bytecode.c: Likewise.
2810 * callint.c: Likewise.
2811 * callproc.c: Likewise.
2812 * casefiddle.c: Likewise.
2813 * casetab.c: Likewise.
2814 * category.c: Likewise.
2815 * cmds.c: Likewise.
2816 * coding.c: Likewise.
2817 * composite.c: Likewise.
2818 * dired.c: Likewise.
2819 * dispnew.c: Likewise.
2820 * doc.c: Likewise.
2821 * dosfns.c: Likewise.
2822 * editfns.c: Likewise.
2823 * emacs.c: Likewise.
2824 * fileio.c: Likewise.
2825 * filelock.c: Likewise.
2826 * font.c: Likewise.
2827 * fontset.c: Likewise.
2828 * fringe.c: Likewise.
2829 * indent.c: Likewise.
2830 * insdel.c: Likewise.
2831 * intervals.c: Likewise.
2832 * keyboard.c: Likewise.
2833 * keymap.c: Likewise.
2834 * lread.c: Likewise.
2835 * macros.c: Likewise.
2836 * marker.c: Likewise.
2837 * minibuf.c: Likewise.
2838 * nsfns.m: Likewise.
2839 * nsmenu.m: Likewise.
2840 * print.c: Likewise.
2841 * process.c: Likewise.
2842 * regex.c: Likewise.
2843 * region-cache.c: Likewise.
2844 * search.c: Likewise.
2845 * syntax.c: Likewise.
2846 * term.c: Likewise.
2847 * textprop.c: Likewise.
2848 * undo.c: Likewise.
2849 * unexsol.c: Likewise.
2850 * w16select.c: Likewise.
2851 * w32fns.c: Likewise.
2852 * w32menu.c: Likewise.
2853 * window.c: Likewise.
2854 * xdisp.c: Likewise.
2855 * xfns.c: Likewise.
2856 * xmenu.c: Likewise.
2857 * xml.c: Likewise.
2858 * xselect.c: Likewise.
2859
2860 2012-06-16 Eli Zaretskii <eliz@gnu.org>
2861
2862 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
2863 If all the glyphs of the glyph row came from strings, and we have no
2864 cursor positioning clues, put the cursor on the first glyph of the
2865 row.
2866 (handle_face_prop): Use chunk-relative overlay string index when
2867 indexing into it->string_overlays array. (Bug#11653)
2868 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
2869 the rightmost. (Bug#11720)
2870
2871 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
2872
2873 * category.h (CHAR_HAS_CATEGORY): Define as inline.
2874 (CATEGORY_MEMBER): Enforce 1/0 value.
2875 * category.c (_temp_category_set): Remove.
2876
2877 2012-06-16 Eli Zaretskii <eliz@gnu.org>
2878
2879 * window.c (Fdelete_other_windows_internal)
2880 (Fdelete_window_internal): Don't access frame's mouse highlight
2881 info of the initial frame. (Bug#11677)
2882
2883 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
2884
2885 * .gdbinit (xgetint): Fix recently-introduced paren typo.
2886 Assume USE_2_TAGS_FOR_INTS.
2887 (xreload): Adjust $tagmask width to match recent lisp.h change.
2888
2889 Simplify lisp.h in minor ways that should not affect code.
2890 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
2891 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
2892 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
2893 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
2894 (INTTYPEBITS): New macro, for clarity.
2895 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
2896 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
2897 Simplify now that USE_LSB_TAG is always defined.
2898 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
2899 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
2900
2901 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
2902
2903 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
2904
2905 2012-06-13 Glenn Morris <rgm@gnu.org>
2906
2907 * s/bsd-common.h (BSD4_3):
2908 * s/usg5-4-common.h (USG5_4): No longer define; unused.
2909
2910 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
2911
2912 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
2913 instead of union.
2914 (XLI, XIL): Define.
2915 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
2916 Use them.
2917 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
2918 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
2919 * alloc.c (widen_to_Lisp_Object): Remove.
2920 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
2921 * frame.c (delete_frame): Remove outdated comment.
2922 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
2923 USE_LISP_UNION_TYPE.
2924 (Fw32_unregister_hot_key): Likewise.
2925 (Fw32_toggle_lock_key): Likewise.
2926 * w32menu.c (add_menu_item): Likewise.
2927 (w32_menu_display_help): Use XIL instead of checking
2928 USE_LISP_UNION_TYPE.
2929 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
2930 (init_heap): Likewise.
2931 * w32term.c (w32_read_socket): Update comment.
2932
2933 2012-06-13 Glenn Morris <rgm@gnu.org>
2934
2935 * s/usg5-4-common.h, src/s/unixware.h:
2936 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
2937
2938 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
2939
2940 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
2941
2942 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
2943 * alloc.c (make_number) [!defined make_number]:
2944 Remove, as lisp.h always defines this now.
2945 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
2946 (roundup_size): Verify that it is a power of 2.
2947 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
2948 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
2949 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
2950 -DUSE_LSB_TAG=0, to override the automatically-selected default.
2951 USE_LSB_TAG now is always defined to be either 0 or 1.
2952 All uses changed.
2953 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
2954 code works fine either way, and efficiency is not a concern here,
2955 as the union type is for debugging, not for production.
2956 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
2957 Use an inline function on all platforms when using the union type,
2958 since this is simpler and 'static inline' can be used portably
2959 within Emacs now.
2960 (LISP_INITIALLY_ZERO): New macro.
2961 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
2962 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
2963
2964 2012-06-12 Glenn Morris <rgm@gnu.org>
2965
2966 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
2967
2968 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
2969
2970 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
2971 Move BROKEN_SIGIO to configure.
2972
2973 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
2974 Move NO_TERMIO to configure.
2975
2976 2012-06-12 Chong Yidong <cyd@gnu.org>
2977
2978 * image.c (imagemagick_load_image): Use MagickFlattenImage if
2979 MagickMergeImageLayers is undefined. Use pixel pusher loop if
2980 MagickExportImagePixels is undefined.
2981
2982 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
2983
2984 * image.c (imagemagick_load_image): Remove unused label.
2985
2986 2012-06-11 Glenn Morris <rgm@gnu.org>
2987
2988 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
2989 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
2990 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
2991 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
2992
2993 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
2994
2995 * alloc.c (make_byte_code): New function.
2996 (Fmake_byte_code): Use it. Don't purify here.
2997 * lread.c (read1): Use it as well to avoid extra allocation.
2998
2999 2012-06-11 Chong Yidong <cyd@gnu.org>
3000
3001 * image.c (imagemagick_load_image): Implement transparency.
3002
3003 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
3004
3005 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
3006 account for preceding backslashes. (Bug#11663)
3007
3008 2012-06-09 Chong Yidong <cyd@gnu.org>
3009
3010 * term.c: Support italics in capable terminals (Bug#9652).
3011 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
3012 (turn_on_face): Output using TS_enter_italic_mode if available.
3013 Don't handle unused blinking and alt-charset cases.
3014 (turn_off_face): Handle italic case; discard unused tty_blinking_p
3015 and tty_alt_charset_p cases.
3016 (tty_capable_p, init_tty): Support italics.
3017
3018 * termchar.h (struct tty_display_info): Add field for italics.
3019 Remove unused blink field.
3020
3021 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
3022 Handle slant.
3023
3024 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
3025 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
3026 tty_alt_charset_p. Add tty_italic_p.
3027
3028 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
3029
3030 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
3031 dbus_type_is_basic if available.
3032 (xd_extract_signed, xd_extract_unsigned): Rename from
3033 extract_signed and extract_unsigned, respectively. Adapt callers.
3034
3035 2012-06-09 Chong Yidong <cyd@gnu.org>
3036
3037 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
3038
3039 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
3040 case (Bug#9752).
3041
3042 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
3043
3044 * xdisp.c (vmessage): Treat frame message as multibyte.
3045 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
3046 would generate the diagnostic "Making \302\247 buffer-local while
3047 let-bound!".
3048
3049 2012-06-08 Eli Zaretskii <eliz@gnu.org>
3050
3051 * dispnew.c (showing_window_margins_p): Undo last change, which
3052 was done due to an inadvertent commit.
3053 (adjust_frame_glyphs_for_frame_redisplay): Do call
3054 showing_window_margins_p.
3055
3056 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
3057
3058 * eval.c (Fmake_var_non_special): New primitive.
3059 (syms_of_eval): Defsubr it.
3060 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
3061
3062 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
3063
3064 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
3065 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
3066
3067 2012-06-08 Eli Zaretskii <eliz@gnu.org>
3068
3069 * alloc.c (allocate_vectorlike): Fix last change.
3070
3071 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
3072
3073 Block-based vector allocation of small vectors.
3074 * lisp.h (struct vectorlike_header): New field `nbytes',
3075 adjust comment accordingly.
3076 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
3077 to denote vector blocks. Adjust users (live_vector_p,
3078 mark_maybe_pointer, valid_lisp_object_p) accordingly.
3079 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
3080 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
3081 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
3082 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
3083 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
3084 (roundup_size): New constant.
3085 (struct vector_block): New data type.
3086 (vector_blocks, vector_free_lists, zero_vector): New variables.
3087 (all_vectors): Rename to `large_vectors'.
3088 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
3089 (sweep_vectors): New functions.
3090 (allocate_vectorlike): Return `zero_vector' as the only vector of
3091 0 items. Allocate new vector from block if vector size is less than
3092 or equal to VBLOCK_BYTES_MAX.
3093 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
3094 (init_alloc_once): Add call to init_vectors.
3095
3096 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
3097
3098 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
3099
3100 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
3101
3102 * doprnt.c (doprnt): Truncate multibyte char correctly.
3103 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
3104 would mishandle a string argument "Xc" if X was a multibyte
3105 character of length 2: it would truncate after X's first byte
3106 rather than including all of X.
3107
3108 2012-06-06 Chong Yidong <cyd@gnu.org>
3109
3110 * buffer.c (word_wrap): Doc fix.
3111
3112 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
3113
3114 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
3115
3116 2012-06-03 Glenn Morris <rgm@gnu.org>
3117
3118 * xdisp.c (tool-bar-style): Doc fix.
3119
3120 2012-06-03 Ulrich Müller <ulm@gentoo.org>
3121
3122 * Makefile.in (PAXCTL): Define.
3123 (temacs$(EXEEXT)): Disable memory randomization for the temacs
3124 binary via PaX flags if the paxctl utility is available.
3125 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3126 Restore PaX flags to their default. (Bug#11398)
3127
3128 2012-06-03 Chong Yidong <cyd@gnu.org>
3129
3130 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
3131 buffer (Bug#11226).
3132
3133 2012-06-03 Chong Yidong <cyd@gnu.org>
3134
3135 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
3136 (note_mode_line_or_margin_highlight): If there is no help echo,
3137 use mode-line-default-help-echo. Handle the case where the mouse
3138 position is past the end of the mode line string.
3139
3140 * buffer.c (buffer_local_value_1): New function, split from
3141 Fbuffer_local_value; can return Qunbound.
3142 (Fbuffer_local_value): Use it.
3143 (Vmode_line_format): Docstring tweaks.
3144
3145 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
3146
3147 * sysdep.c (system_process_attributes): Improve comment.
3148
3149 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
3150
3151 * keyboard.c: Export real-this-command to Elisp.
3152 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
3153 and DEFVAR it. Update all users.
3154
3155 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
3156
3157 * minibuf.c (Fassoc_string): Remove duplicate declaration.
3158
3159 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
3160 Convert pctcpu and pctmem to Lisp float properly.
3161 Let the compiler fold better, as 100.0/0x8000 is exact.
3162
3163 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
3164
3165 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
3166 cons_block.
3167
3168 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
3169
3170 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
3171
3172 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
3173
3174 For a 'struct window', replace some Lisp_Object fields to
3175 bitfields where appropriate, remove unused fields.
3176 * window.h (struct window): Remove unused 'last_mark_x' and
3177 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
3178 change it's type from Lisp_Object to bitfield.
3179 Change type of 'force_start', 'optional_new_start',
3180 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
3181 fields from Lisp_Object to bitfield. Adjust users accordingly.
3182
3183 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
3184
3185 Pacify gcc -Wdouble-precision when using Xaw.
3186 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
3187 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
3188 Use 'float' consistently, rather than 'float' in most places
3189 and 'double' in a couple of places.
3190
3191 2012-05-31 Eli Zaretskii <eliz@gnu.org>
3192
3193 * xdisp.c (handle_stop): Detect whether we have overlay strings
3194 loaded by testing it->current.overlay_string_index to be
3195 non-negative, instead of checking whether n_overlay_strings is
3196 positive. (Bug#11587)
3197
3198 2012-05-31 Chong Yidong <cyd@gnu.org>
3199
3200 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
3201
3202 * doc.c (Fsubstitute_command_keys): Doc fix.
3203
3204 2012-05-31 Eli Zaretskii <eliz@gnu.org>
3205
3206 * search.c (search_buffer): Remove calls to
3207 r_alloc_inhibit_buffer_relocation, as it is now called by
3208 maybe_unify_char, which was the cause of relocation of buffer text
3209 in bug#11519.
3210
3211 2012-05-31 Eli Zaretskii <eliz@gnu.org>
3212
3213 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
3214 for the duration of call to load_charset, to avoid problems with
3215 callers of maybe_unify_char that access buffer text through C
3216 pointers.
3217
3218 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
3219 decrement the inhibition flag, instead of just setting or
3220 resetting it.
3221
3222 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
3223
3224 Remove obsolete '#define static' cruft.
3225 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
3226 This #undef was "temporary" in 2000; it is no longer needed
3227 now that '#define static' has gone away.
3228 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
3229 (gray_bitmap_bits): Remove; no longer needed.
3230 All uses replaced with definiens.
3231 * xterm.c: Include "bitmaps/gray.xbm".
3232
3233 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
3234
3235 Clean up __executable_start, monstartup when --enable-profiling.
3236 The following changes affect the code only when profiling.
3237 * dispnew.c (__executable_start): Rename from safe_bcopy.
3238 Define only on platforms that need it.
3239 * emacs.c: Include <sys/gmon.h> when profiling.
3240 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
3241 (__executable_start): Remove decl, since lisp.h does it now.
3242 (safe_bcopy): Remove decl; no longer has that name.
3243 (main): Coalesce #if into single bit of code, for simplicity.
3244 Cast pointers to uintptr_t, since standard libraries want integers
3245 and not pointers.
3246 * lisp.h (__executable_start): New decl.
3247
3248 2012-05-31 Glenn Morris <rgm@gnu.org>
3249
3250 * image.c (Fimagemagick_types): Doc fix.
3251
3252 2012-05-30 Jim Meyering <meyering@redhat.com>
3253
3254 * callproc.c (Fcall_process_region): Include directory component
3255 in mkstemp error message (Bug#11586).
3256
3257 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
3258
3259 * alloc.c, lisp.h (make_pure_vector): Now static.
3260
3261 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
3262
3263 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
3264 Move to byte-run.el.
3265 (Fautoload): Do the hash-doc more carefully.
3266 * data.c (Fdefalias): Purify definition, except for keymaps.
3267 (Qdefun): Move from eval.c.
3268 * lisp.h (Qdefun): Remove.
3269 * lread.c (read1): Tiny simplification.
3270
3271 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
3272
3273 Do not create empty overlays with the evaporate property (Bug#9642).
3274 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
3275 Bug#9642, but explicitly check that the buffer the overlay would
3276 be moved to is live and rearrange lines to make sure that errors
3277 will not put the overlay in an inconsistent state.
3278 (Fdelete_overlay): Cosmetics.
3279
3280 2012-05-28 Eli Zaretskii <eliz@gnu.org>
3281
3282 * w32term.c (my_bring_window_to_top): New function.
3283 (x_raise_frame): Use handle returned by DeferWindowPos, which
3284 could be different from the original one.
3285 Call my_bring_window_to_top instead of my_set_foreground_window.
3286 (Bug#11513)
3287
3288 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
3289 by calling BringWindowToTop.
3290
3291 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
3292 (WM_EMACS_END): Increase by one.
3293
3294 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
3295
3296 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
3297 This avoids undefined behavior that might cause the eassert
3298 to not catch an out-of-range value.
3299
3300 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
3301
3302 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
3303 Update dependencies.
3304
3305 2012-05-27 Eli Zaretskii <eliz@gnu.org>
3306
3307 * bidi.c (bidi_mirror_char): Fix last change.
3308
3309 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
3310
3311 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
3312 when referring to sectname field in printf format.
3313
3314 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
3315
3316 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
3317 Only r_alloc_inhibit_buffer_relocation needed to be added;
3318 the others were already declared.
3319
3320 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
3321 before checking whether it's out of range. Put the check inside
3322 eassert. See
3323 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
3324
3325 2012-05-27 Ken Brown <kbrown@cornell.edu>
3326
3327 * callproc.c (Fcall_process): Restore a line that was accidentally
3328 commented out in the 2011-02-13 change (bug#11547).
3329
3330 2012-05-27 Eli Zaretskii <eliz@gnu.org>
3331
3332 * lisp.h [REL_ALLOC]: Add prototypes for external functions
3333 defined on ralloc.c.
3334
3335 * buffer.c [REL_ALLOC]: Remove prototypes of
3336 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
3337 they are now on lisp.h.
3338
3339 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
3340
3341 * search.c (search_buffer): Use it to inhibit relocation of buffer
3342 text while re_search_2 is doing its job, because re_search_2 is
3343 passed C pointers to buffer text. (Bug#11519)
3344
3345 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
3346 Update value to 24.
3347
3348 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
3349 state after an additional call to move_it_in_display_line_to, keep
3350 the values of it->max_ascent and it->max_descent found for the
3351 entire line.
3352 (pos_visible_p): Revert the comparison against bottom_y to what it
3353 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
3354 (Bug#11464)
3355
3356 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
3357
3358 Fix coding-related core dumps with gcc -ftrapv.
3359 The code was computing A - B, where A and B are pointers, and B is
3360 random garbage. This can lead to core dumps on platforms that
3361 have special pointer registers, and it also leads to core dumps on
3362 x86-64 when compiled with gcc -ftrapv. The fix is to compute
3363 A - B only when B is initialized properly.
3364 * coding.c (coding_set_source, coding_set_destination): Return void.
3365 (coding_change_source, coding_change_destinations): New functions,
3366 with the old behaviors of coding_set_source and coding_set_destination.
3367 All callers that need an offset changed to use these new functions.
3368
3369 2012-05-26 Glenn Morris <rgm@gnu.org>
3370
3371 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
3372
3373 2012-05-26 Eli Zaretskii <eliz@gnu.org>
3374
3375 Extend mouse support on W32 text-mode console.
3376 * xdisp.c (draw_row_with_mouse_face):
3377 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
3378
3379 * w32console.c: Include window.h.
3380 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
3381 New functions.
3382 (initialize_w32_display): Initialize mouse-highlight data.
3383
3384 * w32inevt.c: Include termchar.h and window.h.
3385 (do_mouse_event): Support mouse-autoselect-window. When the mouse
3386 moves, call note_mouse_highlight. If help_echo changed, call
3387 gen_help_event to produce help-echo message in the echo area.
3388 Call clear_mouse_face if mouse_face_hidden is set in the mouse
3389 highlight info.
3390
3391 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
3392
3393 * lread.c (read1): Simplify slightly to avoid an overflow warning
3394 with GCC 4.7.0 on x86-64.
3395
3396 2012-05-26 Eli Zaretskii <eliz@gnu.org>
3397
3398 * bidi.c (bidi_mirror_char): Revert last change: an int is
3399 definitely wide enough here.
3400
3401 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3402
3403 Fix integer width and related bugs (Bug#9874).
3404 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
3405 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
3406 (string_bytes, check_sblock, allocate_string_data):
3407 (compact_small_strings, Fmake_bool_vector, make_string)
3408 (make_unibyte_string, make_multibyte_string)
3409 (make_string_from_bytes, make_specified_string)
3410 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
3411 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
3412 (mark_vectorlike):
3413 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3414 (allocate_pseudovector):
3415 Use int, not EMACS_INT, where int is wide enough.
3416 (inhibit_garbage_collection, Fgarbage_collect):
3417 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3418 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
3419 int might not be wide enough.
3420 (bidi_cache_search, bidi_cache_find, bidi_init_it)
3421 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
3422 (bidi_at_paragraph_end, bidi_find_paragraph_start)
3423 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
3424 (bidi_level_of_next_char, bidi_move_to_visually_next):
3425 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3426 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
3427 (Fkill_buffer, Fset_buffer_major_mode)
3428 (advance_to_char_boundary, Fbuffer_swap_text)
3429 (Fset_buffer_multibyte, overlays_at, overlays_in)
3430 (overlay_touches_p, struct sortvec, record_overlay_string)
3431 (overlay_strings, recenter_overlay_lists)
3432 (adjust_overlays_for_insert, adjust_overlays_for_delete)
3433 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
3434 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
3435 (Foverlay_recenter, last_overlay_modification_hooks_used)
3436 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
3437 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3438 (validate_region): Omit unnecessary test for b <= e,
3439 since that's guaranteed by the previous test.
3440 (adjust_overlays_for_delete): Avoid pos + length overflow.
3441 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
3442 (report_overlay_modification):
3443 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3444 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
3445 Omit pointer cast, which isn't needed anyway, and doesn't work
3446 after the EMACS_INT -> ptrdiff_t change.
3447 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
3448 * buffer.h: Adjust decls to match defn changes elsewhere.
3449 (struct buffer_text, struct buffer):
3450 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3451 Use EMACS_INT, not int, where int might not be wide enough.
3452 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
3453 not int, to avoid needless 32-bit limit on 64-bit hosts.
3454 (exec_byte_code): Use tighter memory-full test, one that checks
3455 for alloca overflow. Don't compute the address of the object just
3456 before an array, as that's not portable. Use EMACS_INT, not
3457 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
3458 * callint.c (Fcall_interactively):
3459 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3460 * callproc.c (call_process_kill, Fcall_process):
3461 Don't assume pid_t fits into an Emacs fixnum.
3462 (call_process_cleanup, Fcall_process, child_setup):
3463 Don't assume pid_t fits into int.
3464 (call_process_cleanup, Fcall_process, delete_temp_file)
3465 (Fcall_process_region):
3466 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3467 (Fcall_process): Simplify handling of volatile integers.
3468 Use int, not EMACS_INT, where int will do.
3469 * casefiddle.c (casify_object, casify_region, operate_on_word)
3470 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
3471 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3472 (casify_object): Avoid integer overflow when overallocating buffer.
3473 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
3474 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
3475 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
3476 * category.h (CATEGORYP): Don't assume arg is nonnegative.
3477 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
3478 integers are now checked earlier. All uses replaced with XINT.
3479 (ccl_driver):
3480 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3481 For CCL_MapSingle, check that content and value are in int range.
3482 (ccl_driver, Fregister_code_conversion_map):
3483 Check that Vcode_version_map_vector is a vector.
3484 (resolve_symbol_ccl_program): Check that vector header is in range.
3485 Always copy the vector, so that we can check its contents reliably
3486 now rather than having to recheck each instruction as it's being
3487 executed. Check that vector words fit in 'int'.
3488 (ccl_get_compiled_code, Fregister_ccl_program)
3489 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
3490 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
3491 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
3492 contents are in range.
3493 (Fccl_execute_on_string): Check that status is in range.
3494 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
3495 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
3496 Accept and return EMACS_INT, not int, because callers can pass values
3497 out of 'int' range.
3498 (c_string_width, strwidth, lisp_string_width, chars_in_text)
3499 (multibyte_chars_in_text, parse_str_as_multibyte)
3500 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
3501 (str_as_unibyte, str_to_unibyte, string_count_byte8)
3502 (string_escape_byte8, Fget_byte):
3503 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3504 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
3505 avoid mishandling large integers.
3506 * character.h: Adjust decls to match defn changes elsewhere.
3507 * charset.c (load_charset_map_from_file, find_charsets_in_text)
3508 (Ffind_charset_region):
3509 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3510 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
3511 (load_charset_map_from_vector, Fdefine_charset_internal):
3512 Don't assume fixnum fits in int.
3513 (load_charset_map_from_vector, Fmap_charset_chars):
3514 Remove now-unnecessary CHECK_NATNUMs.
3515 (Fdefine_charset_internal): Check ranges here, more carefully.
3516 Don't rely on undefined behavior with signed left shift overflow.
3517 Don't assume unsigned int fits into fixnum, or that fixnum fits
3518 into unsigned int. Don't require max_code to be a valid fixnum;
3519 that's not true for gb10830 4-byte on a 32-bit host. Allow
3520 invalid_code to be a cons, for the same reason. Require code_offset
3521 to be a character. Avoid int overflow if max_char is close
3522 to INT_MAX.
3523 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
3524 this is intended anyway and avoids some undefined behavior.
3525 (load_charset_map): Pass unsigned, not int, as 2nd arg of
3526 INDEX_TO_CODE_POINT, as that's what it expects.
3527 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
3528 * charset.h (DECODE_CHAR): Return int, not unsigned;
3529 this is what was intended anyway, and it avoids undefined behavior.
3530 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
3531 integer-overflow issues.
3532 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
3533 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
3534 where the argument is EMACS_INT, and this behavior is not intended.
3535 * chartab.c (Fmake_char_table, Fset_char_table_range)
3536 (uniprop_get_decoder, uniprop_get_encoder):
3537 Don't assume fixnum fits in int.
3538 * cmds.c (move_point): New function, that does the gist of
3539 Fforward_char and Fbackward_char, but does so while checking
3540 for integer overflow more accurately.
3541 (Fforward_char, Fbackward_char): Use it.
3542 (Fforward_line, Fend_of_line, internal_self_insert)
3543 (internal_self_insert):
3544 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3545 Fix a FIXME, by checking for integer overflow when calculating
3546 target_clm and actual_clm.
3547 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
3548 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
3549 (ASSURE_DESTINATION, coding_alloc_by_realloc)
3550 (coding_alloc_by_making_gap, alloc_destination)
3551 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
3552 (encode_coding_utf_16, detect_coding_emacs_mule)
3553 (decode_coding_emacs_mule, encode_coding_emacs_mule)
3554 (detect_coding_iso_2022, decode_coding_iso_2022)
3555 (encode_invocation_designation, encode_designation_at_bol)
3556 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
3557 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
3558 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
3559 (encode_coding_ccl, encode_coding_raw_text)
3560 (detect_coding_charset, decode_coding_charset)
3561 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
3562 (produce_composition, produce_charset, produce_annotation)
3563 (decode_coding, handle_composition_annotation)
3564 (handle_charset_annotation, consume_chars, decode_coding_gap)
3565 (decode_coding_object, encode_coding_object, detect_coding_system)
3566 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
3567 (code_convert_region, code_convert_string)
3568 (Fdefine_coding_system_internal)
3569 (coding_set_source, coding_set_destination):
3570 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3571 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
3572 (Fdefine_coding_system_internal):
3573 Don't assume fixnums fit in int.
3574 (decode_coding_gap, decode_coding_object, encode_coding_object)
3575 (Fread_coding_system, Fdetect_coding_region)
3576 (Funencodable_char_position, Fcheck_coding_systems_region)
3577 (get_translation, handle_composition_annotation, consume_chars):
3578 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3579 (consume_chars): Rewrite to not calculate an address outside buffer.
3580 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
3581 Don't access memory outside of the args array.
3582 (Fdefine_coding_system_internal): Check for charset-id overflow.
3583 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
3584 result of ENCODE_CHAR.
3585 * coding.h: Adjust decls to match defn changes elsewhere.
3586 (struct coding_system):
3587 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3588 * composite.c (get_composition_id, find_composition)
3589 (run_composition_function, update_compositions)
3590 (compose_text, composition_gstring_put_cache)
3591 (composition_gstring_p, composition_gstring_width)
3592 (fill_gstring_header, fill_gstring_body, autocmp_chars)
3593 (composition_compute_stop_pos, composition_reseat_it)
3594 (composition_update_it, struct position_record)
3595 (find_automatic_composition, composition_adjust_point)
3596 (Fcomposition_get_gstring, Ffind_composition_internal):
3597 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3598 (update_compositions):
3599 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3600 * composite.h: Adjust decls to match defn changes elsewhere.
3601 (struct composition):
3602 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3603 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
3604 Do not attempt to compute the address of the object just before a
3605 buffer; this is not portable.
3606 (Faref, Faset):
3607 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3608 (Faset): Use int, not EMACS_INT, where int is wide enough.
3609 (Fstring_to_number): Don't assume fixnums fit in int.
3610 (Frem): Don't assume arg is nonnegative.
3611 * dbusbind.c (xd_append_arg): Check for integers out of range.
3612 (Fdbus_call_method): Don't overflow the timeout int.
3613 (extract_signed, extract_unsigned): New functions.
3614 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
3615 (xd_get_connection_references): Return ptrdiff_t, not int.
3616 All uses changed.
3617 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
3618 (xd_read_message_1):
3619 Use int, not unsigned, where the dbus API uses int.
3620 (Fdbus_message_internal): Don't overflow mtype.
3621 (syms_of_dbusbind): Allocate right-sized buffer for integers.
3622 * dired.c (directory_files_internal, file_name_completion, scmp)
3623 (file_name_completion_stat):
3624 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3625 (file_name_completion): Don't overflow matchcount.
3626 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
3627 * dispextern.h: Adjust decls to match defn changes elsewhere.
3628 (struct text_pos, struct glyph, struct bidi_saved_info)
3629 (struct bidi_string_data, struct bidi_it, struct composition_it)
3630 (struct it):
3631 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3632 (struct display_pos, struct composition_it, struct it):
3633 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3634 * dispnew.c (increment_matrix_positions)
3635 (increment_row_positions, mode_line_string)
3636 (marginal_area_string):
3637 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3638 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
3639 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3640 (duration_to_sec_usec): New function, to check for overflow better.
3641 (Fsleep_for, sit_for): Use it.
3642 * doc.c (get_doc_string, store_function_docstring):
3643 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3644 (get_doc_string, Fsnarf_documentation):
3645 Use int, not EMACS_INT, where int is wide enough.
3646 (get_doc_string):
3647 Use SAFE_ALLOCA, not alloca.
3648 Check for overflow when converting EMACS_INT to off_t.
3649 * doprnt.c (doprnt):
3650 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3651 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
3652 Don't assume uid_t fits into fixnum.
3653 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
3654 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
3655 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
3656 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
3657 (general_insert_function)
3658 (Finsert_char, make_buffer_string, make_buffer_string_both)
3659 (update_buffer_properties, Fbuffer_substring)
3660 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
3661 (Fsubst_char_in_region, check_translation)
3662 (Ftranslate_region_internal, save_restriction_restore, Fformat)
3663 (transpose_markers, Ftranspose_regions):
3664 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3665 (clip_to_bounds): Move to lisp.h as an inline function).
3666 (Fconstrain_to_field): Don't assume integers are nonnegative.
3667 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
3668 (Fsubst_char_in_region, Fsave_restriction):
3669 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3670 (Femacs_pid): Don't assume pid_t fits into fixnum.
3671 (lo_time): Use int, not EMACS_INT, when int suffices.
3672 (lisp_time_argument): Check for usec out of range.
3673 (Fencode_time): Don't assume fixnum fits in int.
3674 (Fuser_login_name, Fuser_full_name): Signal an error
3675 if a uid argument is out of range, rather than relying on
3676 undefined behavior.
3677 (Fformat_time_string): Remove now-unnecessary check.
3678 lisp_time_argument checks for out-of-range usec now.
3679 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
3680 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
3681 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
3682 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
3683 (init_cmdargs, Fdump_emacs):
3684 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3685 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
3686 the bottom (typically) 32 bits of the fixnum.
3687 * eval.c (specpdl_size, call_debugger):
3688 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3689 (when_entered_debugger, Fbacktrace_debug):
3690 Don't assume fixnum can fit in int.
3691 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
3692 the object just before a buffer; this is not portable.
3693 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
3694 (grow_specpdl, unbind_to):
3695 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3696 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
3697 (grow_specpdl): Simplify allocation by using xpalloc.
3698 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
3699 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
3700 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
3701 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3702 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
3703 (a_write, e_write):
3704 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3705 (Fcopy_file, non_regular_nbytes, read_non_regular)
3706 (Finsert_file_contents):
3707 Use int, not EMACS_INT, where int is wide enough.
3708 (READ_BUF_SIZE): Verify that it fits in int.
3709 (Finsert_file_contents): Check that counts are in proper range,
3710 rather than assuming fixnums fit into ptrdiff_t etc.
3711 Don't assume fixnums fit into int.
3712 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
3713 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
3714 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
3715 (string_char_to_byte, string_byte_to_char)
3716 (string_make_multibyte, string_to_multibyte)
3717 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
3718 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
3719 (substring_both, Fdelete, internal_equal, Ffillarray)
3720 (Fclear_string, mapcar1)
3721 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
3722 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
3723 (larger_vector, make_hash_table, maybe_resize_hash_table)
3724 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
3725 (Fmaphash, secure_hash):
3726 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3727 (concat): Check for string index and length overflow.
3728 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
3729 (Frequire):
3730 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3731 (larger_vector): New API (vec, incr_min, size_max) replaces old
3732 one (vec, new_size, init). This catches size overflow.
3733 INIT was removed because it was always Qnil.
3734 All callers changed.
3735 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
3736 the upper bound on a hash table index size.
3737 (make_hash_table, maybe_resize_hash_table): Use it.
3738 (secure_hash): Computer start_byte and end_byte only after
3739 they're known to be in ptrdiff_t range.
3740 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
3741 (Ffont_get_glyphs, Ffont_at):
3742 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3743 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
3744 (Flist_fonts, Fopen_font):
3745 Don't assume fixnum can fit in int.
3746 (check_gstring): Don't assume index can fit in int.
3747 (font_match_p): Check that fixnum is a character, not a nonnegative
3748 fixnum, since the later code needs to stuff it into an int.
3749 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
3750 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
3751 conversion overflow issues.
3752 (Fopen_font): Check for integer out of range.
3753 (Ffont_get_glyphs): Don't assume index can fit in int.
3754 * font.h: Adjust decls to match defn changes elsewhere.
3755 * fontset.c (reorder_font_vector): Redo score calculation to avoid
3756 integer overflow.
3757 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
3758 printmax_t, where ptrdiff_t is wide enough.
3759 (Finternal_char_font):
3760 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3761 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
3762 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
3763 (Fset_frame_position, x_set_frame_parameters)
3764 (x_set_line_spacing, x_set_border_width)
3765 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
3766 Check that fixnums are in proper range for system types.
3767 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
3768 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3769 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
3770 Use SAFE_ALLOCA_LISP, not alloca.
3771 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
3772 intptr_t is wide enough.
3773 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
3774 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
3775 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
3776 Check for fixnum out of range.
3777 * ftfont.c (ftfont_list): Don't assume index fits in int.
3778 Check that fixnums are in proper range for system types.
3779 (ftfont_shape_by_flt):
3780 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3781 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
3782 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3783 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
3784 Check that fixnums are in proper range for system types.
3785 * gnutls.h: Adjust decls to match defn changes elsewhere.
3786 * gtkutil.c (xg_dialog_run):
3787 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3788 (update_frame_tool_bar):
3789 Check that fixnums are in proper range for system types.
3790 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
3791 (lookup_image): Check that fixnums are in range for system types.
3792 * indent.c (last_known_column, last_known_column_point):
3793 (current_column_bol_cache):
3794 (skip_invisible, current_column, check_display_width):
3795 (check_display_width, scan_for_column, current_column_1)
3796 (Findent_to, Fcurrent_indentation, position_indentation)
3797 (indented_beyond_p, Fmove_to_column, compute_motion):
3798 (Fcompute_motion, Fvertical_motion):
3799 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3800 (last_known_column_modified): Use EMACS_INT, not int.
3801 (check_display_width):
3802 (Fcompute_motion):
3803 Check that fixnums and floats are in proper range for system types.
3804 (compute_motion): Don't assume index or fixnum fits in int.
3805 (compute_motion, Fcompute_motion):
3806 Use int, not EMACS_INT, when it is wide enough.
3807 (vmotion): Omit local var start_hpos that is always 0; that way
3808 we don't need to worry about overflow in expressions involving it.
3809 * indent.h: Adjust decls to match defn changes elsewhere.
3810 (struct position):
3811 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3812 Use int, not EMACS_INT, where int is wide enough.
3813 Remove unused members ovstring_chars_done and tab_offset;
3814 all uses removed.
3815 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
3816 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
3817 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
3818 (make_gap, copy_text, insert, insert_and_inherit)
3819 (insert_before_markers, insert_before_markers_and_inherit)
3820 (insert_1, count_combining_before, count_combining_after)
3821 (insert_1_both, insert_from_string)
3822 (insert_from_string_before_markers, insert_from_string_1)
3823 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
3824 (adjust_after_replace, adjust_after_insert, replace_range)
3825 (replace_range_2, del_range, del_range_1, del_range_byte)
3826 (del_range_both, del_range_2, modify_region)
3827 (prepare_to_modify_buffer, signal_before_change)
3828 (signal_after_change, Fcombine_after_change_execute):
3829 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3830 * intervals.c (traverse_intervals, rotate_right, rotate_left)
3831 (balance_an_interval, split_interval_right, split_interval_left)
3832 (find_interval, next_interval, update_interval)
3833 (adjust_intervals_for_insertion, delete_node, delete_interval)
3834 (interval_deletion_adjustment, adjust_intervals_for_deletion)
3835 (static_offset_intervals, offset_intervals)
3836 (merge_interval_right, merge_interval_left, make_new_interval)
3837 (graft_intervals_into_buffer, temp_set_point_both)
3838 (temp_set_point, set_point, adjust_for_invis_intang)
3839 (set_point_both, move_if_not_intangible, get_property_and_range)
3840 (get_local_map, copy_intervals, copy_intervals_to_string)
3841 (compare_string_intervals, set_intervals_multibyte_1):
3842 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3843 * intervals.h: Adjust decls to match defn changes elsewhere.
3844 (struct interval):
3845 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3846 * keyboard.c (this_command_key_count, this_single_command_key_start)
3847 (before_command_key_count, before_command_echo_length, echo_now)
3848 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
3849 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
3850 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
3851 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
3852 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3853 (last_non_minibuf_size, last_point_position, echo_truncate)
3854 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
3855 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
3856 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
3857 (stuff_buffered_input):
3858 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3859 (last_auto_save, command_loop_1, read_char):
3860 Use EMACS_INT, not int, to avoid integer overflow.
3861 (record_char): Avoid overflow in total_keys computation.
3862 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
3863 * keyboard.h: Adjust decls to match defn changes elsewhere.
3864 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
3865 (Fkey_description, Fdescribe_vector, Flookup_key):
3866 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3867 (click_position): New function, to check that positions are in range.
3868 (Fcurrent_active_maps):
3869 (describe_command):
3870 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3871 (Faccessible_keymaps, Fkey_description):
3872 (preferred_sequence_p):
3873 Don't assume fixnum can fit into int.
3874 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
3875 Check for integer overflow in size calculations.
3876 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
3877 avoid mishandling large integers.
3878 * lisp.h: Adjust decls to match defn changes elsewhere.
3879 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
3880 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
3881 (struct Lisp_Marker):
3882 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3883 (clip_to_bounds): Now an inline function, moved here from editfns.c.
3884 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
3885 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
3886 All callers changed.
3887 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
3888 Assume the arg has valid form, since it always does.
3889 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
3890 unsigned integer system type.
3891 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
3892 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
3893 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3894 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
3895 (duration_to_sec_usec): New decl.
3896 * lread.c (read_from_string_index, read_from_string_index_byte)
3897 (read_from_string_limit, readchar, unreadchar, openp)
3898 (read_internal_start, read1, oblookup):
3899 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3900 (Fload, readevalloop, Feval_buffer, Feval_region):
3901 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3902 (openp): Check for out-of-range argument to 'access'.
3903 (read1): Use int, not EMACS_INT, where int is wide enough.
3904 Don't assume fixnum fits into int.
3905 Fix off-by-one error that can read outside a buffer.
3906 (read_filtered_event): Use duration_to_sec_usec
3907 to do proper overflow checking on durations.
3908 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
3909 in size calculation.
3910 (Fexecute_kbd_macro):
3911 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3912 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
3913 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
3914 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
3915 (set_marker_both, set_marker_restricted_both, marker_position)
3916 (marker_byte_position, Fbuffer_has_markers_at):
3917 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3918 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
3919 * menu.c (ensure_menu_items): Rename from grow_menu_items.
3920 It now merely ensures that the menu is large enough, without
3921 necessarily growing it, as this avoids some integer overflow issues.
3922 All callers changed.
3923 (keymap_panes, parse_single_submenu, Fx_popup_menu):
3924 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3925 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
3926 Use SAFE_ALLOCA_LISP, not alloca.
3927 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
3928 to EMACS_INT. Check that fixnums are in proper range for system types.
3929 * minibuf.c (minibuf_prompt_width, string_to_object)
3930 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
3931 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
3932 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3933 (get_minibuffer, read_minibuf_unwind):
3934 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3935 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
3936 this simplifies overflow checking. All callers changed.
3937 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
3938 (Ftest_completion):
3939 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3940 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
3941 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
3942 Check that fixnums are in proper range for system types.
3943 (Fx_create_frame, Fx_show_tip):
3944 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3945 * nsfont.m (ns_findfonts, nsfont_list_family):
3946 Don't assume fixnum fits in long.
3947 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
3948 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3949 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
3950 wide enough.
3951 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
3952 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3953 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
3954 (PRINTDECLARE, PRINTPREPARE):
3955 (strout, print_string):
3956 (print, print_preprocess, print_check_string_charset_prop)
3957 (print_object):
3958 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3959 (PRINTDECLARE):
3960 (temp_output_buffer_setup, Fprin1_to_string, print_object):
3961 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3962 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
3963 (printchar, strout): Use xpalloc to catch size calculation overflow.
3964 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
3965 (print_error_message): Use SAFE_ALLOCA, not alloca.
3966 (print_object): Use int, not EMACS_INT, where int is wide enough.
3967 (print_depth, new_backquote_output, print_number_index):
3968 Use ptrdiff_t, not int, where int might not be wide enough.
3969 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
3970 (Fset_process_window_size, Fformat_network_address)
3971 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
3972 (sigchld_handler):
3973 Check that fixnums are in proper range for system types.
3974 (Fsignal_process): Simplify by avoiding a goto.
3975 Check for process-ids out of pid_t range rather than relying on
3976 undefined behavior.
3977 (process_tick, update_tick): Use EMACS_INT, not int.
3978 (Fformat_network_address, read_process_output, send_process)
3979 (Fprocess_send_region, status_notify):
3980 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3981 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
3982 (wait_reading_process_output, read_process_output, exec_sentinel):
3983 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3984 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
3985 (Faccept_process_output): Use duration_to_sec_usec to do proper
3986 overflow checking on durations.
3987 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
3988 Don't assume pid_t fits in int.
3989 * process.h (struct Lisp_Process): Members tick and update_tick
3990 are now of type EMACS_INT, not int.
3991 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
3992 configured --with-wide-int.
3993 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
3994 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
3995 * search.c (looking_at_1, string_match_1):
3996 (fast_string_match, fast_c_string_match_ignore_case)
3997 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
3998 (scan_newline, find_before_next_newline, search_command)
3999 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
4000 (set_search_regs, wordify):
4001 (Freplace_match):
4002 (Fmatch_data):
4003 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4004 (string_match_1, search_buffer, set_search_regs):
4005 (Fmatch_data):
4006 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4007 (wordify): Check for overflow in size calculation.
4008 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
4009 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
4010 Check that fixnums are in proper range for system types.
4011 * sound.c (struct sound_device)
4012 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
4013 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4014 (Fplay_sound_internal):
4015 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4016 * syntax.c (struct lisp_parse_state, find_start_modiff)
4017 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
4018 (Fparse_partial_sexp):
4019 Don't assume fixnums can fit in int.
4020 (struct lisp_parse_state, find_start_pos, find_start_value)
4021 (find_start_value_byte, find_start_begv)
4022 (update_syntax_table, char_quoted, dec_bytepos)
4023 (find_defun_start, prev_char_comend_first, back_comment):
4024 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
4025 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
4026 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4027 (Finternal_describe_syntax_value): Check that match_lisp is a
4028 character, not an integer, since the code stuffs it into int.
4029 (scan_words, scan_sexps_forward):
4030 Check that fixnums are in proper range for system types.
4031 (Fforward_word):
4032 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4033 (scan_sexps_forward):
4034 Use CHARACTERP, not INTEGERP, since the value must fit into int.
4035 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
4036 * syntax.h: Adjust decls to match defn changes elsewhere.
4037 (struct gl_state_s):
4038 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4039 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
4040 MOST_POSITIVE_FIXNUM.
4041 * sysdep.c (wait_for_termination_1, wait_for_termination)
4042 (interruptible_wait_for_termination, mkdir):
4043 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
4044 (emacs_read, emacs_write):
4045 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4046 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
4047 and double all fit in int.
4048 * term.c (set_tty_color_mode):
4049 Check that fixnums are in proper range for system types.
4050 * termhooks.h (struct input_event):
4051 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4052 * textprop.c (validate_interval_range, interval_of)
4053 (Fadd_text_properties, set_text_properties_1)
4054 (Fremove_text_properties, Fremove_list_of_text_properties)
4055 (Ftext_property_any, Ftext_property_not_all)
4056 (copy_text_properties, text_property_list, extend_property_ranges)
4057 (verify_interval_modification):
4058 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4059 (Fnext_single_char_property_change)
4060 (Fprevious_single_char_property_change):
4061 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4062 (copy_text_properties):
4063 Check for integer overflow in index calculation.
4064 * undo.c (last_boundary_position, record_point, record_insert)
4065 (record_delete, record_marker_adjustment, record_change)
4066 (record_property_change):
4067 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4068 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
4069 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4070 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
4071 (Fx_hide_tip, Fx_file_dialog):
4072 * w32menu.c (set_frame_menubar):
4073 Use ptrdiff_t, not int, for consistency with rest of code.
4074 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
4075 (select_window, Fdelete_other_windows_internal)
4076 (window_scroll_pixel_based, window_scroll_line_based)
4077 (Frecenter, Fset_window_configuration):
4078 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4079 (Fset_window_hscroll, run_window_configuration_change_hook)
4080 (set_window_buffer, temp_output_buffer_show, scroll_command)
4081 (Fscroll_other_window, Frecenter):
4082 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4083 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
4084 Don't assume fixnum fits in int.
4085 (Fset_window_scroll_bars):
4086 Check that fixnums are in proper range for system types.
4087 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
4088 (string_pos, c_string_pos, number_of_chars, init_iterator)
4089 (in_ellipses_for_invisible_text_p, init_from_display_pos)
4090 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
4091 (compute_display_string_end, handle_face_prop)
4092 (face_before_or_after_it_pos, handle_invisible_prop)
4093 (handle_display_prop, handle_display_spec, handle_single_display_spec)
4094 (display_prop_intangible_p, string_buffer_position_lim)
4095 (string_buffer_position, handle_composition_prop, load_overlay_strings)
4096 (get_overlay_strings_1, get_overlay_strings)
4097 (iterate_out_of_display_property, forward_to_next_line_start)
4098 (back_to_previous_visible_line_start, reseat, reseat_to_string)
4099 (get_next_display_element, set_iterator_to_next)
4100 (get_visually_first_element, compute_stop_pos_backwards)
4101 (handle_stop_backwards, next_element_from_buffer)
4102 (move_it_in_display_line_to, move_it_in_display_line)
4103 (move_it_to, move_it_vertically_backward, move_it_by_lines)
4104 (add_to_log, message_dolog, message_log_check_duplicate)
4105 (message2, message2_nolog, message3, message3_nolog
4106 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
4107 (current_message_1, truncate_echo_area, truncate_message_1)
4108 (set_message, set_message_1, store_mode_line_noprop)
4109 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
4110 (text_outside_line_unchanged_p, check_point_in_composition)
4111 (reconsider_clip_changes)
4112 (redisplay_internal, set_cursor_from_row, try_scrolling)
4113 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
4114 (redisplay_window, find_last_unchanged_at_beg_row)
4115 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
4116 (trailing_whitespace_p, find_row_edges, display_line)
4117 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
4118 (display_mode_element, store_mode_line_string)
4119 (pint2str, pint2hrstr, decode_mode_spec)
4120 (display_count_lines, display_string, draw_glyphs)
4121 (x_produce_glyphs, x_insert_glyphs)
4122 (rows_from_pos_range, mouse_face_from_buffer_pos)
4123 (fast_find_string_pos, mouse_face_from_string_pos)
4124 (note_mode_line_or_margin_highlight, note_mouse_highlight):
4125 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4126 (safe_call, init_from_display_pos, handle_fontified_prop)
4127 (handle_single_display_spec, load_overlay_strings)
4128 (with_echo_area_buffer, setup_echo_area_for_printing)
4129 (display_echo_area, echo_area_display)
4130 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
4131 (update_tool_bar, hscroll_window_tree, redisplay_internal)
4132 (redisplay_window, dump_glyph_row, display_mode_line)
4133 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
4134 (handle_display_spec, display_prop_string_p):
4135 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4136 (handle_single_display_spec, build_desired_tool_bar_string)
4137 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
4138 (get_specified_cursor_type):
4139 Check that fixnums are in proper range for system types.
4140 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
4141 (Flookup_image_map):
4142 Don't assume fixnums fit in int.
4143 (compare_overlay_entries):
4144 Avoid mishandling comparisons due to subtraction overflow.
4145 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
4146 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
4147 (handle_tool_bar_click):
4148 Use int, not unsigned, since we prefer signed and the signedness
4149 doesn't matter here.
4150 (get_next_display_element, next_element_from_display_vector):
4151 Use int, not EMACS_INT, when int is wide enough.
4152 (start_hourglass): Use duration_to_sec_usec to do proper
4153 overflow checking on durations.
4154 * xfaces.c (Fbitmap_spec_p):
4155 Check that fixnums are in proper range for system types.
4156 (compare_fonts_by_sort_order):
4157 Avoid mishandling comparisons due to subtraction overflow.
4158 (Fx_family_fonts, realize_basic_faces):
4159 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4160 (Fx_family_fonts):
4161 Don't assume fixnum fits in int.
4162 Use SAFE_ALLOCA_LISP, not alloca.
4163 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
4164 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
4165 (face_at_buffer_position, face_for_overlay_string)
4166 (face_at_string_position):
4167 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4168 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
4169 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
4170 (Fx_show_tip):
4171 Check that fixnums are in proper range for system types.
4172 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
4173 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
4174 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4175 (Fx_change_window_property): Don't assume fixnums fit in int.
4176 * xfont.c (xfont_chars_supported):
4177 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4178 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
4179 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
4180 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4181 * xml.c (parse_region):
4182 * xrdb.c (magic_file_p):
4183 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4184 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
4185 (x_get_local_selection, x_reply_selection_request)
4186 (x_handle_selection_request, wait_for_property_change):
4187 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4188 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
4189 short is wide enough.
4190 (x_send_client_event): Don't assume fixnum fits in int.
4191 * xterm.c (x_x_to_emacs_modifiers):
4192 Don't assume EMACS_INT overflows nicely into int.
4193 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
4194 may come from Lisp.
4195 (handle_one_xevent): NATNUMP can eval its arg twice.
4196 (x_connection_closed):
4197 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4198 * xterm.h: Adjust decls to match defn changes elsewhere.
4199 (struct scroll_bar): Use struct vectorlike_header
4200 rather than rolling our own approximation.
4201 (SCROLL_BAR_VEC_SIZE): Remove; not used.
4202
4203 2012-05-25 Glenn Morris <rgm@gnu.org>
4204
4205 * lisp.mk (lisp): Update for more files being compiled now.
4206
4207 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
4208
4209 * lread.c: Remove `read_pure' which makes no difference.
4210 (read_pure): Remove var.
4211 (unreadpure): Remove function.
4212 (readevalloop): Don't call read_list with -1 flag.
4213 (read1, read_vector): Don't test read_pure any more.
4214 (read_list): Simplify.
4215
4216 * fileio.c, character.h: Minor style tweaks.
4217
4218 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
4219
4220 * window.h (clip_changed): Remove useless declaration.
4221
4222 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
4223
4224 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
4225 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
4226
4227 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
4228
4229 Remove src/m/*.
4230 This directory predates autoconf and is no longer needed nowadays.
4231 Move its few remaining bits of functionality to where they're needed.
4232 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
4233 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
4234 * m/template.h: Remove.
4235 * Makefile.in (M_FILE): Remove. All uses removed.
4236 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
4237 * lisp.h (USE_LSB_TAG):
4238 * mem-limits.h (EXCEEDS_LISP_PTR):
4239 Use VAL_MAX, not VALBITS, in #if.
4240 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
4241 (EMACS_UINT): Define unconditionally now.
4242 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
4243 (BITS_PER_EMACS_INT): New constants, replacing
4244 what used to be in config.h, but not useful in #if.
4245 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
4246 define them any more.
4247 (VAL_MAX): New macro.
4248 (VALMASK): Use it.
4249 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
4250 BITS_PER_EMACS_INT, in #if.
4251 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
4252 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
4253 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
4254 * s/ms-w32.h (DATA_START):
4255 Move here from removed file m/intel386.h.
4256 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
4257 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
4258
4259 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
4260
4261 Assume C89 or later.
4262 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
4263 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
4264 (xrealloc):
4265 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
4266 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
4267 * textprop.c, tparam.c (NULL): Remove.
4268 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
4269 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
4270 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
4271 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
4272 * xterm.c (input_signal_count): Assume volatile works.
4273
4274 2012-05-21 Ken Brown <kbrown@cornell.edu>
4275
4276 * xgselect.c (xg_select): Fix first argument in call to 'select'
4277 (bug#11508).
4278
4279 2012-05-20 Ken Brown <kbrown@cornell.edu>
4280
4281 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
4282 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
4283
4284 2012-05-19 Ken Brown <kbrown@cornell.edu>
4285
4286 * xfns.c (x_in_use): Remove `static' qualifier.
4287 * xterm.h (x_in_use): Declare.
4288 * xgselect.c: Include xterm.h.
4289 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
4290 and `display_arg' (bug#9754).
4291
4292 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
4293
4294 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
4295
4296 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
4297 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
4298
4299 2012-05-18 Eli Zaretskii <eliz@gnu.org>
4300
4301 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
4302
4303 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
4304 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
4305
4306 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
4307 reference to image_cache->refcount.
4308 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
4309
4310 2012-05-17 Juri Linkov <juri@jurta.org>
4311
4312 * search.c (Fword_search_regexp, Fword_search_backward)
4313 (Fword_search_forward, Fword_search_backward_lax)
4314 (Fword_search_forward_lax): Move functions to isearch.el
4315 (bug#10145, bug#11381).
4316
4317 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
4318
4319 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
4320
4321 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
4322
4323 * lread.c (init_obarray): Declare Qt and Qnil as special.
4324
4325 2012-05-14 Glenn Morris <rgm@gnu.org>
4326
4327 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
4328 Put "libexec" before "bin", for the sake of init_callproc_1.
4329
4330 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
4331
4332 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
4333
4334 * unexaix.c: Port to more-recent AIX compilers.
4335 (report_error, report_error_1, make_hdr, copy_sym)
4336 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
4337 Make arguments const char *, not char *, to avoid violations of C
4338 standard and to fix some AIX warnings reported by Gilles Pion.
4339
4340 2012-05-14 Eli Zaretskii <eliz@gnu.org>
4341
4342 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
4343 already have overlays loaded.
4344 (handle_single_display_spec): Before returning without displaying
4345 fringe bitmap, synchronize the bidi iterator with the main display
4346 iterator, by calling iterate_out_of_display_property.
4347 (iterate_out_of_display_property): Detect buffer iteration by
4348 testing that it->string is a Lisp string.
4349 (get_next_display_element): When the current object is exhausted,
4350 and there's something on it->stack, call set_iterator_to_next to
4351 proceed with what's on the stack, instead of returning zero.
4352 (set_iterator_to_next): If called at the end of a Lisp string,
4353 proceed to consider_string_end without incrementing string
4354 position. Don't increment display vector index past the end of
4355 the display vector. (Bug#11417)
4356 (pos_visible_p): Don't report a position visible when move_it_to
4357 stopped at the last line of window, which happens to be scanned
4358 backwards by the bidi iteration. (Bug#11464)
4359
4360 2012-05-14 Eli Zaretskii <eliz@gnu.org>
4361
4362 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
4363 and right-margin display specs even if the spec is invalid or we
4364 are on a TTY, and thus unable to display on the fringes.
4365 That's because the text with the property will not be displayed anyway,
4366 so we need to signal to the caller that this is a "replacing"
4367 display spec. This fixes display when the spec is invalid or we
4368 are on a TTY.
4369
4370 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
4371
4372 * unexaix.c (make_hdr): Fix typo in prototype.
4373 This bug broke the build on AIX. Problem reported by Gilles Pion.
4374
4375 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
4376
4377 * keyboard.c (kbd_buffer_get_event): Read special events also in
4378 batch mode. (Bug#11415)
4379
4380 2012-05-12 Glenn Morris <rgm@gnu.org>
4381
4382 * ns.mk: Update for ns_appbindir no longer having trailing "/".
4383
4384 2012-05-12 Eli Zaretskii <eliz@gnu.org>
4385
4386 * lisp.mk (lisp): Add newcomment.elc.
4387
4388 2012-05-12 Glenn Morris <rgm@gnu.org>
4389
4390 * Makefile.in (MKDIR_P): New, set by configure.
4391 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
4392
4393 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
4394
4395 Remove unused function hourglass_started.
4396 * dispextern.h (hourglass_started):
4397 * w32fns.c (hourglass_started):
4398 * xdisp.c (hourglass_started): Remove.
4399
4400 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
4401
4402 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
4403 Update dependencies.
4404
4405 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
4406
4407 * xgselect.c (xg_select): Put maxfds+1 into a var.
4408 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
4409
4410 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
4411
4412 2012-05-10 Dave Abrahams <dave@boostpro.com>
4413
4414 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
4415 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
4416
4417 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
4418
4419 * dbusbind.c (xd_registered_buses): New internal Lisp object.
4420 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
4421 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
4422 Initialize xd_registered_buses.
4423
4424 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
4425
4426 Untag more efficiently if USE_LSB_TAG.
4427 This is based on a proposal by YAMAMOTO Mitsuharu in
4428 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
4429 For an admittedly artificial (nth 8000 longlist) benchmark on
4430 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
4431 Emacs's overall text size by 1%.
4432 * lisp.h (XUNTAG): New macro.
4433 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
4434 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
4435 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
4436 * eval.c (Fautoload):
4437 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
4438 * frame.h (XFRAME): Use XUNTAG.
4439
4440 Port recent dbusbind.c changes to 32-bit --with-wide-int.
4441 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
4442 Remove unportable assumptions about print widths of types like
4443 dbus_uint32_t.
4444 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
4445 intptr_t when converting between pointer and integer, to avoid GCC
4446 warnings about wrong width.
4447
4448 2012-05-09 Eli Zaretskii <eliz@gnu.org>
4449
4450 * w32proc.c (new_child): Force Windows to reserve only 64KB of
4451 stack for each reader_thread, instead of defaulting to 8MB
4452 determined by the linker. This avoids failures in creating
4453 subprocesses on Windows 7, see the discussion in this thread:
4454 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
4455
4456 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
4457
4458 Fix up display of the *Minibuf-0* buffer in the mini window.
4459 * keyboard.c (read_char): Don't clear the echo area if there's no
4460 message to clear.
4461 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
4462 contents of *Minibuf-0*) if there's no message displayed in its stead.
4463
4464 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
4465
4466 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
4467 batch mode.
4468
4469 2012-05-06 Chong Yidong <cyd@gnu.org>
4470
4471 * lisp.mk (lisp): Update.
4472
4473 2012-05-05 Jim Meyering <meyering@redhat.com>
4474
4475 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
4476
4477 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
4478
4479 * data.c (PUT_ERROR): New macro.
4480 (syms_of_data): Use it. Add new error type `user-error'.
4481 * undo.c (user_error): New function.
4482 (Fprimitive_undo): Use it.
4483 * print.c (print_error_message): Adjust print style for `user-error'.
4484 * keyboard.c (user_error): New function.
4485 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
4486
4487 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
4488
4489 Do not limit current-time-string to years 1000..9999.
4490 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
4491 (Fcurrent_time_string): Support any year that is supported by the
4492 underlying localtime representation. Don't use asctime, as it
4493 has undefined behavior for years outside the range -999..9999.
4494
4495 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
4496
4497 Fix race conditions involving setenv, gmtime, localtime, asctime.
4498 Without this fix, interrupts could mess up code that uses these
4499 nonreentrant functions, since setting TZ invalidates existing
4500 tm_zone or tzname values, and since most of these functions return
4501 pointers to static storage.
4502 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
4503 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
4504 Grow the critical sections to include not just invoking
4505 localtime/gmtime, but also accessing these functions' results
4506 including their tm_zone values if any, and any related TZ setting.
4507 (format_time_string): Last arg is now struct tm *, not struct tm **,
4508 so that the struct tm is saved in the critical section.
4509 All callers changed. Simplify allocation of initial buffer, partly
4510 motivated by the fact that memory allocation needs to be outside
4511 the critical section.
4512
4513 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
4514
4515 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
4516 with RESET_INTERVAL.
4517
4518 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
4519 Remove duplicated buffer name initialization.
4520
4521 2012-05-02 Jim Meyering <jim@meyering.net>
4522
4523 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
4524
4525 * xfns.c (x_window): Use xstrdup (Bug#11375).
4526
4527 2012-05-02 Eli Zaretskii <eliz@gnu.org>
4528
4529 * xdisp.c (pos_visible_p): If already at a newline from the
4530 display string before the 'while' loop, don't walk back the glyphs
4531 from it3.glyph_row. Solves assertion violation when the display
4532 string begins with a newline (egg.el). (Bug#11367)
4533
4534 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
4535
4536 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
4537 Move to simple.el.
4538
4539 2012-05-01 Glenn Morris <rgm@gnu.org>
4540
4541 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
4542 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
4543 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
4544 All were removed before 23.1.
4545
4546 * dispnew.c: Remove HAVE_LIBNCURSES test;
4547 it is always true on relevant platforms.
4548
4549 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
4550 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
4551
4552 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
4553
4554 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
4555
4556 * .gdbinit (xpr): Remove checks for no longer existing misc types.
4557 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
4558 Remove.
4559
4560 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
4561
4562 Do not avoid creating empty evaporating overlays (Bug#9642).
4563 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
4564 That is, do not delete an evaporating overlay if it becomes
4565 empty after its bounds are adjusted to fit within its buffer.
4566 This fix caused other problems, and I'm reverting it until we get
4567 to the bottom of them.
4568
4569 2012-04-27 Chong Yidong <cyd@gnu.org>
4570
4571 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
4572
4573 2012-04-27 Eli Zaretskii <eliz@gnu.org>
4574
4575 * xdisp.c (pos_visible_p): If the window start position is beyond
4576 ZV, start the display from buffer beginning. Prevents assertion
4577 violation in init_iterator when the minibuffer window is scrolled
4578 via the scroll bar.
4579
4580 * window.c (window_scroll_pixel_based): Likewise.
4581
4582 2012-04-27 Chong Yidong <cyd@gnu.org>
4583
4584 * keymap.c (where_is_internal): Doc fix (Bug#10872).
4585
4586 2012-04-27 Glenn Morris <rgm@gnu.org>
4587
4588 * fileio.c (Fcopy_file, Fset_file_selinux_context):
4589 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
4590
4591 2012-04-27 Eli Zaretskii <eliz@gnu.org>
4592
4593 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
4594 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
4595
4596 2012-04-26 Eli Zaretskii <eliz@gnu.org>
4597
4598 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
4599 display element, check also the underlying string or buffer
4600 character. (Bug#11341)
4601
4602 * w32menu.c: Include w32heap.h.
4603 (add_menu_item): If the call to AppendMenuW (via
4604 unicode_append_menu) fails, disable Unicode menus only if we are
4605 running on Windows 9X/Me.
4606
4607 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
4608
4609 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
4610 (xgetint): Add missing shift for LSB tags.
4611
4612 2012-04-24 Martin Rudalics <rudalics@gmx.at>
4613
4614 * keyboard.c (read_char): Don't wipe echo area for select window
4615 events: These might get delayed via `mouse-autoselect-window'
4616 (Bug#11304).
4617
4618 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
4619
4620 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
4621 manipulation of :loaded-from data.
4622
4623 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
4624
4625 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
4626 now a cons (bug#11311).
4627
4628 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
4629
4630 Do not create empty overlays with the evaporate property (Bug#9642).
4631 * buffer.c (Fmove_overlay): Delete an evaporating overlay
4632 if it becomes empty after its bounds are adjusted to fit within
4633 its buffer. Without this fix, in a nonempty buffer (let ((o
4634 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
4635 yields an empty overlay that has the evaporate property, which is
4636 not supposed to happen.
4637
4638 Fix minor GTK3 problems found by static checking.
4639 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
4640 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
4641 (struct _EmacsFixedClass, emacs_fixed_get_type):
4642 Move decls here from emacsgtkfixed.h, since they needn't be public.
4643 (emacs_fixed_get_type): Now static.
4644 (emacs_fixed_class_init): Omit unused local.
4645 (emacs_fixed_child_type): Remove; unused.
4646 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
4647 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
4648 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
4649 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
4650 (EMACS_FIXED_GET_CLASS): Remove; unused.
4651 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
4652
4653 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
4654 Problem reported by Juanma Barranquero for Windows -Wunused-function.
4655
4656 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
4657
4658 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
4659 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
4660 (__malloc_size_t, __malloc_ptrdiff_t):
4661 Remove. All uses removed, replaced by the definiens if needed,
4662 since we can assume C89 or better now.
4663 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
4664 (protect_malloc_state, align, get_contiguous_space)
4665 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
4666 (malloc_atfork_handler_child, malloc_enable_thread)
4667 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
4668 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
4669 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
4670 (special_realloc, _realloc_internal_nolock, _realloc_internal)
4671 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
4672 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
4673 Define using prototypes, not old style.
4674 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
4675 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
4676 (align): Don't assume that signed integer overflow wraps around.
4677 Omit unused local var.
4678 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
4679 (_free_internal_nolock, memalign, mallochook, reallochook):
4680 Omit no-longer-needed casts.
4681 (valloc): Use getpagesize, not __getpagesize.
4682 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
4683 (struct hdr): The 'magic' member is now size_t, not unsigned long.
4684
4685 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
4686
4687 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
4688
4689 Move functions from C to Lisp. Make non-blocking method calls
4690 the default. Implement further D-Bus standard interfaces.
4691
4692 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
4693 (QCdbus_request_name_allow_replacement)
4694 (QCdbus_request_name_replace_existing)
4695 (QCdbus_request_name_do_not_queue)
4696 (QCdbus_request_name_reply_primary_owner)
4697 (QCdbus_request_name_reply_in_queue)
4698 (QCdbus_request_name_reply_exists)
4699 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
4700 (QCdbus_registered_serial, QCdbus_registered_method)
4701 (QCdbus_registered_signal): New Lisp objects.
4702 (XD_DEBUG_MESSAGE): Use sizeof.
4703 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
4704 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
4705 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
4706 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
4707 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
4708 (xd_signature, xd_append_arg): Allow float for integer types.
4709 (xd_get_connection_references): New function.
4710 (xd_get_connection_address): Rename from xd_initialize.
4711 Return cached address.
4712 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
4713 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
4714 level.
4715 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
4716 Return number of refcounts.
4717 (Fdbus_get_unique_name): Make stronger parameter check.
4718 (Fdbus_message_internal): New defun.
4719 (Fdbus_call_method, Fdbus_call_method_asynchronously)
4720 (Fdbus_method_return_internal, Fdbus_method_error_internal)
4721 (Fdbus_send_signal, Fdbus_register_service)
4722 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
4723 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
4724 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
4725 (Vdbus_compiled_version, Vdbus_runtime_version)
4726 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
4727 (Vdbus_message_type_method_return, Vdbus_message_type_error)
4728 (Vdbus_message_type_signal): New defvars.
4729 (Vdbus_registered_buses, Vdbus_registered_objects_table):
4730 Adapt docstring.
4731
4732 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
4733
4734 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
4735 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
4736 Do not assume ptrdiff_t is the same width as 'int'.
4737
4738 * alloc.c: Handle unusual debugging option combinations.
4739 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
4740 since the two debugging options are incompatible.
4741 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
4742 is defined.
4743 (mem_init, mem_insert, mem_insert_fixup):
4744 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
4745 (NEED_MEM_INSERT): Remove; no longer needed.
4746
4747 2012-04-22 Leo Liu <sdl.web@gmail.com>
4748
4749 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
4750
4751 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
4752
4753 * sysdep.c [__FreeBSD__]: Minor cleanups.
4754 (list_system_processes, system_process_attributes) [__FreeBSD__]:
4755 Use Emacs indenting style more consistently. Avoid some casts.
4756 Use 'double' consistently rather than mixing 'float' and 'double'.
4757
4758 2012-04-21 Eduard Wiebe <usenet@pusto.de>
4759
4760 * sysdep.c (list_system_processes, system_process_attributes):
4761 Add implementation for FreeBSD (Bug#5243).
4762
4763 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
4764
4765 * lisp.mk (lisp): Update.
4766
4767 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
4768
4769 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
4770 It is never used otherwise.
4771
4772 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
4773
4774 * print.c (print_preprocess): Only check print_depth if print-circle
4775 is nil.
4776 (print_object): Check for cycles even when print-circle is nil and
4777 print-gensym is t, but only check print_depth if print-circle is nil.
4778
4779 2012-04-20 Chong Yidong <cyd@gnu.org>
4780
4781 * process.c (wait_reading_process_output): If EIO occurs on a pty,
4782 set the status to "failed" and ensure that sentinel is run.
4783
4784 2012-04-20 Glenn Morris <rgm@gnu.org>
4785
4786 * process.c (Fset_process_inherit_coding_system_flag)
4787 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4788 (Fmake_network_process, Fmake_serial_process): Doc fix.
4789
4790 2012-04-20 Eli Zaretskii <eliz@gnu.org>
4791
4792 * xdisp.c (string_buffer_position_lim): Limit starting position to
4793 BEGV.
4794 (set_cursor_from_row): If called for a mode-line or header-line
4795 row, return zero immediately.
4796 (try_cursor_movement): If inside continuation line, don't back up
4797 farther than the first row after the header line, if any.
4798 Don't consider the header-line row as "partially visible", even if
4799 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
4800
4801 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
4802
4803 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
4804 (bug#11238).
4805
4806 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
4807 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
4808
4809 configure: new option --enable-gcc-warnings (Bug#11207)
4810 * Makefile.in (C_WARNINGS_SWITCH): Remove.
4811 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
4812 (ALL_CFLAGS): Use new macros rather than old.
4813 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
4814 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
4815 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
4816 -Wunused-result, -Wunused-variable. This should go away once
4817 the Emacs and Gnulib regex code is merged.
4818 (xmalloc, xrealloc): Now static.
4819
4820 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
4821
4822 * dired.c (Fsystem_groups): Remove unused local.
4823
4824 2012-04-17 Glenn Morris <rgm@gnu.org>
4825
4826 * dired.c (Fsystem_users): Doc fix.
4827
4828 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
4829
4830 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
4831 (syms_of_dired): Add them.
4832
4833 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
4834
4835 Fix minor alloc.c problems found by static checking.
4836 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
4837 New extern decls, to avoid calling undeclared functions.
4838 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
4839 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
4840 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
4841 (NEED_MEM_INSERT): New macro.
4842 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4843 Remove one incorrect comment and fix another.
4844
4845 Fix minor ralloc.c problems found by static checking.
4846 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
4847 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
4848 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
4849 (r_alloc_sbrk): Now static.
4850
4851 Improve ralloc.c interface checking.
4852 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
4853 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
4854 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
4855 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
4856 [REL_ALLOC]: ... to here, to check interface.
4857 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
4858 Remove decls. This fixes an "It stinks!".
4859
4860 * alloc.c (which_symbols): Fix alignment issue / type clash.
4861
4862 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
4863
4864 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
4865 (struct Lisp_Misc_Any): Likewise.
4866 (struct Lisp_Free): Likewise.
4867 * alloc.c (union aligned_Lisp_Symbol): Define.
4868 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
4869 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
4870 (union aligned_Lisp_Misc): Define.
4871 (MARKER_BLOCK_SIZE, struct marker_block): Use union
4872 aligned_Lisp_Misc instead of union Lisp_Misc.
4873 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
4874
4875 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
4876
4877 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
4878 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
4879 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
4880 * s/netbsd.h, s/sol2-6.h:
4881 Remove definition of GC_MARK_STACK, since the default now works.
4882 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
4883 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
4884 no longer the default.
4885 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
4886
4887 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
4888
4889 * lread.c (lisp_file_lexically_bound_p):
4890 Fix hang at ";-*-\n" (bug#11238).
4891
4892 2012-04-14 Eli Zaretskii <eliz@gnu.org>
4893
4894 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
4895 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
4896
4897 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
4898
4899 * nsterm.m (constrainFrameRect): Always constrain when there is only
4900 one screen (Bug#10962).
4901
4902 2012-04-13 Ken Brown <kbrown@cornell.edu>
4903
4904 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
4905
4906 2012-04-13 Reuben Thomas <rrt@sc3d.org>
4907
4908 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
4909
4910 2012-04-11 Daniel Colascione <dancol@dancol.org>
4911
4912 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
4913 against is gone. It's better to use vfork now so that when Cygwin
4914 gains a new, working vfork, we use it automatically (bug#10398).
4915
4916 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
4917
4918 * window.c (save_window_save): Obey window-point-insertion-type.
4919
4920 2012-04-11 Glenn Morris <rgm@gnu.org>
4921
4922 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
4923
4924 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
4925
4926 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
4927
4928 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
4929
4930 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
4931 (force_quit_count): New var.
4932 (handle_interrupt): Use it.
4933
4934 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
4935
4936 * w32.c (w32_delayed_load): Record the full path of the library
4937 being loaded (bug#10424).
4938
4939 2012-04-09 Glenn Morris <rgm@gnu.org>
4940
4941 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
4942 not just in the obarray, before snarfing them. (Bug#11036)
4943
4944 * Makefile.in ($(leimdir)/leim-list.el):
4945 Pass EMACS rather than BUILT_EMACS.
4946
4947 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
4948
4949 * process.c (make_process):
4950 * process.h: Add integer `gnutls_handshakes_tried' member to
4951 process struct.
4952
4953 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
4954 Add convenience `GNUTLS_LOG2i' macro.
4955
4956 * gnutls.c (gnutls_log_function2i): Convenience log function.
4957 (emacs_gnutls_read): Use new log functions,
4958 `gnutls_handshakes_tried' process member, and
4959 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
4960 attempts per process (connection).
4961
4962 2012-04-09 Chong Yidong <cyd@gnu.org>
4963
4964 * eval.c (Fuser_variable_p, user_variable_p_eh)
4965 (lisp_indirect_variable): Functions deleted.
4966 (Fdefvar): Caller changed.
4967
4968 * callint.c (Finteractive, Fcall_interactively):
4969 * minibuf.c (Fread_variable): Callers changed.
4970
4971 2012-04-09 Eli Zaretskii <eliz@gnu.org>
4972
4973 * xdisp.c (set_cursor_from_row): If the display string appears in
4974 the buffer at position that is closer to point than the position
4975 after the display string, display the cursor on the first glyph of
4976 the display string. Fixes cursor display when a 'display' text
4977 property immediately follows invisible text. (Bug#11094)
4978
4979 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
4980
4981 composite.c: use 'double' consistently
4982 * composite.c (get_composition_id): Use 'double' consistently
4983 instead of converting 'float' to 'double' and vice versa; this is
4984 easier to understand and avoids a GCC warning.
4985
4986 2012-04-09 Glenn Morris <rgm@gnu.org>
4987
4988 * Makefile.in: Generate leim-list with bootstrap-emacs, in
4989 preparation for dumping it with emacs. (Bug#4789)
4990 (leimdir): New variable.
4991 ($(leimdir)/leim-list.el): New rule.
4992 (emacs$(EXEEXT)): Depend on leim-list.el.
4993
4994 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
4995 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
4996 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
4997
4998 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
4999
5000 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
5001 proper alignment.
5002
5003 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
5004
5005 * xml.c (init_libxml2_functions) [WINDOWSNT]:
5006 Remove unused local variable.
5007
5008 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
5009
5010 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
5011 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
5012 (mark_memory): Mark Lisp_Objects only if pointers might hide in
5013 objects, as mark_maybe_pointer will catch them otherwise.
5014 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
5015 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
5016
5017 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
5018
5019 Fix typo that broke non-Windows builds.
5020 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
5021
5022 2012-04-07 Eli Zaretskii <eliz@gnu.org>
5023
5024 Support building on MS-Windows with libxml2.
5025
5026 * makefile.w32-in (OBJ2): Add xml.$(O).
5027 (GLOBAL_SOURCES): Add xml.c.
5028 ($(BLD)/xml.$(O)): New dependency list.
5029
5030 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
5031 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
5032 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
5033 [!WINDOWSNT]: New macros.
5034 (init_libxml2_functions, libxml2_loaded_p): New functions.
5035 (parse_region): Call fn_xmlCheckVersion instead of using the macro
5036 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
5037 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
5038 Calls xmlCleanupParser only if libxml2 was loaded (or statically
5039 linked in).
5040 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
5041 Call init_libxml2_functions before calling libxml2 functions.
5042 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
5043
5044 * emacs.c: Don't include libxml/parser.h.
5045 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
5046 xmlCleanupParser directly.
5047
5048 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
5049
5050 2012-04-07 Eli Zaretskii <eliz@gnu.org>
5051
5052 * indent.c (Fvertical_motion): If there is a display string at
5053 point, use it.vpos to compute how many lines to backtrack after
5054 move_it_to point. (Bug#11133)
5055
5056 2012-04-06 Eli Zaretskii <eliz@gnu.org>
5057
5058 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
5059 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
5060 about subtle differences between FETCH_CHAR* and STRING_CHAR*
5061 macros related to unification of CJK characters. For the details,
5062 see the discussion following the message here:
5063 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
5064
5065 2012-04-04 Chong Yidong <cyd@gnu.org>
5066
5067 * keyboard.c (Vdelayed_warnings_list): Doc fix.
5068
5069 2012-04-01 Eli Zaretskii <eliz@gnu.org>
5070
5071 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
5072 instead of alloca. (Bug#11138)
5073
5074 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
5075
5076 * w32menu.c (is_simple_dialog): Properly check lisp types.
5077 (Bug#11141)
5078
5079 2012-03-31 Eli Zaretskii <eliz@gnu.org>
5080
5081 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
5082 position we get to after a call to move_it_to fails the
5083 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
5084 only if we wind up in a string from display property. (Bug#11063)
5085
5086 * window.c (Fdelete_other_windows_internal): Invalidate the row
5087 and column information about mouse highlight, so that redisplay
5088 restores it after reallocating the glyph matrices. (Bug#7464)
5089
5090 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
5091 string comes from a `display' text property, use the buffer
5092 position of that property as if we actually saw that position in
5093 the row's glyphs.
5094 (move_it_by_lines): Remove the assertion that
5095 "it->current_x == 0 && it->hpos == 0" which can be legitimately
5096 violated when there's a before-string at the beginning of a line.
5097 (Bug#11063)
5098
5099 2012-03-30 Eli Zaretskii <eliz@gnu.org>
5100
5101 * xdisp.c (append_space_for_newline): If the default face was
5102 remapped, use the remapped face for the appended newline.
5103 (extend_face_to_end_of_line): Use the remapped default face for
5104 extending the face to the end of the line.
5105 (display_line): Call extend_face_to_end_of_line when the default
5106 face was remapped. (Bug#11068)
5107
5108 2012-03-29 Eli Zaretskii <eliz@gnu.org>
5109
5110 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
5111
5112 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
5113
5114 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
5115
5116 2012-03-27 Glenn Morris <rgm@gnu.org>
5117
5118 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
5119 Doc fixes.
5120
5121 2012-03-26 Kenichi Handa <handa@m17n.org>
5122
5123 * dispextern.h (struct glyph): Fix previous change. Change the
5124 bit length of glyphless.ch to 25 (Bug#11082).
5125
5126 2012-03-26 Chong Yidong <cyd@gnu.org>
5127
5128 * keyboard.c (Vselection_inhibit_update_commands): New variable.
5129 (command_loop_1): Use it; inhibit selection update for
5130 handle-select-window too (Bug#8996).
5131
5132 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
5133
5134 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
5135
5136 2012-03-25 Kenichi Handa <handa@m17n.org>
5137
5138 * dispextern.h (struct glyph): Change the bit length of
5139 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
5140
5141 2012-03-24 Eli Zaretskii <eliz@gnu.org>
5142
5143 * s/ms-w32.h (tzname): Include time.h before redirecting to
5144 _tzname. Fixes the MSVC build. (Bug#9960)
5145
5146 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
5147
5148 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
5149 characters.
5150
5151 * xterm.c (XTread_socket): Only modify handling_signal if
5152 !SYNC_INPUT. (Bug#11080)
5153
5154 2012-03-23 Eli Zaretskii <eliz@gnu.org>
5155
5156 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
5157 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
5158 when fetching a multibyte character consumes more bytes than
5159 CHAR_BYTES returns, due to unification of CJK characters in
5160 string_char. (Bug#11073)
5161
5162 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
5163
5164 * process.c (wait_reading_process_output): Handle pty disconnect
5165 by refraining from sending oneself a SIGCHLD (bug#10933).
5166
5167 2012-03-22 Chong Yidong <cyd@gnu.org>
5168
5169 * dispextern.h (struct it): New member string_from_prefix_prop_p.
5170
5171 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
5172 Mark string as coming from a prefix property.
5173 (handle_face_prop): Use default face for prefix strings (Bug#4281).
5174 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
5175
5176 2012-03-21 Chong Yidong <cyd@gnu.org>
5177
5178 * xfaces.c (Vface_remapping_alist): Doc fix.
5179
5180 2012-03-20 Eli Zaretskii <eliz@gnu.org>
5181
5182 * w32proc.c (Fw32_set_console_codepage)
5183 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
5184 Doc fixes.
5185
5186 2012-03-20 Chong Yidong <cyd@gnu.org>
5187
5188 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
5189 to reflect default non-nil value of redisplay-dont-pause.
5190
5191 2012-03-19 Kenichi Handa <handa@m17n.org>
5192
5193 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
5194 it fit in a valid range (Bug#11003).
5195
5196 2012-03-18 Eli Zaretskii <eliz@gnu.org>
5197
5198 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
5199 that is not from display property, accept the row as a "cursor
5200 row" if one of the string's character has a non-nil `cursor'
5201 property. Fixes cursor positioning when there are newlines in
5202 overlay strings, e.g. in icomplete.el. (Bug#11035)
5203
5204 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
5205
5206 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
5207
5208 2012-03-12 Chong Yidong <cyd@gnu.org>
5209
5210 * eval.c (inhibit_lisp_code): Rename from
5211 inhibit_window_configuration_change_hook; move from window.c.
5212
5213 * xfns.c (unwind_create_frame_1, Fx_create_frame):
5214 * window.c (run_window_configuration_change_hook)
5215 (syms_of_window): Callers changed.
5216
5217 2012-03-11 Chong Yidong <cyd@gnu.org>
5218
5219 * keymap.c (Fkey_description): Doc fix (Bug#9700).
5220
5221 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
5222
5223 2012-03-10 Chong Yidong <cyd@gnu.org>
5224
5225 * frame.c (other_visible_frames): Don't assume the selected frame
5226 is visible (Bug#10955).
5227
5228 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
5229
5230 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
5231
5232 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
5233
5234 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
5235 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
5236 zero (Bug#10954).
5237
5238 2012-03-03 Glenn Morris <rgm@gnu.org>
5239
5240 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
5241
5242 2012-03-02 Eli Zaretskii <eliz@gnu.org>
5243
5244 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
5245 position past the first glyph_row that ends at ZV. (Bug#10902)
5246 (redisplay_window, next_element_from_string): Fix typos in
5247 comments.
5248 (redisplay_window): Pass to move_it_vertically the margin in
5249 pixels, not in screen lines.
5250
5251 2012-03-02 Glenn Morris <rgm@gnu.org>
5252
5253 * buffer.c (buffer-list-update-hook): Doc fix.
5254
5255 2012-02-29 Eli Zaretskii <eliz@gnu.org>
5256
5257 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
5258 push_it before setting up the iterator for the first overlay
5259 string, even if we have an empty string loaded.
5260 (next_overlay_string): If there's an empty string on the iterator
5261 stack, pop the stack. (Bug#10903)
5262
5263 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
5264
5265 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
5266 Suggested by Stefan Monnier in
5267 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
5268 * alloc.c (widen_to_Lisp_Object): New static function.
5269 (mark_memory): Also mark Lisp_Objects by fetching pointer words
5270 and widening them to Lisp_Objects. This would work even if
5271 USE_LSB_TAG is defined and wide integers are used, which might
5272 happen in a future version of Emacs.
5273
5274 2012-02-25 Chong Yidong <cyd@gnu.org>
5275
5276 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
5277 Doc fix.
5278
5279 * xselect.c (Fx_selection_exists_p): Doc fix.
5280 (x_clipboard_manager_save_all): Print an informative message
5281 before saving to clipboard manager.
5282
5283 2012-02-24 Chong Yidong <cyd@gnu.org>
5284
5285 * keyboard.c (process_special_events): Handle all X selection
5286 requests in kbd_buffer, not just the next one (Bug#8869).
5287
5288 2012-02-23 Chong Yidong <cyd@gnu.org>
5289
5290 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
5291 call when setting menu-bar-lines and tool-bar-lines parameters.
5292 (unwind_create_frame_1): New helper function.
5293
5294 * window.c (inhibit_window_configuration_change_hook): New var.
5295 (run_window_configuration_change_hook): Obey it.
5296 (syms_of_window): Initialize it.
5297
5298 2012-02-22 Chong Yidong <cyd@gnu.org>
5299
5300 * xterm.c (x_draw_image_relief): Add missing type check for
5301 Vtool_bar_button_margin (Bug#10743).
5302
5303 2012-02-21 Chong Yidong <cyd@gnu.org>
5304
5305 * fileio.c (Vfile_name_handler_alist): Doc fix.
5306
5307 * buffer.c (Fget_file_buffer): Protect against invalid file
5308 handler return value.
5309
5310 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
5311
5312 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
5313 when computing $valmask.
5314
5315 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
5316 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
5317 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
5318 It's useless in that case, and it can cause problems on hosts
5319 that allocate halves of EMACS_INT values separately.
5320 Reported by Dan Horák. Diagnosed by Andreas Schwab in
5321 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
5322 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
5323 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
5324 it avoids undefined behavior on hosts where shifting right by more
5325 than the word width has undefined behavior.
5326
5327 2012-02-19 Chong Yidong <cyd@gnu.org>
5328
5329 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
5330 (Funhandled_file_name_directory, Ffile_name_as_directory)
5331 (Fdirectory_file_name, Fexpand_file_name)
5332 (Fsubstitute_in_file_name): Protect against invalid file handler
5333 return values (Bug#10845).
5334
5335 2012-02-18 Eli Zaretskii <eliz@gnu.org>
5336
5337 * .gdbinit (pitx): Fix incorrect references to fields of the
5338 iterator stack.
5339
5340 2012-02-17 Chong Yidong <cyd@gnu.org>
5341
5342 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
5343
5344 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
5345
5346 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
5347 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
5348
5349 2012-02-15 Chong Yidong <cyd@gnu.org>
5350
5351 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
5352 marked as special. Also, starting docstrings with * is obsolete.
5353
5354 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
5355
5356 * gnutls.c (emacs_gnutls_write): Fix last change.
5357
5358 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
5359
5360 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
5361 send_process.
5362
5363 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
5364
5365 * keymap.c (Fsingle_key_description): Handle char ranges.
5366
5367 2012-02-12 Chong Yidong <cyd@gnu.org>
5368
5369 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
5370 as that creates a dangerous corner case.
5371
5372 * window.c (Fdelete_window_internal): Invalidate the mouse
5373 highlight (Bug#9904).
5374
5375 2012-02-12 Glenn Morris <rgm@gnu.org>
5376
5377 * xselect.c (Fx_own_selection_internal)
5378 (Fx_get_selection_internal, Fx_disown_selection_internal)
5379 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
5380 * nsselect.m (Fx_own_selection_internal)
5381 (Fx_disown_selection_internal, Fx_selection_exists_p)
5382 (Fx_selection_owner_p, Fx_get_selection_internal):
5383 Sync docs and argument specs with the xselect.c versions.
5384
5385 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
5386
5387 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
5388
5389 2012-02-11 Eli Zaretskii <eliz@gnu.org>
5390
5391 * w32select.c (Fx_selection_exists_p): Sync doc string and
5392 argument list with xselect.c. (Bug#10783)
5393
5394 * w16select.c (Fx_selection_exists_p): Sync doc string and
5395 argument list with xselect.c. (Bug#10783)
5396
5397 2012-02-10 Glenn Morris <rgm@gnu.org>
5398
5399 * fns.c (Fsecure_hash): Doc fix.
5400
5401 2012-02-09 Kenichi Handa <handa@m17n.org>
5402
5403 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
5404
5405 2012-02-07 Chong Yidong <cyd@gnu.org>
5406
5407 * buffer.c (Fbuffer_local_variables)
5408 (buffer_lisp_local_variables): Handle unbound vars correctly;
5409 don't let Qunbound leak into Lisp.
5410
5411 2012-02-07 Glenn Morris <rgm@gnu.org>
5412
5413 * image.c (Fimagemagick_types): Doc fix.
5414
5415 * image.c (imagemagick-render-type): Change it from a lisp object
5416 to an integer. Move the doc here from the lisp manual.
5417 Treat all values not equal to 0 the same.
5418
5419 2012-02-06 Chong Yidong <cyd@gnu.org>
5420
5421 * doc.c (store_function_docstring): Avoid applying docstring of
5422 alias to base function (Bug#2603).
5423
5424 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
5425
5426 * .gdbinit (pp1, pv1): Remove redundant defines.
5427 (pr): Use pp.
5428
5429 2012-02-04 Chong Yidong <cyd@gnu.org>
5430
5431 * nsterm.m: Declare a global (Bug#10694).
5432
5433 2012-02-04 Eli Zaretskii <eliz@gnu.org>
5434
5435 * w32.c (get_emacs_configuration_options):
5436 Include --enable-checking, if specified, in the return value.
5437
5438 2012-02-04 Martin Rudalics <rudalics@gmx.at>
5439
5440 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
5441 after rounding frame sizes. (Bug#9723)
5442
5443 2012-02-04 Eli Zaretskii <eliz@gnu.org>
5444
5445 * keyboard.c (adjust_point_for_property): Don't position point
5446 before BEGV. (Bug#10696)
5447
5448 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
5449
5450 Handle overflow when computing char display width (Bug#9496).
5451 * character.c (char_width): Return EMACS_INT, not int.
5452 (char_width, c_string_width): Check for overflow when
5453 computing the width; this is possible now that individual
5454 characters can have unbounded width. Problem introduced
5455 by merge from Emacs 23 on 2012-01-19.
5456
5457 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
5458
5459 * dbusbind.c (Fdbus_register_method): Mention the return value
5460 :ignore in the docstring.
5461
5462 2012-02-02 Glenn Morris <rgm@gnu.org>
5463
5464 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
5465
5466 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
5467 Unconditionally set to t. (Bug#10673)
5468 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
5469 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
5470 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
5471
5472 2012-02-02 Kenichi Handa <handa@m17n.org>
5473
5474 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
5475 0, do not call append_composite_glyph.
5476
5477 2012-02-02 Kenichi Handa <handa@m17n.org>
5478
5479 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
5480 NULL (Bug#6988).
5481 (x_produce_glyphs): If the component of a composition is a null
5482 string, set it->pixel_width to 1 to avoid zero-width glyph.
5483
5484 2012-02-01 Eli Zaretskii <eliz@gnu.org>
5485
5486 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
5487 first 2 arguments are identical. This makes inserting large
5488 output from a subprocess an order of magnitude faster on
5489 MS-Windows, where all sbrk'ed memory is always contiguous.
5490
5491 2012-01-31 Glenn Morris <rgm@gnu.org>
5492
5493 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
5494 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
5495 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
5496
5497 2012-01-29 Glenn Morris <rgm@gnu.org>
5498
5499 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
5500
5501 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
5502
5503 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
5504
5505 2012-01-28 Chong Yidong <cyd@gnu.org>
5506
5507 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
5508
5509 2012-01-26 Chong Yidong <cyd@gnu.org>
5510
5511 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
5512
5513 * search.c (Fsearch_forward, Fsearch_backward): Document negative
5514 repeat counts (Bug#10507).
5515
5516 2012-01-26 Glenn Morris <rgm@gnu.org>
5517
5518 * lread.c (syms_of_lread): Doc fix.
5519
5520 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
5521
5522 * coding.c (encode_designation_at_bol): Change return value to
5523 EMACS_INT.
5524
5525 2012-01-25 Chong Yidong <cyd@gnu.org>
5526
5527 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
5528
5529 2012-01-21 Chong Yidong <cyd@gnu.org>
5530
5531 * floatfns.c (Fcopysign): Make the second argument non-optional,
5532 since nil is not allowed anyway.
5533
5534 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
5535
5536 * process.c (read_process_output): Use p instead of XPROCESS (proc).
5537 (send_process): Likewise.
5538
5539 2012-01-19 Martin Rudalics <rudalics@gmx.at>
5540
5541 * window.c (save_window_save, Fcurrent_window_configuration)
5542 (Vwindow_persistent_parameters): Do not use Qstate.
5543 Rewrite doc-strings.
5544
5545 2012-01-19 Kenichi Handa <handa@m17n.org>
5546
5547 * character.c (char_width): New function.
5548 (Fchar_width, c_string_width, lisp_string_width):
5549 Use char_width (Bug#9496).
5550
5551 2012-01-16 Martin Rudalics <rudalics@gmx.at>
5552
5553 * window.c (Vwindow_persistent_parameters): New variable.
5554 (Fset_window_configuration, save_window_save): Handle persistent
5555 window parameters.
5556
5557 2012-01-14 Eli Zaretskii <eliz@gnu.org>
5558
5559 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
5560 thrashing the stack of the thread. (Bug#9087)
5561
5562 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
5563
5564 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
5565
5566 2012-01-11 Eli Zaretskii <eliz@gnu.org>
5567
5568 * xdisp.c (rows_from_pos_range): Handle the case where the
5569 highlight ends on a newline. (Bug#10464)
5570 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
5571 he end column for display of highlight that ends on a newline
5572 before a R2L line.
5573
5574 2012-01-11 Glenn Morris <rgm@gnu.org>
5575
5576 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
5577 from load-path also when installation-directory is nil. (Bug#10208)
5578
5579 2012-01-10 Glenn Morris <rgm@gnu.org>
5580
5581 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
5582
5583 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
5584 Update template values to be closer to their typical values these days.
5585
5586 2012-01-09 Eli Zaretskii <eliz@gnu.org>
5587
5588 * xdisp.c (rows_from_pos_range): Accept additional argument
5589 DISP_STRING, and accept any glyph in a row whose object is that
5590 string as eligible for mouse highlight. Fixes mouse highlight of
5591 display strings from overlays. (Bug#10464)
5592
5593 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
5594
5595 emacs: fix an auto-save permissions race condition (Bug#10400)
5596 * fileio.c (auto_saving_dir_umask): New static var.
5597 (Fmake_directory_internal): Use it.
5598 (do_auto_save_make_dir): Set it, instead of invoking chmod after
5599 creating the directory. The old code temporarily assigns
5600 too-generous permissions to the directory.
5601 (do_auto_save_eh): Clear it.
5602 (Fdo_auto_save): Catch all errors, not just file errors, so
5603 that the var is always cleared.
5604
5605 2012-01-07 Eli Zaretskii <eliz@gnu.org>
5606
5607 * search.c (scan_buffer): Pass character positions to
5608 know_region_cache, not byte positions. (Bug#6540)
5609
5610 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
5611
5612 * w32.c (sys_rename): Report EXDEV when rename of a directory
5613 fails because the target is on another logical disk. (Bug#10284)
5614
5615 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
5616
5617 * xterm.c (x_embed_request_focus): New function.
5618
5619 * xterm.h: Add prototype.
5620
5621 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
5622
5623 2012-01-05 Glenn Morris <rgm@gnu.org>
5624
5625 * emacs.c (emacs_copyright): Update short copyright year to 2012.
5626
5627 2012-01-01 Eli Zaretskii <eliz@gnu.org>
5628
5629 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
5630 Load gnutls_transport_set_lowat only if GnuTLS version is below
5631 2.11.1.
5632 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
5633 GnuTLS versions below 2.11.1.
5634
5635 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
5636
5637 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
5638 to the doc string advising against its use for altering the way
5639 windows are scrolled.
5640
5641 2011-12-28 Kenichi Handa <handa@m17n.org>
5642
5643 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
5644 coding-system ASCII compatible only when it does not produce BOM
5645 on encoding (Bug#10383).
5646
5647 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
5648
5649 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
5650 can scroll.
5651 (create_and_show_popup_menu): Always use menu_position_func for
5652 Gtk3 (Bug#10361).
5653
5654 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
5655
5656 * callint.c (Fcall_interactively): Don't truncate prompt string.
5657
5658 2011-12-23 Eli Zaretskii <eliz@gnu.org>
5659
5660 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
5661 property that ends at ZV, so that the bidi iteration could be
5662 resumed from there (after widening). (Bug#10360)
5663
5664 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
5665
5666 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
5667
5668 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
5669
5670 * nsterm.m (x_free_frame_resources):
5671 Release f->output_data.ns->miniimage.
5672 (ns_index_color): Fix indentation. Do not retain
5673 color_table->colors[i].
5674
5675 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
5676 before returning.
5677
5678 * nsfns.m (x_set_background_color): Assign return value from
5679 ns_index_color to face-background instead of NSColor*.
5680 (ns_implicitly_set_icon_type): Fix indentation.
5681 Change assignment in for loop to comparison.
5682
5683 * emacs.c (ns_pool): New variable.
5684 (main): Assign ns_pool.
5685 (Fkill_emacs): Call ns_release_autorelease_pool.
5686
5687 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
5688 autorelease fdesc, release fdAttrs and tdict.
5689 (ns_get_covering_families): Release charset.
5690 (ns_findfonts): Release NSFontDescriptor created with new.
5691 (ns_uni_to_glyphs): Fix indentation.
5692 (setString): Release attrStr before assigning new value.
5693
5694 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5695
5696 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
5697 and NS_IMPL_COCOA.
5698 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
5699 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
5700
5701 2011-12-18 David Reitter <reitter@cmu.edu>
5702
5703 * nsterm.m (ns_term_init): Subscribe for notifications
5704 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
5705 to method trackingNotification in EmacsMenu.
5706
5707 * nsmenu.m (trackingMenu): New variable.
5708 (trackingNotification): New method (from Aquamacs).
5709 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
5710 from Aquamacs (Bug#7030).
5711
5712 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5713
5714 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
5715 (symbol_to_nsstring): Fix indentation.
5716 (ns_symbol_to_pb): New function.
5717 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
5718 (Fns_rotate_cut_buffers_internal): Remove.
5719 (Fns_store_selection_internal): Rename from
5720 Fns_store_cut_buffer_internal.
5721 (ns_get_foreign_selection, Fx_own_selection_internal)
5722 (Fx_disown_selection_internal, Fx_selection_exists_p)
5723 (Fns_get_selection_internal, Fns_store_selection_internal):
5724 Use ns_symbol_to_pb and check if return value is nil.
5725 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
5726 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
5727 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
5728 renamed to Sns_store_selection_internal.
5729 (ns_handle_selection_request): Move code to Fx_own_selection_internal
5730 and remove this function.
5731 (ns_handle_selection_clear): Remove, never used.
5732 (Fx_own_selection_internal): Move code from ns_handle_selection_request
5733 here.
5734
5735 2011-12-17 Ken Brown <kbrown@cornell.edu>
5736
5737 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
5738 GID is unknown (Bug#10257).
5739
5740 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
5741
5742 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
5743 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
5744 which caused a build failure on GNU/Linux IA-64. This problem was
5745 introduced by my 2011-10-07 patch.
5746
5747 2011-12-15 Juri Linkov <juri@jurta.org>
5748
5749 * image.c (imagemagick_error): New function. (Bug#10112)
5750 (imagemagick_load_image): Comment out `MagickSetResolution' call.
5751 Use `imagemagick_error' where ImageMagick functions return
5752 `MagickFalse'.
5753 (Fimagemagick_types): Add `Fnreverse' to return the list in the
5754 proper order.
5755
5756 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5757
5758 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
5759 fill background (Bug#8992).
5760
5761 2011-12-13 Martin Rudalics <rudalics@gmx.at>
5762
5763 * window.c (Vwindow_combination_resize)
5764 (Vwindow_combination_limit): Use t instead of non-nil in
5765 doc-strings.
5766 (Vrecenter_redisplay): Add first sentence of doc-string on
5767 separate line.
5768 (Frecenter): Fix doc-string typo.
5769
5770 2011-12-11 Kenichi Handa <handa@m17n.org>
5771
5772 * coding.c (Funencodable_char_position): Pay attention to the
5773 buffer text relocation (Bug#9389).
5774
5775 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
5776
5777 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
5778 gtk_init (Bug#10100).
5779
5780 2011-12-10 Eli Zaretskii <eliz@gnu.org>
5781
5782 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
5783 IT->string is nil. (Bug#10263)
5784
5785 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
5786
5787 * nsterm.h (x_free_frame_resources): Declare.
5788
5789 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
5790 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
5791
5792 * nsterm.h (ns_get_defaults_value): Declare.
5793
5794 * nsterm.m (ns_default): Call ns_get_defaults_value.
5795
5796 2011-12-09 Eli Zaretskii <eliz@gnu.org>
5797
5798 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
5799 (Bug#10170)
5800
5801 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5802
5803 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
5804 that where the value of an _OBJC_* symbol points to is in the .bss
5805 section (Bug#10240).
5806
5807 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
5808
5809 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
5810 after the loop to call ccl_driver at least once (Bug#8619).
5811
5812 2011-12-08 Kenichi Handa <handa@m17n.org>
5813
5814 * ftfont.c (get_adstyle_property): Fix previous change
5815 (Bug#10233).
5816
5817 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
5818
5819 * w32.c (init_environment): If no_site_lisp, remove site-lisp
5820 dirs from the default value of EMACSLOADPATH (bug#10208).
5821
5822 2011-12-07 Glenn Morris <rgm@gnu.org>
5823
5824 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
5825 installation and source directories as well. (Bug#10208)
5826
5827 2011-12-06 Chong Yidong <cyd@gnu.org>
5828
5829 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
5830
5831 2011-12-06 Glenn Morris <rgm@gnu.org>
5832
5833 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
5834 as an error, not just -1. (Bug#10217)
5835
5836 2011-12-05 Chong Yidong <cyd@gnu.org>
5837
5838 * keyboard.c (process_special_events): New function.
5839 (swallow_events, Finput_pending_p): Use it (Bug#10195).
5840
5841 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
5842
5843 * coding.c (encode_designation_at_bol): Don't use uninitialized
5844 local variable (Bug#9318).
5845
5846 2011-12-05 Kenichi Handa <handa@m17n.org>
5847
5848 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
5849 return Qnil (Bug#8046, Bug#10193).
5850
5851 2011-12-05 Kenichi Handa <handa@m17n.org>
5852
5853 * coding.c (encode_designation_at_bol): New args charbuf_end and
5854 dst. Return the number of produced bytes. Callers changed.
5855 (coding_set_source): Return how many bytes coding->source was
5856 relocated.
5857 (coding_set_destination): Return how many bytes
5858 coding->destination was relocated.
5859 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
5860 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5861
5862 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
5863
5864 * coding.c (CODING_CHAR_CHARSET_P): New macro.
5865 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
5866 macro (Bug#9318).
5867
5868 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
5869
5870 The following changes are to fix Bug#9318.
5871
5872 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5873 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
5874 (encode_coding_iso_2022, encode_coding_sjis)
5875 (encode_coding_big5, encode_coding_charset): Use the above macros.
5876
5877 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
5878
5879 * lisp.h (process_quit_flag): Fix external declaration.
5880
5881 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
5882
5883 Don't macro-inline non-performance-critical code.
5884 * eval.c (process_quit_flag): New function.
5885 * lisp.h (QUIT): Use it.
5886
5887 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
5888
5889 * nsfns.m (get_geometry_from_preferences): New function.
5890 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
5891
5892 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
5893
5894 * emacs.c (Qkill_emacs): Define.
5895 (syms_of_emacs): Initialize it.
5896 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
5897 Qquit_flag to `kill-emacs' instead.
5898 (quit_throw_to_read_char): Add parameter `from_signal'.
5899 All callers changed. Call Fkill_emacs if requested and safe.
5900 * lisp.h (QUIT): Call Fkill_emacs if requested.
5901
5902 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
5903
5904 * widget.c (update_wm_hints): Return if wmshell is null.
5905 (widget_update_wm_size_hints): New function.
5906
5907 * widget.h (widget_update_wm_size_hints): Declare.
5908
5909 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
5910 widget_update_wm_size_hints (Bug#10104).
5911
5912 2011-12-03 Eli Zaretskii <eliz@gnu.org>
5913
5914 * xdisp.c (handle_invisible_prop): If the invisible text ends just
5915 before a newline, prepare the bidi iterator for consuming the
5916 newline, and keep the current paragraph direction. (Bug#10183)
5917 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
5918
5919 2011-12-02 Juri Linkov <juri@jurta.org>
5920
5921 * search.c (Fword_search_regexp): New Lisp function created from
5922 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
5923 (Fword_search_backward, Fword_search_forward)
5924 (Fword_search_backward_lax, Fword_search_forward_lax):
5925 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
5926 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
5927
5928 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
5929
5930 * fileio.c (Finsert_file_contents): Move after-change-function call
5931 to before the "handled:" label, since all "goto handled" appear in
5932 cases where the *-change-functions have already been properly called
5933 (bug#10117).
5934
5935 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
5936
5937 * keyboard.c (interrupt_signal): Don't call kill-emacs when
5938 waiting for input. (Bug#10169)
5939
5940 2011-11-30 Eli Zaretskii <eliz@gnu.org>
5941
5942 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
5943 verifies glyph row's hash code--we have just reallocated the
5944 glyphs, so their contents can be complete garbage. (Bug#10164)
5945
5946 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
5947
5948 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
5949
5950 2011-11-30 Eli Zaretskii <eliz@gnu.org>
5951
5952 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
5953 attributes are tested _before_ calling verify_row_hash, to protect
5954 against GCC re-ordering of the tests. (Bug#10164)
5955
5956 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
5957
5958 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
5959
5960 * xterm.c (handle_one_xevent): Only set async_visible and friends
5961 if net_wm_state_hidden_seen is non-zero (Bug#10002)
5962 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
5963 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
5964
5965 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
5966
5967 Remove GCPRO-related macros that exist only to avoid shadowing locals.
5968 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
5969 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
5970 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
5971 All uses changed to use GCPRO1 etc.
5972 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
5973 Revert to old implementation (i.e., before 2011-03-11).
5974
5975 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5976
5977 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
5978 of scroll runs so as to avoid assigning disabled bogus rows and
5979 unnecessary graphics copy operations.
5980
5981 2011-11-27 Eli Zaretskii <eliz@gnu.org>
5982
5983 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
5984 (snprintf) [_MSC_VER]: Redirect to _snprintf.
5985 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
5986 (malloc, free, realloc, calloc): Redirect to e_* only when
5987 compiling Emacs.
5988
5989 * lisp.h (GCTYPEBITS): Move before first use.
5990 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
5991 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
5992 this macro definition.
5993
5994 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
5995 _MSC_VER.
5996
5997 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
5998
5999 * gtkutil.c (xg_create_frame_widgets):
6000 Call gtk_window_set_has_resize_grip (FALSE) if that function is
6001 present with Gtk+ 2.0.
6002
6003 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
6004
6005 * fileio.c (Finsert_file_contents): Undo previous change; see
6006 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
6007
6008 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
6009
6010 Rename locals to avoid shadowing.
6011 * fileio.c (Finsert_file_contents):
6012 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
6013 * process.c (wait_reading_process_output):
6014 Rename inner 'proc' to 'p' to avoid shadowing.
6015 Indent for consistency with usual Emacs style.
6016
6017 2011-11-25 Eli Zaretskii <eliz@gnu.org>
6018
6019 * xdisp.c (redisplay_window): If cursor row is not fully visible
6020 after recentering, and scroll-conservatively is set to a large
6021 number, scroll window by a few more lines to make the cursor fully
6022 visible and out of scroll-margin. (Bug#10105)
6023 (start_display): Don't move to the next line if the display should
6024 start at a newline that is part of a display vector or an overlay
6025 string. (Bug#10119)
6026
6027 2011-11-24 Juri Linkov <juri@jurta.org>
6028
6029 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
6030 after the `MagickPingImage' call. (Bug#10112)
6031
6032 2011-11-23 Chong Yidong <cyd@gnu.org>
6033
6034 * window.c (Fcoordinates_in_window_p): Accept only live windows.
6035
6036 2011-11-23 Martin Rudalics <rudalics@gmx.at>
6037
6038 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
6039 making another buffer current. (Bug#10114)
6040
6041 2011-11-23 Glenn Morris <rgm@gnu.org>
6042
6043 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
6044
6045 2011-11-23 Chong Yidong <cyd@gnu.org>
6046
6047 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
6048 using it (Bug#5984).
6049
6050 2011-11-22 Eli Zaretskii <eliz@gnu.org>
6051
6052 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
6053 and header-lines, as they don't have one computed for them.
6054 (Bug#10098)
6055
6056 * .gdbinit (prow): Make displayed values more self-explaining.
6057 Add row's hash code.
6058
6059 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
6060
6061 * process.c (wait_reading_process_output): Fix asynchrounous
6062 GnuTLS socket handling on some versions of the GnuTLS library.
6063 (wait_reading_process_output): Add comment and URL.
6064
6065 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
6066
6067 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
6068
6069 2011-11-21 Chong Yidong <cyd@gnu.org>
6070
6071 * window.c (Fnext_window, Fprevious_window): Doc fix.
6072
6073 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
6074
6075 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
6076
6077 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
6078
6079 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
6080
6081 2011-11-20 Martin Rudalics <rudalics@gmx.at>
6082
6083 * window.c (Fset_window_combination_limit): Rename argument
6084 STATUS to LIMIT.
6085 (Vwindow_combination_limit): Remove "status" from doc-string.
6086
6087 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
6088
6089 * m/ibms390.h: Remove.
6090 * m/ibms390x.h: Don't include "ibms390.h".
6091
6092 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
6093
6094 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
6095 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
6096
6097 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
6098
6099 * casetab.c (Fset_case_table):
6100 * charset.c (Fcharset_after): Fix typos.
6101
6102 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6103
6104 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
6105 Otherwise, valgrind does not work on some platforms.
6106 Problem reported by Andreas Schwab in
6107 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
6108 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
6109 is set, removing the need for VIRT_ADDRESS_VARIES.
6110 (PURE_P): Use a more-efficient implementation that needs just one
6111 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
6112 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
6113 to 4 (xorl, subq, cmpq, setbe).
6114 * alloc.c (pure): Always extern now, since that's the
6115 VIRT_ADDR_VARIES behavior.
6116 (PURE_POINTER_P): Use a single comparison, not two, for
6117 consistency with the new puresize.h.
6118 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
6119 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
6120 Remove VIRT_ADDR_VARIES no longer needed.
6121
6122 2011-11-19 Eli Zaretskii <eliz@gnu.org>
6123
6124 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
6125 (erase_phys_cursor, update_window_cursor, show_mouse_face)
6126 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
6127 behave as if the cursor position were at the window margin.
6128
6129 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
6130 and the cursor position is out of bounds, behave as if the cursor
6131 position were at the window margin. (Bug#10075)
6132
6133 2011-11-18 Chong Yidong <cyd@gnu.org>
6134
6135 * window.c (Fwindow_combination_limit): Make first argument
6136 non-optional, since it is meaningless for live windows like the
6137 selected window.
6138
6139 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
6140
6141 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
6142
6143 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
6144
6145 * intervals.c: Fix grafting over the whole buffer (bug#10071).
6146 (graft_intervals_into_buffer): Simplify.
6147
6148 2011-11-18 Eli Zaretskii <eliz@gnu.org>
6149
6150 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
6151 hash values of the two rows.
6152 (copy_row_except_pointers): Preserve the used[] arrays and the
6153 hash values of the two rows. (Bug#10035)
6154 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
6155
6156 * xdisp.c (row_hash): New function, body extracted from
6157 compute_line_metrics.
6158 (compute_line_metrics): Call row_hash, instead of computing the
6159 hash code inline.
6160
6161 * dispnew.c (verify_row_hash): Call row_hash for computing the
6162 hash code of a row, instead of duplicating code from xdisp.c.
6163
6164 * dispextern.h (row_hash): Add prototype.
6165
6166 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
6167
6168 * frame.c (delete_frame): Don't delete the terminal when the last
6169 X frame is closed if emacs is built with GTK toolkit.
6170
6171 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
6172
6173 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
6174
6175 2011-11-17 Martin Rudalics <rudalics@gmx.at>
6176
6177 * window.c (Vwindow_splits): Rename to
6178 Vwindow_combination_resize. Suggested by Juri Linkov.
6179 (Fsplit_window_internal): Use Vwindow_combination_resize instead
6180 of Vwindow_splits.
6181
6182 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
6183
6184 * nsfns.m (Fns_font_name):
6185 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
6186
6187 2011-11-16 Martin Rudalics <rudalics@gmx.at>
6188
6189 * window.h (window): Rename slot "nest" to "combination_limit".
6190 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
6191 (Fset_window_nest): Rename to Fset_window_combination_limit.
6192 (Vwindow_nest): Rename to Vwindow_combination_limit.
6193 (recombine_windows, make_parent_window, make_window)
6194 (Fsplit_window_internal, saved_window)
6195 (Fset_window_configuration, save_window_save): Rename all
6196 occurrences of window_nest to window_combination_limit.
6197
6198 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
6199
6200 * image.c (imagemagick_load_image): Fix typo.
6201
6202 2011-11-14 Eli Zaretskii <eliz@gnu.org>
6203
6204 * xdisp.c (display_line): Move the call to
6205 highlight_trailing_whitespace before the call to
6206 compute_line_metrics, since the latter needs to see the final
6207 faces of all the glyphs to compute ROW's hash value.
6208 Fixes assertion violations in row_equal_p. (Bug#10035)
6209
6210 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
6211
6212 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
6213 just return (bug#10044).
6214
6215 2011-11-12 Eli Zaretskii <eliz@gnu.org>
6216
6217 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
6218 with user-defined heap size. Bump the default size of the temacs
6219 heap to 27MB, to avoid memory warning when running temacs.
6220 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
6221
6222 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
6223 current_matrix and desired_matrix. (Bug#9990)
6224 (verify_row_hash) [XASSERTS]: New function.
6225 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
6226 that the hash value of glyph rows is correct.
6227
6228 2011-11-12 Martin Rudalics <rudalics@gmx.at>
6229
6230 * window.h (window): Remove splits slot.
6231 * window.c (Fwindow_splits, Fset_window_splits): Remove.
6232 (Fdelete_other_windows_internal, make_parent_window)
6233 (make_window, Fsplit_window_internal, Fdelete_window_internal)
6234 (Fset_window_configuration, save_window_save): Don't deal with
6235 split status of windows.
6236 (saved_window): Remove splits slot.
6237 (Vwindow_splits): Rewrite doc-string.
6238
6239 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
6240
6241 * xfns.c (unwind_create_frame):
6242 * nsfns.m (unwind_create_frame):
6243 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
6244 Vframe_list (Bug#9999).
6245
6246 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
6247
6248 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
6249
6250 2011-11-11 Kenichi Handa <handa@m17n.org>
6251
6252 * callproc.c (Fcall_process): Set the member dst_multibyte of
6253 process_coding.
6254
6255 2011-11-11 Johan Bockgård <bojohan@gnu.org>
6256
6257 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
6258 avoid a crash (bug#9496).
6259
6260 2011-11-09 Chong Yidong <cyd@gnu.org>
6261
6262 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
6263 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
6264
6265 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
6266
6267 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
6268
6269 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
6270
6271 Avoid some portability problems by eschewing 'extern inline' functions.
6272 The trivial performance wins aren't worth the portability hassles; see
6273 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
6274 et seq.
6275 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
6276 (window_box_width, window_box_left, window_box_left_offset)
6277 (window_box_right, window_box_right_offset): Undo previous change,
6278 by removing the "extern"s.
6279 * intervals.c (adjust_intervals_for_insertion)
6280 (adjust_intervals_for_deletion): Undo previous change,
6281 making these static again.
6282 (offset_intervals, temp_set_point_both, temp_set_point)
6283 (copy_intervals_to_string): No longer inline.
6284 * xdisp.c (window_text_bottom_y, window_box_width)
6285 (window_box_height, window_box_left_offset)
6286 (window_box_right_offset, window_box_left, window_box_right)
6287 (window_box): No longer inline.
6288
6289 2011-11-08 Chong Yidong <cyd@gnu.org>
6290
6291 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6292 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
6293 Signal an error if not a live window.
6294 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
6295 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
6296
6297 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
6298
6299 * lisp.h (syms_of_abbrev): Remove declaration.
6300 Reported by CHENG Gao <chenggao@royau.me>.
6301
6302 2011-11-07 Eli Zaretskii <eliz@gnu.org>
6303
6304 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
6305 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
6306 of temacs in GUI mode.
6307
6308 2011-11-07 Martin Rudalics <rudalics@gmx.at>
6309
6310 * window.h: Declare delete_all_child_windows instead of
6311 delete_all_subwindows.
6312 * window.c (Fwindow_nest, Fset_window_nest)
6313 (Fset_window_new_total, Fset_window_new_normal)
6314 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
6315 (delete_all_subwindows): Rename to delete_all_child_windows.
6316 (Fdelete_other_windows_internal, Fset_window_configuration):
6317 Call delete_all_child_windows instead of delete_all_subwindows.
6318 * frame.c (delete_frame): Call delete_all_child_windows instead
6319 of delete_all_subwindows.
6320
6321 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
6322
6323 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
6324 This is also needed for porting to any host where GC_MARK_STACK is
6325 not GC_MAKE_GCPROS_NOOPS.
6326 (which_symbols): Use it.
6327
6328 2011-11-07 Kenichi Handa <handa@m17n.org>
6329
6330 * coding.c (coding_set_destination): Check coding->src_pos only
6331 when coding->src_object is a buffer (bug#9910).
6332
6333 * process.c (send_process): Set the member src_multibyte of coding
6334 to 0 (bug#9911) when sending a unibyte text.
6335
6336 * callproc.c (Fcall_process): Set the member src_multibyte of
6337 process_coding to 0 (bug#9912).
6338
6339 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6340
6341 * xmenu.c (cleanup_widget_value_tree): New function.
6342 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
6343 calling free_menubar_widget_value_tree directly (Bug#9830).
6344
6345 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
6346
6347 Fix some portability problems with 'inline'.
6348 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
6349 (window_box_width, window_box_left, window_box_left_offset)
6350 (window_box_right, window_box_right_offset): Declare extern.
6351 Otherwise, these inline functions do not conform to C99 and
6352 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
6353 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
6354 * intervals.c (adjust_intervals_for_insertion)
6355 (adjust_intervals_for_deletion): Now extern, because otherwise the
6356 extern inline functions 'offset_intervals' couldn't refer to it.
6357 (static_offset_intervals): Remove.
6358 (offset_intervals): Rewrite using the old contents of
6359 static_offset_intervals. The old version didn't conform to C99
6360 because an extern inline function contained a reference to an
6361 identifier with static linkage.
6362
6363 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
6364
6365 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
6366 GC.
6367
6368 2011-11-06 Eli Zaretskii <eliz@gnu.org>
6369
6370 * xdisp.c (init_iterator, reseat_to_string): Don't set the
6371 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
6372 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
6373 return Qleft_to_right.
6374
6375 2011-11-06 Chong Yidong <cyd@gnu.org>
6376
6377 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
6378 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
6379 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
6380 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
6381 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
6382 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
6383 (Fwindow_vscroll): Doc fix.
6384 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
6385 argument, since it makes no sense to pass a live window and for
6386 consistency with window-child.
6387
6388 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
6389
6390 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
6391 support MSVC.
6392
6393 2011-11-05 Jason Rumney <jasonr@gnu.org>
6394
6395 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
6396 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
6397 fonts (Bug#6029).
6398 (add_font_entity_to_list): Fix logic errors in mixed boolean and
6399 bitwise arithmetic preventing use of unicode-sip and non-truetype
6400 opentype fonts.
6401
6402 2011-11-05 Eli Zaretskii <eliz@gnu.org>
6403
6404 * s/ms-w32.h (fstat, stat, utime): Move redirections to
6405 "emacs"-only part.
6406
6407 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
6408 initialization code to keep similarity to xfns.c after changes
6409 from 2011-11-05.
6410
6411 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
6412
6413 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
6414 (unwind_create_frame): New function (Bug#9943).
6415 (Fx_create_frame): Restructure code to be more similar to the one in
6416 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
6417 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
6418 Move terminal->reference_count++ just before making the frame official
6419 (Bug#9943).
6420
6421 * nsterm.m (x_free_frame_resources): New function.
6422 (x_destroy_window): Move code to x_free_frame_resources.
6423
6424 * xfns.c (unwind_create_frame): Fix comment.
6425 (Fx_create_frame, x_create_tip_frame):
6426 Move terminal->reference_count++ just before making the frame
6427 official. Move initialization of image_cache_refcount and
6428 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
6429
6430 2011-11-05 Eli Zaretskii <eliz@gnu.org>
6431
6432 Support MSVC build with newer versions of Visual Studio.
6433 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
6434 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
6435 nt/gmake.defs.
6436
6437 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
6438 which are not supported by MSVC.
6439 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
6440 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
6441 bitfields.
6442 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
6443 types in bitfields.
6444 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
6445
6446 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
6447
6448 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
6449
6450 Support MSVC build with newer versions of Visual Studio.
6451 * w32.c: Don't include w32api.h for MSVC.
6452 (init_environment) [_MSC_VER]: Call sys_access, not _access.
6453
6454 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
6455 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
6456 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
6457 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
6458 e_* cousins.
6459 (alloca) [_MSC_VER]: Define to _alloca.
6460
6461 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
6462
6463 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
6464
6465 2011-11-04 Eli Zaretskii <eliz@gnu.org>
6466
6467 * xdisp.c (note_mouse_highlight): If either of
6468 previous/next-single-property-change returns nil, treat that as
6469 the beginning or the end of the buffer. (Bug#9955)
6470
6471 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
6472
6473 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
6474 label is not null (Bug#9951).
6475 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
6476 may be NULL.
6477
6478 2011-11-04 Eli Zaretskii <eliz@gnu.org>
6479
6480 * window.c (Fwindow_body_size): Mention in the doc string that the
6481 return value is in frame's canonical units. (Bug#9949)
6482
6483 2011-11-03 Eli Zaretskii <eliz@gnu.org>
6484
6485 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
6486
6487 * w32fns.c (unwind_create_frame): If needed, free the glyph
6488 matrices of the partially constructed frame. (Bug#9943)
6489 * xfns.c (unwind_create_frame): Likewise.
6490
6491 2011-11-01 Eli Zaretskii <eliz@gnu.org>
6492
6493 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
6494 Don't stop backward scan on the continuation glyph, even though
6495 its CHARPOS is positive.
6496 (mouse_face_from_buffer_pos, note_mouse_highlight):
6497 Rename cover_string to disp_string.
6498
6499 2011-11-01 Martin Rudalics <rudalics@gmx.at>
6500
6501 * window.c (temp_output_buffer_show): Don't use
6502 Vtemp_buffer_show_specifiers.
6503 (Vtemp_buffer_show_specifiers): Remove unused variable.
6504
6505 2011-10-30 Eli Zaretskii <eliz@gnu.org>
6506
6507 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
6508 past the beginning of the current glyph matrix.
6509
6510 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6511
6512 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
6513 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
6514 HAVE_GTK3 (Bug#9869).
6515
6516 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
6517 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
6518
6519 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
6520
6521 * xterm.c: Declare x_handle_net_wm_state to return int.
6522 (handle_one_xevent): Check if we are iconified but don't have
6523 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
6524 (get_current_wm_state): Return non-zero if not hidden,
6525 check for _NET_WM_STATE_HIDDEN (Bug#9893).
6526 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
6527 (x_handle_net_wm_state): Return what get_current_wm_state returns.
6528 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
6529
6530 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
6531
6532 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
6533 so that this new function doesn't get optimized away by a
6534 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
6535
6536 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
6537
6538 * frame.h (MOUSE_HL_INFO): Remove excess parens.
6539
6540 2011-10-29 Eli Zaretskii <eliz@gnu.org>
6541
6542 Fix the `xbytecode' command.
6543 * .gdbinit (xprintbytestr): New command.
6544 (xwhichsymbols): Rename from `which'; all callers changed.
6545 (xbytecode): Print the byte-code string as well.
6546
6547 2011-10-29 Kim Storm <storm@cua.dk>
6548
6549 * alloc.c (which_symbols): New function.
6550
6551 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
6552
6553 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
6554 line. (Bug#9903)
6555
6556 2011-10-29 Glenn Morris <rgm@gnu.org>
6557
6558 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
6559 Not clear what it was for, and it causes various bugs. (Bug#9839)
6560
6561 2011-10-28 Eli Zaretskii <eliz@gnu.org>
6562
6563 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
6564 possible random value that matches one of those tested as
6565 condition to clear the mouse face.
6566
6567 2011-10-28 Chong Yidong <cyd@gnu.org>
6568
6569 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
6570
6571 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
6572
6573 * window.c (make_window): Initialize phys_cursor_on_p.
6574
6575 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
6576
6577 * lisp.h (struct Lisp_Symbol): Update comments.
6578
6579 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
6580
6581 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
6582
6583 2011-10-28 Eli Zaretskii <eliz@gnu.org>
6584
6585 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
6586 <oslsachem@gmail.com> for helping to debug this.
6587
6588 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
6589 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
6590 (g_b_init_get_glyph_outline_w): New static variables.
6591 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
6592 (GetGlyphOutlineW_Proc): New typedefs.
6593 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
6594 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
6595 New functions.
6596 (w32font_open_internal, compute_metrics):
6597 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
6598 instead of calling the "wide" APIs directly.
6599
6600 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
6601
6602 * w32.h (syms_of_w32font): Add prototype.
6603
6604 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
6605
6606 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
6607 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
6608 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
6609 (Fmove_to_window_line): Doc fix.
6610
6611 2011-10-27 Chong Yidong <cyd@gnu.org>
6612
6613 * process.c (make_process): Set gnutls_state to NULL.
6614
6615 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
6616 non-NULL, regardless of GNUTLS_INITSTAGE.
6617 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
6618 an error. Set process slots as soon as we allocate them.
6619
6620 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
6621
6622 2011-10-27 Chong Yidong <cyd@gnu.org>
6623
6624 * gnutls.c (emacs_gnutls_deinit): New function.
6625 Deallocate credentials structures as well as calling gnutls_deinit.
6626 (Fgnutls_deinit, Fgnutls_boot): Use it.
6627
6628 * process.c (make_process): Initialize GnuTLS credentials to NULL.
6629 (deactivate_process): Call emacs_gnutls_deinit.
6630
6631 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
6632
6633 * image.c (x_create_x_image_and_pixmap):
6634 * w32.c (sys_rename, w32_delayed_load):
6635 * w32font.c (fill_in_logfont):
6636 * w32reg.c (x_get_string_resource): Silence compiler warnings.
6637
6638 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
6639
6640 * w32fns.c (w32_default_color_map): New function,
6641 extracted from Fw32_default_color_map.
6642 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
6643
6644 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
6645
6646 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
6647
6648 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
6649
6650 * keyboard.c (test_undefined): New function (bug#9751).
6651 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
6652
6653 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
6654
6655 * sysdep.c (init_sys_modes): Fix the check for the controlling
6656 terminal (Bug#6649).
6657
6658 2011-10-20 Eli Zaretskii <eliz@gnu.org>
6659
6660 * dispextern.h (struct bidi_it): New member next_en_type.
6661
6662 * bidi.c (bidi_line_init): Initialize the next_en_type member.
6663 (bidi_resolve_explicit_1): When next_en_pos is valid for the
6664 current character, check also for next_en_type being WEAK_EN.
6665 (bidi_resolve_weak): Don't enter the expensive loop if the current
6666 position is before next_en_pos. Record the bidi type of the first
6667 non-ET, non-BN character we find, in addition to its position.
6668 (bidi_level_of_next_char): Invalidate next_en_type when
6669 next_en_pos is over-stepped.
6670
6671 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
6672
6673 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
6674 * editfns.c: Rewrite current-time-zone so that it invokes
6675 the equivalent of (format-time-string "%Z") to get the time zone name.
6676 This fixes a bug when the time zone name contains characters that
6677 need converting from the system time locale to Emacs internal format.
6678 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
6679 that patch fixed format-time-string to do the conversion, but
6680 I forgot to fix current-time-zone.
6681 (format_time_string): New function, containing most of
6682 what Fformat_time_string used to contain.
6683 (Fformat_time_string): Rewrite in terms of format_time_string.
6684 This doesn't change this function's behavior.
6685 (current-time-zone): Rewrite to use format_time_string.
6686 This fixes the bug reported by Michael Schierl in
6687 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
6688 Jason Rumney's 2007-06-07 change worked around this bug, but
6689 didn't fix it.
6690 * systime.h (tzname, timezone): Remove no-longer-used declarations.
6691
6692 2011-10-19 Eli Zaretskii <eliz@gnu.org>
6693
6694 * xdisp.c (start_display): If the character at POS is displayed
6695 via a display vector, reset IT->current.dpvec_index to zero.
6696 (try_window_reusing_current_matrix): If a line ends in a display
6697 vector or the next line starts in a display vector, continue
6698 redrawing the window even though the character position of
6699 start_row was reached.
6700 (Bug#9771, part 2)
6701
6702 2011-10-18 Chong Yidong <cyd@gnu.org>
6703
6704 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
6705 with nobreak-char-display too.
6706
6707 2011-10-18 Eli Zaretskii <eliz@gnu.org>
6708
6709 Fix part 3 of bug#9771.
6710 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
6711 (bidi_resolve_neutral): Don't enter the expensive loop looking for
6712 non-neutral characters if the current character is a paragraph
6713 separator (a.k.a. Newline). This avoids running the same
6714 expensive loop twice, once when we consume the preceding newline
6715 and the other time when the line actually needs to be displayed.
6716 Avoid the loop when we see neutrals on the base embedding level
6717 following a character whose directionality is the same as the
6718 paragraph's. This avoids running the expensive loop when a line
6719 ends in a long sequence of neutrals, like control characters.
6720 Add assertion against STRONG_AL type. Slightly rearrange code
6721 that determines the type of a neutral given the first non-neutral
6722 that follows it.
6723 (bidi_level_of_next_char): Set next_en_pos to zero when
6724 invalidating its info.
6725
6726 2011-10-17 Eli Zaretskii <eliz@gnu.org>
6727
6728 * xdisp.c (push_display_prop): Determine whether to record string
6729 or buffer position by IT->string, not by IT->method. Allow
6730 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
6731 (move_it_vertically_backward): Don't look for character position
6732 immediately after the newline when in a continuation line.
6733 (Bug#9771, part 1)
6734
6735 2011-10-15 Martin Rudalics <rudalics@gmx.at>
6736
6737 * window.c (coordinates_in_window): Rewrite and delabelize
6738 vertical border check. (Bug#5357) (Bug#9618)
6739
6740 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
6741
6742 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
6743 errors in XSetWindowBorder (bug#9310).
6744
6745 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
6746
6747 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
6748 avoid crash when xmalloc overrun checking is enabled.
6749
6750 2011-10-13 Eli Zaretskii <eliz@gnu.org>
6751
6752 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
6753 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
6754 cursor motion with <left> and <right> arrow keys.
6755
6756 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
6757 some callers set that themselves.
6758
6759 2011-10-12 Eli Zaretskii <eliz@gnu.org>
6760
6761 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
6762 display string and the previous row comes from the same string and
6763 is empty. (Bug#9739) (Bug#9738)
6764
6765 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
6766
6767 * doc.c (get_doc_string): Encode file name (bug#9735).
6768
6769 2011-10-12 Eli Zaretskii <eliz@gnu.org>
6770
6771 * bidi.c (bidi_level_of_next_char):
6772 * xdisp.c (get_visually_first_element): Remove old incorrect
6773 comments regarding the Unicode Line Separator character.
6774
6775 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
6776
6777 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
6778
6779 * alloc.c (Fgc_status): Do not access beyond zombies array
6780 boundary if nzombies > MAX_ZOMBIES.
6781 * alloc.c (dump_zombies): Add missing format specifier.
6782
6783 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
6784
6785 * xdisp.c (set_cursor_from_row): Simplify conditionals,
6786 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
6787
6788 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
6789 Some packages use them to denote characters with modifiers.
6790
6791 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
6792
6793 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
6794 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
6795 matching a pp-number. Rename parameter var to var1.
6796
6797 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
6798
6799 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
6800
6801 2011-10-08 Glenn Morris <rgm@gnu.org>
6802
6803 * callint.c (Fcall_interactively): Give a more explicit error for the
6804 'c' case with a non-character input. (Bug#8479)
6805
6806 2011-10-08 Eli Zaretskii <eliz@gnu.org>
6807
6808 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
6809 lines.
6810 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
6811 lines that are hscrolled on the left.
6812
6813 * dispnew.c (buffer_posn_from_coords): Account for a possible
6814 presence of header-line. (Bug#4426)
6815
6816 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
6817
6818 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
6819 Don't advertise functionality which we discourage or doesn't work.
6820
6821 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
6822
6823 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
6824 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
6825 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
6826 this makes Emacs dump core during garbage collection on rare
6827 occasions. sizeof is obviously inferior to offsetof here, so
6828 stick with offsetof.
6829 (GC_POINTER_ALIGNMENT): New macro.
6830 (mark_memory): Omit 3rd (offset) arg; caller changed.
6831 Don't assume EMACS_INT alignment is the same as pointer alignment.
6832
6833 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
6834
6835 * keyboard.c (read_key_sequence_remapped): New var.
6836 (read_key_sequence): Compute remapping in the right buffer.
6837 (command_loop_1): Use read_key_sequence's remapping directly.
6838
6839 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
6840
6841 * dired.c (file_name_completion): Don't expand file name.
6842 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
6843 before checking file name handler.
6844
6845 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
6846 they've been requested explicitly (bug#9591).
6847
6848 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
6849
6850 * keymap.c (Fsingle_key_description): Use make_specified_string
6851 instead of build_string to build string from push_key_description.
6852 (Bug#5193)
6853
6854 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
6855
6856 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
6857 This fixes a Y2038 bug on 64-bit hosts.
6858 * buffer.c (reset_buffer):
6859 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
6860 (Fclear_buffer_auto_save_failure):
6861 Use 0, not -1, to represent an unset failure time, since time_t
6862 might not be signed.
6863
6864 Remove dependency on glibc malloc internals.
6865 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
6866 Move back here from lisp.h, but with their new implementations.
6867 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
6868 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
6869 * charset.c (charset_table_init): New static var.
6870 (syms_of_charset): Use it instead of xmalloc. This removes a
6871 dependency on glibc malloc internals. See Eli Zaretskii's comment in
6872 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
6873 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
6874 Move back to alloc.c.
6875 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
6876 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
6877
6878 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
6879
6880 * nsterm.m (windowDidResize): Call x_set_window_size only when
6881 ns_in_resize is true. Otherwise set pixelwidth/height and
6882 call change_frame_size (Bug#9628).
6883
6884 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
6885
6886 Port --enable-checking=all to Fedora 14 x86-64.
6887 * charset.c (syms_of_charset): Also account for glibc malloc's
6888 internal overhead when calculating the initial malloc maximum.
6889
6890 Port --enable-checking=all to Fedora 14 x86.
6891 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
6892 Move to lisp.h.
6893 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
6894 (overrun_check_realloc, overrun_check_free):
6895 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
6896 That way, xmalloc returns a properly-aligned pointer even if
6897 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
6898 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
6899 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
6900 into account when calculating the initial malloc maximum.
6901 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
6902 Move here from alloc.c, so that charset.c can use it too.
6903 Properly align; the old code wasn't right for common 32-bit hosts
6904 when configured with --enable-checking=all.
6905 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
6906 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
6907
6908 2011-09-29 Eli Zaretskii <eliz@gnu.org>
6909
6910 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
6911 use EDOM.
6912
6913 2011-09-28 Eli Zaretskii <eliz@gnu.org>
6914
6915 * xdisp.c (compute_display_string_end): If there's no display
6916 string at CHARPOS, return -1.
6917
6918 * bidi.c (bidi_fetch_char): When compute_display_string_end
6919 returns a negative value, treat the character as a normal
6920 character not covered by a display string. (Bug#9624)
6921
6922 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
6923
6924 * lread.c (Fread_from_string): Fix typo in docstring.
6925
6926 2011-09-27 Eli Zaretskii <eliz@gnu.org>
6927
6928 * xdisp.c (handle_invisible_prop): If invisible text ends on a
6929 newline, reseat the iterator instead of bidi-iterating there one
6930 character at a time. (Bug#9610)
6931 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
6932 TO_CHARPOS if the bidi iterator is at base embedding level.
6933
6934 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
6935
6936 * lread.c (readevalloop): Use correct code for NBSP.
6937 (read1): Likewise. (Bug#9608)
6938
6939 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
6940
6941 * dbusbind.c (Fdbus_register_signal): When service is not
6942 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
6943
6944 2011-09-25 Glenn Morris <rgm@gnu.org>
6945
6946 * buffer.c (truncate-lines): Doc fix.
6947
6948 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
6949
6950 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
6951 (Fset_window_next_buffers): Doc fix.
6952
6953 2011-09-24 Glenn Morris <rgm@gnu.org>
6954
6955 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
6956
6957 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
6958
6959 Fix minor problems found by static checking.
6960 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
6961 * indent.c (Fvertical_motion): Fix == vs = typo.
6962
6963 2011-09-24 Eli Zaretskii <eliz@gnu.org>
6964
6965 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
6966 Default value is now t. Doc fix.
6967
6968 * indent.c (Fvertical_motion): Compute and apply the overshoot
6969 logic when moving up, not only when moving down. Fix the
6970 confusing name and values of the it_overshoot_expected variable;
6971 logic changes accordingly. (Bug#9254) (Bug#9549)
6972
6973 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
6974 CHARPOS is covered by a display string which includes newlines.
6975 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
6976 is covered by a display string with embedded newlines.
6977
6978 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
6979
6980 * dbusbind.c (Fdbus_register_signal): Add match rule to
6981 Vdbus_registered_objects_table. (Bug#9581)
6982 (Fdbus_register_method, Vdbus_registered_objects_table):
6983 Fix docstring.
6984
6985 2011-09-24 Jim Meyering <meyering@redhat.com>
6986
6987 do not ignore write error for any output size
6988 The previous change was incomplete.
6989 While it makes emacs --batch detect the vast majority of stdout
6990 write failures, errors were still ignored whenever the output size is
6991 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
6992 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
6993 && echo FAIL: ignored write error
6994 FAIL: ignored write error
6995 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
6996 && echo FAIL: ignored write error
6997 FAIL: ignored write error
6998 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
6999
7000 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
7001
7002 * emacs.c (Fkill_emacs): In noninteractive mode exit
7003 non-successfully if a write error occurred on stdout. (Bug#9574)
7004
7005 2011-09-21 Eli Zaretskii <eliz@gnu.org>
7006
7007 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
7008 the xassert test.
7009
7010 * dispextern.h (struct it): Update the comment documenting what
7011 can it->OBJECT be.
7012
7013 2011-09-20 Eli Zaretskii <eliz@gnu.org>
7014
7015 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
7016 a display string, extend search for cursor position to end of row.
7017 (find_row_edges): If the row ends in a newline from a display
7018 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
7019 Handle the case of a display string with multiple newlines.
7020 (Fcurrent_bidi_paragraph_direction): Fix search for previous
7021 non-empty line. Fixes confusing cursor motion with arrow keys at
7022 the beginning of a line that starts with whitespace.
7023
7024 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
7025
7026 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
7027 (bug#9493).
7028
7029 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
7030
7031 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
7032 boolean (Bug#9154).
7033
7034 2011-09-18 Eli Zaretskii <eliz@gnu.org>
7035
7036 * xdisp.c (display_line): Record maximum and minimum buffer
7037 positions even if no glyphs were produced (e.g., by a zero-width
7038 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
7039 buffer positions that will be removed from the glyph row because
7040 they don't fit.
7041 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
7042 column is beyond frame width: don't subtract 1 "pixel" when
7043 computing width of the stretch.
7044 (reseat_at_next_visible_line_start): Undo the change made on
7045 2011-09-17 that saved paragraph information and restored it after
7046 the call to `reseat'. (Bug#9545)
7047
7048 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7049
7050 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
7051 and turn window cursor on if cleared (Bug#9415).
7052
7053 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
7054
7055 * search.c (boyer_moore): Take unibyte characters from pattern
7056 literally. (Bug#9458)
7057
7058 2011-09-18 Eli Zaretskii <eliz@gnu.org>
7059
7060 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
7061
7062 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
7063
7064 Fix minor problem found by static checking.
7065 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
7066 initialized, to pacify gcc -Wuninitialized.
7067
7068 * fileio.c: Report proper errno when syscall falls.
7069 (Finsert_file_contents): Save and restore errno,
7070 so that report_file_error outputs the correct diagnostic.
7071 (Fwrite_region) [CLASH_DETECTION]: Likewise.
7072
7073 2011-09-18 Eli Zaretskii <eliz@gnu.org>
7074
7075 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
7076
7077 2011-09-17 Eli Zaretskii <eliz@gnu.org>
7078
7079 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
7080 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
7081
7082 2011-09-17 Eli Zaretskii <eliz@gnu.org>
7083
7084 * xdisp.c (reseat_at_next_visible_line_start): Keep information
7085 about the current paragraph and restore it after the call to reseat.
7086
7087 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
7088 (bidi_find_paragraph_start): Search back for paragraph beginning
7089 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
7090 (bidi_move_to_visually_next): Only trigger paragraph-related
7091 computations when the last character is a newline or at EOB, not
7092 just any NEUTRAL_B. (Bug#9470)
7093
7094 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
7095 truncated lines if point is covered by a display string. (Bug#9524)
7096
7097 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
7098
7099 * xselect.c: Relax test for outgoing X longs (Bug#9498).
7100 (cons_to_x_long): New function.
7101 (lisp_data_to_selection_data): Use it. Correct the test for
7102 short-versus-long data; it was negated. Break out of vector
7103 loop, for efficiency, when a long datum is discovered.
7104
7105 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
7106
7107 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
7108
7109 2011-09-16 Eli Zaretskii <eliz@gnu.org>
7110
7111 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
7112 GCC PR/17406) by declaring this function with external scope.
7113
7114 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
7115
7116 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
7117 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
7118
7119 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
7120
7121 * editfns.c (Fformat): Correctly handle text properties on "%%".
7122
7123 2011-09-15 Eli Zaretskii <eliz@gnu.org>
7124
7125 * xterm.c (x_draw_composite_glyph_string_foreground):
7126 * w32term.c (x_draw_composite_glyph_string_foreground):
7127 * term.c (encode_terminal_code):
7128 * composite.c (composition_update_it, get_composition_id):
7129 * xdisp.c (get_next_display_element)
7130 (fill_composite_glyph_string): Add comments about special meaning
7131 of TAB characters in a composition.
7132
7133 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
7134
7135 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
7136 This occurs when processing a multibyte format.
7137 Problem reported by Wolfgang Jenker.
7138
7139 2011-09-15 Johan Bockgård <bojohan@gnu.org>
7140
7141 * xdisp.c (try_cursor_movement): Only check for exact match if
7142 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
7143
7144 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
7145
7146 Remove unused external symbols.
7147 * dispextern.h (calc_pixel_width_or_height): Remove decl.
7148 * xdisp.c (calc_pixel_width_or_height): Now static.
7149 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
7150 * indent.c (check_display_width):
7151 * w32term.c: Fix comment to match code.
7152 * xterm.c, xterm.h (x_catching_errors): Remove.
7153
7154 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
7155
7156 * xselect.c: Use signed conversions more consistently (Bug#9498).
7157 (selection_data_to_lisp_data): Assume incoming selection data are
7158 signed integers, not unsigned. This is to be consistent with
7159 outgoing selection data, which was modified to use signed integers
7160 in as part of the fix to Bug#9196 in response to Jan D.'s comment
7161 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
7162 expects long, not unsigned long.
7163
7164 2011-09-14 Eli Zaretskii <eliz@gnu.org>
7165
7166 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
7167 computation of loop end. Reported by Johan Bockgård
7168 <bojohan@gnu.org>.
7169
7170 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
7171
7172 * frame.c (Fother_visible_frames_p): Function deleted.
7173
7174 2011-09-12 Eli Zaretskii <eliz@gnu.org>
7175
7176 * indent.c (compute_motion): Process display vector front to back
7177 rather than the other way around. (Bug#2496)
7178
7179 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
7180
7181 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
7182
7183 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
7184
7185 * minibuf.c (Fread_from_minibuffer): Doc fix.
7186
7187 2011-09-11 Eli Zaretskii <eliz@gnu.org>
7188
7189 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
7190 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
7191
7192 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
7193
7194 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
7195 value for non-existent files.
7196
7197 2011-09-11 Eli Zaretskii <eliz@gnu.org>
7198
7199 * fileio.c (Finsert_file_contents): If the file cannot be opened,
7200 set its "size" to -1. This will set the modtime_size field of
7201 the corresponding buffer to -1, which is what
7202 verify-visited-file-modtime expects for files that do not exist.
7203 (Bug#9139)
7204
7205 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
7206
7207 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
7208 here ...
7209 * lisp.h: ... from here. push_key_description is no longer
7210 defined in keyboard.c, so its declaration should not be in
7211 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
7212 logically belongs with push_key_description.
7213
7214 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
7215
7216 * buffer.h: Include <sys/types.h> instead of <time.h>.
7217 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
7218 Problem reported by Herbert J. Skuhra.
7219
7220 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
7221
7222 * xml.c (parse_region): Make the parsing work for
7223 non-comment-starting XML files again (bug#9144).
7224
7225 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
7226
7227 * image.c (gif_load): Fix calculation of bottom and right corner.
7228 (Bug#9468)
7229
7230 2011-09-10 Eli Zaretskii <eliz@gnu.org>
7231
7232 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
7233 redisplay in small windows.
7234
7235 2011-09-09 Eli Zaretskii <eliz@gnu.org>
7236
7237 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
7238
7239 2011-09-08 Martin Rudalics <rudalics@gmx.at>
7240
7241 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
7242 Operate on live windows only.
7243
7244 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
7245
7246 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
7247
7248 2011-09-07 Eli Zaretskii <eliz@gnu.org>
7249
7250 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
7251 only under bidi iteration.
7252
7253 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
7254
7255 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
7256
7257 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
7258
7259 isnan: Fix porting problem to Solaris 10 with bundled gcc.
7260 Without this fix, the command to link temacs failed due to an
7261 undefined symbol __builtin_isnan. This is because
7262 /usr/include/iso/math_c99.h #defines isnan(x) to
7263 __builtin_isnan(x), but the bundled gcc, which identifies itself
7264 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
7265 a __builtin_isnan.
7266 * floatfns.c (isnan): #undef, and then #define to a clone of
7267 what's in data.c.
7268 (Fisnan): Always define, since it's always available now.
7269 (syms_of_floatfns): Always define isnan at the Lisp level.
7270
7271 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
7272
7273 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
7274
7275 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
7276
7277 * fileio.c: Fix bugs with large file offsets (Bug#9428).
7278 The previous code assumed that file offsets (off_t values) fit in
7279 EMACS_INT variables, which is not true on typical 32-bit hosts.
7280 The code messed up by falsely reporting buffer overflow in cases
7281 such as (insert-file-contents "big" nil 1 2) into an empty buffer
7282 when "big" contains more than 2**29 bytes, even though this
7283 inserts just one byte and does not overflow the buffer.
7284 (Finsert_file_contents): Store file offsets as off_t
7285 values, not as EMACS_INT values. Check for overflow when
7286 converting between EMACS_INT and off_t. When checking for
7287 buffer overflow or for overlap, take the offsets into account.
7288 Don't use EMACS_INT for small values where int suffices.
7289 When checking for overlap, fix a typo: ZV was used where
7290 ZV_BYTE was intended.
7291 (Fwrite_region): Don't assume off_t fits into 'long'.
7292 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
7293
7294 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
7295
7296 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
7297
7298 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
7299
7300 sprintf-related integer and memory overflow issues (Bug#9412).
7301
7302 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
7303 (esprintf, exprintf, evxprintf): New functions.
7304 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
7305 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
7306 (modify_event_symbol): Do not assume that the length of
7307 name_alist_or_stem is safe to alloca and fits in int.
7308 (Fexecute_extended_command): Likewise for function name and binding.
7309 (Frecursion_depth): Wrap around reliably on integer overflow.
7310 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
7311 since some callers pass EMACS_INT values.
7312 (Fsingle_key_description): Don't crash if symbol name contains more
7313 than MAX_ALLOCA bytes.
7314 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
7315 (get_minibuffer): Arg is now EMACS_INT, not int.
7316 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
7317 (esprintf, exprintf, evxprintf): New decls.
7318 * window.h (command_loop_level, minibuf_level): Reflect API changes.
7319
7320 * dbusbind.c (signature_cat): New function.
7321 (xd_signature, Fdbus_register_signal):
7322 Do not overrun buffer; instead, report string overflow.
7323
7324 * dispnew.c (add_window_display_history): Don't overrun buffer.
7325 Truncate instead; this is OK since it's just a log.
7326
7327 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
7328 even if the time zone offset is outlandishly large.
7329 Don't mishandle offset == INT_MIN.
7330
7331 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
7332 when creating daemon; the previous buffer-overflow check was incorrect.
7333
7334 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
7335 which has the guts of the old verror function.
7336
7337 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
7338 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
7339
7340 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
7341 (font_unparse_xlfd): Don't blindly alloca long strings.
7342 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
7343 fits in int, when using sprintf. Use single snprintf to count
7344 length of string rather than counting it via multiple sprintfs;
7345 that's simpler and more reliable.
7346 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
7347 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
7348 sprintf, in case result does not fit in int.
7349
7350 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
7351 (fontset_from_font): Print it.
7352
7353 * frame.c (tty_frame_count): Now printmax_t, not int.
7354 (make_terminal_frame, set_term_frame_name): Print it.
7355 (x_report_frame_params): In X, window IDs are unsigned long,
7356 not signed long, so print them as unsigned.
7357 (validate_x_resource_name): Check for implausibly long names,
7358 and don't assume name length fits in 'int'.
7359 (x_get_resource_string): Don't blindly alloca invocation name;
7360 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
7361 not fit in int.
7362
7363 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
7364 (xg_check_special_colors, xg_set_geometry):
7365 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
7366
7367 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
7368 Use esprintf, not sprintf, in case result does not fit in int.
7369
7370 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
7371 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
7372 it as a large positive number.
7373 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
7374 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
7375
7376 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
7377 in case result does not fit in int.
7378
7379 * print.c (float_to_string): Detect width overflow more reliably.
7380 (print_object): Make sprintf buffer a bit bigger, to avoid potential
7381 buffer overrun. Don't assume list length fits in 'int'. Treat
7382 print length of 0 as 0, not as infinity; to be consistent with other
7383 uses of print length in this function. Don't overflow print length
7384 index. Don't assume hash table size fits in 'long', or that
7385 vectorlike size fits in 'unsigned long'.
7386
7387 * process.c (make_process): Use printmax_t, not int, to format
7388 process-name gensyms.
7389
7390 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
7391
7392 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
7393 to avoid potential buffer overrun.
7394
7395 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
7396 if X resource line is longer than 512 bytes.
7397
7398 * xfns.c (x_window): Make sprintf buffer a bit bigger
7399 to avoid potential buffer overrun.
7400
7401 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
7402
7403 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
7404
7405 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
7406
7407 Integer overflow fixes for scrolling, etc.
7408 Without these, Emacs silently mishandles large integers sometimes.
7409 For example, "C-u 4294967297 M-x recenter" was treated as if
7410 it were "C-u 1 M-x recenter" on a typical 64-bit host.
7411
7412 * xdisp.c (try_window_id): Check Emacs fixnum range before
7413 converting to 'int'.
7414
7415 * window.c (window_scroll_line_based, Frecenter):
7416 Check that an Emacs fixnum is in range before assigning it to 'int'.
7417 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
7418 values converted from Emacs fixnums.
7419 (Frecenter): Don't wrap around a line count if it is out of 'int'
7420 range; instead, treat it as an extreme value.
7421 (Fset_window_configuration, compare_window_configurations):
7422 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
7423
7424 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
7425 that can exceed INT_MAX. Check that EMACS_INT value is in range
7426 before assigning it to the (possibly-narrower) index.
7427 (match_limit): Don't assume that a fixnum can fit in 'int'.
7428
7429 * print.c (print_object): Use ptrdiff_t, not int, for index that can
7430 exceed INT_MAX.
7431
7432 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
7433 (Fvertical_motion): Don't wrap around LINES values that don't fit
7434 in 'int'. Instead, treat them as extreme values. This is good
7435 enough for windows, which can't have more than INT_MAX lines anyway.
7436
7437 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
7438
7439 * Require libxml/parser.h to avoid compilation warning.
7440
7441 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
7442
7443 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
7444 since this reportedly can destroy thread storage.
7445
7446 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
7447
7448 * syntax.c (find_defun_start): Update all cache variables if
7449 exiting early (Bug#9401).
7450
7451 2011-08-30 Eli Zaretskii <eliz@gnu.org>
7452
7453 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
7454
7455 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
7456 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
7457 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
7458
7459 * term.c (tty_append_glyph): New function.
7460 (produce_stretch_glyph): Static function and its prototype deleted.
7461
7462 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
7463 Add prototypes.
7464
7465 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
7466
7467 * image.c (parse_image_spec): Check for nonnegative, not for positive,
7468 when checking :margin (Bug#9390).
7469 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
7470 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
7471 so that the name doesn't mislead. All uses changed.
7472
7473 2011-08-28 Johan Bockgård <bojohan@gnu.org>
7474
7475 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
7476 set_tty_hooks.
7477
7478 2011-08-27 Eli Zaretskii <eliz@gnu.org>
7479
7480 * xdisp.c (move_it_to): Don't bail out early when reaching
7481 position beyond to_charpos, if we are scanning backwards.
7482 (move_it_vertically_backward): When DY == 0, make sure we get to
7483 the first character in the line after the newline.
7484
7485 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
7486
7487 * ccl.c: Improve and simplify overflow checking (Bug#9196).
7488 (ccl_driver): Do not generate an out-of-range pointer.
7489 (Fccl_execute_on_string): Remove unnecessary check for
7490 integer overflow, noted by Stefan Monnier in
7491 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
7492 Remove a FIXME that didn't need fixing.
7493 Simplify the newly-introduced buffer reallocation code.
7494
7495 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
7496
7497 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
7498
7499 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
7500
7501 Integer and memory overflow issues (Bug#9196).
7502
7503 * doc.c (get_doc_string): Rework so that
7504 get_doc_string_buffer_size is the actual buffer size, rather than
7505 being 1 less than the actual buffer size; this makes xpalloc more
7506 convenient.
7507
7508 * image.c (x_allocate_bitmap_record, cache_image):
7509 * xselect.c (Fx_register_dnd_atom):
7510 Simplify previous changes by using xpalloc.
7511
7512 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
7513 since either will do and ptrdiff_t is convenient with xpalloc.
7514
7515 * charset.c (charset_table_size)
7516 (struct charset_sort_data.priority): Now ptrdiff_t.
7517 (charset_compare): Don't overflow if priorities differ greatly.
7518 (Fsort_charsets): Don't assume list length fits in int.
7519 Check for size-calculation overflow when allocating sort data.
7520 (syms_of_charset): Allocate an initial charset table that is
7521 just under 64 KiB, to avoid problems with glibc malloc and mmap.
7522
7523 * cmds.c (internal_self_insert): Check for size-calculation overflow.
7524
7525 * composite.h (struct composition.glyph_len): Now int, not unsigned.
7526 The actual value is always <= INT_MAX, and leaving it unsigned made
7527 overflow checking harder.
7528
7529 * dispextern.h (struct glyph_matrix.rows_allocated)
7530 (struct face_cache.size): Now ptrdiff_t, for convenience in use
7531 with xpalloc. The values are still always <= INT_MAX.
7532
7533 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
7534
7535 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
7536 (SAFE_NALLOCA): New macro.
7537
7538 * region-cache.c (struct boundary.pos, find_cache_boundary)
7539 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
7540 (set_cache_region, invalidate_region_cache)
7541 (revalidate_region_cache, know_region_cache, region_cache_forward)
7542 (region_cache_backward, pp_cache):
7543 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
7544 so that ptrdiff_t * can be passed to xpalloc.
7545 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
7546 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
7547 (pp_cache): Don't assume cache_len fits in int.
7548 * region-cache.h: Adjust extern decls to match.
7549
7550 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
7551 EMACS_INT, since either will do, for xpalloc.
7552
7553 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
7554 (xnmalloc, xnrealloc, xpalloc): New functions.
7555
7556 * bidi.c (bidi_shelve_header_size): New constant.
7557 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
7558 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
7559
7560 * bidi.c (bidi_cache_shrink):
7561 * buffer.c (overlays_at, overlays_in, record_overlay_string)
7562 (overlay_strings):
7563 Don't update size of array until after memory allocation succeeds,
7564 because xmalloc/xrealloc may not return.
7565 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
7566 now that we have proper integer overflow checking.
7567 (record_overlay_string, overlay_strings): Catch overflows when
7568 calculating size of overlay_str_buf.
7569
7570 * callproc.c (Fcall_process): Check for size overflow when
7571 calculating size of args2.
7572 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
7573 Normally we prefer signed values, but sticking with ptrdiff_t would
7574 require adding more-complicated checks.
7575
7576 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
7577 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
7578 Redo buffer-overflow calculations to avoid integer overflow.
7579 Add a FIXME comment where memory seems to be over-allocated.
7580
7581 * character.c (Fstring): Check for size-calculation overflow.
7582
7583 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
7584 unnecessary integer overflow. Check for size overflow.
7585 (encode_coding_object): Don't update size until xmalloc succeeds.
7586
7587 * composite.c (get_composition_id): Check for overflow in glyph
7588 length calculations.
7589
7590 Integer and memory overflow fixes for display code.
7591 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
7592 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
7593 (scrolling_window): Check for overflow in size calculations.
7594 (line_draw_cost, realloc_glyph_pool, add_row_entry):
7595 Don't assume glyph table len fits in int.
7596 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
7597 (row_table_size): Now ptrdiff_t, not int.
7598 (scrolling_window): Avoid overflow in size calculations.
7599 Don't update size until allocation succeeds.
7600 * fns.c (concat): Check for overflow in size calculations.
7601 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
7602 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
7603 (NEXT_ALMOST_PRIME_LIMIT): New constant.
7604
7605 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
7606 (get_doc_string): Check for size calculation overflow.
7607 Don't update size until allocation succeeds.
7608 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
7609 EMACS_INT, where ptrdiff_t will do.
7610 (Fsubstitute_command_keys): Check for string overflow.
7611
7612 * editfns.c (set_time_zone_rule): Don't assume environment length
7613 fits in int.
7614 (message_length): Now ptrdiff_t, not int.
7615 (Fmessage_box): Don't update size until allocation succeeds.
7616 Don't assume message length fits in int.
7617 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
7618
7619 * emacs.c (main): Do not reallocate argv, since there is a null at
7620 the end that can be overwritten, and this way there's no need to
7621 worry about size-calculation overflow.
7622 (sort_args): Check for size-calculation overflow.
7623
7624 * eval.c (init_eval_once, grow_specpdl): Don't update size until
7625 alloc succeeds.
7626 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
7627
7628 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
7629 (x_set_scroll_bar_width, x_figure_window_size):
7630 Check for integer overflow.
7631 (x_set_alpha): Do not assume XINT fits in int.
7632
7633 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
7634 This is for the members text_lines, text_cols, total_lines, total_cols,
7635 where the system imposes an 'int' limit.
7636
7637 * fringe.c (Fdefine_fringe_bitmap):
7638 Don't update size until alloc works.
7639
7640 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
7641 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
7642
7643 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
7644 Check for size-calculation overflow.
7645 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
7646 do, as we prefer signed integers.
7647 (id_to_widget.max_size, id_to_widget.used)
7648 (xg_store_widget_in_map, xg_remove_widget_from_map)
7649 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
7650 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
7651 Use and return ptrdiff_t, not int.
7652 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
7653 * gtkutil.h: Change prototypes to match the above.
7654
7655 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
7656 are duplicate now that they've been promoted to lisp.h.
7657 (x_allocate_bitmap_record, x_alloc_image_color)
7658 (make_image_cache, cache_image, xpm_load):
7659 Don't update size until alloc is done.
7660 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
7661 (x_detect_edges):
7662 Check for size calculation overflow.
7663 (ct_colors_allocated_max): New constant.
7664 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
7665 overflow.
7666
7667 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
7668 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
7669 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
7670 Use ptrdiff_t, not int, to count maps.
7671 (read_char_minibuf_menu_prompt): Check for overflow in size
7672 calculations. Don't update size until allocation succeeds.
7673 Redo calculations to avoid overflow.
7674 * keyboard.h: Change prototypes to match the above.
7675
7676 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
7677 to count maps.
7678 (current_minor_maps): Check for size calculation overflow.
7679 * keymap.h: Change prototypes to match the above.
7680
7681 * lread.c (read1, init_obarray): Don't update size until alloc done.
7682
7683 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
7684 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
7685
7686 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
7687 Now ptrdiff_t, not int.
7688 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
7689 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
7690
7691 * process.c (Fnetwork_interface_list): Check for overflow
7692 in size calculation.
7693
7694 * region-cache.c (move_cache_gap): Check for size calculation overflow.
7695
7696 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
7697 overflow. Don't bother calling xmalloc when xrealloc will do.
7698
7699 * search.c (Freplace_match): Check for size calculation overflow.
7700 (Fset_match_data): Don't assume list lengths fit in 'int'.
7701
7702 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
7703 for command line length. Do not attempt to address one before the
7704 beginning of an array, as that's not portable.
7705
7706 * term.c (max_frame_lines): Remove; unused.
7707 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
7708 not int.
7709 (encode_terminal_code, calculate_costs): Check for size
7710 calculation overflow.
7711 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
7712 table lengths and related sizes. Don't update size until alloc
7713 done. Redo calculations to avoid overflow.
7714 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
7715
7716 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
7717 subtracting pointers.
7718 (gobble_line): Check for overflow more carefully. Don't update size
7719 until alloc done.
7720
7721 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
7722 Don't update size until alloc done.
7723 Redo size calculations to avoid overflow.
7724 Check for size calculation overflow.
7725 (main) [DEBUG]: Fix typo in invoking tparam1.
7726
7727 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
7728 Use ptrdiff_t, not int, for sizes.
7729 (store_mode_line_noprop_char): Don't update size until alloc done.
7730
7731 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
7732 Use ptrdiff_t, not int, for sizes.
7733 (Finternal_make_lisp_face, cache_face):
7734 Check for size calculation overflow.
7735 (cache_face): Treat size calculation overflows as if they were
7736 memory exhaustion (the usual treatment), rather than aborting.
7737
7738 * xfns.c (x_encode_text, x_set_name_internal)
7739 (Fx_change_window_property): Use ptrdiff_t, not int, to count
7740 sizes, since they can exceed INT_MAX in size. Check for size
7741 calculation overflow.
7742
7743 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
7744 (xg_select): Check for size calculation overflow.
7745 Don't update size until alloc done.
7746
7747 * xrdb.c (get_environ_db): Don't assume path length fits in int,
7748 as sprintf is limited to int lengths.
7749
7750 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
7751 (X_LONG_MIN): New macros.
7752 Use them to make the following changes clearer.
7753 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
7754 This change doesn't affect the value now, but it may help remind
7755 future maintainers not to raise the value too much later.
7756 (SELECTION_QUANTUM): Remove, replacing with ...
7757 (selection_quantum): ... new function, which avoids overflow.
7758 All uses changed.
7759 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
7760 assumption that selection length fits in 'int'.
7761 (x_reply_selection_request, x_handle_selection_request)
7762 (x_get_window_property, receive_incremental_selection)
7763 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
7764 (lisp_data_to_selection_data, clean_local_selection_data):
7765 Use ptrdiff_t, not int, to record length of selection.
7766 (x_reply_selection_request, x_get_window_property)
7767 (receive_incremental_selection, x_property_data_to_lisp):
7768 Redo calculations to avoid overflow.
7769 (x_reply_selection_request): When sending hint, ceiling it at
7770 X_LONG_MAX rather than relying on wraparound overflow to send
7771 something.
7772 (x_get_window_property, receive_incremental_selection)
7773 (lisp_data_to_selection_data, x_property_data_to_lisp):
7774 Check for size-calculation overflow.
7775 (x_get_window_property, receive_incremental_selection)
7776 (lisp_data_to_selection_data, Fx_register_dnd_atom):
7777 Don't store size until memory allocation succeeds.
7778 (x_get_window_property): Plug memory leak on memory exhaustion.
7779 Don't double-block input; malloc is safe here. Don't assume 2**34
7780 - 4 fits in unsigned long. Add an xassert to check
7781 XGetWindowProperty overflow. Be more careful about overflow
7782 calculations, and distinguish size from memory overflow better.
7783 (receive_incremental_selection): When tracing, don't assume
7784 unsigned int is less than INT_MAX.
7785 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
7786 harmful) conversions of unsigned short to int.
7787 (lisp_data_to_selection_data): Don't assume that integers
7788 in the range -65535 through -1 fit in an X unsigned short.
7789 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
7790 result parameters unless successful. Rely on cons_to_unsigned
7791 to report problems with elements; the old code wasn't right anyway.
7792 (x_check_property_data): Check for int overflow; we cannot use
7793 a wider type due to X limits.
7794 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
7795
7796 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
7797
7798 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
7799 (x_term_init): Check for size calculation overflow.
7800 (x_color_cells): Don't store size until memory allocation succeeds.
7801 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
7802 Don't assume alloca size is less than MAX_ALLOCA.
7803 (x_term_init): Don't assume length fits in int (sprintf is limited
7804 to int size).
7805
7806 Use ptrdiff_t for composition IDs.
7807 * character.c (lisp_string_width):
7808 * composite.c (composition_table_size, n_compositions)
7809 (get_composition_id, composition_gstring_from_id):
7810 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
7811 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
7812 * window.c (Frecenter):
7813 Use ptrdiff_t, not int, for composition IDs.
7814 * composite.c (get_composition_id): Check for integer overflow.
7815 * composite.h: Adjust prototypes to match the above changes.
7816
7817 Use ptrdiff_t for hash table indexes.
7818 * category.c (hash_get_category_set):
7819 * ccl.c (ccl_driver):
7820 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
7821 * coding.c (coding_system_charset_list, detect_coding_system):
7822 * coding.h (struct coding_system.id):
7823 * composite.c (get_composition_id, gstring_lookup_cache):
7824 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
7825 * image.c (xpm_get_color_table_h):
7826 * lisp.h (hash_lookup, hash_put):
7827 * minibuf.c (Ftest_completion):
7828 Use ptrdiff_t for hash table indexes, not int (which is too
7829 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
7830 32-bit --with-wide-int hosts).
7831
7832 * charset.c (Fdefine_charset_internal): Check for integer overflow.
7833 Add a FIXME comment about memory leaks.
7834 (syms_of_charset): Don't assume xmalloc returns.
7835
7836 Don't assume that stated character widths fit in int.
7837 * character.c (Fchar_width, c_string_width, lisp_string_width):
7838 * character.h (CHAR_WIDTH):
7839 * indent.c (MULTIBYTE_BYTES_WIDTH):
7840 Use sanitize_char_width to avoid undefined and/or bad behavior
7841 with outlandish widths.
7842 * character.h (sanitize_tab_width): Rename from sanitize_width,
7843 now that we have two such functions. All uses changed.
7844 (sanitize_char_width): New inline function.
7845
7846 Don't assume that tab-width fits in int.
7847 * character.h (sanitize_width): New inline function.
7848 (SANE_TAB_WIDTH): New macro.
7849 (ASCII_CHAR_WIDTH): Use it.
7850 * indent.c (sane_tab_width): Remove. All uses replaced by
7851 SANE_TAB_WIDTH (current_buffer).
7852 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
7853
7854 * fileio.c: Integer overflow issues with file modes.
7855 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
7856
7857 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
7858 Remove unreachable code.
7859 (read_hex, load_charset_map_from_file): Check for integer overflow.
7860
7861 * xterm.c: Don't go over XClientMessageEvent limit.
7862 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
7863 (x_send_scroll_bar_event): Likewise. Check that the size does not
7864 exceed limits imposed by XClientMessageEvent, as well as the usual
7865 ptrdiff_t and size_t limits.
7866
7867 * keyboard.c: Overflow, signedness and related fixes.
7868 (make_lispy_movement): Use same integer type in forward decl
7869 that is used in the definition.
7870 (read_key_sequence, keyremap_step):
7871 Change bufsize argument back to int, undoing my 2011-03-30 change.
7872 We prefer signed types, and int is wide enough here.
7873 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
7874 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
7875 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
7876 length, not size_t. Use ptrdiff_t for index, not int.
7877 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
7878 possibility of integer overflow.
7879
7880 Overflow, signedness and related fixes for images.
7881
7882 * dispextern.h (struct it.stack[0].u.image.image_id)
7883 (struct_it.image_id, struct image.id, struct image_cache.size)
7884 (struct image_cache.used, struct image_cache.ref_count):
7885 * gtkutil.c (update_frame_tool_bar):
7886 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
7887 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
7888 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
7889 * nsmenu.m (update_frame_tool_bar):
7890 * xdisp.c (calc_pixel_width_or_height):
7891 * xfns.c (image_cache_refcount):
7892 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
7893 on typical 64-bit hosts.
7894
7895 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
7896 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
7897 Omit unnecessary casts to int.
7898 (parse_image_spec): Check that integers fall into 'int' range
7899 when the callers expect that.
7900 (image_ascent): Redo ascent calculation to avoid int overflow.
7901 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
7902 (lookup_image): Remove unnecessary tests.
7903 (xbm_image_p): Locals are now of int, not EMACS_INT,
7904 since parse_image_check makes sure they fit into int.
7905 (png_load, gif_load, svg_load_image):
7906 Prefer int to unsigned where either will do.
7907 (tiff_handler): New function, combining the cores of the
7908 old tiff_error_handler and tiff_warning_handler.
7909 This function is rewritten to use vsnprintf and thereby avoid
7910 stack buffer overflows. It uses only the features of vsnprintf
7911 that are common to both POSIX and native Microsoft.
7912 (tiff_error_handler, tiff_warning_handler): Use it.
7913 (tiff_load, gif_load, imagemagick_load_image):
7914 Don't assume :index value fits in 'int'.
7915 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
7916 (imagemagick_load_image): Check that crop parameters fit into
7917 the integer types that MagickCropImage accepts. Don't assume
7918 Vimagemagick_render_type has a nonnegative value. Don't assume
7919 size_t fits in 'long'.
7920 (gs_load): Use printmax_t to print the widest integers possible.
7921 Check for integer overflow when computing image height and width.
7922
7923 2011-08-26 Eli Zaretskii <eliz@gnu.org>
7924
7925 * xdisp.c (redisplay_window): Don't force window start if point
7926 will be invisible in the resulting window. (Bug#9324)
7927
7928 2011-08-25 Eli Zaretskii <eliz@gnu.org>
7929
7930 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
7931 the display spec is of the form `(space ...)'.
7932 (handle_display_spec): Return the value returned by
7933 handle_single_display_spec, not just 1 or zero.
7934 (handle_single_display_spec): If the display spec is of the form
7935 `(space ...)', and specifies display in the text area, return 2
7936 rather than 1.
7937 (try_cursor_movement): Check for the need to scroll more
7938 accurately, and prefer exact match for point under bidi.
7939 Don't advance `row' beyond the last row of the window.
7940
7941 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
7942 into disp_prop; all users changed.
7943
7944 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
7945 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
7946 for the text covered by the display property.
7947
7948 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
7949
7950 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
7951 Change return value to nil.
7952 (Frecord_buffer): Delete unused function.
7953
7954 2011-08-24 Eli Zaretskii <eliz@gnu.org>
7955
7956 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
7957 buffers, return left-to-right.
7958 (set_cursor_from_row): Consider candidate row a win if its glyph
7959 represents a newline and point is on that newline. Fixes cursor
7960 positioning on the newline at EOL of R2L text within L2R
7961 paragraph, and vice versa.
7962 (try_cursor_movement): Check continued rows, in addition to
7963 continuation rows. Fixes unwarranted scroll when point enters a
7964 continued line of R2L text within an L2R paragraph, or vice versa.
7965 (cursor_row_p): Consider the case of point being equal to
7966 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
7967 from the end of a short line to the beginning of a continued line
7968 of R2L text within L2R paragraph.
7969 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
7970 composed characters.
7971
7972 * bidi.c (bidi_check_type): Use xassert.
7973 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
7974 members.
7975
7976 2011-08-23 Eli Zaretskii <eliz@gnu.org>
7977
7978 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
7979 a character.
7980
7981 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
7982
7983 * nsfont.m (ns_otf_to_script): Fix typo.
7984
7985 2011-08-22 Kenichi Handa <handa@m17n.org>
7986
7987 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
7988 extra slot even if the purpose is char-code-property-table.
7989
7990 2011-08-23 Eli Zaretskii <eliz@gnu.org>
7991
7992 * xdisp.c (redisplay_window): When computing centering_position,
7993 account for the height of the header line. (Bug#8874)
7994
7995 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
7996 instead of CHAR_TO_BYTE. Fixes a crash when a completion
7997 candidate is selected by the mouse, and that candidate has a
7998 composed character under the mouse.
7999
8000 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
8001 coordinates reported by pos-visible-in-window-p for a composed
8002 character in column zero.
8003
8004 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
8005
8006 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
8007
8008 2011-08-22 Eli Zaretskii <eliz@gnu.org>
8009
8010 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
8011 consider it a hit if to_charpos is anywhere in the range of the
8012 composed buffer positions.
8013
8014 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
8015
8016 * image.c (gif_load): Don't assume that each subimage has the same
8017 dimensions as the base image. Handle disposal method that is
8018 "undefined" by the gif spec (Bug#9335).
8019
8020 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
8021
8022 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
8023 (Fcondition_case): Document `debug' symbol in error handler.
8024
8025 2011-08-19 Eli Zaretskii <eliz@gnu.org>
8026
8027 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
8028 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
8029 from an Org mode buffer to a Speedbar frame.
8030
8031 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
8032 a composition, take its buffer position from IT->cmp_it.charpos.
8033 Fixes cursor positioning at the beginning of a line that begins
8034 with a composed character.
8035
8036 2011-08-18 Eli Zaretskii <eliz@gnu.org>
8037
8038 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
8039 character bidirectional type, use STRONG_L instead. Fixes crashes
8040 in a buffer produced by `describe-categories'.
8041
8042 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
8043 members before the level stack, so they would be saved and
8044 restored when copying iterator state. Fixes incorrect reordering
8045 around TABs covered by display properties.
8046
8047 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
8048
8049 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
8050
8051 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
8052
8053 * eval.c (internal_condition_case, internal_condition_case_1)
8054 (internal_condition_case_2, internal_condition_case_n):
8055 Remove unnecessary aborts (Bug#9081).
8056
8057 2011-08-17 Eli Zaretskii <eliz@gnu.org>
8058
8059 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
8060 has no `load' handler, try opening the file locally. (Bug#9311)
8061
8062 2011-08-16 Ken Brown <kbrown@cornell.edu>
8063
8064 * gmalloc.c: Expand comment.
8065
8066 2011-08-16 Eli Zaretskii <eliz@gnu.org>
8067
8068 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
8069 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
8070
8071 2011-08-16 Ken Brown <kbrown@cornell.edu>
8072
8073 Fix memory allocation problems in Cygwin build (Bug#9273).
8074
8075 * unexcw.c ( __malloc_initialized): Declare external variable.
8076 (fixup_executable): Force the dumped emacs to reinitialize malloc.
8077
8078 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
8079 New variables.
8080 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
8081 dumped emacs.
8082 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
8083 in the static heap.
8084 [CYGWIN] (special_realloc): New function.
8085 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
8086 requests to realloc storage in the static heap.
8087
8088 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
8089
8090 * bidi.c (bidi_initialize): Remove unused local.
8091
8092 2011-08-15 Eli Zaretskii <eliz@gnu.org>
8093
8094 * bidimirror.h:
8095 * biditype.h: Remove file.
8096 * makefile.w32-in ($(BLD)/bidi.$(O)):
8097 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
8098
8099 * dispextern.h: Fix a typo in the comment to bidi_type_t.
8100
8101 * chartab.c: Improve commentary for the uniprop_table API.
8102
8103 * bidi.c (bidi_paragraph_init): Support zero value of
8104 bidi_ignore_explicit_marks_for_paragraph_level.
8105 (bidi_initialize): Use uniprop_table instead of including
8106 biditype.h and bidimirror.h.
8107
8108 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
8109 coordinates of the iterator when restoring from ppos_it.
8110 (Bug#9296)
8111
8112 2011-08-14 Kenichi Handa <handa@m17n.org>
8113
8114 * process.c (create_process): Call setup_process_coding_systems
8115 after the pid of the process is set to -1 (Bug#8162).
8116
8117 2011-08-14 Eli Zaretskii <eliz@gnu.org>
8118
8119 * xdisp.c (move_it_in_display_line_to): Don't invoke
8120 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
8121 ppos_it. Fixes vertical cursor motion when line beginning is
8122 covered by an image. (Bug#9296)
8123
8124 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
8125
8126 * nsterm.h (ns_run_ascript): Declare.
8127 (NSAPP_DATA2_RUNASSCRIPT): Define.
8128
8129 * nsfns.m (as_script, as_result, as_status): New static variables.
8130 (ns_run_ascript): New function.
8131 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
8132 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
8133 the event loop. Get status from as_status (Bug#7276).
8134
8135 * nsterm.m (sendEvent): If event is NSApplicationDefined and
8136 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
8137 the event loop (Bug#7276).
8138
8139 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
8140
8141 * gnutls.c (QCgnutls_bootprop_priority)
8142 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
8143 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
8144 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
8145 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
8146 (QCgnutls_bootprop_verify_hostname_error)
8147 (QCgnutls_bootprop_callbacks_verify): Rename from
8148 Qgnutls_bootprop_..., all uses changed.
8149
8150 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
8151 uses changed.
8152
8153 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
8154
8155 * xfaces.c (Qframe_set_background_mode): Now static.
8156 * dispextern.h (Qframe_set_background_mode): Remove decl.
8157
8158 * process.c (Fnetwork_interface_info): Declare local only if needed.
8159
8160 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
8161
8162 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
8163 (Fnetwork_interface_list): Allocate in increments of bytes instead
8164 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
8165 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
8166 sockaddr.
8167 (struct ifflag_def): notrailers is smart on OSX.
8168 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
8169 Get hardware address with getifaddrs if available.
8170
8171 2011-08-12 Eli Zaretskii <eliz@gnu.org>
8172
8173 * xdisp.c (iterate_out_of_display_property): xassert that
8174 IT->position is set to within IT->object's boundaries. Break from
8175 the loop as soon as EOB is reached; avoids infloops in redisplay
8176 when IT->position is set up wrongly due to some bug.
8177 Set IT->current to match the bidi iterator unconditionally.
8178 (push_display_prop): Allow GET_FROM_STRING as IT->method on
8179 entry. Force push_it to save on the stack the current
8180 buffer/string position, to be restored by pop_it. Fix flags in
8181 the iterator structure wrt the object coming from a display
8182 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
8183 properties. (Bug#9284)
8184
8185 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
8186
8187 * fontset.c (fontset_get_font_group): Add proper type checks.
8188 (Bug#9172)
8189
8190 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8191
8192 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
8193 and LC_VERSION_MIN_MACOSX.
8194 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
8195 (dump_it) [LC_FUNCTION_STARTS]: Use it.
8196
8197 2011-08-08 Eli Zaretskii <eliz@gnu.org>
8198
8199 * xdisp.c (forward_to_next_line_start): Allow to use the
8200 no-display-properties-and-no-overlays under bidi display.
8201 Set disp_pos in the bidi iterator to avoid searches for display
8202 properties and overlays.
8203
8204 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
8205
8206 * editfns.c (Fset_time_zone_rule): Document relationship with the
8207 setenv function.
8208
8209 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
8210 the font entity extracted from the cache (Bug#8109).
8211
8212 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
8213
8214 * composite.c (autocmp_chars): Don't reset point. That is done by
8215 restore_point_unwind (Bug#5984).
8216
8217 2011-08-07 Juri Linkov <juri@jurta.org>
8218
8219 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
8220 to show the arg `TIME' instead of `TIMEVAL'.
8221
8222 2011-08-06 Eli Zaretskii <eliz@gnu.org>
8223
8224 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
8225 display property strides EOL and includes a newline, as in
8226 longlines-mode. (Bug#9254)
8227 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
8228 word-wrap under bidirectional display. (Bug#9224)
8229
8230 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
8231 is non-zero, even if the data buffer is NULL. Fixes a crash in
8232 vertical-motion with longlines-mode. (Bug#9254)
8233
8234 2011-08-05 Eli Zaretskii <eliz@gnu.org>
8235
8236 * bidi.c <bidi_cache_total_alloc>: Now static.
8237 (bidi_initialize): Initialize bidi_cache_total_alloc.
8238
8239 * xdisp.c (display_line): Release buffer allocated for shelved bidi
8240 cache. (Bug#9221)
8241
8242 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
8243 amount allocated this far in `bidi_cache_total_alloc'.
8244 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
8245 non-zero, only free the data buffer without restoring the cache
8246 contents. All callers changed.
8247
8248 * dispextern.h (bidi_unshelve_cache): Update prototype.
8249
8250 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
8251 (move_it_in_display_line, move_it_to)
8252 (move_it_vertically_backward, move_it_by_lines): Replace the call
8253 to xfree to an equivalent call to bidi_unshelve_cache.
8254 (move_it_in_display_line_to): Fix logic of returning
8255 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
8256
8257 2011-08-05 Eli Zaretskii <eliz@gnu.org>
8258
8259 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
8260 came from a string character with a `cursor' property. (Bug#9229)
8261
8262 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
8263
8264 * Makefile.in (LIB_PTHREAD): New variable.
8265 (LIBES): Add LIB_PTHREAD (Bug#9216).
8266
8267 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
8268 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
8269
8270 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
8271
8272 * regex.c (re_iswctype): Remove some redundant boolean conversions.
8273
8274 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
8275
8276 * xterm.c (x_find_topmost_parent): New function.
8277 (x_set_frame_alpha): Find topmost parent window with
8278 x_find_topmost_parent and set the property there also (bug#9181).
8279 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
8280
8281 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
8282
8283 * callproc.c (Fcall_process): Avoid vfork clobbering
8284 the local vars buffer, coding_systems, current_dir.
8285
8286 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
8287
8288 * keymap.c (Fmake_composed_keymap): Move to subr.el.
8289
8290 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
8291
8292 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
8293 so that it is not optimized away.
8294
8295 * xdisp.c (compute_display_string_pos): Remove unused local.
8296
8297 2011-08-02 Eli Zaretskii <eliz@gnu.org>
8298
8299 Fix slow cursor motion and scrolling in large buffers with
8300 selective display, like Org Mode buffers. (Bug#9218)
8301
8302 * dispextern.h (struct bidi_it): New member disp_prop_p.
8303
8304 * xdisp.c: Remove one-slot cache of display string positions.
8305 (compute_display_string_pos): Accept an additional argument
8306 DISP_PROP_P; callers changed. Scan at most 5K characters forward
8307 for a display string or property. If found, set DISP_PROP_P
8308 non-zero.
8309
8310 * bidi.c (bidi_fetch_char): Accept an additional argument
8311 DISP_PROP_P, and pass it to compute_display_string_pos.
8312 Only handle text covered by a display string if DISP_PROP_P is returned
8313 non-zero. All callers of bidi_fetch_char changed.
8314
8315 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
8316
8317 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
8318
8319 2010-12-03 Don March <don@ohspite.net>
8320
8321 * keymap.c (Fdefine_key): Fix non-prefix key error message when
8322 last character M-[char] is translated to ESC [char] (bug#7541).
8323
8324 2011-08-02 Kenichi Handa <handa@m17n.org>
8325
8326 * lisp.h (uniprop_table): Extern it.
8327
8328 * chartab.c (uniprop_table): Make it non-static.
8329
8330 2011-08-01 Eli Zaretskii <eliz@gnu.org>
8331
8332 * xdisp.c (forward_to_next_line_start): Accept additional argument
8333 BIDI_IT_PREV, and store into it the state of the bidi iterator had
8334 on the newline.
8335 (reseat_at_next_visible_line_start): Use the bidi iterator state
8336 returned by forward_to_next_line_start to restore the state of
8337 it->bidi_it after backing up to previous newline. (Bug#9212)
8338
8339 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
8340
8341 * regex.c (re_comp): Protoize.
8342 (re_exec): Fix return type.
8343 (regexec): Fix type of `ret'. (Bug#9203)
8344
8345 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
8346
8347 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
8348 This is needed if max-image-size is a floating-point number.
8349
8350 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
8351
8352 * print.c (print_object): Print empty symbol as ##.
8353
8354 * lread.c (read1): Read ## as empty symbol.
8355
8356 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
8357
8358 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
8359 setting frame foreground color (Bug#9175).
8360 (x_set_background_color): Likewise.
8361
8362 * nsmenu.m (-setText): Size tooltip dimensions precisely to
8363 contents (Bug#9176).
8364 (EmacsTooltip -init): Remove bezels and add shadows to
8365 tooltip windows.
8366
8367 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
8368 or scroll bar (Bug#8470).
8369
8370 * nsfont.m (nsfont_open): Remove assignment to voffset and
8371 unnecessary vars hshink, expand, hd, full_height, min_height.
8372 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
8373
8374 * nsterm.h (nsfont_info): Remove voffset field.
8375
8376 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
8377
8378 Implement strike-through and overline on NextStep (Bug#8863).
8379
8380 * nsfont.m (nsfont_open): Use underline position provided by font,
8381 instead of hard-coded value of 2.
8382 (nsfont_draw): Call ns_draw_text_decoration instead.
8383
8384 * nsterm.h: Add declaration for ns_draw_text_decoration.
8385
8386 * nsterm.m (ns_draw_text_decoration): New function for drawing
8387 underline, overline, and strike-through.
8388 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
8389 ns_draw_text_decoration. Change treatment of cursor drawing to
8390 accommodate underlining, etc.
8391
8392 2011-07-28 Eli Zaretskii <eliz@gnu.org>
8393
8394 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
8395 default.
8396
8397 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
8398
8399 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
8400 Without this fix, if a signal arrives just after memory fills up,
8401 'malloc' might be invoked reentrantly.
8402
8403 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
8404 In other words, assume that every image size is allowed, on non-X
8405 hosts. This assumption is probably wrong, but it lets Emacs compile.
8406
8407 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
8408
8409 * regex.c (re_iswctype): Convert return values to boolean.
8410
8411 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
8412
8413 * xdisp.c (compute_display_string_pos): Don't use cached display
8414 string position if the buffer had its restriction changed.
8415 (Bug#9184)
8416
8417 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
8418
8419 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
8420
8421 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
8422
8423 Integer signedness and overflow and related fixes. (Bug#9079)
8424
8425 * bidi.c: Integer size and overflow fixes.
8426 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
8427 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
8428 (bidi_cache_find_level_change, bidi_cache_ensure_space)
8429 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
8430 (bidi_find_other_level_edge):
8431 Use ptrdiff_t instead of EMACS_INT where either will do.
8432 This works better on 32-bit hosts configured --with-wide-int.
8433 (bidi_cache_ensure_space): Check for size-calculation overflow.
8434 Use % rather than repeated addition, for better worst-case speed.
8435 Don't set bidi_cache_size until after xrealloc returns, because it
8436 might not return.
8437 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
8438 (bidi_cache_ensure_space): Also check that the bidi cache size
8439 does not exceed that of the largest Lisp string or buffer. See Eli
8440 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
8441
8442 * alloc.c (__malloc_size_t): Remove.
8443 All uses replaced by size_t. See Andreas Schwab's note
8444 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
8445
8446 * image.c: Improve checking for integer overflow.
8447 (check_image_size): Assume that f is nonnull, since
8448 it is always nonnull in practice. This is one less thing to
8449 worry about when checking for integer overflow later.
8450 (x_check_image_size): New function, which checks for integer
8451 overflow issues inside X.
8452 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
8453 This removes the need for a memory_full check.
8454 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
8455 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
8456 (xbm_read_bitmap_data): Change locals back to 'int', since
8457 their values must fit in 'int'.
8458 (xpm_load_image, png_load, tiff_load):
8459 Invoke x_create_x_image_and_pixmap earlier,
8460 to avoid much needless work if the image is too large.
8461 (tiff_load): Treat overly large images as if
8462 x_create_x_image_and_pixmap failed, not as malloc failures.
8463 (gs_load): Use x_check_image_size.
8464
8465 * gtkutil.c: Omit integer casts.
8466 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
8467 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
8468
8469 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
8470
8471 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
8472 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
8473 would wrongly return t on a 64-bit host.
8474
8475 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
8476 The plain *_OVERFLOW macros run afoul of GCC bug 49705
8477 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
8478 and therefore cause GCC to emit a bogus diagnostic in some cases.
8479
8480 * image.c: Integer signedness and overflow and related fixes.
8481 This is not an exhaustive set of fixes, but it's time to
8482 record what I've got.
8483 (lookup_pixel_color, check_image_size): Remove redundant decls.
8484 (check_image_size): Don't assume that arbitrary EMACS_INT values
8485 fit in 'int', or that arbitrary 'double' values fit in 'int'.
8486 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
8487 (tiff_load, imagemagick_load_image):
8488 Check for overflow in size calculations.
8489 (x_create_x_image_and_pixmap): Remove unnecessary test for
8490 xmalloc returning NULL; that can't happen.
8491 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
8492 (xpm_color_bucket): Use better integer hashing function.
8493 (xpm_cache_color): Don't possibly over-allocate memory.
8494 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
8495 (gif_memory_source):
8496 Use ptrdiff_t, not int or size_t, to record sizes.
8497 (png_load): Don't assume values greater than 2**31 fit in 'int'.
8498 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
8499 either works, as we prefer signed integers.
8500 (tiff_read_from_memory, tiff_write_from_memory):
8501 Return tsize_t, not size_t, since that's what the TIFF API wants.
8502 (tiff_read_from_memory): Don't fail simply because the read would
8503 go past EOF; instead, return a short read.
8504 (tiff_load): Omit no-longer-needed casts.
8505 (Fimagemagick_types): Don't assume size fits into 'int'.
8506
8507 Improve hashing quality when configured --with-wide-int.
8508 * fns.c (hash_string): New function, taken from sxhash_string.
8509 Do not discard information about ASCII character case; this
8510 discarding is no longer needed.
8511 (sxhash-string): Use it. Change sig to match it. Caller changed.
8512 * lisp.h: Declare it.
8513 * lread.c (hash_string): Remove, since we now use fns.c's version.
8514 The fns.c version returns a wider integer if --with-wide-int is
8515 specified, so this should help the quality of the hashing a bit.
8516
8517 * emacs.c: Integer overflow minor fix.
8518 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
8519 Define only if GNU_LINUX.
8520 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
8521
8522 * dispnew.c: Integer signedness and overflow fixes.
8523 Remove unnecessary forward decls, that were a maintenance hassle.
8524 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
8525 All uses changed.
8526 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
8527 (scrolling_window): Use ptrdiff_t, not int, for byte count.
8528 (prepare_desired_row, line_draw_cost):
8529 Use int, not unsigned, where either works.
8530 (save_current_matrix, restore_current_matrix):
8531 Use ptrdiff_t, not size_t, where either works.
8532 (init_display): Check for overflow more accurately, and without
8533 relying on undefined behavior.
8534
8535 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
8536 Remove, replacing with the new symbols in lisp.h. All uses changed.
8537 * fileio.c (make_temp_name):
8538 * filelock.c (lock_file_1, lock_file):
8539 * xdisp.c (message_dolog):
8540 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
8541 Use pMd etc. instead.
8542 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
8543 replacing the pWIDE etc. symbols removed from editfns.c.
8544
8545 * keyboard.h (num_input_events): Now uintmax_t.
8546 This is (very slightly) less likely to mess up due to wraparound.
8547 All uses changed.
8548
8549 * buffer.c: Integer signedness fixes.
8550 (alloc_buffer_text, enlarge_buffer_text):
8551 Use ptrdiff_t rather than size_t when either will do, as we prefer
8552 signed integers.
8553
8554 * alloc.c: Integer signedness and overflow fixes.
8555 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
8556 (__malloc_size_t): Default to size_t, not to int.
8557 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
8558 (Fgarbage_collect, mark_object_loop_halt, mark_object):
8559 Prefer ptrdiff_t to size_t when either would do, as we prefer
8560 signed integers.
8561 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
8562 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
8563 Now const. Initialize with values that are in range even if char
8564 is signed.
8565 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
8566 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
8567 These functions do the right thing with sizes > 2**32.
8568 (check_depth): Now ptrdiff_t, not int.
8569 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
8570 Adjust to new way of storing sizes. Check for size overflow bugs
8571 in rest of code.
8572 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
8573 slightly wrong anyway, as it missed one instance of
8574 XMALLOC_OVERRUN_CHECK_OVERHEAD.
8575 (refill_memory_reserve): Omit needless cast to size_t.
8576 (mark_object_loop_halt): Mark as externally visible.
8577
8578 * xselect.c: Integer signedness and overflow fixes.
8579 (Fx_register_dnd_atom, x_handle_dnd_message):
8580 Use ptrdiff_t, not size_t, since we prefer signed.
8581 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
8582 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
8583 x_dnd_atoms_size and x_dnd_atoms_length.
8584
8585 * doprnt.c: Prefer signed to unsigned when either works.
8586 * eval.c (verror):
8587 * doprnt.c (doprnt):
8588 * lisp.h (doprnt):
8589 * xdisp.c (vmessage):
8590 Use ptrdiff_t, not size_t, when using or implementing doprnt,
8591 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
8592 prefer signed arithmetic to avoid comparison confusion.
8593 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
8594 but is a bit tricky.
8595
8596 Assume freestanding C89 headers, string.h, stdlib.h.
8597 * data.c, doprnt.c, floatfns.c, print.c:
8598 Include float.h unconditionally.
8599 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
8600 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
8601 * regex.c: Likewise for stddef.h, string.h.
8602 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
8603 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
8604 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
8605 (STDC_HEADERS): Remove obsolete defines.
8606 * sysdep.c: Include limits.h unconditionally.
8607
8608 Assume support for memcmp, memcpy, memmove, memset.
8609 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
8610 * regex.c (memcmp, memcpy):
8611 Remove; we assume C89 now.
8612
8613 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
8614 (__malloc_safe_bcopy): Remove; no longer needed.
8615
8616 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
8617 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
8618 well either way, and we prefer signed to unsigned.
8619
8620 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
8621
8622 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
8623 closes the connection while we're reading (bug#9182).
8624
8625 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
8626
8627 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
8628 are specified (Bug#9168).
8629
8630 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
8631
8632 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
8633 Found by GCC static checking and --with-wide-int on a 32-bit host.
8634
8635 2011-07-25 Eli Zaretskii <eliz@gnu.org>
8636
8637 * xdisp.c (compute_display_string_pos): Fix logic of caching
8638 previous display string position. Initialize cached_prev_pos to
8639 -1. Fixes slow-down at the beginning of a buffer.
8640
8641 2011-07-24 Eli Zaretskii <eliz@gnu.org>
8642
8643 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
8644 for attrs[LFACE_FONTSET_INDEX].
8645
8646 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
8647
8648 * xml.c (parse_region): Remove unused local
8649 that was recently introduced.
8650
8651 2011-07-23 Eli Zaretskii <eliz@gnu.org>
8652
8653 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
8654 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
8655
8656 * xdisp.c (move_it_in_display_line_to): Record the best matching
8657 position for TO_CHARPOS while scanning the line, and restore it on
8658 exit if none of the characters scanned was an exact match.
8659 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
8660 when exact match is impossible due to invisible text, and the
8661 lines are truncated.
8662
8663 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
8664
8665 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
8666 for OSX >= 10.7.
8667
8668 2011-07-22 Eli Zaretskii <eliz@gnu.org>
8669
8670 Fix a significant slow-down of cursor motion with C-n, C-p,
8671 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
8672 auto-repeat under bidi redisplay in fontified buffers.
8673 * xdisp.c (compute_stop_pos_backwards): New function.
8674 (next_element_from_buffer): Call compute_stop_pos_backwards to
8675 find a suitable prev_stop when we find ourselves before
8676 base_level_stop.
8677 (reseat): Don't look for prev_stop, as that could mean a very long
8678 run.
8679 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
8680 <cached_disp_overlay_modiff>: Cache for last found display string
8681 position.
8682 (compute_display_string_pos): Return the cached position if asked
8683 about the same buffer in the same area of character positions, and
8684 the buffer wasn't changed since the time the display string
8685 position was cached.
8686
8687 2011-07-22 Eli Zaretskii <eliz@gnu.org>
8688
8689 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
8690 is an integer, which is important for empty lines. (Bug#9149)
8691
8692 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
8693
8694 * frame.c (Fmodify_frame_parameters): In tty case, update the
8695 default face if necessary (Bug#4238).
8696
8697 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
8698
8699 * editfns.c (Fstring_to_char): No need to explain what a character
8700 is in the docstring (Bug#6576).
8701
8702 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
8703
8704 * xml.c (parse_region): Make sure we always return a tree.
8705
8706 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
8707
8708 * xml.c (parse_region): If a document contains only comments,
8709 return that, too.
8710
8711 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
8712
8713 * xml.c (make_dom): Return comments, too.
8714
8715 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
8716
8717 Port to OpenBSD.
8718 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
8719 and the surrounding thread.
8720 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
8721 rather than fgets, and retry after EINTR. Otherwise, 'emacs
8722 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
8723 timer goes off.
8724 * s/openbsd.h (BROKEN_SIGIO): Define.
8725 * unexelf.c (unexec) [__OpenBSD__]:
8726 Don't update the .mdebug section of the Alpha COFF symbol table.
8727
8728 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
8729
8730 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
8731 (bug#8460).
8732
8733 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
8734
8735 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
8736 This fixes some race conditions on the permissions of any newly
8737 created file.
8738
8739 * alloc.c (valid_pointer_p): Use pipe, not open.
8740 This fixes some permissions issues when debugging.
8741
8742 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
8743 If fchown fails to set both uid and gid, try to set just gid,
8744 as that is sometimes allowed. Adjust the file's mode to eliminate
8745 setuid or setgid bits that are inappropriate if fchown fails.
8746
8747 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
8748
8749 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
8750 to compare Lisp_Objects.
8751 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
8752 global_gnutls_log_level, don't mistake it for a Lisp_Object.
8753 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
8754
8755 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
8756
8757 * lread.c (read_integer): Unread even EOF character.
8758 (read1): Likewise. Properly record start position of symbol.
8759
8760 * lread.c (read1): Read `#:' as empty uninterned symbol if no
8761 symbol character follows.
8762
8763 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
8764
8765 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
8766 This works around a problem with the previous change to Fcopy_file.
8767 Recent glibc declares fchown with __attribute__((warn_unused_result)),
8768 and without this change, GCC might complain about discarding
8769 fchown's return value.
8770
8771 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
8772
8773 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
8774
8775 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
8776
8777 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
8778
8779 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
8780
8781 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
8782 it's used from the C level.
8783
8784 * process.c: Use the same condition for POLL_FOR_INPUT in both
8785 keyboard.c and process.c (bug#1858).
8786
8787 2011-07-09 Lawrence Mitchell <wence@gmx.li>
8788
8789 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
8790 (Fgnutls_boot): Use it.
8791
8792 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
8793
8794 * doc.c (Fsubstitute_command_keys): Revert last change.
8795
8796 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
8797
8798 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
8799 quotes the next character, and doesn't affect other longer
8800 sequences (bug#8935).
8801
8802 * lread.c (syms_of_lread): Clarify that is isn't only
8803 `eval-buffer' and `eval-defun' that's affected by
8804 `lexical-binding' (bug#8460).
8805
8806 2011-07-15 Eli Zaretskii <eliz@gnu.org>
8807
8808 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
8809 bidi redisplay when a line includes both an image and is truncated.
8810
8811 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
8812
8813 Fix minor problems found by static checking.
8814 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
8815 (elsz): Now a signed constant, not a size_t var. We prefer signed
8816 types to unsigned, to avoid integer comparison confusion. Without
8817 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
8818 "cannot optimize loop, the loop counter may overflow", a symptom
8819 of the confusion.
8820 * indent.c (Fvertical_motion): Mark locals as initialized.
8821 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
8822
8823 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
8824
8825 * search.c (Fre_search_backward): Mention `case-fold-search' in
8826 all the re_search_* functions (bug#8138).
8827
8828 * keyboard.c (Fopen_dribble_file): Document when the file is
8829 closed (bug#8056).
8830
8831 2011-07-14 Eli Zaretskii <eliz@gnu.org>
8832
8833 * bidi.c (bidi_dump_cached_states): Fix format of displaying
8834 bidi_cache_idx.
8835
8836 Support bidi reordering of display and overlay strings.
8837 * xdisp.c (compute_display_string_pos)
8838 (compute_display_string_end): Accept additional argument STRING.
8839 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
8840 (reseat_to_string): Initialize bidi_it->string.s and
8841 bidi_it->string.schars.
8842 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
8843 NULL (avoids a crash in bidi_paragraph_init).
8844 Initialize itb.string.lstring.
8845 (init_iterator): Call bidi_init_it only of a valid
8846 buffer position was specified. Initialize paragraph_embedding to
8847 L2R.
8848 (reseat_to_string): Initialize the bidi iterator.
8849 (display_string): If we need to ignore text properties of
8850 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
8851 original value of -1 will not work with bidi.)
8852 (compute_display_string_pos): First arg is now struct
8853 `text_pos *'; all callers changed. Support display properties on
8854 Lisp strings.
8855 (compute_display_string_end): Support display properties on Lisp
8856 strings.
8857 (init_iterator, reseat_1, reseat_to_string): Initialize the
8858 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
8859 when iterating on a string not from display properties).
8860 (compute_display_string_pos, compute_display_string_end):
8861 Fix calculation of the object to scan. Fixes an error when using
8862 arrow keys.
8863 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
8864 base_level_stop; instead, set base_level_stop to BEGV.
8865 Fixes crashes in vertical-motion.
8866 (next_element_from_buffer): Improve commentary for when
8867 the iterator is before prev_stop.
8868 (init_iterator): Initialize bidi_p from the default value of
8869 bidi-display-reordering, not from buffer-local value. Use the
8870 buffer-local value only if initializing for buffer iteration.
8871 (handle_invisible_prop): Support invisible properties on strings
8872 that are being bidi-reordered.
8873 (set_iterator_to_next): Support bidi reordering of C strings and
8874 Lisp strings.
8875 (next_element_from_string): Support bidi reordering of Lisp
8876 strings.
8877 (handle_stop_backwards): Support Lisp strings as well.
8878 (display_string): Support display of R2L glyph rows.
8879 Use IT_STRING_CHARPOS when displaying from a Lisp string.
8880 (init_iterator): Don't initialize it->bidi_p for strings
8881 here.
8882 (reseat_to_string): Initialize it->bidi_p for strings here.
8883 (next_element_from_string, next_element_from_c_string)
8884 (next_element_from_buffer): Add xassert's for correspondence
8885 between IT's object being iterated and it->bidi_it.string
8886 structure.
8887 (face_before_or_after_it_pos): Support bidi iteration.
8888 (next_element_from_c_string): Handle the case of the first string
8889 character that is not the first one in the visual order.
8890 (get_visually_first_element): New function, refactored from common
8891 parts of next_element_from_buffer, next_element_from_string, and
8892 next_element_from_c_string.
8893 (tool_bar_lines_needed, redisplay_tool_bar)
8894 (display_menu_bar): Force left-to-right direction. Add a FIXME
8895 comment for making that be controlled by a user option.
8896 (push_it, pop_it): Save and restore the state of the
8897 bidi iterator. Save and restore the bidi_p flag.
8898 (pop_it): Iterate out of display property for string iteration as
8899 well.
8900 (iterate_out_of_display_property): Support iteration over strings.
8901 (handle_single_display_spec): Set up it->bidi_it for iteration
8902 over a display string, and call bidi_init_it.
8903 (handle_single_display_spec, next_overlay_string)
8904 (get_overlay_strings_1, push_display_prop): Set up the bidi
8905 iterator for displaying display or overlay strings.
8906 (forward_to_next_line_start): Don't use the shortcut if
8907 bidi-iterating.
8908 (back_to_previous_visible_line_start): If handle_display_prop
8909 pushed the iterator stack, restore the internal state of the bidi
8910 iterator by calling bidi_pop_it same number of times.
8911 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
8912 and we are bidi-iterating, don't decrement the iterator position;
8913 instead, set the first_elt flag in the bidi iterator, to produce
8914 the same effect.
8915 (reseat_1): Remove redundant setting of string_from_display_prop_p.
8916 (push_display_prop): xassert that we are iterating a buffer.
8917 (push_it, pop_it): Save and restore paragraph_embedding member.
8918 (handle_single_display_spec, next_overlay_string)
8919 (get_overlay_strings_1, reseat_1, reseat_to_string)
8920 (push_display_prop): Set up the `unibyte' member of bidi_it.string
8921 correctly. Don't assume unibyte strings are not bidi-reordered.
8922 (compute_display_string_pos)
8923 (compute_display_string_end): Fix handling the case of C string.
8924 (push_it, pop_it): Save and restore from_disp_prop_p.
8925 (handle_single_display_spec, push_display_prop): Set the
8926 from_disp_prop_p flag.
8927 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
8928 (pop_it): Call iterate_out_of_display_property only if we are
8929 popping after iteration over a string that came from a display
8930 property. Fix a typo in popping stretch info. Add an assertion
8931 for verifying that the iterator position is in sync with the bidi
8932 iterator.
8933 (handle_single_display_spec, get_overlay_strings_1)
8934 (push_display_prop): Fix initialization of paragraph direction for
8935 string when that of the parent object is not yet determined.
8936 (reseat_1): Call bidi_init_it to resync the bidi
8937 iterator with IT's position. (Bug#7616)
8938 (find_row_edges): If ROW->start.pos gives position
8939 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
8940 (handle_stop, back_to_previous_visible_line_start, reseat_1):
8941 Reset the from_disp_prop_p flag.
8942 (SAVE_IT, RESTORE_IT): New macros.
8943 (pos_visible_p, face_before_or_after_it_pos)
8944 (back_to_previous_visible_line_start)
8945 (move_it_in_display_line_to, move_it_in_display_line)
8946 (move_it_to, move_it_vertically_backward, move_it_by_lines)
8947 (try_scrolling, redisplay_window, display_line): Use them when
8948 saving a temporary copy of the iterator and restoring it back.
8949 (back_to_previous_visible_line_start, reseat_1)
8950 (init_iterator): Empty the bidi cache "stack".
8951 (move_it_in_display_line_to): If iterator ended up at
8952 EOL, but we never saw any buffer positions smaller than
8953 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
8954 motion in bidi-reordered lines.
8955 (move_it_in_display_line_to): Record prev_method and prev_pos
8956 immediately before the call to set_iterator_to_next. Fixes cursor
8957 motion in bidi-reordered lines with stretch glyphs and strings
8958 displayed in margins. (Bug#8133) (Bug#8867)
8959 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
8960 TO_CHARPOS.
8961 (pos_visible_p): Support positions in bidi-reordered lines.
8962 Save and restore bidi cache.
8963
8964 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
8965 (bidi_paragraph_info): Delete unused struct.
8966 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
8967 (bidi_cache_start): New variable.
8968 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
8969 to zero.
8970 (bidi_cache_fetch_state, bidi_cache_search)
8971 (bidi_cache_find_level_change, bidi_cache_iterator_state)
8972 (bidi_cache_find, bidi_peek_at_next_level)
8973 (bidi_level_of_next_char, bidi_find_other_level_edge)
8974 (bidi_move_to_visually_next): Compare cache index with
8975 bidi_cache_start rather than with zero.
8976 (bidi_fetch_char): Accept new argument STRING; all callers
8977 changed. Support iteration over a string. Support strings with
8978 display properties. Support unibyte strings. Fix the type of
8979 `len' according to what STRING_CHAR_AND_LENGTH expects.
8980 (bidi_paragraph_init, bidi_resolve_explicit_1)
8981 (bidi_resolve_explicit, bidi_resolve_weak)
8982 (bidi_level_of_next_char, bidi_move_to_visually_next):
8983 Support iteration over a string.
8984 (bidi_set_sor_type, bidi_resolve_explicit_1)
8985 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
8986 can now be zero (for strings); special values 0 and -1 were
8987 changed to -1 and -2, respectively.
8988 (bidi_char_at_pos): New function.
8989 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
8990 Call it instead of FETCH_MULTIBYTE_CHAR.
8991 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
8992 initialized to valid values.
8993 (bidi_init_it): Don't initialize charpos and bytepos with invalid
8994 values.
8995 (bidi_level_of_next_char): Allow the sentinel "position" to pass
8996 the test for valid cached positions. Fix the logic for looking up
8997 the sentinel state in the cache. GCPRO the Lisp string we are
8998 iterating.
8999 (bidi_push_it, bidi_pop_it): New functions.
9000 (bidi_initialize): Initialize the bidi cache start stack pointer.
9001 (bidi_cache_ensure_space): New function, refactored from part of
9002 bidi_cache_iterator_state. Don't assume the required size is just
9003 one BIDI_CACHE_CHUNK away.
9004 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
9005 (bidi_count_bytes, bidi_char_at_pos): New functions.
9006 (bidi_cache_search): Don't assume bidi_cache_last_idx is
9007 always valid if bidi_cache_idx is valid.
9008 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
9009 is valid if it's going to be used.
9010 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
9011 (bidi_cache_fetch_state, bidi_cache_search)
9012 (bidi_cache_find_level_change, bidi_cache_ensure_space)
9013 (bidi_cache_iterator_state, bidi_cache_find)
9014 (bidi_find_other_level_edge, bidi_cache_start_stack):
9015 All variables related to cache indices are now EMACS_INT.
9016
9017 * dispextern.h (struct bidi_string_data): New structure.
9018 (struct bidi_it): New member `string'. Make flag members be 1-bit
9019 fields, and put them last in the struct.
9020 (compute_display_string_pos, compute_display_string_end):
9021 Update prototypes.
9022 (bidi_push_it, bidi_pop_it): Add prototypes.
9023 (struct iterator_stack_entry): New members bidi_p,
9024 paragraph_embedding, and from_disp_prop_p.
9025 (struct it): Member bidi_p is now a bit field 1 bit wide.
9026 (bidi_shelve_cache, bidi_unshelve_cache):
9027 Declare prototypes.
9028
9029 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
9030 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
9031 and vector-like objects.
9032
9033 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
9034 cache around display iteration.
9035
9036 * window.c (Fwindow_end, window_scroll_pixel_based)
9037 (displayed_window_lines, Frecenter): Save and restore the bidi
9038 cache around display iteration.
9039
9040 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
9041
9042 * editfns.c (Fdelete_region): Clarify the use of the named
9043 parameters (bug#6788).
9044
9045 2011-07-14 Martin Rudalics <rudalics@gmx.at>
9046
9047 * indent.c (Fvertical_motion): Set and restore w->pointm when
9048 saving and restoring the window's buffer (Bug#9006).
9049
9050 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
9051
9052 * editfns.c (Fstring_to_char): Clarify just what is returned
9053 (bug#6576). Text by Eli Zaretskii.
9054
9055 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
9056
9057 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
9058
9059 2011-07-13 Eli Zaretskii <eliz@gnu.org>
9060
9061 * buffer.c (mmap_find): Fix a typo.
9062
9063 2011-07-13 Johan Bockgård <bojohan@gnu.org>
9064
9065 Fix execution of x selection hooks.
9066 * xselect.c (Qx_lost_selection_functions)
9067 (Qx_sent_selection_functions): New vars.
9068 (syms_of_xselect): DEFSYM them.
9069 (x_handle_selection_request): Pass Qx_sent_selection_functions
9070 rather than Vx_sent_selection_functions to Frun_hook_with_args.
9071 (x_handle_selection_clear,x_clear_frame_selections):
9072 Pass Qx_lost_selection_functions rather than
9073 Vx_lost_selection_functions to Frun_hook_with_args.
9074
9075 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
9076
9077 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
9078 The old code sometimes used this field without initializing it.
9079
9080 * alloc.c (gc_sweep): Don't read past end of array.
9081 In theory, the old code could also have corrupted Emacs internals,
9082 though it'd be very unlikely.
9083
9084 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
9085
9086 * character.c (Fcharacterp): Don't advertise optional ignored
9087 argument. (Bug#4026)
9088
9089 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
9090
9091 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
9092 key" (bug#4257).
9093
9094 * window.c (Fset_window_start): Doc fix (bug#4199).
9095 (Fset_window_hscroll): Ditto.
9096
9097 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
9098
9099 Fix minor new problems caught by GCC 4.6.1.
9100 * term.c (init_tty): Remove unused local.
9101 * xsettings.c (store_monospaced_changed): Define this function only
9102 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
9103 not used otherwise.
9104
9105 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
9106
9107 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
9108
9109 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
9110
9111 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
9112 are the mini-buffer and the echo area (bug#3320).
9113
9114 * term.c (init_tty): Remove support for supdup, c10 and perq
9115 terminals, which are no longer supported (bug#1482).
9116
9117 2011-07-10 Johan Bockgård <bojohan@gnu.org>
9118
9119 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
9120
9121 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
9122
9123 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
9124 for non-popups (Bug#3642).
9125
9126 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
9127
9128 * alloc.c (reset_malloc_hooks): Protoize.
9129 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
9130 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
9131 * cm.c (losecursor): Likewise.
9132 * data.c (fmod): Likewise.
9133 * dispnew.c (swap_glyphs_in_rows): Likewise.
9134 * emacs.c (memory_warning_signal): Likewise.
9135 * floatfns.c (float_error): Likewise.
9136 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
9137 (otf_open, font_otf_capability, generate_otf_features)
9138 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
9139 Likewise.
9140 * image.c (pbm_read_file): Likewise.
9141 * indent.c (string_display_width): Likewise.
9142 * intervals.c (check_for_interval, search_for_interval)
9143 (inc_interval_count, count_intervals, root_interval)
9144 (adjust_intervals_for_insertion, make_new_interval): Likewise.
9145 * lread.c (defalias): Likewise.
9146 * ralloc.c (r_alloc_check): Likewise.
9147 * regex.c (set_image_of_range_1, set_image_of_range)
9148 (regex_grow_registers): Likewise.
9149 * sysdep.c (strerror): Likewise.
9150 * termcap.c (valid_filename_p, tprint, main): Likewise.
9151 * tparam.c (main): Likewise.
9152 * unexhp9k800.c (run_time_remap, save_data_space)
9153 (update_file_ptrs, read_header, write_header, calculate_checksum)
9154 (copy_file, copy_rest, display_header): Likewise.
9155 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
9156 Likewise.
9157 * xdisp.c (check_it): Likewise.
9158 * xfaces.c (register_color, unregister_color, unregister_colors):
9159 Likewise.
9160 * xfns.c (print_fontset_result): Likewise.
9161 * xrdb.c (member, fatal, main): Likewise.
9162
9163 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
9164
9165 Fix minor problems found by static checking (Bug#9031).
9166 * chartab.c (char_table_set_range, map_sub_char_table):
9167 Remove unused locals.
9168 (uniprop_table): Now static.
9169 * composite.c (_work_char): Remove unused static var.
9170
9171 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
9172
9173 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
9174
9175 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
9176
9177 * gtkutil.c (qttip_cb): Remove code without function.
9178
9179 2011-07-09 Eli Zaretskii <eliz@gnu.org>
9180
9181 * w32.c (pthread_sigmask): New stub.
9182
9183 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
9184
9185 Use pthread_sigmask, not sigprocmask (Bug#9010).
9186 sigprocmask is portable only for single-threaded applications, and
9187 Emacs can be multi-threaded when it uses GTK.
9188 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
9189 (LIBES): Use it.
9190 * callproc.c (Fcall_process):
9191 * process.c (create_process):
9192 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
9193 Use pthread_sigmask, not sigprocmask.
9194
9195 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
9196
9197 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
9198 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
9199 wrong (Bug#8591).
9200
9201 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
9202
9203 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
9204 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
9205 (xg_hide_tooltip): Fix comment.
9206
9207 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
9208 in registerServicesMenuSendTypes.
9209 (validRequestorForSendType): Don't check ns_return_types.
9210
9211 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
9212 ns_return_type.
9213
9214 2011-07-08 Jason Rumney <jasonr@gnu.org>
9215
9216 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
9217 SH_SHOW for hidden windows (Bug#5482).
9218
9219 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
9220 frame struct members of non-existent frames (Bug#6284).
9221
9222 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
9223
9224 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
9225 variable firstTime not needed on OSX >= 10.6.
9226 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
9227 >= 10.5. Use setKnobProportion, setDoubleValue.
9228
9229 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
9230 (MAC_OS_X_VERSION_10_5): Define if not defined.
9231 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
9232 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
9233 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
9234
9235 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
9236 cString and lossyCString on OSX >= 10.4.
9237
9238 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
9239 sizeToFit on OSX >= 10.2.
9240
9241 * nsimage.m (allocInitFromFile): Don't use deprecated method
9242 bestRepresentationForDevice on OSX >= 10.6.
9243
9244 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
9245 to avoid warning.
9246
9247 * emacs.c: Declare unexec_init_emacs_zone.
9248
9249 * nsgui.h: Fix compiler warning about gnulib redefining verify.
9250
9251 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
9252
9253 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
9254 on svcsMenu (Bug#8842).
9255
9256 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
9257 ns_return_types.
9258 (Fns_list_services): Just return Qnil on 10.6, code not working there.
9259
9260 * nsterm.m (QUTF8_STRING): Declare.
9261 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
9262 (validRequestorForSendType): Return type is (id).
9263 Change indexOfObjectIdenticalTo to indexOfObject.
9264 Check if we have local selection before returning self (Bug#8842).
9265 (writeSelectionToPasteboard): Put local selection into paste board
9266 if we have a local selection (Bug#8842).
9267 (syms_of_nsterm): DEFSYM QUTF8_STRING.
9268
9269 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
9270 (ns_get_local_selection): Declare.
9271
9272 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
9273
9274 * keymap.c (describe_map_tree): Don't insert a double newline at
9275 the end of the buffer (bug#1169) and return whether we inserted
9276 something.
9277
9278 * callint.c (Fcall_interactively): Change "reading args" to
9279 "providing args" to try to clarify what it does (bug#1010).
9280
9281 2011-07-07 Kenichi Handa <handa@m17n.org>
9282
9283 * composite.c (composition_compute_stop_pos): Ignore a static
9284 composition starting before CHARPOS (Bug#8915).
9285
9286 * xdisp.c (handle_composition_prop): Likewise.
9287
9288 2011-07-07 Eli Zaretskii <eliz@gnu.org>
9289
9290 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
9291 (Bug#9015)
9292
9293 2011-07-07 Kenichi Handa <handa@m17n.org>
9294
9295 * character.h (unicode_category_t): New enum type.
9296
9297 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
9298 (Qchar_code_property_table): New variable.
9299 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
9300 (UNIPROP_COMPRESSED_FORM_P): New macros.
9301 (char_table_ascii): Uncompress the compressed values.
9302 (sub_char_table_ref): New arg is_uniprop. Callers changed.
9303 Uncompress the compressed values.
9304 (sub_char_table_ref_and_range): Likewise.
9305 (char_table_ref_and_range): Uncompress the compressed values.
9306 (sub_char_table_set): New arg is_uniprop. Callers changed.
9307 Uncompress the compressed values.
9308 (sub_char_table_set_range): Args changed. Callers changed.
9309 (char_table_set_range): Adjuted for the above change.
9310 (map_sub_char_table): Delete args default_val and parent. Add arg
9311 top. Give decoded values to a Lisp function.
9312 (map_char_table): Adjust for the above change. Give decoded
9313 values to a Lisp function. Gcpro more variables.
9314 (uniprop_table_uncompress)
9315 (uniprop_decode_value_run_length): New functions.
9316 (uniprop_decoder, uniprop_decoder_count): New variables.
9317 (uniprop_get_decoder, uniprop_encode_value_character)
9318 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
9319 New functions.
9320 (uniprop_encoder, uniprop_encoder_count): New variables.
9321 (uniprop_get_encoder, uniprop_table)
9322 (Funicode_property_table_internal, Fget_unicode_property_internal)
9323 (Fput_unicode_property_internal): New functions.
9324 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
9325 Sunicode_property_table_internal, Sget_unicode_property_internal,
9326 and Sput_unicode_property_internal. Defvar_lisp
9327 char-code-property-alist.
9328
9329 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
9330 Vunicode_category_table.
9331
9332 * font.c (font_range): Adjust for the change of
9333 Vunicode_category_table.
9334
9335 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
9336
9337 * m/iris4d.h: Remove file, move contents ...
9338 * s/irix6-5.h: ... here.
9339
9340 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
9341
9342 Remove unportable assumption about struct layout (Bug#8884).
9343 * alloc.c (mark_buffer):
9344 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
9345 (clone_per_buffer_values): Don't assume that
9346 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
9347 This isn't true in general, and it's particularly not true
9348 if Emacs is configured with --with-wide-int.
9349 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
9350 New macros, used in the buffer.c change.
9351
9352 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
9353
9354 * xsettings.c: Use both GConf and GSettings if both are available.
9355 (store_config_changed_event): Add comment.
9356 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
9357 (store_tool_bar_style_changed): New functions.
9358 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
9359 (struct xsettings): Move font inside HAVE_XFT.
9360 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
9361 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
9362 Move inside HAVE_XFT.
9363 (something_changed_gsettingsCB): Rename from something_changedCB.
9364 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
9365 also.
9366 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
9367 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
9368 (something_changed_gconfCB): Rename from something_changedCB.
9369 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
9370 (parse_settings): Move check for font inside HAVE_XFT.
9371 (read_settings, apply_xft_settings): Add comment.
9372 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
9373 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
9374 call store_font_name_changed.
9375 (xft_settings_event): Add comment.
9376 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
9377 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
9378 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
9379 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
9380 (xsettings_initialize): Call init_gsettings last.
9381 (xsettings_get_system_font, xsettings_get_system_normal_font):
9382 Add comment.
9383
9384 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
9385
9386 Random fixes. E.g., (random) never returned negative values.
9387 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
9388 subseconds part to the entropy, as that's a bit more random.
9389 Prefer signed to unsigned, since the signedness doesn't matter and
9390 in general we prefer signed. When given a limit, use a
9391 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
9392 latter isn't right if USE_2_TAGS_FOR_INTS.
9393 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
9394 not 0..VALMASK. Don't discard "excess" bits that random () returns.
9395
9396 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
9397
9398 * textprop.c (text_property_stickiness):
9399 Obey Vtext_property_default_nonsticky.
9400 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
9401 * w32fns.c (syms_of_w32fns):
9402 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
9403
9404 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
9405
9406 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
9407 This is more efficient than Ffile_directory_p and avoids a minor race.
9408
9409 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
9410
9411 * buffer.c (Foverlay_put): Say what the return value is
9412 (bug#7835).
9413
9414 * fileio.c (barf_or_query_if_file_exists): Check first if the file
9415 is a directory before asking whether to use the file name
9416 (bug#7564).
9417 (barf_or_query_if_file_exists): Make the "File is a directory"
9418 error be more correct.
9419
9420 * fns.c (Frequire): Remove the mention of the .gz files, since
9421 that's installation-specific, but keep the mention of
9422 `get-load-suffixes'.
9423
9424 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
9425
9426 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
9427 Report string overflow if the output is too long.
9428
9429 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
9430
9431 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
9432 (syms_of_gnutls): Remove duplicate DEFSYM for
9433 Qgnutls_bootprop_verify_hostname_error, an error for
9434 Qgnutls_bootprop_verify_error (which is no longer used).
9435
9436 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
9437 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
9438 Also (re)move comments that are misplaced or no longer relevant.
9439
9440 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
9441
9442 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
9443
9444 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
9445
9446 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
9447 and background color parameters if they have been changed.
9448
9449 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
9450
9451 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
9452
9453 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
9454
9455 * xsettings.c (SYSTEM_FONT): Define only when used.
9456 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
9457
9458 * keymap.c (access_keymap_1): Now static.
9459
9460 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
9461
9462 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
9463 leave any prefix arg for the up event (Bug#1586).
9464
9465 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
9466
9467 * lread.c (syms_of_lread): Mention single symbols defined by
9468 `defvar' or `defconst' (bug#7154).
9469
9470 * fns.c (Frequire): Mention .el.gz files (bug#7314).
9471 (Frequire): Mention get-load-suffixes.
9472
9473 2011-07-02 Martin Rudalics <rudalics@gmx.at>
9474
9475 * window.h (window): Remove clone_number slot.
9476 * window.c (Fwindow_clone_number, Fset_window_clone_number):
9477 Remove.
9478 (make_parent_window, make_window, saved_window)
9479 (Fset_window_configuration, save_window_save): Don't deal with
9480 clone numbers.
9481 * buffer.c (Qclone_number): Remove declaration.
9482 (sort_overlays, overlay_strings): Don't deal with clone numbers.
9483
9484 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
9485
9486 Add multiple inheritance to keymaps.
9487 * keymap.c (Fmake_composed_keymap): New function.
9488 (Fset_keymap_parent): Simplify.
9489 (fix_submap_inheritance): Remove.
9490 (access_keymap_1): New function extracted from access_keymap to handle
9491 embedded parents and handle lists of maps.
9492 (access_keymap): Use it.
9493 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
9494 (Fcopy_keymap): Handle embedded parents.
9495 (Fcommand_remapping, define_as_prefix): Simplify.
9496 (Fkey_binding): Simplify.
9497 (syms_of_keymap): Move minibuffer-local-completion-map,
9498 minibuffer-local-filename-completion-map,
9499 minibuffer-local-must-match-map, and
9500 minibuffer-local-filename-must-match-map to Elisp.
9501 (syms_of_keymap): Defsubr make-composed-keymap.
9502 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
9503 (parse_menu_item): Trivial simplification.
9504
9505 2011-07-01 Glenn Morris <rgm@gnu.org>
9506
9507 * Makefile.in (SETTINGS_LIBS): Fix typo.
9508
9509 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
9510
9511 * coding.c (Fencode_coding_string): Record the last coding system
9512 used, as the function doc string says (bug#8738).
9513
9514 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
9515
9516 * xsettings.c (store_monospaced_changed): Take new font as arg and
9517 check for change against current_mono_font.
9518 (EMACS_TYPE_SETTINGS): Remove this and related defines.
9519 (emacs_settings_constructor, emacs_settings_get_property)
9520 (emacs_settings_set_property, emacs_settings_class_init)
9521 (emacs_settings_init, gsettings_obj): Remove.
9522 (something_changedCB): New function for HAVE_GSETTINGS.
9523 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
9524 with value as argument.
9525 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
9526 g_settings_new (Bug#8967). Do not create gsettings_obj.
9527 Remove calls to g_settings_bind. Connect something_changedCB to
9528 "changed".
9529
9530 * xgselect.c: Add defined (HAVE_GSETTINGS).
9531 (xgselect_initialize): Ditto.
9532
9533 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
9534 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
9535 xg_select.
9536
9537 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
9538
9539 * eval.c (struct backtrace): Simplify and port the data structure.
9540 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
9541 signed bit field, as this assumption is not portable and it makes
9542 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
9543 "char debug_on_exit : 1" as this is not portable either; instead,
9544 use the portable "unsigned int debug_on_exit : 1". Remove unused
9545 member evalargs. Remove obsolete comments about cc bombing out.
9546
9547 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
9548
9549 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9550 Let HAVE_GSETTINGS override HAVE_GCONF.
9551 (store_monospaced_changed): New function.
9552 (EMACS_SETTINGS): A new type derived from GObject to handle
9553 GSettings notifications.
9554 (emacs_settings_constructor, emacs_settings_get_property)
9555 (emacs_settings_set_property, emacs_settings_class_init):
9556 New functions.
9557 (gsettings_client, gsettings_obj): New variables.
9558 (GSETTINGS_SCHEMA): New define.
9559 (something_changedCB): Call store_monospaced_changed.
9560 (init_gsettings): New function.
9561 (xsettings_initialize): Call init_gsettings.
9562 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
9563 to NULL.
9564
9565 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9566 GCONF_CFLAGS/LIBS.
9567
9568 2011-06-29 Martin Rudalics <rudalics@gmx.at>
9569
9570 * window.c (resize_root_window, grow_mini_window)
9571 (shrink_mini_window): Rename Qresize_root_window to
9572 Qwindow_resize_root_window and Qresize_root_window_vertically to
9573 Qwindow_resize_root_window_vertically.
9574
9575 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
9576
9577 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
9578
9579 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
9580
9581 * makefile.w32-in: Redesign dependencies so they reflect more
9582 clearly which files are directly included by each source file,
9583 and not through other includes.
9584
9585 2011-06-27 Martin Rudalics <rudalics@gmx.at>
9586
9587 * buffer.c (Qclone_number): Declare static and DEFSYM it.
9588 (sort_overlays, overlay_strings): When an overlay's clone number
9589 matches the window's clone number process the overlay even if
9590 the overlay's window property doesn't match the current window.
9591
9592 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
9593 (Fwindow_hchild): Rename to Fwindow_left_child.
9594 (Fwindow_next): Rename to Fwindow_next_sibling.
9595 (Fwindow_prev): Rename to Fwindow_prev_sibling.
9596 (resize_window_check): Rename to window_resize_check.
9597 (resize_window_apply): Rename to window_resize_apply.
9598 (Fresize_window_apply): Rename to Fwindow_resize_apply.
9599 (Fdelete_other_windows_internal, resize_frame_windows)
9600 (Fsplit_window_internal, Fdelete_window_internal)
9601 (grow_mini_window, shrink_mini_window)
9602 (Fresize_mini_window_internal): Fix callers accordingly.
9603
9604 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
9605
9606 * emacsgtkfixed.h: State that this is only used with Gtk+3.
9607 (emacs_fixed_set_min_size): Remove.
9608 (emacs_fixed_new): Take frame as argument.
9609
9610 * emacsgtkfixed.c: State that this is only used with Gtk+3.
9611 (_EmacsFixedPrivate): Remove minwidth/height.
9612 Add struct frame *f.
9613 (emacs_fixed_init): Initialize priv->f.
9614 (get_parent_class, emacs_fixed_set_min_size): Remove.
9615 (emacs_fixed_new): Set priv->f to argument.
9616 (emacs_fixed_get_preferred_width)
9617 (emacs_fixed_get_preferred_height): Use min_width/height from
9618 frames size_hint to set minimum and natural (Bug#8919).
9619 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
9620 and use min_width/height from frames size_hint to set
9621 min_width/height (Bug#8919).
9622
9623 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9624 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
9625 Fix indentation.
9626
9627 2011-06-26 Eli Zaretskii <eliz@gnu.org>
9628
9629 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
9630 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
9631 called at ZV.
9632
9633 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
9634
9635 * process.c (wait_reading_process_output): Bypass select if
9636 waiting for a cell while ignoring keyboard input, and input is
9637 pending. Suggested by Jan Djärv (Bug#8869).
9638
9639 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
9640
9641 Use gnulib's dup2 module instead of rolling our own.
9642 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
9643
9644 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9645
9646 * dispnew.c (scrolling_window): Before scrolling, turn off a
9647 mouse-highlight in the window being scrolled.
9648
9649 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
9650
9651 Move DEFSYM to lisp.h and use everywhere.
9652
9653 * character.h (DEFSYM): Move declaration...
9654 * lisp.h (DEFSYM): ...here.
9655
9656 * gnutls.c:
9657 * minibuf.c:
9658 * w32menu.c:
9659 * w32proc.c:
9660 * w32select.c: Don't include character.h.
9661
9662 * alloc.c (syms_of_alloc):
9663 * buffer.c (syms_of_buffer):
9664 * bytecode.c (syms_of_bytecode):
9665 * callint.c (syms_of_callint):
9666 * casefiddle.c (syms_of_casefiddle):
9667 * casetab.c (init_casetab_once):
9668 * category.c (init_category_once, syms_of_category):
9669 * ccl.c (syms_of_ccl):
9670 * cmds.c (syms_of_cmds):
9671 * composite.c (syms_of_composite):
9672 * dbusbind.c (syms_of_dbusbind):
9673 * dired.c (syms_of_dired):
9674 * dispnew.c (syms_of_display):
9675 * doc.c (syms_of_doc):
9676 * editfns.c (syms_of_editfns):
9677 * emacs.c (syms_of_emacs):
9678 * eval.c (syms_of_eval):
9679 * fileio.c (syms_of_fileio):
9680 * fns.c (syms_of_fns):
9681 * frame.c (syms_of_frame):
9682 * fringe.c (syms_of_fringe):
9683 * insdel.c (syms_of_insdel):
9684 * keymap.c (syms_of_keymap):
9685 * lread.c (init_obarray, syms_of_lread):
9686 * macros.c (syms_of_macros):
9687 * msdos.c (syms_of_msdos):
9688 * print.c (syms_of_print):
9689 * process.c (syms_of_process):
9690 * search.c (syms_of_search):
9691 * sound.c (syms_of_sound):
9692 * syntax.c (init_syntax_once, syms_of_syntax):
9693 * terminal.c (syms_of_terminal):
9694 * textprop.c (syms_of_textprop):
9695 * undo.c (syms_of_undo):
9696 * w32.c (globals_of_w32):
9697 * window.c (syms_of_window):
9698 * xdisp.c (syms_of_xdisp):
9699 * xfaces.c (syms_of_xfaces):
9700 * xfns.c (syms_of_xfns):
9701 * xmenu.c (syms_of_xmenu):
9702 * xsettings.c (syms_of_xsettings):
9703 * xterm.c (syms_of_xterm): Use DEFSYM.
9704
9705 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
9706
9707 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
9708
9709 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
9710
9711 Integer and buffer overflow fixes (Bug#8873).
9712
9713 * print.c (printchar, strout): Check for string overflow.
9714 (PRINTPREPARE, printchar, strout):
9715 Don't set size unless allocation succeeds.
9716
9717 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
9718 for sizes. Check for string overflow more accurately.
9719 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
9720
9721 * macros.c: Integer and buffer overflow fixes.
9722 * keyboard.h (struct keyboard.kbd_macro_bufsize):
9723 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
9724 Use ptrdiff_t, not int, for sizes.
9725 Don't increment bufsize until after realloc succeeds.
9726 Check for size-calculation overflow.
9727 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
9728
9729 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
9730
9731 * lread.c: Integer overflow fixes.
9732 (read_integer): Radix is now EMACS_INT, not int,
9733 to improve quality of diagnostics for out-of-range radices.
9734 Calculate buffer size correctly for out-of-range radices.
9735 (read1): Check for integer overflow in radices, and in
9736 read-circle numbers.
9737 (read_escape): Avoid int overflow.
9738 (Fload, openp, read_buffer_size, read1)
9739 (substitute_object_recurse, read_vector, read_list, map_obarray):
9740 Use ptrdiff_t, not int, for sizes.
9741 (read1): Use EMACS_INT, not int, for sizes.
9742 Check for size overflow.
9743
9744 * image.c (cache_image): Check for size arithmetic overflow.
9745
9746 * lread.c: Integer overflow issues.
9747 (saved_doc_string_size, saved_doc_string_length)
9748 (prev_saved_doc_string_size, prev_saved_doc_string_length):
9749 Now ptrdiff_t, not int.
9750 (read1): Don't assume doc string length fits in int. Check for
9751 out-of-range doc string lengths.
9752 (read_list): Don't assume file position fits in int.
9753 (read_escape): Check for hex character overflow.
9754
9755 2011-06-22 Leo Liu <sdl.web@gmail.com>
9756
9757 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
9758 Move to minibuffer.el.
9759
9760 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
9761
9762 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
9763 The following patches are for when GLYPH_DEBUG && !XASSERT.
9764 * dispextern.h (trace_redisplay_p, dump_glyph_string):
9765 * dispnew.c (flush_stdout):
9766 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
9767 Mark as externally visible.
9768 * dispnew.c (check_window_matrix_pointers): Now static.
9769 * dispnew.c (window_to_frame_vpos):
9770 * xfns.c (unwind_create_frame):
9771 * xterm.c (x_check_font): Remove unused local.
9772 * scroll.c (CHECK_BOUNDS):
9773 * xfaces.c (cache_fache): Rename local to avoid shadowing.
9774 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
9775 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
9776 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
9777 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
9778 Now static.
9779 (debug_method_add): Use va_list and vsprintf rather than relying
9780 on undefined behavior with wrong number of arguments.
9781 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
9782 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
9783 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
9784 since we're not interested in debugging glyphs with old libraries.
9785 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
9786 GCC 4.6.0's static checking.
9787
9788 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
9789
9790 Integer overflow and signedness fixes (Bug#8873).
9791 A few related buffer overrun fixes, too.
9792
9793 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
9794
9795 * dispextern.h (struct face.stipple):
9796 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
9797 (x_bitmap_mask, x_allocate_bitmap_record)
9798 (x_create_bitmap_from_data, x_create_bitmap_from_file)
9799 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
9800 (x_create_bitmap_from_xpm_data):
9801 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
9802 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
9803 (.bitmaps_last):
9804 * xfaces.c (load_pixmap):
9805 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
9806 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
9807 (.bitmaps_last, struct x_output.icon_bitmap):
9808 Use ptrdiff_t, not int, for bitmap indexes.
9809 (x_allocate_bitmap_record): Check for size overflow.
9810 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
9811
9812 Use ptrdiff_t, not int, for overlay counts.
9813 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
9814 * editfns.c (overlays_around, get_pos_property):
9815 * textprop.c (get_char_property_and_overlay):
9816 * xdisp.c (next_overlay_change, note_mouse_highlight):
9817 * xfaces.c (face_at_buffer_position):
9818 * buffer.c (OVERLAY_COUNT_MAX): New macro.
9819 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
9820 (Fnext_overlay_change, Fprevious_overlay_change)
9821 (mouse_face_overlay_overlaps, Foverlays_in):
9822 Use ptrdiff_t, not int, for sizes.
9823 (overlays_at, overlays_in): Check for size-calculation overflow.
9824
9825 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
9826
9827 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
9828 (x_session_initialize): Do not assume string length fits in int.
9829
9830 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
9831 This is unlikely, but can occur if DPI is outlandish.
9832
9833 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
9834 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
9835
9836 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
9837 * xrdb.c (magic_file_p, search_magic_path):
9838 Omit last arg SUFFIX; it was always 0. All callers changed.
9839 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
9840
9841 * xfont.c (xfont_match): Avoid need for strlen.
9842
9843 * xfns.c: Don't assume strlen fits in int.
9844 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
9845
9846 * xdisp.c (message_log_check_duplicate): Return intmax_t,
9847 not unsigned long, as we prefer signed integers. All callers changed.
9848 Detect integer overflow in repeat count.
9849 (message_dolog): Don't assume print length fits in 39 bytes.
9850 (display_mode_element): Don't assume strlen fits in int.
9851
9852 * termcap.c: Don't assume sizes fit in int and never overflow.
9853 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
9854 (gobble_line): Check for size-calculation overflow.
9855
9856 * minibuf.c (Fread_buffer):
9857 * lread.c (intern, intern_c_string):
9858 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
9859 Don't assume string length fits in int.
9860
9861 * keyboard.c (parse_tool_bar_item):
9862 * gtkutil.c (style_changed_cb): Avoid need for strlen.
9863
9864 * font.c: Don't assume string length fits in int.
9865 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
9866 Use ptrdiff_t, not int.
9867 (font_intern_prop): Don't assume string length fits in int.
9868 Don't assume integer property fits in fixnum.
9869 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
9870
9871 * filelock.c: Fix some buffer overrun and integer overflow issues.
9872 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
9873 Reformulate so as not to need the command string.
9874 Invoke gzip -cd rather than gunzip, as it's more portable.
9875 (lock_info_type, lock_file_1, lock_file):
9876 Don't assume pid_t and time_t fit in unsigned long.
9877 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
9878 (current_lock_owner): Prefer signed type for sizes.
9879 Use memcpy, not strncpy, where memcpy is what is really wanted.
9880 Don't assume (via atoi) that time_t and pid_t fit in int.
9881 Check for time_t and/or pid_t out of range, e.g., via a network share.
9882 Don't alloca where an auto var works fine.
9883
9884 * fileio.c: Fix some integer overflow issues.
9885 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
9886 Don't assume string length fits in int.
9887 (directory_file_name): Don't assume string length fits in long.
9888 (make_temp_name): Don't assume pid fits in int, or that its print
9889 length is less than 20.
9890
9891 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
9892
9893 * coding.c (make_subsidiaries): Don't assume string length fits in int.
9894
9895 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
9896
9897 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
9898 We prefer signed integers, even for size calculations.
9899
9900 * emacs.c: Don't assume string length fits in 'int'.
9901 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
9902 (main): Don't invoke strlen when not needed.
9903
9904 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
9905 (XD_DEBUG_MESSAGE): Don't waste a byte.
9906
9907 * callproc.c (getenv_internal_1, getenv_internal)
9908 (Fgetenv_internal):
9909 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
9910
9911 * lread.c (invalid_syntax): Omit length argument.
9912 All uses changed. This doesn't fix a bug, but it simplifies the
9913 code away from its former Hollerith-constant appearance, and it's
9914 one less 'int' to worry about when looking at integer-overflow issues.
9915 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
9916
9917 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
9918 This didn't break anything, but it didn't help either.
9919 It's confusing to put a bogus integer in a place where the actual
9920 value does not matter.
9921 (LIST_END_P): Remove unused macro and its bogus comment.
9922 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
9923
9924 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
9925 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
9926 implementation.
9927 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
9928 We prefer signed types, and the value cannot exceed the EMACS_INT
9929 range anyway (because otherwise the length would not be representable).
9930 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
9931 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
9932 This avoids a GCC warning when WIDE_EMACS_INT.
9933
9934 * indent.c (sane_tab_width): New function.
9935 (current_column, scan_for_column, Findent_to, position_indentation)
9936 (compute_motion): Use it. This is just for clarity.
9937 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
9938
9939 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
9940
9941 * lisp.h (lint_assume): New macro.
9942 * composite.c (composition_gstring_put_cache):
9943 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
9944
9945 * editfns.c, insdel.c:
9946 Omit unnecessary forward decls, to simplify future changes.
9947
9948 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
9949
9950 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
9951
9952 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
9953 Use much-faster test for byte-length change.
9954 Don't assume string byte-length fits in 'int'.
9955 Check that character arg fits in 'int'.
9956 (mapcar1): Declare byte as byte, for clarity.
9957
9958 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
9959
9960 * fns.c (concat): Catch string overflow earlier.
9961 Do not rely on integer wraparound.
9962
9963 * dispextern.h (struct it.overlay_strings_charpos)
9964 (struct it.selective): Now EMACS_INT, not int.
9965 * xdisp.c (forward_to_next_line_start)
9966 (back_to_previous_visible_line_start)
9967 (reseat_at_next_visible_line_start, next_element_from_buffer):
9968 Don't arbitrarily truncate the value of 'selective' to int.
9969
9970 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
9971
9972 * composite.c: Don't truncate sizes to 'int'.
9973 (composition_gstring_p, composition_reseat_it)
9974 (composition_adjust_point): Use EMACS_INT, not int.
9975 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
9976 not EMACS_UINT, for indexes.
9977
9978 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
9979
9980 * buffer.c: Include <verify.h>.
9981 (struct sortvec.priority, struct sortstr.priority):
9982 Now EMACS_INT, not int.
9983 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
9984 (struct sortstr.size, record_overlay_string)
9985 (struct sortstrlist.size, struct sortlist.used):
9986 Don't truncate size to int.
9987 (record_overlay_string): Check for size-calculation overflow.
9988 (init_buffer_once): Check at compile-time, not run-time.
9989
9990 2011-06-22 Jim Meyering <meyering@redhat.com>
9991
9992 Don't leak an XBM-image-sized buffer
9993 * image.c (xbm_load): Free the image buffer after using it.
9994
9995 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
9996
9997 Port to Sun C.
9998 * composite.c (find_automatic_composition): Omit needless 'return 0;'
9999 that Sun C diagnosed.
10000 * fns.c (secure_hash): Fix pointer signedness issue.
10001 * intervals.c (static_offset_intervals): New function.
10002 (offset_intervals): Use it.
10003
10004 2011-06-21 Leo Liu <sdl.web@gmail.com>
10005
10006 * deps.mk (fns.o):
10007 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
10008 sha512.h.
10009
10010 * fns.c (secure_hash): Rename from crypto_hash_function and change
10011 the first arg to accept symbols.
10012 (Fsecure_hash): New primitive.
10013 (syms_of_fns): New symbols.
10014
10015 2011-06-20 Deniz Dogan <deniz@dogan.se>
10016
10017 * process.c (Fset_process_buffer): Clarify return value in
10018 docstring.
10019
10020 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
10021
10022 * dispnew.c (add_window_display_history): Use BVAR.
10023
10024 * xdisp.c (debug_method_add): Use BVAR.
10025 (check_window_end, dump_glyph_matrix, dump_glyph)
10026 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
10027
10028 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
10029 Likewise.
10030
10031 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
10032 check till after the cache is created in init_frame_faces.
10033
10034 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
10035
10036 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
10037
10038 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
10039
10040 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
10041 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
10042 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
10043
10044 Improve buffer-overflow checking (Bug#8873).
10045 * fileio.c (Finsert_file_contents):
10046 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
10047 Remove the old (too-loose) buffer overflow checks.
10048 They weren't needed, since make_gap checks for buffer overflow.
10049 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
10050 The old code merely checked for Emacs fixnum overflow, and relied
10051 on undefined (wraparound) behavior. The new code avoids undefined
10052 behavior, and also checks for ptrdiff_t and/or size_t overflow.
10053
10054 * editfns.c (Finsert_char): Don't dump core with very negative counts.
10055 Tune. Don't use wider integers than needed. Don't use alloca.
10056 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
10057
10058 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
10059
10060 * insdel.c, lisp.h (buffer_overflow): New function.
10061 (insert_from_buffer_1, replace_range, replace_range_2):
10062 * insdel.c (make_gap_larger):
10063 * editfns.c (Finsert_char):
10064 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
10065
10066 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
10067
10068 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
10069
10070 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
10071
10072 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
10073 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
10074
10075 * fileio.c: Don't assume EMACS_INT fits in off_t.
10076 (emacs_lseek): New static function.
10077 (Finsert_file_contents, Fwrite_region): Use it.
10078 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
10079
10080 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
10081
10082 * fns.c: Don't overflow int when computing a list length.
10083 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
10084 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
10085 truncation on 64-bit hosts. Check for QUIT every
10086 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
10087 faster and is responsive enough.
10088 (Flength): Report an error instead of overflowing an integer.
10089 (Fsafe_length): Return a float if the value is not representable
10090 as a fixnum. This shouldn't happen except in contrived situations.
10091 (Fnthcdr, Fsort): Don't assume list length fits in int.
10092 (Fcopy_sequence): Don't assume vector length fits in int.
10093
10094 * alloc.c: Check that resized vectors' lengths fit in fixnums.
10095 (header_size, word_size): New constants.
10096 (allocate_vectorlike): Don't check size overflow here.
10097 (allocate_vector): Check it here instead, since this is the only
10098 caller of allocate_vectorlike that could cause overflow.
10099 Check that the new vector's length is representable as a fixnum.
10100
10101 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
10102 The previous code was bogus. For example, next_almost_prime (32)
10103 returned 39, which is undesirable as it is a multiple of 3; and
10104 next_almost_prime (24) returned 25, which is a multiple of 5 so
10105 why was the code bothering to check for multiples of 7?
10106
10107 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
10108
10109 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
10110
10111 Variadic C functions now count arguments with ptrdiff_t.
10112 This partly undoes my 2011-03-30 change, which replaced int with size_t.
10113 Back then I didn't know that the Emacs coding style prefers signed int.
10114 Also, in the meantime I found a few more instances where arguments
10115 were being counted with int, which may truncate counts on 64-bit
10116 machines, or EMACS_INT, which may be unnecessarily wide.
10117 * lisp.h (struct Lisp_Subr.function.aMANY)
10118 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
10119 Arg counts are now ptrdiff_t, not size_t.
10120 All variadic functions and their callers changed accordingly.
10121 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
10122 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
10123 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
10124 * callint.c (Fcall_interactively): Check arg count for overflow,
10125 to avoid potential buffer overrun. Use signed char, not 'int',
10126 for 'varies' array, so that we needn't bother to check its size
10127 calculation for overflow.
10128 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
10129 * eval.c (apply_lambda):
10130 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
10131 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
10132 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
10133
10134 * callint.c (Fcall_interactively): Don't use index var as event count.
10135
10136 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
10137 * mem-limits.h (SIZE): Remove; no longer used.
10138
10139 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
10140
10141 Remove unnecessary casts.
10142 * xterm.c (x_term_init):
10143 * xfns.c (x_set_border_pixel):
10144 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
10145 These aren't needed now that we assume ANSI C.
10146
10147 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
10148 It's more likely to cause problems (due to unsigned overflow)
10149 than to cure them.
10150
10151 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
10152
10153 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
10154
10155 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
10156
10157 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
10158
10159 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
10160
10161 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
10162
10163 GLYPH_CODE_FACE returns EMACS_INT, not int.
10164 * dispextern.h (merge_faces):
10165 * xfaces.c (merge_faces):
10166 * xdisp.c (get_next_display_element, next_element_from_display_vector):
10167 Don't assume EMACS_INT fits in int.
10168
10169 * character.h (CHAR_VALID_P): Remove unused parameter.
10170 * fontset.c, lisp.h, xdisp.c: All uses changed.
10171
10172 * editfns.c (Ftranslate_region_internal): Omit redundant test.
10173
10174 * fns.c (concat): Minor tuning based on overflow analysis.
10175 This doesn't fix any bugs. Use int to hold character, instead
10176 of constantly refetching from Emacs object. Use XFASTINT, not
10177 XINT, for value known to be a character. Don't bother comparing
10178 a single byte to 0400, as it's always less.
10179
10180 * floatfns.c (Fexpt):
10181 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
10182
10183 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
10184 for characters.
10185
10186 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
10187
10188 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
10189 Without this fix, on a 64-bit host (aset S 0 4294967386) would
10190 incorrectly succeed when S was a string, because 4294967386 was
10191 truncated before it was used.
10192
10193 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
10194 Otherwise, an out-of-range integer could cause undefined behavior
10195 on a 64-bit host.
10196
10197 * composite.c: Use int, not EMACS_INT, for characters.
10198 (fill_gstring_body, composition_compute_stop_pos): Use int, not
10199 EMACS_INT, for values that are known to be in character range.
10200 This doesn't fix any bugs but is the usual style inside Emacs and
10201 may generate better code on 32-bit machines.
10202
10203 Make sure a 64-bit char is never passed to ENCODE_CHAR.
10204 This is for reasons similar to the recent CHAR_STRING fix.
10205 * charset.c (Fencode_char): Check that character arg is actually
10206 a character. Pass an int to ENCODE_CHAR.
10207 * charset.h (ENCODE_CHAR): Verify that the character argument is no
10208 wider than 'int', as a compile-time check to prevent future regressions
10209 in this area.
10210
10211 * character.c (char_string): Remove unnecessary casts.
10212
10213 Make sure a 64-bit char is never passed to CHAR_STRING.
10214 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
10215 by silently ignoring the top 32 bits, allowing some values
10216 that were far too large to be valid characters.
10217 * character.h: Include <verify.h>.
10218 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
10219 arguments are no wider than unsigned, as a compile-time check
10220 to prevent future regressions in this area.
10221 * data.c (Faset):
10222 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
10223 (Fsubst_char_in_region):
10224 * fns.c (concat):
10225 * xdisp.c (decode_mode_spec_coding):
10226 Adjust to CHAR_STRING's new requirement.
10227 * editfns.c (Finsert_char, Fsubst_char_in_region):
10228 * fns.c (concat): Check that character args are actually
10229 characters. Without this test, these functions did the wrong
10230 thing with wildly out-of-range values on 64-bit hosts.
10231
10232 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
10233 These casts should not be needed on 32-bit hosts, either.
10234 * keyboard.c (read_char):
10235 * lread.c (Fload): Remove casts to unsigned.
10236
10237 * lisp.h (UNSIGNED_CMP): New macro.
10238 This fixes comparison bugs on 64-bit hosts.
10239 (ASCII_CHAR_P): Use it.
10240 * casefiddle.c (casify_object):
10241 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
10242 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
10243 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
10244 * dispextern.h (FACE_FROM_ID):
10245 * keyboard.c (read_char): Use UNSIGNED_CMP.
10246
10247 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
10248 not to EMACS_INT, to avoid GCC warning.
10249
10250 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
10251
10252 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
10253 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
10254 isn't needed on 32-bit machines.
10255
10256 * buffer.c (Fgenerate_new_buffer_name):
10257 Use EMACS_INT for count, not int.
10258 (advance_to_char_boundary): Return EMACS_INT, not int.
10259
10260 * data.c (Qcompiled_function): Now static.
10261
10262 * window.c (window_body_lines): Now static.
10263
10264 * image.c (gif_load): Rename local to avoid shadowing.
10265
10266 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
10267 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
10268 * alloc.c (make_save_value): Integer argument is now of type
10269 ptrdiff_t, not int.
10270 (mark_object): Use ptrdiff_t, not int.
10271 * lisp.h (pD): New macro.
10272 * print.c (print_object): Use it.
10273
10274 * alloc.c: Use EMACS_INT, not int, to count objects.
10275 (total_conses, total_markers, total_symbols, total_vector_size)
10276 (total_free_conses, total_free_markers, total_free_symbols)
10277 (total_free_floats, total_floats, total_free_intervals)
10278 (total_intervals, total_strings, total_free_strings):
10279 Now EMACS_INT, not int. All uses changed.
10280 (Fgarbage_collect): Compute overall total using a double, so that
10281 integer overflow is less likely to be a problem. Check for overflow
10282 when converting back to an integer.
10283 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
10284 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
10285 These were 'int' variables that could overflow on 64-bit hosts;
10286 they were never used, so remove them instead of repairing them.
10287 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
10288 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
10289 Previously, this ceilinged at INT_MAX, but that doesn't work on
10290 64-bit machines.
10291 (allocate_pseudovector): Don't use EMACS_INT when int would do.
10292
10293 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
10294 (allocate_vectorlike): Check for ptrdiff_t overflow.
10295 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
10296 when a (possibly-narrower) signed value would do just as well.
10297 We prefer using signed arithmetic, to avoid comparison confusion.
10298
10299 * alloc.c: Catch some string size overflows that we were missing.
10300 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
10301 for convenience in STRING_BYTES_MAX.
10302 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
10303 The definition here is exact; the one in lisp.h was approximate.
10304 (allocate_string_data): Check for string overflow. This catches
10305 some instances we weren't catching before. Also, it catches
10306 size_t overflow on (unusual) hosts where SIZE_MAX <= min
10307 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
10308 and ptrdiff_t and EMACS_INT are both 64 bits.
10309
10310 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
10311 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
10312 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
10313
10314 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
10315
10316 * alloc.c (Fmake_string): Check for out-of-range init.
10317
10318 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
10319
10320 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
10321
10322 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
10323
10324 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
10325 xg_get_default_scrollbar_width.
10326
10327 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
10328 (int_gtk_range_get_value): Move to the scroll bar part of the file.
10329 (style_changed_cb): Call update_theme_scrollbar_width and call
10330 x_set_scroll_bar_default_width and xg_frame_set_char_size for
10331 all frames (Bug#8505).
10332 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
10333 Call gtk_window_set_resizable if HAVE_GTK3.
10334 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
10335 and height if HAVE_GTK3 (Bug#8505).
10336 (scroll_bar_width_for_theme): New variable.
10337 (update_theme_scrollbar_width): New function.
10338 (xg_get_default_scrollbar_width): Move code to
10339 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
10340 (xg_initialize): Call update_theme_scrollbar_width.
10341
10342 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
10343
10344 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
10345
10346 2011-06-12 Martin Rudalics <rudalics@gmx.at>
10347
10348 * frame.c (make_frame): Call other_buffer_safely instead of
10349 other_buffer.
10350
10351 * window.c (temp_output_buffer_show): Call display_buffer with
10352 second argument Vtemp_buffer_show_specifiers and reset latter
10353 immediately after the call.
10354 (Vtemp_buffer_show_specifiers): New variable.
10355 (auto_window_vscroll_p, next_screen_context_lines)
10356 (Vscroll_preserve_screen_position): Remove leading asterisks from
10357 doc-strings.
10358
10359 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
10360
10361 Fix minor problems found by GCC 4.6.0 static checking.
10362 * buffer.c (Qclone_number): Remove for now, as it's unused.
10363 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
10364 (record_buffer): Remove unused local.
10365 * frame.c (other_visible_frames, frame_buffer_list): Now static.
10366 (set_frame_buffer_list): Remove; unused.
10367 * frame.h (other_visible_frames): Remove decl.
10368 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
10369 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
10370 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
10371 if HAVE_GPM.
10372 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
10373 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
10374 Define only if HAVE_GPM.
10375 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
10376 (update_hints_inhibit): Remove; never set. All uses removed.
10377 * widgetprv.h (emacsFrameClassRec): Remove decl.
10378 * window.c (delete_deletable_window): Now returns void, since it
10379 wasn't returning anything.
10380 (compare_window_configurations): Remove unused locals.
10381 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
10382 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
10383 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
10384 the same widths as pointers. This follows up on the 2011-05-06 patch.
10385 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
10386 * xterm.h: Likewise.
10387 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
10388
10389 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
10390
10391 * makefile.w32-in: Update dependencies.
10392 (LISP_H): Add lib/intprops.h.
10393
10394 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
10395
10396 * image.c (gif_load): Add animation frame delay to the metadata.
10397 (syms_of_image): Use DEFSYM. New symbol `delay'.
10398
10399 2011-06-11 Martin Rudalics <rudalics@gmx.at>
10400
10401 * window.c (delete_deletable_window): Re-add.
10402 (Fset_window_configuration): Rewrite to handle dead buffers and
10403 consequently deletable windows.
10404 (window_tree, Fwindow_tree): Remove. Supply functionality in
10405 window.el.
10406 (compare_window_configurations): Simplify code.
10407
10408 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
10409
10410 * image.c (imagemagick_load_image): Fix type mismatch.
10411 (Fimagemagick_types): Likewise.
10412
10413 * window.h (replace_buffer_in_windows): Declare.
10414
10415 2011-06-11 Martin Rudalics <rudalics@gmx.at>
10416
10417 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
10418 Qclone_number. Remove external declaration of Qdelete_window.
10419 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
10420 code.
10421 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
10422 Run Qbuffer_list_update_hook if allowed.
10423 (Fother_buffer): Rewrite doc-string. Major rewrite for new
10424 buffer list implementation.
10425 (other_buffer_safely): New function.
10426 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
10427 calls to replace_buffer_in_windows and
10428 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
10429 if allowed.
10430 (record_buffer): Inhibit quitting and rewrite using quittable
10431 functions. Run Qbuffer_list_update_hook if allowed.
10432 (Frecord_buffer, Funrecord_buffer): New functions.
10433 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
10434 Move switch-to-buffer to window.el.
10435 (bury-buffer): Move to window.el.
10436 (Vbuffer_list_update_hook): New variable.
10437
10438 * lisp.h (other_buffer_safely): Add prototype in buffer.c
10439 section.
10440
10441 * window.h (resize_frame_windows): Move up in code.
10442 (Fwindow_frame): Remove EXFUN.
10443 (replace_buffer_in_all_windows): Remove prototype.
10444 (replace_buffer_in_windows_safely): Add prototype.
10445
10446 * window.c: Declare Qdelete_window static again. Move down
10447 declaration of select_count.
10448 (Fnext_window, Fprevious_window): Rewrite doc-strings.
10449 (Fother_window): Move to window.el.
10450 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
10451 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
10452 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
10453 window.el.
10454 (replace_buffer_in_windows): Implement by calling
10455 Qreplace_buffer_in_windows.
10456 (replace_buffer_in_all_windows): Remove with some functionality
10457 moved into replace_buffer_in_windows_safely.
10458 (replace_buffer_in_windows_safely): New function.
10459 (select_window_norecord, select_frame_norecord): Move in front
10460 of run_window_configuration_change_hook. Remove now obsolete
10461 declarations.
10462 (Fset_window_buffer): Rewrite doc-string.
10463 Call Qrecord_window_buffer.
10464 (keys_of_window): Move binding for other-window to window.el.
10465
10466 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
10467
10468 * dispextern.h (struct image): Replace data member, whose int_val
10469 and ptr_val fields were not used by anything, with a single
10470 lisp_val object.
10471
10472 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
10473 (gif_clear_image, gif_load, imagemagick_load_image)
10474 (gs_clear_image, gs_load): Callers changed.
10475
10476 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
10477
10478 * buffer.h: Include <time.h>, for time_t.
10479 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
10480
10481 Fix minor problems found by static checking.
10482
10483 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
10484
10485 Make identifiers static if they are not used in other modules.
10486 * data.c (Qcompiled_function, Qframe, Qvector):
10487 * image.c (QimageMagick, Qsvg):
10488 * minibuf.c (Qmetadata):
10489 * window.c (resize_window_check, resize_root_window): Now static.
10490 * window.h (resize_window_check, resize_root_window): Remove decls.
10491
10492 * window.c (window_deletion_count, delete_deletable_window):
10493 Remove; unused.
10494 (window_body_lines): Now static.
10495 (Fdelete_other_windows_internal): Mark vars as initialized.
10496 Make sure 'resize_failed' is initialized.
10497 (run_window_configuration_change_hook): Rename local to avoid shadowing.
10498 (resize_window_apply): Remove unused local.
10499 * window.h (delete_deletable_window): Remove decl.
10500
10501 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
10502 (imagemagick_load_image): Fix pointer signedness problem by changing
10503 last arg from unsigned char * to char *. All uses changed.
10504 Also, fix a local for similar reasons.
10505 Remove unused locals. Remove locals to avoid shadowing.
10506 (fn_rsvg_handle_free): Remove; unused.
10507 (svg_load, svg_load_image): Fix pointer signedness problem.
10508 (imagemagick_load_image): Don't use garbage pointer image_wand.
10509
10510 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
10511
10512 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
10513
10514 * image.c (gif_load): Fix omitted cast error introduced by
10515 2011-06-06 change.
10516
10517 2011-06-10 Martin Rudalics <rudalics@gmx.at>
10518
10519 * window.h (resize_proportionally, orig_total_lines)
10520 (orig_top_line): Remove from window structure.
10521 (set_window_height, set_window_width, change_window_heights)
10522 (Fdelete_window): Remove prototypes.
10523 (resize_frame_windows): Remove duplicate declaration.
10524
10525 2011-06-10 Eli Zaretskii <eliz@gnu.org>
10526
10527 * window.h (resize_frame_windows, resize_window_check)
10528 (delete_deletable_window, resize_root_window)
10529 (resize_frame_windows): Declare prototypes.
10530
10531 * window.c (resize_window_apply): Make definition be "static" to
10532 match the prototype.
10533
10534 2011-06-10 Martin Rudalics <rudalics@gmx.at>
10535
10536 * window.c: Remove declarations of Qwindow_size_fixed,
10537 window_min_size_1, window_min_size_2, window_min_size,
10538 size_window, window_fixed_size_p, enlarge_window, delete_window.
10539 Remove static from declaration of Qdelete_window, it's
10540 temporarily needed by Fbury_buffer.
10541 (replace_window): Don't assign orig_top_line and
10542 orig_total_lines.
10543 (Fdelete_window, delete_window): Remove. Window deletion is
10544 handled by window.el.
10545 (window_loop): Remove DELETE_OTHER_WINDOWS case.
10546 Replace Fdelete_window calls with calls to Qdelete_window.
10547 (Fdelete_other_windows): Remove. Deleting other windows is
10548 handled by window.el.
10549 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
10550 handled in window.el.
10551 (window_min_size_2, window_min_size_1, window_min_size): Remove.
10552 Window minimum sizes are handled in window.el.
10553 (shrink_windows, size_window, set_window_height)
10554 (set_window_width, change_window_heights, window_height)
10555 (window_width, CURBEG, CURSIZE, enlarge_window)
10556 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
10557 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
10558 handled in window.el.
10559 (make_dummy_parent): Rename to make_parent_window and give it a
10560 second argument horflag.
10561 (make_window): Don't set resize_proportionally any more.
10562 (Fsplit_window): Remove. Windows are split in window.el.
10563 (save_restore_action, save_restore_orig_size)
10564 (shrink_window_lowest_first, save_restore_orig_size): Remove.
10565 Resize mini windows in window.el.
10566 (grow_mini_window, shrink_mini_window): Implement by calling
10567 Qresize_root_window_vertically, resize_window_check and
10568 resize_window_apply.
10569 (saved_window, Fset_window_configuration, save_window_save):
10570 Do not handle orig_top_line, orig_total_lines, and
10571 resize_proportionally.
10572 (window_min_height, window_min_width): Move to window.el.
10573 (keys_of_window): Move bindings for delete-other-windows,
10574 split-window, delete-window and enlarge-window to window.el.
10575
10576 * buffer.c: Temporarily extern Qdelete_window.
10577 (Fbury_buffer): Temporarily call Qdelete_window instead of
10578 Fdelete_window (Fbury_buffer will move to window.el soon).
10579
10580 * frame.c (set_menu_bar_lines_1): Remove code handling
10581 orig_top_line and orig_total_lines.
10582
10583 * dispnew.c (adjust_frame_glyphs_initially): Don't use
10584 set_window_height but set heights directly.
10585 (change_frame_size_1): Use resize_frame_windows.
10586
10587 * xdisp.c (init_xdisp): Don't use set_window_height but set
10588 heights directly.
10589
10590 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
10591 Use resize_frame_windows instead of change_window_heights and run
10592 run_window_configuration_change_hook.
10593
10594 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
10595 instead of change_window_heights and run
10596 run_window_configuration_change_hook.
10597
10598 2011-06-09 Martin Rudalics <rudalics@gmx.at>
10599
10600 * window.c (replace_window): Rename second argument REPLACEMENT to
10601 NEW. New third argument SETFLAG. Rewrite.
10602 (delete_window, make_dummy_parent): Call replace_window with
10603 third argument 1.
10604 (window_list_1): Move down in code.
10605 (run_window_configuration_change_hook): Move set_buffer part
10606 before select_frame_norecord part in order to unwind correctly.
10607 Rename count1 to count.
10608 (recombine_windows, delete_deletable_window, resize_root_window)
10609 (Fdelete_other_windows_internal)
10610 (Frun_window_configuration_change_hook, make_parent_window)
10611 (resize_window_check, resize_window_apply, Fresize_window_apply)
10612 (resize_frame_windows, Fsplit_window_internal)
10613 (Fdelete_window_internal, Fresize_mini_window_internal):
10614 New functions.
10615 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
10616
10617 2011-06-08 Martin Rudalics <rudalics@gmx.at>
10618
10619 * window.h (window): Add some new members to window structure -
10620 normal_lines, normal_cols, new_total, new_normal, clone_number,
10621 splits, nest, prev_buffers, next_buffers.
10622 (WINDOW_TOTAL_SIZE): Move here from window.c.
10623 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
10624
10625 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
10626 Remove.
10627 (make_dummy_parent): Set new members of windows structure.
10628 (make_window): Move down in code. Handle new members of window
10629 structure.
10630 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
10631 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
10632 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
10633 (Fset_window_prev_buffers, Fwindow_next_buffers)
10634 (Fset_window_next_buffers, Fset_window_clone_number):
10635 New functions.
10636 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
10637 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
10638 Doc-string fixes.
10639 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
10640 Argument WINDOW can be now internal window too.
10641 (Fwindow_use_time): Move up in code.
10642 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
10643 Rewrite doc-string.
10644 (Fset_window_configuration, saved_window)
10645 (Fcurrent_window_configuration, save_window_save): Handle new
10646 members of window structure.
10647 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
10648 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
10649 (syms_of_window): New Lisp objects Qrecord_window_buffer,
10650 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
10651 Qget_mru_window, Qresize_root_window,
10652 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
10653 Qauto_buffer_name; staticpro them.
10654
10655 2011-06-07 Martin Rudalics <rudalics@gmx.at>
10656
10657 * window.c (Fwindow_total_size, Fwindow_left_column)
10658 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
10659 (Fwindow_list_1): New functions.
10660 (window_box_text_cols): Replace with window_body_cols.
10661 (Fwindow_width, Fscroll_left, Fscroll_right):
10662 Use window_body_cols instead of window_box_text_cols.
10663 (delete_window, Fset_window_configuration):
10664 Call delete_all_subwindows with window as argument.
10665 (delete_all_subwindows): Take a window as argument and not a
10666 structure. Rewrite.
10667 (window_loop): Remove handling of GET_LRU_WINDOW and
10668 GET_LARGEST_WINDOW.
10669 (Fget_lru_window, Fget_largest_window): Move to window.el.
10670
10671 * window.h: Extern window_body_cols instead of
10672 window_box_text_cols. delete_all_subwindows now takes a
10673 Lisp_Object as argument.
10674
10675 * indent.c (compute_motion, Fcompute_motion):
10676 Use window_body_cols instead of window_box_text_cols.
10677
10678 * frame.c (delete_frame): Call delete_all_subwindows with root
10679 window as argument.
10680
10681 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
10682
10683 * fns.c (Fputhash): Document return value.
10684
10685 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
10686
10687 * image.c (gif_load): Implement gif89a spec "no disposal" method.
10688
10689 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
10690
10691 Cons<->int and similar integer overflow fixes (Bug#8794).
10692
10693 Check for overflow when converting integer to cons and back.
10694 * charset.c (Fdefine_charset_internal, Fdecode_char):
10695 Use cons_to_unsigned to catch overflow.
10696 (Fencode_char): Use INTEGER_TO_CONS.
10697 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
10698 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
10699 * data.c (long_to_cons, cons_to_long): Remove.
10700 (cons_to_unsigned, cons_to_signed): New functions.
10701 These signal an error for invalid or out-of-range values.
10702 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
10703 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
10704 * font.c (Ffont_variation_glyphs):
10705 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
10706 * lisp.h: Include <intprops.h>.
10707 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
10708 (cons_to_signed, cons_to_unsigned): New decls.
10709 (long_to_cons, cons_to_long): Remove decls.
10710 * undo.c (record_first_change): Use INTEGER_TO_CONS.
10711 (Fprimitive_undo): Use CONS_TO_INTEGER.
10712 * xfns.c (Fx_window_property): Likewise.
10713 * xselect.c: Include <limits.h>.
10714 (x_own_selection, selection_data_to_lisp_data):
10715 Use INTEGER_TO_CONS.
10716 (x_handle_selection_request, x_handle_selection_clear)
10717 (x_get_foreign_selection, Fx_disown_selection_internal)
10718 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
10719 (lisp_data_to_selection_data): Use cons_to_unsigned.
10720 (x_fill_property_data): Use cons_to_signed.
10721 Report values out of range.
10722
10723 Check for buffer and string overflow more precisely.
10724 * buffer.h (BUF_BYTES_MAX): New macro.
10725 * lisp.h (STRING_BYTES_MAX): New macro.
10726 * alloc.c (Fmake_string):
10727 * character.c (string_escape_byte8):
10728 * coding.c (coding_alloc_by_realloc):
10729 * doprnt.c (doprnt):
10730 * editfns.c (Fformat):
10731 * eval.c (verror):
10732 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
10733 since they may not be the same number.
10734 * editfns.c (Finsert_char):
10735 * fileio.c (Finsert_file_contents):
10736 Likewise for BUF_BYTES_MAX.
10737
10738 * image.c: Use ptrdiff_t, not int, for sizes.
10739 (slurp_file): Switch from int to ptrdiff_t.
10740 All uses changed.
10741 (slurp_file): Check that file size fits in both size_t (for
10742 malloc) and ptrdiff_t (for sanity and safety).
10743
10744 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
10745 if b->modtime has its maximal value.
10746
10747 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
10748
10749 Don't assume time_t can fit into int.
10750 * buffer.h (struct buffer.modtime): Now time_t, not int.
10751 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
10752 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
10753
10754 Minor fixes for signed vs unsigned integers.
10755 * character.h (MAYBE_UNIFY_CHAR):
10756 * charset.c (maybe_unify_char):
10757 * keyboard.c (read_char, reorder_modifiers):
10758 XINT -> XFASTINT, since the integer must be nonnegative.
10759 * ftfont.c (ftfont_spec_pattern):
10760 * keymap.c (access_keymap, silly_event_symbol_error):
10761 XUINT -> XFASTINT, since the integer must be nonnegative.
10762 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
10763 since it makes no difference and we prefer signed.
10764 * keyboard.c (record_char): Use XUINT when all the neighbors do.
10765 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
10766 nonnegative.
10767
10768 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
10769
10770 * window.h (Fwindow_frame): Declare.
10771
10772 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
10773
10774 * alloc.c: Simplify handling of large-request failures (Bug#8800).
10775 (SPARE_MEMORY): Always define.
10776 (LARGE_REQUEST): Remove.
10777 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
10778
10779 2011-06-06 Martin Rudalics <rudalics@gmx.at>
10780
10781 * lisp.h: Move EXFUNS for Fframe_root_window,
10782 Fframe_first_window and Fset_frame_selected_window to window.h.
10783
10784 * window.h: Move EXFUNS for Fframe_root_window,
10785 Fframe_first_window and Fset_frame_selected_window here from
10786 lisp.h.
10787
10788 * frame.c (Fwindow_frame, Fframe_first_window)
10789 (Fframe_root_window, Fframe_selected_window)
10790 (Fset_frame_selected_window): Move to window.c.
10791 (Factive_minibuffer_window): Move to minibuf.c.
10792 (Fother_visible_frames_p): New function.
10793
10794 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
10795
10796 * window.c (decode_window, decode_any_window): Move up in code.
10797 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
10798 (inhibit_frame_unsplittable): Remove unused variable.
10799 (Fwindow_buffer): Move up and rewrite doc-string.
10800 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
10801 (Fwindow_prev): New functions.
10802 (Fwindow_frame): Move here from frame.c. Accept any window as
10803 argument.
10804 (Fframe_root_window, Fframe_first_window)
10805 (Fframe_selected_window): Move here from frame.c. Accept frame
10806 or arbitrary window as argument. Update doc-strings.
10807 (Fminibuffer_window): Move up in code.
10808 (Fwindow_minibuffer_p): Move up in code and simplify.
10809 (Fset_frame_selected_window): Move here from frame.c.
10810 Marginal rewrite.
10811 (Fselected_window, select_window, Fselect_window): Move up in
10812 code. Minor doc-string fixes.
10813
10814 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
10815
10816 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
10817 Do not assume that spare memory exists; that assumption is valid
10818 only if SYSTEM_MALLOC.
10819 (LARGE_REQUEST): New macro, so that the issue of large requests
10820 is separated from the issue of spare memory.
10821
10822 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
10823
10824 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
10825 format. (Bug#8806)
10826
10827 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
10828
10829 * xfns.c (x_set_scroll_bar_default_width): Move declarations
10830 before statements.
10831
10832 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
10833
10834 * gtkutil.c (xg_get_default_scrollbar_width): New function.
10835
10836 * gtkutil.h: Declare xg_get_default_scrollbar_width.
10837
10838 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
10839 min width by calling x_set_scroll_bar_default_width (Bug#8505).
10840
10841 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
10842
10843 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
10844
10845 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
10846
10847 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
10848 (x_clipboard_manager_save): Add return value.
10849 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
10850 New error handlers.
10851 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
10852 Obey Vx_select_enable_clipboard_manager. Catch errors in
10853 x_clipboard_manager_save (Bug#8779).
10854 (Vx_select_enable_clipboard_manager): New variable.
10855 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
10856
10857 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
10858
10859 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
10860
10861 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10862
10863 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
10864 in the current matrix if keep_current_p is non-zero.
10865
10866 2011-06-04 Eli Zaretskii <eliz@gnu.org>
10867
10868 * bidi.c (bidi_level_of_next_char): Fix last change.
10869
10870 2011-06-03 Eli Zaretskii <eliz@gnu.org>
10871
10872 Support bidi reordering of text covered by display properties.
10873
10874 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
10875 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
10876 (bidi_cache_search, bidi_cache_iterator_state)
10877 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
10878 (bidi_level_of_next_char, bidi_move_to_visually_next):
10879 Support character positions inside a run of characters covered by a
10880 display string.
10881 (bidi_paragraph_init, bidi_resolve_explicit_1)
10882 (bidi_level_of_next_char): Call bidi_fetch_char and
10883 bidi_fetch_char_advance instead of FETCH_CHAR and
10884 FETCH_CHAR_ADVANCE.
10885 (bidi_init_it): Initialize new members.
10886 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
10887 definitions.
10888 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
10889 instead of using explicit *_CHAR codes.
10890 (bidi_resolve_explicit, bidi_resolve_weak):
10891 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
10892 bidirectional text is supported only in multibyte buffers.
10893 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
10894 it to initialize the frame_window_p member of struct bidi_it.
10895 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
10896 (bidi_resolve_explicit, bidi_resolve_weak)
10897 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
10898 bidi_it->nchars is non-positive.
10899 (bidi_level_of_next_char): Don't try to lookup the cache for the
10900 next/previous character if nothing is cached there yet, or if we
10901 were just reseat()'ed to a new position.
10902
10903 * xdisp.c (set_cursor_from_row): Set start and stop points
10904 according to the row's direction when priming the loop that looks
10905 for the glyph on which to display cursor.
10906 (single_display_spec_intangible_p): Function deleted.
10907 (display_prop_intangible_p): Reimplement to call
10908 handle_display_spec instead of single_display_spec_intangible_p.
10909 Accept 3 additional arguments needed by handle_display_spec.
10910 This fixes incorrect cursor motion across display property with complex
10911 values: lists, `(when COND...)' forms, etc.
10912 (single_display_spec_string_p): Support property values that are
10913 lists with the argument STRING its top-level element.
10914 (display_prop_string_p): Fix the condition for processing a
10915 property that is a list to be consistent with handle_display_spec.
10916 (handle_display_spec): New function, refactored from the
10917 last portion of handle_display_prop.
10918 (compute_display_string_pos): Accept additional argument
10919 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
10920 value of a `display' property is a "replacing spec".
10921 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
10922 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
10923 the display property, but just return a value indicating whether
10924 the display property will replace the characters it covers.
10925 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
10926 frame_window_p members of struct bidi_it.
10927 (compute_display_string_pos, compute_display_string_end):
10928 New functions.
10929 (push_it): Accept second argument POSITION, where pop_it should
10930 jump to continue iteration.
10931 (reseat_1): Initialize bidi_it.disp_pos.
10932
10933 * keyboard.c (adjust_point_for_property): Adjust the call to
10934 display_prop_intangible_p to its new signature.
10935
10936 * dispextern.h (struct bidi_it): New member frame_window_p.
10937 (bidi_init_it): Update prototypes.
10938 (display_prop_intangible_p): Update prototype.
10939 (compute_display_string_pos, compute_display_string_end):
10940 Declare prototypes.
10941 (struct bidi_it): New members nchars and disp_pos. ch_len is now
10942 EMACS_INT.
10943
10944 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
10945
10946 Malloc failure behavior now depends on size of allocation.
10947 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
10948 * lisp.h: Change signatures accordingly.
10949 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
10950 All callers changed. (Bug#8762)
10951
10952 * gnutls.c: Use Emacs's memory allocators.
10953 Without this change, the gnutls library would invoke malloc etc.
10954 directly, which causes problems on non-SYNC_INPUT hosts, and which
10955 runs afoul of improving memory_full behavior. (Bug#8761)
10956 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
10957 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
10958 xfree instead of the default malloc, realloc, free.
10959 (Fgnutls_boot): No need to check for memory allocation failure,
10960 since xmalloc does that for us.
10961
10962 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
10963 * category.c (hash_get_category_set):
10964 * ccl.c (ccl_driver):
10965 * charset.c (Fdefine_charset_internal):
10966 * charset.h (struct charset.hash_index):
10967 * composite.c (get_composition_id, gstring_lookup_cache)
10968 (composition_gstring_put_cache):
10969 * composite.h (struct composition.hash_index):
10970 * dispextern.h (struct image.hash):
10971 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
10972 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
10973 (hashfn_equal, hashfn_user_defined, make_hash_table)
10974 (maybe_resize_hash_table, hash_lookup, hash_put)
10975 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
10976 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
10977 (Fsxhash, Fgethash, Fputhash, Fmaphash):
10978 * image.c (make_image, search_image_cache, lookup_image)
10979 (xpm_put_color_table_h):
10980 * lisp.h (struct Lisp_Hash_Table):
10981 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
10982 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
10983 for hashes and hash indexes, instead of 'unsigned' and 'int'.
10984 * alloc.c (allocate_vectorlike):
10985 Check for overflow in vector size calculations.
10986 * ccl.c (ccl_driver):
10987 Check for overflow when converting EMACS_INT to int.
10988 * fns.c, image.c: Remove unnecessary static decls that would otherwise
10989 need to be updated by these changes.
10990 * fns.c (make_hash_table, maybe_resize_hash_table):
10991 Check for integer overflow with large hash tables.
10992 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
10993 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
10994 (SXHASH_REDUCE): New macro.
10995 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
10996 Use it instead of discarding useful hash info with large hash values.
10997 (sxhash_float): New function.
10998 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
10999 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
11000 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
11001 Rewrite to use FIXNUM_BITS, as this simplifies things.
11002 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
11003 Adjust signatures to match updated version of code.
11004 (consing_since_gc): Now EMACS_INT, since a single hash table can
11005 use more than INT_MAX bytes.
11006
11007 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
11008
11009 Make it possible to build with GCC-4.6+ -O2 -flto.
11010
11011 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
11012
11013 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
11014
11015 * minibuf.c (get_minibuffer, read_minibuf_unwind):
11016 Call minibuffer-inactive-mode.
11017
11018 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
11019
11020 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
11021 Update dependencies.
11022
11023 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
11024
11025 * data.c (init_data): Remove code for UTS, this system is not
11026 supported anymore.
11027
11028 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
11029
11030 Don't force ./temacs to start in terminal mode.
11031
11032 * frame.c (make_initial_frame): Initialize faces in all cases, not
11033 only when CANNOT_DUMP is defined.
11034 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
11035
11036 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
11037
11038 * dispnew.c (add_window_display_history): Use const for the string
11039 pointer. Remove declaration, not needed.
11040
11041 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
11042
11043 Use 'inline', not 'INLINE'.
11044 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
11045 * alloc.c, fontset.c (INLINE): Remove.
11046 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
11047 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
11048 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
11049 * gmalloc.c (register_heapinfo): Use inline unconditionally.
11050 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
11051
11052 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
11053
11054 Make it possible to run ./temacs.
11055
11056 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
11057 syms_of_callproc does the same thing. Remove test for
11058 "initialized", do it in the caller.
11059 * emacs.c (main): Avoid calling set_initial_environment when dumping.
11060
11061 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
11062
11063 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
11064 (read_minibuf): Use get_minibuffer.
11065 (syms_of_minibuf): Use DEFSYM.
11066 (Qmetadata): New var.
11067 * data.c (Qbuffer): Don't make it static.
11068 (syms_of_data): Use DEFSYM.
11069
11070 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
11071
11072 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
11073 (CCL_CODE_MIN): New macro.
11074
11075 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
11076
11077 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
11078
11079 * eval.c (Qdebug): Now static.
11080 * lisp.h (Qdebug): Remove decl. This reverts a part of the
11081 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
11082 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
11083
11084 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
11085
11086 * image.c: Various fixes to ImageMagick code comments.
11087 (Fimagemagick_types): Doc fix.
11088
11089 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
11090
11091 Minor fixes prompted by GCC 4.6.0 warnings.
11092
11093 * xselect.c (converted_selections, conversion_fail_tag): Now static.
11094
11095 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
11096 (x_clipboard_manager_save_all): Move extern decl to ...
11097 * xterm.h: ... here, so that it can be checked for consistency.
11098
11099 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
11100
11101 * xselect.c (x_clipboard_manager_save_frame)
11102 (x_clipboard_manager_save_all): New functions.
11103 (Fx_clipboard_manager_save): Lisp function deleted.
11104
11105 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
11106 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
11107
11108 * xterm.h: Update prototype.
11109
11110 2011-05-28 William Xu <william.xwl@gmail.com>
11111
11112 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
11113 exiting (Bug#8239).
11114
11115 2011-05-28 Jim Meyering <meyering@redhat.com>
11116
11117 Avoid a sign-extension bug in crypto_hash_function.
11118 * fns.c (to_uchar): Define.
11119 (crypto_hash_function): Use it to convert some newly-signed
11120 variables to unsigned, to avoid sign-extension bugs. For example,
11121 without this change, (md5 "truc") would evaluate to
11122 45723a2aff78ff4fff7fff1114760e62 rather than the expected
11123 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
11124 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
11125
11126 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
11127
11128 Integer overflow fixes.
11129
11130 * dbusbind.c: Serial number integer overflow fixes.
11131 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
11132 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
11133 to hold a serial number that is too large for a fixnum.
11134 (Fdbus_method_return_internal, Fdbus_method_error_internal):
11135 Check for serial numbers out of range. Decode any serial number
11136 that was so large that it became a float. (Bug#8722)
11137
11138 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
11139 (Fdbus_call_method, Fdbus_call_method_asynchronously):
11140 Use XFASTINT rather than XUINT when numbers are nonnegative.
11141 (xd_append_arg, Fdbus_method_return_internal):
11142 (Fdbus_method_error_internal): Likewise. Also, for unsigned
11143 arguments, check that Lisp number is nonnegative, rather than
11144 silently wrapping negative numbers around. (Bug#8722)
11145 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
11146 (Bug#8722)
11147
11148 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
11149
11150 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
11151
11152 ccl: Add integer overflow checks.
11153 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
11154 (IN_INT_RANGE): New macros.
11155 (ccl_driver): Use them to check for integer overflow when
11156 decoding a CCL program. Many of the new checks are whether XINT (x)
11157 fits in int; it doesn't always, on 64-bit hosts. The new version
11158 doesn't catch all possible integer overflows, but it's an
11159 improvement. (Bug#8719)
11160
11161 * alloc.c (make_event_array): Use XINT, not XUINT.
11162 There's no need for unsigned here.
11163
11164 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
11165 This follows up to the 2011-05-06 change that substituted uintptr_t
11166 for EMACS_INT. This case wasn't caught back then.
11167
11168 Rework Fformat to avoid integer overflow issues.
11169 * editfns.c: Include <float.h> unconditionally, as it's everywhere
11170 now (part of C89). Include <verify.h>.
11171 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
11172 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
11173 (Fformat): Avoid the prepass trying to compute sizes; it was only
11174 approximate and thus did not catch overflow reliably. Instead, walk
11175 through the format just once, formatting and computing sizes as we go,
11176 checking for integer overflow at every step, and allocating a larger
11177 buffer as needed. Keep track separately whether the format is
11178 multibyte. Keep only the most-recently calculated precision, rather
11179 than them all. Record whether each argument has been converted to
11180 string. Use EMACS_INT, not int, for byte and char and arg counts.
11181 Support field widths and precisions larger than INT_MAX. Avoid
11182 sprintf's undefined behavior with conversion specifications such as %#d
11183 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
11184 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
11185 formatting out-of-range floating point numbers with int
11186 formats. (Bug#8668)
11187
11188 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
11189
11190 * data.c: Avoid integer truncation in expressions involving floats.
11191 * data.c: Include <intprops.h>.
11192 (arith_driver): When there's an integer overflow in an expression
11193 involving floating point, convert the integers to floating point
11194 so that the resulting value does not suffer from catastrophic
11195 integer truncation. For example, on a 64-bit host (* 4
11196 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
11197 Do not rely on undefined behavior after integer overflow.
11198
11199 merge count_size_as_multibyte, parse_str_to_multibyte
11200 * character.c, character.h (count_size_as_multibyte):
11201 Rename from parse_str_to_multibyte; all uses changed.
11202 Check for integer overflow.
11203 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
11204 since it's now a duplicate of the other. This is more of
11205 a character than a buffer op, so better that it's in character.c.
11206 * fns.c, print.c: Adjust to above changes.
11207
11208 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
11209
11210 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
11211
11212 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
11213
11214 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
11215 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
11216 (x_clipboard_manager_save): Now static.
11217 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
11218
11219 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
11220 (crypto_hash_function): Now static.
11221 Fix pointer signedness problems. Avoid unnecessary initializations.
11222
11223 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
11224
11225 * termhooks.h (Vselection_alist): Make it terminal-local.
11226
11227 * terminal.c (create_terminal): Initialize it.
11228
11229 * xselect.c: Support for clipboard managers.
11230 (Vselection_alist): Move to termhooks.h as terminal-local var.
11231 (LOCAL_SELECTION): New macro.
11232 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
11233 (symbol_to_x_atom): Remove gratuitous arg.
11234 (x_handle_selection_request, lisp_data_to_selection_data)
11235 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
11236 (x_own_selection, x_get_local_selection, x_convert_selection):
11237 New arg, specifying work frame. Use terminal-local Vselection_alist.
11238 (some_frame_on_display): Delete unused function.
11239 (Fx_own_selection_internal, Fx_get_selection_internal)
11240 (Fx_disown_selection_internal, Fx_selection_owner_p)
11241 (Fx_selection_exists_p): New optional frame arg.
11242 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
11243 (x_handle_selection_clear): Don't treat other terminals with the
11244 same keyboard specially. Use the terminal-local Vselection_alist.
11245 (x_clear_frame_selections): Use Frun_hook_with_args.
11246
11247 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
11248
11249 * xterm.h: Add support for those atoms.
11250
11251 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
11252
11253 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
11254 (converted_selections, conversion_fail_tag): New global variables.
11255 (x_selection_request_lisp_error): Free the above.
11256 (x_get_local_selection): Remove unnecessary code.
11257 (x_reply_selection_request): Args changed; handle arbitrary array
11258 of converted selections stored in converted_selections.
11259 Separate the XChangeProperty and SelectionNotify steps.
11260 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
11261 (x_convert_selection): New function.
11262 (x_handle_selection_event): Simplify.
11263 (x_get_foreign_selection): Don't ignore incoming requests while
11264 waiting for an answer; this will fail when we implement
11265 SAVE_TARGETS, and seems unnecessary anyway.
11266 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
11267 (Vx_sent_selection_functions): Doc fix.
11268
11269 2011-05-26 Leo Liu <sdl.web@gmail.com>
11270
11271 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
11272
11273 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11274
11275 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
11276
11277 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
11278 for fringe update if it has periodic bitmap.
11279 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
11280 and fringe_bitmap_periodic_p.
11281
11282 * fringe.c (get_fringe_bitmap_data): New function.
11283 (draw_fringe_bitmap_1, update_window_fringes): Use it.
11284 (update_window_fringes): Record periodicity of fringe bitmap in glyph
11285 row. Mark glyph row for fringe update if periodicity changed.
11286
11287 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
11288 for fringe update unless it has periodic bitmap.
11289
11290 2011-05-25 Kenichi Handa <handa@m17n.org>
11291
11292 * xdisp.c (get_next_display_element): Set correct it->face_id for
11293 a static composition.
11294
11295 2011-05-24 Leo Liu <sdl.web@gmail.com>
11296
11297 * deps.mk (fns.o):
11298 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
11299
11300 * fns.c (crypto_hash_function, Fsha1): New function.
11301 (Fmd5): Use crypto_hash_function.
11302 (syms_of_fns): Add Ssha1.
11303
11304 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
11305
11306 * gnutls.c: Remove unused macros.
11307 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
11308 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
11309 Remove macros that are defined and never used.
11310 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
11311
11312 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
11313
11314 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
11315 (Fx_get_selection_internal): Minor cleanup.
11316 (Fx_own_selection_internal): Rename arguments for consistency with
11317 select.el.
11318
11319 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
11320
11321 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
11322
11323 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
11324
11325 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
11326
11327 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11328
11329 * dispnew.c (scrolling_window): Don't exclude the case that the
11330 last enabled row in the desired matrix touches the bottom boundary.
11331
11332 2011-05-21 Glenn Morris <rgm@gnu.org>
11333
11334 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
11335 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
11336 and add some more files.
11337
11338 2011-05-20 Eli Zaretskii <eliz@gnu.org>
11339
11340 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
11341 report_file_error introduced by the change from 2011-05-07.
11342
11343 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
11344
11345 * systime.h (Time): Define only if emacs is defined.
11346 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
11347 where the include path doesn't have X11/X.h by default. See
11348 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
11349
11350 2011-05-20 Kenichi Handa <handa@m17n.org>
11351
11352 * composite.c (find_automatic_composition): Fix previous change.
11353
11354 2011-05-20 Glenn Morris <rgm@gnu.org>
11355
11356 * lisp.mk: New file, split from Makefile.in.
11357 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
11358 (shortlisp): Remove.
11359 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
11360
11361 2011-05-19 Glenn Morris <rgm@gnu.org>
11362
11363 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
11364 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
11365 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
11366 (lisp): Set the order to that of loadup.el.
11367 (shortlisp): Make it a copy of $lisp.
11368 (SOME_MACHINE_LISP): Remove.
11369 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
11370 Use just $shortlisp, not $SOME_MACHINE_LISP too.
11371
11372 2011-05-18 Kenichi Handa <handa@m17n.org>
11373
11374 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
11375 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
11376 (find_automatic_composition): Mostly rewrite for efficiency.
11377
11378 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
11379
11380 * makefile.w32-in: Update dependencies.
11381
11382 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
11383
11384 * menu.c: Include limits.h (fixes the MS-Windows build broken by
11385 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
11386
11387 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
11388
11389 Fix some integer overflow issues, such as string length overflow.
11390
11391 * insdel.c (count_size_as_multibyte): Check for string overflow.
11392
11393 * character.c (lisp_string_width): Check for string overflow.
11394 Use EMACS_INT, not int, for string indexes and lengths; in
11395 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
11396 the resulting string length overflows an EMACS_INT; instead,
11397 report a string overflow if no precision given. When checking for
11398 precision exhaustion, use a check that cannot possibly have
11399 integer overflow. (Bug#8675)
11400 * character.h (lisp_string_width): Adjust to new signature.
11401
11402 * alloc.c (string_overflow): New function.
11403 (Fmake_string): Use it. This doesn't change behavior, but saves
11404 a few bytes and will simplify future changes.
11405 * character.c (string_escape_byte8): Likewise.
11406 * lisp.h (string_overflow): New decl.
11407
11408 Fixups, following up to the user-interface timestamp change.
11409 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
11410 for UI timestamps, instead of unsigned long.
11411 * msdos.c (mouse_get_pos): Likewise.
11412 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
11413 * w32gui.h (Time): Define by including "systime.h" rather than by
11414 declaring it ourselves. (Bug#8664)
11415
11416 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
11417 * image.c (clear_image_cache): Likewise.
11418
11419 * term.c (term_mouse_position): Don't assume time_t wraparound.
11420
11421 Be more systematic about user-interface timestamps.
11422 Before, the code sometimes used 'Time', sometimes 'unsigned long',
11423 and sometimes 'EMACS_UINT', to represent these timestamps.
11424 This change causes it to use 'Time' uniformly, as that's what X uses.
11425 This makes the code easier to follow, and makes it easier to catch
11426 integer overflow bugs such as Bug#8664.
11427 * frame.c (Fmouse_position, Fmouse_pixel_position):
11428 Use Time, not unsigned long, for user-interface timestamps.
11429 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
11430 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
11431 * keyboard.h (last_event_timestamp): Likewise.
11432 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
11433 * menu.h (xmenu_show): Likewise.
11434 * term.c (term_mouse_position): Likewise.
11435 * termhooks.h (struct input_event.timestamp): Likewise.
11436 (struct terminal.mouse_position_hook): Likewise.
11437 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
11438 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
11439 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
11440 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
11441 what it was before.
11442 * menu.h, termhooks.h: Include "systime.h", for Time.
11443
11444 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
11445 Don't assume that the difference between two unsigned long values
11446 can fit into an integer. At this point, we know button_down_time
11447 <= event->timestamp, so the difference must be nonnegative, so
11448 there's no need to cast the result if double-click-time is
11449 nonnegative, as it should be; check that it's nonnegative, just in
11450 case. This bug is triggered when events are more than 2**31 ms
11451 apart (about 25 days). (Bug#8664)
11452
11453 * xselect.c (last_event_timestamp): Remove duplicate decl.
11454 (x_own_selection): Remove needless cast to unsigned long.
11455
11456 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
11457 that always fit in int. Use a sentinel instead of a counter, to
11458 avoid a temp and to allay GCC's concerns about possible int overflow.
11459 * frame.h (struct frame): Use int for menu_bar_items_used
11460 instead of EMACS_INT, since it always fits in int.
11461
11462 * menu.c (grow_menu_items): Check for int overflow.
11463
11464 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
11465
11466 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
11467 Before, the code was not consistent. These values cannot exceed
11468 2**31 - 1 so there's no need to make them unsigned.
11469 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
11470 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
11471 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
11472 as modifiers.
11473 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
11474
11475 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
11476 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
11477 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
11478 presumably because the widths might not match.
11479
11480 * window.c (size_window): Avoid needless test at loop start.
11481
11482 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
11483
11484 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
11485
11486 2011-05-12 Drew Adams <drew.adams@oracle.com>
11487
11488 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
11489
11490 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11491
11492 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
11493 `width' to `bar_area_x' and `bar_area_width', respectively.
11494 (x_scroll_run): Take account of fringe background extension.
11495
11496 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
11497 Rename local vars `left' and `width' to `bar_area_x' and
11498 `bar_area_width', respectively.
11499 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
11500 background extension.
11501
11502 2011-05-10 Jim Meyering <meyering@redhat.com>
11503
11504 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
11505
11506 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
11507
11508 * image.c (Finit_image_library): Return t for built-in image types,
11509 like pbm and xbm. (Bug#8640)
11510
11511 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
11512
11513 * w32menu.c (set_frame_menubar): Fix submenu allocation.
11514
11515 2011-05-07 Eli Zaretskii <eliz@gnu.org>
11516
11517 * w32console.c (Fset_screen_color): Doc fix.
11518 (Fget_screen_color): New function.
11519 (syms_of_ntterm): Defsubr it.
11520
11521 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
11522 unlink the temporary file if Fcall_process didn't create it in the
11523 first place.
11524 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
11525 child process will be redirected to a file specified with `:file'.
11526 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
11527 cue to call_process_cleanup not to close that handle.
11528
11529 2011-05-07 Ben Key <bkey76@gmail.com>
11530
11531 * makefile.w32-in: The bootstrap-temacs rule now makes use of
11532 one of two shell specific rules, either bootstrap-temacs-CMD or
11533 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
11534 to the previous implementation of the bootstrap-temacs rule.
11535 The bootstrap-temacs-CMD rule is similar to the previous
11536 implementation of the bootstrap-temacs rule except that it
11537 makes use of the ESC_CFLAGS variable instead of the CFLAGS
11538 variable.
11539
11540 These changes, along with some changes to nt/configure.bat,
11541 nt/gmake.defs, and nt/nmake.defs, are required to extend my
11542 earlier fix to add support for --cflags and --ldflags options
11543 that include quotes so that it works whether make uses cmd or
11544 sh as the shell.
11545
11546 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
11547
11548 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
11549 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
11550 is a constant.
11551 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
11552 a string. Handle both cases.
11553 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
11554 (Fdbus_register_method): Use Qinvalid_function.
11555
11556 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
11557
11558 * makefile.w32-in: Update dependencies.
11559 (LISP_H): Add inttypes.h and stdin.h.
11560 (PROCESS_H): Add unistd.h.
11561
11562 2011-05-06 Eli Zaretskii <eliz@gnu.org>
11563
11564 * lread.c: Include limits.h (fixes the MS-Windows build broken by
11565 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
11566
11567 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
11568
11569 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
11570
11571 * term.c (vfatal): Remove stray call to va_end.
11572 It's not needed and the C Standard doesn't allow it here anyway.
11573
11574 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
11575 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
11576
11577 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
11578 bytes.
11579
11580 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
11581
11582 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11583
11584 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
11585
11586 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
11587
11588 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
11589
11590 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
11591 * charset.c (Fdefine_charset_internal): Don't initialize
11592 charset.code_space[15]. The value was garbage, on hosts with
11593 32-bit int (Bug#8600).
11594
11595 * lread.c (read_integer): Be more consistent with string-to-number.
11596 Use string_to_number to do the actual conversion; this avoids
11597 rounding errors and fixes some other screwups. Without this fix,
11598 for example, #x1fffffffffffffff was misread as -2305843009213693952.
11599 (digit_to_number): Move earlier, for benefit of read_integer.
11600 Return -1 if the digit is out of range for the base, -2 if it is
11601 not a digit in any supported base. (Bug#8602)
11602
11603 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
11604
11605 * dispnew.c (scrolling_window): Return 1 if we scrolled,
11606 to match comment at start of function. This also removes a
11607 GCC warning about overflow in a 32+64-bit port.
11608
11609 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
11610
11611 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
11612 Reported by Stefan Monnier in
11613 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
11614 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
11615 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
11616
11617 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
11618 (EMACS_UINTPTR): Likewise, with uintptr_t.
11619
11620 * lisp.h: Prefer 64-bit EMACS_INT if available.
11621 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
11622 on 32-bit hosts that have 64-bit int, so that they can access
11623 large files.
11624 However, temporarily disable this change unless the temporary
11625 symbol WIDE_EMACS_INT is defined.
11626
11627 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
11628
11629 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
11630 This removes an assumption that EMACS_INT and long are the same
11631 width as pointers. The assumption is true for Emacs porting targets
11632 now, but we want to make other targets possible.
11633 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
11634 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
11635 In the rest of the code, change types of integers that hold casted
11636 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
11637 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
11638 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
11639 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
11640 No need to cast type when ORing.
11641 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
11642 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
11643 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
11644 assume EMACS_INT is the same width as char *.
11645 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
11646 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
11647 Remove no-longer-needed casts.
11648 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
11649 (xg_tool_bar_help_callback, xg_make_tool_item):
11650 Use EMACS_INTPTR to hold an integer
11651 that will be cast to void *; this can avoid a GCC warning
11652 if EMACS_INT is not the same width as void *.
11653 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
11654 * xdisp.c (display_echo_area_1, resize_mini_window_1):
11655 (current_message_1, set_message_1):
11656 Use a local to convert to proper width without a cast.
11657 * xmenu.c (dialog_selection_callback): Likewise.
11658
11659 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
11660 Also, don't assume VALBITS / RAND_BITS is less than 5,
11661 and don't rely on undefined behavior when shifting a 1 left into
11662 the sign bit.
11663 * lisp.h (get_random): Change signature to match.
11664
11665 * lread.c (hash_string): Use size_t, not int, for hash computation.
11666 Normally we prefer signed values; but hashing is special, because
11667 it's better to use unsigned division on hash table sizes so that
11668 the remainder is nonnegative. Also, size_t is the natural width
11669 for hashing into memory. The previous code used 'int', which doesn't
11670 retain enough info to hash well into very large tables.
11671 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
11672
11673 * dbusbind.c: Don't possibly lose pointer info when converting.
11674 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
11675 Use XPNTR rather than XHASH, so that the high-order bits of
11676 the pointer aren't lost when converting through void *.
11677
11678 * eval.c (Fautoload): Don't double-shift a pointer.
11679
11680 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
11681
11682 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
11683
11684 * gnutls.c (DEF_GNUTLS_FN):
11685 * image.c (DEF_IMGLIB_FN): Make function pointers static.
11686
11687 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
11688
11689 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
11690 marker. (Bug#8610)
11691
11692 2011-05-05 Eli Zaretskii <eliz@gnu.org>
11693
11694 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
11695 New version that can reserve upto 2GB of heap space.
11696
11697 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
11698
11699 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
11700
11701 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
11702
11703 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
11704 `gnutls_certificate_set_x509_key_file'.
11705
11706 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
11707
11708 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
11709 Update dependencies.
11710
11711 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
11712
11713 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
11714 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
11715 Remove unused parameter `fildes'.
11716 * process.c (read_process_output, send_process): Don't pass it.
11717
11718 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
11719
11720 Fix previous change: the library cache is defined in w32.c.
11721 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
11722 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
11723
11724 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
11725
11726 Implement dynamic loading of GnuTLS on Windows.
11727
11728 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
11729 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
11730 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
11731 Declare.
11732
11733 * gnutls.c (Qgnutls_dll): Define.
11734 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
11735 (gnutls_*): Declare function pointers.
11736 (init_gnutls_functions): New function to initialize function pointers.
11737 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
11738 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
11739 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
11740 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
11741 (emacs_gnutls_write, emacs_gnutls_read)
11742 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
11743 (Fgnutls_available_p): New function.
11744 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
11745 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
11746 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
11747
11748 * image.c: Include w32.h.
11749 (Vimage_type_cache): Delete.
11750 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
11751 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
11752 (w32_delayed_load): Move to w32.c.
11753
11754 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
11755
11756 * w32.c (QCloaded_from, Vlibrary_cache): Define.
11757 (w32_delayed_load): Move from image.c. When loading a library, record
11758 its filename in the :loaded-from property of the library id.
11759 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
11760 Initialize and staticpro them.
11761 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
11762
11763 * process.c: Include lisp.h before w32.h, not after.
11764 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
11765 instead of gnutls_record_check_pending.
11766
11767 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
11768
11769 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
11770
11771 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
11772 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
11773 as passed in.
11774
11775 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
11776
11777 * xterm.c (x_set_frame_alpha): Do not set property on anything
11778 else than FRAME_X_OUTER_WINDOW (Bug#8608).
11779
11780 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
11781
11782 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
11783
11784 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
11785
11786 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
11787 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
11788 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
11789 (gnutls_global_initialized, Qgnutls_bootprop_priority)
11790 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
11791 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
11792 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
11793 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
11794 (Qgnutls_bootprop_callbacks_verify): Make static.
11795
11796 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
11797
11798 * callproc.c: Indentation fixup.
11799
11800 * sysdep.c (wait_for_termination_1): Make static.
11801 (wait_for_termination, interruptible_wait_for_termination):
11802 Move after wait_for_termination_1.
11803
11804 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
11805
11806 * sysdep.c (interruptible_wait_for_termination): New function
11807 which is like wait_for_termination, but allows keyboard
11808 interruptions.
11809
11810 * callproc.c (Fcall_process): Add (:file "file") as an option for
11811 the STDOUT buffer.
11812 (Fcall_process_region): Ditto.
11813
11814 2011-04-30 Eli Zaretskii <eliz@gnu.org>
11815
11816 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
11817 rather than `XVECTOR (FOO)->size'.
11818
11819 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
11820 inttypes.h, as a gnulib replacement is used if it not available in
11821 system headers.
11822
11823 2011-04-21 Eli Zaretskii <eliz@gnu.org>
11824
11825 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
11826 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
11827 of MOST_POSITIVE_FIXNUM. (Bug#8528)
11828
11829 * coding.c (coding_alloc_by_realloc): Error out if destination
11830 will grow beyond MOST_POSITIVE_FIXNUM.
11831 (decode_coding_emacs_mule): Abort if there isn't enough place in
11832 charbuf for the composition carryover bytes. Reserve an extra
11833 space for up to 2 characters produced in a loop.
11834 (decode_coding_iso_2022): Abort if there isn't enough place in
11835 charbuf for the composition carryover bytes.
11836
11837 2011-04-21 Eli Zaretskii <eliz@gnu.org>
11838
11839 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
11840 aborting when %lld or %lll format is passed.
11841 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
11842 %llo or %llx format is passed. (Bug#8545)
11843
11844 * window.c (window_scroll_line_based): Use a marker instead of
11845 simple variables to record original value of point. (Bug#7952)
11846
11847 * doprnt.c (doprnt): Fix the case where a multibyte sequence
11848 produced by %s or %c overflows available buffer space. (Bug#8545)
11849
11850 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
11851
11852 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
11853 (SIZE_MAX): Move defn after all includes, as they might #define it.
11854
11855 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
11856
11857 * w32.c (init_environment): Warn about defaulting HOME to C:\.
11858
11859 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
11860
11861 * keyboard.c (Qdelayed_warnings_hook): Define.
11862 (command_loop_1): Run `delayed-warnings-hook'
11863 if Vdelayed_warnings_list is non-nil.
11864 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
11865 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
11866
11867 2011-04-28 Eli Zaretskii <eliz@gnu.org>
11868
11869 * doprnt.c (doprnt): Don't return value smaller than the buffer
11870 size if the message was truncated. (Bug#8545).
11871
11872 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
11873
11874 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
11875 (Fx_window_property): #if-0 the whole functions, not just the bodies.
11876
11877 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
11878
11879 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
11880
11881 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
11882
11883 * makefile.w32-in: Update dependencies.
11884
11885 2011-04-27 Eli Zaretskii <eliz@gnu.org>
11886
11887 Improve `doprnt' and its usage. (Bug#8545)
11888 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
11889 `format_end'. Remove support for %l as a conversion specifier.
11890 Don't use xrealloc. Improve diagnostics when the %l size modifier
11891 is used. Update the commentary.
11892
11893 * eval.c (verror): Simplify calculation of size_t.
11894
11895 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
11896 messages.
11897
11898 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
11899
11900 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
11901 change.
11902
11903 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
11904
11905 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
11906 This makes this file independent of the recent pseudovector change.
11907
11908 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
11909
11910 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
11911
11912 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
11913 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
11914 Remove unused local.
11915 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
11916
11917 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
11918 GCC 4.6.0 optimizes based on type-based alias analysis.
11919 For example, if b is of type struct buffer * and v of type struct
11920 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
11921 != &v->size, and therefore "v->size = 1; b->size = 2; return
11922 v->size;" must therefore return 1. This assumption is incorrect
11923 for Emacs, since it type-puns struct Lisp_Vector * with many other
11924 types. To fix this problem, this patch adds a new type struct
11925 vectorlike_header that documents the constraints on layout of vectors
11926 and pseudovectors, and helps optimizing compilers not get fooled
11927 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
11928 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
11929 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
11930 the size member.
11931 (XSETPVECTYPE): Rewrite in terms of new macro.
11932 (XSETPVECTYPESIZE): New macro, specifying both type and size.
11933 This is a bit clearer, and further avoids the possibility of
11934 undesirable aliasing.
11935 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
11936 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
11937 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
11938 since Lisp_Subr is a special case (no "next" field).
11939 (ASIZE): Now uses header.size rather than size.
11940 All previous uses of XVECTOR (foo)->size replaced to use this macro,
11941 to avoid the hassle of writing XVECTOR (foo)->header.size.
11942 (struct vectorlike_header): New type.
11943 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
11944 object, to help avoid aliasing.
11945 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
11946 (SUBRP): Likewise, since Lisp_Subr is a special case.
11947 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
11948 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
11949 (struct Lisp_Hash_Table): Combine first two members into a single
11950 struct vectorlike_header member. All uses of "size" and "next" members
11951 changed to be "header.size" and "header.next".
11952 * buffer.h (struct buffer): Likewise.
11953 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
11954 * frame.h (struct frame): Likewise.
11955 * process.h (struct Lisp_Process): Likewise.
11956 * termhooks.h (struct terminal): Likewise.
11957 * window.c (struct save_window_data, struct saved_window): Likewise.
11958 * window.h (struct window): Likewise.
11959 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
11960 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
11961 * buffer.c (init_buffer_once): Likewise.
11962 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
11963 special case.
11964 * process.c (Fformat_network_address): Use local var for size,
11965 for brevity.
11966
11967 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
11968
11969 Make the Lisp reader and string-to-float more consistent (Bug#8525)
11970 * data.c (atof): Remove decl; no longer used or needed.
11971 (digit_to_number): Move to lread.c.
11972 (Fstring_to_number): Use new string_to_number function, to be
11973 consistent with how the Lisp reader treats infinities and NaNs.
11974 Do not assume that floating-point numbers represent EMACS_INT
11975 without losing information; this is not true on most 64-bit hosts.
11976 Avoid double-rounding errors, by insisting on integers when
11977 parsing non-base-10 numbers, as the documentation specifies.
11978 * lisp.h (string_to_number): New decl, replacing ...
11979 (isfloat_string): Remove.
11980 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
11981 (read1): Do not accept +. and -. as integers; this
11982 appears to have been a coding error. Similarly, do not accept
11983 strings like +-1e0 as floating point numbers. Do not report
11984 overflow for integer overflows unless the base is not 10 which
11985 means we have no simple and reliable way to continue.
11986 Break out the floating-point parsing into a new
11987 function string_to_number, so that Fstring_to_number parses
11988 floating point numbers consistently with the Lisp reader.
11989 (digit_to_number): Move here from data.c. Make it static inline.
11990 (E_CHAR, EXP_INT): Remove, replacing with ...
11991 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
11992 (string_to_number): New function, replacing isfloat_string.
11993 This function checks for valid syntax and produces the resulting
11994 Lisp float number too. Rework it so that string-to-number
11995 no longer mishandles examples like "1.0e+". Use strtoumax,
11996 so that overflow for non-base-10 numbers is reported only when
11997 there's no portable and simple way to convert to floating point.
11998
11999 * textprop.c (set_text_properties_1): Rewrite for clarity,
12000 and to avoid GCC warning about integer overflow.
12001
12002 * intervals.h (struct interval): Use EMACS_INT for members
12003 where EMACS_UINT might cause problems. See
12004 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
12005 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
12006 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
12007 All uses changed.
12008 (offset_intervals): Tell GCC not to worry about length overflow
12009 when negating a negative length.
12010
12011 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
12012 (overrun_check_free): Likewise.
12013
12014 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
12015 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
12016 word size.
12017
12018 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
12019 (gnutls_make_error): Rename local to avoid shadowing.
12020 (gnutls_emacs_global_deinit): ifdef out; not used.
12021 (Fgnutls_boot): Use const for pointer to readonly storage.
12022 Comment out unused local. Fix pointer signedness problems.
12023
12024 * lread.c (openp): Don't stuff size_t into an 'int'.
12025 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
12026 about possible signed overflow.
12027
12028 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
12029 (GDK_KEY_g): Don't define if already defined.
12030 (xg_prepare_tooltip): Avoid pointer signedness problem.
12031 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
12032
12033 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
12034 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
12035
12036 * xfns.c (Fx_window_property): Simplify a bit,
12037 to make a bit faster and to avoid GCC 4.6.0 warning.
12038 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
12039
12040 * fns.c (internal_equal): Don't assume size_t fits in int.
12041
12042 * alloc.c (compact_small_strings): Tighten assertion a little.
12043
12044 Replace pEd with more-general pI, and fix some printf arg casts.
12045 * lisp.h (pI): New macro, generalizing old pEd macro to other
12046 conversion specifiers. For example, use "...%"pI"d..." rather
12047 than "...%"pEd"...".
12048 (pEd): Remove. All uses replaced with similar uses of pI.
12049 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
12050 * alloc.c (check_pure_size): Don't overflow by converting size to int.
12051 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
12052 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
12053 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
12054 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
12055 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
12056 64-bit hosts.
12057 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
12058 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
12059 * print.c (safe_debug_print, print_object): Likewise.
12060 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
12061 to int.
12062 Use pI instead of if-then-else-abort. Use %p to avoid casts,
12063 avoiding the 0 flag, which is not portable.
12064 * process.c (Fmake_network_process): Use pI to avoid cast.
12065 * region-cache.c (pp_cache): Likewise.
12066 * xdisp.c (decode_mode_spec): Likewise.
12067 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
12068 behavior on 64-bit hosts with printf arg.
12069 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
12070 (x_stop_queuing_selection_requests): Likewise.
12071 (x_get_window_property): Don't truncate byte count to an 'int'
12072 when tracing.
12073
12074 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
12075 here, since it parses constructs like leading '-' and spaces,
12076 which are not wanted; and it overflows with large numbers.
12077 Instead, simply match F[0-9]+, which is what is wanted anyway.
12078
12079 * alloc.c: Remove unportable assumptions about struct layout.
12080 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
12081 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
12082 (allocate_vectorlike, make_pure_vector): Use the new macros,
12083 plus offsetof, to remove unportable assumptions about struct layout.
12084 These assumptions hold on all porting targets that I know of, but
12085 they are not guaranteed, they're easy to remove, and removing them
12086 makes further changes easier.
12087
12088 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
12089 This doesn't fix a bug but makes the code clearer.
12090 (string_overrun_cookie): Now const. Use initializers that
12091 don't formally overflow signed char, to avoid warnings.
12092 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
12093 can cause Emacs to crash when string overrun checking is enabled.
12094 (allocate_buffer): Don't assume sizeof (struct buffer) is a
12095 multiple of sizeof (EMACS_INT); it need not be, if
12096 alignof(EMACS_INT) < sizeof (EMACS_INT).
12097 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
12098
12099 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
12100
12101 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
12102
12103 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
12104
12105 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
12106 supposed to be handshaking. (Bug#8556)
12107 Reported by Paul Eggert <eggert@cs.ucla.edu>.
12108
12109 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
12110
12111 * lisp.h (Qdebug): List symbol.
12112 * eval.c (Qdebug): Restore global linkage.
12113 * keyboard.c (debug-on-event): New variable.
12114 (handle_user_signal): Break into debugger when debug-on-event
12115 matches the current signal symbol.
12116
12117 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
12118
12119 * alloc.c (check_sblock, check_string_bytes)
12120 (check_string_free_list): Convert to standard C.
12121
12122 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
12123
12124 * w32.c (emacs_gnutls_push): Fix typo.
12125
12126 2011-04-25 Eli Zaretskii <eliz@gnu.org>
12127
12128 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
12129 "cast to pointer from integer of different size".
12130
12131 Improve doprnt and its use in verror. (Bug#8545)
12132 * doprnt.c (doprnt): Document the set of format control sequences
12133 supported by the function. Use SAFE_ALLOCA instead of always
12134 using `alloca'.
12135
12136 * eval.c (verror): Don't limit the buffer size at size_max-1, that
12137 is one byte too soon. Don't use xrealloc; instead xfree and
12138 xmalloc anew.
12139
12140 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
12141
12142 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
12143 callbacks stage.
12144
12145 * gnutls.c: Renamed global_initialized to
12146 gnutls_global_initialized. Added internals for the
12147 :verify-hostname-error, :verify-error, and :verify-flags
12148 parameters of `gnutls-boot' and documented those parameters in the
12149 docstring. Start callback support.
12150 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
12151 unless a fatal error occurred. Call gnutls_alert_send_appropriate
12152 on error. Return error code.
12153 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
12154 (emacs_gnutls_read): Likewise.
12155 (Fgnutls_boot): Return handshake error code.
12156 (emacs_gnutls_handle_error): New function.
12157 (wsaerror_to_errno): Likewise.
12158
12159 * w32.h (emacs_gnutls_pull): Add prototype.
12160 (emacs_gnutls_push): Likewise.
12161
12162 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
12163 (emacs_gnutls_push): Likewise.
12164
12165 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
12166
12167 * process.c (wait_reading_process_output): Check if GnuTLS
12168 buffered some data internally if no FDs are set for TLS
12169 connections.
12170
12171 * makefile.w32-in (OBJ2): Add gnutls.$(O).
12172 (LIBS): Link to USER_LIBS.
12173 ($(BLD)/gnutls.$(0)): New target.
12174
12175 2011-04-24 Eli Zaretskii <eliz@gnu.org>
12176
12177 * xdisp.c (handle_single_display_spec): Rename the
12178 display_replaced_before_p argument into display_replaced_p, to
12179 make it consistent with the commentary. Fix typos in the
12180 commentary.
12181
12182 * textprop.c (syms_of_textprop): Remove dead code.
12183 (copy_text_properties): Delete obsolete commentary about an
12184 interface that was deleted long ago. Fix typos in the description
12185 of arguments.
12186
12187 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
12188 to changes in oldXMenu/XMenu.h from 2011-04-16.
12189 <menu_help_message, prev_menu_help_message>: Constify.
12190 (IT_menu_make_room): menu->help_text is now `const char **';
12191 adjust.
12192
12193 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
12194 to changes in oldXMenu/XMenu.h from 2011-04-16.
12195 (struct XMenu): Declare `help_text' `const char **'.
12196
12197 * xfaces.c <Qunspecified>: Make extern again.
12198
12199 * syntax.c: Include sys/types.h before including regex.h, as
12200 required by POSIX.
12201
12202 * doc.c (get_doc_string): Improve the format passed to `error'.
12203
12204 * doprnt.c (doprnt): Improve commentary.
12205
12206 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
12207
12208 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
12209 them with etags.
12210
12211 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
12212 changes in globals.h immediately force recompilation.
12213 (TAGS): Depend on $(CURDIR)/m/intel386.h and
12214 $(CURDIR)/s/ms-w32.h.
12215 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
12216
12217 * character.c (Fchar_direction): Function deleted.
12218 (syms_of_character): Don't defsubr it.
12219 <char-direction-table>: Deleted.
12220
12221 2011-04-23 Eli Zaretskii <eliz@gnu.org>
12222
12223 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
12224 * doprnt.c: Include limits.h.
12225 (SIZE_MAX): New macro.
12226 (doprnt): Return a size_t value. 2nd arg is now size_t.
12227 Many local variables are now size_t instead of int or unsigned.
12228 Improve overflow protection. Support `l' modifier for integer
12229 conversions. Support %l conversion. Don't assume an EMACS_INT
12230 argument for integer conversions and for %c.
12231
12232 * lisp.h (doprnt): Restore prototype.
12233
12234 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
12235 $(SRC)/character.h.
12236
12237 * Makefile.in (base_obj): Add back doprnt.o.
12238
12239 * deps.mk (doprnt.o): Add back prerequisites.
12240 (callint.o): Depend on character.h.
12241
12242 * eval.c (internal_lisp_condition_case): Include the handler
12243 representation in the error message.
12244 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
12245 when breaking from the loop.
12246
12247 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
12248
12249 * callint.c (Fcall_interactively): When displaying error message
12250 about invalid control letter, pass the character's codepoint, not
12251 a pointer to its multibyte form. Improve display of the character
12252 in octal and display also its hex code.
12253
12254 * character.c (char_string): Use %x to display the (unsigned)
12255 codepoint of an invalid character, to avoid displaying a bogus
12256 negative value.
12257
12258 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
12259 `error', not SYMBOL_NAME itself.
12260
12261 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
12262 character arguments to `error'.
12263
12264 * charset.c (check_iso_charset_parameter): Fix incorrect argument
12265 to `error' in error message about FINAL_CHAR argument. Make sure
12266 FINAL_CHAR is a character, and use %c when it is passed as
12267 argument to `error'.
12268
12269 2011-04-23 Eli Zaretskii <eliz@gnu.org>
12270
12271 * s/ms-w32.h (localtime): Redirect to sys_localtime.
12272
12273 * w32.c: Include <time.h>.
12274 (sys_localtime): New function.
12275
12276 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
12277
12278 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
12279
12280 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
12281
12282 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
12283
12284 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
12285 zombies (Bug#8467).
12286
12287 2011-04-19 Eli Zaretskii <eliz@gnu.org>
12288
12289 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
12290 gl_state.e_property when gl_state.object is Qt.
12291
12292 * insdel.c (make_gap_larger): Remove limitation of buffer size
12293 to <= INT_MAX.
12294
12295 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
12296
12297 * xdisp.c (lookup_glyphless_char_display)
12298 (produce_glyphless_glyph): Handle cons cell entry in
12299 glyphless-char-display.
12300 (Vglyphless_char_display): Document it.
12301
12302 * term.c (produce_glyphless_glyph): Handle cons cell entry in
12303 glyphless-char-display.
12304
12305 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
12306
12307 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
12308
12309 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
12310
12311 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
12312 definition for no-X builds.
12313
12314 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
12315
12316 Static checks with GCC 4.6.0 and non-default toolkits.
12317
12318 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
12319
12320 * process.c (keyboard_bit_set): Define only if SIGIO.
12321 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
12322 (send_process): Repair possible setjmp clobbering.
12323
12324 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
12325
12326 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
12327
12328 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
12329
12330 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
12331 Define only if needed.
12332
12333 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
12334 by pacifying GCC about it. Maybe it's time to retire it?
12335 * xfaces.c (USG, __TIMEVAL__): Likewise.
12336
12337 * dispextern.h (struct redisplay_interface): Rename param
12338 to avoid shadowing.
12339 * termhooks.h (struct terminal): Likewise.
12340 * xterm.c (xembed_send_message): Likewise.
12341
12342 * insdel.c (make_gap_smaller): Define only if
12343 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
12344
12345 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
12346 it.
12347
12348 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
12349 so that we aren't warned about unused symbols.
12350
12351 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
12352
12353 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
12354
12355 * xfns.c (x_real_positions): Mark locals as initialized.
12356
12357 * xmenu.c (xmenu_show): Don't use uninitialized vars.
12358
12359 * xterm.c: Fix problems found by static analysis with other toolkits.
12360 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
12361 (x_dispatch_event): Declare static if USE_GTK, and
12362 define if USE_GTK || USE_X_TOOLKIT.
12363 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
12364 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
12365 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
12366 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
12367
12368 * xmenu.c (menu_help_callback): Pointer type fixes.
12369 Use const pointers when pointing at readonly data. Avoid pointer
12370 signedness clashes.
12371 (FALSE): Remove unused macro.
12372 (update_frame_menubar): Remove unused decl.
12373
12374 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
12375
12376 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
12377 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
12378 (single_menu_item): Rename local to avoid shadowing.
12379
12380 * keyboard.c (make_lispy_event): Remove unused local var.
12381
12382 * frame.c, frame.h (x_get_resource_string): Bring this back, but
12383 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
12384
12385 * bitmaps: Change bitmaps from unsigned char back to the X11
12386 compatible char. Avoid the old compiler warnings about
12387 out-of-range initializers by using, for example, '\xab' rather
12388 than 0xab.
12389
12390 * xgselect.c (xgselect_initialize): Check vs interface
12391 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
12392
12393 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
12394
12395 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
12396 to read-only memory.
12397
12398 * fns.c (vector): Remove; this old hack is no longer needed.
12399
12400 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
12401 Remove unused var.
12402 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
12403
12404 * xrdb.c (x_load_resources): Omit unused local.
12405
12406 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
12407 (x_window): Rename locals to avoid shadowing.
12408 (USG): Use the kludged USG macro, to pacify gcc.
12409
12410 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
12411 (x_term_init): Remove local to avoid shadowing.
12412
12413 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
12414
12415 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
12416 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
12417
12418 2011-04-16 Eli Zaretskii <eliz@gnu.org>
12419
12420 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
12421
12422 Fix regex.c, syntax.c and friends for buffers > 2GB.
12423 * syntax.h (struct gl_state_s): Declare character position members
12424 EMACS_INT.
12425
12426 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
12427
12428 * textprop.c (verify_interval_modification, interval_of):
12429 Declare arguments EMACS_INT.
12430
12431 * intervals.c (adjust_intervals_for_insertion): Declare arguments
12432 EMACS_INT.
12433
12434 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
12435
12436 * indent.c (Fvertical_motion): Local variable it_start is now
12437 EMACS_INT.
12438
12439 * regex.c (re_match, re_match_2, re_match_2_internal)
12440 (bcmp_translate, regcomp, regexec, print_double_string)
12441 (group_in_compile_stack, re_search, re_search_2, regex_compile)
12442 (re_compile_pattern, re_exec): Declare arguments and local
12443 variables `size_t' and `ssize_t' and return values `regoff_t', as
12444 appropriate.
12445 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
12446 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
12447 <compile_stack_type>: `size' and `avail' are now `size_t'.
12448
12449 * regex.h <regoff_t>: Use ssize_t, not int.
12450 (re_search, re_search_2, re_match, re_match_2): Arguments that
12451 specify buffer/string position and length are now ssize_t and
12452 size_t. Return type is regoff_t.
12453
12454 2011-04-16 Ben Key <bkey76@gmail.com>
12455
12456 * nsfont.m: Fixed bugs in ns_get_family and
12457 ns_descriptor_to_entity that were caused by using free to
12458 deallocate memory blocks that were allocated by xmalloc (via
12459 xstrdup). This caused Emacs to crash when compiled with
12460 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
12461 --enable-checking=xmallocoverrun). xfree is now used to
12462 deallocate these memory blocks.
12463
12464 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
12465
12466 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
12467
12468 emacs_write: Accept and return EMACS_INT for sizes.
12469 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
12470 et seq.
12471 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
12472 Accept and return EMACS_INT.
12473 (emacs_gnutls_write): Return the number of bytes written on
12474 partial writes.
12475 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
12476 (emacs_read, emacs_write): Remove check for negative size, as the
12477 Emacs source code has been audited now.
12478 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
12479 (emacs_read, emacs_write): Use it.
12480 * process.c (send_process): Adjust to the new signatures of
12481 emacs_write and emacs_gnutls_write. Do not attempt to store
12482 a byte offset into an 'int'; it might overflow.
12483 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
12484
12485 * sound.c: Don't assume sizes fit in 'int'.
12486 (struct sound_device.period_size, alsa_period_size):
12487 Return EMACS_INT, not int.
12488 (struct sound_device.write, vox_write, alsa_write):
12489 Accept EMACS_INT, not int.
12490 (wav_play, au_play): Use EMACS_INT to store sizes and to
12491 record read return values.
12492
12493 2011-04-15 Ben Key <bkey76@gmail.com>
12494
12495 * keyboard.c (Qundefined): Don't declare static since it is used
12496 in nsfns.m.
12497 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
12498 static since they are used in nsfont.m.
12499
12500 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
12501
12502 * process.c (Qprocessp): Don't declare static.
12503 * lisp.h (Qprocessp): Declare again.
12504
12505 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
12506
12507 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
12508
12509 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
12510
12511 Improve C-level modularity by making more things 'static'.
12512
12513 Don't publish debugger-only interfaces to other modules.
12514 * lisp.h (safe_debug_print, debug_output_compilation_hack):
12515 (verify_bytepos, count_markers): Move decls to the only modules
12516 that need them.
12517 * region-cache.h (pp_cache): Likewise.
12518 * window.h (check_all_windows): Likewise.
12519 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
12520
12521 * sysdep.c (croak): Now static, if
12522 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
12523 * syssignal.h (croak): Declare only if not static.
12524
12525 * alloc.c (refill_memory_reserve): Now static if
12526 !defined REL_ALLOC || defined SYSTEM_MALLOC.
12527 * lisp.h (refill_memory_reserve): Declare only if not static.
12528
12529 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
12530 Define only if USE_LUCID.
12531
12532 * xrdb.c (x_customization_string, x_rm_string): Now static.
12533
12534 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
12535 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
12536
12537 * xdisp.c (draw_row_with_mouse_face): Now static.
12538 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
12539
12540 * window.h (check_all_windows): Mark externally visible.
12541
12542 * window.c (window_deletion_count): Now static.
12543
12544 * undo.c: Make symbols static if they're not exported.
12545 (last_undo_buffer, last_boundary_position, pending_boundary):
12546 Now static.
12547
12548 * textprop.c (interval_insert_behind_hooks): Now static.
12549 (interval_insert_in_front_hooks): Likewise.
12550
12551 * term.c: Make symbols static if they're not exported.
12552 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
12553 (max_frame_lines, tty_set_terminal_modes):
12554 (tty_reset_terminal_modes, tty_turn_off_highlight):
12555 (get_tty_terminal): Now static.
12556 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
12557 * termhooks.h (term_mouse_moveto): Do not declare if
12558 HAVE_WINDOW_SYSTEM.
12559 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
12560 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
12561
12562 * sysdep.c: Make symbols static if they're not exported.
12563 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
12564 Now static.
12565 (sigprocmask_set, full_mask): Remove; unused.
12566 (wait_debugging): Mark as visible.
12567 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
12568 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
12569
12570 * syntax.c (syntax_temp): Define only if !__GNUC__.
12571
12572 * sound.c (current_sound_device, current_sound): Now static.
12573
12574 * search.c (searchbufs, searchbuf_head): Now static.
12575
12576 * scroll.c (scroll_cost): Remove; unused.
12577 * dispextern.h (scroll_cost): Remove decl.
12578
12579 * region-cache.h (pp_cache): Mark as externally visible.
12580
12581 * process.c: Make symbols static if they're not exported.
12582 (process_tick, update_tick, create_process, chan_process):
12583 (Vprocess_alist, proc_buffered_char, datagram_access):
12584 (fd_callback_data, send_process_frame, process_sent_to): Now static.
12585 (deactivate_process): Mark defn as static, as well as decl.
12586 * lisp.h (create_process): Remove decl.
12587 * process.h (chan_process, Vprocess_alist): Remove decls.
12588
12589 * print.c: Make symbols static if they're not exported.
12590 (print_depth, new_backquote_output, being_printed, print_buffer):
12591 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
12592 (print_interval, print_number_index, initial_stderr_stream):
12593 Now static.
12594 * lisp.h (Fprinc): Remove decl.
12595 (debug_output_compilation_hack): Mark as externally visible.
12596
12597 * sysdep.c (croak): Move decl from here to syssignal.h.
12598 * syssignal.h (croak): Put it here, so the API can be checked when
12599 'croak' is called from dissociate_if_controlling_tty.
12600
12601 * minibuf.c: Make symbols static if they're not exported.
12602 (minibuf_save_list, choose_minibuf_frame): Now static.
12603 * lisp.h (choose_minibuf_frame): Remove decl.
12604
12605 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
12606
12607 * lread.c: Make symbols static if they're not exported.
12608 (read_objects, initial_obarray, oblookup_last_bucket_number):
12609 Now static.
12610 (make_symbol): Remove; unused.
12611 * lisp.h (initial_obarray, make_symbol): Remove decls.
12612
12613 * keyboard.c: Make symbols static if they're not exported.
12614 (single_kboard, recent_keys_index, total_keys, recent_keys):
12615 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
12616 (this_single_command_key_start, echoing, last_auto_save):
12617 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
12618 (command_loop, echo_now, keyboard_init_hook, help_char_p):
12619 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
12620 (Vlispy_mouse_stem, double_click_count):
12621 Now static.
12622 (force_auto_save_soon): Define only if SIGDANGER.
12623 (ignore_mouse_drag_p): Now static if
12624 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
12625 (print_help): Remove; unused.
12626 (stop_character, last_timer_event): Mark as externally visible.
12627 * keyboard.h (ignore_mouse_drag_p): Declare only if
12628 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
12629 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
12630 * lisp.h (echoing): Remove decl.
12631 (force_auto_save_soon): Declare only if SIGDANGER.
12632 * xdisp.c (redisplay_window): Simplify code, to make it more
12633 obvious that ignore_mouse_drag_p is not accessed if !defined
12634 USE_GTK && !defined HAVE_NS.
12635
12636 * intervals.c: Make symbols static if they're not exported.
12637 (merge_properties_sticky, merge_interval_right, delete_interval):
12638 Now static.
12639 * intervals.h (merge_interval_right, delete_interval): Remove decls.
12640
12641 * insdel.c: Make symbols static if they're not exported.
12642 However, leave prepare_to_modify_buffer alone. It's never
12643 called from outside this function, but that appears to be a bug.
12644 (combine_after_change_list, combine_after_change_buffer):
12645 (adjust_after_replace, signal_before_change): Now static.
12646 (adjust_after_replace_noundo): Remove; unused.
12647 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
12648 (signal_before_change): Remove decls.
12649
12650 * indent.c (val_compute_motion, val_vmotion): Now static.
12651
12652 * image.c: Make symbols static if they're not exported.
12653 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
12654 if USE_GTK.
12655 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
12656 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
12657
12658 * fringe.c (standard_bitmaps): Now static.
12659 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
12660
12661 * frame.c: Make symbols static if they're not exported.
12662 (x_report_frame_params, make_terminal_frame): Now static.
12663 (get_frame_param): Now static, unless HAVE_NS.
12664 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
12665 (x_get_resource_string): Remove; not used.
12666 * frame.h (make_terminal_frame, x_report_frame_params):
12667 (x_get_resource_string); Remove decls.
12668 (x_fullscreen_adjust): Declare only if WINDOWSNT.
12669 * lisp.h (get_frame_param): Declare only if HAVE_NS.
12670
12671 * font.c, fontset.c: Make symbols static if they're not exported.
12672 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
12673 (FACE_SUITABLE_FOR_CHAR_P): Use it.
12674 * font.c (font_close_object): Now static.
12675 * font.h (font_close_object): Remove.
12676 * fontset.c (FONTSET_OBJLIST): Remove.
12677 (free_realized_fontset) #if-0 the body, which does nothing.
12678 (face_suitable_for_char_p): #if-0, as it's never called.
12679 * fontset.h (face_suitable_for_char_p): Remove decl.
12680 * xfaces.c (face_at_string_position):
12681 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
12682 since 0 is always ASCII.
12683
12684 * fns.c (weak_hash_tables): Now static.
12685
12686 * fileio.c: Make symbols static if they're not exported.
12687 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
12688 (Vwrite_region_annotation_buffers): Now static.
12689
12690 * eval.c: Make symbols static if they're not exported.
12691 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
12692 * lisp.h (backtrace_list): Remove decl.
12693
12694 * emacs.c: Make symbols static if they're not exported.
12695 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
12696 (fatal_error_code, fatal_error_signal_hook, standard_args):
12697 Now static.
12698 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
12699 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
12700 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
12701 * lisp.h (fatal_error_signal_hook): Remove decl.
12702 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
12703
12704 * editfns.c: Move a (normally-unused) function to its only use.
12705 * editfns.c, lisp.h (get_operating_system_release): Remove.
12706 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
12707 worth the hassle of breaking this out.
12708
12709 * xterm.c: Make symbols static if they're not exported.
12710 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
12711 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
12712 (x_destroy_window, x_delete_display):
12713 Now static.
12714 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
12715 (x_mouse_leave): Remove; unused.
12716 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
12717 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
12718 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
12719 Remove decls.
12720 (x_mouse_leave): Declare only if WINDOWSNT.
12721 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
12722 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
12723 USE_X_TOOLKIT.
12724
12725 * ftxfont.c: Make symbols static if they're not exported.
12726 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
12727 HAVE_FREETYPE.
12728 * font.h (ftxfont_driver): Likewise.
12729
12730 * xfns.c: Make symbols static if they're not exported.
12731 (x_last_font_name, x_display_info_for_name):
12732 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
12733 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
12734 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
12735 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
12736 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
12737 (last_show_tip_args): Now static.
12738 (xic_defaut_fontset, xic_create_fontsetname): Define only if
12739 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
12740 (x_screen_planes): Remove; unused.
12741 * dispextern.h (x_screen_planes): Remove decl.
12742
12743 * dispnew.c: Make symbols static if they're not exported.
12744 * dispextern.h (redraw_garbaged_frames, scrolling):
12745 (increment_row_positions): Remove.
12746 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
12747 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
12748 Now static.
12749 (redraw_garbaged_frames): Remove; unused.
12750
12751 * xfaces.c: Make symbols static if they're not exported.
12752 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
12753 Remove decls.
12754 * xterm.h (defined_color): Remove decls.
12755 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
12756 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
12757 (menu_face_changed_default, defined_color, free_realized_face):
12758 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
12759 (ascii_face_of_lisp_face): Remove; unused.
12760
12761 * xdisp.c: Make symbols static if they're not exported.
12762 * dispextern.h (scratch_glyph_row, window_box_edges):
12763 (glyph_to_pixel_coords, set_cursor_from_row):
12764 (get_next_display_element, set_iterator_to_next):
12765 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
12766 (show_mouse_face): Remove decls
12767 * frame.h (message_buf_print): Likewise.
12768 * lisp.h (pop_message, set_message, check_point_in_composition):
12769 Likewise.
12770 * xterm.h (set_vertical_scroll_bar): Likewise.
12771 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
12772 (message_buf_print, scratch_glyph_row, displayed_buffer):
12773 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
12774 (get_next_display_element, show_mouse_face, window_box_edges):
12775 (frame_to_window_pixel_xy, check_point_in_composition):
12776 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
12777 (glyph_to_pixel_coords): Remove; unused.
12778
12779 * dired.c (file_name_completion): Now static.
12780
12781 * dbusbind.c (xd_in_read_queued_messages): Now static.
12782
12783 * lisp.h (circular_list_error, FOREACH): Remove; unused.
12784 * data.c (circular_list_error): Remove.
12785
12786 * commands.h (last_point_position, last_point_position_buffer):
12787 (last_point_position_window): Remove decls.
12788 * keyboard.c: Make these variables static.
12789
12790 * coding.h (coding, code_convert_region, encode_coding_gap):
12791 Remove decls.
12792 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
12793 (iso_code_class, detect_coding, code_convert_region): Now static.
12794 (encode_coding_gap): Remove; unused.
12795
12796 * chartab.c (chartab_chars, chartab_bits): Now static.
12797
12798 * charset.h (charset_iso_8859_1): Remove decl.
12799 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
12800 Now static.
12801
12802 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
12803 * ccl.c (Vccl_program_table): Now static.
12804 (check_ccl_update): Remove; unused.
12805
12806 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
12807 * category.h: ... from here.
12808 * category.c (check_category_table, set_category_set): Now static.
12809
12810 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
12811 * lisp.h: Remove these decls.
12812
12813 * buffer.c (buffer_count): Remove unused var.
12814
12815 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
12816 so that it's not optimized away.
12817 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
12818 * dispextern.h (bidi_dump_cached_states): Remove, since it's
12819 exported only to the debugger.
12820
12821 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
12822 * atimer.h (run_all_atimers): Remove; not exported.
12823
12824 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
12825 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
12826 was inaccessible from Lisp.
12827 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
12828 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
12829
12830 alloc.c: Import and export fewer symbols, and remove unused items.
12831 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
12832 is defined.
12833 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
12834 it's not optimized away by whole-program optimization.
12835 (message_enable_multibyte, free_misc): Remove.
12836 (catchlist, handlerlist, mark_backtrace):
12837 Declare only if BYTE_MARK_STACK.
12838 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
12839 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
12840 (message_enable_multibyte): Remove decl.
12841 (free_misc, interval_free_list, float_block, float_block_index):
12842 (n_float_blocks, float_free_list, cons_block, cons_block_index):
12843 (cons_free_list, last_marked_index):
12844 Now static.
12845 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
12846 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
12847 (mark_backtrace): Define only if BYTE_MARK_STACK.
12848 * xdisp.c (message_enable_multibyte): Now static.
12849
12850 Declare Lisp_Object Q* variables to be 'static' if not exported.
12851 This makes it easier for human readers (and static analyzers)
12852 to see whether these variables are used from other modules.
12853 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
12854 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
12855 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
12856 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
12857 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
12858 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
12859 * xmenu.c, xselect.c:
12860 Declare Q* vars static if they are not used in other modules.
12861 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
12862 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
12863 Remove decls of unexported vars.
12864 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
12865
12866 * lisp.h (DEFINE_FUNC): Make sname 'static'.
12867
12868 Make Emacs functions such as Fatom 'static' by default.
12869 This makes it easier for human readers (and static analyzers)
12870 to see whether these functions can be called from other modules.
12871 DEFUN now defines a static function. To make the function external
12872 so that it can be used in other C modules, use the new macro DEFUE.
12873 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
12874 (Finit_image_library):
12875 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
12876 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
12877 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
12878 Remove decls, since these functions are now static.
12879 (Funintern, Fget_internal_run_time): New decls, since these functions
12880 were already external.
12881
12882 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
12883 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
12884 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
12885 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
12886 * keyboard.c, keymap.c, lread.c:
12887 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
12888 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
12889 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
12890 Mark functions with DEFUE instead of DEFUN,
12891 if they are used in other modules.
12892 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
12893 decls for now-static functions.
12894 * buffer.h (Fdelete_overlay): Remove decl.
12895 * callproc.c (Fgetenv_internal): Mark as internal.
12896 * composite.c (Fremove_list_of_text_properties): Remove decl.
12897 (Fcomposition_get_gstring): New forward static decl.
12898 * composite.h (Fcomposite_get_gstring): Remove decl.
12899 * dired.c (Ffile_attributes): New forward static decl.
12900 * doc.c (Fdocumntation_property): New forward static decl.
12901 * eval.c (Ffetch_bytecode): New forward static decl.
12902 (Funintern): Remove extern decl; now in .h file where it belongs.
12903 * fileio.c (Fmake_symbolic_link): New forward static decl.
12904 * image.c (Finit_image_library): New forward static decl.
12905 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
12906 * intervals.h (Fprevious_property_change):
12907 (Fremove_list_of_text_properties): Remove decls.
12908 * keyboard.c (Fthis_command_keys): Remove decl.
12909 (Fcommand_execute): New forward static decl.
12910 * keymap.c (Flookup_key): New forward static decl.
12911 (Fcopy_keymap): Now static.
12912 * keymap.h (Flookup_key): Remove decl.
12913 * process.c (Fget_process): New forward static decl.
12914 (Fprocess_datagram_address): Mark as internal.
12915 * syntax.c (Fsyntax_table_p): New forward static decl.
12916 (skip_chars): Remove duplicate decl.
12917 * textprop.c (Fprevious_property_change): New forward static decl.
12918 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
12919 Now internal.
12920 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
12921 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
12922
12923 * editfns.c (Fformat): Remove unreachable code.
12924
12925 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
12926
12927 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
12928 change. (Bug#8496)
12929
12930 2011-04-13 Eli Zaretskii <eliz@gnu.org>
12931
12932 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
12933 when at ZV. (Bug#8487)
12934
12935 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
12936
12937 * charset.c (Fclear_charset_maps): Use xfree instead of free.
12938 (Bug#8437)
12939 * keyboard.c (parse_tool_bar_item): Likewise.
12940 * sound.c (sound_cleanup, alsa_close): Likewise.
12941 * termcap.c (tgetent): Likewise.
12942 * xfns.c (x_default_font_parameter): Likewise.
12943 * xsettings.c (read_and_apply_settings): Likewise.
12944
12945 * alloc.c (overrun_check_malloc, overrun_check_realloc)
12946 (overrun_check_free): Protoize.
12947
12948 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
12949
12950 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
12951 since callers should never pass a negative size.
12952 Change the signature to match that of plain 'read' and 'write'; see
12953 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
12954 * lisp.h: Update prototypes of emacs_write and emacs_read.
12955
12956 2011-04-11 Eli Zaretskii <eliz@gnu.org>
12957
12958 * xdisp.c (redisplay_window): Don't try to determine the character
12959 position of the scroll margin if the window start point w->startp
12960 is outside the buffer's accessible region. (Bug#8468)
12961
12962 2011-04-10 Eli Zaretskii <eliz@gnu.org>
12963
12964 Fix write-region and its subroutines for buffers > 2GB.
12965 * fileio.c (a_write, e_write): Modify declaration of arguments and
12966 local variables to support buffers larger than 2GB.
12967 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
12968
12969 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
12970 argument, local variables, and return value.
12971
12972 * lisp.h: Update prototypes of emacs_write and emacs_read.
12973
12974 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
12975
12976 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
12977
12978 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
12979
12980 Fix more problems found by GCC 4.6.0's static checks.
12981
12982 * xdisp.c (vmessage): Use a better test for character truncation.
12983
12984 * charset.c (load_charset_map): <, not <=, for optimization,
12985 and to avoid potential problems with integer overflow.
12986 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
12987 * casetab.c (set_identity, shuffle): Likewise.
12988 * editfns.c (Fformat): Likewise.
12989 * syntax.c (skip_chars): Likewise.
12990
12991 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
12992 This also lets GCC 4.6.0 generate slightly better loop code.
12993
12994 * callint.c (Fcall_interactively): <, not <=, for optimization.
12995 (Fcall_interactively): Count the number of arguments produced,
12996 not the number of arguments given. This is simpler and lets GCC
12997 4.6.0 generate slightly better code.
12998
12999 * ftfont.c: Distingish more carefully between FcChar8 and char.
13000 The previous code passed unsigned char * to a functions like
13001 strlen and xstrcasecmp that expect char *, which does not
13002 conform to the C standard.
13003 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
13004 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
13005 char * when the C standard requires it.
13006
13007 * keyboard.c (read_char): Remove unused var.
13008
13009 * eval.c: Port to Windows vsnprintf (Bug#8435).
13010 Include <limits.h>.
13011 (SIZE_MAX): Define if the headers do not.
13012 (verror): Do not give up if vsnprintf returns a negative count.
13013 Instead, grow the buffer. This ports to Windows vsnprintf, which
13014 does not conform to C99. Problem reported by Eli Zaretskii.
13015 Also, simplify the allocation scheme, by avoiding the need for
13016 calling realloc, and removing the ALLOCATED variable.
13017
13018 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
13019
13020 Remove invocations of doprnt, as Emacs now uses vsnprintf.
13021 But keep the doprint source code for now, as we might revamp it
13022 and use it again (Bug#8435).
13023 * lisp.h (doprnt): Remove.
13024 * Makefile.in (base_obj): Remove doprnt.o.
13025 * deps.mk (doprnt.o): Remove.
13026
13027 error: Print 32- and 64-bit integers portably (Bug#8435).
13028 Without this change, on typical 64-bit hosts error ("...%d...", N)
13029 was used to print both 32- and 64-bit integers N, which relied on
13030 undefined behavior.
13031 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
13032 * lisp.h (error, verror): Mark as printf-like functions.
13033 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
13034 Report overflow in size calculations when allocating printf buffer.
13035 Do not truncate output string at its first null byte.
13036 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
13037 Truncate the output at a character boundary, since vsnprintf does not
13038 do that.
13039 * charset.c (check_iso_charset_parameter): Convert internal
13040 character to string before calling 'error', since %c now has the
13041 printf meaning.
13042 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
13043 overflow when computing char to be passed to 'error'. Do not
13044 pass Lisp_Object to 'error'; pass the integer instead.
13045 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
13046 formatted with plain %d.
13047
13048 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
13049
13050 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
13051
13052 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
13053
13054 * xterm.c (x_catch_errors): Remove duplicate declaration.
13055
13056 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
13057
13058 * xdisp.c, lisp.h (message_nolog): Remove; unused.
13059
13060 2011-04-10 Jim Meyering <meyering@redhat.com>
13061
13062 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
13063 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
13064 return ssize_t not "int", and use size_t as the buffer length.
13065 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
13066 * gnutls.h: Update declarations.
13067 * process.c (read_process_output): Use ssize_t, to match.
13068 (send_process): Likewise.
13069
13070 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
13071
13072 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
13073
13074 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
13075
13076 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
13077 Use unsigned char, to match FcChar8 type definition.
13078
13079 * xterm.c (handle_one_xevent):
13080 * xmenu.c (create_and_show_popup_menu):
13081 * xselect.c (x_decline_selection_request)
13082 (x_reply_selection_request): Avoid type-punned deref of X events.
13083
13084 2011-04-09 Eli Zaretskii <eliz@gnu.org>
13085
13086 Fix some uses of `int' instead of EMACS_INT.
13087 * search.c (string_match_1, fast_string_match)
13088 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
13089 (scan_buffer, find_next_newline_no_quit)
13090 (find_before_next_newline, search_command, Freplace_match)
13091 (Fmatch_data): Make some `int' variables be EMACS_INT.
13092
13093 * xdisp.c (display_count_lines): 3rd argument and return value now
13094 EMACS_INT. All callers changed.
13095 (pint2hrstr): Last argument is now EMACS_INT.
13096
13097 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
13098 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
13099 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
13100 (decode_coding_utf_16, decode_coding_emacs_mule)
13101 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
13102 (decode_coding_ccl, decode_coding_charset)
13103 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
13104 (decode_coding_iso_2022, decode_coding_emacs_mule)
13105 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
13106 <char_offset, last_offset>: Declare EMACS_INT.
13107 (encode_coding_utf_8, encode_coding_utf_16)
13108 (encode_coding_emacs_mule, encode_invocation_designation)
13109 (encode_designation_at_bol, encode_coding_iso_2022)
13110 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
13111 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
13112 Declare EMACS_INT.
13113 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
13114 (encode_invocation_designation): Last argument P_NCHARS is now
13115 EMACS_INT.
13116 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
13117 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
13118
13119 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
13120 All users changed.
13121
13122 * ccl.c (Fccl_execute_on_string): Declare some variables
13123 EMACS_INT.
13124
13125 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
13126
13127 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
13128
13129 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
13130
13131 * process.c (Fformat_network_address): Doc fix.
13132
13133 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
13134
13135 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
13136
13137 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
13138
13139 * keyboard.c (read_char): Call Lisp function help-form-show,
13140 instead of using internal_with_output_to_temp_buffer.
13141 (Qhelp_form_show): New var.
13142 (syms_of_keyboard): Use DEFSYM macro.
13143
13144 * print.c (internal_with_output_to_temp_buffer): Function deleted.
13145
13146 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
13147
13148 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
13149
13150 * process.c (Flist_processes): Remove to Lisp.
13151 (list_processes_1): Delete.
13152
13153 2011-04-06 Eli Zaretskii <eliz@gnu.org>
13154
13155 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
13156
13157 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
13158
13159 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
13160
13161 Fix more problems found by GCC 4.6.0's static checks.
13162
13163 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
13164
13165 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
13166
13167 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
13168
13169 * xdisp.c (vmessage): Mark as a printf-like function.
13170
13171 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
13172
13173 * sound.c (sound_warning): Don't crash if arg contains a printf format.
13174
13175 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
13176 printf-like functions.
13177 (tiff_load): Add casts to remove these marks before passing them
13178 to system-supplied API.
13179
13180 * eval.c (Fsignal): Remove excess argument to 'fatal'.
13181
13182 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
13183 This avoids several warnings with gcc -Wstrict-overflow.
13184 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
13185 directly, rather than having caller test rule sign. This avoids
13186 some unnecessary tests.
13187 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
13188 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
13189 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
13190
13191 * xfont.c (xfont_text_extents): Remove var that was set but not used.
13192 (xfont_open): Avoid unnecessary tests.
13193
13194 * composite.c (composition_gstring_put_cache): Use unsigned integer.
13195
13196 * composite.h, composite.c (composition_gstring_put_cache):
13197 Use EMACS_INT, not int, for length.
13198
13199 * composite.h (COMPOSITION_DECODE_REFS): New macro,
13200 breaking out part of COMPOSITION_DECODE_RULE.
13201 (COMPOSITION_DECODE_RULE): Use it.
13202 * composite.c (get_composition_id): Remove unused local vars,
13203 by using the new macro.
13204
13205 * textprop.c (set_text_properties_1): Change while to do-while,
13206 since the condition is always true at first.
13207
13208 * intervals.c (graft_intervals_into_buffer): Mark var as used.
13209 (interval_deletion_adjustment): Return unsigned value.
13210 All uses changed.
13211
13212 * process.c (list_processes_1, create_pty, read_process_output):
13213 (exec_sentinel): Remove vars that were set but not used.
13214 (create_pty): Remove unnecessary "volatile"s.
13215 (Fnetwork_interface_info): Avoid possibility of int overflow.
13216 (read_process_output): Do adaptive read buffering even if carryover.
13217 (read_process_output): Simplify nbytes computation if buffered.
13218
13219 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
13220
13221 * syntax.c (scan_words): Remove var that was set but not used.
13222 (update_syntax_table): Use unsigned instead of int.
13223
13224 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
13225 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
13226 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
13227
13228 * print.c (print_error_message): Avoid int overflow.
13229
13230 * font.c (font_list_entities): Redo for clarity,
13231 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
13232
13233 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
13234 (font_score): Avoid potential overflow in diff calculation.
13235
13236 * fns.c (substring_both): Remove var that is set but not used.
13237 (sxhash): Redo loop for clarity and to avoid wraparound warning.
13238
13239 * eval.c (funcall_lambda): Rename local to avoid shadowing.
13240
13241 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
13242 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
13243 can always succeed if overflow has undefined behavior.
13244
13245 * search.c (boyer_moore, wordify): Remove vars set but not used.
13246 (wordify): Omit three unnecessary tests.
13247
13248 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
13249 All callers changed. This avoids the need for an unused var.
13250
13251 * casefiddle.c (casify_region): Remove var that is set but not used.
13252
13253 * dired.c (file_name_completion): Remove var that is set but not used.
13254
13255 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
13256
13257 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
13258 (Finsert_file_contents): Remove unnecessary code checking fd.
13259
13260 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
13261 Check for integer overflow on size calculations.
13262
13263 * buffer.c (Fprevious_overlay_change): Remove var that is set
13264 but not used.
13265
13266 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
13267 Remove vars that are set but not used.
13268 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
13269 (timer_check_2): Mark vars as initialized.
13270
13271 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
13272
13273 * image.c (lookup_image): Remove var that is set but not used.
13274 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
13275
13276 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
13277 that are set but not used.
13278
13279 * xfns.c (make_invisible_cursor): Don't return garbage
13280 if XCreateBitmapFromData fails (Bug#8410).
13281
13282 * xselect.c (x_get_local_selection, x_handle_property_notify):
13283 Remove vars that are set but not used.
13284
13285 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
13286 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
13287
13288 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
13289 Remove var that is set but not used.
13290 (scroll_bar_windows_size): Now size_t, not int.
13291 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
13292 Check for overflow.
13293
13294 * xfaces.c (realize_named_face): Remove vars that are set but not used.
13295 (map_tty_color) [!defined MSDOS]: Likewise.
13296
13297 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
13298
13299 * coding.c: Remove vars that are set but not used.
13300 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
13301 All callers changed.
13302 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
13303 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
13304 (decode_coding_charset): Remove vars that are set but not used.
13305
13306 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
13307 that is set but not used.
13308
13309 * print.c (print_object): Remove var that is set but not used.
13310
13311 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
13312 The gnulib version avoids calling malloc in the usual case,
13313 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
13314 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
13315 * filelock.c (current_lock_owner): Likewise.
13316 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
13317 * sysdep.c: Include allocator.h, careadlinkat.h.
13318 (emacs_no_realloc_allocator): New static constant.
13319 (emacs_readlink): New function.
13320 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
13321 ../lib/careadlinkat.h.
13322
13323 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
13324
13325 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
13326 first non-nil return value).
13327
13328 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
13329
13330 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
13331 if not defined (Bug#8403).
13332
13333 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
13334
13335 * xdisp.c (display_count_lines): Remove parameter `start',
13336 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
13337 (get_char_face_and_encoding): Remove parameter `multibyte_p',
13338 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
13339 (fill_stretch_glyph_string): Remove parameters `row' and `area',
13340 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
13341 and thereabouts. All callers changed.
13342 (get_per_char_metric): Remove parameter `f', unused since
13343 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
13344
13345 2011-04-02 Jim Meyering <meyering@redhat.com>
13346
13347 do not dereference NULL upon failed strdup
13348 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
13349 (ns_get_family): Likewise.
13350
13351 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
13352
13353 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
13354
13355 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
13356
13357 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
13358 later (Bug#8403).
13359
13360 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
13361
13362 Add lexical binding.
13363
13364 * window.c (Ftemp_output_buffer_show): New fun.
13365 (Fsave_window_excursion):
13366 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
13367
13368 * lread.c (lisp_file_lexically_bound_p): New function.
13369 (Fload): Bind Qlexical_binding.
13370 (readevalloop): Remove `evalfun' arg.
13371 Bind Qinternal_interpreter_environment.
13372 (Feval_buffer): Bind Qlexical_binding.
13373 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
13374 Mark as dynamic.
13375 (syms_of_lread): Declare `lexical-binding'.
13376
13377 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
13378
13379 * keyboard.c (eval_dyn): New fun.
13380 (menu_item_eval_property): Use it.
13381
13382 * image.c (parse_image_spec): Use Ffunctionp.
13383
13384 * fns.c (concat, mapcar1): Accept byte-code-functions.
13385
13386 * eval.c (Fsetq): Handle lexical vars.
13387 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
13388 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
13389 (FletX, Flet): Obey lexical binding.
13390 (Fcommandp): Handle closures.
13391 (Feval): New `lexical' arg.
13392 (eval_sub): New function extracted from Feval. Use it almost
13393 everywhere where Feval was used. Look up vars in lexical env.
13394 Handle closures.
13395 (Ffunctionp): Move from subr.el.
13396 (Ffuncall): Handle closures.
13397 (apply_lambda): Remove `eval_flags'.
13398 (funcall_lambda): Handle closures and new byte-code-functions.
13399 (Fspecial_variable_p): New function.
13400 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
13401 but without exporting it to Lisp.
13402
13403 * doc.c (Fdocumentation, store_function_docstring):
13404 * data.c (Finteractive_form): Handle closures.
13405
13406 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
13407 interactive spec.
13408
13409 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
13410 New byte-codes.
13411 (exec_byte_code): New function extracted from Fbyte_code to handle new
13412 calling convention for byte-code-functions. Add new byte-codes.
13413
13414 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
13415
13416 * alloc.c (Fmake_symbol): Init new `declared_special' field.
13417
13418 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
13419
13420 * xdisp.c (redisplay_internal): Fix prototype.
13421
13422 2011-03-31 Eli Zaretskii <eliz@gnu.org>
13423
13424 * xdisp.c (SCROLL_LIMIT): New macro.
13425 (try_scrolling): Use it when setting scroll_limit.
13426 Limit scrolling to 100 screen lines.
13427 (redisplay_window): Even when falling back on "recentering",
13428 position point in the window according to scroll-conservatively,
13429 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
13430
13431 (try_scrolling): When point is above the window, allow searching
13432 as far as scroll_max, or one screenful, to compute vertical
13433 distance from PT to the scroll margin position. This prevents
13434 try_scrolling from unnecessarily failing when
13435 scroll-conservatively is set to a value slightly larger than the
13436 window height. Clean up the case of PT below the margin at bottom
13437 of window: scroll_max can no longer be INT_MAX. When aggressive
13438 scrolling is in use, don't let point enter the opposite scroll
13439 margin as result of the scroll.
13440 (syms_of_xdisp) <scroll-conservatively>: Document the
13441 threshold of 100 lines for never-recentering scrolling.
13442
13443 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
13444
13445 * dispextern.h (move_it_by_lines):
13446 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
13447 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
13448 (message_log_check_duplicate): Remove parameters `prev_bol' and
13449 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
13450 (redisplay_internal): Remove parameter `preserve_echo_area',
13451 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
13452
13453 * indent.c (Fvertical_motion):
13454 * window.c (window_scroll_pixel_based, Frecenter):
13455 Don't pass `need_y_p' to `move_it_by_lines'.
13456
13457 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
13458
13459 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
13460 steal a few bits to be more compact.
13461 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
13462 Remove unneeded casts.
13463
13464 * bytecode.c (Fbyte_code): CAR and CDR can GC.
13465
13466 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
13467
13468 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
13469 binding" message (bug#7967).
13470
13471 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
13472
13473 Fix more problems found by GCC 4.6.0's static checks.
13474
13475 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
13476 Remove unused local var.
13477
13478 * editfns.c (Fmessage_box): Remove unused local var.
13479
13480 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
13481 (note_mode_line_or_margin_highlight, note_mouse_highlight):
13482 Omit unused local vars.
13483 * window.c (shrink_windows): Omit unused local var.
13484 * menu.c (digest_single_submenu): Omit unused local var.
13485 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
13486 Omit unused local var.
13487
13488 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
13489 Don't assume string length fits in int.
13490 (keyremap_step, read_key_sequence): Use size_t for sizes.
13491 (read_key_sequence): Don't check last_real_key_start redundantly.
13492
13493 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
13494 instead of alloca (Bug#8344).
13495
13496 * eval.c (Fbacktrace): Don't assume nargs fits in int.
13497 (Fbacktrace_frame): Don't assume nframes fits in int.
13498
13499 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
13500
13501 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
13502 concerns.
13503
13504 * term.c (produce_glyphless_glyph): Remove unnecessary test.
13505
13506 * cm.c (calccost): Turn while-do into do-while, for clarity.
13507
13508 * keyboard.c (syms_of_keyboard): Use the same style as later
13509 in this function when indexing through an array. This also
13510 works around GCC bug 48267.
13511
13512 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
13513
13514 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
13515
13516 * chartab.c (sub_char_table_ref_and_range): Redo for slight
13517 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
13518
13519 * keyboard.c, keyboard.h (num_input_events): Now size_t.
13520 This avoids undefined behavior on integer overflow, and is a bit
13521 more convenient anyway since it is compared to a size_t variable.
13522
13523 Variadic C functions now count arguments with size_t, not int.
13524 This avoids an unnecessary limitation on 64-bit machines, which
13525 caused (substring ...) to crash on large vectors (Bug#8344).
13526 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
13527 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
13528 All variadic functions and their callers changed accordingly.
13529 (struct gcpro.nvars): Now size_t, not int. All uses changed.
13530 * data.c (arith_driver, float_arith_driver): Likewise.
13531 * editfns.c (general_insert_function): Likewise.
13532 * eval.c (struct backtrace.nargs, interactive_p)
13533 (internal_condition_case_n, run_hook_with_args, apply_lambda)
13534 (funcall_lambda, mark_backtrace): Likewise.
13535 * fns.c (concat): Likewise.
13536 * frame.c (x_set_frame_parameters): Likewise.
13537 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
13538 0 if not found, not -1. All callers changed.
13539
13540 * alloc.c (garbage_collect): Don't assume stack size fits in int.
13541 (stack_copy_size): Now size_t, not int.
13542 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
13543
13544 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
13545
13546 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
13547 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
13548 All callers changed.
13549
13550 * lisp.h (multibyte_char_to_unibyte):
13551 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
13552 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
13553 * character.h (CHAR_TO_BYTE8):
13554 * cmds.c (internal_self_insert):
13555 * editfns.c (general_insert_function):
13556 * keymap.c (push_key_description):
13557 * search.c (Freplace_match):
13558 * xdisp.c (message_dolog, set_message_1): All callers changed.
13559
13560 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
13561
13562 * keyboard.c (safe_run_hook_funcall): New function.
13563 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
13564 don't set the hook to nil, but remove the offending function instead.
13565 (Qcommand_hook_internal): Remove, unused.
13566 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
13567 Vcommand_hook_internal.
13568
13569 * eval.c (enum run_hooks_condition): Remove.
13570 (funcall_nil, funcall_not): New functions.
13571 (run_hook_with_args): Call each function through a `funcall' argument.
13572 Remove `cond' argument, now redundant.
13573 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
13574 (Frun_hook_with_args_until_failure): Adjust accordingly.
13575 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
13576
13577 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
13578
13579 * dispextern.h (string_buffer_position): Remove declaration.
13580
13581 * print.c (strout): Remove parameter `multibyte', unused since
13582 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
13583
13584 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
13585 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
13586 All callers changed.
13587
13588 * w32.c (_wsa_errlist): Use braces for struct initializers.
13589
13590 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
13591 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
13592 All callers changed.
13593 (string_buffer_position): Likewise. Also, make static (it's never
13594 used outside xdisp.c).
13595 (cursor_row_p): Remove parameter `w', unused since
13596 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
13597 (decode_mode_spec): Remove parameter `precision', introduced during
13598 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
13599 All callers changed.
13600
13601 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
13602
13603 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
13604
13605 2011-03-27 Anders Lindgren <andlind@gmail.com>
13606
13607 * nsterm.m (ns_menu_bar_is_hidden): New variable.
13608 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
13609 (ns_update_auto_hide_menu_bar): New functions.
13610 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
13611 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
13612 ns_constrain_all_frames.
13613 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
13614 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
13615
13616 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
13617
13618 * nsmenu.m (runDialogAt): Remove argument to timer_check.
13619
13620 2011-03-27 Glenn Morris <rgm@gnu.org>
13621
13622 * syssignal.h: Replace RETSIGTYPE with void.
13623 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
13624 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
13625 Replace SIGTYPE with void everywhere.
13626 * s/usg5-4-common.h (SIGTYPE): Remove definition.
13627 * s/template.h (SIGTYPE): Remove commented out definition.
13628
13629 2011-03-26 Eli Zaretskii <eliz@gnu.org>
13630
13631 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
13632 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
13633
13634 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
13635
13636 * w32.c (read_unc_volume): Use parameter `henum', instead of
13637 global variable `wget_enum_handle'.
13638
13639 * keymap.c (describe_vector): Remove parameters `indices' and
13640 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
13641 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
13642
13643 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
13644
13645 * keyboard.c (timer_check): Remove parameter `do_it_now',
13646 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
13647 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
13648 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
13649
13650 * keyboard.c (read_char):
13651 * w32menu.c (w32_menu_display_help):
13652 * xmenu.c (show_help_event, menu_help_callback):
13653 Adjust calls to `show_help_echo'.
13654
13655 * gtkutil.c (xg_maybe_add_timer):
13656 * keyboard.c (readable_events):
13657 * process.c (wait_reading_process_output):
13658 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
13659
13660 * insdel.c (adjust_markers_gap_motion):
13661 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
13662 (gap_left, gap_right): Don't call it.
13663
13664 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
13665
13666 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
13667 incurred during fontification.
13668
13669 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
13670
13671 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
13672 (DEFVAR_PER_BUFFER): Don't pass it.
13673
13674 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
13675 (scrolling_window): Don't pass it.
13676
13677 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
13678
13679 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
13680
13681 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
13682 and `suffix'.
13683 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
13684 of variables specific to SELinux and computation of `encoded_absname'.
13685
13686 * image.c (XPutPixel): Remove unused variable `height'.
13687
13688 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
13689
13690 * unexw32.c (get_section_info): Remove unused variable `section'.
13691
13692 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
13693 (system_process_attributes): Remove unused variable `sess'.
13694 (sys_read): Remove unused variable `err'.
13695
13696 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
13697 (w32_wnd_proc): Remove unused variable `isdead'.
13698 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
13699 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
13700 (x_create_tip_frame): Remove unused variable `tem'.
13701
13702 * w32inevt.c (w32_console_read_socket):
13703 Remove unused variable `no_events'.
13704
13705 * w32term.c (x_draw_composite_glyph_string_foreground):
13706 Remove unused variable `width'.
13707
13708 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
13709
13710 * w32term.c (x_set_glyph_string_clipping):
13711 Don't pass uninitialized region to CombineRgn.
13712
13713 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
13714
13715 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
13716 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
13717 (Fx_close_connection): Remove unused variable `i'.
13718
13719 * w32font.c (w32font_draw): Return number of glyphs.
13720 (w32font_open_internal): Remove unused variable `i'.
13721 (w32font_driver): Add missing initializer.
13722
13723 * w32menu.c (utf8to16): Remove unused variable `utf16'.
13724 (fill_in_menu): Remove unused variable `items_added'.
13725
13726 * w32term.c (last_mouse_press_frame): Remove static global variable.
13727 (w32_clip_to_row): Remove unused variable `f'.
13728 (x_delete_terminal): Remove unused variable `i'.
13729
13730 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
13731 (NOTHING): Remove unused static global variable.
13732 (uniscribe_check_otf): Remove unused variable `table'.
13733 (uniscribe_font_driver): Add missing initializers.
13734
13735 2011-03-23 Julien Danjou <julien@danjou.info>
13736
13737 * term.c (Fsuspend_tty, Fresume_tty):
13738 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
13739 * window.c (temp_output_buffer_show):
13740 * insdel.c (signal_before_change):
13741 * frame.c (Fhandle_switch_frame):
13742 * fileio.c (Fdo_auto_save):
13743 * emacs.c (Fkill_emacs):
13744 * editfns.c (save_excursion_restore):
13745 * cmds.c (internal_self_insert):
13746 * callint.c (Fcall_interactively):
13747 * buffer.c (Fkill_all_local_variables):
13748 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
13749 Use Frun_hooks.
13750 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
13751 unconditionally since it does the check itself.
13752
13753 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
13754
13755 Fix more problems found by GCC 4.5.2's static checks.
13756
13757 * coding.c (encode_coding_raw_text): Avoid unnecessary test
13758 the first time through the loop, since we know p0 < p1 then.
13759 This also avoids a gcc -Wstrict-overflow warning.
13760
13761 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
13762 leading to a memory leak, possible in functions like
13763 load_charset_map_from_file that can allocate an unbounded number
13764 of objects (Bug#8318).
13765
13766 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
13767 that could (at least in theory) be that large.
13768
13769 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
13770 This is less likely to overflow, and avoids undefined behavior if
13771 overflow does occur. All callers changed. Use strtoul to scan
13772 for the unsigned long integer.
13773 (pint2hrstr): Simplify and tune code slightly.
13774 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
13775
13776 * scroll.c (do_scrolling): Work around GCC bug 48228.
13777 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
13778
13779 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
13780 This also avoids a warning with gcc -Wstrict-overflow.
13781 (validate_x_resource_name): Simplify count usage.
13782 This also avoids a warning with gcc -Wstrict-overflow.
13783
13784 * fileio.c (Fcopy_file): Report error if fchown or fchmod
13785 fail (Bug#8306).
13786
13787 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
13788
13789 * process.c (Fmake_network_process): Use socklen_t, not int,
13790 where POSIX says socklen_t is required in portable programs.
13791 This fixes a porting bug on hosts like 64-bit HP-UX, where
13792 socklen_t is wider than int (Bug#8277).
13793 (Fmake_network_process, server_accept_connection):
13794 (wait_reading_process_output, read_process_output):
13795 Likewise.
13796
13797 * process.c: Rename or move locals to avoid shadowing.
13798 (list_processes_1, Fmake_network_process):
13799 (read_process_output_error_handler, exec_sentinel_error_handler):
13800 Rename or move locals.
13801 (Fmake_network_process): Define label "retry_connect" only if needed.
13802 (Fnetwork_interface_info): Fix pointer signedness.
13803 (process_send_signal): Add cast to avoid pointer signedness problem.
13804 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
13805 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
13806
13807 Make tparam.h and terminfo.c consistent.
13808 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
13809 Include tparam.h instead, since it declares them.
13810 * cm.h (PC): Remove extern decl; tparam.h now does this.
13811 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
13812 * terminfo.c: Include tparam.h, to check interfaces.
13813 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
13814 (tparam): Adjust signature to match interface in tparam.h;
13815 this removes some undefined behavior. Check that outstring and len
13816 are zero, which they always are with Emacs.
13817 * tparam.h (PC, BC, UP): New extern decls.
13818
13819 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
13820 (xftfont_open): Rename locals to avoid shadowing.
13821
13822 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
13823 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
13824 (OTF_TAG_SYM): Omit macro if not needed.
13825 (ftfont_list): Remove unused local.
13826 (get_adstyle_property, ftfont_pattern_entity):
13827 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
13828 Rename locals to avoid shadowing.
13829
13830 * xfont.c (xfont_list_family): Mark var as initialized.
13831
13832 * xml.c (make_dom): Now static.
13833
13834 * composite.c (composition_compute_stop_pos): Rename local to
13835 avoid shadowing.
13836 (composition_reseat_it): Remove unused locals.
13837 (find_automatic_composition, composition_adjust_point): Likewise.
13838 (composition_update_it): Mark var as initialized.
13839 (find_automatic_composition): Mark vars as initialized,
13840 with a FIXME (Bug#8290).
13841
13842 character.h: Rename locals to avoid shadowing.
13843 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
13844 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
13845 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
13846 (BUF_DEC_POS): Be more systematic about renaming local temporaries
13847 to avoid shadowing.
13848
13849 * textprop.c (property_change_between_p): Remove; unused.
13850
13851 * intervals.c (interval_start_pos): Now static.
13852
13853 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
13854
13855 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
13856 Rename locals to avoid shadowing.
13857
13858 * sound.c (wav_play, au_play, Fplay_sound_internal):
13859 Fix pointer signedness.
13860 (alsa_choose_format): Remove unused local var.
13861 (wav_play): Initialize a variable to 0, to prevent undefined
13862 behavior (Bug#8278).
13863
13864 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
13865
13866 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
13867
13868 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
13869 clobbering (Bug#8298).
13870 * sysdep.c (sys_subshell): Likewise.
13871 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
13872
13873 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
13874 This should get cleaned up, so that child_setup has the
13875 same signature on all platforms.
13876
13877 * callproc.c (call_process_cleanup): Now static.
13878 (relocate_fd): Rename locals to avoid shadowing.
13879
13880 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
13881
13882 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
13883 not to be necessary, and produces flickering.
13884
13885 2011-03-20 Glenn Morris <rgm@gnu.org>
13886
13887 * config.in: Remove file.
13888
13889 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
13890
13891 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
13892 are now in src/globals.h.
13893 (syms_of_minibuf): Remove spurious & from previous change.
13894
13895 2011-03-20 Leo Liu <sdl.web@gmail.com>
13896
13897 * minibuf.c (completing-read-function): New variable.
13898 (completing-read-default): Rename from completing-read.
13899 (completing-read): Call completing-read-function.
13900
13901 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
13902
13903 * xfaces.c (Fx_load_color_file):
13904 Read color file from absolute filename (bug#8250).
13905
13906 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
13907
13908 * makefile.w32-in: Update dependencies.
13909
13910 2011-03-17 Eli Zaretskii <eliz@gnu.org>
13911
13912 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
13913
13914 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
13915
13916 Fix more problems found by GCC 4.5.2's static checks.
13917
13918 * process.c (make_serial_process_unwind, send_process_trap):
13919 (sigchld_handler): Now static.
13920
13921 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
13922 That way, the code declares only the vars that it needs.
13923 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
13924 * s/cygwin.h (PTY_ITERATION): Likewise.
13925 * s/darwin.h (PTY_ITERATION): Likewise.
13926 * s/gnu-linux.h (PTY_ITERATION): Likewise.
13927
13928 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
13929 * process.c (allocate_pty): Don't declare stb unless it's needed.
13930
13931 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
13932 (CONSTANTLIM): Remove; unused.
13933 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
13934 Define only if needed.
13935
13936 * unexelf.c (unexec): Name an expression,
13937 to avoid gcc -Wbad-function-cast warning.
13938 Use a different way to cause a compilation error if anyone uses
13939 n rather than nn, a way that does not involve shadowing.
13940 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
13941
13942 * deps.mk (unexalpha.o): Remove; unused.
13943
13944 New file unexec.h, the (simple) interface for unexec (Bug#8267).
13945 * unexec.h: New file.
13946 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
13947 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
13948 Depend on unexec.h.
13949 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
13950 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
13951 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
13952 Change as necessary to match prototype in unexec.h.
13953
13954 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
13955 shadowing.
13956 (back_comment, skip_chars): Mark vars as initialized.
13957
13958 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
13959 Rename locals to avoid shadowing.
13960
13961 * lread.c (read1): Rewrite so as not to use empty "else".
13962 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
13963
13964 * print.c (Fredirect_debugging_output): Fix pointer signedess.
13965
13966 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
13967 warning when compiling print.c.
13968
13969 * font.c (font_unparse_fcname): Abort in an "impossible" situation
13970 instead of using an uninitialized var.
13971 (font_sort_entities): Mark var as initialized.
13972
13973 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
13974
13975 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
13976 pointers to constants.
13977 (font_parse_fcname): Remove unused vars.
13978 (font_delete_unmatched): Now static.
13979 (font_get_spec): Remove; unused.
13980 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
13981 (font_update_drivers, Ffont_get_glyphs, font_add_log):
13982 Rename or move locals to avoid shadowing.
13983
13984 * fns.c (require_nesting_list, require_unwind): Now static.
13985 (Ffillarray): Rename locals to avoid shadowing.
13986
13987 * floatfns.c (domain_error2): Define only if needed.
13988 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
13989
13990 * alloc.c (mark_backtrace): Move decl from here ...
13991 * lisp.h: ... to here, so that it can be checked.
13992
13993 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
13994 (Fdefvar): Rewrite so as not to use empty "else".
13995 (lisp_indirect_variable): Name an expression,
13996 to avoid gcc -Wbad-function-cast warning.
13997 (Fdefvar): Rename locals to avoid shadowing.
13998
13999 * callint.c (quotify_arg, quotify_args): Now static.
14000 (Fcall_interactively): Rename locals to avoid shadowing.
14001 Use const pointer when appropriate.
14002
14003 * lisp.h (get_system_name, get_operating_system_release):
14004 Move decls here, to check interfaces.
14005 * process.c (get_operating_system_release): Move decl to lisp.h.
14006 * xrdb.c (get_system_name): Likewise.
14007 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
14008 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
14009 some of which prompt warnings from gcc -Wbad-function-cast.
14010 (Fformat_time_string, Fencode_time, Finsert_char):
14011 (Ftranslate_region_internal, Fformat):
14012 Rename or remove local vars to avoid shadowing.
14013 (Ftranslate_region_internal): Mark var as initialized.
14014
14015 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
14016 avoid shadowing.
14017
14018 * lisp.h (eassert): Check that the argument compiles, even if
14019 ENABLE_CHECKING is not defined.
14020
14021 * data.c (Findirect_variable): Name an expression, to avoid
14022 gcc -Wbad-function-cast warning.
14023 (default_value, arithcompare, arith_driver, arith_error): Now static.
14024 (store_symval_forwarding): Rename local to avoid shadowing.
14025 (Fmake_variable_buffer_local, Fmake_local_variable):
14026 Mark variables as initialized.
14027 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
14028
14029 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
14030 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
14031 Rename locals to avoid shadowing.
14032 (mark_stack): Move local variables into the #ifdef region where
14033 they're used.
14034 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
14035 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
14036 needed otherwise.
14037 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
14038 (GC_STRING_CHARS): Remove; not used.
14039 (Fmemory_limit): Cast sbrk's returned value to char *.
14040
14041 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
14042 avoids undefined behavior in theory.
14043
14044 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
14045
14046 Use functions, not macros, for up- and down-casing (Bug#8254).
14047 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
14048 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
14049 to use the following functions instead of these macros.
14050 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
14051 EMACS_INT, since callers assume the returned value fits in int.
14052 (upcase1): Likewise, for UPCASE_TABLE.
14053 (uppercasep, lowercasep, upcase): New static inline functions.
14054 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
14055 the race-condition problem in the old DOWNCASE.
14056
14057 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
14058 Rename locals to avoid shadowing.
14059 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
14060 (regex_compile, re_search_2, re_match_2_internal):
14061 Remove unused local vars.
14062 (FREE_VAR): Rewrite so as not to use empty "else",
14063 which gcc can warn about.
14064 (regex_compile, re_match_2_internal): Mark locals as initialized.
14065 (RETALLOC_IF): Define only if needed.
14066 (WORDCHAR_P): Likewise. This one is never needed, but is used
14067 only in a comment talking about a compiler bug, so put inside
14068 the #if 0 of that comment.
14069 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
14070 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
14071 Remove; unused.
14072
14073 * search.c (boyer_moore): Rename locals to avoid shadowing.
14074 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
14075 (PREV_CHAR_BOUNDARY): Likewise.
14076
14077 * search.c (simple_search): Remove unused var.
14078
14079 * dired.c (compile_pattern): Move decl from here ...
14080 * lisp.h: ... to here, so that it can be checked.
14081 (struct re_registers): New forward decl.
14082
14083 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
14084
14085 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
14086 All uses changed.
14087 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
14088 Rename locals to avoid shadowing.
14089 (Fvertical_motion): Mark locals as initialized.
14090
14091 * casefiddle.c (casify_object, casify_region): Now static.
14092 (casify_region): Mark local as initialized.
14093
14094 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
14095
14096 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
14097 New macros, so that the caller can use some names other than
14098 gcpro1, gcpro2, etc.
14099 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
14100 of the new macros.
14101 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
14102 argument, for consistency with GCPRO2_VAR, etc: it is now the
14103 prefix of the variable, not the variable itself. All uses
14104 changed.
14105 * dired.c (directory_files_internal, file_name_completion):
14106 Rename locals to avoid shadowing.
14107
14108 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
14109 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
14110 dired.c's scmp function, had undefined behavior.
14111 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
14112 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
14113 * buffer.h: ... to here, because these macros use current_buffer,
14114 and the new implementation with inline functions needs to have
14115 current_buffer in scope now, rather than later when the macros
14116 are used.
14117 (downcase, upcase1): New static inline functions.
14118 (DOWNCASE, UPCASE1): Reimplement using these functions.
14119 This avoids undefined behavior in expressions like
14120 DOWNCASE (x) == DOWNCASE (y), which previously suffered
14121 from race conditions in accessing the global variables
14122 case_temp1 and case_temp2.
14123 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
14124 * lisp.h (case_temp1, case_temp2): Remove their decls.
14125 * character.h (ASCII_CHAR_P): Move from here ...
14126 * lisp.h: ... to here, so that the inline functions mentioned
14127 above can use them.
14128
14129 * dired.c (directory_files_internal_unwind): Now static.
14130
14131 * fileio.c (file_name_as_directory, directory_file_name):
14132 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
14133 Now static.
14134 (file_name_as_directory): Use const pointers when appropriate.
14135 (Fexpand_file_name): Likewise. In particular, newdir might
14136 point at constant storage, so make it a const pointer.
14137 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
14138 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
14139 signedness issues.
14140 (Fset_file_times, Finsert_file_contents, auto_save_error):
14141 Rename locals to avoid shadowing.
14142
14143 * minibuf.c (choose_minibuf_frame_1): Now static.
14144 (Ftry_completion, Fall_completions): Rename or remove locals
14145 to avoid shadowing.
14146
14147 * marker.c (bytepos_to_charpos): Remove; unused.
14148
14149 * lisp.h (verify_bytepos, count_markers): New decls,
14150 so that gcc does not warn that these functions aren't declared.
14151
14152 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
14153 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
14154 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
14155 (copy_text): Remove unused local var.
14156
14157 * filelock.c (within_one_second): Now static.
14158 (lock_file_1): Rename local to avoid shadowing.
14159
14160 * buffer.c (fix_overlays_before): Mark locals as initialized.
14161 (fix_start_end_in_overlays): Likewise. This function should be
14162 simplified by using pointers-to-pointers, but that's a different
14163 matter.
14164 (switch_to_buffer_1): Now static.
14165 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
14166 (report_overlay_modification): Rename locals to avoid shadowing.
14167
14168 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
14169 Fix pointer signedness issue.
14170 (sys_subshell): Mark local as volatile if checking for lint,
14171 to suppress a gcc -Wclobbered warning that does not seem to be right.
14172 (MAXPATHLEN): Define only if needed.
14173
14174 * process.c (serial_open, serial_configure): Move decls from here ...
14175 * systty.h: ... to here, so that they can be checked.
14176
14177 * fns.c (get_random, seed_random): Move extern decls from here ...
14178 * lisp.h: ... to here, so that they can be checked.
14179
14180 * sysdep.c (reset_io): Now static.
14181 (wait_for_termination_signal): Remove; unused.
14182
14183 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
14184 (copy_keymap_item, append_key, push_text_char_description):
14185 Now static.
14186 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
14187 (DENSE_TABLE_SIZE): Remove; unused.
14188 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
14189 (describe_map_tree):
14190 Rename locals to avoid shadowing.
14191
14192 * keyboard.c: Declare functions static if they are not used elsewhere.
14193 (echo_char, echo_dash, cmd_error, top_level_2):
14194 (poll_for_input, handle_async_input): Now static.
14195 (read_char, kbd_buffer_get_event, make_lispy_position):
14196 (make_lispy_event, make_lispy_movement, apply_modifiers):
14197 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
14198 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
14199 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
14200 (read_key_sequence, read_char): Mark locals as initialized.
14201 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
14202
14203 * keyboard.h (make_ctrl_char): New decl.
14204 (mark_kboards): Move decl here ...
14205 * alloc.c (mark_kboards): ... from here.
14206
14207 * lisp.h (force_auto_save_soon): New decl.
14208
14209 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
14210 (DEFINE_DUMMY_FUNCTION): New macro.
14211 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
14212 Use it.
14213 (main): Add casts to avoid warnings
14214 if GCC considers string literals to be constants.
14215
14216 * lisp.h (fatal_error_signal): Add decl, since it's exported.
14217
14218 * dbusbind.c: Pointer signedness fixes.
14219 (xd_signature, xd_append_arg, xd_initialize):
14220 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14221 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14222 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
14223 (Fdbus_register_signal): Use SSDATA when the context wants char *.
14224
14225 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
14226 if GCC considers string literals to be constants.
14227 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
14228
14229 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
14230
14231 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
14232 (print_preprocess, print_object): New macro to fix last change.
14233
14234 * print.c (print_preprocess): Don't forget font objects.
14235
14236 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
14237
14238 * emacs.c (USAGE3): Doc fixes.
14239
14240 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
14241
14242 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
14243 structure.
14244
14245 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
14246
14247 * lisp.h (VWindow_system, Qfile_name_history):
14248 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
14249 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
14250 (w32_system_caret_x, w32_system_caret_y): Declare extern.
14251
14252 * w32select.c: Don't #include "keyboard.h".
14253 (run_protected): Add extern declaration for waiting_for_input.
14254
14255 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
14256 * w32console.c (detect_input_pending, read_input_pending)
14257 (encode_terminal_code):
14258 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
14259 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
14260 (w32_system_caret_y, Qfile_name_history):
14261 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
14262 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
14263 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
14264 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
14265 * w32proc.c (Qlocal, report_file_error):
14266 * w32term.c (Vwindow_system, updating_frame):
14267 * w32uniscribe.c (initialized, uniscribe_font_driver):
14268 Remove unneeded extern declarations.
14269
14270 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
14271
14272 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
14273
14274 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
14275
14276 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
14277 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
14278 These macros can no longer be used for assignment.
14279
14280 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
14281 Assign struct members directly, instead of using BUF_BEGV etc.
14282 (record_buffer_markers, fetch_buffer_markers): New functions for
14283 recording and fetching special buffer markers.
14284 (set_buffer_internal_1, set_buffer_temp): Use them.
14285
14286 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
14287
14288 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
14289
14290 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
14291 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
14292
14293 * xdisp.c (hscroll_window_tree):
14294 (reconsider_clip_changes): Use PT instead of BUF_PT.
14295
14296 2011-03-13 Eli Zaretskii <eliz@gnu.org>
14297
14298 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
14299 $(EMACS_ROOT)/lib/intprops.h.
14300
14301 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
14302
14303 Fix more problems found by GCC 4.5.2's static checks.
14304
14305 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
14306 to unsigned char * to avoid compiler diagnostic.
14307 (xg_free_frame_widgets): Make it clear that a local variable is
14308 needed only if USE_GTK_TOOLTIP.
14309 (gdk_window_get_screen): Make it clear that this macro is needed
14310 only if USE_GTK_TOOLTIP.
14311 (int_gtk_range_get_value): New function, which avoids a diagnostic
14312 from gcc -Wbad-function-cast.
14313 (xg_set_toolkit_scroll_bar_thumb): Use it.
14314 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
14315 diagnostic from gcc -Wbad-function-cast.
14316 (get_utf8_string, xg_get_file_with_chooser):
14317 Rename locals to avoid shadowing.
14318 (create_dialog): Move locals to avoid shadowing.
14319
14320 * xgselect.c (xg_select): Remove unused var.
14321
14322 * image.c (four_corners_best): Mark locals as initialized.
14323 (gif_load): Initialize transparent_p to zero (Bug#8238).
14324 Mark another local as initialized.
14325 (my_png_error, my_error_exit): Mark with NO_RETURN.
14326
14327 * image.c (clear_image_cache): Now static.
14328 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
14329 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
14330 (x_edge_detection): Remove unnecessary cast that
14331 gcc -Wbad-function-cast diagnoses.
14332 (gif_load): Fix pointer signedness.
14333 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
14334 (jpeg_load, gif_load): Rename locals to avoid shadowing.
14335
14336 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
14337
14338 Improve quality of tests for time stamp overflow.
14339 For example, without this patch (encode-time 0 0 0 1 1
14340 1152921504606846976) returns the obviously-bogus value (-948597
14341 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
14342 reports time overflow. See
14343 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
14344 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
14345 * editfns.c: Include limits.h and intprops.h.
14346 (TIME_T_MIN, TIME_T_MAX): New macros.
14347 (time_overflow): Move earlier, to before first use.
14348 (hi_time, lo_time): New functions, for an accurate test for
14349 out-of-range times.
14350 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
14351 (Fget_internal_run_time): Don't assume time_t fits in int.
14352 (make_time): Use list2 instead of Fcons twice.
14353 (Fdecode_time): More accurate test for out-of-range times.
14354 (check_tm_member): New function.
14355 (Fencode_time): Use it, to test for out-of-range times.
14356 (lisp_time_argument): Don't rely on undefined left-shift and
14357 right-shift behavior when checking for time stamp overflow.
14358
14359 * editfns.c (time_overflow): New function, refactoring common code.
14360 (Fformat_time_string, Fdecode_time, Fencode_time):
14361 (Fcurrent_time_string): Use it.
14362
14363 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
14364 * dired.c (make_time): Move to ...
14365 * editfns.c (make_time): ... here.
14366 * systime.h: Note the move.
14367
14368 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14369
14370 * fringe.c (update_window_fringes): Remove unused variables.
14371
14372 * unexmacosx.c (copy_data_segment): Also copy __got section.
14373 (Bug#8223)
14374
14375 2011-03-12 Eli Zaretskii <eliz@gnu.org>
14376
14377 * termcap.c [MSDOS]: Include "msdos.h".
14378 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
14379 Constify `char *' arguments and their references according to
14380 prototypes in tparam.h.
14381
14382 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
14383
14384 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
14385 Adapt all references accordingly.
14386
14387 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
14388
14389 2011-03-11 Tom Tromey <tromey@redhat.com>
14390
14391 * buffer.c (syms_of_buffer): Remove obsolete comment.
14392
14393 2011-03-11 Eli Zaretskii <eliz@gnu.org>
14394
14395 * termhooks.h (encode_terminal_code): Declare prototype.
14396
14397 * msdos.c (encode_terminal_code): Don't declare prototype.
14398
14399 * term.c (encode_terminal_code): Now external again, used by
14400 w32console.c and msdos.c.
14401
14402 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
14403 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
14404
14405 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
14406
14407 Fix some minor problems found by GCC 4.5.2's static checks.
14408
14409 * fringe.c (update_window_fringes): Mark locals as initialized
14410 (Bug#8227).
14411 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
14412
14413 * alloc.c (mark_fringe_data): Move decl from here ...
14414 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
14415 to check its interface.
14416 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
14417
14418 * fontset.c (free_realized_fontset): Now static.
14419 (Fset_fontset_font): Rename local to avoid shadowing.
14420 (fontset_font): Mark local as initialized.
14421 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
14422
14423 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
14424
14425 * xselect.c (x_disown_buffer_selections): Remove; not used.
14426 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
14427 (x_own_selection, Fx_disown_selection_internal): Rename locals
14428 to avoid shadowing.
14429 (x_handle_dnd_message): Remove local to avoid shadowing.
14430
14431 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
14432 so that the caller can use some name other than gcpro1.
14433 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
14434 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
14435 (Fx_backspace_delete_keys_p):
14436 Use them to avoid shadowing, and rename vars to avoid shadowing.
14437 (x_decode_color, x_set_name, x_window): Now static.
14438 (Fx_create_frame): Add braces to silence GCC warning.
14439 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
14440 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
14441 Remove unused locals.
14442 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
14443 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
14444 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
14445 macros.
14446
14447 * xterm.h (x_mouse_leave): New decl.
14448
14449 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
14450 Remove unused functions.
14451 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
14452 (x_calc_absolute_position): Now static.
14453 (XTread_socket): Don't define label "out" unless it's used.
14454 Don't declare local "event" unless it's used.
14455 (x_iconify_frame, x_free_frame_resources): Don't declare locals
14456 unless they are used.
14457 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
14458 (x_fatal_error_signal): Remove; not used.
14459 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
14460 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
14461 (x_error_catcher, x_connection_closed, x_error_handler):
14462 (x_error_quitter, xembed_send_message, x_iconify_frame):
14463 (my_log_handler): Rename locals to avoid shadowing.
14464 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
14465 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
14466
14467 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
14468 Rename or move locals to avoid shadowing.
14469 (tty_defined_color, merge_face_heights): Now static.
14470 (free_realized_faces_for_fontset): Remove; not used.
14471 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
14472 does not deduce is never used uninitialized.
14473 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
14474 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
14475
14476 * terminal.c (store_terminal_param): Now static.
14477
14478 * xmenu.c (menu_highlight_callback): Now static.
14479 (set_frame_menubar): Remove unused local.
14480 (xmenu_show): Rename parameter to avoid shadowing.
14481 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
14482 since they might point to immutable storage.
14483 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
14484 since it's unused otherwise.
14485
14486 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
14487 Add a FIXME, since the code still doesn't look right. (Bug#8215)
14488 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
14489 avoids a gcc -Wuninitialized diagnostic.
14490 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
14491 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
14492 does not deduce are never used uninitialized.
14493
14494 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
14495
14496 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
14497 * window.c (window_loop, size_window):
14498 (run_window_configuration_change_hook, enlarge_window): Likewise.
14499
14500 * window.c (display_buffer): Now static.
14501 (size_window): Mark variables that gcc -Wuninitialized
14502 does not deduce are never used uninitialized.
14503 * window.h (check_all_windows): New decl, to forestall
14504 gcc -Wmissing-prototypes diagnostic.
14505 * dispextern.h (bidi_dump_cached_states): Likewise.
14506
14507 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
14508 shadowing.
14509 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
14510 Include <limits.h>.
14511 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
14512 and to avoid gcc -Wuninitialized warning.
14513 (load_charset_map): Mark variables that gcc -Wuninitialized
14514 does not deduce are never used uninitialized.
14515 (load_charset): Abort instead of using uninitialized var (Bug#8229).
14516
14517 * coding.c (coding_set_source, coding_set_destination):
14518 Use "else { /* comment */ }" rather than "else /* comment */;"
14519 for clarity, and to avoid gcc -Wempty-body warning.
14520 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
14521 a block, when the outer 'i' will do.
14522 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
14523 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
14524 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
14525 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
14526 (Fdecode_sjis_char, Fdefine_coding_system_internal):
14527 Rename locals to avoid shadowing.
14528 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
14529 * coding.c (emacs_mule_char, encode_invocation_designation):
14530 Now static, since they're not used elsewhere.
14531 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
14532 (decode_coding_object, encode_coding_object, detect_coding_system):
14533 (decode_coding_emacs_mule): Mark variables that gcc
14534 -Wuninitialized does not deduce are never used uninitialized.
14535 (detect_coding_iso_2022): Initialize a local variable that might
14536 be used uninitialized. Leave a FIXME because it's not clear that
14537 this initialization is needed. (Bug#8211)
14538 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
14539 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
14540 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
14541 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
14542 Remove unused macros.
14543
14544 * category.c (hash_get_category_set): Remove unused local var.
14545 (copy_category_table): Now static, since it's not used elsewhere.
14546 * character.c (string_count_byte8): Likewise.
14547
14548 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
14549 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
14550
14551 * chartab.c (copy_sub_char_table): Now static, since it's not used
14552 elsewhere.
14553 (sub_char_table_ref_and_range, char_table_ref_and_range):
14554 Rename locals to avoid shadowing.
14555 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
14556
14557 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
14558 (BIDI_BOB): Remove unused macro.
14559
14560 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
14561 deduce are never used uninitialized.
14562 * term.c (encode_terminal_code): Likewise.
14563
14564 * term.c (encode_terminal_code): Now static. Remove unused local.
14565
14566 * tparam.h: New file.
14567 * term.c, tparam.h: Include it.
14568 * deps.mk (term.o, tparam.o): Depend on tparam.h.
14569 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
14570 Move these decls to tparam.h, and make them agree with what
14571 is actually in tparam.c. The previous trick of using incompatible
14572 decls in different modules does not conform to the C standard.
14573 All callers of tparam changed to use tparam's actual API.
14574 * tparam.c (tparam1, tparam, tgoto):
14575 Use const pointers where appropriate.
14576
14577 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
14578 * cm.h (struct cm): Likewise.
14579 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
14580 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
14581 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
14582 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
14583 (turn_on_face, init_tty): Likewise.
14584 * termchar.h (struct tty_display_info): Likewise.
14585
14586 * term.c (term_mouse_position): Rename local to avoid shadowing.
14587
14588 * alloc.c (mark_ttys): Move decl from here ...
14589 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
14590
14591 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
14592
14593 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
14594
14595 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
14596
14597 * search.c (compile_pattern_1): Remove argument regp, unused since
14598 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
14599 (compile_pattern): Don't pass it.
14600
14601 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
14602
14603 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
14604 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
14605 for ! HAVE_GTK3.
14606 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
14607
14608 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
14609
14610 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
14611 gdk_window_get_screen, gdk_window_get_geometry,
14612 gdk_x11_window_lookup_for_display and GDK_KEY_g.
14613 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
14614 (xg_get_pixbuf_from_pixmap): New function.
14615 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
14616 to Pixmap, take frame as parameter, remove GdkColormap parameter.
14617 Call xg_get_pixbuf_from_pixmap instead of
14618 gdk_pixbuf_get_from_drawable.
14619 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
14620 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
14621 (xg_check_special_colors): Use GtkStyleContext and its functions
14622 for HAVE_GTK3.
14623 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
14624 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
14625 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
14626 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
14627 Call gtk_widget_get_preferred_size.
14628 (xg_frame_resized): gdk_window_get_geometry only takes 5
14629 parameters.
14630 (xg_win_to_widget, xg_event_is_for_menubar):
14631 Call gdk_x11_window_lookup_for_display.
14632 (xg_set_widget_bg): New function.
14633 (delete_cb): New function.
14634 (xg_create_frame_widgets): Connect delete-event to delete_cb.
14635 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
14636 (xg_set_background_color): Call xg_set_widget_bg.
14637 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
14638 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
14639 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
14640 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
14641 if ! HAVE_GTK3.
14642 (update_frame_tool_bar): Call gtk_widget_hide.
14643 (xg_initialize): Use GDK_KEY_g.
14644
14645 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
14646 if ! HAVE_GTK3
14647 (x_session_initialize): Call gdk_x11_set_sm_client_id.
14648
14649 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
14650 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
14651 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
14652
14653 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
14654
14655 * w32xfns.c (select_palette): Check success of RealizePalette against
14656 GDI_ERROR, not zero.
14657
14658 See ChangeLog.11 for earlier changes.
14659
14660 ;; Local Variables:
14661 ;; coding: utf-8
14662 ;; End:
14663
14664 Copyright (C) 2011-2012 Free Software Foundation, Inc.
14665
14666 This file is part of GNU Emacs.
14667
14668 GNU Emacs is free software: you can redistribute it and/or modify
14669 it under the terms of the GNU General Public License as published by
14670 the Free Software Foundation, either version 3 of the License, or
14671 (at your option) any later version.
14672
14673 GNU Emacs is distributed in the hope that it will be useful,
14674 but WITHOUT ANY WARRANTY; without even the implied warranty of
14675 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14676 GNU General Public License for more details.
14677
14678 You should have received a copy of the GNU General Public License
14679 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.