1 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3 Separate read and write access to Lisp_Object slots of struct window.
4 * window.h (WGET, WSET): New macros similar to AREF and ASET.
5 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
6 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
8 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
9 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
12 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
14 Fix Windows build errors introduced after converting to FGET and FSET.
15 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
16 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
17 (w32_judge_scroll_bars): Change to use FSET.
18 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
20 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
23 * window.c (replace_window): Set root_window instead of
24 selected_window. This fixes a total window subsystem
25 malfunction reported by Bastien Guerry <bzg@gnu.org>.
27 2012-08-06 Glenn Morris <rgm@gnu.org>
29 * lisp.mk (lisp): Add language/persian.elc.
31 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
33 Separate read and write access to Lisp_Object slots of struct frame.
34 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
35 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
36 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
37 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
38 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
40 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
42 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
44 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
46 Generalize common compile-time constants.
47 * lisp.h (header_size, bool_header_size, word_size): Now here.
48 (struct Lisp_Vector): Add comment.
49 (struct Lisp_Bool_Vector): Move up to define handy constants.
50 (VECSIZE, PSEUDOVECSIZE): Simplify.
51 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
52 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
53 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
54 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
55 * xfont.c, xmenu.c: Use word_size where appropriate.
57 2012-08-05 Lawrence Mitchell <wence@gmx.li>
59 * search.c (Freplace_match): Treat \? in the replacement text
62 2012-08-05 Chong Yidong <cyd@gnu.org>
64 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
65 * frame.c (Vdelete_frame_functions):
66 * emacs.c (Vkill_emacs_hook): Doc fix.
68 2012-08-04 Eli Zaretskii <eliz@gnu.org>
70 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
71 --with-x-toolkit=no builds.
72 Reported by Carsten Mattner <carstenmattner@gmail.com>.
74 2012-08-04 Chong Yidong <cyd@gnu.org>
76 * syntax.c (Fmodify_syntax_entry): Doc fix.
78 2012-08-04 Eli Zaretskii <eliz@gnu.org>
80 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
81 * w32.c (init_environment): Change the default values of many
82 environment variables in dflt_envvars[] to NULL, to avoid pushing
83 them into environment when they were not already defined. Remove
84 the code that deletes site-lisp subdirectories from the default
85 value of EMACSLOADPATH, as it is no longer needed.
86 (check_windows_init_file): Now external, not static. Use
87 Vload_path as is, without adding anything, as this function is now
88 called when Vload_path is already set up.
90 * w32.h (check_windows_init_file): Add prototype.
92 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
93 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
94 compatibility with Posix platforms.
95 (main): Move the call to check_windows_init_file to here from
97 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
98 any, in the DEFALT argument into the root of the Emacs build or
99 installation tree, as appropriate.
101 * callproc.c (init_callproc_1): Call decode_env_path instead of
102 doing its equivalent by hand.
103 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
104 the code that sets Vexec_path run on MS-Windows.
106 * lread.c (init_lread): Add comments to #ifdef's.
108 * msdos.c (dos_set_window_size, IT_update_begin)
109 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
110 instead of direct references.
112 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
114 Export DEFAULT_REHASH_* to GDB.
115 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
116 Now constants, not macros.
118 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
120 Remove unnecessary casts involving pointers.
121 These casts are no longer needed now that we assume C89 or later,
122 since they involve casting to or from void *.
123 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
124 (make_pure_float, make_pure_vector):
125 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
126 * macros.c (Fstart_kbd_macro):
127 * menu.c (find_and_return_menu_selection):
128 * minibuf.c (read_minibuf_noninteractive):
129 * sysdep.c (closedir):
130 * xdisp.c (x_produce_glyphs):
131 * xfaces.c (compare_fonts_by_sort_order):
132 * xfns.c (x_real_positions, select_visual):
133 * xselect.c (x_stop_queuing_selection_requests)
134 (x_get_window_property, x_get_window_property_as_lisp_data):
135 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
136 Remove unnecessary pointer casts.
137 * alloc.c (record_xmalloc): New function.
138 * lisp.h (record_xmalloc): New decl.
139 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
140 more like a function. This is because the pointer cast is not
141 needed. All uses changed.
142 * print.c (print_string, print_error_message): Avoid length recalc.
144 Improve fix for macroexp crash with debugging (Bug#12118).
145 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
146 ARRAY_MARK_FLAG when checking subscripts, because ASET is
147 not supposed to be invoked from the garbage collector.
148 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
149 (gc_aset): New function, which is like ASET but can be
150 used in the garbage collector.
151 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
152 (set_hash_index): Use it instead of ASET.
154 2012-08-03 Eli Zaretskii <eliz@gnu.org>
156 Support symlinks on latest versions of MS-Windows.
157 * w32.c: Include winioctl.h and aclapi.h.
158 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
159 (revert_to_self): Forward declarations of static functions.
160 <static BOOL g_b_init_get_security_info>:
161 <g_b_init_create_symbolic_link>: New static flags.
162 (globals_of_w32): Initialize them to zero.
163 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
164 (map_w32_filename): Improve commentary. Simplify switch.
165 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
166 headers (most versions of MinGW w32api don't).
167 (get_security_info, create_symbolic_link)
168 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
170 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
171 in the argument file name.
172 (sys_access): Call unc_volume_file_attributes only if
173 GetFileAttributes fails with network-related error codes.
174 (sys_rename): Diagnose renaming of a symlink when the user doesn't
175 have the required privileges.
176 (get_file_security_desc_by_name): Renamed from
177 get_file_security_desc.
178 (stat_worker): New function, with most of the guts of 'stat', and
179 with addition of handling of symlinks and support for 'lstat'. If
180 possible, get file's attributes and security information by
181 handle, not by name. Produce S_IFLNK bit for symlinks, when
183 (stat, lstat): New functions, call 'stat_worker'.
184 (symlink, readlink, careadlinkat): Rewritten to create and resolve
185 symlinks when the underlying filesystem supports them.
187 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
189 Fix macroexp crash on Windows with debugging (Bug#12118).
190 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
191 checking subscripts; problem introduced with the recent
192 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
193 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
194 since it's used in non-static inline functions now.
196 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
197 Don't assume buffer size fits in 'int'. Remove unused local.
199 Use C99-style 'extern inline' if available.
200 * buffer.h (BUFFER_INLINE):
201 * category.h (CATEGORY_INLINE):
202 * character.h (CHARACTER_INLINE):
203 * charset.h (CHARSET_INLINE):
204 * composite.h (COMPOSITE_INLINE):
205 * dispextern.h (DISPEXTERN_INLINE):
206 * lisp.h (LISP_INLINE):
207 * systime.h (SYSTIME_INLINE):
208 New macro, replacing 'static inline' in this header.
209 * buffer.h, category.h, character.h, charset.h, composite.h:
210 * dispextern.h, lisp.h, systime.h:
211 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
212 * alloc.c (LISP_INLINE):
213 * buffer.c (BUFFER_INLINE):
214 * category.c (CATEGORY_INLINE):
215 * character.c (CHARACTER_INLINE):
216 * charset.c (CHARSET_INLINE):
217 * composite.c (COMPOSITE_INLINE):
218 * dispnew.c (DISPEXTERN_INLINE):
219 * sysdep.c (SYSTIME_INLINE):
220 Define to EXTERN_INLINE, so that the corresponding functions
221 are compiled into code.
222 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
223 (INLINE_HEADER_END): New macros.
224 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
225 since it's used in non-static inline functions now.
226 (VALMASK) [!USE_LSB_TAG]: Likewise.
228 2012-08-02 Glenn Morris <rgm@gnu.org>
230 * s/: Remove empty directory.
232 * s/ms-w32.h: Move to ../nt/inc.
233 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
234 Update for new ms-w32.h location.
236 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
239 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
241 2012-08-02 Glenn Morris <rgm@gnu.org>
243 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
244 hard-coding the path separator.
246 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
248 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
249 This how ASET and AREF are supposed to work, and makes
250 it easier to think about future improvements. See
251 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
252 * charset.h (set_charset_attr): New function.
253 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
254 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
255 (aref_addr): New function. All uses of &AREF(...) changed.
256 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
257 (set_hash_index): New functions. All lvalue-style uses of
258 HASH_KEY etc. changed.
259 * keyboard.c (set_prop): New function. All lvalue-style uses
262 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
264 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
265 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
266 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
267 * nsfns.m (ns_set_name_as_filename): Likewise.
268 * nsmenu.m (ns_update_menubar): Likewise.
269 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
271 2012-08-01 Eli Zaretskii <eliz@gnu.org>
273 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
274 Adapt to latest changes in field names of the corresponding Lisp
277 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
279 2012-08-01 Glenn Morris <rgm@gnu.org>
281 * s/msdos.h: Remove file.
282 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
283 * Makefile.in (S_FILE): Remove.
284 (config_h): Remove S_FILE.
286 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
288 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
289 Remove; moved to nt/config.nt.
291 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
293 Use INTERNAL_FIELD for conses and overlays.
294 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
295 Remove obsolete comment.
297 (struct Lisp_Overlay): Use INTERNAL_FIELD.
298 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
300 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
302 Use INTERNAL_FIELD for symbols.
303 * lisp.h (SVAR): New macro. Adjust users.
304 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
305 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
307 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
309 Use INTERNAL_FIELD for processes.
310 * process.h (PVAR): New macro. Adjust style.
311 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
312 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
314 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
316 Use INTERNAL_FIELD for windows.
317 * window.h (WVAR): New macro.
318 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
319 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
320 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
321 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
322 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
323 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
325 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
327 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
329 2012-08-01 Glenn Morris <rgm@gnu.org>
331 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
332 Move to configure.ac.
334 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
336 * makefile.w32-in (CONFIG_H): Update dependencies.
337 (CONF_POST_H): New macro.
339 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
341 2012-07-31 Glenn Morris <rgm@gnu.org>
343 * Makefile.in (S_FILE): No longer set by configure.
345 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
347 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
349 * process.h (NULL_DEVICE):
351 * editfns.c (USER_FULL_NAME): Let configure set them.
353 * s/README, s/template.h: Remove files.
355 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
357 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
358 Move to configure.ac.
360 2012-07-31 Eli Zaretskii <eliz@gnu.org>
362 * .gdbinit (xframe): Adapt to introduction of FVAR and the
363 resulting renaming of 'struct frame' members.
365 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
367 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
368 after introduction of FVAR.
370 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
372 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
374 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
375 instead of compositeToPoint.
376 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
378 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
380 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
382 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
383 * lisp.h (INTERNAL_FIELD): New macro.
384 * buffer.h (BUFFER_INTERNAL_FIELD): Removed.
385 (BVAR): Change to use INTERNAL_FIELD.
386 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
387 (KVAR): Change to use INTERNAL_FIELD.
388 * frame.h (FVAR): New macro.
389 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
390 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
391 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
392 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
393 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
395 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
397 Miscellaneous fixes for non-default X toolkits.
398 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
399 * xterm.c (x_frame_of_widget): Remove redundant prototype.
400 Move under #ifdef USE_LUCID.
401 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
402 definition and usage to avoid warnings.
404 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
406 * nsterm.m (openFiles): Fix previous checkin.
408 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
410 * indent.c (compute_motion): Remove unused local.
412 2012-07-31 Glenn Morris <rgm@gnu.org>
414 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
416 * conf_post.h [USG5_4]:
417 Move remaining contents of s/usg5-4-common.h here.
418 * s/usg5-4-common.h: Remove file.
420 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
421 * s/irix6-5.h: Remove file.
423 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
424 * s/darwin.h: Remove file.
426 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
427 * s/hpux10-20.h: Remove file, which is now empty.
429 2012-07-30 Glenn Morris <rgm@gnu.org>
431 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
432 * Makefile.in (config_h): Add conf_post.h.
433 * makefile.w32-in (CONFIG_H): Add conf_post.h.
435 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
437 * nsterm.m (ns_do_open_file): New variable.
438 (ns_term_init): Set ns_do_open_file to YES after run returns.
439 (openFile, openTempFile, openFileWithoutUI, openFiles): Open
440 files only if ns_do_open_file.
442 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
444 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
445 This no-op macro hasn't been needed for many years.
446 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
448 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
449 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
450 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
451 gdb_make_enums_visible.
452 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
453 (DIRECTORY_SEP): Now a constant, not a macro.
455 2012-07-30 Eli Zaretskii <eliz@gnu.org>
457 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
458 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
460 * w32term.c <w32_keyboard_codepage>: Renamed from
461 keyboard_codepage and now external. All users changed.
463 * w32term.h: Add declaration of w32_keyboard_codepage.
465 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
466 the codepage to translate keys to Unicode. If this argument is
467 -1, use the value returned by GetConsoleCP. All callers changed.
469 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
471 Update .PHONY listings in makefiles.
472 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
473 bootstrap-clean, distclean, maintainer-clean, versioclean,
476 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
477 This is a bit clearer. Fix some commentary typos.
479 2012-07-30 Glenn Morris <rgm@gnu.org>
481 * s/netbsd.h: Let configure include signal.h if needed.
482 Remove file, which is now empty.
484 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
485 Let configure set them.
486 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
487 No more need to undefine.
489 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
491 * keymap.c (Fkey_description): Don't remove 0x80 bit from
492 non-single-byte char when adding meta modifier. (Bug#12090)
494 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
496 Convert safe_call to use variable number of arguments.
497 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
498 (safe_call2): Fix comment.
499 * lisp.h (safe_call): Adjust prototype.
500 * coding.c (encode_coding_object): Change to use safe_call2.
501 * xfaces.c (merge_face_heights): Change to use safe_call1.
503 2012-07-30 Glenn Morris <rgm@gnu.org>
505 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
506 does that unconditionally. Remove file, which is now empty.
508 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
511 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
513 Export to GDB most of lisp.h's remaining object-like macros.
514 * lisp.h (min, max): Move earlier, because they're used earlier now.
515 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
516 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
517 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
518 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
519 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
520 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
521 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
522 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
523 Now constants, for GDB. They need not be macros.
524 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
525 Now constants, for GDB, as well as macros, for static initializers.
526 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
527 Move to after the definition of struct Lisp_Char_Table,
528 since the former now needs that type defined.
529 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
530 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
531 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
532 New enums, for gdb_make_enums_visible.
533 (GLYPH_MODE_LINE_FACE): Remove; unused.
534 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
535 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
536 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
537 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
538 enum maxargs, enum MAX_ALLOCA.
539 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
540 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
541 no longer needed, now that they are done in lisp.h.
543 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
545 Cleanup string bytes checking.
546 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
547 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
548 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
549 (check_sblock, compact_small_strings): Simplify.
551 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
553 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
554 These macros are confusing and no longer need to be defined, as
555 the enum values now suffice. All uses replaced with definiens.
556 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
558 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
560 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
561 ($(BLD)/w32console.$(O)): Update dependencies.
563 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
565 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
566 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
568 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
570 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
572 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
573 setting sitelisp (Bug#12010).
575 2012-07-29 Eli Zaretskii <eliz@gnu.org>
577 * w32heap.h (OS_9X): Renamed from OS_WINDOWS_95.
579 * w32heap.c (cache_system_info):
580 * w32.c (sys_rename):
581 * w32proc.c (find_child_console, sys_kill): All users changed.
583 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
585 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
587 2012-07-29 Eli Zaretskii <eliz@gnu.org>
589 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
591 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
593 Cleanup statistics calculation in Fgarbage_collect.
594 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start. Fix
595 zombies percentage calculation. Simplify elapsed time calculation.
597 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
599 Generalize marker debugging code under MARKER_DEBUG and use eassert.
600 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
601 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
602 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
603 (replace_range, replace_range_2, del_range_2): Change to eassert.
604 * marker.c (byte_char_debug_check): Adjust style.
606 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
608 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
609 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
610 long-ago-commented-out code that talks about "WIN32".
611 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
614 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
616 Use Gnulib stdalign module (Bug#9772, Bug#9960).
617 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
618 Simplify by using alignof.
619 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
620 * lisp.h: Include <stdalign.h>.
621 (GCALIGNMENT): New macro and constant.
622 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
623 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
624 (stdalign): New macro, if not already defined.
626 2012-07-28 Eli Zaretskii <eliz@gnu.org>
628 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
629 * w32inevt.c: Include w32inevt.h.
630 (w32_read_console_input): New inline function, calls either
631 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
632 w32_console_unicode_input.
633 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
634 (w32_kbd_patch_key, key_event): Use the codepage returned by
635 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
636 (key_event): use uChar.UnicodeChar only if
637 w32_console_unicode_input is non-zero.
639 * w32console.c: Include w32heap.h.
640 <w32_console_unicode_input>: New global variable.
641 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
642 family of Windows, zero otherwise.
644 * w32inevt.h: Declare w32_console_unicode_input.
646 * xdisp.c (init_iterator): Don't reference tip_frame in a build
647 --without-x. (Bug#11742)
649 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
651 Adjust GDB to reflect pvec_type changes (Bug#12036).
652 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
653 2012-07-04 changes to pseudovector representation. Problem
654 reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
656 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
658 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
660 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
662 2012-07-27 Eli Zaretskii <eliz@gnu.org>
664 * alloc.c (listn): Fix the order the arguments are consed onto the
667 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
668 enumeration constants, as PURE and HEAP are too general, and clash
669 with other headers and sources, such as gmalloc.c and the
670 MS-Windows system headers. All users changed.
672 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
674 Revert last save_excursion_save and save_excursion_restore changes.
675 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
676 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
678 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
680 Fix recently-introduced typos in Windows port.
681 Reported by Martin Rudalics <rudalics@gmx.at>.
682 * w32.c (init_environment): Replace comma with semicolon.
683 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
685 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
687 Improve GDB symbol export (Bug#12036).
688 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
689 arms of an 'if', not using conditional expressions; otherwise GDB
690 complains about the types in the unevaluated arm when the argument
691 is an integer literal.
692 (xgetint): Simplify expression.
693 * alloc.c (gdb_make_enums_visible): New constant. This ports to
694 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
695 Zaretskii in <http://bugs.gnu.org/12036#13>.
696 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
697 needed now that we have gdb_make_enums_visible.
698 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
699 (enum enum_USE_LSB_TAG):
700 New enum types, packaging up enums that need to be exported to GDB.
702 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
704 Utility function to make a list from specified amount of objects.
705 * lisp.h (enum constype): New datatype.
706 (listn): New prototype.
707 * alloc.c (listn): New function.
708 (Fmemory_use_count, syms_of_alloc): Use it.
709 * buffer.c (syms_of_buffer): Likewise.
710 * callint.c (syms_of_callint): Likewise.
711 * charset.c (define_charset_internal): Likewise.
712 * coding.c (syms_of_coding): Likewise.
713 * keymap.c (syms_of_keymap): Likewise.
714 * search.c (syms_of_search): Likewise.
715 * syntax.c (syms_of_syntax): Likewise.
716 * w32.c (init_environment): Likewise.
717 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
718 * xdisp.c (syms_of_xdisp): Likewise.
719 * xfns.c (syms_of_xfns): Likewise.
721 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
723 Fast save_excursion_save and save_excursion_restore.
724 * lisp.h (struct Lisp_Excursion): New data type.
725 (PVEC_EXCURSION): New pseudovector type.
726 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
727 to deal with it. Adjust comments.
728 (init_marker, attach_marker): New prototype.
729 (unchain_marker): Adjust prototype.
730 * marker.c (attach_marker): Change to global.
731 (init_marker): New function.
732 * alloc.c (Fmake_marker, build_marker): Use it.
733 (build_marker): More easserts.
734 (mark_object): Handle struct Lisp_Excursion.
735 * editfns.c (save_excursion_save, save_excursion_restore):
736 Reimplement to use struct Lisp_Excursion. Add comments.
738 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
740 Fix export of symbols to GDB (Bug#12036).
741 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
742 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
743 emacs.c, as this is a more-suitable home. Had this been done earlier
744 the fix for 12036 would have avoided some of the problems noted in
745 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
746 would have been more obvious.
747 * emacs.c: Do not include <verify.h>; no longer needed.
748 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
749 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
750 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
751 Remove; now done in lisp.h.
752 * lisp.h (PUBLISH_TO_GDB): New macro.
753 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
754 (DATA_SEG_BITS): Use it.
755 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
756 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
757 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
758 not be usable in #if. This simplifies things.
760 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
762 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
764 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
766 Simplify export of symbols to GDB (Bug#12036).
767 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
768 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
769 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
770 Adjust to changes in lisp.h and emacs.c, by using
771 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
772 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
773 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
774 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
775 instead of gdb_valbits.
776 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
777 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
778 instead of gdb_array_mark_flag.
779 (xboolvector): Get size from $->size, not $->header.size.
780 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
781 (xreload, hook-run, hookpost-run): Remove.
782 * emacs.c: Include <verify.h>.
783 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
784 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
786 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
787 (gdb_USE_LSB_TAG): New enum constants.
788 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
789 Also define these as enum constants, so they're visible to GDB.
790 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
791 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
792 as constants, so they're visible to GDB.
793 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
794 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
795 Now enum constants, not macros, so they're visible to GDB.
796 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
797 more convenient now. All uses changed.
798 (VALMASK) [USE_LSB_TAG]: Also define in this case.
799 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
801 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
803 Explicitly free restriction data that are not needed anymore.
804 * editfns.c (save_restriction_restore): Free restriction data.
806 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
808 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
809 add argument, tune behavior, and adjust all callers.
811 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
813 Use typedef for EMACS_INT, EMACS_UINT.
814 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
815 than macros. This simplifies debugging in the usual case, since
816 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
817 and it allows expressions involving EMACS_INT casts.
818 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
820 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
822 * nsterm.m (ns_read_socket): Return early if there is a modal
825 2012-07-25 Martin Rudalics <rudalics@gmx.at>
827 * frame.c (Fredirect_frame_focus): In doc-string don't mention
828 that FOCUS-FRAME can be omitted.
830 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
832 Adjust buffer text indirection counters at the end of Fkill_buffer.
833 * buffer.c (Fkill_buffer): Adjust indirection counters when the
834 buffer is definitely dead. This should really fix an issue reported
835 by Christoph Scholtes again. (Bug#12007).
836 (init_buffer_once): Initialize indirection counters of
837 buffer_defaults and buffer_local_symbols (for sanity and safety).
839 2012-07-24 Eli Zaretskii <eliz@gnu.org>
841 * xdisp.c (init_iterator): Don't compute dimensions of truncation
842 and continuation glyphs on tooltip frames, leave them at zero.
843 Avoids continued lines in tooltips. (Bug#11832)
845 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
847 Simplify copy_overlay.
848 * buffer.c (copy_overlay): Simplify. Use build_marker.
849 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
851 2012-07-23 Eli Zaretskii <eliz@gnu.org>
853 * print.c (print_object): Don't crash when a frame's name is nil
854 or invalid. (Bug#12025)
856 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
857 it signals an error when a tooltip frame is being created.
859 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
861 Cleanup miscellaneous objects allocation and initialization.
862 * alloc.c (allocate_misc): Change to static. Add argument to
863 specify the subtype. Adjust comment and users.
864 (build_overlay): New function.
865 * buffer.c (copy_overlays, Fmake_overlay): Use it.
866 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
867 (allocate_misc): Remove prototype.
868 (build_overlay): Add prototype.
870 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
872 Swap buffer text indirection counters in Fbuffer_swap_text.
873 * buffer.c (Fbuffer_swap_text): Swap indirections too.
874 This avoids crash reported by Christoph Scholtes at
875 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
877 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
879 * nsmenu.m (Popdown_data): New struct.
880 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
882 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
883 (initWithContentRect): Make imgView and contentView non-static
884 and autorelease them. Also autorelease img and matrix (Bug#12005).
885 (dealloc): Remove (Bug#12005).
887 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
889 Adjust consing_since_gc when objects are explicitly freed.
890 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
891 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
892 (free_cons, free_misc): Subtract object size from consing_since_gc.
894 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
896 Simplify and cleanup markers positioning code.
897 * marker.c (attach_marker): More useful eassert.
898 (live_buffer, set_marker_internal): New function.
899 (Fset_marker, set_marker_restricted): Use set_marker_internal.
900 (set_marker_both, set_marker_restricted_both): Use live_buffer.
902 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
904 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
905 as it's limited by the amount of memory, not by INT_MAX.
907 2012-07-21 Eli Zaretskii <eliz@gnu.org>
909 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
910 in special-event-map. See the discussion at
911 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
914 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
915 info.dwItemData. Fixes crashes on 64-bit Windows. Suggested by
916 Fabrice Popineau <fabrice.popineau@supelec.fr>.
918 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
920 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
921 (conversationIdentifier): Return value is NSInteger.
922 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
924 2012-07-21 Chong Yidong <cyd@gnu.org>
926 * window.c (decode_any_window): Signal an error if the window is
927 on a dead frame (Bug#11984).
929 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
931 Add indirection counting to speed up Fkill_buffer.
932 * buffer.h (struct buffer): New member.
933 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
934 (Fmake_indirect_buffer): Set indirection counter to -1, increment
935 base buffer indirection counter.
936 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
937 (Fkill_buffer): Adjust indirection counters as needed, don't walk
938 through buffer list if indirection counter is 0.
940 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
942 Extend the value returned by Fgarbage_collect with heap statistics.
943 * alloc.c (Qheap): New symbol.
944 (syms_of_alloc): DEFSYM it.
945 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
946 (Fmemory_free): Remove.
947 (syms_of_alloc): Don't defsubr it.
948 * buffer.c (Fcompact_buffer): Remove.
949 (syms_of_buffer): Don't defsubr it.
951 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
953 Make maybe_gc inline.
954 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
955 * lisp.h (consing_since_gc, gc_relative_threshold)
956 (memory_full_cons_threshold): Revert declaration.
957 (maybe_gc): Remove prototype, define as inline.
958 * alloc.c: Remove old commented-out code.
959 (consing_since_gc, gc_relative_threshold)
960 (memory_full_cons_threshold): Revert to global.
963 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
965 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
966 * lisp.h (build_unibyte_string): New function.
967 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
968 * sysdep.c, w32fns.c, xfns.c: Use it.
969 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
970 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
971 Adjust users accordingly.
972 * font.h (font_open_by_name): Adjust prototype.
974 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
976 Cleanup calls to Fgarbage_collect.
977 * lisp.h (maybe_gc): New prototype.
978 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
980 * alloc.c (maybe_gc): New function.
981 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
983 * bytecode.c (MAYBE_GC): Use maybe_gc.
984 * eval.c (eval_sub, Ffuncall): Likewise.
985 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
986 to avoid dependency from auto-save feature.
988 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
990 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
991 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
992 'for_each_per_buffer_object_at'.
993 All uses changed. It's better to use upper-case for macros that
994 cannot be implemented as functions, to give the reader a clue
995 that they're special.
997 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
999 * alloc.c (Fgarbage_collect): Tweak docstring.
1001 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
1003 Tweak the value returned from Fgarbage_collect again.
1004 * alloc.c (Fgarbage_collect): New return value, as confirmed in
1005 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
1006 Adjust documentation.
1007 (total_vector_bytes): Rename to total_vector_slots, adjust
1009 (total_free_vector_bytes): Rename to total_free_vector_slots,
1011 (Qstring_bytes, Qvector_slots): New symbols.
1012 (syms_of_alloc): DEFSYM them.
1014 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
1016 Buffer compaction primitive which may be used from Lisp.
1017 * buffer.c (compact_buffer, Fcompact_buffer): New function.
1018 (syms_of_buffer): Register Fcompact_buffer.
1019 * alloc.c (Fgarbage_collect): Use compact_buffer.
1020 * buffer.h (compact_buffer): New prototype.
1021 (struct buffer_text): New member.
1023 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
1025 New macro to iterate over all buffers, miscellaneous cleanups.
1026 * lisp.h (all_buffers): Remove declaration.
1027 * buffer.h (all_buffers): Add declaration, with comment.
1028 (for_each_buffer): New macro.
1029 * alloc.c (Fgarbage_collect, mark_object): Use it.
1030 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
1031 (init_buffer): Likewise.
1032 * data.c (Fset_default): Likewise.
1033 * coding.c (code_conversion_restore): Remove redundant check
1035 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
1037 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
1039 Fix bug that created negative-length intervals.
1040 * intervals.c (merge_interval_right, merge_interval_left):
1041 Do not zero out this interval if it is absorbed by its children,
1042 as this interval's total length doesn't change in that case. See
1043 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
1045 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
1047 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
1048 when invoking (make-bool-vector N t) and N is a positive
1049 multiple of 8 -- the last 8 bits were mistakenly cleared.
1051 Remove some struct layout assumptions in bool vectors.
1052 * alloc.c (bool_header_size): New constant.
1053 (header_size, word_size): Move earlier, as they're now used earlier.
1054 Use 'word_size' in a few more places, where it's appropriate.
1055 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
1056 padding before the data member of a bool vector.
1057 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
1058 than doing the check by hand with an abort ().
1060 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
1062 * eval.c (Fdefvar): Don't check constants since we only set the var if
1063 it's not yet defined anyway (bug#11904).
1065 * lisp.h (last_undo_boundary): Declare new var.
1066 * keyboard.c (command_loop_1): Set it.
1067 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
1068 were auto-added by the command loop (bug#11774).
1070 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
1072 * w32font.c (Qsymbol): Remove local definition.
1073 (syms_of_w32font): Don't DEFSYM it.
1075 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
1077 Fix sweep_vectors to handle large bool vectors correctly.
1078 * alloc.c (sweep_vectors): Account total_vector_bytes for
1079 bool vectors larger than VBLOCK_BYTES_MAX.
1081 2012-07-18 Chong Yidong <cyd@gnu.org>
1083 * frame.c (x_set_frame_parameters): Revert bogus change introduced
1084 in 2012-05-25 commit by Paul Eggert (Bug#11738).
1086 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
1088 Return more descriptive data from Fgarbage_collect.
1089 Suggested by Stefan Monnier in
1090 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
1091 * alloc.c (bounded_number): New function.
1092 (total_buffers, total_vectors): New variable.
1093 (total_string_size): Rename to total_string_bytes, adjust users.
1094 (total_vector_size): Rename to total_vector_bytes, adjust users.
1095 (sweep_vectors): Account total_vectors and total_vector_bytes.
1096 (Fgarbage_collect): New return value. Adjust documentation.
1097 (gc_sweep): Account total_buffers.
1098 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
1099 (VECTOR_SIZE): Remove.
1100 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
1101 (Qinterval, Qmisc): New symbols.
1102 (syms_of_data): Initialize them.
1103 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
1104 (Qcons, Qbuffer): New declarations.
1106 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
1108 * alloc.c (Fmemory_free): Account for memory-free's own storage.
1109 Round up, not down. Improve doc.
1111 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
1113 Restore old code in allocate_string_data to avoid Faset breakage.
1114 Reported by Julien Danjou <julien@danjou.info> in
1115 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
1116 * alloc.c (allocate_string_data): Restore old code with minor
1117 adjustments, fix comment to explain this subtle issue.
1119 2012-07-17 Eli Zaretskii <eliz@gnu.org>
1121 Remove FILE_SYSTEM_CASE.
1122 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
1124 * fileio.c (FILE_SYSTEM_CASE): Don't define.
1125 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
1126 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
1127 call-process-region passes it through expand-file-name.
1129 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
1131 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
1133 Fix crash when creating indirect buffer (Bug#11917)
1134 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
1135 Don't handle unbound variables specially if non-zero.
1136 (Fbuffer_local_variables): Pass zero.
1137 (clone_per_buffer_values): Pass non-zero.
1139 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
1141 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
1142 to make the loop interruptible.
1144 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
1146 * gnutls.c (emacs_gnutls_handshake): Only retry if
1147 GNUTLS_E_INTERRUPTED.
1149 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
1151 Cleanup and convert miscellaneous checks to eassert.
1152 * alloc.c (mark_interval): Fix comment, partially rephrase
1153 old comment from intervals.h (see below).
1154 * intervals.c (find_interval, adjust_intervals_for_insertion)
1155 (delete_interval, adjust_intervals_for_deletion)
1156 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
1158 (adjust_intervals_for_insertion, make_new_interval):
1159 Remove obsolete and unused code.
1160 * intervals.h (struct interval): Remove obsolete comment.
1161 * textprotp.c (erase_properties): Remove unused code.
1162 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
1163 (Fremove_list_of_text_properties): Convert to eassert.
1165 2012-07-17 Chong Yidong <cyd@gnu.org>
1167 * editfns.c (Finsert_char): Doc fix.
1169 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
1171 Fix previous change to make Fmemory_free always accurate.
1172 * alloc.c (make_interval): Update total_free_intervals.
1173 (make_float): Likewise for total_free_floats.
1174 (free_cons, Fcons): Likewise for total_free_conses.
1175 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
1176 Likewise for total_free_vector_bytes.
1177 (Fmake_symbol): Likewise for total_free_symbols.
1178 (bytes_free): Remove.
1180 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
1182 Simple free memory accounting feature.
1183 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
1184 (sweep_vectors): Accumulate size of free vectors.
1185 (Fgarbage_collect): Setup bytes_free.
1186 (Fmemory_free): New function.
1187 (syms_of_alloc): Register it.
1189 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
1191 Cleanup overlays checking.
1192 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
1193 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
1194 eassert and OVERLAYP.
1195 (sort_overlays): Change to use OVERLAYP.
1197 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
1199 * editfns.c (Finsert_char): Make it interactive, and make the
1200 second arg optional. Copy interactive spec and docstring from
1203 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
1205 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
1206 Unlike the other wrapped functions, fabs has an unspecified
1209 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
1211 * nsterm.m (keyDown): Interpret flags without left/right bits
1212 as the left key (Bug#11670).
1214 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
1216 Remove empty and useless init functions.
1217 * lisp.h (init_character_once, init_fns, init_image)
1218 (init_filelock, init_sound): Remove prototype.
1219 * character.c (init_character_once): Remove.
1220 * filelock.c (init_filelock): Likewise.
1221 * fns.c (init_fns): Likewise.
1222 * image.c (init_image): Likewise.
1223 * sound.c (init_sound): Likewise.
1224 * emacs.c (main): Adjust accordingly.
1226 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
1228 * gtkutil.h: Tiny cleanups.
1229 (use_old_gtk_file_dialog): Remove useless declaration.
1230 (xg_uses_old_file_dialog): Add suggested const attribute.
1232 2012-07-15 Eli Zaretskii <eliz@gnu.org>
1234 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
1235 (bidi_paragraph_init): Use it to limit search forward for a strong
1236 directional character in abnormally large paragraphs full of
1237 neutral or weak characters. (Bug#11943)
1239 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
1241 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
1242 the toolbar (Bug#9451).
1243 (xg_make_tool_item): Give the widget event box a transparent
1246 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
1248 Cleanup basic allocation variables and functions.
1249 * alloc.c (ignore_warnings, init_intervals, init_float)
1250 (init_cons, init_symbol, init_marker): Remove.
1251 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
1252 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
1253 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
1254 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
1255 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
1256 (staticidx, init_alloc_once, init_strings, free_ablock):
1257 Remove redundant initialization.
1258 * fns.c (init_weak_hash_tables): Remove.
1259 * lisp.h (init_weak_hash_tables): Remove prototype.
1261 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
1263 Use zero_vector where appropriate.
1264 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
1266 * lisp.h (zero_vector): New declaration.
1267 * font.c (null_vector): Remove.
1268 (syms_of_font): Remove initialization and staticpro.
1269 (font_list_entities, font_find_for_lface): Change to use zero_vector.
1270 * keymap.c (Faccessible_keymaps): Likewise.
1272 2012-07-15 Leo Liu <sdl.web@gmail.com>
1274 * fringe.c: Fix typo in comments.
1276 2012-07-14 Leo Liu <sdl.web@gmail.com>
1278 * fringe.c: Add a new bitmap exclamation-mark.
1280 2012-07-14 Eli Zaretskii <eliz@gnu.org>
1282 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
1284 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
1285 (HAVE_MENUS): Don't define, defined by editing config.in with
1287 (GMALLOC_INHIBIT_VALLOC): Don't define.
1288 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
1290 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
1292 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
1294 2012-07-14 Glenn Morris <rgm@gnu.org>
1296 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
1297 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
1298 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
1300 2012-07-13 Glenn Morris <rgm@gnu.org>
1302 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
1304 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
1305 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
1307 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
1309 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
1310 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
1311 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
1312 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
1314 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
1315 as boolean expression.
1316 (x_set_window_size): Remove unused variable toolbar.
1317 (ns_get_color_default, ns_mod_to_lisp): Remove.
1318 (ns_mouse_position): Remove unused variables xchar and ychar.
1319 (ns_compute_glyph_string_overhangs): Remove unused variable face.
1320 (ns_set_vertical_scroll_bar): Remove unused variable count.
1321 (ns_delete_terminal): Remove unused variable i.
1322 (ns_term_init): Remove unused variables r, g and b.
1323 (mouseDown): Remove unused variable window.
1324 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
1325 (initFrameFromEmacs): Remove unused variable vbextra.
1326 (mouseEntered): Remove unused variables p and dpyinfo.
1327 (mouseExited): Remove unused variables p and r.
1328 (ns_define_frame_cursor, ns_clear_frame_area)
1329 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
1330 (menuDown): Assign [sender tag] to variable and cast the variable.
1332 * nsterm.h (menuDown): Add id as type to argument sender.
1333 (ns_display_info_for_name): Add Lisp_Object argument.
1334 (ns_term_init): Add Lisp_Object argument.
1335 (ns_map_event_to_object): Add void argument.
1336 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
1337 prototype with arguments and only declare if __OBJC__.
1338 (nxatoms_of_nsselect): Add void argument.
1339 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
1340 (ns_alloc_autorelease_pool): Add void argument.
1341 (ns_release_autorelease_pool): Add void* argument.
1342 (ns_get_defaults_value): Add const char* argument.
1344 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
1345 (initFromContents): Use SSDATA where appropriate.
1346 (ns_update_menubar): Add braces to ambigous if-else.
1347 (initWithTitle): Put () around assignment in if statement.
1348 (ns_menu_show): Remove unused variables window and keymap.
1349 (update_frame_tool_bar): Remove unused variable selected_p.
1350 (initWithContentRect): Remove unused variable this_cmd_name.
1352 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
1354 (setXBMColor): Remove unused variable len.
1355 (setPixmapData): Put () around assignment in loop statement.
1357 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
1358 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
1360 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
1361 around assignment in loop statement.
1362 (nsfont_open): Remove unused variable i.
1363 (nsfont_open): Remove unused variable len.
1364 (nsfont_draw): Remove unused variable cs.
1366 * nsfns.m (x_set_icon_name, ns_set_name_internal)
1367 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
1368 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
1369 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
1370 (Fns_font_name, Fns_perform_service)
1371 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
1372 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
1373 (ns_set_name): Remove unused variable view.
1374 (x_set_menu_bar_lines): Remove unused variable olines.
1375 (x_set_tool_bar_lines): Remove unused variable root_window.
1376 (Fns_list_colors): Put () around assignment in while statement.
1377 (Fns_perform_service): Remove unused variable len.
1378 (Fns_display_usable_bounds): Remove unused variable top.
1379 (syms_of_nsfns): Remove unused variable i.
1381 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
1384 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
1386 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
1387 and free it with DestroyExceptionInfo (Bug#11558).
1389 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
1391 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
1392 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
1393 Set here, not in nt/config.nt.
1395 2012-07-13 Eli Zaretskii <eliz@gnu.org>
1397 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
1398 cursor overflow into the last glyph on display line when the right
1399 fringe is off. (Bug#11832)
1401 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
1403 * xdisp.c (produce_special_glyphs): Now static.
1404 * dispextern.h (produce_special_glyphs): Remove decl.
1406 2012-07-13 Glenn Morris <rgm@gnu.org>
1408 * s/bsd-common.h, s/cygwin.h: Remove empty files.
1409 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
1411 * s/usg5-4-common.h (USG, USG5):
1412 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
1413 * s/sol2-6.h (SOLARIS2):
1414 * s/irix6-5.h (IRIX6_5):
1415 * s/hpux10-20.h (USG, USG5, HPUX):
1416 * s/gnu-linux.h (USG, GNU_LINUX):
1417 * s/freebsd.h (BSD_SYSTEM):
1418 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
1419 * s/cygwin.h (CYGWIN):
1420 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
1421 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
1423 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
1425 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
1427 2012-07-13 Glenn Morris <rgm@gnu.org>
1429 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
1431 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
1433 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
1434 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
1436 2012-07-12 Glenn Morris <rgm@gnu.org>
1438 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
1440 * process.c (init_process_emacs): Rename from init_process.
1441 The old name is also the name of a Mach system call.
1442 * lisp.h, emacs.c: Update for this name change.
1443 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
1446 2012-07-12 Eli Zaretskii <eliz@gnu.org>
1448 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
1449 memmove call that removes glyphs covered by the left truncation
1450 glyph. Improve commentary.
1451 (display_line): Fix display of continuation glyphs on GUI frames
1452 when the right fringe is turned off and variable-size fonts are
1453 used in the window. Move the code that appends a stretch glyph to
1454 produce_special_glyphs, so that it could be used for truncation
1455 and continuation glyphs alike.
1456 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
1457 glyph of a suitably computed width, to align the special glyphs at
1458 the window margin. Code moved from display_line. (Bug#11832)
1460 2012-07-12 Glenn Morris <rgm@gnu.org>
1462 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
1464 * s/gnu-linux.h, s/hpux10-20.h:
1465 Do not unconditionally define HAVE_XRMSETDATABASE.
1467 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
1469 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
1471 Fix typos that broke OS X build.
1472 Reported by Randal L. Schwartz in
1473 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
1474 * nsterm.m (ns_timeout): Add missing local decl.
1475 (ns_get_color): snprintf -> sprintf, to fix typo.
1477 2012-07-12 Glenn Morris <rgm@gnu.org>
1479 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
1480 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
1481 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
1482 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
1484 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
1485 Move PTY_OPEN to configure.
1487 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
1488 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
1489 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
1491 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
1493 Use empty_unibyte_string where applicable.
1494 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
1495 * lread.c (read1): Likewise.
1496 * xsettings.c (syms_of_xsettings): Likewise.
1498 2012-07-12 Glenn Morris <rgm@gnu.org>
1500 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
1501 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
1502 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
1503 * s/hpux10-20.h (RUN_TIME_REMAP):
1504 * s/bsd-common.h (TABDLY): Move to configure.
1506 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
1508 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
1510 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
1511 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
1513 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
1515 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
1516 * s/template.h: Move NARROWPROTO to configure.
1518 2012-07-11 Glenn Morris <rgm@gnu.org>
1520 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
1521 unused since 2011-01-17 change to systty.h.
1523 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
1524 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
1525 Move HAVE_PTYS and HAVE_SOCKETS to configure.
1527 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
1529 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
1531 2012-07-11 Glenn Morris <rgm@gnu.org>
1533 * s/darwin.h, s/gnu-linux.h, s/template.h:
1534 Move INTERRUPT_INPUT to configure.
1536 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
1538 Minor adjustments to interning code.
1539 * lisp.h (intern, intern_c_string): Redefine as static inline
1540 wrappers for intern_1 and intern_c_string_1, respectively.
1541 (intern_1, intern_c_string_1): Rename prototypes.
1542 * lread.c (intern_1, intern_c_string_1, oblookup): Simplify
1544 * font.c (font_intern_prop): Likewise. Adjust comment.
1545 * w32font.c (intern_font_name): Likewise.
1547 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
1549 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
1551 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
1552 of Fcar/Fcdr if possible.
1553 * font.c (check_otf_features): Likewise.
1554 * fontset.c (Fnew_fontset): Likewise.
1555 * gnutls.c (Fgnutls_boot): Likewise.
1556 * minibuf.c (read_minibuf): Likewise.
1557 * msdos.c (IT_set_frame_parameters): Likewise.
1558 * xmenu.c (Fx_popup_dialog): Likewise.
1559 * w32menu.c (Fx_popup_dialog): Likewise.
1561 2012-07-11 Glenn Morris <rgm@gnu.org>
1563 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
1564 since nothing has defined it on these platforms.
1566 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
1567 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
1569 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
1570 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
1571 Move CLASH_DETECTION to configure.
1573 * s/gnu.h: Remove file, which is now empty.
1575 * s/gnu.h, s/gnu-linux.h:
1576 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
1578 2012-07-11 John Wiegley <johnw@newartisans.com>
1580 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
1581 function attribute, so we only use it if it exists in the
1584 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
1586 Avoid call to strlen in fast_c_string_match_ignore_case.
1587 * search.c (fast_c_string_match_ignore_case): Change to use
1588 length argument. Adjust users accordingly.
1589 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
1591 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
1593 Assume mkdir, rmdir.
1594 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
1595 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
1598 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
1601 * s/hpux10-20.h (HAVE_PERROR): Remove.
1602 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
1603 Remove dummy definition, as this problem was obsolete long ago.
1606 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
1608 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
1610 Avoid calls to strlen in font processing functions.
1611 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
1612 (font_open_by_name): Change to use length argument. Adjust
1614 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
1616 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
1617 Change to return ptrdiff_t.
1618 (xfont_list_pattern, xfont_match): Use length returned by
1619 xfont_decode_coding_xlfd.
1620 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
1622 2012-07-11 Glenn Morris <rgm@gnu.org>
1624 * s/darwin.h, s/freebsd.h, s/netbsd.h:
1625 Move DONT_REOPEN_PTY to configure.
1627 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
1628 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
1630 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
1632 Remove "#define unix" that is no longer needed (Bug#11905).
1633 * s/aix4-2.h (unix): Remove; no longer needed.
1635 EMACS_TIME simplification (Bug#11875).
1636 This replaces macros (which typically do not work in GDB)
1637 with functions, typedefs and enums, making the code easier to debug.
1638 The functional style also makes code easier to read and maintain.
1639 * systime.h: Include <sys/time.h> on all hosts, not just if
1640 WINDOWSNT, since 'struct timeval' is needed in general.
1641 (EMACS_TIME): Now a typedef, not a macro.
1642 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
1644 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
1645 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
1646 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
1647 (EMACS_TIME_LE): Now functions, not macros.
1648 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
1649 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
1650 which are not functions. All uses rewritten to use:
1651 (make_emacs_time): New function.
1652 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
1653 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
1654 not functions. All uses rewritten to use the following, respectively:
1655 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
1656 (add_emacs_time, sub_emacs_time): New functions.
1657 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
1658 * fileio.c (Fcopy_file):
1659 * xterm.c (XTflash): Get the current time closer to when it's used.
1660 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
1662 * bytecode.c (targets): Suppress -Woverride-init warnings.
1664 Simplify by avoiding confusing use of strncpy etc.
1665 * doc.c (Fsnarf_documentation):
1666 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
1667 * frame.c (Fmake_terminal_frame):
1668 * gtkutil.c (get_utf8_string):
1670 * nsmenu.m (ns_update_menubar):
1671 * regex.c (regerror):
1672 Prefer memcpy to strncpy and strncat when either will do.
1673 * fileio.c (Fsubstitute_in_file_name):
1674 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
1675 (menu_separator_name_p):
1676 * nsmenu.m (ns_update_menubar):
1677 Prefer memcmp to strncmp when either will do.
1678 * nsterm.m: Include <ftoastr.h>.
1680 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
1681 Prefer snprintf to strncpy.
1682 * nsterm.m (ns_term_init):
1683 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
1684 * nsterm.m (ns_term_init):
1685 Avoid the need for strncpy, by using build_string or
1686 make_unibyte_string directly. Use dtoastr, not snprintf.
1687 * process.c (Fmake_network_process): Diagnose service names that
1688 are too long, rather than silently truncating them or creating
1689 non-null-terminated names.
1690 (Fnetwork_interface_info): Likewise, for interface names.
1691 * sysdep.c (system_process_attributes) [GNU_LINUX]:
1692 Prefer sprintf to strncat.
1693 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
1694 Prefer vsnprintf to vsprintf + strncpy.
1696 2012-07-10 Glenn Morris <rgm@gnu.org>
1698 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
1699 Clarify fallback case.
1701 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
1703 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
1704 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
1705 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
1706 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
1707 where argument type is known to be a Lisp_Cons.
1709 2012-07-10 Tom Tromey <tromey@redhat.com>
1711 * bytecode.c (BYTE_CODE_THREADED): New macro.
1712 (BYTE_CODES): New macro. Replaces all old byte-code defines.
1713 (enum byte_code_op): New type.
1714 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
1715 (exec_byte_code): Use them. Use token threading when applicable.
1717 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
1719 Optimize pure C strings initialization.
1720 * lisp.h (make_pure_string): Fix prototype.
1721 (build_pure_c_string): New function, defined as static inline. This
1722 provides a better opportunity to optimize away calls to strlen when
1723 the function is called with compile-time constant argument.
1724 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
1725 argument, adjust users accordingly. Use build_pure_c_string where
1727 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
1728 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
1729 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
1731 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
1733 Avoid calls to strlen in miscellaneous functions.
1734 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
1735 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
1736 * lread.c (openp): Likewise.
1738 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
1740 Avoid calls to strlen in path processing functions.
1741 * fileio.c (file_name_as_directory): Add comment. Change to add
1742 srclen argument and return the length of result. Adjust users
1744 (directory_file_name): Fix comment. Change to add srclen argument,
1745 swap 1st and 2nd arguments to obey the common convention. Adjust
1747 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
1749 2012-07-10 Glenn Morris <rgm@gnu.org>
1751 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
1752 Move PENDING_OUTPUT_COUNT definition to configure.
1754 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
1755 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
1756 * s/gnu.h (DATA_START): Move definitions to configure.
1758 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
1759 We include usg5-4-common.h, which defines them both.
1761 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
1762 O_RDONLY already includes it).
1764 Stop ns builds setting the EMACSLOADPATH environment variable.
1765 * nsterm.m (ns_load_path): Rename from ns_init_paths.
1766 Now it does not set EMACSLOADPATH, just returns the load-path string.
1767 * nsterm.h: Update accordingly.
1768 * lread.c [HAVE_NS]: Include nsterm.h.
1769 (init_lread) [HAVE_NS]: Use ns_load_path.
1770 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
1772 2012-07-09 Glenn Morris <rgm@gnu.org>
1774 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
1775 since the included bsd-common.h does so.
1777 Stop ns builds setting the EMACSPATH environment variable.
1778 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
1779 (ns_init_paths): Do not set EMACSPATH.
1780 * nsterm.h (ns_exec_path): Add it.
1781 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
1784 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
1786 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
1788 * process.c (wait_reading_process_output): 'waitchannels' was unset
1789 when read_kbd || !NILP (wait_for_cell); fix this.
1791 Add GCC-style 'const' attribute to functions that can use it.
1792 * character.h (char_resolve_modifier_mask):
1793 * keyboard.h (make_ctrl_char):
1794 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
1795 (init_character_once, next_almost_prime, init_fns, init_image)
1796 (flush_pending_output, init_sound):
1797 * mem-limits.h (start_of_data):
1798 * menu.h (finish_menu_items):
1799 Add ATTRIBUTE_CONST.
1800 * emacs.c (DEFINE_DUMMY_FUNCTION):
1801 Declare the dummy function with ATTRIBUTE_CONST.
1802 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
1803 Add decls with ATTRIBUTE_CONST.
1805 Minor improvements to make_formatted_string.
1806 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
1807 where int is good enough, as vsprintf returns an int.
1808 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
1810 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
1812 Use make_formatted_string to avoid double length calculation.
1813 * lisp.h (make_formatted_string): New prototype.
1814 * alloc.c (make_formatted_string): New function.
1815 * buffer.c (Fgenerate_new_buffer_name): Use it.
1816 * dbus.c (syms_of_dbusbind): Likewise.
1817 * editfns.c (Fcurrent_time_zone): Likewise.
1818 * filelock.c (get_boot_time): Likewise.
1819 * frame.c (make_terminal_frame, set_term_frame_name)
1820 (x_report_frame_params): Likewise.
1821 * image.c (gs_load): Likewise.
1822 * minibuf.c (get_minibuffer): Likewise.
1823 * msdos.c (dos_set_window_size): Likewise.
1824 * process.c (make_process): Likewise.
1825 * xdisp.c (ensure_echo_area_buffers): Likewise.
1826 * xsettings.c (apply_xft_settings): Likewise.
1828 2012-07-09 Glenn Morris <rgm@gnu.org>
1830 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
1831 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
1832 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
1833 * nsterm.h (ns_etc_directory): Add it.
1834 * callproc.c [HAVE_NS]: Include nsterm.h.
1835 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
1837 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
1839 Move marker debugging code under MARKER_DEBUG.
1840 * marker.c (MARKER_DEBUG): Move marker debugging code under
1841 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
1842 for bootstrap with --enable-checking (~3x slowdown reported
1843 by Juanma Barranquero <lekktu@gmail.com>).
1844 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
1846 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
1848 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
1849 See <http://bugs.gnu.org/11825#29>.
1851 2012-07-08 Eli Zaretskii <eliz@gnu.org>
1853 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
1854 has no font, use the frame's font. (Bug#11813)
1855 (display_line): Add commentary about displaying truncation glyphs
1857 (produce_special_glyphs): Move here from term.c.
1859 * term.c (produce_special_glyphs): Move to xdisp.c.
1861 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
1864 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
1866 * xdisp.c (display_line): Avoid warning about implicit declaration
1869 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
1871 * lisp.h: Remove empty conditional.
1873 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
1875 * lread.c (load_path_check): Now static.
1877 Fix some minor --with-ns problems found by static checking.
1878 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
1879 (x_set_font) [!HAVE_X_WINDOWS]:
1880 * image.c (xpm_load_image) [HAVE_NS]:
1881 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
1882 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
1883 Remove unused local.
1884 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
1885 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
1886 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
1887 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
1888 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
1889 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
1890 Fix pointer signedness problem.
1891 * xfaces.c (FRAME_X_FONT_TABLE):
1892 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
1894 2012-07-07 Glenn Morris <rgm@gnu.org>
1896 * lread.c (load_path_check): New function, split from init_lread.
1897 (init_lread): Reorganize. Motivation:
1898 If EMACSLOADPATH is set, check/warn about that rather than the
1899 defaults, which we are not going to use. Hence we can remove
1900 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
1901 Don't warn if site-lisp directories are missing.
1902 If not installed, start from a blank load-path, since
1903 PATH_LOADSEARCH refers to the eventual installation directories.
1905 2012-07-07 Eli Zaretskii <eliz@gnu.org>
1907 Support truncation and continuation glyphs on GUI frames, when
1908 fringes are disabled. (Bug#11832)
1909 * xdisp.c (init_iterator): Get dimensions of truncation and
1910 continuation glyphs even if on GUI frames. Adjust
1911 it->last_visible_x on GUI frames when the left or right fringes,
1912 or both, are absent.
1913 (start_display, move_it_in_display_line_to): Handle the case of a
1914 GUI frame without a fringe to display continuation or truncation
1916 (insert_left_trunc_glyphs): Support GUI frames: make sure
1917 truncation glyphs overwrite enough glyphs from the current line to
1918 have sufficient space in pixels.
1919 (display_line): Support truncation and continuation glyphs on GUI
1920 frames. If some spare pixels are left on the line after inserting
1921 the truncation glyphs, fill that space with a stretch glyph of a
1922 suitably computed width.
1924 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
1925 produce_glyphs, to support GUI sessions.
1927 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
1929 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
1931 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
1933 Do not require float-time's arg to fit in time_t (Bug#11825).
1934 This works better on hosts where time_t is unsigned, and where
1935 float-time is applied to the (negative) difference between two times.
1936 * editfns.c (decode_time_components): Last arg is now double *,
1937 not int *, and means to store all the result as a double, without
1938 worrying about whether the seconds part fits in time_t.
1939 All callers changed.
1940 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
1941 All callers changed.
1942 (Ffloat_time): Do not fail merely because the specified time falls
1943 outside of time_t range.
1945 2012-07-07 Glenn Morris <rgm@gnu.org>
1947 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
1948 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
1949 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
1951 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
1953 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
1954 Update dependencies.
1956 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
1958 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
1960 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
1961 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
1962 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
1963 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
1964 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
1965 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
1967 * xfont.c (compare_font_names): Redo to omit the need for casts.
1969 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
1971 * xfns.c (Fx_change_window_property): Doc fix.
1972 * w32fns.c (Fx_change_window_property): Doc fix.
1974 * w32fns.c (Fx_window_property): Accept the same arguments as the
1975 X Windows version. Doc fix.
1976 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
1978 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
1979 Eli Zaretskii <eliz@gnu.org>
1981 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
1982 Windows-specific code from nt/config.nt moved here.
1983 Obsolete settings removed.
1985 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
1987 * process.c: Avoid unnecessary calls to gettime.
1988 (wait_reading_process_output): Don't get the time of day
1989 when gobbling data immediately and not waiting, as there's no need
1990 for it in that case. This removes a FIXME.
1992 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
1994 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
1995 is defined (Bug#11768).
1997 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
1999 Fix marker debugging code.
2000 * marker.c (byte_char_debug_check): Do not perform the check
2001 if buffer is not multibyte.
2002 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
2003 Call byte_char_debug_check with correct arguments.
2005 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
2007 Compile marker debugging code only if ENABLE_CHECKING is defined.
2008 * marker.c (byte_char_debug_check, count_markers):
2009 Use only if ENABLE_CHECKING is defined.
2010 (byte_debug_flag): Remove.
2011 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
2012 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
2014 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
2016 Avoid code repetition in marker-related functions.
2017 * marker.c (attach_marker): New function.
2018 (Fset_marker, set_marker_restricted, set_marker_both)
2019 (set_marker_restricted_both): Use it.
2020 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
2021 Consistently rename charno to charpos.
2022 (marker_position): Add eassert.
2023 (marker_byte_position): Convert to eassert.
2025 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
2027 Simplify list operations in unchain_overlay and unchain_marker.
2028 * buffer.c (unchain_overlay): Simplify. Add comment.
2029 * marker.c (unchain_marker): Simplify. Fix comments.
2031 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
2033 Introduce fast path for the widely used marker operation.
2034 * alloc.c (build_marker): New function.
2035 * lisp.h (build_marker): New prototype.
2036 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
2037 * composite.c (autocmp_chars): Likewise.
2038 * editfns.c (buildmark): Remove.
2039 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
2040 (save_restriction_save): Use build_marker.
2041 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
2042 * window.c (save_window_save): Likewise.
2044 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
2046 Do not use Fdelete_overlay in delete_all_overlays
2047 to avoid redundant calls to unchain_overlay.
2048 * buffer.c (drop_overlay): New function.
2049 (delete_all_overlays, Fdelete_overlay): Use it.
2050 * minibuf.c (get_minibuffer): Fix comment.
2052 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
2054 Port to OpenBSD 5.1 amd64.
2055 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
2056 This is needed for OpenBSD, and should be harmless on all BSD systems.
2057 Also, include <sys/sysctl.h>, as it should be available on all
2058 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
2059 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
2060 use p_pid member, not kp_proc.pid.
2062 2012-07-06 Glenn Morris <rgm@gnu.org>
2064 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
2066 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
2068 More xmalloc and related cleanup.
2069 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
2070 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
2071 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
2072 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
2073 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
2074 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
2075 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
2076 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
2077 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
2079 Omit needless casts involving void * pointers and allocation.
2080 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
2081 as the former is more robust if P's type is changed.
2082 Prefer xzalloc to xmalloc + memset 0.
2083 Simplify malloc-or-realloc to realloc.
2084 Don't worry about xmalloc returning a null pointer.
2085 Prefer xstrdup to xmalloc + strcpy.
2086 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
2088 * keyboard.c (apply_modifiers_uncached): Prefer local array to
2089 alloca of a constant.
2091 2012-07-05 Eli Zaretskii <eliz@gnu.org>
2093 * xdisp.c (display_line): Fix horizontal pixel coordinates when
2094 hscroll is larger than the line width. Fixes long and futile
2095 looping inside extend_face_to_end_of_line (on a TTY) producing
2096 glyphs that are not needed and thrown away.
2098 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
2100 * marker.c (set_marker_restricted_both): Simplify by using
2103 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
2105 * editfns.c (region_limit): Simplify by using clip_to_bounds.
2107 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
2109 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
2110 not defined (Bug#11768).
2111 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
2112 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
2113 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
2114 followed by gtk_box_set_homogeneous (Bug#11768).
2115 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
2116 (update_theme_scrollbar_width, xg_create_scroll_bar):
2117 Use gtk_scrollbar_new (Bug#11768).
2118 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
2119 (is_box_type): New function (Bug#11768).
2120 (xg_tool_item_stale_p): Call is_box_type.
2121 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
2122 with default display (Bug#11768).
2124 2012-07-05 Eli Zaretskii <eliz@gnu.org>
2126 * xdisp.c (window_hscroll_limited): New function.
2127 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
2128 coordinates when window's hscroll is set to insanely large
2131 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
2133 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
2134 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
2136 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
2139 * lisp.h (xzalloc): New prototype. Omit needless casts.
2140 * alloc.c (xzalloc): New function. Omit needless casts.
2141 * charset.c: Omit needless casts. Convert all calls to
2142 xmalloc with following memset to xzalloc.
2143 * dispnew.c: Likewise.
2144 * fringe.c: Likewise.
2145 * image.c: Likewise.
2146 * sound.c: Likewise.
2148 * w32fns.c: Likewise.
2149 * w32font.c: Likewise.
2150 * w32term.c: Likewise.
2151 * xfaces.c: Likewise.
2153 * xterm.c: Likewise.
2154 * atimer.c: Omit needless casts.
2155 * buffer.c: Likewise.
2156 * callproc.c: Likewise.
2158 * coding.c: Likewise.
2159 * composite.c: Likewise.
2161 * doprnt.c: Likewise.
2162 * editfns.c: Likewise.
2163 * emacs.c: Likewise.
2165 * filelock.c: Likewise.
2167 * gtkutil.c: Likewise.
2168 * keyboard.c: Likewise.
2170 * lread.c: Likewise.
2171 * minibuf.c: Likewise.
2172 * msdos.c: Likewise.
2173 * print.c: Likewise.
2174 * process.c: Likewise.
2175 * region-cache.c: Likewise.
2176 * search.c: Likewise.
2177 * sysdep.c: Likewise.
2178 * termcap.c: Likewise.
2179 * terminal.c: Likewise.
2180 * tparam.c: Likewise.
2181 * w16select.c: Likewise.
2183 * w32reg.c: Likewise.
2184 * w32select.c: Likewise.
2185 * w32uniscribe.c: Likewise.
2186 * widget.c: Likewise.
2187 * xdisp.c: Likewise.
2188 * xmenu.c: Likewise.
2190 * xselect.c: Likewise.
2192 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
2194 * fileio.c (time_error_value): Check the right error number.
2195 Problem reported by Troels Nielsen in
2196 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
2198 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
2200 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
2201 This should be fixed in a better way; see Eli Zaretskii in
2202 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
2203 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
2205 * fileio.c (time_error_value): Rename from special_mtime.
2206 The old name's problems were noted by Eli Zaretskii in
2207 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
2209 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
2210 This variable's comment says Emacs needs at least one GDB-visible
2211 symbol of type enum pvec_type, to work around GDB problems.
2212 The symbol's value doesn't matter.
2214 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
2215 that causes compilation to fail on pre-C99 compilers.
2217 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
2219 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
2220 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
2222 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
2224 * buffer.c (init_buffer_once): Fix initialization of
2225 headers for buffer_defaults and buffer_local_symbols.
2226 Reported by Juanma Barranquero <lekktu@gmail.com>.
2228 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
2230 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
2231 * lisp.h (enum pvec_type): Use fewer bits.
2232 (PSEUDOVECTOR_SIZE_BITS): New constant.
2233 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
2234 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
2235 change in pvec_type.
2236 (PSEUDOVECTOR_TYPEP): New macro.
2237 (TYPED_PSEUDOVECTORP): Use it.
2238 * fns.c (internal_equal): Adapt code to extract pvectype.
2239 * emacs.c (gdb_pvec_type): Update type.
2240 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
2241 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
2242 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
2243 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
2244 (sweep_vectors): Use it. Use local var `total_bytes' instead of
2245 abusing vector->header.next.nbytes.
2246 (live_vector_p): Use PVEC_TYPE.
2247 (mark_object): Adapt code to extract pvectype. Use switch.
2249 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
2251 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
2252 Tighten new eassert a bit.
2254 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
2256 Fix compilation with --enable-gcc-warnings and -O1
2258 * doprnt.c (doprnt): Change type of tem to int, initialize
2259 to avoid compiler warning. Add eassert.
2260 * search.c (simple_search): Initialize match_byte to avoid
2261 compiler warning. Add eassert.
2263 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
2265 Avoid weird behavior with large horizontal scrolls.
2266 Without this change, for example, large hscroll values would
2267 mess up Emacs's display on Fedora 15 x86, presumably due to
2268 overflows in int calculations in the display code.
2269 Also, if buffers had long lines, Emacs would freeze.
2270 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
2271 (set_window_hscroll): New function, containing the old guts of
2272 Fset_window_hscroll. Return the clipped value.
2273 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
2274 This avoids the need to check against PTRDIFF_MAX.
2276 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
2278 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
2280 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
2282 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
2284 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
2285 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
2286 since GCC 4.4.6 issues a bogus warning for them.
2288 Fix bugs in file timestamp newness comparisons.
2289 * fileio.c (Ffile_newer_than_file_p):
2290 * lread.c (Fload): Use full timestamp resolution of files,
2291 not just the 1-second resolution, so that files that are only
2292 slightly newer still count as newer.
2293 * fileio.c (Ffile_newer_than_file_p): Don't assume file
2294 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
2296 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
2298 * fileio.c: Improve handling of file time marker. (Bug#11852)
2299 (special_mtime): New function.
2300 (Finsert_file_contents, Fverify_visited_file_modtime):
2301 Use it to set special mtime values consistently.
2303 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
2305 * fileio.c (Finsert_file_contents): Properly handle st_mtime
2306 marker for non-existing file. (Bug#11852)
2308 2012-07-03 Glenn Morris <rgm@gnu.org>
2310 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
2311 and did not make it into globals.h).
2313 2012-07-03 Tom Tromey <tromey@redhat.com>
2315 * window.c (Fset_window_margins, Fset_window_fringes)
2316 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
2317 * textprop.c (Fprevious_property_change): No longer static.
2318 * syntax.c (Fsyntax_table_p): No longer static.
2319 * process.c (Fget_process, Fprocess_datagram_address): No longer
2321 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
2322 * keyboard.c (Fcommand_execute): No longer static.
2324 * insdel.c (Fcombine_after_change_execute): No longer static.
2325 * image.c (Finit_image_library): No longer static.
2326 * fileio.c (Fmake_symbolic_link): No longer static.
2327 * eval.c (Ffetch_bytecode): No longer static.
2328 * editfns.c (Fuser_full_name): No longer static.
2329 * doc.c (Fdocumentation_property, Fsnarf_documentation):
2331 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
2333 * dired.c (Ffile_attributes): No longer static.
2334 * composite.c (Fcomposition_get_gstring): No longer static.
2335 * callproc.c (Fgetenv_internal): No longer static.
2337 * ccl.h: Remove EXFUNs.
2338 * buffer.h: Remove EXFUNs.
2339 * dispextern.h: Remove EXFUNs.
2340 * intervals.h: Remove EXFUNs.
2341 * fontset.h: Remove EXFUN.
2342 * font.h: Remove EXFUNs.
2343 * dosfns.c (system_process_attributes): Remove EXFUN.
2344 * keymap.h: Remove EXFUNs.
2345 * lisp.h: Remove EXFUNs.
2346 * w32term.h: Remove EXFUNs.
2347 * window.h: Remove EXFUNs.
2348 * xsettings.h: Remove EXFUN.
2349 * xterm.h: Remove EXFUN.
2351 2012-07-03 Glenn Morris <rgm@gnu.org>
2353 * lisp.h (Frandom): Make it visible to C.
2354 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
2355 buffer for invisible buffers. (Bug#1229)
2357 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
2359 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
2360 values which aren't power of 2.
2361 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro. Verify
2362 it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
2365 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
2367 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
2369 * alloc.c (mark_object): Revert part of last patch to use `switch'.
2371 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
2373 * alloc.c (allocate_vector_block): Remove redundant
2374 calls to mallopt if DOUG_LEA_MALLOC is defined.
2375 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
2376 avoid calls to mallopt if zero_vector is returned.
2378 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
2380 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
2381 is enabled, avoid dereferencing NULL current_sblock if
2384 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
2386 Cleanup basic buffer management.
2387 * buffer.h (struct buffer): Change layout to use generic vector
2388 marking code. Fix some comments. Change type of 'clip_changed'
2389 to bitfield. Remove unused #ifndef old.
2390 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
2391 (GET_OVERLAYS_AT): Fix indentation.
2392 (for_each_per_buffer_object_at): New macro.
2393 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
2394 (Fbuffer_local_variables): Use it.
2395 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
2396 * alloc.c (allocate_buffer): Adjust to match new layout of
2397 struct buffer. Fix comment.
2398 (mark_overlay): New function.
2399 (mark_buffer): Use it. Use mark_vectorlike to mark normal
2400 Lisp area of struct buffer.
2401 (mark_object): Use it. Adjust marking of misc objects
2402 and related comments.
2404 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
2406 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
2407 wrapper that is not needed because the wrapped code is a no-op (zero
2408 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
2409 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
2411 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
2413 * alloc.c (mark_buffer): Simplify. Remove prototype.
2414 (mark_object): Add comment. Reorganize marking of vector-like
2415 objects. Use CHECK_LIVE for all vector-like objects except buffers
2416 and subroutines when GC_CHECK_MARKED_OBJECTS is defined. Avoid
2417 redundant calls to mark_vectorlike for bool vectors.
2419 2012-06-30 Glenn Morris <rgm@gnu.org>
2421 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
2423 * epaths.in (PATH_SITELOADSEARCH): New.
2424 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
2425 This is rather than relying on --enable-locallisppath elements
2426 having "site-lisp" in their names. (Bug#10208#25, 11658)
2428 2012-06-30 Eli Zaretskii <eliz@gnu.org>
2430 * w32proc.c (sys_select): Accept and ignore one more argument.
2432 * w32.c (emacs_gnutls_pull): Call select with one more argument.
2434 * sysselect.h [DOS_NT]: Don't include sys/select.h.
2435 (pselect) [!MS_DOS]: Redirect to sys_select.
2437 * sysdep.c: Don't include dos.h and dosfns.h.
2439 * process.c (sys_select):
2440 * msdos.c (sys_select): Accept one more argument and ignore it.
2442 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
2443 adapt data types and code to that.
2446 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
2447 which clashes with the gnulib function of the same name.
2449 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
2451 * font.c (font_style_to_value, font_style_symbolic)
2452 (font_prop_validate_style): Add type checks for values in
2455 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
2457 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
2460 2012-06-29 Eli Zaretskii <eliz@gnu.org>
2462 * xdisp.c (try_window_id): Undo last change.
2464 * w32.c (getwd): Adjust commentary about startup_dir.
2465 (init_environment): Always call sys_access, even in non-MSVC
2466 builds. Don't chdir to the directory of the Emacs executable.
2467 This undoes code from 1997 which was justified by the need to
2468 "avoid conflicts when removing and renaming directories". But its
2469 downside was that every relative file name was being interpreted
2470 relative to the directory of the Emacs executable, which can never
2471 be TRT. In particular, it broke sys_access when called with
2472 relative file names.
2473 (sys_access): Map GetLastError to errno.
2475 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
2477 * window.h (struct window): Change type of 'fringes_outside_margins'
2478 to bitfield. Fix comment. Adjust users accordingly.
2479 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2481 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
2484 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
2486 * gnutls.c (emacs_gnutls_handshake):
2487 Add QUIT to make the loop interruptible.
2489 2012-06-29 Glenn Morris <rgm@gnu.org>
2491 * charset.c (init_charset): Make lack of etc/charsets fatal.
2493 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
2495 * editfns.c (region_limit): Fix type mismatch.
2497 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
2499 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
2500 undefined. Convert from xassert to eassert.
2501 * nsmenu.m: Convert from xassert to eassert.
2502 * nsterm.m: Likewise.
2504 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
2506 * editfns.c (region_limit): Clip to narrowing (bug#11770).
2508 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
2510 Avoid integer overflow on scroll-left and scroll-right.
2511 * window.c (HSCROLL_MAX): New macro.
2512 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
2513 overflow when requested scroll falls outside ptrdiff_t range.
2515 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
2517 * window.h (struct window): Change type of 'hscroll',
2518 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
2519 'last_modified' and 'last_overlay_modified' to EMACS_INT.
2520 Adjust users accordingly.
2521 * xdisp.c (try_cursor_movement): Replace type check with eassert.
2522 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
2523 from EMACS_INT to ptrdiff_t.
2524 (make_window): Omit redundant initialization.
2526 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
2528 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
2530 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
2532 * window.h (struct window): Change type of 'use_time' and
2533 'sequence_number' from Lisp_Object to int.
2534 * frame.c (make_frame): Adjust users accordingly.
2535 * print.c (print_object): Likewise.
2536 * window.c (select_window, Fwindow_use_time, make_parent_window)
2537 (make_window): Likewise.
2539 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
2541 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
2542 enabled with --enable-checking=[all,glyphs] configure option.
2543 Fix GLYPH_DEBUG usage assuming that it may be undefined,
2544 adjust comments accordingly.
2545 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
2546 undefined, adjust comments accordingly.
2547 * image.c: Likewise.
2548 * scroll.c: Likewise.
2549 * w32fns.c: Likewise.
2550 * w32term.c: Likewise.
2551 * xdisp.c: Likewise.
2552 * xfaces.c: Likewise.
2554 * xterm.c: Likewise.
2556 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
2558 Generalize run-time debugging checks.
2559 * dispextern.h (XASSERTS): Remove.
2560 * fontset.c (xassert): Remove.
2561 Convert from xassert to eassert.
2562 * alloc.c: Convert from xassert to eassert.
2564 * dispnew.c: Likewise.
2566 * fringe.c: Likewise.
2567 * ftfont.c: Likewise.
2568 * gtkutil.c: Likewise.
2569 * image.c: Likewise.
2570 * keyboard.c: Likewise.
2572 * process.c: Likewise.
2573 * scroll.c: Likewise.
2574 * sound.c: Likewise.
2576 * w32console.c: Likewise.
2577 * w32fns.c: Likewise.
2578 * w32term.c: Likewise.
2579 * window.c: Likewise.
2580 * xdisp.c: Likewise.
2581 * xfaces.c: Likewise.
2583 * xselect.c: Likewise.
2584 * xterm.c: Likewise.
2586 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
2588 * fns.c (maybe_resize_hash_table): Output message when growing the
2591 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2593 * alloc.c (allocate_string_data): Remove dead code.
2594 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
2595 avoid GCC warning about unused macro.
2597 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2599 * alloc.c (allocate_string): Omit intervals initialization.
2600 * alloc.c (make_uninit_multibyte_string): Initialize intervals
2601 as in make_pure_string and make_pure_c_string.
2603 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2605 * alloc.c (allocate_string): Fix last change.
2607 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2609 * alloc.c (allocate_string): Remove two redundant calls
2610 to memset, add explicit initialization where appropriate.
2612 2012-06-27 Glenn Morris <rgm@gnu.org>
2614 * lisp.mk (lisp): Remove paths.elc.
2616 2012-06-27 Chong Yidong <cyd@gnu.org>
2618 * doc.c (Fsubstitute_command_keys): Fix punctuation.
2620 2012-06-26 John Wiegley <johnw@newartisans.com>
2622 * unexmacosx.c (copy_data_segment): Add two section names used
2623 on Mac OS X Lion: __mod_init_func and __mod_term_func.
2625 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
2626 when building with Clang.
2628 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
2630 * eval.c (Fapply): Allow calling it with a single argument.
2632 2012-06-26 Eli Zaretskii <eliz@gnu.org>
2634 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
2635 _stricmp and _strnicmp.
2636 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
2638 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
2640 * alloc.c (allocate_window): Zero out non-Lisp part of newly
2642 (allocate_process): Likewise for new process.
2643 (allocate_terminal): Change to use offsetof.
2644 (allocate_frame): Likewise.
2645 * frame.c (make_frame): Omit redundant initialization.
2646 * window.c (make_parent_window): Use memset.
2647 (make_window): Omit redundant initialization.
2648 * process.c (make_process): Omit redundant initialization.
2649 * terminal.c (create_terminal): Likewise.
2651 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
2653 * term.c (delete_tty): Remove redundant call to memset.
2655 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
2657 * alloc.c: Remove build_string.
2658 * lisp.h: Define build_string as static inline. This provides
2659 a better opportunity to optimize away calls to strlen when the
2660 function is called with compile-time constant argument.
2661 * image.c (imagemagick_error): Convert to build_string.
2662 * w32proc.c (sys_spawnve): Likewise.
2663 * xterm.c (x_term_init): Likewise.
2665 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
2667 Use sprintf return value instead of invoking strlen on result.
2668 In the old days this wasn't portable, since some sprintf
2669 implementations returned char *. But they died out years ago and
2670 Emacs already assumes sprintf returns int.
2671 Similarly for float_to_string.
2672 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
2673 * ccl.c (ccl_driver):
2674 * character.c (string_escape_byte8):
2675 * data.c (Fnumber_to_string):
2676 * doprnt.c (doprnt):
2677 * print.c (print_object):
2678 * xdisp.c (message_dolog):
2679 * xfns.c (syms_of_xfns):
2680 Use sprintf or float_to_string result to avoid need to call strlen.
2681 * data.c (Fnumber_to_string):
2682 Use make_unibyte_string, since the string must be ASCII.
2683 * lisp.h, print.c (float_to_string): Now returns int length.
2684 * term.c (produce_glyphless_glyph):
2685 Use sprintf result rather than recomputing it.
2687 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
2688 * Makefile.in (ALL_CFLAGS):
2689 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
2690 * gmalloc.c, regex.c: Include <config.h> unconditionally.
2692 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
2694 * dispextern.h (xstrcasecmp): Define to library function
2695 strcasecmp if available.
2696 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
2698 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
2700 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
2701 Avoid comma operator.
2702 * menu.c (push_submenu_start, push_submenu_end)
2703 (push_left_right_boundary, push_menu_pane): Likewise.
2704 * msdos.c (dos_rawgetc): Likewise.
2706 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
2708 * xfns.c (xic_create_fontsetname): Remove redundant calls
2711 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
2713 * gtkutil.c (get_utf8_string): Remove redundant assignment.
2714 sprintf already null-terminates its output.
2716 * xfns.c (x_window): Remove redundant cast.
2718 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
2720 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
2721 `const char *' to `char *' to avoid compiler warning.
2723 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
2725 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
2726 instead of truncating it to 63 (admittedly a generous limit).
2728 * process.c: Fix spelling and caps in comments.
2730 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
2732 * emacs.c (setpgrp): Remove definition, unused.
2733 * sysdep.c (setpgrp): Remove definition, not used in this file.
2735 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
2737 * makefile.w32-in: Update dependencies.
2739 2012-06-24 Eli Zaretskii <eliz@gnu.org>
2741 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
2742 (SYSTIME_H): Add nt/inc/sys/time.h.
2744 * systime.h [WINDOWSNT]: Include sys/time.h.
2746 * s/ms-w32.h (struct timespec): Definition moved from
2747 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
2749 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
2751 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
2752 * buffer.h (buffer_slot_type_mismatch):
2753 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
2754 * eval.c (unwind_to_catch):
2755 * image.c (my_png_error, my_error_exit):
2756 * keyboard.c (quit_throw_to_read_char, user_error)
2757 (Fexit_recursive_edit, Fabort_recursive_edit):
2758 * lisp.h (die, args_out_of_range, args_out_of_range_3)
2759 (wrong_type_argument, buffer_overflow, __executable_start)
2760 (memory_full, buffer_memory_full, string_overflow, Fthrow)
2761 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
2762 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
2764 (child_setup) [!DOS_NT]:
2765 * lread.c (end_of_file_error, invalid_syntax):
2766 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
2767 * puresize.h (pure_write_error):
2768 * search.c (matcher_overflow):
2769 * sound.c (sound_perror, alsa_sound_perror):
2770 * sysdep.c, syssignal.h (croak):
2771 * term.c (maybe_fatal, vfatal):
2772 * textprop.c (text_read_only):
2773 * undo.c (user_error):
2774 * unexmacosx.c (unexec_error):
2775 * xterm.c (x_ins_del_lines, x_delete_glyphs):
2776 Use _Noreturn rather than NO_RETURN.
2777 No need for separate decl merely because of _Noreturn.
2778 * sound.c (sound_warning, parse_sound):
2779 Remove unnecessary forward decls.
2781 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
2783 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
2784 * lisp.h (WAIT_READING_MAX): New macro.
2785 * dispnew.c (Fsleep_for, sit_for):
2786 * keyboard.c (kbd_buffer_get_event):
2787 * process.c (Faccept_process_output):
2788 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
2789 This improves on the previous patch, which introduced a bug
2790 when time_t is unsigned and as wide as intmax_t.
2791 See <http://bugs.gnu.org/9000#51>.
2793 2012-06-23 Eli Zaretskii <eliz@gnu.org>
2795 * dispnew.c (sit_for, Fsleep_for):
2796 * keyboard.c (kbd_buffer_get_event):
2797 * process.c (Faccept_process_output): Avoid compiler warnings when
2798 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
2800 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
2802 * makefile.w32-in: Update dependencies.
2804 * w32.c (ltime): Add return type and declare static.
2805 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
2807 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
2809 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
2810 Privately reported by Herbert J. Skuhra.
2811 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
2813 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
2814 not make_lisp_timeval, when the argument is of type EMACS_TIME.
2816 2012-06-23 Eli Zaretskii <eliz@gnu.org>
2818 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
2819 last argument of make_unibyte_string.
2821 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
2822 language ID in the event parameters.
2824 * w32term.c (w32_read_socket): Put the new keyboard codepage into
2825 event.code, not the obscure "character set ID".
2827 2012-06-23 Chong Yidong <cyd@gnu.org>
2829 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
2831 2012-06-23 Eli Zaretskii <eliz@gnu.org>
2833 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
2834 * w32.c (fdutimens): New function.
2836 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
2838 * s/ms-w32.h (pselect): Redirect to sys_select.
2840 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
2842 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
2843 in the logic of incrementing and decrementing the value of
2844 use_relocatable_buffers.
2846 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
2848 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
2849 Privately reported by Herbert J. Skuhra.
2850 [__FreeBSD__]: Remove "*/" typo after "#include".
2851 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
2852 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
2853 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
2854 Don't assume EMACS_TIME and struct timeval are the same type.
2856 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
2858 Support higher-resolution time stamps (Bug#9000).
2859 The time stamps are only nanosecond-resolution at the C level,
2860 since that's the best that any real-world system supports now.
2861 But they are picosecond-resolution at the Lisp level, as that's
2862 easy, and leaves room for future OS improvements.
2864 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
2867 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
2868 Don't get current time unless it's needed.
2870 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
2871 now provides it if it's absent.
2872 (start_atimer): Port to higher-res time stamps.
2873 Check for time stamp overflow. Don't get current time more
2874 often than is needed.
2876 * buffer.h (struct buffer): Buffer modtime now has high resolution.
2877 Include systime.h, not time.h.
2878 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
2880 * dired.c: Include stat-time.h.
2881 (Ffile-attributes): File times now have higher resolution.
2883 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
2884 (struct image): Timestamp now has higher resolution.
2886 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
2887 has at least microseconds now. All uses removed.
2888 (update_frame, update_single_window, update_window, update_frame_1)
2889 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
2891 * editfns.c (time_overflow): Now extern.
2892 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
2893 (float-time, Fformat_time_string, Fcurrent_time_string)
2894 (Fcurrent_time_zone): Accept and generate higher-resolution
2896 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
2897 (decode_time_components, lisp_seconds_argument): New functions.
2898 (make_time): Now static.
2899 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
2900 Report an error if the time is invalid, rather than having the caller
2903 * fileio.c: Include <stat-time.h>
2904 (Fcopy_file): Copy higher-resolution time stamps.
2905 Prefer to set the time stamp via a file descriptor if that works.
2906 (Fset_file_times, Finsert_file_contents, Fwrite_region)
2907 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
2908 (Fvisited_file_modtime, Fset_visited_file_modtime):
2909 Support higher-resolution time stamps.
2911 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
2913 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
2915 * image.c (prepare_image_for_display, clear_image_cache)
2916 (lookup_image): Port to higer-resolution time stamps.
2918 * keyboard.c (start_polling, bind_polling_period):
2919 Check for time stamp overflow.
2920 (read_char, kbd_buffer_get_event, timer_start_idle)
2921 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
2922 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
2923 Port to higher-resolution time stamps. Do not assume time_t is signed.
2924 (decode_timer): New function. Timers are now vectors of length 9,
2925 not 8, to accommodate the picosecond component.
2926 (timer_check_2): Use it.
2928 * nsterm.m (select_timeout, timeval_subtract): Remove.
2929 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
2930 as they're a bit more accurate and handle overflow better.
2931 (ns_select): Change prototype to be compatible with pselect.
2932 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
2933 * nsterm.h (ns_select): Adjust prototype.
2935 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
2936 us-resolution time stamps.
2937 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
2939 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
2941 * lisp.h (time_overflow): New decl.
2942 (wait_reading_process_output): First arg is now intmax_t, not int,
2943 to accommodate larger waits.
2945 * process.h (struct Lisp_Process.read_output_delay):
2946 Now counts nanoseconds, not microseconds.
2947 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
2949 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
2950 (wait_reading_process_output):
2951 Port to ns-resolution time stamps.
2952 (Faccept_process_output, wait_reading_process_output):
2953 Check for time stamp overflow. Do not assume time_t is signed.
2954 (select_wrapper): Remove; we now use pselect.
2955 (Fprocess_attributes): Now generates ns-resolution time stamps.
2957 * sysdep.c: Include utimens.h. Don't include utime.h
2958 or worry about struct utimbuf; gnulib does that for us now.
2959 (gettimeofday): Remove; gnulib provides a substitute.
2960 (make_timeval): New function.
2961 (set_file_times): Now sets ns-resolution time stamps.
2962 New arg FD; all uses changed.
2963 (time_from_jiffies, ltime_from_jiffies, get_up_time)
2964 (system_process_attributes):
2965 Now returns ns-resolution time stamp. All uses changed.
2966 Check for time stamp overflow.
2968 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
2969 provides a substitute now.
2971 * systime.h: Include timespec.h rather than sys/time.h and time.h,
2972 since it guarantees struct timespec.
2973 (EMACS_TIME): Now struct timespec, so that we can support
2974 ns-resolution time stamps.
2975 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
2976 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
2977 (EMACS_USECS): Remove.
2978 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
2979 so multiply the arg by 1000 before storing it.
2980 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
2982 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
2983 Port to ns-resolution time stamps.
2984 (EMACS_TIME_NEG_P): Remove; replaced by....
2985 (EMACS_TIME_SIGN): New macro.
2986 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
2987 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
2988 (set_file_times, make_time, lisp_time_argument): Adjust signature.
2989 (make_timeval, make_lisp_time, decode_time_components): New decls.
2990 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
2991 that it mishandled time_t overflow. You can't compare by subtracting!
2992 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
2993 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
2995 * term.c: Include <sys/time.h>.
2996 (timeval_to_Time): New function, for proper overflow wraparound.
2997 (term_mouse_position, term_mouse_click): Use it.
2999 * undo.c (record_first_change): Support higher-resolution time stamps
3001 (Fprimitive_undo): Use them when restoring time stamps.
3003 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
3004 (w32_get_internal_run_time):
3005 Port to higher-resolution Emacs time stamps.
3006 (ltime): Now accepts single 64-bit integer, as that's more convenient
3009 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
3011 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
3012 for compatibility with pselect. Support ns-resolution time stamps.
3014 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
3016 * xselect.c (wait_for_property_change, x_get_foreign_selection):
3017 Check for time stamp overflow, and support ns-resolution time stamps.
3019 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
3020 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
3021 (timeval_subtract): Remove; no longer needed.
3022 (XTflash, XTring_bell, x_wait_for_event):
3023 Port to ns-resolution time stamps. Don't assume time_t is signed.
3025 2012-06-22 Chong Yidong <cyd@gnu.org>
3027 * xdisp.c (x_consider_frame_title): Revert last change.
3029 2012-06-22 Eli Zaretskii <eliz@gnu.org>
3031 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
3032 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
3033 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
3034 staticidx goes up to 1597 out of 1600 = 0x640.)
3036 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
3038 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
3039 Otherwise, the umask might be mistakenly 0 while handling input signals.
3041 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
3043 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
3045 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
3047 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
3048 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
3049 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
3050 access to `contents' member of Lisp_Vector objects with AREF and ASET
3053 2012-06-19 Chong Yidong <cyd@gnu.org>
3055 * frame.c (delete_frame): When selecting a frame on a different
3056 text terminal, do not alter the terminal's top-frame.
3058 * xdisp.c (format_mode_line_unwind_data): Record the target
3059 frame's selected window and its terminal's top-frame.
3060 (unwind_format_mode_line): Restore them.
3061 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
3063 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
3064 since tty frames can be explicitly named.
3065 (prepare_menu_bars): Likewise.
3067 * term.c (Ftty_top_frame): New function.
3069 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
3071 Port byte-code-meter to modern targets.
3072 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
3073 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
3074 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
3075 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
3076 (METER_1, METER_2): Simplify.
3078 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
3080 * data.c (Fdefalias): Return `symbol' (bug#11686).
3082 2012-06-18 Martin Rudalics <rudalics@gmx.at>
3084 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
3085 gets killed during executing of this function (Bug#11665).
3086 Try to always return Qt when the buffer has been actually killed.
3087 (Vkill_buffer_query_functions): In doc-string say that functions
3088 run by this hook should not change the current buffer.
3090 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
3092 Fix recently-introduced process.c problems found by static checking.
3093 * process.c (write_queue_push, write_queue_pop, send_process):
3094 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
3095 (write_queue_pop): Fix pointer signedness problem.
3096 (send_process): Remove unused local.
3098 2012-06-17 Chong Yidong <cyd@gnu.org>
3100 * xdisp.c (redisplay_internal): No need to redisplay terminal
3101 frames that are not on top.
3103 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
3105 * process.c (make_process): Initialize write_queue.
3106 (write_queue_push, write_queue_pop): New functions.
3107 (send_process): Use them to maintain correct ordering of process
3110 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
3112 * lisp.h (eassert): Assume C89 or later.
3113 This removes the need for CHECK.
3114 (CHECK): Remove. Its comments about always evaluating its
3115 argument were confusing, as 'eassert' typically does not evaluate
3118 * coding.c (produce_chars): Use ptrdiff_t, not int.
3120 * xterm.c (x_draw_underwave): Check for integer overflow.
3121 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
3123 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
3125 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
3126 referenced (Bug#11583).
3128 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
3130 Implement wave-style variant of underlining.
3131 * dispextern.h (face_underline_type): New enum.
3132 (face): Add field for underline type.
3133 * nsterm.m (ns_draw_underwave): New function.
3134 (ns_draw_text_decoration): Use it.
3135 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
3137 (x_draw_glyph_string): Use them.
3138 * xfaces.c (Qline, Qwave): New Lisp objects.
3139 (check_lface_attrs, merge_face_ref)
3140 (Finternal_set_lisp_face_attribute, realize_x_face):
3141 Handle wave-style underline face attributes.
3142 * xterm.c (x_draw_underwave): New function.
3143 (x_draw_glyph_string): Use it.
3145 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
3147 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
3148 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
3149 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
3150 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
3151 ($(BLD)/w32select.$(O)): Update dependencies.
3153 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
3155 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
3156 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
3157 * character.c (_fetch_multibyte_char_p): Remove.
3158 * alloc.c: Include "character.h" before "buffer.h".
3160 * buffer.c: Likewise.
3161 * bytecode.c: Likewise.
3162 * callint.c: Likewise.
3163 * callproc.c: Likewise.
3164 * casefiddle.c: Likewise.
3165 * casetab.c: Likewise.
3166 * category.c: Likewise.
3168 * coding.c: Likewise.
3169 * composite.c: Likewise.
3170 * dired.c: Likewise.
3171 * dispnew.c: Likewise.
3173 * dosfns.c: Likewise.
3174 * editfns.c: Likewise.
3175 * emacs.c: Likewise.
3176 * fileio.c: Likewise.
3177 * filelock.c: Likewise.
3179 * fontset.c: Likewise.
3180 * fringe.c: Likewise.
3181 * indent.c: Likewise.
3182 * insdel.c: Likewise.
3183 * intervals.c: Likewise.
3184 * keyboard.c: Likewise.
3185 * keymap.c: Likewise.
3186 * lread.c: Likewise.
3187 * macros.c: Likewise.
3188 * marker.c: Likewise.
3189 * minibuf.c: Likewise.
3190 * nsfns.m: Likewise.
3191 * nsmenu.m: Likewise.
3192 * print.c: Likewise.
3193 * process.c: Likewise.
3194 * regex.c: Likewise.
3195 * region-cache.c: Likewise.
3196 * search.c: Likewise.
3197 * syntax.c: Likewise.
3199 * textprop.c: Likewise.
3201 * unexsol.c: Likewise.
3202 * w16select.c: Likewise.
3203 * w32fns.c: Likewise.
3204 * w32menu.c: Likewise.
3205 * window.c: Likewise.
3206 * xdisp.c: Likewise.
3208 * xmenu.c: Likewise.
3210 * xselect.c: Likewise.
3212 2012-06-16 Eli Zaretskii <eliz@gnu.org>
3214 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
3215 If all the glyphs of the glyph row came from strings, and we have no
3216 cursor positioning clues, put the cursor on the first glyph of the
3218 (handle_face_prop): Use chunk-relative overlay string index when
3219 indexing into it->string_overlays array. (Bug#11653)
3220 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
3221 the rightmost. (Bug#11720)
3223 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
3225 * category.h (CHAR_HAS_CATEGORY): Define as inline.
3226 (CATEGORY_MEMBER): Enforce 1/0 value.
3227 * category.c (_temp_category_set): Remove.
3229 2012-06-16 Eli Zaretskii <eliz@gnu.org>
3231 * window.c (Fdelete_other_windows_internal)
3232 (Fdelete_window_internal): Don't access frame's mouse highlight
3233 info of the initial frame. (Bug#11677)
3235 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
3237 * .gdbinit (xgetint): Fix recently-introduced paren typo.
3238 Assume USE_2_TAGS_FOR_INTS.
3239 (xreload): Adjust $tagmask width to match recent lisp.h change.
3241 Simplify lisp.h in minor ways that should not affect code.
3242 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
3243 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
3244 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
3245 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
3246 (INTTYPEBITS): New macro, for clarity.
3247 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
3248 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
3249 Simplify now that USE_LSB_TAG is always defined.
3250 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
3251 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
3253 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
3255 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
3257 2012-06-13 Glenn Morris <rgm@gnu.org>
3259 * s/bsd-common.h (BSD4_3):
3260 * s/usg5-4-common.h (USG5_4): No longer define; unused.
3262 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
3264 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
3267 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
3269 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
3270 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
3271 * alloc.c (widen_to_Lisp_Object): Remove.
3272 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
3273 * frame.c (delete_frame): Remove outdated comment.
3274 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
3275 USE_LISP_UNION_TYPE.
3276 (Fw32_unregister_hot_key): Likewise.
3277 (Fw32_toggle_lock_key): Likewise.
3278 * w32menu.c (add_menu_item): Likewise.
3279 (w32_menu_display_help): Use XIL instead of checking
3280 USE_LISP_UNION_TYPE.
3281 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
3282 (init_heap): Likewise.
3283 * w32term.c (w32_read_socket): Update comment.
3285 2012-06-13 Glenn Morris <rgm@gnu.org>
3287 * s/usg5-4-common.h, src/s/unixware.h:
3288 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
3290 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
3292 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
3294 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
3295 * alloc.c (make_number) [!defined make_number]:
3296 Remove, as lisp.h always defines this now.
3297 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
3298 (roundup_size): Verify that it is a power of 2.
3299 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
3300 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
3301 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
3302 -DUSE_LSB_TAG=0, to override the automatically-selected default.
3303 USE_LSB_TAG now is always defined to be either 0 or 1.
3305 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
3306 code works fine either way, and efficiency is not a concern here,
3307 as the union type is for debugging, not for production.
3308 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
3309 Use an inline function on all platforms when using the union type,
3310 since this is simpler and 'static inline' can be used portably
3312 (LISP_INITIALLY_ZERO): New macro.
3313 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
3314 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
3316 2012-06-12 Glenn Morris <rgm@gnu.org>
3318 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
3320 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
3322 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
3323 Move BROKEN_SIGIO to configure.
3325 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
3326 Move NO_TERMIO to configure.
3328 2012-06-12 Chong Yidong <cyd@gnu.org>
3330 * image.c (imagemagick_load_image): Use MagickFlattenImage if
3331 MagickMergeImageLayers is undefined. Use pixel pusher loop if
3332 MagickExportImagePixels is undefined.
3334 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
3336 * image.c (imagemagick_load_image): Remove unused label.
3338 2012-06-11 Glenn Morris <rgm@gnu.org>
3340 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3341 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
3342 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
3343 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
3345 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
3347 * alloc.c (make_byte_code): New function.
3348 (Fmake_byte_code): Use it. Don't purify here.
3349 * lread.c (read1): Use it as well to avoid extra allocation.
3351 2012-06-11 Chong Yidong <cyd@gnu.org>
3353 * image.c (imagemagick_load_image): Implement transparency.
3355 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
3357 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
3358 account for preceding backslashes. (Bug#11663)
3360 2012-06-09 Chong Yidong <cyd@gnu.org>
3362 * term.c: Support italics in capable terminals (Bug#9652).
3363 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
3364 (turn_on_face): Output using TS_enter_italic_mode if available.
3365 Don't handle unused blinking and alt-charset cases.
3366 (turn_off_face): Handle italic case; discard unused tty_blinking_p
3367 and tty_alt_charset_p cases.
3368 (tty_capable_p, init_tty): Support italics.
3370 * termchar.h (struct tty_display_info): Add field for italics.
3371 Remove unused blink field.
3373 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
3376 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
3377 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
3378 tty_alt_charset_p. Add tty_italic_p.
3380 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
3382 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
3383 dbus_type_is_basic if available.
3384 (xd_extract_signed, xd_extract_unsigned): Rename from
3385 extract_signed and extract_unsigned, respectively. Adapt callers.
3387 2012-06-09 Chong Yidong <cyd@gnu.org>
3389 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
3391 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
3394 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
3396 * xdisp.c (vmessage): Treat frame message as multibyte.
3397 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
3398 would generate the diagnostic "Making \302\247 buffer-local while
3401 2012-06-08 Eli Zaretskii <eliz@gnu.org>
3403 * dispnew.c (showing_window_margins_p): Undo last change, which
3404 was done due to an inadvertent commit.
3405 (adjust_frame_glyphs_for_frame_redisplay): Do call
3406 showing_window_margins_p.
3408 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
3410 * eval.c (Fmake_var_non_special): New primitive.
3411 (syms_of_eval): Defsubr it.
3412 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
3414 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
3416 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
3417 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
3419 2012-06-08 Eli Zaretskii <eliz@gnu.org>
3421 * alloc.c (allocate_vectorlike): Fix last change.
3423 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
3425 Block-based vector allocation of small vectors.
3426 * lisp.h (struct vectorlike_header): New field `nbytes',
3427 adjust comment accordingly.
3428 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
3429 to denote vector blocks. Adjust users (live_vector_p,
3430 mark_maybe_pointer, valid_lisp_object_p) accordingly.
3431 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
3432 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
3433 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
3434 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
3435 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
3436 (roundup_size): New constant.
3437 (struct vector_block): New data type.
3438 (vector_blocks, vector_free_lists, zero_vector): New variables.
3439 (all_vectors): Rename to `large_vectors'.
3440 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
3441 (sweep_vectors): New functions.
3442 (allocate_vectorlike): Return `zero_vector' as the only vector of
3443 0 items. Allocate new vector from block if vector size is less than
3444 or equal to VBLOCK_BYTES_MAX.
3445 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
3446 (init_alloc_once): Add call to init_vectors.
3448 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
3450 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
3452 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
3454 * doprnt.c (doprnt): Truncate multibyte char correctly.
3455 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
3456 would mishandle a string argument "Xc" if X was a multibyte
3457 character of length 2: it would truncate after X's first byte
3458 rather than including all of X.
3460 2012-06-06 Chong Yidong <cyd@gnu.org>
3462 * buffer.c (word_wrap): Doc fix.
3464 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
3466 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
3468 2012-06-03 Glenn Morris <rgm@gnu.org>
3470 * xdisp.c (tool-bar-style): Doc fix.
3472 2012-06-03 Ulrich Müller <ulm@gentoo.org>
3474 * Makefile.in (PAXCTL): Define.
3475 (temacs$(EXEEXT)): Disable memory randomization for the temacs
3476 binary via PaX flags if the paxctl utility is available.
3477 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3478 Restore PaX flags to their default. (Bug#11398)
3480 2012-06-03 Chong Yidong <cyd@gnu.org>
3482 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
3485 2012-06-03 Chong Yidong <cyd@gnu.org>
3487 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
3488 (note_mode_line_or_margin_highlight): If there is no help echo,
3489 use mode-line-default-help-echo. Handle the case where the mouse
3490 position is past the end of the mode line string.
3492 * buffer.c (buffer_local_value_1): New function, split from
3493 Fbuffer_local_value; can return Qunbound.
3494 (Fbuffer_local_value): Use it.
3495 (Vmode_line_format): Docstring tweaks.
3497 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
3499 * sysdep.c (system_process_attributes): Improve comment.
3501 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
3503 * keyboard.c: Export real-this-command to Elisp.
3504 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
3505 and DEFVAR it. Update all users.
3507 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
3509 * minibuf.c (Fassoc_string): Remove duplicate declaration.
3511 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
3512 Convert pctcpu and pctmem to Lisp float properly.
3513 Let the compiler fold better, as 100.0/0x8000 is exact.
3515 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
3517 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
3520 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
3522 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
3524 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
3526 For a 'struct window', replace some Lisp_Object fields to
3527 bitfields where appropriate, remove unused fields.
3528 * window.h (struct window): Remove unused 'last_mark_x' and
3529 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
3530 change it's type from Lisp_Object to bitfield.
3531 Change type of 'force_start', 'optional_new_start',
3532 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
3533 fields from Lisp_Object to bitfield. Adjust users accordingly.
3535 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
3537 Pacify gcc -Wdouble-precision when using Xaw.
3538 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
3539 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
3540 Use 'float' consistently, rather than 'float' in most places
3541 and 'double' in a couple of places.
3543 2012-05-31 Eli Zaretskii <eliz@gnu.org>
3545 * xdisp.c (handle_stop): Detect whether we have overlay strings
3546 loaded by testing it->current.overlay_string_index to be
3547 non-negative, instead of checking whether n_overlay_strings is
3548 positive. (Bug#11587)
3550 2012-05-31 Chong Yidong <cyd@gnu.org>
3552 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
3554 * doc.c (Fsubstitute_command_keys): Doc fix.
3556 2012-05-31 Eli Zaretskii <eliz@gnu.org>
3558 * search.c (search_buffer): Remove calls to
3559 r_alloc_inhibit_buffer_relocation, as it is now called by
3560 maybe_unify_char, which was the cause of relocation of buffer text
3563 2012-05-31 Eli Zaretskii <eliz@gnu.org>
3565 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
3566 for the duration of call to load_charset, to avoid problems with
3567 callers of maybe_unify_char that access buffer text through C
3570 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
3571 decrement the inhibition flag, instead of just setting or
3574 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
3576 Remove obsolete '#define static' cruft.
3577 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
3578 This #undef was "temporary" in 2000; it is no longer needed
3579 now that '#define static' has gone away.
3580 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
3581 (gray_bitmap_bits): Remove; no longer needed.
3582 All uses replaced with definiens.
3583 * xterm.c: Include "bitmaps/gray.xbm".
3585 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
3587 Clean up __executable_start, monstartup when --enable-profiling.
3588 The following changes affect the code only when profiling.
3589 * dispnew.c (__executable_start): Rename from safe_bcopy.
3590 Define only on platforms that need it.
3591 * emacs.c: Include <sys/gmon.h> when profiling.
3592 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
3593 (__executable_start): Remove decl, since lisp.h does it now.
3594 (safe_bcopy): Remove decl; no longer has that name.
3595 (main): Coalesce #if into single bit of code, for simplicity.
3596 Cast pointers to uintptr_t, since standard libraries want integers
3598 * lisp.h (__executable_start): New decl.
3600 2012-05-31 Glenn Morris <rgm@gnu.org>
3602 * image.c (Fimagemagick_types): Doc fix.
3604 2012-05-30 Jim Meyering <meyering@redhat.com>
3606 * callproc.c (Fcall_process_region): Include directory component
3607 in mkstemp error message (Bug#11586).
3609 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
3611 * alloc.c, lisp.h (make_pure_vector): Now static.
3613 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
3615 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
3616 Move to byte-run.el.
3617 (Fautoload): Do the hash-doc more carefully.
3618 * data.c (Fdefalias): Purify definition, except for keymaps.
3619 (Qdefun): Move from eval.c.
3620 * lisp.h (Qdefun): Remove.
3621 * lread.c (read1): Tiny simplification.
3623 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
3625 Do not create empty overlays with the evaporate property (Bug#9642).
3626 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
3627 Bug#9642, but explicitly check that the buffer the overlay would
3628 be moved to is live and rearrange lines to make sure that errors
3629 will not put the overlay in an inconsistent state.
3630 (Fdelete_overlay): Cosmetics.
3632 2012-05-28 Eli Zaretskii <eliz@gnu.org>
3634 * w32term.c (my_bring_window_to_top): New function.
3635 (x_raise_frame): Use handle returned by DeferWindowPos, which
3636 could be different from the original one.
3637 Call my_bring_window_to_top instead of my_set_foreground_window.
3640 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
3641 by calling BringWindowToTop.
3643 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
3644 (WM_EMACS_END): Increase by one.
3646 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
3648 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
3649 This avoids undefined behavior that might cause the eassert
3650 to not catch an out-of-range value.
3652 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
3654 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
3655 Update dependencies.
3657 2012-05-27 Eli Zaretskii <eliz@gnu.org>
3659 * bidi.c (bidi_mirror_char): Fix last change.
3661 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
3663 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
3664 when referring to sectname field in printf format.
3666 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
3668 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
3669 Only r_alloc_inhibit_buffer_relocation needed to be added;
3670 the others were already declared.
3672 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
3673 before checking whether it's out of range. Put the check inside
3675 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
3677 2012-05-27 Ken Brown <kbrown@cornell.edu>
3679 * callproc.c (Fcall_process): Restore a line that was accidentally
3680 commented out in the 2011-02-13 change (bug#11547).
3682 2012-05-27 Eli Zaretskii <eliz@gnu.org>
3684 * lisp.h [REL_ALLOC]: Add prototypes for external functions
3685 defined on ralloc.c.
3687 * buffer.c [REL_ALLOC]: Remove prototypes of
3688 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
3689 they are now on lisp.h.
3691 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
3693 * search.c (search_buffer): Use it to inhibit relocation of buffer
3694 text while re_search_2 is doing its job, because re_search_2 is
3695 passed C pointers to buffer text. (Bug#11519)
3697 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
3700 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
3701 state after an additional call to move_it_in_display_line_to, keep
3702 the values of it->max_ascent and it->max_descent found for the
3704 (pos_visible_p): Revert the comparison against bottom_y to what it
3705 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
3708 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
3710 Fix coding-related core dumps with gcc -ftrapv.
3711 The code was computing A - B, where A and B are pointers, and B is
3712 random garbage. This can lead to core dumps on platforms that
3713 have special pointer registers, and it also leads to core dumps on
3714 x86-64 when compiled with gcc -ftrapv. The fix is to compute
3715 A - B only when B is initialized properly.
3716 * coding.c (coding_set_source, coding_set_destination): Return void.
3717 (coding_change_source, coding_change_destinations): New functions,
3718 with the old behaviors of coding_set_source and coding_set_destination.
3719 All callers that need an offset changed to use these new functions.
3721 2012-05-26 Glenn Morris <rgm@gnu.org>
3723 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
3725 2012-05-26 Eli Zaretskii <eliz@gnu.org>
3727 Extend mouse support on W32 text-mode console.
3728 * xdisp.c (draw_row_with_mouse_face):
3729 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
3731 * w32console.c: Include window.h.
3732 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
3734 (initialize_w32_display): Initialize mouse-highlight data.
3736 * w32inevt.c: Include termchar.h and window.h.
3737 (do_mouse_event): Support mouse-autoselect-window. When the mouse
3738 moves, call note_mouse_highlight. If help_echo changed, call
3739 gen_help_event to produce help-echo message in the echo area.
3740 Call clear_mouse_face if mouse_face_hidden is set in the mouse
3743 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
3745 * lread.c (read1): Simplify slightly to avoid an overflow warning
3746 with GCC 4.7.0 on x86-64.
3748 2012-05-26 Eli Zaretskii <eliz@gnu.org>
3750 * bidi.c (bidi_mirror_char): Revert last change: an int is
3751 definitely wide enough here.
3753 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3755 Fix integer width and related bugs (Bug#9874).
3756 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
3757 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
3758 (string_bytes, check_sblock, allocate_string_data):
3759 (compact_small_strings, Fmake_bool_vector, make_string)
3760 (make_unibyte_string, make_multibyte_string)
3761 (make_string_from_bytes, make_specified_string)
3762 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
3763 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
3765 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3766 (allocate_pseudovector):
3767 Use int, not EMACS_INT, where int is wide enough.
3768 (inhibit_garbage_collection, Fgarbage_collect):
3769 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3770 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
3771 int might not be wide enough.
3772 (bidi_cache_search, bidi_cache_find, bidi_init_it)
3773 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
3774 (bidi_at_paragraph_end, bidi_find_paragraph_start)
3775 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
3776 (bidi_level_of_next_char, bidi_move_to_visually_next):
3777 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3778 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
3779 (Fkill_buffer, Fset_buffer_major_mode)
3780 (advance_to_char_boundary, Fbuffer_swap_text)
3781 (Fset_buffer_multibyte, overlays_at, overlays_in)
3782 (overlay_touches_p, struct sortvec, record_overlay_string)
3783 (overlay_strings, recenter_overlay_lists)
3784 (adjust_overlays_for_insert, adjust_overlays_for_delete)
3785 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
3786 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
3787 (Foverlay_recenter, last_overlay_modification_hooks_used)
3788 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
3789 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3790 (validate_region): Omit unnecessary test for b <= e,
3791 since that's guaranteed by the previous test.
3792 (adjust_overlays_for_delete): Avoid pos + length overflow.
3793 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
3794 (report_overlay_modification):
3795 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3796 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
3797 Omit pointer cast, which isn't needed anyway, and doesn't work
3798 after the EMACS_INT -> ptrdiff_t change.
3799 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
3800 * buffer.h: Adjust decls to match defn changes elsewhere.
3801 (struct buffer_text, struct buffer):
3802 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3803 Use EMACS_INT, not int, where int might not be wide enough.
3804 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
3805 not int, to avoid needless 32-bit limit on 64-bit hosts.
3806 (exec_byte_code): Use tighter memory-full test, one that checks
3807 for alloca overflow. Don't compute the address of the object just
3808 before an array, as that's not portable. Use EMACS_INT, not
3809 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
3810 * callint.c (Fcall_interactively):
3811 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3812 * callproc.c (call_process_kill, Fcall_process):
3813 Don't assume pid_t fits into an Emacs fixnum.
3814 (call_process_cleanup, Fcall_process, child_setup):
3815 Don't assume pid_t fits into int.
3816 (call_process_cleanup, Fcall_process, delete_temp_file)
3817 (Fcall_process_region):
3818 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3819 (Fcall_process): Simplify handling of volatile integers.
3820 Use int, not EMACS_INT, where int will do.
3821 * casefiddle.c (casify_object, casify_region, operate_on_word)
3822 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
3823 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3824 (casify_object): Avoid integer overflow when overallocating buffer.
3825 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
3826 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
3827 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
3828 * category.h (CATEGORYP): Don't assume arg is nonnegative.
3829 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
3830 integers are now checked earlier. All uses replaced with XINT.
3832 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3833 For CCL_MapSingle, check that content and value are in int range.
3834 (ccl_driver, Fregister_code_conversion_map):
3835 Check that Vcode_version_map_vector is a vector.
3836 (resolve_symbol_ccl_program): Check that vector header is in range.
3837 Always copy the vector, so that we can check its contents reliably
3838 now rather than having to recheck each instruction as it's being
3839 executed. Check that vector words fit in 'int'.
3840 (ccl_get_compiled_code, Fregister_ccl_program)
3841 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
3842 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
3843 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
3844 contents are in range.
3845 (Fccl_execute_on_string): Check that status is in range.
3846 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
3847 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
3848 Accept and return EMACS_INT, not int, because callers can pass values
3850 (c_string_width, strwidth, lisp_string_width, chars_in_text)
3851 (multibyte_chars_in_text, parse_str_as_multibyte)
3852 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
3853 (str_as_unibyte, str_to_unibyte, string_count_byte8)
3854 (string_escape_byte8, Fget_byte):
3855 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3856 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
3857 avoid mishandling large integers.
3858 * character.h: Adjust decls to match defn changes elsewhere.
3859 * charset.c (load_charset_map_from_file, find_charsets_in_text)
3860 (Ffind_charset_region):
3861 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3862 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
3863 (load_charset_map_from_vector, Fdefine_charset_internal):
3864 Don't assume fixnum fits in int.
3865 (load_charset_map_from_vector, Fmap_charset_chars):
3866 Remove now-unnecessary CHECK_NATNUMs.
3867 (Fdefine_charset_internal): Check ranges here, more carefully.
3868 Don't rely on undefined behavior with signed left shift overflow.
3869 Don't assume unsigned int fits into fixnum, or that fixnum fits
3870 into unsigned int. Don't require max_code to be a valid fixnum;
3871 that's not true for gb10830 4-byte on a 32-bit host. Allow
3872 invalid_code to be a cons, for the same reason. Require code_offset
3873 to be a character. Avoid int overflow if max_char is close
3875 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
3876 this is intended anyway and avoids some undefined behavior.
3877 (load_charset_map): Pass unsigned, not int, as 2nd arg of
3878 INDEX_TO_CODE_POINT, as that's what it expects.
3879 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
3880 * charset.h (DECODE_CHAR): Return int, not unsigned;
3881 this is what was intended anyway, and it avoids undefined behavior.
3882 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
3883 integer-overflow issues.
3884 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
3885 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
3886 where the argument is EMACS_INT, and this behavior is not intended.
3887 * chartab.c (Fmake_char_table, Fset_char_table_range)
3888 (uniprop_get_decoder, uniprop_get_encoder):
3889 Don't assume fixnum fits in int.
3890 * cmds.c (move_point): New function, that does the gist of
3891 Fforward_char and Fbackward_char, but does so while checking
3892 for integer overflow more accurately.
3893 (Fforward_char, Fbackward_char): Use it.
3894 (Fforward_line, Fend_of_line, internal_self_insert)
3895 (internal_self_insert):
3896 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3897 Fix a FIXME, by checking for integer overflow when calculating
3898 target_clm and actual_clm.
3899 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
3900 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
3901 (ASSURE_DESTINATION, coding_alloc_by_realloc)
3902 (coding_alloc_by_making_gap, alloc_destination)
3903 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
3904 (encode_coding_utf_16, detect_coding_emacs_mule)
3905 (decode_coding_emacs_mule, encode_coding_emacs_mule)
3906 (detect_coding_iso_2022, decode_coding_iso_2022)
3907 (encode_invocation_designation, encode_designation_at_bol)
3908 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
3909 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
3910 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
3911 (encode_coding_ccl, encode_coding_raw_text)
3912 (detect_coding_charset, decode_coding_charset)
3913 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
3914 (produce_composition, produce_charset, produce_annotation)
3915 (decode_coding, handle_composition_annotation)
3916 (handle_charset_annotation, consume_chars, decode_coding_gap)
3917 (decode_coding_object, encode_coding_object, detect_coding_system)
3918 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
3919 (code_convert_region, code_convert_string)
3920 (Fdefine_coding_system_internal)
3921 (coding_set_source, coding_set_destination):
3922 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3923 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
3924 (Fdefine_coding_system_internal):
3925 Don't assume fixnums fit in int.
3926 (decode_coding_gap, decode_coding_object, encode_coding_object)
3927 (Fread_coding_system, Fdetect_coding_region)
3928 (Funencodable_char_position, Fcheck_coding_systems_region)
3929 (get_translation, handle_composition_annotation, consume_chars):
3930 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3931 (consume_chars): Rewrite to not calculate an address outside buffer.
3932 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
3933 Don't access memory outside of the args array.
3934 (Fdefine_coding_system_internal): Check for charset-id overflow.
3935 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
3936 result of ENCODE_CHAR.
3937 * coding.h: Adjust decls to match defn changes elsewhere.
3938 (struct coding_system):
3939 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3940 * composite.c (get_composition_id, find_composition)
3941 (run_composition_function, update_compositions)
3942 (compose_text, composition_gstring_put_cache)
3943 (composition_gstring_p, composition_gstring_width)
3944 (fill_gstring_header, fill_gstring_body, autocmp_chars)
3945 (composition_compute_stop_pos, composition_reseat_it)
3946 (composition_update_it, struct position_record)
3947 (find_automatic_composition, composition_adjust_point)
3948 (Fcomposition_get_gstring, Ffind_composition_internal):
3949 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3950 (update_compositions):
3951 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3952 * composite.h: Adjust decls to match defn changes elsewhere.
3953 (struct composition):
3954 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3955 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
3956 Do not attempt to compute the address of the object just before a
3957 buffer; this is not portable.
3959 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3960 (Faset): Use int, not EMACS_INT, where int is wide enough.
3961 (Fstring_to_number): Don't assume fixnums fit in int.
3962 (Frem): Don't assume arg is nonnegative.
3963 * dbusbind.c (xd_append_arg): Check for integers out of range.
3964 (Fdbus_call_method): Don't overflow the timeout int.
3965 (extract_signed, extract_unsigned): New functions.
3966 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
3967 (xd_get_connection_references): Return ptrdiff_t, not int.
3969 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
3970 (xd_read_message_1):
3971 Use int, not unsigned, where the dbus API uses int.
3972 (Fdbus_message_internal): Don't overflow mtype.
3973 (syms_of_dbusbind): Allocate right-sized buffer for integers.
3974 * dired.c (directory_files_internal, file_name_completion, scmp)
3975 (file_name_completion_stat):
3976 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3977 (file_name_completion): Don't overflow matchcount.
3978 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
3979 * dispextern.h: Adjust decls to match defn changes elsewhere.
3980 (struct text_pos, struct glyph, struct bidi_saved_info)
3981 (struct bidi_string_data, struct bidi_it, struct composition_it)
3983 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3984 (struct display_pos, struct composition_it, struct it):
3985 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3986 * dispnew.c (increment_matrix_positions)
3987 (increment_row_positions, mode_line_string)
3988 (marginal_area_string):
3989 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3990 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
3991 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3992 (duration_to_sec_usec): New function, to check for overflow better.
3993 (Fsleep_for, sit_for): Use it.
3994 * doc.c (get_doc_string, store_function_docstring):
3995 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3996 (get_doc_string, Fsnarf_documentation):
3997 Use int, not EMACS_INT, where int is wide enough.
3999 Use SAFE_ALLOCA, not alloca.
4000 Check for overflow when converting EMACS_INT to off_t.
4001 * doprnt.c (doprnt):
4002 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4003 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
4004 Don't assume uid_t fits into fixnum.
4005 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
4006 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
4007 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
4008 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
4009 (general_insert_function)
4010 (Finsert_char, make_buffer_string, make_buffer_string_both)
4011 (update_buffer_properties, Fbuffer_substring)
4012 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
4013 (Fsubst_char_in_region, check_translation)
4014 (Ftranslate_region_internal, save_restriction_restore, Fformat)
4015 (transpose_markers, Ftranspose_regions):
4016 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4017 (clip_to_bounds): Move to lisp.h as an inline function).
4018 (Fconstrain_to_field): Don't assume integers are nonnegative.
4019 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
4020 (Fsubst_char_in_region, Fsave_restriction):
4021 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4022 (Femacs_pid): Don't assume pid_t fits into fixnum.
4023 (lo_time): Use int, not EMACS_INT, when int suffices.
4024 (lisp_time_argument): Check for usec out of range.
4025 (Fencode_time): Don't assume fixnum fits in int.
4026 (Fuser_login_name, Fuser_full_name): Signal an error
4027 if a uid argument is out of range, rather than relying on
4029 (Fformat_time_string): Remove now-unnecessary check.
4030 lisp_time_argument checks for out-of-range usec now.
4031 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
4032 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
4033 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
4034 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
4035 (init_cmdargs, Fdump_emacs):
4036 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4037 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
4038 the bottom (typically) 32 bits of the fixnum.
4039 * eval.c (specpdl_size, call_debugger):
4040 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4041 (when_entered_debugger, Fbacktrace_debug):
4042 Don't assume fixnum can fit in int.
4043 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
4044 the object just before a buffer; this is not portable.
4045 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
4046 (grow_specpdl, unbind_to):
4047 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4048 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
4049 (grow_specpdl): Simplify allocation by using xpalloc.
4050 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
4051 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
4052 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
4053 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4054 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
4056 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4057 (Fcopy_file, non_regular_nbytes, read_non_regular)
4058 (Finsert_file_contents):
4059 Use int, not EMACS_INT, where int is wide enough.
4060 (READ_BUF_SIZE): Verify that it fits in int.
4061 (Finsert_file_contents): Check that counts are in proper range,
4062 rather than assuming fixnums fit into ptrdiff_t etc.
4063 Don't assume fixnums fit into int.
4064 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
4065 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
4066 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
4067 (string_char_to_byte, string_byte_to_char)
4068 (string_make_multibyte, string_to_multibyte)
4069 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
4070 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
4071 (substring_both, Fdelete, internal_equal, Ffillarray)
4072 (Fclear_string, mapcar1)
4073 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
4074 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
4075 (larger_vector, make_hash_table, maybe_resize_hash_table)
4076 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
4077 (Fmaphash, secure_hash):
4078 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4079 (concat): Check for string index and length overflow.
4080 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
4082 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4083 (larger_vector): New API (vec, incr_min, size_max) replaces old
4084 one (vec, new_size, init). This catches size overflow.
4085 INIT was removed because it was always Qnil.
4086 All callers changed.
4087 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
4088 the upper bound on a hash table index size.
4089 (make_hash_table, maybe_resize_hash_table): Use it.
4090 (secure_hash): Computer start_byte and end_byte only after
4091 they're known to be in ptrdiff_t range.
4092 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
4093 (Ffont_get_glyphs, Ffont_at):
4094 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4095 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
4096 (Flist_fonts, Fopen_font):
4097 Don't assume fixnum can fit in int.
4098 (check_gstring): Don't assume index can fit in int.
4099 (font_match_p): Check that fixnum is a character, not a nonnegative
4100 fixnum, since the later code needs to stuff it into an int.
4101 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
4102 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
4103 conversion overflow issues.
4104 (Fopen_font): Check for integer out of range.
4105 (Ffont_get_glyphs): Don't assume index can fit in int.
4106 * font.h: Adjust decls to match defn changes elsewhere.
4107 * fontset.c (reorder_font_vector): Redo score calculation to avoid
4109 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
4110 printmax_t, where ptrdiff_t is wide enough.
4111 (Finternal_char_font):
4112 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4113 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
4114 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
4115 (Fset_frame_position, x_set_frame_parameters)
4116 (x_set_line_spacing, x_set_border_width)
4117 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
4118 Check that fixnums are in proper range for system types.
4119 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
4120 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4121 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
4122 Use SAFE_ALLOCA_LISP, not alloca.
4123 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
4124 intptr_t is wide enough.
4125 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
4126 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
4127 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
4128 Check for fixnum out of range.
4129 * ftfont.c (ftfont_list): Don't assume index fits in int.
4130 Check that fixnums are in proper range for system types.
4131 (ftfont_shape_by_flt):
4132 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4133 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
4134 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4135 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
4136 Check that fixnums are in proper range for system types.
4137 * gnutls.h: Adjust decls to match defn changes elsewhere.
4138 * gtkutil.c (xg_dialog_run):
4139 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4140 (update_frame_tool_bar):
4141 Check that fixnums are in proper range for system types.
4142 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
4143 (lookup_image): Check that fixnums are in range for system types.
4144 * indent.c (last_known_column, last_known_column_point):
4145 (current_column_bol_cache):
4146 (skip_invisible, current_column, check_display_width):
4147 (check_display_width, scan_for_column, current_column_1)
4148 (Findent_to, Fcurrent_indentation, position_indentation)
4149 (indented_beyond_p, Fmove_to_column, compute_motion):
4150 (Fcompute_motion, Fvertical_motion):
4151 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4152 (last_known_column_modified): Use EMACS_INT, not int.
4153 (check_display_width):
4155 Check that fixnums and floats are in proper range for system types.
4156 (compute_motion): Don't assume index or fixnum fits in int.
4157 (compute_motion, Fcompute_motion):
4158 Use int, not EMACS_INT, when it is wide enough.
4159 (vmotion): Omit local var start_hpos that is always 0; that way
4160 we don't need to worry about overflow in expressions involving it.
4161 * indent.h: Adjust decls to match defn changes elsewhere.
4163 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4164 Use int, not EMACS_INT, where int is wide enough.
4165 Remove unused members ovstring_chars_done and tab_offset;
4167 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
4168 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
4169 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
4170 (make_gap, copy_text, insert, insert_and_inherit)
4171 (insert_before_markers, insert_before_markers_and_inherit)
4172 (insert_1, count_combining_before, count_combining_after)
4173 (insert_1_both, insert_from_string)
4174 (insert_from_string_before_markers, insert_from_string_1)
4175 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
4176 (adjust_after_replace, adjust_after_insert, replace_range)
4177 (replace_range_2, del_range, del_range_1, del_range_byte)
4178 (del_range_both, del_range_2, modify_region)
4179 (prepare_to_modify_buffer, signal_before_change)
4180 (signal_after_change, Fcombine_after_change_execute):
4181 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4182 * intervals.c (traverse_intervals, rotate_right, rotate_left)
4183 (balance_an_interval, split_interval_right, split_interval_left)
4184 (find_interval, next_interval, update_interval)
4185 (adjust_intervals_for_insertion, delete_node, delete_interval)
4186 (interval_deletion_adjustment, adjust_intervals_for_deletion)
4187 (static_offset_intervals, offset_intervals)
4188 (merge_interval_right, merge_interval_left, make_new_interval)
4189 (graft_intervals_into_buffer, temp_set_point_both)
4190 (temp_set_point, set_point, adjust_for_invis_intang)
4191 (set_point_both, move_if_not_intangible, get_property_and_range)
4192 (get_local_map, copy_intervals, copy_intervals_to_string)
4193 (compare_string_intervals, set_intervals_multibyte_1):
4194 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4195 * intervals.h: Adjust decls to match defn changes elsewhere.
4197 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4198 * keyboard.c (this_command_key_count, this_single_command_key_start)
4199 (before_command_key_count, before_command_echo_length, echo_now)
4200 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
4201 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
4202 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
4203 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
4204 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4205 (last_non_minibuf_size, last_point_position, echo_truncate)
4206 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
4207 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
4208 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
4209 (stuff_buffered_input):
4210 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4211 (last_auto_save, command_loop_1, read_char):
4212 Use EMACS_INT, not int, to avoid integer overflow.
4213 (record_char): Avoid overflow in total_keys computation.
4214 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
4215 * keyboard.h: Adjust decls to match defn changes elsewhere.
4216 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
4217 (Fkey_description, Fdescribe_vector, Flookup_key):
4218 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4219 (click_position): New function, to check that positions are in range.
4220 (Fcurrent_active_maps):
4222 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4223 (Faccessible_keymaps, Fkey_description):
4224 (preferred_sequence_p):
4225 Don't assume fixnum can fit into int.
4226 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
4227 Check for integer overflow in size calculations.
4228 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
4229 avoid mishandling large integers.
4230 * lisp.h: Adjust decls to match defn changes elsewhere.
4231 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
4232 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
4233 (struct Lisp_Marker):
4234 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4235 (clip_to_bounds): Now an inline function, moved here from editfns.c.
4236 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
4237 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
4238 All callers changed.
4239 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
4240 Assume the arg has valid form, since it always does.
4241 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
4242 unsigned integer system type.
4243 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
4244 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
4245 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4246 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
4247 (duration_to_sec_usec): New decl.
4248 * lread.c (read_from_string_index, read_from_string_index_byte)
4249 (read_from_string_limit, readchar, unreadchar, openp)
4250 (read_internal_start, read1, oblookup):
4251 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4252 (Fload, readevalloop, Feval_buffer, Feval_region):
4253 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4254 (openp): Check for out-of-range argument to 'access'.
4255 (read1): Use int, not EMACS_INT, where int is wide enough.
4256 Don't assume fixnum fits into int.
4257 Fix off-by-one error that can read outside a buffer.
4258 (read_filtered_event): Use duration_to_sec_usec
4259 to do proper overflow checking on durations.
4260 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
4261 in size calculation.
4262 (Fexecute_kbd_macro):
4263 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4264 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
4265 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
4266 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
4267 (set_marker_both, set_marker_restricted_both, marker_position)
4268 (marker_byte_position, Fbuffer_has_markers_at):
4269 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4270 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
4271 * menu.c (ensure_menu_items): Rename from grow_menu_items.
4272 It now merely ensures that the menu is large enough, without
4273 necessarily growing it, as this avoids some integer overflow issues.
4274 All callers changed.
4275 (keymap_panes, parse_single_submenu, Fx_popup_menu):
4276 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4277 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
4278 Use SAFE_ALLOCA_LISP, not alloca.
4279 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
4280 to EMACS_INT. Check that fixnums are in proper range for system types.
4281 * minibuf.c (minibuf_prompt_width, string_to_object)
4282 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
4283 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
4284 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4285 (get_minibuffer, read_minibuf_unwind):
4286 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4287 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
4288 this simplifies overflow checking. All callers changed.
4289 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
4291 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4292 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
4293 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
4294 Check that fixnums are in proper range for system types.
4295 (Fx_create_frame, Fx_show_tip):
4296 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4297 * nsfont.m (ns_findfonts, nsfont_list_family):
4298 Don't assume fixnum fits in long.
4299 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
4300 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4301 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
4303 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
4304 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4305 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
4306 (PRINTDECLARE, PRINTPREPARE):
4307 (strout, print_string):
4308 (print, print_preprocess, print_check_string_charset_prop)
4310 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4312 (temp_output_buffer_setup, Fprin1_to_string, print_object):
4313 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4314 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
4315 (printchar, strout): Use xpalloc to catch size calculation overflow.
4316 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
4317 (print_error_message): Use SAFE_ALLOCA, not alloca.
4318 (print_object): Use int, not EMACS_INT, where int is wide enough.
4319 (print_depth, new_backquote_output, print_number_index):
4320 Use ptrdiff_t, not int, where int might not be wide enough.
4321 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
4322 (Fset_process_window_size, Fformat_network_address)
4323 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
4325 Check that fixnums are in proper range for system types.
4326 (Fsignal_process): Simplify by avoiding a goto.
4327 Check for process-ids out of pid_t range rather than relying on
4329 (process_tick, update_tick): Use EMACS_INT, not int.
4330 (Fformat_network_address, read_process_output, send_process)
4331 (Fprocess_send_region, status_notify):
4332 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4333 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
4334 (wait_reading_process_output, read_process_output, exec_sentinel):
4335 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4336 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
4337 (Faccept_process_output): Use duration_to_sec_usec to do proper
4338 overflow checking on durations.
4339 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
4340 Don't assume pid_t fits in int.
4341 * process.h (struct Lisp_Process): Members tick and update_tick
4342 are now of type EMACS_INT, not int.
4343 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
4344 configured --with-wide-int.
4345 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
4346 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
4347 * search.c (looking_at_1, string_match_1):
4348 (fast_string_match, fast_c_string_match_ignore_case)
4349 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
4350 (scan_newline, find_before_next_newline, search_command)
4351 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
4352 (set_search_regs, wordify):
4355 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4356 (string_match_1, search_buffer, set_search_regs):
4358 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4359 (wordify): Check for overflow in size calculation.
4360 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
4361 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
4362 Check that fixnums are in proper range for system types.
4363 * sound.c (struct sound_device)
4364 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
4365 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4366 (Fplay_sound_internal):
4367 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4368 * syntax.c (struct lisp_parse_state, find_start_modiff)
4369 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
4370 (Fparse_partial_sexp):
4371 Don't assume fixnums can fit in int.
4372 (struct lisp_parse_state, find_start_pos, find_start_value)
4373 (find_start_value_byte, find_start_begv)
4374 (update_syntax_table, char_quoted, dec_bytepos)
4375 (find_defun_start, prev_char_comend_first, back_comment):
4376 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
4377 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
4378 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4379 (Finternal_describe_syntax_value): Check that match_lisp is a
4380 character, not an integer, since the code stuffs it into int.
4381 (scan_words, scan_sexps_forward):
4382 Check that fixnums are in proper range for system types.
4384 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4385 (scan_sexps_forward):
4386 Use CHARACTERP, not INTEGERP, since the value must fit into int.
4387 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
4388 * syntax.h: Adjust decls to match defn changes elsewhere.
4389 (struct gl_state_s):
4390 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4391 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
4392 MOST_POSITIVE_FIXNUM.
4393 * sysdep.c (wait_for_termination_1, wait_for_termination)
4394 (interruptible_wait_for_termination, mkdir):
4395 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
4396 (emacs_read, emacs_write):
4397 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4398 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
4399 and double all fit in int.
4400 * term.c (set_tty_color_mode):
4401 Check that fixnums are in proper range for system types.
4402 * termhooks.h (struct input_event):
4403 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4404 * textprop.c (validate_interval_range, interval_of)
4405 (Fadd_text_properties, set_text_properties_1)
4406 (Fremove_text_properties, Fremove_list_of_text_properties)
4407 (Ftext_property_any, Ftext_property_not_all)
4408 (copy_text_properties, text_property_list, extend_property_ranges)
4409 (verify_interval_modification):
4410 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4411 (Fnext_single_char_property_change)
4412 (Fprevious_single_char_property_change):
4413 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4414 (copy_text_properties):
4415 Check for integer overflow in index calculation.
4416 * undo.c (last_boundary_position, record_point, record_insert)
4417 (record_delete, record_marker_adjustment, record_change)
4418 (record_property_change):
4419 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4420 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
4421 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4422 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
4423 (Fx_hide_tip, Fx_file_dialog):
4424 * w32menu.c (set_frame_menubar):
4425 Use ptrdiff_t, not int, for consistency with rest of code.
4426 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
4427 (select_window, Fdelete_other_windows_internal)
4428 (window_scroll_pixel_based, window_scroll_line_based)
4429 (Frecenter, Fset_window_configuration):
4430 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4431 (Fset_window_hscroll, run_window_configuration_change_hook)
4432 (set_window_buffer, temp_output_buffer_show, scroll_command)
4433 (Fscroll_other_window, Frecenter):
4434 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4435 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
4436 Don't assume fixnum fits in int.
4437 (Fset_window_scroll_bars):
4438 Check that fixnums are in proper range for system types.
4439 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
4440 (string_pos, c_string_pos, number_of_chars, init_iterator)
4441 (in_ellipses_for_invisible_text_p, init_from_display_pos)
4442 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
4443 (compute_display_string_end, handle_face_prop)
4444 (face_before_or_after_it_pos, handle_invisible_prop)
4445 (handle_display_prop, handle_display_spec, handle_single_display_spec)
4446 (display_prop_intangible_p, string_buffer_position_lim)
4447 (string_buffer_position, handle_composition_prop, load_overlay_strings)
4448 (get_overlay_strings_1, get_overlay_strings)
4449 (iterate_out_of_display_property, forward_to_next_line_start)
4450 (back_to_previous_visible_line_start, reseat, reseat_to_string)
4451 (get_next_display_element, set_iterator_to_next)
4452 (get_visually_first_element, compute_stop_pos_backwards)
4453 (handle_stop_backwards, next_element_from_buffer)
4454 (move_it_in_display_line_to, move_it_in_display_line)
4455 (move_it_to, move_it_vertically_backward, move_it_by_lines)
4456 (add_to_log, message_dolog, message_log_check_duplicate)
4457 (message2, message2_nolog, message3, message3_nolog
4458 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
4459 (current_message_1, truncate_echo_area, truncate_message_1)
4460 (set_message, set_message_1, store_mode_line_noprop)
4461 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
4462 (text_outside_line_unchanged_p, check_point_in_composition)
4463 (reconsider_clip_changes)
4464 (redisplay_internal, set_cursor_from_row, try_scrolling)
4465 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
4466 (redisplay_window, find_last_unchanged_at_beg_row)
4467 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
4468 (trailing_whitespace_p, find_row_edges, display_line)
4469 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
4470 (display_mode_element, store_mode_line_string)
4471 (pint2str, pint2hrstr, decode_mode_spec)
4472 (display_count_lines, display_string, draw_glyphs)
4473 (x_produce_glyphs, x_insert_glyphs)
4474 (rows_from_pos_range, mouse_face_from_buffer_pos)
4475 (fast_find_string_pos, mouse_face_from_string_pos)
4476 (note_mode_line_or_margin_highlight, note_mouse_highlight):
4477 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4478 (safe_call, init_from_display_pos, handle_fontified_prop)
4479 (handle_single_display_spec, load_overlay_strings)
4480 (with_echo_area_buffer, setup_echo_area_for_printing)
4481 (display_echo_area, echo_area_display)
4482 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
4483 (update_tool_bar, hscroll_window_tree, redisplay_internal)
4484 (redisplay_window, dump_glyph_row, display_mode_line)
4485 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
4486 (handle_display_spec, display_prop_string_p):
4487 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4488 (handle_single_display_spec, build_desired_tool_bar_string)
4489 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
4490 (get_specified_cursor_type):
4491 Check that fixnums are in proper range for system types.
4492 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
4493 (Flookup_image_map):
4494 Don't assume fixnums fit in int.
4495 (compare_overlay_entries):
4496 Avoid mishandling comparisons due to subtraction overflow.
4497 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
4498 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
4499 (handle_tool_bar_click):
4500 Use int, not unsigned, since we prefer signed and the signedness
4501 doesn't matter here.
4502 (get_next_display_element, next_element_from_display_vector):
4503 Use int, not EMACS_INT, when int is wide enough.
4504 (start_hourglass): Use duration_to_sec_usec to do proper
4505 overflow checking on durations.
4506 * xfaces.c (Fbitmap_spec_p):
4507 Check that fixnums are in proper range for system types.
4508 (compare_fonts_by_sort_order):
4509 Avoid mishandling comparisons due to subtraction overflow.
4510 (Fx_family_fonts, realize_basic_faces):
4511 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4513 Don't assume fixnum fits in int.
4514 Use SAFE_ALLOCA_LISP, not alloca.
4515 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
4516 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
4517 (face_at_buffer_position, face_for_overlay_string)
4518 (face_at_string_position):
4519 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4520 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
4521 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
4523 Check that fixnums are in proper range for system types.
4524 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
4525 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
4526 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4527 (Fx_change_window_property): Don't assume fixnums fit in int.
4528 * xfont.c (xfont_chars_supported):
4529 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4530 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
4531 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
4532 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4533 * xml.c (parse_region):
4534 * xrdb.c (magic_file_p):
4535 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4536 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
4537 (x_get_local_selection, x_reply_selection_request)
4538 (x_handle_selection_request, wait_for_property_change):
4539 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4540 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
4541 short is wide enough.
4542 (x_send_client_event): Don't assume fixnum fits in int.
4543 * xterm.c (x_x_to_emacs_modifiers):
4544 Don't assume EMACS_INT overflows nicely into int.
4545 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
4547 (handle_one_xevent): NATNUMP can eval its arg twice.
4548 (x_connection_closed):
4549 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4550 * xterm.h: Adjust decls to match defn changes elsewhere.
4551 (struct scroll_bar): Use struct vectorlike_header
4552 rather than rolling our own approximation.
4553 (SCROLL_BAR_VEC_SIZE): Remove; not used.
4555 2012-05-25 Glenn Morris <rgm@gnu.org>
4557 * lisp.mk (lisp): Update for more files being compiled now.
4559 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
4561 * lread.c: Remove `read_pure' which makes no difference.
4562 (read_pure): Remove var.
4563 (unreadpure): Remove function.
4564 (readevalloop): Don't call read_list with -1 flag.
4565 (read1, read_vector): Don't test read_pure any more.
4566 (read_list): Simplify.
4568 * fileio.c, character.h: Minor style tweaks.
4570 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
4572 * window.h (clip_changed): Remove useless declaration.
4574 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
4576 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
4577 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
4579 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
4582 This directory predates autoconf and is no longer needed nowadays.
4583 Move its few remaining bits of functionality to where they're needed.
4584 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
4585 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
4586 * m/template.h: Remove.
4587 * Makefile.in (M_FILE): Remove. All uses removed.
4588 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
4589 * lisp.h (USE_LSB_TAG):
4590 * mem-limits.h (EXCEEDS_LISP_PTR):
4591 Use VAL_MAX, not VALBITS, in #if.
4592 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
4593 (EMACS_UINT): Define unconditionally now.
4594 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
4595 (BITS_PER_EMACS_INT): New constants, replacing
4596 what used to be in config.h, but not useful in #if.
4597 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
4598 define them any more.
4599 (VAL_MAX): New macro.
4601 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
4602 BITS_PER_EMACS_INT, in #if.
4603 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
4604 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
4605 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
4606 * s/ms-w32.h (DATA_START):
4607 Move here from removed file m/intel386.h.
4608 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
4609 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
4611 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
4613 Assume C89 or later.
4614 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
4615 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
4617 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
4618 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
4619 * textprop.c, tparam.c (NULL): Remove.
4620 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
4621 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
4622 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
4623 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
4624 * xterm.c (input_signal_count): Assume volatile works.
4626 2012-05-21 Ken Brown <kbrown@cornell.edu>
4628 * xgselect.c (xg_select): Fix first argument in call to 'select'
4631 2012-05-20 Ken Brown <kbrown@cornell.edu>
4633 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
4634 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
4636 2012-05-19 Ken Brown <kbrown@cornell.edu>
4638 * xfns.c (x_in_use): Remove `static' qualifier.
4639 * xterm.h (x_in_use): Declare.
4640 * xgselect.c: Include xterm.h.
4641 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
4642 and `display_arg' (bug#9754).
4644 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
4646 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
4648 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
4649 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
4651 2012-05-18 Eli Zaretskii <eliz@gnu.org>
4653 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
4655 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
4656 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
4658 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
4659 reference to image_cache->refcount.
4660 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
4662 2012-05-17 Juri Linkov <juri@jurta.org>
4664 * search.c (Fword_search_regexp, Fword_search_backward)
4665 (Fword_search_forward, Fword_search_backward_lax)
4666 (Fword_search_forward_lax): Move functions to isearch.el
4667 (bug#10145, bug#11381).
4669 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
4671 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
4673 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
4675 * lread.c (init_obarray): Declare Qt and Qnil as special.
4677 2012-05-14 Glenn Morris <rgm@gnu.org>
4679 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
4680 Put "libexec" before "bin", for the sake of init_callproc_1.
4682 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
4684 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
4686 * unexaix.c: Port to more-recent AIX compilers.
4687 (report_error, report_error_1, make_hdr, copy_sym)
4688 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
4689 Make arguments const char *, not char *, to avoid violations of C
4690 standard and to fix some AIX warnings reported by Gilles Pion.
4692 2012-05-14 Eli Zaretskii <eliz@gnu.org>
4694 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
4695 already have overlays loaded.
4696 (handle_single_display_spec): Before returning without displaying
4697 fringe bitmap, synchronize the bidi iterator with the main display
4698 iterator, by calling iterate_out_of_display_property.
4699 (iterate_out_of_display_property): Detect buffer iteration by
4700 testing that it->string is a Lisp string.
4701 (get_next_display_element): When the current object is exhausted,
4702 and there's something on it->stack, call set_iterator_to_next to
4703 proceed with what's on the stack, instead of returning zero.
4704 (set_iterator_to_next): If called at the end of a Lisp string,
4705 proceed to consider_string_end without incrementing string
4706 position. Don't increment display vector index past the end of
4707 the display vector. (Bug#11417)
4708 (pos_visible_p): Don't report a position visible when move_it_to
4709 stopped at the last line of window, which happens to be scanned
4710 backwards by the bidi iteration. (Bug#11464)
4712 2012-05-14 Eli Zaretskii <eliz@gnu.org>
4714 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
4715 and right-margin display specs even if the spec is invalid or we
4716 are on a TTY, and thus unable to display on the fringes.
4717 That's because the text with the property will not be displayed anyway,
4718 so we need to signal to the caller that this is a "replacing"
4719 display spec. This fixes display when the spec is invalid or we
4722 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
4724 * unexaix.c (make_hdr): Fix typo in prototype.
4725 This bug broke the build on AIX. Problem reported by Gilles Pion.
4727 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
4729 * keyboard.c (kbd_buffer_get_event): Read special events also in
4730 batch mode. (Bug#11415)
4732 2012-05-12 Glenn Morris <rgm@gnu.org>
4734 * ns.mk: Update for ns_appbindir no longer having trailing "/".
4736 2012-05-12 Eli Zaretskii <eliz@gnu.org>
4738 * lisp.mk (lisp): Add newcomment.elc.
4740 2012-05-12 Glenn Morris <rgm@gnu.org>
4742 * Makefile.in (MKDIR_P): New, set by configure.
4743 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
4745 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
4747 Remove unused function hourglass_started.
4748 * dispextern.h (hourglass_started):
4749 * w32fns.c (hourglass_started):
4750 * xdisp.c (hourglass_started): Remove.
4752 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
4754 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
4755 Update dependencies.
4757 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
4759 * xgselect.c (xg_select): Put maxfds+1 into a var.
4760 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
4762 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
4764 2012-05-10 Dave Abrahams <dave@boostpro.com>
4766 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
4767 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
4769 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
4771 * dbusbind.c (xd_registered_buses): New internal Lisp object.
4772 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
4773 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
4774 Initialize xd_registered_buses.
4776 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
4778 Untag more efficiently if USE_LSB_TAG.
4779 This is based on a proposal by YAMAMOTO Mitsuharu in
4780 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
4781 For an admittedly artificial (nth 8000 longlist) benchmark on
4782 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
4783 Emacs's overall text size by 1%.
4784 * lisp.h (XUNTAG): New macro.
4785 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
4786 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
4787 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
4788 * eval.c (Fautoload):
4789 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
4790 * frame.h (XFRAME): Use XUNTAG.
4792 Port recent dbusbind.c changes to 32-bit --with-wide-int.
4793 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
4794 Remove unportable assumptions about print widths of types like
4796 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
4797 intptr_t when converting between pointer and integer, to avoid GCC
4798 warnings about wrong width.
4800 2012-05-09 Eli Zaretskii <eliz@gnu.org>
4802 * w32proc.c (new_child): Force Windows to reserve only 64KB of
4803 stack for each reader_thread, instead of defaulting to 8MB
4804 determined by the linker. This avoids failures in creating
4805 subprocesses on Windows 7, see the discussion in this thread:
4806 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
4808 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
4810 Fix up display of the *Minibuf-0* buffer in the mini window.
4811 * keyboard.c (read_char): Don't clear the echo area if there's no
4813 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
4814 contents of *Minibuf-0*) if there's no message displayed in its stead.
4816 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
4818 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
4821 2012-05-06 Chong Yidong <cyd@gnu.org>
4823 * lisp.mk (lisp): Update.
4825 2012-05-05 Jim Meyering <meyering@redhat.com>
4827 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
4829 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
4831 * data.c (PUT_ERROR): New macro.
4832 (syms_of_data): Use it. Add new error type `user-error'.
4833 * undo.c (user_error): New function.
4834 (Fprimitive_undo): Use it.
4835 * print.c (print_error_message): Adjust print style for `user-error'.
4836 * keyboard.c (user_error): New function.
4837 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
4839 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
4841 Do not limit current-time-string to years 1000..9999.
4842 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
4843 (Fcurrent_time_string): Support any year that is supported by the
4844 underlying localtime representation. Don't use asctime, as it
4845 has undefined behavior for years outside the range -999..9999.
4847 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
4849 Fix race conditions involving setenv, gmtime, localtime, asctime.
4850 Without this fix, interrupts could mess up code that uses these
4851 nonreentrant functions, since setting TZ invalidates existing
4852 tm_zone or tzname values, and since most of these functions return
4853 pointers to static storage.
4854 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
4855 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
4856 Grow the critical sections to include not just invoking
4857 localtime/gmtime, but also accessing these functions' results
4858 including their tm_zone values if any, and any related TZ setting.
4859 (format_time_string): Last arg is now struct tm *, not struct tm **,
4860 so that the struct tm is saved in the critical section.
4861 All callers changed. Simplify allocation of initial buffer, partly
4862 motivated by the fact that memory allocation needs to be outside
4863 the critical section.
4865 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
4867 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
4868 with RESET_INTERVAL.
4870 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
4871 Remove duplicated buffer name initialization.
4873 2012-05-02 Jim Meyering <jim@meyering.net>
4875 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
4877 * xfns.c (x_window): Use xstrdup (Bug#11375).
4879 2012-05-02 Eli Zaretskii <eliz@gnu.org>
4881 * xdisp.c (pos_visible_p): If already at a newline from the
4882 display string before the 'while' loop, don't walk back the glyphs
4883 from it3.glyph_row. Solves assertion violation when the display
4884 string begins with a newline (egg.el). (Bug#11367)
4886 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
4888 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
4891 2012-05-01 Glenn Morris <rgm@gnu.org>
4893 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
4894 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
4895 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
4896 All were removed before 23.1.
4898 * dispnew.c: Remove HAVE_LIBNCURSES test;
4899 it is always true on relevant platforms.
4901 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
4902 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
4904 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
4906 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
4908 * .gdbinit (xpr): Remove checks for no longer existing misc types.
4909 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
4912 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
4914 Do not avoid creating empty evaporating overlays (Bug#9642).
4915 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
4916 That is, do not delete an evaporating overlay if it becomes
4917 empty after its bounds are adjusted to fit within its buffer.
4918 This fix caused other problems, and I'm reverting it until we get
4919 to the bottom of them.
4921 2012-04-27 Chong Yidong <cyd@gnu.org>
4923 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
4925 2012-04-27 Eli Zaretskii <eliz@gnu.org>
4927 * xdisp.c (pos_visible_p): If the window start position is beyond
4928 ZV, start the display from buffer beginning. Prevents assertion
4929 violation in init_iterator when the minibuffer window is scrolled
4932 * window.c (window_scroll_pixel_based): Likewise.
4934 2012-04-27 Chong Yidong <cyd@gnu.org>
4936 * keymap.c (where_is_internal): Doc fix (Bug#10872).
4938 2012-04-27 Glenn Morris <rgm@gnu.org>
4940 * fileio.c (Fcopy_file, Fset_file_selinux_context):
4941 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
4943 2012-04-27 Eli Zaretskii <eliz@gnu.org>
4945 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
4946 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
4948 2012-04-26 Eli Zaretskii <eliz@gnu.org>
4950 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
4951 display element, check also the underlying string or buffer
4952 character. (Bug#11341)
4954 * w32menu.c: Include w32heap.h.
4955 (add_menu_item): If the call to AppendMenuW (via
4956 unicode_append_menu) fails, disable Unicode menus only if we are
4957 running on Windows 9X/Me.
4959 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
4961 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
4962 (xgetint): Add missing shift for LSB tags.
4964 2012-04-24 Martin Rudalics <rudalics@gmx.at>
4966 * keyboard.c (read_char): Don't wipe echo area for select window
4967 events: These might get delayed via `mouse-autoselect-window'
4970 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
4972 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
4973 manipulation of :loaded-from data.
4975 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
4977 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
4978 now a cons (bug#11311).
4980 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
4982 Do not create empty overlays with the evaporate property (Bug#9642).
4983 * buffer.c (Fmove_overlay): Delete an evaporating overlay
4984 if it becomes empty after its bounds are adjusted to fit within
4985 its buffer. Without this fix, in a nonempty buffer (let ((o
4986 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
4987 yields an empty overlay that has the evaporate property, which is
4988 not supposed to happen.
4990 Fix minor GTK3 problems found by static checking.
4991 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
4992 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
4993 (struct _EmacsFixedClass, emacs_fixed_get_type):
4994 Move decls here from emacsgtkfixed.h, since they needn't be public.
4995 (emacs_fixed_get_type): Now static.
4996 (emacs_fixed_class_init): Omit unused local.
4997 (emacs_fixed_child_type): Remove; unused.
4998 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
4999 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
5000 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
5001 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
5002 (EMACS_FIXED_GET_CLASS): Remove; unused.
5003 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
5005 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
5006 Problem reported by Juanma Barranquero for Windows -Wunused-function.
5008 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
5010 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
5011 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
5012 (__malloc_size_t, __malloc_ptrdiff_t):
5013 Remove. All uses removed, replaced by the definiens if needed,
5014 since we can assume C89 or better now.
5015 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
5016 (protect_malloc_state, align, get_contiguous_space)
5017 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
5018 (malloc_atfork_handler_child, malloc_enable_thread)
5019 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
5020 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
5021 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
5022 (special_realloc, _realloc_internal_nolock, _realloc_internal)
5023 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
5024 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
5025 Define using prototypes, not old style.
5026 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
5027 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
5028 (align): Don't assume that signed integer overflow wraps around.
5029 Omit unused local var.
5030 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
5031 (_free_internal_nolock, memalign, mallochook, reallochook):
5032 Omit no-longer-needed casts.
5033 (valloc): Use getpagesize, not __getpagesize.
5034 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
5035 (struct hdr): The 'magic' member is now size_t, not unsigned long.
5037 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
5039 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
5041 Move functions from C to Lisp. Make non-blocking method calls
5042 the default. Implement further D-Bus standard interfaces.
5044 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
5045 (QCdbus_request_name_allow_replacement)
5046 (QCdbus_request_name_replace_existing)
5047 (QCdbus_request_name_do_not_queue)
5048 (QCdbus_request_name_reply_primary_owner)
5049 (QCdbus_request_name_reply_in_queue)
5050 (QCdbus_request_name_reply_exists)
5051 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
5052 (QCdbus_registered_serial, QCdbus_registered_method)
5053 (QCdbus_registered_signal): New Lisp objects.
5054 (XD_DEBUG_MESSAGE): Use sizeof.
5055 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
5056 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
5057 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
5058 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
5059 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
5060 (xd_signature, xd_append_arg): Allow float for integer types.
5061 (xd_get_connection_references): New function.
5062 (xd_get_connection_address): Rename from xd_initialize.
5063 Return cached address.
5064 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
5065 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
5067 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
5068 Return number of refcounts.
5069 (Fdbus_get_unique_name): Make stronger parameter check.
5070 (Fdbus_message_internal): New defun.
5071 (Fdbus_call_method, Fdbus_call_method_asynchronously)
5072 (Fdbus_method_return_internal, Fdbus_method_error_internal)
5073 (Fdbus_send_signal, Fdbus_register_service)
5074 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
5075 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
5076 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
5077 (Vdbus_compiled_version, Vdbus_runtime_version)
5078 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
5079 (Vdbus_message_type_method_return, Vdbus_message_type_error)
5080 (Vdbus_message_type_signal): New defvars.
5081 (Vdbus_registered_buses, Vdbus_registered_objects_table):
5084 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
5086 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
5087 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
5088 Do not assume ptrdiff_t is the same width as 'int'.
5090 * alloc.c: Handle unusual debugging option combinations.
5091 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
5092 since the two debugging options are incompatible.
5093 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
5095 (mem_init, mem_insert, mem_insert_fixup):
5096 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
5097 (NEED_MEM_INSERT): Remove; no longer needed.
5099 2012-04-22 Leo Liu <sdl.web@gmail.com>
5101 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
5103 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
5105 * sysdep.c [__FreeBSD__]: Minor cleanups.
5106 (list_system_processes, system_process_attributes) [__FreeBSD__]:
5107 Use Emacs indenting style more consistently. Avoid some casts.
5108 Use 'double' consistently rather than mixing 'float' and 'double'.
5110 2012-04-21 Eduard Wiebe <usenet@pusto.de>
5112 * sysdep.c (list_system_processes, system_process_attributes):
5113 Add implementation for FreeBSD (Bug#5243).
5115 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
5117 * lisp.mk (lisp): Update.
5119 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
5121 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
5122 It is never used otherwise.
5124 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
5126 * print.c (print_preprocess): Only check print_depth if print-circle
5128 (print_object): Check for cycles even when print-circle is nil and
5129 print-gensym is t, but only check print_depth if print-circle is nil.
5131 2012-04-20 Chong Yidong <cyd@gnu.org>
5133 * process.c (wait_reading_process_output): If EIO occurs on a pty,
5134 set the status to "failed" and ensure that sentinel is run.
5136 2012-04-20 Glenn Morris <rgm@gnu.org>
5138 * process.c (Fset_process_inherit_coding_system_flag)
5139 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
5140 (Fmake_network_process, Fmake_serial_process): Doc fix.
5142 2012-04-20 Eli Zaretskii <eliz@gnu.org>
5144 * xdisp.c (string_buffer_position_lim): Limit starting position to
5146 (set_cursor_from_row): If called for a mode-line or header-line
5147 row, return zero immediately.
5148 (try_cursor_movement): If inside continuation line, don't back up
5149 farther than the first row after the header line, if any.
5150 Don't consider the header-line row as "partially visible", even if
5151 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
5153 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
5155 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
5158 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
5159 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
5161 configure: new option --enable-gcc-warnings (Bug#11207)
5162 * Makefile.in (C_WARNINGS_SWITCH): Remove.
5163 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
5164 (ALL_CFLAGS): Use new macros rather than old.
5165 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
5166 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
5167 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
5168 -Wunused-result, -Wunused-variable. This should go away once
5169 the Emacs and Gnulib regex code is merged.
5170 (xmalloc, xrealloc): Now static.
5172 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
5174 * dired.c (Fsystem_groups): Remove unused local.
5176 2012-04-17 Glenn Morris <rgm@gnu.org>
5178 * dired.c (Fsystem_users): Doc fix.
5180 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
5182 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
5183 (syms_of_dired): Add them.
5185 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
5187 Fix minor alloc.c problems found by static checking.
5188 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
5189 New extern decls, to avoid calling undeclared functions.
5190 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
5191 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
5192 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
5193 (NEED_MEM_INSERT): New macro.
5194 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
5195 Remove one incorrect comment and fix another.
5197 Fix minor ralloc.c problems found by static checking.
5198 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
5199 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
5200 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
5201 (r_alloc_sbrk): Now static.
5203 Improve ralloc.c interface checking.
5204 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
5205 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
5206 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
5207 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
5208 [REL_ALLOC]: ... to here, to check interface.
5209 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
5210 Remove decls. This fixes an "It stinks!".
5212 * alloc.c (which_symbols): Fix alignment issue / type clash.
5214 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
5216 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
5217 (struct Lisp_Misc_Any): Likewise.
5218 (struct Lisp_Free): Likewise.
5219 * alloc.c (union aligned_Lisp_Symbol): Define.
5220 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
5221 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
5222 (union aligned_Lisp_Misc): Define.
5223 (MARKER_BLOCK_SIZE, struct marker_block): Use union
5224 aligned_Lisp_Misc instead of union Lisp_Misc.
5225 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
5227 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
5229 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
5230 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
5231 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
5232 * s/netbsd.h, s/sol2-6.h:
5233 Remove definition of GC_MARK_STACK, since the default now works.
5234 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
5235 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
5236 no longer the default.
5237 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
5239 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
5241 * lread.c (lisp_file_lexically_bound_p):
5242 Fix hang at ";-*-\n" (bug#11238).
5244 2012-04-14 Eli Zaretskii <eliz@gnu.org>
5246 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
5247 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
5249 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
5251 * nsterm.m (constrainFrameRect): Always constrain when there is only
5252 one screen (Bug#10962).
5254 2012-04-13 Ken Brown <kbrown@cornell.edu>
5256 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
5258 2012-04-13 Reuben Thomas <rrt@sc3d.org>
5260 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
5262 2012-04-11 Daniel Colascione <dancol@dancol.org>
5264 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
5265 against is gone. It's better to use vfork now so that when Cygwin
5266 gains a new, working vfork, we use it automatically (bug#10398).
5268 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
5270 * window.c (save_window_save): Obey window-point-insertion-type.
5272 2012-04-11 Glenn Morris <rgm@gnu.org>
5274 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
5276 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
5278 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
5280 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
5282 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
5283 (force_quit_count): New var.
5284 (handle_interrupt): Use it.
5286 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
5288 * w32.c (w32_delayed_load): Record the full path of the library
5289 being loaded (bug#10424).
5291 2012-04-09 Glenn Morris <rgm@gnu.org>
5293 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
5294 not just in the obarray, before snarfing them. (Bug#11036)
5296 * Makefile.in ($(leimdir)/leim-list.el):
5297 Pass EMACS rather than BUILT_EMACS.
5299 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
5301 * process.c (make_process):
5302 * process.h: Add integer `gnutls_handshakes_tried' member to
5305 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
5306 Add convenience `GNUTLS_LOG2i' macro.
5308 * gnutls.c (gnutls_log_function2i): Convenience log function.
5309 (emacs_gnutls_read): Use new log functions,
5310 `gnutls_handshakes_tried' process member, and
5311 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
5312 attempts per process (connection).
5314 2012-04-09 Chong Yidong <cyd@gnu.org>
5316 * eval.c (Fuser_variable_p, user_variable_p_eh)
5317 (lisp_indirect_variable): Functions deleted.
5318 (Fdefvar): Caller changed.
5320 * callint.c (Finteractive, Fcall_interactively):
5321 * minibuf.c (Fread_variable): Callers changed.
5323 2012-04-09 Eli Zaretskii <eliz@gnu.org>
5325 * xdisp.c (set_cursor_from_row): If the display string appears in
5326 the buffer at position that is closer to point than the position
5327 after the display string, display the cursor on the first glyph of
5328 the display string. Fixes cursor display when a 'display' text
5329 property immediately follows invisible text. (Bug#11094)
5331 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
5333 composite.c: use 'double' consistently
5334 * composite.c (get_composition_id): Use 'double' consistently
5335 instead of converting 'float' to 'double' and vice versa; this is
5336 easier to understand and avoids a GCC warning.
5338 2012-04-09 Glenn Morris <rgm@gnu.org>
5340 * Makefile.in: Generate leim-list with bootstrap-emacs, in
5341 preparation for dumping it with emacs. (Bug#4789)
5342 (leimdir): New variable.
5343 ($(leimdir)/leim-list.el): New rule.
5344 (emacs$(EXEEXT)): Depend on leim-list.el.
5346 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
5347 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
5348 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
5350 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
5352 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
5355 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
5357 * xml.c (init_libxml2_functions) [WINDOWSNT]:
5358 Remove unused local variable.
5360 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
5362 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
5363 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
5364 (mark_memory): Mark Lisp_Objects only if pointers might hide in
5365 objects, as mark_maybe_pointer will catch them otherwise.
5366 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
5367 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
5369 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
5371 Fix typo that broke non-Windows builds.
5372 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
5374 2012-04-07 Eli Zaretskii <eliz@gnu.org>
5376 Support building on MS-Windows with libxml2.
5378 * makefile.w32-in (OBJ2): Add xml.$(O).
5379 (GLOBAL_SOURCES): Add xml.c.
5380 ($(BLD)/xml.$(O)): New dependency list.
5382 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
5383 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
5384 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
5385 [!WINDOWSNT]: New macros.
5386 (init_libxml2_functions, libxml2_loaded_p): New functions.
5387 (parse_region): Call fn_xmlCheckVersion instead of using the macro
5388 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
5389 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
5390 Calls xmlCleanupParser only if libxml2 was loaded (or statically
5392 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
5393 Call init_libxml2_functions before calling libxml2 functions.
5394 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
5396 * emacs.c: Don't include libxml/parser.h.
5397 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
5398 xmlCleanupParser directly.
5400 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
5402 2012-04-07 Eli Zaretskii <eliz@gnu.org>
5404 * indent.c (Fvertical_motion): If there is a display string at
5405 point, use it.vpos to compute how many lines to backtrack after
5406 move_it_to point. (Bug#11133)
5408 2012-04-06 Eli Zaretskii <eliz@gnu.org>
5410 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
5411 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
5412 about subtle differences between FETCH_CHAR* and STRING_CHAR*
5413 macros related to unification of CJK characters. For the details,
5414 see the discussion following the message here:
5415 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
5417 2012-04-04 Chong Yidong <cyd@gnu.org>
5419 * keyboard.c (Vdelayed_warnings_list): Doc fix.
5421 2012-04-01 Eli Zaretskii <eliz@gnu.org>
5423 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
5424 instead of alloca. (Bug#11138)
5426 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
5428 * w32menu.c (is_simple_dialog): Properly check lisp types.
5431 2012-03-31 Eli Zaretskii <eliz@gnu.org>
5433 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
5434 position we get to after a call to move_it_to fails the
5435 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
5436 only if we wind up in a string from display property. (Bug#11063)
5438 * window.c (Fdelete_other_windows_internal): Invalidate the row
5439 and column information about mouse highlight, so that redisplay
5440 restores it after reallocating the glyph matrices. (Bug#7464)
5442 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
5443 string comes from a `display' text property, use the buffer
5444 position of that property as if we actually saw that position in
5446 (move_it_by_lines): Remove the assertion that
5447 "it->current_x == 0 && it->hpos == 0" which can be legitimately
5448 violated when there's a before-string at the beginning of a line.
5451 2012-03-30 Eli Zaretskii <eliz@gnu.org>
5453 * xdisp.c (append_space_for_newline): If the default face was
5454 remapped, use the remapped face for the appended newline.
5455 (extend_face_to_end_of_line): Use the remapped default face for
5456 extending the face to the end of the line.
5457 (display_line): Call extend_face_to_end_of_line when the default
5458 face was remapped. (Bug#11068)
5460 2012-03-29 Eli Zaretskii <eliz@gnu.org>
5462 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
5464 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
5466 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
5468 2012-03-27 Glenn Morris <rgm@gnu.org>
5470 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
5473 2012-03-26 Kenichi Handa <handa@m17n.org>
5475 * dispextern.h (struct glyph): Fix previous change. Change the
5476 bit length of glyphless.ch to 25 (Bug#11082).
5478 2012-03-26 Chong Yidong <cyd@gnu.org>
5480 * keyboard.c (Vselection_inhibit_update_commands): New variable.
5481 (command_loop_1): Use it; inhibit selection update for
5482 handle-select-window too (Bug#8996).
5484 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
5486 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
5488 2012-03-25 Kenichi Handa <handa@m17n.org>
5490 * dispextern.h (struct glyph): Change the bit length of
5491 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
5493 2012-03-24 Eli Zaretskii <eliz@gnu.org>
5495 * s/ms-w32.h (tzname): Include time.h before redirecting to
5496 _tzname. Fixes the MSVC build. (Bug#9960)
5498 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
5500 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
5503 * xterm.c (XTread_socket): Only modify handling_signal if
5504 !SYNC_INPUT. (Bug#11080)
5506 2012-03-23 Eli Zaretskii <eliz@gnu.org>
5508 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
5509 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
5510 when fetching a multibyte character consumes more bytes than
5511 CHAR_BYTES returns, due to unification of CJK characters in
5512 string_char. (Bug#11073)
5514 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
5516 * process.c (wait_reading_process_output): Handle pty disconnect
5517 by refraining from sending oneself a SIGCHLD (bug#10933).
5519 2012-03-22 Chong Yidong <cyd@gnu.org>
5521 * dispextern.h (struct it): New member string_from_prefix_prop_p.
5523 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
5524 Mark string as coming from a prefix property.
5525 (handle_face_prop): Use default face for prefix strings (Bug#4281).
5526 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
5528 2012-03-21 Chong Yidong <cyd@gnu.org>
5530 * xfaces.c (Vface_remapping_alist): Doc fix.
5532 2012-03-20 Eli Zaretskii <eliz@gnu.org>
5534 * w32proc.c (Fw32_set_console_codepage)
5535 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
5538 2012-03-20 Chong Yidong <cyd@gnu.org>
5540 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
5541 to reflect default non-nil value of redisplay-dont-pause.
5543 2012-03-19 Kenichi Handa <handa@m17n.org>
5545 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
5546 it fit in a valid range (Bug#11003).
5548 2012-03-18 Eli Zaretskii <eliz@gnu.org>
5550 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
5551 that is not from display property, accept the row as a "cursor
5552 row" if one of the string's character has a non-nil `cursor'
5553 property. Fixes cursor positioning when there are newlines in
5554 overlay strings, e.g. in icomplete.el. (Bug#11035)
5556 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
5558 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
5560 2012-03-12 Chong Yidong <cyd@gnu.org>
5562 * eval.c (inhibit_lisp_code): Rename from
5563 inhibit_window_configuration_change_hook; move from window.c.
5565 * xfns.c (unwind_create_frame_1, Fx_create_frame):
5566 * window.c (run_window_configuration_change_hook)
5567 (syms_of_window): Callers changed.
5569 2012-03-11 Chong Yidong <cyd@gnu.org>
5571 * keymap.c (Fkey_description): Doc fix (Bug#9700).
5573 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
5575 2012-03-10 Chong Yidong <cyd@gnu.org>
5577 * frame.c (other_visible_frames): Don't assume the selected frame
5578 is visible (Bug#10955).
5580 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
5582 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
5584 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
5586 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
5587 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
5590 2012-03-03 Glenn Morris <rgm@gnu.org>
5592 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
5594 2012-03-02 Eli Zaretskii <eliz@gnu.org>
5596 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
5597 position past the first glyph_row that ends at ZV. (Bug#10902)
5598 (redisplay_window, next_element_from_string): Fix typos in
5600 (redisplay_window): Pass to move_it_vertically the margin in
5601 pixels, not in screen lines.
5603 2012-03-02 Glenn Morris <rgm@gnu.org>
5605 * buffer.c (buffer-list-update-hook): Doc fix.
5607 2012-02-29 Eli Zaretskii <eliz@gnu.org>
5609 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
5610 push_it before setting up the iterator for the first overlay
5611 string, even if we have an empty string loaded.
5612 (next_overlay_string): If there's an empty string on the iterator
5613 stack, pop the stack. (Bug#10903)
5615 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
5617 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
5618 Suggested by Stefan Monnier in
5619 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
5620 * alloc.c (widen_to_Lisp_Object): New static function.
5621 (mark_memory): Also mark Lisp_Objects by fetching pointer words
5622 and widening them to Lisp_Objects. This would work even if
5623 USE_LSB_TAG is defined and wide integers are used, which might
5624 happen in a future version of Emacs.
5626 2012-02-25 Chong Yidong <cyd@gnu.org>
5628 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
5631 * xselect.c (Fx_selection_exists_p): Doc fix.
5632 (x_clipboard_manager_save_all): Print an informative message
5633 before saving to clipboard manager.
5635 2012-02-24 Chong Yidong <cyd@gnu.org>
5637 * keyboard.c (process_special_events): Handle all X selection
5638 requests in kbd_buffer, not just the next one (Bug#8869).
5640 2012-02-23 Chong Yidong <cyd@gnu.org>
5642 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
5643 call when setting menu-bar-lines and tool-bar-lines parameters.
5644 (unwind_create_frame_1): New helper function.
5646 * window.c (inhibit_window_configuration_change_hook): New var.
5647 (run_window_configuration_change_hook): Obey it.
5648 (syms_of_window): Initialize it.
5650 2012-02-22 Chong Yidong <cyd@gnu.org>
5652 * xterm.c (x_draw_image_relief): Add missing type check for
5653 Vtool_bar_button_margin (Bug#10743).
5655 2012-02-21 Chong Yidong <cyd@gnu.org>
5657 * fileio.c (Vfile_name_handler_alist): Doc fix.
5659 * buffer.c (Fget_file_buffer): Protect against invalid file
5660 handler return value.
5662 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
5664 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
5665 when computing $valmask.
5667 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
5668 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
5669 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
5670 It's useless in that case, and it can cause problems on hosts
5671 that allocate halves of EMACS_INT values separately.
5672 Reported by Dan Horák. Diagnosed by Andreas Schwab in
5673 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
5674 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
5675 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
5676 it avoids undefined behavior on hosts where shifting right by more
5677 than the word width has undefined behavior.
5679 2012-02-19 Chong Yidong <cyd@gnu.org>
5681 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
5682 (Funhandled_file_name_directory, Ffile_name_as_directory)
5683 (Fdirectory_file_name, Fexpand_file_name)
5684 (Fsubstitute_in_file_name): Protect against invalid file handler
5685 return values (Bug#10845).
5687 2012-02-18 Eli Zaretskii <eliz@gnu.org>
5689 * .gdbinit (pitx): Fix incorrect references to fields of the
5692 2012-02-17 Chong Yidong <cyd@gnu.org>
5694 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
5696 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
5698 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
5699 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
5701 2012-02-15 Chong Yidong <cyd@gnu.org>
5703 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
5704 marked as special. Also, starting docstrings with * is obsolete.
5706 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
5708 * gnutls.c (emacs_gnutls_write): Fix last change.
5710 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
5712 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
5715 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
5717 * keymap.c (Fsingle_key_description): Handle char ranges.
5719 2012-02-12 Chong Yidong <cyd@gnu.org>
5721 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
5722 as that creates a dangerous corner case.
5724 * window.c (Fdelete_window_internal): Invalidate the mouse
5725 highlight (Bug#9904).
5727 2012-02-12 Glenn Morris <rgm@gnu.org>
5729 * xselect.c (Fx_own_selection_internal)
5730 (Fx_get_selection_internal, Fx_disown_selection_internal)
5731 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
5732 * nsselect.m (Fx_own_selection_internal)
5733 (Fx_disown_selection_internal, Fx_selection_exists_p)
5734 (Fx_selection_owner_p, Fx_get_selection_internal):
5735 Sync docs and argument specs with the xselect.c versions.
5737 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
5739 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
5741 2012-02-11 Eli Zaretskii <eliz@gnu.org>
5743 * w32select.c (Fx_selection_exists_p): Sync doc string and
5744 argument list with xselect.c. (Bug#10783)
5746 * w16select.c (Fx_selection_exists_p): Sync doc string and
5747 argument list with xselect.c. (Bug#10783)
5749 2012-02-10 Glenn Morris <rgm@gnu.org>
5751 * fns.c (Fsecure_hash): Doc fix.
5753 2012-02-09 Kenichi Handa <handa@m17n.org>
5755 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
5757 2012-02-07 Chong Yidong <cyd@gnu.org>
5759 * buffer.c (Fbuffer_local_variables)
5760 (buffer_lisp_local_variables): Handle unbound vars correctly;
5761 don't let Qunbound leak into Lisp.
5763 2012-02-07 Glenn Morris <rgm@gnu.org>
5765 * image.c (Fimagemagick_types): Doc fix.
5767 * image.c (imagemagick-render-type): Change it from a lisp object
5768 to an integer. Move the doc here from the lisp manual.
5769 Treat all values not equal to 0 the same.
5771 2012-02-06 Chong Yidong <cyd@gnu.org>
5773 * doc.c (store_function_docstring): Avoid applying docstring of
5774 alias to base function (Bug#2603).
5776 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
5778 * .gdbinit (pp1, pv1): Remove redundant defines.
5781 2012-02-04 Chong Yidong <cyd@gnu.org>
5783 * nsterm.m: Declare a global (Bug#10694).
5785 2012-02-04 Eli Zaretskii <eliz@gnu.org>
5787 * w32.c (get_emacs_configuration_options):
5788 Include --enable-checking, if specified, in the return value.
5790 2012-02-04 Martin Rudalics <rudalics@gmx.at>
5792 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
5793 after rounding frame sizes. (Bug#9723)
5795 2012-02-04 Eli Zaretskii <eliz@gnu.org>
5797 * keyboard.c (adjust_point_for_property): Don't position point
5798 before BEGV. (Bug#10696)
5800 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
5802 Handle overflow when computing char display width (Bug#9496).
5803 * character.c (char_width): Return EMACS_INT, not int.
5804 (char_width, c_string_width): Check for overflow when
5805 computing the width; this is possible now that individual
5806 characters can have unbounded width. Problem introduced
5807 by merge from Emacs 23 on 2012-01-19.
5809 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
5811 * dbusbind.c (Fdbus_register_method): Mention the return value
5812 :ignore in the docstring.
5814 2012-02-02 Glenn Morris <rgm@gnu.org>
5816 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
5818 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
5819 Unconditionally set to t. (Bug#10673)
5820 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
5821 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
5822 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
5824 2012-02-02 Kenichi Handa <handa@m17n.org>
5826 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
5827 0, do not call append_composite_glyph.
5829 2012-02-02 Kenichi Handa <handa@m17n.org>
5831 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
5833 (x_produce_glyphs): If the component of a composition is a null
5834 string, set it->pixel_width to 1 to avoid zero-width glyph.
5836 2012-02-01 Eli Zaretskii <eliz@gnu.org>
5838 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
5839 first 2 arguments are identical. This makes inserting large
5840 output from a subprocess an order of magnitude faster on
5841 MS-Windows, where all sbrk'ed memory is always contiguous.
5843 2012-01-31 Glenn Morris <rgm@gnu.org>
5845 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
5846 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
5847 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
5849 2012-01-29 Glenn Morris <rgm@gnu.org>
5851 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
5853 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
5855 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
5857 2012-01-28 Chong Yidong <cyd@gnu.org>
5859 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
5861 2012-01-26 Chong Yidong <cyd@gnu.org>
5863 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
5865 * search.c (Fsearch_forward, Fsearch_backward): Document negative
5866 repeat counts (Bug#10507).
5868 2012-01-26 Glenn Morris <rgm@gnu.org>
5870 * lread.c (syms_of_lread): Doc fix.
5872 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
5874 * coding.c (encode_designation_at_bol): Change return value to
5877 2012-01-25 Chong Yidong <cyd@gnu.org>
5879 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
5881 2012-01-21 Chong Yidong <cyd@gnu.org>
5883 * floatfns.c (Fcopysign): Make the second argument non-optional,
5884 since nil is not allowed anyway.
5886 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
5888 * process.c (read_process_output): Use p instead of XPROCESS (proc).
5889 (send_process): Likewise.
5891 2012-01-19 Martin Rudalics <rudalics@gmx.at>
5893 * window.c (save_window_save, Fcurrent_window_configuration)
5894 (Vwindow_persistent_parameters): Do not use Qstate.
5895 Rewrite doc-strings.
5897 2012-01-19 Kenichi Handa <handa@m17n.org>
5899 * character.c (char_width): New function.
5900 (Fchar_width, c_string_width, lisp_string_width):
5901 Use char_width (Bug#9496).
5903 2012-01-16 Martin Rudalics <rudalics@gmx.at>
5905 * window.c (Vwindow_persistent_parameters): New variable.
5906 (Fset_window_configuration, save_window_save): Handle persistent
5909 2012-01-14 Eli Zaretskii <eliz@gnu.org>
5911 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
5912 thrashing the stack of the thread. (Bug#9087)
5914 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
5916 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
5918 2012-01-11 Eli Zaretskii <eliz@gnu.org>
5920 * xdisp.c (rows_from_pos_range): Handle the case where the
5921 highlight ends on a newline. (Bug#10464)
5922 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
5923 he end column for display of highlight that ends on a newline
5926 2012-01-11 Glenn Morris <rgm@gnu.org>
5928 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
5929 from load-path also when installation-directory is nil. (Bug#10208)
5931 2012-01-10 Glenn Morris <rgm@gnu.org>
5933 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
5935 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
5936 Update template values to be closer to their typical values these days.
5938 2012-01-09 Eli Zaretskii <eliz@gnu.org>
5940 * xdisp.c (rows_from_pos_range): Accept additional argument
5941 DISP_STRING, and accept any glyph in a row whose object is that
5942 string as eligible for mouse highlight. Fixes mouse highlight of
5943 display strings from overlays. (Bug#10464)
5945 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
5947 emacs: fix an auto-save permissions race condition (Bug#10400)
5948 * fileio.c (auto_saving_dir_umask): New static var.
5949 (Fmake_directory_internal): Use it.
5950 (do_auto_save_make_dir): Set it, instead of invoking chmod after
5951 creating the directory. The old code temporarily assigns
5952 too-generous permissions to the directory.
5953 (do_auto_save_eh): Clear it.
5954 (Fdo_auto_save): Catch all errors, not just file errors, so
5955 that the var is always cleared.
5957 2012-01-07 Eli Zaretskii <eliz@gnu.org>
5959 * search.c (scan_buffer): Pass character positions to
5960 know_region_cache, not byte positions. (Bug#6540)
5962 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
5964 * w32.c (sys_rename): Report EXDEV when rename of a directory
5965 fails because the target is on another logical disk. (Bug#10284)
5967 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
5969 * xterm.c (x_embed_request_focus): New function.
5971 * xterm.h: Add prototype.
5973 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
5975 2012-01-05 Glenn Morris <rgm@gnu.org>
5977 * emacs.c (emacs_copyright): Update short copyright year to 2012.
5979 2012-01-01 Eli Zaretskii <eliz@gnu.org>
5981 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
5982 Load gnutls_transport_set_lowat only if GnuTLS version is below
5984 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
5985 GnuTLS versions below 2.11.1.
5987 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
5989 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
5990 to the doc string advising against its use for altering the way
5991 windows are scrolled.
5993 2011-12-28 Kenichi Handa <handa@m17n.org>
5995 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
5996 coding-system ASCII compatible only when it does not produce BOM
5997 on encoding (Bug#10383).
5999 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
6001 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
6003 (create_and_show_popup_menu): Always use menu_position_func for
6006 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
6008 * callint.c (Fcall_interactively): Don't truncate prompt string.
6010 2011-12-23 Eli Zaretskii <eliz@gnu.org>
6012 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
6013 property that ends at ZV, so that the bidi iteration could be
6014 resumed from there (after widening). (Bug#10360)
6016 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
6018 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
6020 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
6022 * nsterm.m (x_free_frame_resources):
6023 Release f->output_data.ns->miniimage.
6024 (ns_index_color): Fix indentation. Do not retain
6025 color_table->colors[i].
6027 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
6030 * nsfns.m (x_set_background_color): Assign return value from
6031 ns_index_color to face-background instead of NSColor*.
6032 (ns_implicitly_set_icon_type): Fix indentation.
6033 Change assignment in for loop to comparison.
6035 * emacs.c (ns_pool): New variable.
6036 (main): Assign ns_pool.
6037 (Fkill_emacs): Call ns_release_autorelease_pool.
6039 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
6040 autorelease fdesc, release fdAttrs and tdict.
6041 (ns_get_covering_families): Release charset.
6042 (ns_findfonts): Release NSFontDescriptor created with new.
6043 (ns_uni_to_glyphs): Fix indentation.
6044 (setString): Release attrStr before assigning new value.
6046 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
6048 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
6050 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
6051 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
6053 2011-12-18 David Reitter <reitter@cmu.edu>
6055 * nsterm.m (ns_term_init): Subscribe for notifications
6056 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
6057 to method trackingNotification in EmacsMenu.
6059 * nsmenu.m (trackingMenu): New variable.
6060 (trackingNotification): New method (from Aquamacs).
6061 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
6062 from Aquamacs (Bug#7030).
6064 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
6066 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
6067 (symbol_to_nsstring): Fix indentation.
6068 (ns_symbol_to_pb): New function.
6069 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
6070 (Fns_rotate_cut_buffers_internal): Remove.
6071 (Fns_store_selection_internal): Rename from
6072 Fns_store_cut_buffer_internal.
6073 (ns_get_foreign_selection, Fx_own_selection_internal)
6074 (Fx_disown_selection_internal, Fx_selection_exists_p)
6075 (Fns_get_selection_internal, Fns_store_selection_internal):
6076 Use ns_symbol_to_pb and check if return value is nil.
6077 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
6078 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
6079 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
6080 renamed to Sns_store_selection_internal.
6081 (ns_handle_selection_request): Move code to Fx_own_selection_internal
6082 and remove this function.
6083 (ns_handle_selection_clear): Remove, never used.
6084 (Fx_own_selection_internal): Move code from ns_handle_selection_request
6087 2011-12-17 Ken Brown <kbrown@cornell.edu>
6089 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
6090 GID is unknown (Bug#10257).
6092 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
6094 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
6095 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
6096 which caused a build failure on GNU/Linux IA-64. This problem was
6097 introduced by my 2011-10-07 patch.
6099 2011-12-15 Juri Linkov <juri@jurta.org>
6101 * image.c (imagemagick_error): New function. (Bug#10112)
6102 (imagemagick_load_image): Comment out `MagickSetResolution' call.
6103 Use `imagemagick_error' where ImageMagick functions return
6105 (Fimagemagick_types): Add `Fnreverse' to return the list in the
6108 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6110 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
6111 fill background (Bug#8992).
6113 2011-12-13 Martin Rudalics <rudalics@gmx.at>
6115 * window.c (Vwindow_combination_resize)
6116 (Vwindow_combination_limit): Use t instead of non-nil in
6118 (Vrecenter_redisplay): Add first sentence of doc-string on
6120 (Frecenter): Fix doc-string typo.
6122 2011-12-11 Kenichi Handa <handa@m17n.org>
6124 * coding.c (Funencodable_char_position): Pay attention to the
6125 buffer text relocation (Bug#9389).
6127 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
6129 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
6130 gtk_init (Bug#10100).
6132 2011-12-10 Eli Zaretskii <eliz@gnu.org>
6134 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
6135 IT->string is nil. (Bug#10263)
6137 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
6139 * nsterm.h (x_free_frame_resources): Declare.
6141 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
6142 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
6144 * nsterm.h (ns_get_defaults_value): Declare.
6146 * nsterm.m (ns_default): Call ns_get_defaults_value.
6148 2011-12-09 Eli Zaretskii <eliz@gnu.org>
6150 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
6153 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6155 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
6156 that where the value of an _OBJC_* symbol points to is in the .bss
6157 section (Bug#10240).
6159 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
6161 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
6162 after the loop to call ccl_driver at least once (Bug#8619).
6164 2011-12-08 Kenichi Handa <handa@m17n.org>
6166 * ftfont.c (get_adstyle_property): Fix previous change
6169 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
6171 * w32.c (init_environment): If no_site_lisp, remove site-lisp
6172 dirs from the default value of EMACSLOADPATH (bug#10208).
6174 2011-12-07 Glenn Morris <rgm@gnu.org>
6176 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
6177 installation and source directories as well. (Bug#10208)
6179 2011-12-06 Chong Yidong <cyd@gnu.org>
6181 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
6183 2011-12-06 Glenn Morris <rgm@gnu.org>
6185 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
6186 as an error, not just -1. (Bug#10217)
6188 2011-12-05 Chong Yidong <cyd@gnu.org>
6190 * keyboard.c (process_special_events): New function.
6191 (swallow_events, Finput_pending_p): Use it (Bug#10195).
6193 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
6195 * coding.c (encode_designation_at_bol): Don't use uninitialized
6196 local variable (Bug#9318).
6198 2011-12-05 Kenichi Handa <handa@m17n.org>
6200 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
6201 return Qnil (Bug#8046, Bug#10193).
6203 2011-12-05 Kenichi Handa <handa@m17n.org>
6205 * coding.c (encode_designation_at_bol): New args charbuf_end and
6206 dst. Return the number of produced bytes. Callers changed.
6207 (coding_set_source): Return how many bytes coding->source was
6209 (coding_set_destination): Return how many bytes
6210 coding->destination was relocated.
6211 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
6212 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
6214 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
6216 * coding.c (CODING_CHAR_CHARSET_P): New macro.
6217 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
6220 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
6222 The following changes are to fix Bug#9318.
6224 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
6225 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
6226 (encode_coding_iso_2022, encode_coding_sjis)
6227 (encode_coding_big5, encode_coding_charset): Use the above macros.
6229 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
6231 * lisp.h (process_quit_flag): Fix external declaration.
6233 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
6235 Don't macro-inline non-performance-critical code.
6236 * eval.c (process_quit_flag): New function.
6237 * lisp.h (QUIT): Use it.
6239 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
6241 * nsfns.m (get_geometry_from_preferences): New function.
6242 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
6244 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
6246 * emacs.c (Qkill_emacs): Define.
6247 (syms_of_emacs): Initialize it.
6248 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
6249 Qquit_flag to `kill-emacs' instead.
6250 (quit_throw_to_read_char): Add parameter `from_signal'.
6251 All callers changed. Call Fkill_emacs if requested and safe.
6252 * lisp.h (QUIT): Call Fkill_emacs if requested.
6254 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
6256 * widget.c (update_wm_hints): Return if wmshell is null.
6257 (widget_update_wm_size_hints): New function.
6259 * widget.h (widget_update_wm_size_hints): Declare.
6261 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
6262 widget_update_wm_size_hints (Bug#10104).
6264 2011-12-03 Eli Zaretskii <eliz@gnu.org>
6266 * xdisp.c (handle_invisible_prop): If the invisible text ends just
6267 before a newline, prepare the bidi iterator for consuming the
6268 newline, and keep the current paragraph direction. (Bug#10183)
6269 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
6271 2011-12-02 Juri Linkov <juri@jurta.org>
6273 * search.c (Fword_search_regexp): New Lisp function created from
6274 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
6275 (Fword_search_backward, Fword_search_forward)
6276 (Fword_search_backward_lax, Fword_search_forward_lax):
6277 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
6278 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
6280 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
6282 * fileio.c (Finsert_file_contents): Move after-change-function call
6283 to before the "handled:" label, since all "goto handled" appear in
6284 cases where the *-change-functions have already been properly called
6287 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
6289 * keyboard.c (interrupt_signal): Don't call kill-emacs when
6290 waiting for input. (Bug#10169)
6292 2011-11-30 Eli Zaretskii <eliz@gnu.org>
6294 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
6295 verifies glyph row's hash code--we have just reallocated the
6296 glyphs, so their contents can be complete garbage. (Bug#10164)
6298 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
6300 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
6302 2011-11-30 Eli Zaretskii <eliz@gnu.org>
6304 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
6305 attributes are tested _before_ calling verify_row_hash, to protect
6306 against GCC re-ordering of the tests. (Bug#10164)
6308 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
6310 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
6312 * xterm.c (handle_one_xevent): Only set async_visible and friends
6313 if net_wm_state_hidden_seen is non-zero (Bug#10002)
6314 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
6315 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
6317 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
6319 Remove GCPRO-related macros that exist only to avoid shadowing locals.
6320 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
6321 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
6322 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
6323 All uses changed to use GCPRO1 etc.
6324 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
6325 Revert to old implementation (i.e., before 2011-03-11).
6327 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6329 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
6330 of scroll runs so as to avoid assigning disabled bogus rows and
6331 unnecessary graphics copy operations.
6333 2011-11-27 Eli Zaretskii <eliz@gnu.org>
6335 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
6336 (snprintf) [_MSC_VER]: Redirect to _snprintf.
6337 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
6338 (malloc, free, realloc, calloc): Redirect to e_* only when
6341 * lisp.h (GCTYPEBITS): Move before first use.
6342 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
6343 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
6344 this macro definition.
6346 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
6349 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
6351 * gtkutil.c (xg_create_frame_widgets):
6352 Call gtk_window_set_has_resize_grip (FALSE) if that function is
6353 present with Gtk+ 2.0.
6355 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
6357 * fileio.c (Finsert_file_contents): Undo previous change; see
6358 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
6360 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
6362 Rename locals to avoid shadowing.
6363 * fileio.c (Finsert_file_contents):
6364 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
6365 * process.c (wait_reading_process_output):
6366 Rename inner 'proc' to 'p' to avoid shadowing.
6367 Indent for consistency with usual Emacs style.
6369 2011-11-25 Eli Zaretskii <eliz@gnu.org>
6371 * xdisp.c (redisplay_window): If cursor row is not fully visible
6372 after recentering, and scroll-conservatively is set to a large
6373 number, scroll window by a few more lines to make the cursor fully
6374 visible and out of scroll-margin. (Bug#10105)
6375 (start_display): Don't move to the next line if the display should
6376 start at a newline that is part of a display vector or an overlay
6379 2011-11-24 Juri Linkov <juri@jurta.org>
6381 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
6382 after the `MagickPingImage' call. (Bug#10112)
6384 2011-11-23 Chong Yidong <cyd@gnu.org>
6386 * window.c (Fcoordinates_in_window_p): Accept only live windows.
6388 2011-11-23 Martin Rudalics <rudalics@gmx.at>
6390 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
6391 making another buffer current. (Bug#10114)
6393 2011-11-23 Glenn Morris <rgm@gnu.org>
6395 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
6397 2011-11-23 Chong Yidong <cyd@gnu.org>
6399 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
6400 using it (Bug#5984).
6402 2011-11-22 Eli Zaretskii <eliz@gnu.org>
6404 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
6405 and header-lines, as they don't have one computed for them.
6408 * .gdbinit (prow): Make displayed values more self-explaining.
6409 Add row's hash code.
6411 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
6413 * process.c (wait_reading_process_output): Fix asynchrounous
6414 GnuTLS socket handling on some versions of the GnuTLS library.
6415 (wait_reading_process_output): Add comment and URL.
6417 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
6419 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
6421 2011-11-21 Chong Yidong <cyd@gnu.org>
6423 * window.c (Fnext_window, Fprevious_window): Doc fix.
6425 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
6427 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
6429 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
6431 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
6433 2011-11-20 Martin Rudalics <rudalics@gmx.at>
6435 * window.c (Fset_window_combination_limit): Rename argument
6437 (Vwindow_combination_limit): Remove "status" from doc-string.
6439 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
6441 * m/ibms390.h: Remove.
6442 * m/ibms390x.h: Don't include "ibms390.h".
6444 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
6446 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
6447 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
6449 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
6451 * casetab.c (Fset_case_table):
6452 * charset.c (Fcharset_after): Fix typos.
6454 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6456 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
6457 Otherwise, valgrind does not work on some platforms.
6458 Problem reported by Andreas Schwab in
6459 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
6460 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
6461 is set, removing the need for VIRT_ADDRESS_VARIES.
6462 (PURE_P): Use a more-efficient implementation that needs just one
6463 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
6464 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
6465 to 4 (xorl, subq, cmpq, setbe).
6466 * alloc.c (pure): Always extern now, since that's the
6467 VIRT_ADDR_VARIES behavior.
6468 (PURE_POINTER_P): Use a single comparison, not two, for
6469 consistency with the new puresize.h.
6470 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
6471 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
6472 Remove VIRT_ADDR_VARIES no longer needed.
6474 2011-11-19 Eli Zaretskii <eliz@gnu.org>
6476 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
6477 (erase_phys_cursor, update_window_cursor, show_mouse_face)
6478 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
6479 behave as if the cursor position were at the window margin.
6481 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
6482 and the cursor position is out of bounds, behave as if the cursor
6483 position were at the window margin. (Bug#10075)
6485 2011-11-18 Chong Yidong <cyd@gnu.org>
6487 * window.c (Fwindow_combination_limit): Make first argument
6488 non-optional, since it is meaningless for live windows like the
6491 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
6493 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
6495 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
6497 * intervals.c: Fix grafting over the whole buffer (bug#10071).
6498 (graft_intervals_into_buffer): Simplify.
6500 2011-11-18 Eli Zaretskii <eliz@gnu.org>
6502 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
6503 hash values of the two rows.
6504 (copy_row_except_pointers): Preserve the used[] arrays and the
6505 hash values of the two rows. (Bug#10035)
6506 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
6508 * xdisp.c (row_hash): New function, body extracted from
6509 compute_line_metrics.
6510 (compute_line_metrics): Call row_hash, instead of computing the
6513 * dispnew.c (verify_row_hash): Call row_hash for computing the
6514 hash code of a row, instead of duplicating code from xdisp.c.
6516 * dispextern.h (row_hash): Add prototype.
6518 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
6520 * frame.c (delete_frame): Don't delete the terminal when the last
6521 X frame is closed if emacs is built with GTK toolkit.
6523 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
6525 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
6527 2011-11-17 Martin Rudalics <rudalics@gmx.at>
6529 * window.c (Vwindow_splits): Rename to
6530 Vwindow_combination_resize. Suggested by Juri Linkov.
6531 (Fsplit_window_internal): Use Vwindow_combination_resize instead
6534 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
6536 * nsfns.m (Fns_font_name):
6537 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
6539 2011-11-16 Martin Rudalics <rudalics@gmx.at>
6541 * window.h (window): Rename slot "nest" to "combination_limit".
6542 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
6543 (Fset_window_nest): Rename to Fset_window_combination_limit.
6544 (Vwindow_nest): Rename to Vwindow_combination_limit.
6545 (recombine_windows, make_parent_window, make_window)
6546 (Fsplit_window_internal, saved_window)
6547 (Fset_window_configuration, save_window_save): Rename all
6548 occurrences of window_nest to window_combination_limit.
6550 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
6552 * image.c (imagemagick_load_image): Fix typo.
6554 2011-11-14 Eli Zaretskii <eliz@gnu.org>
6556 * xdisp.c (display_line): Move the call to
6557 highlight_trailing_whitespace before the call to
6558 compute_line_metrics, since the latter needs to see the final
6559 faces of all the glyphs to compute ROW's hash value.
6560 Fixes assertion violations in row_equal_p. (Bug#10035)
6562 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
6564 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
6565 just return (bug#10044).
6567 2011-11-12 Eli Zaretskii <eliz@gnu.org>
6569 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
6570 with user-defined heap size. Bump the default size of the temacs
6571 heap to 27MB, to avoid memory warning when running temacs.
6572 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
6574 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
6575 current_matrix and desired_matrix. (Bug#9990)
6576 (verify_row_hash) [XASSERTS]: New function.
6577 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
6578 that the hash value of glyph rows is correct.
6580 2011-11-12 Martin Rudalics <rudalics@gmx.at>
6582 * window.h (window): Remove splits slot.
6583 * window.c (Fwindow_splits, Fset_window_splits): Remove.
6584 (Fdelete_other_windows_internal, make_parent_window)
6585 (make_window, Fsplit_window_internal, Fdelete_window_internal)
6586 (Fset_window_configuration, save_window_save): Don't deal with
6587 split status of windows.
6588 (saved_window): Remove splits slot.
6589 (Vwindow_splits): Rewrite doc-string.
6591 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
6593 * xfns.c (unwind_create_frame):
6594 * nsfns.m (unwind_create_frame):
6595 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
6596 Vframe_list (Bug#9999).
6598 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
6600 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
6602 2011-11-11 Kenichi Handa <handa@m17n.org>
6604 * callproc.c (Fcall_process): Set the member dst_multibyte of
6607 2011-11-11 Johan Bockgård <bojohan@gnu.org>
6609 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
6610 avoid a crash (bug#9496).
6612 2011-11-09 Chong Yidong <cyd@gnu.org>
6614 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
6615 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
6617 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
6619 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
6621 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
6623 Avoid some portability problems by eschewing 'extern inline' functions.
6624 The trivial performance wins aren't worth the portability hassles; see
6625 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
6627 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
6628 (window_box_width, window_box_left, window_box_left_offset)
6629 (window_box_right, window_box_right_offset): Undo previous change,
6630 by removing the "extern"s.
6631 * intervals.c (adjust_intervals_for_insertion)
6632 (adjust_intervals_for_deletion): Undo previous change,
6633 making these static again.
6634 (offset_intervals, temp_set_point_both, temp_set_point)
6635 (copy_intervals_to_string): No longer inline.
6636 * xdisp.c (window_text_bottom_y, window_box_width)
6637 (window_box_height, window_box_left_offset)
6638 (window_box_right_offset, window_box_left, window_box_right)
6639 (window_box): No longer inline.
6641 2011-11-08 Chong Yidong <cyd@gnu.org>
6643 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6644 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
6645 Signal an error if not a live window.
6646 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
6647 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
6649 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
6651 * lisp.h (syms_of_abbrev): Remove declaration.
6652 Reported by CHENG Gao <chenggao@royau.me>.
6654 2011-11-07 Eli Zaretskii <eliz@gnu.org>
6656 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
6657 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
6658 of temacs in GUI mode.
6660 2011-11-07 Martin Rudalics <rudalics@gmx.at>
6662 * window.h: Declare delete_all_child_windows instead of
6663 delete_all_subwindows.
6664 * window.c (Fwindow_nest, Fset_window_nest)
6665 (Fset_window_new_total, Fset_window_new_normal)
6666 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
6667 (delete_all_subwindows): Rename to delete_all_child_windows.
6668 (Fdelete_other_windows_internal, Fset_window_configuration):
6669 Call delete_all_child_windows instead of delete_all_subwindows.
6670 * frame.c (delete_frame): Call delete_all_child_windows instead
6671 of delete_all_subwindows.
6673 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
6675 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
6676 This is also needed for porting to any host where GC_MARK_STACK is
6677 not GC_MAKE_GCPROS_NOOPS.
6678 (which_symbols): Use it.
6680 2011-11-07 Kenichi Handa <handa@m17n.org>
6682 * coding.c (coding_set_destination): Check coding->src_pos only
6683 when coding->src_object is a buffer (bug#9910).
6685 * process.c (send_process): Set the member src_multibyte of coding
6686 to 0 (bug#9911) when sending a unibyte text.
6688 * callproc.c (Fcall_process): Set the member src_multibyte of
6689 process_coding to 0 (bug#9912).
6691 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6693 * xmenu.c (cleanup_widget_value_tree): New function.
6694 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
6695 calling free_menubar_widget_value_tree directly (Bug#9830).
6697 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
6699 Fix some portability problems with 'inline'.
6700 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
6701 (window_box_width, window_box_left, window_box_left_offset)
6702 (window_box_right, window_box_right_offset): Declare extern.
6703 Otherwise, these inline functions do not conform to C99 and
6704 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
6705 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
6706 * intervals.c (adjust_intervals_for_insertion)
6707 (adjust_intervals_for_deletion): Now extern, because otherwise the
6708 extern inline functions 'offset_intervals' couldn't refer to it.
6709 (static_offset_intervals): Remove.
6710 (offset_intervals): Rewrite using the old contents of
6711 static_offset_intervals. The old version didn't conform to C99
6712 because an extern inline function contained a reference to an
6713 identifier with static linkage.
6715 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
6717 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
6720 2011-11-06 Eli Zaretskii <eliz@gnu.org>
6722 * xdisp.c (init_iterator, reseat_to_string): Don't set the
6723 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
6724 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
6725 return Qleft_to_right.
6727 2011-11-06 Chong Yidong <cyd@gnu.org>
6729 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
6730 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
6731 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
6732 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
6733 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
6734 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
6735 (Fwindow_vscroll): Doc fix.
6736 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
6737 argument, since it makes no sense to pass a live window and for
6738 consistency with window-child.
6740 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
6742 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
6745 2011-11-05 Jason Rumney <jasonr@gnu.org>
6747 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
6748 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
6750 (add_font_entity_to_list): Fix logic errors in mixed boolean and
6751 bitwise arithmetic preventing use of unicode-sip and non-truetype
6754 2011-11-05 Eli Zaretskii <eliz@gnu.org>
6756 * s/ms-w32.h (fstat, stat, utime): Move redirections to
6759 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
6760 initialization code to keep similarity to xfns.c after changes
6763 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
6765 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
6766 (unwind_create_frame): New function (Bug#9943).
6767 (Fx_create_frame): Restructure code to be more similar to the one in
6768 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
6769 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
6770 Move terminal->reference_count++ just before making the frame official
6773 * nsterm.m (x_free_frame_resources): New function.
6774 (x_destroy_window): Move code to x_free_frame_resources.
6776 * xfns.c (unwind_create_frame): Fix comment.
6777 (Fx_create_frame, x_create_tip_frame):
6778 Move terminal->reference_count++ just before making the frame
6779 official. Move initialization of image_cache_refcount and
6780 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
6782 2011-11-05 Eli Zaretskii <eliz@gnu.org>
6784 Support MSVC build with newer versions of Visual Studio.
6785 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
6786 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
6789 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
6790 which are not supported by MSVC.
6791 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
6792 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
6794 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
6796 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
6798 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
6800 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
6802 Support MSVC build with newer versions of Visual Studio.
6803 * w32.c: Don't include w32api.h for MSVC.
6804 (init_environment) [_MSC_VER]: Call sys_access, not _access.
6806 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
6807 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
6808 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
6809 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
6811 (alloca) [_MSC_VER]: Define to _alloca.
6813 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
6815 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
6817 2011-11-04 Eli Zaretskii <eliz@gnu.org>
6819 * xdisp.c (note_mouse_highlight): If either of
6820 previous/next-single-property-change returns nil, treat that as
6821 the beginning or the end of the buffer. (Bug#9955)
6823 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
6825 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
6826 label is not null (Bug#9951).
6827 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
6830 2011-11-04 Eli Zaretskii <eliz@gnu.org>
6832 * window.c (Fwindow_body_size): Mention in the doc string that the
6833 return value is in frame's canonical units. (Bug#9949)
6835 2011-11-03 Eli Zaretskii <eliz@gnu.org>
6837 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
6839 * w32fns.c (unwind_create_frame): If needed, free the glyph
6840 matrices of the partially constructed frame. (Bug#9943)
6841 * xfns.c (unwind_create_frame): Likewise.
6843 2011-11-01 Eli Zaretskii <eliz@gnu.org>
6845 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
6846 Don't stop backward scan on the continuation glyph, even though
6847 its CHARPOS is positive.
6848 (mouse_face_from_buffer_pos, note_mouse_highlight):
6849 Rename cover_string to disp_string.
6851 2011-11-01 Martin Rudalics <rudalics@gmx.at>
6853 * window.c (temp_output_buffer_show): Don't use
6854 Vtemp_buffer_show_specifiers.
6855 (Vtemp_buffer_show_specifiers): Remove unused variable.
6857 2011-10-30 Eli Zaretskii <eliz@gnu.org>
6859 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
6860 past the beginning of the current glyph matrix.
6862 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6864 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
6865 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
6866 HAVE_GTK3 (Bug#9869).
6868 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
6869 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
6871 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
6873 * xterm.c: Declare x_handle_net_wm_state to return int.
6874 (handle_one_xevent): Check if we are iconified but don't have
6875 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
6876 (get_current_wm_state): Return non-zero if not hidden,
6877 check for _NET_WM_STATE_HIDDEN (Bug#9893).
6878 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
6879 (x_handle_net_wm_state): Return what get_current_wm_state returns.
6880 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
6882 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
6884 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
6885 so that this new function doesn't get optimized away by a
6886 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
6888 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
6890 * frame.h (MOUSE_HL_INFO): Remove excess parens.
6892 2011-10-29 Eli Zaretskii <eliz@gnu.org>
6894 Fix the `xbytecode' command.
6895 * .gdbinit (xprintbytestr): New command.
6896 (xwhichsymbols): Rename from `which'; all callers changed.
6897 (xbytecode): Print the byte-code string as well.
6899 2011-10-29 Kim Storm <storm@cua.dk>
6901 * alloc.c (which_symbols): New function.
6903 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
6905 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
6908 2011-10-29 Glenn Morris <rgm@gnu.org>
6910 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
6911 Not clear what it was for, and it causes various bugs. (Bug#9839)
6913 2011-10-28 Eli Zaretskii <eliz@gnu.org>
6915 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
6916 possible random value that matches one of those tested as
6917 condition to clear the mouse face.
6919 2011-10-28 Chong Yidong <cyd@gnu.org>
6921 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
6923 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
6925 * window.c (make_window): Initialize phys_cursor_on_p.
6927 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
6929 * lisp.h (struct Lisp_Symbol): Update comments.
6931 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
6933 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
6935 2011-10-28 Eli Zaretskii <eliz@gnu.org>
6937 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
6938 <oslsachem@gmail.com> for helping to debug this.
6940 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
6941 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
6942 (g_b_init_get_glyph_outline_w): New static variables.
6943 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
6944 (GetGlyphOutlineW_Proc): New typedefs.
6945 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
6946 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
6948 (w32font_open_internal, compute_metrics):
6949 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
6950 instead of calling the "wide" APIs directly.
6952 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
6954 * w32.h (syms_of_w32font): Add prototype.
6956 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
6958 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
6959 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
6960 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
6961 (Fmove_to_window_line): Doc fix.
6963 2011-10-27 Chong Yidong <cyd@gnu.org>
6965 * process.c (make_process): Set gnutls_state to NULL.
6967 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
6968 non-NULL, regardless of GNUTLS_INITSTAGE.
6969 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
6970 an error. Set process slots as soon as we allocate them.
6972 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
6974 2011-10-27 Chong Yidong <cyd@gnu.org>
6976 * gnutls.c (emacs_gnutls_deinit): New function.
6977 Deallocate credentials structures as well as calling gnutls_deinit.
6978 (Fgnutls_deinit, Fgnutls_boot): Use it.
6980 * process.c (make_process): Initialize GnuTLS credentials to NULL.
6981 (deactivate_process): Call emacs_gnutls_deinit.
6983 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
6985 * image.c (x_create_x_image_and_pixmap):
6986 * w32.c (sys_rename, w32_delayed_load):
6987 * w32font.c (fill_in_logfont):
6988 * w32reg.c (x_get_string_resource): Silence compiler warnings.
6990 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
6992 * w32fns.c (w32_default_color_map): New function,
6993 extracted from Fw32_default_color_map.
6994 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
6996 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
6998 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
7000 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
7002 * keyboard.c (test_undefined): New function (bug#9751).
7003 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
7005 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
7007 * sysdep.c (init_sys_modes): Fix the check for the controlling
7008 terminal (Bug#6649).
7010 2011-10-20 Eli Zaretskii <eliz@gnu.org>
7012 * dispextern.h (struct bidi_it): New member next_en_type.
7014 * bidi.c (bidi_line_init): Initialize the next_en_type member.
7015 (bidi_resolve_explicit_1): When next_en_pos is valid for the
7016 current character, check also for next_en_type being WEAK_EN.
7017 (bidi_resolve_weak): Don't enter the expensive loop if the current
7018 position is before next_en_pos. Record the bidi type of the first
7019 non-ET, non-BN character we find, in addition to its position.
7020 (bidi_level_of_next_char): Invalidate next_en_type when
7021 next_en_pos is over-stepped.
7023 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
7025 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
7026 * editfns.c: Rewrite current-time-zone so that it invokes
7027 the equivalent of (format-time-string "%Z") to get the time zone name.
7028 This fixes a bug when the time zone name contains characters that
7029 need converting from the system time locale to Emacs internal format.
7030 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
7031 that patch fixed format-time-string to do the conversion, but
7032 I forgot to fix current-time-zone.
7033 (format_time_string): New function, containing most of
7034 what Fformat_time_string used to contain.
7035 (Fformat_time_string): Rewrite in terms of format_time_string.
7036 This doesn't change this function's behavior.
7037 (current-time-zone): Rewrite to use format_time_string.
7038 This fixes the bug reported by Michael Schierl in
7039 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
7040 Jason Rumney's 2007-06-07 change worked around this bug, but
7042 * systime.h (tzname, timezone): Remove no-longer-used declarations.
7044 2011-10-19 Eli Zaretskii <eliz@gnu.org>
7046 * xdisp.c (start_display): If the character at POS is displayed
7047 via a display vector, reset IT->current.dpvec_index to zero.
7048 (try_window_reusing_current_matrix): If a line ends in a display
7049 vector or the next line starts in a display vector, continue
7050 redrawing the window even though the character position of
7051 start_row was reached.
7054 2011-10-18 Chong Yidong <cyd@gnu.org>
7056 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
7057 with nobreak-char-display too.
7059 2011-10-18 Eli Zaretskii <eliz@gnu.org>
7061 Fix part 3 of bug#9771.
7062 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
7063 (bidi_resolve_neutral): Don't enter the expensive loop looking for
7064 non-neutral characters if the current character is a paragraph
7065 separator (a.k.a. Newline). This avoids running the same
7066 expensive loop twice, once when we consume the preceding newline
7067 and the other time when the line actually needs to be displayed.
7068 Avoid the loop when we see neutrals on the base embedding level
7069 following a character whose directionality is the same as the
7070 paragraph's. This avoids running the expensive loop when a line
7071 ends in a long sequence of neutrals, like control characters.
7072 Add assertion against STRONG_AL type. Slightly rearrange code
7073 that determines the type of a neutral given the first non-neutral
7075 (bidi_level_of_next_char): Set next_en_pos to zero when
7076 invalidating its info.
7078 2011-10-17 Eli Zaretskii <eliz@gnu.org>
7080 * xdisp.c (push_display_prop): Determine whether to record string
7081 or buffer position by IT->string, not by IT->method. Allow
7082 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
7083 (move_it_vertically_backward): Don't look for character position
7084 immediately after the newline when in a continuation line.
7087 2011-10-15 Martin Rudalics <rudalics@gmx.at>
7089 * window.c (coordinates_in_window): Rewrite and delabelize
7090 vertical border check. (Bug#5357) (Bug#9618)
7092 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
7094 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
7095 errors in XSetWindowBorder (bug#9310).
7097 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
7099 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
7100 avoid crash when xmalloc overrun checking is enabled.
7102 2011-10-13 Eli Zaretskii <eliz@gnu.org>
7104 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
7105 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
7106 cursor motion with <left> and <right> arrow keys.
7108 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
7109 some callers set that themselves.
7111 2011-10-12 Eli Zaretskii <eliz@gnu.org>
7113 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
7114 display string and the previous row comes from the same string and
7115 is empty. (Bug#9739) (Bug#9738)
7117 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
7119 * doc.c (get_doc_string): Encode file name (bug#9735).
7121 2011-10-12 Eli Zaretskii <eliz@gnu.org>
7123 * bidi.c (bidi_level_of_next_char):
7124 * xdisp.c (get_visually_first_element): Remove old incorrect
7125 comments regarding the Unicode Line Separator character.
7127 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
7129 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
7131 * alloc.c (Fgc_status): Do not access beyond zombies array
7132 boundary if nzombies > MAX_ZOMBIES.
7133 * alloc.c (dump_zombies): Add missing format specifier.
7135 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
7137 * xdisp.c (set_cursor_from_row): Simplify conditionals,
7138 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
7140 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
7141 Some packages use them to denote characters with modifiers.
7143 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
7145 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
7146 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
7147 matching a pp-number. Rename parameter var to var1.
7149 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
7151 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
7153 2011-10-08 Glenn Morris <rgm@gnu.org>
7155 * callint.c (Fcall_interactively): Give a more explicit error for the
7156 'c' case with a non-character input. (Bug#8479)
7158 2011-10-08 Eli Zaretskii <eliz@gnu.org>
7160 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
7162 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
7163 lines that are hscrolled on the left.
7165 * dispnew.c (buffer_posn_from_coords): Account for a possible
7166 presence of header-line. (Bug#4426)
7168 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
7170 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
7171 Don't advertise functionality which we discourage or doesn't work.
7173 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
7175 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
7176 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
7177 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
7178 this makes Emacs dump core during garbage collection on rare
7179 occasions. sizeof is obviously inferior to offsetof here, so
7180 stick with offsetof.
7181 (GC_POINTER_ALIGNMENT): New macro.
7182 (mark_memory): Omit 3rd (offset) arg; caller changed.
7183 Don't assume EMACS_INT alignment is the same as pointer alignment.
7185 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
7187 * keyboard.c (read_key_sequence_remapped): New var.
7188 (read_key_sequence): Compute remapping in the right buffer.
7189 (command_loop_1): Use read_key_sequence's remapping directly.
7191 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
7193 * dired.c (file_name_completion): Don't expand file name.
7194 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
7195 before checking file name handler.
7197 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
7198 they've been requested explicitly (bug#9591).
7200 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
7202 * keymap.c (Fsingle_key_description): Use make_specified_string
7203 instead of build_string to build string from push_key_description.
7206 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
7208 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
7209 This fixes a Y2038 bug on 64-bit hosts.
7210 * buffer.c (reset_buffer):
7211 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
7212 (Fclear_buffer_auto_save_failure):
7213 Use 0, not -1, to represent an unset failure time, since time_t
7214 might not be signed.
7216 Remove dependency on glibc malloc internals.
7217 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
7218 Move back here from lisp.h, but with their new implementations.
7219 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
7220 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
7221 * charset.c (charset_table_init): New static var.
7222 (syms_of_charset): Use it instead of xmalloc. This removes a
7223 dependency on glibc malloc internals. See Eli Zaretskii's comment in
7224 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
7225 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
7226 Move back to alloc.c.
7227 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
7228 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
7230 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
7232 * nsterm.m (windowDidResize): Call x_set_window_size only when
7233 ns_in_resize is true. Otherwise set pixelwidth/height and
7234 call change_frame_size (Bug#9628).
7236 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
7238 Port --enable-checking=all to Fedora 14 x86-64.
7239 * charset.c (syms_of_charset): Also account for glibc malloc's
7240 internal overhead when calculating the initial malloc maximum.
7242 Port --enable-checking=all to Fedora 14 x86.
7243 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
7245 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
7246 (overrun_check_realloc, overrun_check_free):
7247 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
7248 That way, xmalloc returns a properly-aligned pointer even if
7249 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
7250 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
7251 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
7252 into account when calculating the initial malloc maximum.
7253 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
7254 Move here from alloc.c, so that charset.c can use it too.
7255 Properly align; the old code wasn't right for common 32-bit hosts
7256 when configured with --enable-checking=all.
7257 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
7258 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
7260 2011-09-29 Eli Zaretskii <eliz@gnu.org>
7262 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
7265 2011-09-28 Eli Zaretskii <eliz@gnu.org>
7267 * xdisp.c (compute_display_string_end): If there's no display
7268 string at CHARPOS, return -1.
7270 * bidi.c (bidi_fetch_char): When compute_display_string_end
7271 returns a negative value, treat the character as a normal
7272 character not covered by a display string. (Bug#9624)
7274 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
7276 * lread.c (Fread_from_string): Fix typo in docstring.
7278 2011-09-27 Eli Zaretskii <eliz@gnu.org>
7280 * xdisp.c (handle_invisible_prop): If invisible text ends on a
7281 newline, reseat the iterator instead of bidi-iterating there one
7282 character at a time. (Bug#9610)
7283 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
7284 TO_CHARPOS if the bidi iterator is at base embedding level.
7286 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
7288 * lread.c (readevalloop): Use correct code for NBSP.
7289 (read1): Likewise. (Bug#9608)
7291 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
7293 * dbusbind.c (Fdbus_register_signal): When service is not
7294 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
7296 2011-09-25 Glenn Morris <rgm@gnu.org>
7298 * buffer.c (truncate-lines): Doc fix.
7300 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
7302 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
7303 (Fset_window_next_buffers): Doc fix.
7305 2011-09-24 Glenn Morris <rgm@gnu.org>
7307 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
7309 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
7311 Fix minor problems found by static checking.
7312 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
7313 * indent.c (Fvertical_motion): Fix == vs = typo.
7315 2011-09-24 Eli Zaretskii <eliz@gnu.org>
7317 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
7318 Default value is now t. Doc fix.
7320 * indent.c (Fvertical_motion): Compute and apply the overshoot
7321 logic when moving up, not only when moving down. Fix the
7322 confusing name and values of the it_overshoot_expected variable;
7323 logic changes accordingly. (Bug#9254) (Bug#9549)
7325 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
7326 CHARPOS is covered by a display string which includes newlines.
7327 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
7328 is covered by a display string with embedded newlines.
7330 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
7332 * dbusbind.c (Fdbus_register_signal): Add match rule to
7333 Vdbus_registered_objects_table. (Bug#9581)
7334 (Fdbus_register_method, Vdbus_registered_objects_table):
7337 2011-09-24 Jim Meyering <meyering@redhat.com>
7339 do not ignore write error for any output size
7340 The previous change was incomplete.
7341 While it makes emacs --batch detect the vast majority of stdout
7342 write failures, errors were still ignored whenever the output size is
7343 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
7344 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
7345 && echo FAIL: ignored write error
7346 FAIL: ignored write error
7347 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
7348 && echo FAIL: ignored write error
7349 FAIL: ignored write error
7350 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
7352 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
7354 * emacs.c (Fkill_emacs): In noninteractive mode exit
7355 non-successfully if a write error occurred on stdout. (Bug#9574)
7357 2011-09-21 Eli Zaretskii <eliz@gnu.org>
7359 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
7362 * dispextern.h (struct it): Update the comment documenting what
7365 2011-09-20 Eli Zaretskii <eliz@gnu.org>
7367 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
7368 a display string, extend search for cursor position to end of row.
7369 (find_row_edges): If the row ends in a newline from a display
7370 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
7371 Handle the case of a display string with multiple newlines.
7372 (Fcurrent_bidi_paragraph_direction): Fix search for previous
7373 non-empty line. Fixes confusing cursor motion with arrow keys at
7374 the beginning of a line that starts with whitespace.
7376 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
7378 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
7381 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
7383 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
7386 2011-09-18 Eli Zaretskii <eliz@gnu.org>
7388 * xdisp.c (display_line): Record maximum and minimum buffer
7389 positions even if no glyphs were produced (e.g., by a zero-width
7390 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
7391 buffer positions that will be removed from the glyph row because
7393 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
7394 column is beyond frame width: don't subtract 1 "pixel" when
7395 computing width of the stretch.
7396 (reseat_at_next_visible_line_start): Undo the change made on
7397 2011-09-17 that saved paragraph information and restored it after
7398 the call to `reseat'. (Bug#9545)
7400 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7402 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
7403 and turn window cursor on if cleared (Bug#9415).
7405 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
7407 * search.c (boyer_moore): Take unibyte characters from pattern
7408 literally. (Bug#9458)
7410 2011-09-18 Eli Zaretskii <eliz@gnu.org>
7412 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
7414 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
7416 Fix minor problem found by static checking.
7417 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
7418 initialized, to pacify gcc -Wuninitialized.
7420 * fileio.c: Report proper errno when syscall falls.
7421 (Finsert_file_contents): Save and restore errno,
7422 so that report_file_error outputs the correct diagnostic.
7423 (Fwrite_region) [CLASH_DETECTION]: Likewise.
7425 2011-09-18 Eli Zaretskii <eliz@gnu.org>
7427 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
7429 2011-09-17 Eli Zaretskii <eliz@gnu.org>
7431 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
7432 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
7434 2011-09-17 Eli Zaretskii <eliz@gnu.org>
7436 * xdisp.c (reseat_at_next_visible_line_start): Keep information
7437 about the current paragraph and restore it after the call to reseat.
7439 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
7440 (bidi_find_paragraph_start): Search back for paragraph beginning
7441 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
7442 (bidi_move_to_visually_next): Only trigger paragraph-related
7443 computations when the last character is a newline or at EOB, not
7444 just any NEUTRAL_B. (Bug#9470)
7446 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
7447 truncated lines if point is covered by a display string. (Bug#9524)
7449 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
7451 * xselect.c: Relax test for outgoing X longs (Bug#9498).
7452 (cons_to_x_long): New function.
7453 (lisp_data_to_selection_data): Use it. Correct the test for
7454 short-versus-long data; it was negated. Break out of vector
7455 loop, for efficiency, when a long datum is discovered.
7457 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
7459 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
7461 2011-09-16 Eli Zaretskii <eliz@gnu.org>
7463 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
7464 GCC PR/17406) by declaring this function with external scope.
7466 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
7468 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
7469 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
7471 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
7473 * editfns.c (Fformat): Correctly handle text properties on "%%".
7475 2011-09-15 Eli Zaretskii <eliz@gnu.org>
7477 * xterm.c (x_draw_composite_glyph_string_foreground):
7478 * w32term.c (x_draw_composite_glyph_string_foreground):
7479 * term.c (encode_terminal_code):
7480 * composite.c (composition_update_it, get_composition_id):
7481 * xdisp.c (get_next_display_element)
7482 (fill_composite_glyph_string): Add comments about special meaning
7483 of TAB characters in a composition.
7485 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
7487 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
7488 This occurs when processing a multibyte format.
7489 Problem reported by Wolfgang Jenker.
7491 2011-09-15 Johan Bockgård <bojohan@gnu.org>
7493 * xdisp.c (try_cursor_movement): Only check for exact match if
7494 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
7496 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
7498 Remove unused external symbols.
7499 * dispextern.h (calc_pixel_width_or_height): Remove decl.
7500 * xdisp.c (calc_pixel_width_or_height): Now static.
7501 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
7502 * indent.c (check_display_width):
7503 * w32term.c: Fix comment to match code.
7504 * xterm.c, xterm.h (x_catching_errors): Remove.
7506 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
7508 * xselect.c: Use signed conversions more consistently (Bug#9498).
7509 (selection_data_to_lisp_data): Assume incoming selection data are
7510 signed integers, not unsigned. This is to be consistent with
7511 outgoing selection data, which was modified to use signed integers
7512 in as part of the fix to Bug#9196 in response to Jan D.'s comment
7513 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
7514 expects long, not unsigned long.
7516 2011-09-14 Eli Zaretskii <eliz@gnu.org>
7518 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
7519 computation of loop end. Reported by Johan Bockgård
7522 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
7524 * frame.c (Fother_visible_frames_p): Function deleted.
7526 2011-09-12 Eli Zaretskii <eliz@gnu.org>
7528 * indent.c (compute_motion): Process display vector front to back
7529 rather than the other way around. (Bug#2496)
7531 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
7533 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
7535 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
7537 * minibuf.c (Fread_from_minibuffer): Doc fix.
7539 2011-09-11 Eli Zaretskii <eliz@gnu.org>
7541 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
7542 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
7544 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
7546 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
7547 value for non-existent files.
7549 2011-09-11 Eli Zaretskii <eliz@gnu.org>
7551 * fileio.c (Finsert_file_contents): If the file cannot be opened,
7552 set its "size" to -1. This will set the modtime_size field of
7553 the corresponding buffer to -1, which is what
7554 verify-visited-file-modtime expects for files that do not exist.
7557 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
7559 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
7561 * lisp.h: ... from here. push_key_description is no longer
7562 defined in keyboard.c, so its declaration should not be in
7563 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
7564 logically belongs with push_key_description.
7566 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
7568 * buffer.h: Include <sys/types.h> instead of <time.h>.
7569 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
7570 Problem reported by Herbert J. Skuhra.
7572 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
7574 * xml.c (parse_region): Make the parsing work for
7575 non-comment-starting XML files again (bug#9144).
7577 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
7579 * image.c (gif_load): Fix calculation of bottom and right corner.
7582 2011-09-10 Eli Zaretskii <eliz@gnu.org>
7584 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
7585 redisplay in small windows.
7587 2011-09-09 Eli Zaretskii <eliz@gnu.org>
7589 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
7591 2011-09-08 Martin Rudalics <rudalics@gmx.at>
7593 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
7594 Operate on live windows only.
7596 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
7598 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
7600 2011-09-07 Eli Zaretskii <eliz@gnu.org>
7602 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
7603 only under bidi iteration.
7605 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
7607 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
7609 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
7611 isnan: Fix porting problem to Solaris 10 with bundled gcc.
7612 Without this fix, the command to link temacs failed due to an
7613 undefined symbol __builtin_isnan. This is because
7614 /usr/include/iso/math_c99.h #defines isnan(x) to
7615 __builtin_isnan(x), but the bundled gcc, which identifies itself
7616 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
7618 * floatfns.c (isnan): #undef, and then #define to a clone of
7620 (Fisnan): Always define, since it's always available now.
7621 (syms_of_floatfns): Always define isnan at the Lisp level.
7623 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
7625 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
7627 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
7629 * fileio.c: Fix bugs with large file offsets (Bug#9428).
7630 The previous code assumed that file offsets (off_t values) fit in
7631 EMACS_INT variables, which is not true on typical 32-bit hosts.
7632 The code messed up by falsely reporting buffer overflow in cases
7633 such as (insert-file-contents "big" nil 1 2) into an empty buffer
7634 when "big" contains more than 2**29 bytes, even though this
7635 inserts just one byte and does not overflow the buffer.
7636 (Finsert_file_contents): Store file offsets as off_t
7637 values, not as EMACS_INT values. Check for overflow when
7638 converting between EMACS_INT and off_t. When checking for
7639 buffer overflow or for overlap, take the offsets into account.
7640 Don't use EMACS_INT for small values where int suffices.
7641 When checking for overlap, fix a typo: ZV was used where
7642 ZV_BYTE was intended.
7643 (Fwrite_region): Don't assume off_t fits into 'long'.
7644 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
7646 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
7648 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
7650 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
7652 sprintf-related integer and memory overflow issues (Bug#9412).
7654 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
7655 (esprintf, exprintf, evxprintf): New functions.
7656 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
7657 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
7658 (modify_event_symbol): Do not assume that the length of
7659 name_alist_or_stem is safe to alloca and fits in int.
7660 (Fexecute_extended_command): Likewise for function name and binding.
7661 (Frecursion_depth): Wrap around reliably on integer overflow.
7662 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
7663 since some callers pass EMACS_INT values.
7664 (Fsingle_key_description): Don't crash if symbol name contains more
7665 than MAX_ALLOCA bytes.
7666 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
7667 (get_minibuffer): Arg is now EMACS_INT, not int.
7668 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
7669 (esprintf, exprintf, evxprintf): New decls.
7670 * window.h (command_loop_level, minibuf_level): Reflect API changes.
7672 * dbusbind.c (signature_cat): New function.
7673 (xd_signature, Fdbus_register_signal):
7674 Do not overrun buffer; instead, report string overflow.
7676 * dispnew.c (add_window_display_history): Don't overrun buffer.
7677 Truncate instead; this is OK since it's just a log.
7679 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
7680 even if the time zone offset is outlandishly large.
7681 Don't mishandle offset == INT_MIN.
7683 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
7684 when creating daemon; the previous buffer-overflow check was incorrect.
7686 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
7687 which has the guts of the old verror function.
7689 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
7690 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
7692 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
7693 (font_unparse_xlfd): Don't blindly alloca long strings.
7694 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
7695 fits in int, when using sprintf. Use single snprintf to count
7696 length of string rather than counting it via multiple sprintfs;
7697 that's simpler and more reliable.
7698 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
7699 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
7700 sprintf, in case result does not fit in int.
7702 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
7703 (fontset_from_font): Print it.
7705 * frame.c (tty_frame_count): Now printmax_t, not int.
7706 (make_terminal_frame, set_term_frame_name): Print it.
7707 (x_report_frame_params): In X, window IDs are unsigned long,
7708 not signed long, so print them as unsigned.
7709 (validate_x_resource_name): Check for implausibly long names,
7710 and don't assume name length fits in 'int'.
7711 (x_get_resource_string): Don't blindly alloca invocation name;
7712 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
7715 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
7716 (xg_check_special_colors, xg_set_geometry):
7717 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
7719 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
7720 Use esprintf, not sprintf, in case result does not fit in int.
7722 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
7723 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
7724 it as a large positive number.
7725 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
7726 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
7728 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
7729 in case result does not fit in int.
7731 * print.c (float_to_string): Detect width overflow more reliably.
7732 (print_object): Make sprintf buffer a bit bigger, to avoid potential
7733 buffer overrun. Don't assume list length fits in 'int'. Treat
7734 print length of 0 as 0, not as infinity; to be consistent with other
7735 uses of print length in this function. Don't overflow print length
7736 index. Don't assume hash table size fits in 'long', or that
7737 vectorlike size fits in 'unsigned long'.
7739 * process.c (make_process): Use printmax_t, not int, to format
7740 process-name gensyms.
7742 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
7744 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
7745 to avoid potential buffer overrun.
7747 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
7748 if X resource line is longer than 512 bytes.
7750 * xfns.c (x_window): Make sprintf buffer a bit bigger
7751 to avoid potential buffer overrun.
7753 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
7755 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
7757 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
7759 Integer overflow fixes for scrolling, etc.
7760 Without these, Emacs silently mishandles large integers sometimes.
7761 For example, "C-u 4294967297 M-x recenter" was treated as if
7762 it were "C-u 1 M-x recenter" on a typical 64-bit host.
7764 * xdisp.c (try_window_id): Check Emacs fixnum range before
7765 converting to 'int'.
7767 * window.c (window_scroll_line_based, Frecenter):
7768 Check that an Emacs fixnum is in range before assigning it to 'int'.
7769 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
7770 values converted from Emacs fixnums.
7771 (Frecenter): Don't wrap around a line count if it is out of 'int'
7772 range; instead, treat it as an extreme value.
7773 (Fset_window_configuration, compare_window_configurations):
7774 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
7776 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
7777 that can exceed INT_MAX. Check that EMACS_INT value is in range
7778 before assigning it to the (possibly-narrower) index.
7779 (match_limit): Don't assume that a fixnum can fit in 'int'.
7781 * print.c (print_object): Use ptrdiff_t, not int, for index that can
7784 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
7785 (Fvertical_motion): Don't wrap around LINES values that don't fit
7786 in 'int'. Instead, treat them as extreme values. This is good
7787 enough for windows, which can't have more than INT_MAX lines anyway.
7789 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
7791 * Require libxml/parser.h to avoid compilation warning.
7793 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
7795 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
7796 since this reportedly can destroy thread storage.
7798 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
7800 * syntax.c (find_defun_start): Update all cache variables if
7801 exiting early (Bug#9401).
7803 2011-08-30 Eli Zaretskii <eliz@gnu.org>
7805 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
7807 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
7808 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
7809 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
7811 * term.c (tty_append_glyph): New function.
7812 (produce_stretch_glyph): Static function and its prototype deleted.
7814 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
7817 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
7819 * image.c (parse_image_spec): Check for nonnegative, not for positive,
7820 when checking :margin (Bug#9390).
7821 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
7822 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
7823 so that the name doesn't mislead. All uses changed.
7825 2011-08-28 Johan Bockgård <bojohan@gnu.org>
7827 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
7830 2011-08-27 Eli Zaretskii <eliz@gnu.org>
7832 * xdisp.c (move_it_to): Don't bail out early when reaching
7833 position beyond to_charpos, if we are scanning backwards.
7834 (move_it_vertically_backward): When DY == 0, make sure we get to
7835 the first character in the line after the newline.
7837 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
7839 * ccl.c: Improve and simplify overflow checking (Bug#9196).
7840 (ccl_driver): Do not generate an out-of-range pointer.
7841 (Fccl_execute_on_string): Remove unnecessary check for
7842 integer overflow, noted by Stefan Monnier in
7843 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
7844 Remove a FIXME that didn't need fixing.
7845 Simplify the newly-introduced buffer reallocation code.
7847 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
7849 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
7851 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
7853 Integer and memory overflow issues (Bug#9196).
7855 * doc.c (get_doc_string): Rework so that
7856 get_doc_string_buffer_size is the actual buffer size, rather than
7857 being 1 less than the actual buffer size; this makes xpalloc more
7860 * image.c (x_allocate_bitmap_record, cache_image):
7861 * xselect.c (Fx_register_dnd_atom):
7862 Simplify previous changes by using xpalloc.
7864 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
7865 since either will do and ptrdiff_t is convenient with xpalloc.
7867 * charset.c (charset_table_size)
7868 (struct charset_sort_data.priority): Now ptrdiff_t.
7869 (charset_compare): Don't overflow if priorities differ greatly.
7870 (Fsort_charsets): Don't assume list length fits in int.
7871 Check for size-calculation overflow when allocating sort data.
7872 (syms_of_charset): Allocate an initial charset table that is
7873 just under 64 KiB, to avoid problems with glibc malloc and mmap.
7875 * cmds.c (internal_self_insert): Check for size-calculation overflow.
7877 * composite.h (struct composition.glyph_len): Now int, not unsigned.
7878 The actual value is always <= INT_MAX, and leaving it unsigned made
7879 overflow checking harder.
7881 * dispextern.h (struct glyph_matrix.rows_allocated)
7882 (struct face_cache.size): Now ptrdiff_t, for convenience in use
7883 with xpalloc. The values are still always <= INT_MAX.
7885 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
7887 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
7888 (SAFE_NALLOCA): New macro.
7890 * region-cache.c (struct boundary.pos, find_cache_boundary)
7891 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
7892 (set_cache_region, invalidate_region_cache)
7893 (revalidate_region_cache, know_region_cache, region_cache_forward)
7894 (region_cache_backward, pp_cache):
7895 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
7896 so that ptrdiff_t * can be passed to xpalloc.
7897 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
7898 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
7899 (pp_cache): Don't assume cache_len fits in int.
7900 * region-cache.h: Adjust extern decls to match.
7902 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
7903 EMACS_INT, since either will do, for xpalloc.
7905 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
7906 (xnmalloc, xnrealloc, xpalloc): New functions.
7908 * bidi.c (bidi_shelve_header_size): New constant.
7909 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
7910 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
7912 * bidi.c (bidi_cache_shrink):
7913 * buffer.c (overlays_at, overlays_in, record_overlay_string)
7915 Don't update size of array until after memory allocation succeeds,
7916 because xmalloc/xrealloc may not return.
7917 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
7918 now that we have proper integer overflow checking.
7919 (record_overlay_string, overlay_strings): Catch overflows when
7920 calculating size of overlay_str_buf.
7922 * callproc.c (Fcall_process): Check for size overflow when
7923 calculating size of args2.
7924 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
7925 Normally we prefer signed values, but sticking with ptrdiff_t would
7926 require adding more-complicated checks.
7928 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
7929 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
7930 Redo buffer-overflow calculations to avoid integer overflow.
7931 Add a FIXME comment where memory seems to be over-allocated.
7933 * character.c (Fstring): Check for size-calculation overflow.
7935 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
7936 unnecessary integer overflow. Check for size overflow.
7937 (encode_coding_object): Don't update size until xmalloc succeeds.
7939 * composite.c (get_composition_id): Check for overflow in glyph
7940 length calculations.
7942 Integer and memory overflow fixes for display code.
7943 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
7944 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
7945 (scrolling_window): Check for overflow in size calculations.
7946 (line_draw_cost, realloc_glyph_pool, add_row_entry):
7947 Don't assume glyph table len fits in int.
7948 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
7949 (row_table_size): Now ptrdiff_t, not int.
7950 (scrolling_window): Avoid overflow in size calculations.
7951 Don't update size until allocation succeeds.
7952 * fns.c (concat): Check for overflow in size calculations.
7953 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
7954 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
7955 (NEXT_ALMOST_PRIME_LIMIT): New constant.
7957 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
7958 (get_doc_string): Check for size calculation overflow.
7959 Don't update size until allocation succeeds.
7960 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
7961 EMACS_INT, where ptrdiff_t will do.
7962 (Fsubstitute_command_keys): Check for string overflow.
7964 * editfns.c (set_time_zone_rule): Don't assume environment length
7966 (message_length): Now ptrdiff_t, not int.
7967 (Fmessage_box): Don't update size until allocation succeeds.
7968 Don't assume message length fits in int.
7969 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
7971 * emacs.c (main): Do not reallocate argv, since there is a null at
7972 the end that can be overwritten, and this way there's no need to
7973 worry about size-calculation overflow.
7974 (sort_args): Check for size-calculation overflow.
7976 * eval.c (init_eval_once, grow_specpdl): Don't update size until
7978 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
7980 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
7981 (x_set_scroll_bar_width, x_figure_window_size):
7982 Check for integer overflow.
7983 (x_set_alpha): Do not assume XINT fits in int.
7985 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
7986 This is for the members text_lines, text_cols, total_lines, total_cols,
7987 where the system imposes an 'int' limit.
7989 * fringe.c (Fdefine_fringe_bitmap):
7990 Don't update size until alloc works.
7992 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
7993 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
7995 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
7996 Check for size-calculation overflow.
7997 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
7998 do, as we prefer signed integers.
7999 (id_to_widget.max_size, id_to_widget.used)
8000 (xg_store_widget_in_map, xg_remove_widget_from_map)
8001 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
8002 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
8003 Use and return ptrdiff_t, not int.
8004 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
8005 * gtkutil.h: Change prototypes to match the above.
8007 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
8008 are duplicate now that they've been promoted to lisp.h.
8009 (x_allocate_bitmap_record, x_alloc_image_color)
8010 (make_image_cache, cache_image, xpm_load):
8011 Don't update size until alloc is done.
8012 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
8014 Check for size calculation overflow.
8015 (ct_colors_allocated_max): New constant.
8016 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
8019 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
8020 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
8021 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
8022 Use ptrdiff_t, not int, to count maps.
8023 (read_char_minibuf_menu_prompt): Check for overflow in size
8024 calculations. Don't update size until allocation succeeds.
8025 Redo calculations to avoid overflow.
8026 * keyboard.h: Change prototypes to match the above.
8028 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
8030 (current_minor_maps): Check for size calculation overflow.
8031 * keymap.h: Change prototypes to match the above.
8033 * lread.c (read1, init_obarray): Don't update size until alloc done.
8035 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
8036 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
8038 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
8039 Now ptrdiff_t, not int.
8040 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
8041 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
8043 * process.c (Fnetwork_interface_list): Check for overflow
8044 in size calculation.
8046 * region-cache.c (move_cache_gap): Check for size calculation overflow.
8048 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
8049 overflow. Don't bother calling xmalloc when xrealloc will do.
8051 * search.c (Freplace_match): Check for size calculation overflow.
8052 (Fset_match_data): Don't assume list lengths fit in 'int'.
8054 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
8055 for command line length. Do not attempt to address one before the
8056 beginning of an array, as that's not portable.
8058 * term.c (max_frame_lines): Remove; unused.
8059 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
8061 (encode_terminal_code, calculate_costs): Check for size
8062 calculation overflow.
8063 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
8064 table lengths and related sizes. Don't update size until alloc
8065 done. Redo calculations to avoid overflow.
8066 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
8068 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
8069 subtracting pointers.
8070 (gobble_line): Check for overflow more carefully. Don't update size
8073 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
8074 Don't update size until alloc done.
8075 Redo size calculations to avoid overflow.
8076 Check for size calculation overflow.
8077 (main) [DEBUG]: Fix typo in invoking tparam1.
8079 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
8080 Use ptrdiff_t, not int, for sizes.
8081 (store_mode_line_noprop_char): Don't update size until alloc done.
8083 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
8084 Use ptrdiff_t, not int, for sizes.
8085 (Finternal_make_lisp_face, cache_face):
8086 Check for size calculation overflow.
8087 (cache_face): Treat size calculation overflows as if they were
8088 memory exhaustion (the usual treatment), rather than aborting.
8090 * xfns.c (x_encode_text, x_set_name_internal)
8091 (Fx_change_window_property): Use ptrdiff_t, not int, to count
8092 sizes, since they can exceed INT_MAX in size. Check for size
8093 calculation overflow.
8095 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
8096 (xg_select): Check for size calculation overflow.
8097 Don't update size until alloc done.
8099 * xrdb.c (get_environ_db): Don't assume path length fits in int,
8100 as sprintf is limited to int lengths.
8102 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
8103 (X_LONG_MIN): New macros.
8104 Use them to make the following changes clearer.
8105 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
8106 This change doesn't affect the value now, but it may help remind
8107 future maintainers not to raise the value too much later.
8108 (SELECTION_QUANTUM): Remove, replacing with ...
8109 (selection_quantum): ... new function, which avoids overflow.
8111 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
8112 assumption that selection length fits in 'int'.
8113 (x_reply_selection_request, x_handle_selection_request)
8114 (x_get_window_property, receive_incremental_selection)
8115 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
8116 (lisp_data_to_selection_data, clean_local_selection_data):
8117 Use ptrdiff_t, not int, to record length of selection.
8118 (x_reply_selection_request, x_get_window_property)
8119 (receive_incremental_selection, x_property_data_to_lisp):
8120 Redo calculations to avoid overflow.
8121 (x_reply_selection_request): When sending hint, ceiling it at
8122 X_LONG_MAX rather than relying on wraparound overflow to send
8124 (x_get_window_property, receive_incremental_selection)
8125 (lisp_data_to_selection_data, x_property_data_to_lisp):
8126 Check for size-calculation overflow.
8127 (x_get_window_property, receive_incremental_selection)
8128 (lisp_data_to_selection_data, Fx_register_dnd_atom):
8129 Don't store size until memory allocation succeeds.
8130 (x_get_window_property): Plug memory leak on memory exhaustion.
8131 Don't double-block input; malloc is safe here. Don't assume 2**34
8132 - 4 fits in unsigned long. Add an xassert to check
8133 XGetWindowProperty overflow. Be more careful about overflow
8134 calculations, and distinguish size from memory overflow better.
8135 (receive_incremental_selection): When tracing, don't assume
8136 unsigned int is less than INT_MAX.
8137 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
8138 harmful) conversions of unsigned short to int.
8139 (lisp_data_to_selection_data): Don't assume that integers
8140 in the range -65535 through -1 fit in an X unsigned short.
8141 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
8142 result parameters unless successful. Rely on cons_to_unsigned
8143 to report problems with elements; the old code wasn't right anyway.
8144 (x_check_property_data): Check for int overflow; we cannot use
8145 a wider type due to X limits.
8146 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
8148 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
8150 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
8151 (x_term_init): Check for size calculation overflow.
8152 (x_color_cells): Don't store size until memory allocation succeeds.
8153 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
8154 Don't assume alloca size is less than MAX_ALLOCA.
8155 (x_term_init): Don't assume length fits in int (sprintf is limited
8158 Use ptrdiff_t for composition IDs.
8159 * character.c (lisp_string_width):
8160 * composite.c (composition_table_size, n_compositions)
8161 (get_composition_id, composition_gstring_from_id):
8162 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
8163 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
8164 * window.c (Frecenter):
8165 Use ptrdiff_t, not int, for composition IDs.
8166 * composite.c (get_composition_id): Check for integer overflow.
8167 * composite.h: Adjust prototypes to match the above changes.
8169 Use ptrdiff_t for hash table indexes.
8170 * category.c (hash_get_category_set):
8171 * ccl.c (ccl_driver):
8172 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
8173 * coding.c (coding_system_charset_list, detect_coding_system):
8174 * coding.h (struct coding_system.id):
8175 * composite.c (get_composition_id, gstring_lookup_cache):
8176 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
8177 * image.c (xpm_get_color_table_h):
8178 * lisp.h (hash_lookup, hash_put):
8179 * minibuf.c (Ftest_completion):
8180 Use ptrdiff_t for hash table indexes, not int (which is too
8181 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
8182 32-bit --with-wide-int hosts).
8184 * charset.c (Fdefine_charset_internal): Check for integer overflow.
8185 Add a FIXME comment about memory leaks.
8186 (syms_of_charset): Don't assume xmalloc returns.
8188 Don't assume that stated character widths fit in int.
8189 * character.c (Fchar_width, c_string_width, lisp_string_width):
8190 * character.h (CHAR_WIDTH):
8191 * indent.c (MULTIBYTE_BYTES_WIDTH):
8192 Use sanitize_char_width to avoid undefined and/or bad behavior
8193 with outlandish widths.
8194 * character.h (sanitize_tab_width): Rename from sanitize_width,
8195 now that we have two such functions. All uses changed.
8196 (sanitize_char_width): New inline function.
8198 Don't assume that tab-width fits in int.
8199 * character.h (sanitize_width): New inline function.
8200 (SANE_TAB_WIDTH): New macro.
8201 (ASCII_CHAR_WIDTH): Use it.
8202 * indent.c (sane_tab_width): Remove. All uses replaced by
8203 SANE_TAB_WIDTH (current_buffer).
8204 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
8206 * fileio.c: Integer overflow issues with file modes.
8207 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
8209 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
8210 Remove unreachable code.
8211 (read_hex, load_charset_map_from_file): Check for integer overflow.
8213 * xterm.c: Don't go over XClientMessageEvent limit.
8214 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
8215 (x_send_scroll_bar_event): Likewise. Check that the size does not
8216 exceed limits imposed by XClientMessageEvent, as well as the usual
8217 ptrdiff_t and size_t limits.
8219 * keyboard.c: Overflow, signedness and related fixes.
8220 (make_lispy_movement): Use same integer type in forward decl
8221 that is used in the definition.
8222 (read_key_sequence, keyremap_step):
8223 Change bufsize argument back to int, undoing my 2011-03-30 change.
8224 We prefer signed types, and int is wide enough here.
8225 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
8226 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
8227 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
8228 length, not size_t. Use ptrdiff_t for index, not int.
8229 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
8230 possibility of integer overflow.
8232 Overflow, signedness and related fixes for images.
8234 * dispextern.h (struct it.stack[0].u.image.image_id)
8235 (struct_it.image_id, struct image.id, struct image_cache.size)
8236 (struct image_cache.used, struct image_cache.ref_count):
8237 * gtkutil.c (update_frame_tool_bar):
8238 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
8239 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
8240 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
8241 * nsmenu.m (update_frame_tool_bar):
8242 * xdisp.c (calc_pixel_width_or_height):
8243 * xfns.c (image_cache_refcount):
8244 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
8245 on typical 64-bit hosts.
8247 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
8248 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
8249 Omit unnecessary casts to int.
8250 (parse_image_spec): Check that integers fall into 'int' range
8251 when the callers expect that.
8252 (image_ascent): Redo ascent calculation to avoid int overflow.
8253 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
8254 (lookup_image): Remove unnecessary tests.
8255 (xbm_image_p): Locals are now of int, not EMACS_INT,
8256 since parse_image_check makes sure they fit into int.
8257 (png_load, gif_load, svg_load_image):
8258 Prefer int to unsigned where either will do.
8259 (tiff_handler): New function, combining the cores of the
8260 old tiff_error_handler and tiff_warning_handler.
8261 This function is rewritten to use vsnprintf and thereby avoid
8262 stack buffer overflows. It uses only the features of vsnprintf
8263 that are common to both POSIX and native Microsoft.
8264 (tiff_error_handler, tiff_warning_handler): Use it.
8265 (tiff_load, gif_load, imagemagick_load_image):
8266 Don't assume :index value fits in 'int'.
8267 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
8268 (imagemagick_load_image): Check that crop parameters fit into
8269 the integer types that MagickCropImage accepts. Don't assume
8270 Vimagemagick_render_type has a nonnegative value. Don't assume
8271 size_t fits in 'long'.
8272 (gs_load): Use printmax_t to print the widest integers possible.
8273 Check for integer overflow when computing image height and width.
8275 2011-08-26 Eli Zaretskii <eliz@gnu.org>
8277 * xdisp.c (redisplay_window): Don't force window start if point
8278 will be invisible in the resulting window. (Bug#9324)
8280 2011-08-25 Eli Zaretskii <eliz@gnu.org>
8282 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
8283 the display spec is of the form `(space ...)'.
8284 (handle_display_spec): Return the value returned by
8285 handle_single_display_spec, not just 1 or zero.
8286 (handle_single_display_spec): If the display spec is of the form
8287 `(space ...)', and specifies display in the text area, return 2
8289 (try_cursor_movement): Check for the need to scroll more
8290 accurately, and prefer exact match for point under bidi.
8291 Don't advance `row' beyond the last row of the window.
8293 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
8294 into disp_prop; all users changed.
8296 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
8297 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
8298 for the text covered by the display property.
8300 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
8302 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
8303 Change return value to nil.
8304 (Frecord_buffer): Delete unused function.
8306 2011-08-24 Eli Zaretskii <eliz@gnu.org>
8308 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
8309 buffers, return left-to-right.
8310 (set_cursor_from_row): Consider candidate row a win if its glyph
8311 represents a newline and point is on that newline. Fixes cursor
8312 positioning on the newline at EOL of R2L text within L2R
8313 paragraph, and vice versa.
8314 (try_cursor_movement): Check continued rows, in addition to
8315 continuation rows. Fixes unwarranted scroll when point enters a
8316 continued line of R2L text within an L2R paragraph, or vice versa.
8317 (cursor_row_p): Consider the case of point being equal to
8318 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
8319 from the end of a short line to the beginning of a continued line
8320 of R2L text within L2R paragraph.
8321 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
8322 composed characters.
8324 * bidi.c (bidi_check_type): Use xassert.
8325 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
8328 2011-08-23 Eli Zaretskii <eliz@gnu.org>
8330 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
8333 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
8335 * nsfont.m (ns_otf_to_script): Fix typo.
8337 2011-08-22 Kenichi Handa <handa@m17n.org>
8339 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
8340 extra slot even if the purpose is char-code-property-table.
8342 2011-08-23 Eli Zaretskii <eliz@gnu.org>
8344 * xdisp.c (redisplay_window): When computing centering_position,
8345 account for the height of the header line. (Bug#8874)
8347 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
8348 instead of CHAR_TO_BYTE. Fixes a crash when a completion
8349 candidate is selected by the mouse, and that candidate has a
8350 composed character under the mouse.
8352 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
8353 coordinates reported by pos-visible-in-window-p for a composed
8354 character in column zero.
8356 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
8358 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
8360 2011-08-22 Eli Zaretskii <eliz@gnu.org>
8362 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
8363 consider it a hit if to_charpos is anywhere in the range of the
8364 composed buffer positions.
8366 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
8368 * image.c (gif_load): Don't assume that each subimage has the same
8369 dimensions as the base image. Handle disposal method that is
8370 "undefined" by the gif spec (Bug#9335).
8372 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
8374 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
8375 (Fcondition_case): Document `debug' symbol in error handler.
8377 2011-08-19 Eli Zaretskii <eliz@gnu.org>
8379 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
8380 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
8381 from an Org mode buffer to a Speedbar frame.
8383 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
8384 a composition, take its buffer position from IT->cmp_it.charpos.
8385 Fixes cursor positioning at the beginning of a line that begins
8386 with a composed character.
8388 2011-08-18 Eli Zaretskii <eliz@gnu.org>
8390 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
8391 character bidirectional type, use STRONG_L instead. Fixes crashes
8392 in a buffer produced by `describe-categories'.
8394 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
8395 members before the level stack, so they would be saved and
8396 restored when copying iterator state. Fixes incorrect reordering
8397 around TABs covered by display properties.
8399 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
8401 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
8403 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
8405 * eval.c (internal_condition_case, internal_condition_case_1)
8406 (internal_condition_case_2, internal_condition_case_n):
8407 Remove unnecessary aborts (Bug#9081).
8409 2011-08-17 Eli Zaretskii <eliz@gnu.org>
8411 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
8412 has no `load' handler, try opening the file locally. (Bug#9311)
8414 2011-08-16 Ken Brown <kbrown@cornell.edu>
8416 * gmalloc.c: Expand comment.
8418 2011-08-16 Eli Zaretskii <eliz@gnu.org>
8420 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
8421 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
8423 2011-08-16 Ken Brown <kbrown@cornell.edu>
8425 Fix memory allocation problems in Cygwin build (Bug#9273).
8427 * unexcw.c ( __malloc_initialized): Declare external variable.
8428 (fixup_executable): Force the dumped emacs to reinitialize malloc.
8430 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
8432 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
8434 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
8436 [CYGWIN] (special_realloc): New function.
8437 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
8438 requests to realloc storage in the static heap.
8440 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
8442 * bidi.c (bidi_initialize): Remove unused local.
8444 2011-08-15 Eli Zaretskii <eliz@gnu.org>
8447 * biditype.h: Remove file.
8448 * makefile.w32-in ($(BLD)/bidi.$(O)):
8449 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
8451 * dispextern.h: Fix a typo in the comment to bidi_type_t.
8453 * chartab.c: Improve commentary for the uniprop_table API.
8455 * bidi.c (bidi_paragraph_init): Support zero value of
8456 bidi_ignore_explicit_marks_for_paragraph_level.
8457 (bidi_initialize): Use uniprop_table instead of including
8458 biditype.h and bidimirror.h.
8460 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
8461 coordinates of the iterator when restoring from ppos_it.
8464 2011-08-14 Kenichi Handa <handa@m17n.org>
8466 * process.c (create_process): Call setup_process_coding_systems
8467 after the pid of the process is set to -1 (Bug#8162).
8469 2011-08-14 Eli Zaretskii <eliz@gnu.org>
8471 * xdisp.c (move_it_in_display_line_to): Don't invoke
8472 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
8473 ppos_it. Fixes vertical cursor motion when line beginning is
8474 covered by an image. (Bug#9296)
8476 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
8478 * nsterm.h (ns_run_ascript): Declare.
8479 (NSAPP_DATA2_RUNASSCRIPT): Define.
8481 * nsfns.m (as_script, as_result, as_status): New static variables.
8482 (ns_run_ascript): New function.
8483 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
8484 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
8485 the event loop. Get status from as_status (Bug#7276).
8487 * nsterm.m (sendEvent): If event is NSApplicationDefined and
8488 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
8489 the event loop (Bug#7276).
8491 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
8493 * gnutls.c (QCgnutls_bootprop_priority)
8494 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
8495 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
8496 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
8497 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
8498 (QCgnutls_bootprop_verify_hostname_error)
8499 (QCgnutls_bootprop_callbacks_verify): Rename from
8500 Qgnutls_bootprop_..., all uses changed.
8502 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
8505 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
8507 * xfaces.c (Qframe_set_background_mode): Now static.
8508 * dispextern.h (Qframe_set_background_mode): Remove decl.
8510 * process.c (Fnetwork_interface_info): Declare local only if needed.
8512 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
8514 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
8515 (Fnetwork_interface_list): Allocate in increments of bytes instead
8516 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
8517 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
8519 (struct ifflag_def): notrailers is smart on OSX.
8520 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
8521 Get hardware address with getifaddrs if available.
8523 2011-08-12 Eli Zaretskii <eliz@gnu.org>
8525 * xdisp.c (iterate_out_of_display_property): xassert that
8526 IT->position is set to within IT->object's boundaries. Break from
8527 the loop as soon as EOB is reached; avoids infloops in redisplay
8528 when IT->position is set up wrongly due to some bug.
8529 Set IT->current to match the bidi iterator unconditionally.
8530 (push_display_prop): Allow GET_FROM_STRING as IT->method on
8531 entry. Force push_it to save on the stack the current
8532 buffer/string position, to be restored by pop_it. Fix flags in
8533 the iterator structure wrt the object coming from a display
8534 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
8535 properties. (Bug#9284)
8537 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
8539 * fontset.c (fontset_get_font_group): Add proper type checks.
8542 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8544 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
8545 and LC_VERSION_MIN_MACOSX.
8546 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
8547 (dump_it) [LC_FUNCTION_STARTS]: Use it.
8549 2011-08-08 Eli Zaretskii <eliz@gnu.org>
8551 * xdisp.c (forward_to_next_line_start): Allow to use the
8552 no-display-properties-and-no-overlays under bidi display.
8553 Set disp_pos in the bidi iterator to avoid searches for display
8554 properties and overlays.
8556 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
8558 * editfns.c (Fset_time_zone_rule): Document relationship with the
8561 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
8562 the font entity extracted from the cache (Bug#8109).
8564 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
8566 * composite.c (autocmp_chars): Don't reset point. That is done by
8567 restore_point_unwind (Bug#5984).
8569 2011-08-07 Juri Linkov <juri@jurta.org>
8571 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
8572 to show the arg `TIME' instead of `TIMEVAL'.
8574 2011-08-06 Eli Zaretskii <eliz@gnu.org>
8576 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
8577 display property strides EOL and includes a newline, as in
8578 longlines-mode. (Bug#9254)
8579 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
8580 word-wrap under bidirectional display. (Bug#9224)
8582 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
8583 is non-zero, even if the data buffer is NULL. Fixes a crash in
8584 vertical-motion with longlines-mode. (Bug#9254)
8586 2011-08-05 Eli Zaretskii <eliz@gnu.org>
8588 * bidi.c <bidi_cache_total_alloc>: Now static.
8589 (bidi_initialize): Initialize bidi_cache_total_alloc.
8591 * xdisp.c (display_line): Release buffer allocated for shelved bidi
8594 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
8595 amount allocated this far in `bidi_cache_total_alloc'.
8596 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
8597 non-zero, only free the data buffer without restoring the cache
8598 contents. All callers changed.
8600 * dispextern.h (bidi_unshelve_cache): Update prototype.
8602 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
8603 (move_it_in_display_line, move_it_to)
8604 (move_it_vertically_backward, move_it_by_lines): Replace the call
8605 to xfree to an equivalent call to bidi_unshelve_cache.
8606 (move_it_in_display_line_to): Fix logic of returning
8607 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
8609 2011-08-05 Eli Zaretskii <eliz@gnu.org>
8611 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
8612 came from a string character with a `cursor' property. (Bug#9229)
8614 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
8616 * Makefile.in (LIB_PTHREAD): New variable.
8617 (LIBES): Add LIB_PTHREAD (Bug#9216).
8619 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
8620 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
8622 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
8624 * regex.c (re_iswctype): Remove some redundant boolean conversions.
8626 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
8628 * xterm.c (x_find_topmost_parent): New function.
8629 (x_set_frame_alpha): Find topmost parent window with
8630 x_find_topmost_parent and set the property there also (bug#9181).
8631 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
8633 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
8635 * callproc.c (Fcall_process): Avoid vfork clobbering
8636 the local vars buffer, coding_systems, current_dir.
8638 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
8640 * keymap.c (Fmake_composed_keymap): Move to subr.el.
8642 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
8644 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
8645 so that it is not optimized away.
8647 * xdisp.c (compute_display_string_pos): Remove unused local.
8649 2011-08-02 Eli Zaretskii <eliz@gnu.org>
8651 Fix slow cursor motion and scrolling in large buffers with
8652 selective display, like Org Mode buffers. (Bug#9218)
8654 * dispextern.h (struct bidi_it): New member disp_prop_p.
8656 * xdisp.c: Remove one-slot cache of display string positions.
8657 (compute_display_string_pos): Accept an additional argument
8658 DISP_PROP_P; callers changed. Scan at most 5K characters forward
8659 for a display string or property. If found, set DISP_PROP_P
8662 * bidi.c (bidi_fetch_char): Accept an additional argument
8663 DISP_PROP_P, and pass it to compute_display_string_pos.
8664 Only handle text covered by a display string if DISP_PROP_P is returned
8665 non-zero. All callers of bidi_fetch_char changed.
8667 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
8669 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
8671 2010-12-03 Don March <don@ohspite.net>
8673 * keymap.c (Fdefine_key): Fix non-prefix key error message when
8674 last character M-[char] is translated to ESC [char] (bug#7541).
8676 2011-08-02 Kenichi Handa <handa@m17n.org>
8678 * lisp.h (uniprop_table): Extern it.
8680 * chartab.c (uniprop_table): Make it non-static.
8682 2011-08-01 Eli Zaretskii <eliz@gnu.org>
8684 * xdisp.c (forward_to_next_line_start): Accept additional argument
8685 BIDI_IT_PREV, and store into it the state of the bidi iterator had
8687 (reseat_at_next_visible_line_start): Use the bidi iterator state
8688 returned by forward_to_next_line_start to restore the state of
8689 it->bidi_it after backing up to previous newline. (Bug#9212)
8691 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
8693 * regex.c (re_comp): Protoize.
8694 (re_exec): Fix return type.
8695 (regexec): Fix type of `ret'. (Bug#9203)
8697 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
8699 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
8700 This is needed if max-image-size is a floating-point number.
8702 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
8704 * print.c (print_object): Print empty symbol as ##.
8706 * lread.c (read1): Read ## as empty symbol.
8708 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
8710 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
8711 setting frame foreground color (Bug#9175).
8712 (x_set_background_color): Likewise.
8714 * nsmenu.m (-setText): Size tooltip dimensions precisely to
8715 contents (Bug#9176).
8716 (EmacsTooltip -init): Remove bezels and add shadows to
8719 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
8720 or scroll bar (Bug#8470).
8722 * nsfont.m (nsfont_open): Remove assignment to voffset and
8723 unnecessary vars hshink, expand, hd, full_height, min_height.
8724 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
8726 * nsterm.h (nsfont_info): Remove voffset field.
8728 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
8730 Implement strike-through and overline on NextStep (Bug#8863).
8732 * nsfont.m (nsfont_open): Use underline position provided by font,
8733 instead of hard-coded value of 2.
8734 (nsfont_draw): Call ns_draw_text_decoration instead.
8736 * nsterm.h: Add declaration for ns_draw_text_decoration.
8738 * nsterm.m (ns_draw_text_decoration): New function for drawing
8739 underline, overline, and strike-through.
8740 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
8741 ns_draw_text_decoration. Change treatment of cursor drawing to
8742 accommodate underlining, etc.
8744 2011-07-28 Eli Zaretskii <eliz@gnu.org>
8746 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
8749 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
8751 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
8752 Without this fix, if a signal arrives just after memory fills up,
8753 'malloc' might be invoked reentrantly.
8755 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
8756 In other words, assume that every image size is allowed, on non-X
8757 hosts. This assumption is probably wrong, but it lets Emacs compile.
8759 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
8761 * regex.c (re_iswctype): Convert return values to boolean.
8763 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
8765 * xdisp.c (compute_display_string_pos): Don't use cached display
8766 string position if the buffer had its restriction changed.
8769 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
8771 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
8773 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
8775 Integer signedness and overflow and related fixes. (Bug#9079)
8777 * bidi.c: Integer size and overflow fixes.
8778 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
8779 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
8780 (bidi_cache_find_level_change, bidi_cache_ensure_space)
8781 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
8782 (bidi_find_other_level_edge):
8783 Use ptrdiff_t instead of EMACS_INT where either will do.
8784 This works better on 32-bit hosts configured --with-wide-int.
8785 (bidi_cache_ensure_space): Check for size-calculation overflow.
8786 Use % rather than repeated addition, for better worst-case speed.
8787 Don't set bidi_cache_size until after xrealloc returns, because it
8789 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
8790 (bidi_cache_ensure_space): Also check that the bidi cache size
8791 does not exceed that of the largest Lisp string or buffer. See Eli
8792 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
8794 * alloc.c (__malloc_size_t): Remove.
8795 All uses replaced by size_t. See Andreas Schwab's note
8796 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
8798 * image.c: Improve checking for integer overflow.
8799 (check_image_size): Assume that f is nonnull, since
8800 it is always nonnull in practice. This is one less thing to
8801 worry about when checking for integer overflow later.
8802 (x_check_image_size): New function, which checks for integer
8803 overflow issues inside X.
8804 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
8805 This removes the need for a memory_full check.
8806 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
8807 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
8808 (xbm_read_bitmap_data): Change locals back to 'int', since
8809 their values must fit in 'int'.
8810 (xpm_load_image, png_load, tiff_load):
8811 Invoke x_create_x_image_and_pixmap earlier,
8812 to avoid much needless work if the image is too large.
8813 (tiff_load): Treat overly large images as if
8814 x_create_x_image_and_pixmap failed, not as malloc failures.
8815 (gs_load): Use x_check_image_size.
8817 * gtkutil.c: Omit integer casts.
8818 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
8819 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
8821 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
8823 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
8824 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
8825 would wrongly return t on a 64-bit host.
8827 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
8828 The plain *_OVERFLOW macros run afoul of GCC bug 49705
8829 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
8830 and therefore cause GCC to emit a bogus diagnostic in some cases.
8832 * image.c: Integer signedness and overflow and related fixes.
8833 This is not an exhaustive set of fixes, but it's time to
8834 record what I've got.
8835 (lookup_pixel_color, check_image_size): Remove redundant decls.
8836 (check_image_size): Don't assume that arbitrary EMACS_INT values
8837 fit in 'int', or that arbitrary 'double' values fit in 'int'.
8838 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
8839 (tiff_load, imagemagick_load_image):
8840 Check for overflow in size calculations.
8841 (x_create_x_image_and_pixmap): Remove unnecessary test for
8842 xmalloc returning NULL; that can't happen.
8843 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
8844 (xpm_color_bucket): Use better integer hashing function.
8845 (xpm_cache_color): Don't possibly over-allocate memory.
8846 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
8847 (gif_memory_source):
8848 Use ptrdiff_t, not int or size_t, to record sizes.
8849 (png_load): Don't assume values greater than 2**31 fit in 'int'.
8850 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
8851 either works, as we prefer signed integers.
8852 (tiff_read_from_memory, tiff_write_from_memory):
8853 Return tsize_t, not size_t, since that's what the TIFF API wants.
8854 (tiff_read_from_memory): Don't fail simply because the read would
8855 go past EOF; instead, return a short read.
8856 (tiff_load): Omit no-longer-needed casts.
8857 (Fimagemagick_types): Don't assume size fits into 'int'.
8859 Improve hashing quality when configured --with-wide-int.
8860 * fns.c (hash_string): New function, taken from sxhash_string.
8861 Do not discard information about ASCII character case; this
8862 discarding is no longer needed.
8863 (sxhash-string): Use it. Change sig to match it. Caller changed.
8864 * lisp.h: Declare it.
8865 * lread.c (hash_string): Remove, since we now use fns.c's version.
8866 The fns.c version returns a wider integer if --with-wide-int is
8867 specified, so this should help the quality of the hashing a bit.
8869 * emacs.c: Integer overflow minor fix.
8870 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
8871 Define only if GNU_LINUX.
8872 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
8874 * dispnew.c: Integer signedness and overflow fixes.
8875 Remove unnecessary forward decls, that were a maintenance hassle.
8876 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
8878 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
8879 (scrolling_window): Use ptrdiff_t, not int, for byte count.
8880 (prepare_desired_row, line_draw_cost):
8881 Use int, not unsigned, where either works.
8882 (save_current_matrix, restore_current_matrix):
8883 Use ptrdiff_t, not size_t, where either works.
8884 (init_display): Check for overflow more accurately, and without
8885 relying on undefined behavior.
8887 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
8888 Remove, replacing with the new symbols in lisp.h. All uses changed.
8889 * fileio.c (make_temp_name):
8890 * filelock.c (lock_file_1, lock_file):
8891 * xdisp.c (message_dolog):
8892 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
8893 Use pMd etc. instead.
8894 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
8895 replacing the pWIDE etc. symbols removed from editfns.c.
8897 * keyboard.h (num_input_events): Now uintmax_t.
8898 This is (very slightly) less likely to mess up due to wraparound.
8901 * buffer.c: Integer signedness fixes.
8902 (alloc_buffer_text, enlarge_buffer_text):
8903 Use ptrdiff_t rather than size_t when either will do, as we prefer
8906 * alloc.c: Integer signedness and overflow fixes.
8907 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
8908 (__malloc_size_t): Default to size_t, not to int.
8909 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
8910 (Fgarbage_collect, mark_object_loop_halt, mark_object):
8911 Prefer ptrdiff_t to size_t when either would do, as we prefer
8913 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
8914 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
8915 Now const. Initialize with values that are in range even if char
8917 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
8918 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
8919 These functions do the right thing with sizes > 2**32.
8920 (check_depth): Now ptrdiff_t, not int.
8921 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
8922 Adjust to new way of storing sizes. Check for size overflow bugs
8924 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
8925 slightly wrong anyway, as it missed one instance of
8926 XMALLOC_OVERRUN_CHECK_OVERHEAD.
8927 (refill_memory_reserve): Omit needless cast to size_t.
8928 (mark_object_loop_halt): Mark as externally visible.
8930 * xselect.c: Integer signedness and overflow fixes.
8931 (Fx_register_dnd_atom, x_handle_dnd_message):
8932 Use ptrdiff_t, not size_t, since we prefer signed.
8933 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
8934 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
8935 x_dnd_atoms_size and x_dnd_atoms_length.
8937 * doprnt.c: Prefer signed to unsigned when either works.
8939 * doprnt.c (doprnt):
8941 * xdisp.c (vmessage):
8942 Use ptrdiff_t, not size_t, when using or implementing doprnt,
8943 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
8944 prefer signed arithmetic to avoid comparison confusion.
8945 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
8946 but is a bit tricky.
8948 Assume freestanding C89 headers, string.h, stdlib.h.
8949 * data.c, doprnt.c, floatfns.c, print.c:
8950 Include float.h unconditionally.
8951 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
8952 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
8953 * regex.c: Likewise for stddef.h, string.h.
8954 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
8955 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
8956 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
8957 (STDC_HEADERS): Remove obsolete defines.
8958 * sysdep.c: Include limits.h unconditionally.
8960 Assume support for memcmp, memcpy, memmove, memset.
8961 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
8962 * regex.c (memcmp, memcpy):
8963 Remove; we assume C89 now.
8965 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
8966 (__malloc_safe_bcopy): Remove; no longer needed.
8968 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
8969 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
8970 well either way, and we prefer signed to unsigned.
8972 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
8974 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
8975 closes the connection while we're reading (bug#9182).
8977 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
8979 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
8980 are specified (Bug#9168).
8982 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
8984 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
8985 Found by GCC static checking and --with-wide-int on a 32-bit host.
8987 2011-07-25 Eli Zaretskii <eliz@gnu.org>
8989 * xdisp.c (compute_display_string_pos): Fix logic of caching
8990 previous display string position. Initialize cached_prev_pos to
8991 -1. Fixes slow-down at the beginning of a buffer.
8993 2011-07-24 Eli Zaretskii <eliz@gnu.org>
8995 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
8996 for attrs[LFACE_FONTSET_INDEX].
8998 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
9000 * xml.c (parse_region): Remove unused local
9001 that was recently introduced.
9003 2011-07-23 Eli Zaretskii <eliz@gnu.org>
9005 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
9006 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
9008 * xdisp.c (move_it_in_display_line_to): Record the best matching
9009 position for TO_CHARPOS while scanning the line, and restore it on
9010 exit if none of the characters scanned was an exact match.
9011 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
9012 when exact match is impossible due to invisible text, and the
9013 lines are truncated.
9015 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
9017 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
9020 2011-07-22 Eli Zaretskii <eliz@gnu.org>
9022 Fix a significant slow-down of cursor motion with C-n, C-p,
9023 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
9024 auto-repeat under bidi redisplay in fontified buffers.
9025 * xdisp.c (compute_stop_pos_backwards): New function.
9026 (next_element_from_buffer): Call compute_stop_pos_backwards to
9027 find a suitable prev_stop when we find ourselves before
9029 (reseat): Don't look for prev_stop, as that could mean a very long
9031 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
9032 <cached_disp_overlay_modiff>: Cache for last found display string
9034 (compute_display_string_pos): Return the cached position if asked
9035 about the same buffer in the same area of character positions, and
9036 the buffer wasn't changed since the time the display string
9037 position was cached.
9039 2011-07-22 Eli Zaretskii <eliz@gnu.org>
9041 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
9042 is an integer, which is important for empty lines. (Bug#9149)
9044 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
9046 * frame.c (Fmodify_frame_parameters): In tty case, update the
9047 default face if necessary (Bug#4238).
9049 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
9051 * editfns.c (Fstring_to_char): No need to explain what a character
9052 is in the docstring (Bug#6576).
9054 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
9056 * xml.c (parse_region): Make sure we always return a tree.
9058 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
9060 * xml.c (parse_region): If a document contains only comments,
9063 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
9065 * xml.c (make_dom): Return comments, too.
9067 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
9070 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
9071 and the surrounding thread.
9072 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
9073 rather than fgets, and retry after EINTR. Otherwise, 'emacs
9074 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
9076 * s/openbsd.h (BROKEN_SIGIO): Define.
9077 * unexelf.c (unexec) [__OpenBSD__]:
9078 Don't update the .mdebug section of the Alpha COFF symbol table.
9080 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
9082 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
9085 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
9087 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
9088 This fixes some race conditions on the permissions of any newly
9091 * alloc.c (valid_pointer_p): Use pipe, not open.
9092 This fixes some permissions issues when debugging.
9094 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
9095 If fchown fails to set both uid and gid, try to set just gid,
9096 as that is sometimes allowed. Adjust the file's mode to eliminate
9097 setuid or setgid bits that are inappropriate if fchown fails.
9099 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
9101 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
9102 to compare Lisp_Objects.
9103 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
9104 global_gnutls_log_level, don't mistake it for a Lisp_Object.
9105 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
9107 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
9109 * lread.c (read_integer): Unread even EOF character.
9110 (read1): Likewise. Properly record start position of symbol.
9112 * lread.c (read1): Read `#:' as empty uninterned symbol if no
9113 symbol character follows.
9115 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
9117 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
9118 This works around a problem with the previous change to Fcopy_file.
9119 Recent glibc declares fchown with __attribute__((warn_unused_result)),
9120 and without this change, GCC might complain about discarding
9121 fchown's return value.
9123 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
9125 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
9127 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
9129 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
9131 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
9133 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
9134 it's used from the C level.
9136 * process.c: Use the same condition for POLL_FOR_INPUT in both
9137 keyboard.c and process.c (bug#1858).
9139 2011-07-09 Lawrence Mitchell <wence@gmx.li>
9141 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
9142 (Fgnutls_boot): Use it.
9144 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
9146 * doc.c (Fsubstitute_command_keys): Revert last change.
9148 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
9150 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
9151 quotes the next character, and doesn't affect other longer
9152 sequences (bug#8935).
9154 * lread.c (syms_of_lread): Clarify that is isn't only
9155 `eval-buffer' and `eval-defun' that's affected by
9156 `lexical-binding' (bug#8460).
9158 2011-07-15 Eli Zaretskii <eliz@gnu.org>
9160 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
9161 bidi redisplay when a line includes both an image and is truncated.
9163 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
9165 Fix minor problems found by static checking.
9166 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
9167 (elsz): Now a signed constant, not a size_t var. We prefer signed
9168 types to unsigned, to avoid integer comparison confusion. Without
9169 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
9170 "cannot optimize loop, the loop counter may overflow", a symptom
9172 * indent.c (Fvertical_motion): Mark locals as initialized.
9173 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
9175 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
9177 * search.c (Fre_search_backward): Mention `case-fold-search' in
9178 all the re_search_* functions (bug#8138).
9180 * keyboard.c (Fopen_dribble_file): Document when the file is
9183 2011-07-14 Eli Zaretskii <eliz@gnu.org>
9185 * bidi.c (bidi_dump_cached_states): Fix format of displaying
9188 Support bidi reordering of display and overlay strings.
9189 * xdisp.c (compute_display_string_pos)
9190 (compute_display_string_end): Accept additional argument STRING.
9191 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
9192 (reseat_to_string): Initialize bidi_it->string.s and
9193 bidi_it->string.schars.
9194 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
9195 NULL (avoids a crash in bidi_paragraph_init).
9196 Initialize itb.string.lstring.
9197 (init_iterator): Call bidi_init_it only of a valid
9198 buffer position was specified. Initialize paragraph_embedding to
9200 (reseat_to_string): Initialize the bidi iterator.
9201 (display_string): If we need to ignore text properties of
9202 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
9203 original value of -1 will not work with bidi.)
9204 (compute_display_string_pos): First arg is now struct
9205 `text_pos *'; all callers changed. Support display properties on
9207 (compute_display_string_end): Support display properties on Lisp
9209 (init_iterator, reseat_1, reseat_to_string): Initialize the
9210 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
9211 when iterating on a string not from display properties).
9212 (compute_display_string_pos, compute_display_string_end):
9213 Fix calculation of the object to scan. Fixes an error when using
9215 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
9216 base_level_stop; instead, set base_level_stop to BEGV.
9217 Fixes crashes in vertical-motion.
9218 (next_element_from_buffer): Improve commentary for when
9219 the iterator is before prev_stop.
9220 (init_iterator): Initialize bidi_p from the default value of
9221 bidi-display-reordering, not from buffer-local value. Use the
9222 buffer-local value only if initializing for buffer iteration.
9223 (handle_invisible_prop): Support invisible properties on strings
9224 that are being bidi-reordered.
9225 (set_iterator_to_next): Support bidi reordering of C strings and
9227 (next_element_from_string): Support bidi reordering of Lisp
9229 (handle_stop_backwards): Support Lisp strings as well.
9230 (display_string): Support display of R2L glyph rows.
9231 Use IT_STRING_CHARPOS when displaying from a Lisp string.
9232 (init_iterator): Don't initialize it->bidi_p for strings
9234 (reseat_to_string): Initialize it->bidi_p for strings here.
9235 (next_element_from_string, next_element_from_c_string)
9236 (next_element_from_buffer): Add xassert's for correspondence
9237 between IT's object being iterated and it->bidi_it.string
9239 (face_before_or_after_it_pos): Support bidi iteration.
9240 (next_element_from_c_string): Handle the case of the first string
9241 character that is not the first one in the visual order.
9242 (get_visually_first_element): New function, refactored from common
9243 parts of next_element_from_buffer, next_element_from_string, and
9244 next_element_from_c_string.
9245 (tool_bar_lines_needed, redisplay_tool_bar)
9246 (display_menu_bar): Force left-to-right direction. Add a FIXME
9247 comment for making that be controlled by a user option.
9248 (push_it, pop_it): Save and restore the state of the
9249 bidi iterator. Save and restore the bidi_p flag.
9250 (pop_it): Iterate out of display property for string iteration as
9252 (iterate_out_of_display_property): Support iteration over strings.
9253 (handle_single_display_spec): Set up it->bidi_it for iteration
9254 over a display string, and call bidi_init_it.
9255 (handle_single_display_spec, next_overlay_string)
9256 (get_overlay_strings_1, push_display_prop): Set up the bidi
9257 iterator for displaying display or overlay strings.
9258 (forward_to_next_line_start): Don't use the shortcut if
9260 (back_to_previous_visible_line_start): If handle_display_prop
9261 pushed the iterator stack, restore the internal state of the bidi
9262 iterator by calling bidi_pop_it same number of times.
9263 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
9264 and we are bidi-iterating, don't decrement the iterator position;
9265 instead, set the first_elt flag in the bidi iterator, to produce
9267 (reseat_1): Remove redundant setting of string_from_display_prop_p.
9268 (push_display_prop): xassert that we are iterating a buffer.
9269 (push_it, pop_it): Save and restore paragraph_embedding member.
9270 (handle_single_display_spec, next_overlay_string)
9271 (get_overlay_strings_1, reseat_1, reseat_to_string)
9272 (push_display_prop): Set up the `unibyte' member of bidi_it.string
9273 correctly. Don't assume unibyte strings are not bidi-reordered.
9274 (compute_display_string_pos)
9275 (compute_display_string_end): Fix handling the case of C string.
9276 (push_it, pop_it): Save and restore from_disp_prop_p.
9277 (handle_single_display_spec, push_display_prop): Set the
9278 from_disp_prop_p flag.
9279 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
9280 (pop_it): Call iterate_out_of_display_property only if we are
9281 popping after iteration over a string that came from a display
9282 property. Fix a typo in popping stretch info. Add an assertion
9283 for verifying that the iterator position is in sync with the bidi
9285 (handle_single_display_spec, get_overlay_strings_1)
9286 (push_display_prop): Fix initialization of paragraph direction for
9287 string when that of the parent object is not yet determined.
9288 (reseat_1): Call bidi_init_it to resync the bidi
9289 iterator with IT's position. (Bug#7616)
9290 (find_row_edges): If ROW->start.pos gives position
9291 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
9292 (handle_stop, back_to_previous_visible_line_start, reseat_1):
9293 Reset the from_disp_prop_p flag.
9294 (SAVE_IT, RESTORE_IT): New macros.
9295 (pos_visible_p, face_before_or_after_it_pos)
9296 (back_to_previous_visible_line_start)
9297 (move_it_in_display_line_to, move_it_in_display_line)
9298 (move_it_to, move_it_vertically_backward, move_it_by_lines)
9299 (try_scrolling, redisplay_window, display_line): Use them when
9300 saving a temporary copy of the iterator and restoring it back.
9301 (back_to_previous_visible_line_start, reseat_1)
9302 (init_iterator): Empty the bidi cache "stack".
9303 (move_it_in_display_line_to): If iterator ended up at
9304 EOL, but we never saw any buffer positions smaller than
9305 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
9306 motion in bidi-reordered lines.
9307 (move_it_in_display_line_to): Record prev_method and prev_pos
9308 immediately before the call to set_iterator_to_next. Fixes cursor
9309 motion in bidi-reordered lines with stretch glyphs and strings
9310 displayed in margins. (Bug#8133) (Bug#8867)
9311 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
9313 (pos_visible_p): Support positions in bidi-reordered lines.
9314 Save and restore bidi cache.
9316 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
9317 (bidi_paragraph_info): Delete unused struct.
9318 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
9319 (bidi_cache_start): New variable.
9320 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
9322 (bidi_cache_fetch_state, bidi_cache_search)
9323 (bidi_cache_find_level_change, bidi_cache_iterator_state)
9324 (bidi_cache_find, bidi_peek_at_next_level)
9325 (bidi_level_of_next_char, bidi_find_other_level_edge)
9326 (bidi_move_to_visually_next): Compare cache index with
9327 bidi_cache_start rather than with zero.
9328 (bidi_fetch_char): Accept new argument STRING; all callers
9329 changed. Support iteration over a string. Support strings with
9330 display properties. Support unibyte strings. Fix the type of
9331 `len' according to what STRING_CHAR_AND_LENGTH expects.
9332 (bidi_paragraph_init, bidi_resolve_explicit_1)
9333 (bidi_resolve_explicit, bidi_resolve_weak)
9334 (bidi_level_of_next_char, bidi_move_to_visually_next):
9335 Support iteration over a string.
9336 (bidi_set_sor_type, bidi_resolve_explicit_1)
9337 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
9338 can now be zero (for strings); special values 0 and -1 were
9339 changed to -1 and -2, respectively.
9340 (bidi_char_at_pos): New function.
9341 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
9342 Call it instead of FETCH_MULTIBYTE_CHAR.
9343 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
9344 initialized to valid values.
9345 (bidi_init_it): Don't initialize charpos and bytepos with invalid
9347 (bidi_level_of_next_char): Allow the sentinel "position" to pass
9348 the test for valid cached positions. Fix the logic for looking up
9349 the sentinel state in the cache. GCPRO the Lisp string we are
9351 (bidi_push_it, bidi_pop_it): New functions.
9352 (bidi_initialize): Initialize the bidi cache start stack pointer.
9353 (bidi_cache_ensure_space): New function, refactored from part of
9354 bidi_cache_iterator_state. Don't assume the required size is just
9355 one BIDI_CACHE_CHUNK away.
9356 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
9357 (bidi_count_bytes, bidi_char_at_pos): New functions.
9358 (bidi_cache_search): Don't assume bidi_cache_last_idx is
9359 always valid if bidi_cache_idx is valid.
9360 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
9361 is valid if it's going to be used.
9362 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
9363 (bidi_cache_fetch_state, bidi_cache_search)
9364 (bidi_cache_find_level_change, bidi_cache_ensure_space)
9365 (bidi_cache_iterator_state, bidi_cache_find)
9366 (bidi_find_other_level_edge, bidi_cache_start_stack):
9367 All variables related to cache indices are now EMACS_INT.
9369 * dispextern.h (struct bidi_string_data): New structure.
9370 (struct bidi_it): New member `string'. Make flag members be 1-bit
9371 fields, and put them last in the struct.
9372 (compute_display_string_pos, compute_display_string_end):
9374 (bidi_push_it, bidi_pop_it): Add prototypes.
9375 (struct iterator_stack_entry): New members bidi_p,
9376 paragraph_embedding, and from_disp_prop_p.
9377 (struct it): Member bidi_p is now a bit field 1 bit wide.
9378 (bidi_shelve_cache, bidi_unshelve_cache):
9381 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
9382 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
9383 and vector-like objects.
9385 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
9386 cache around display iteration.
9388 * window.c (Fwindow_end, window_scroll_pixel_based)
9389 (displayed_window_lines, Frecenter): Save and restore the bidi
9390 cache around display iteration.
9392 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
9394 * editfns.c (Fdelete_region): Clarify the use of the named
9395 parameters (bug#6788).
9397 2011-07-14 Martin Rudalics <rudalics@gmx.at>
9399 * indent.c (Fvertical_motion): Set and restore w->pointm when
9400 saving and restoring the window's buffer (Bug#9006).
9402 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
9404 * editfns.c (Fstring_to_char): Clarify just what is returned
9405 (bug#6576). Text by Eli Zaretskii.
9407 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
9409 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
9411 2011-07-13 Eli Zaretskii <eliz@gnu.org>
9413 * buffer.c (mmap_find): Fix a typo.
9415 2011-07-13 Johan Bockgård <bojohan@gnu.org>
9417 Fix execution of x selection hooks.
9418 * xselect.c (Qx_lost_selection_functions)
9419 (Qx_sent_selection_functions): New vars.
9420 (syms_of_xselect): DEFSYM them.
9421 (x_handle_selection_request): Pass Qx_sent_selection_functions
9422 rather than Vx_sent_selection_functions to Frun_hook_with_args.
9423 (x_handle_selection_clear,x_clear_frame_selections):
9424 Pass Qx_lost_selection_functions rather than
9425 Vx_lost_selection_functions to Frun_hook_with_args.
9427 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
9429 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
9430 The old code sometimes used this field without initializing it.
9432 * alloc.c (gc_sweep): Don't read past end of array.
9433 In theory, the old code could also have corrupted Emacs internals,
9434 though it'd be very unlikely.
9436 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
9438 * character.c (Fcharacterp): Don't advertise optional ignored
9439 argument. (Bug#4026)
9441 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
9443 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
9446 * window.c (Fset_window_start): Doc fix (bug#4199).
9447 (Fset_window_hscroll): Ditto.
9449 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
9451 Fix minor new problems caught by GCC 4.6.1.
9452 * term.c (init_tty): Remove unused local.
9453 * xsettings.c (store_monospaced_changed): Define this function only
9454 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
9457 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
9459 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
9461 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
9463 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
9464 are the mini-buffer and the echo area (bug#3320).
9466 * term.c (init_tty): Remove support for supdup, c10 and perq
9467 terminals, which are no longer supported (bug#1482).
9469 2011-07-10 Johan Bockgård <bojohan@gnu.org>
9471 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
9473 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
9475 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
9476 for non-popups (Bug#3642).
9478 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
9480 * alloc.c (reset_malloc_hooks): Protoize.
9481 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
9482 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
9483 * cm.c (losecursor): Likewise.
9484 * data.c (fmod): Likewise.
9485 * dispnew.c (swap_glyphs_in_rows): Likewise.
9486 * emacs.c (memory_warning_signal): Likewise.
9487 * floatfns.c (float_error): Likewise.
9488 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
9489 (otf_open, font_otf_capability, generate_otf_features)
9490 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
9492 * image.c (pbm_read_file): Likewise.
9493 * indent.c (string_display_width): Likewise.
9494 * intervals.c (check_for_interval, search_for_interval)
9495 (inc_interval_count, count_intervals, root_interval)
9496 (adjust_intervals_for_insertion, make_new_interval): Likewise.
9497 * lread.c (defalias): Likewise.
9498 * ralloc.c (r_alloc_check): Likewise.
9499 * regex.c (set_image_of_range_1, set_image_of_range)
9500 (regex_grow_registers): Likewise.
9501 * sysdep.c (strerror): Likewise.
9502 * termcap.c (valid_filename_p, tprint, main): Likewise.
9503 * tparam.c (main): Likewise.
9504 * unexhp9k800.c (run_time_remap, save_data_space)
9505 (update_file_ptrs, read_header, write_header, calculate_checksum)
9506 (copy_file, copy_rest, display_header): Likewise.
9507 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
9509 * xdisp.c (check_it): Likewise.
9510 * xfaces.c (register_color, unregister_color, unregister_colors):
9512 * xfns.c (print_fontset_result): Likewise.
9513 * xrdb.c (member, fatal, main): Likewise.
9515 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
9517 Fix minor problems found by static checking (Bug#9031).
9518 * chartab.c (char_table_set_range, map_sub_char_table):
9519 Remove unused locals.
9520 (uniprop_table): Now static.
9521 * composite.c (_work_char): Remove unused static var.
9523 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
9525 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
9527 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
9529 * gtkutil.c (qttip_cb): Remove code without function.
9531 2011-07-09 Eli Zaretskii <eliz@gnu.org>
9533 * w32.c (pthread_sigmask): New stub.
9535 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
9537 Use pthread_sigmask, not sigprocmask (Bug#9010).
9538 sigprocmask is portable only for single-threaded applications, and
9539 Emacs can be multi-threaded when it uses GTK.
9540 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
9542 * callproc.c (Fcall_process):
9543 * process.c (create_process):
9544 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
9545 Use pthread_sigmask, not sigprocmask.
9547 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
9549 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
9550 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
9553 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
9555 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
9556 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
9557 (xg_hide_tooltip): Fix comment.
9559 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
9560 in registerServicesMenuSendTypes.
9561 (validRequestorForSendType): Don't check ns_return_types.
9563 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
9566 2011-07-08 Jason Rumney <jasonr@gnu.org>
9568 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
9569 SH_SHOW for hidden windows (Bug#5482).
9571 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
9572 frame struct members of non-existent frames (Bug#6284).
9574 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
9576 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
9577 variable firstTime not needed on OSX >= 10.6.
9578 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
9579 >= 10.5. Use setKnobProportion, setDoubleValue.
9581 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
9582 (MAC_OS_X_VERSION_10_5): Define if not defined.
9583 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
9584 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
9585 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
9587 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
9588 cString and lossyCString on OSX >= 10.4.
9590 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
9591 sizeToFit on OSX >= 10.2.
9593 * nsimage.m (allocInitFromFile): Don't use deprecated method
9594 bestRepresentationForDevice on OSX >= 10.6.
9596 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
9599 * emacs.c: Declare unexec_init_emacs_zone.
9601 * nsgui.h: Fix compiler warning about gnulib redefining verify.
9603 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
9605 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
9606 on svcsMenu (Bug#8842).
9608 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
9610 (Fns_list_services): Just return Qnil on 10.6, code not working there.
9612 * nsterm.m (QUTF8_STRING): Declare.
9613 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
9614 (validRequestorForSendType): Return type is (id).
9615 Change indexOfObjectIdenticalTo to indexOfObject.
9616 Check if we have local selection before returning self (Bug#8842).
9617 (writeSelectionToPasteboard): Put local selection into paste board
9618 if we have a local selection (Bug#8842).
9619 (syms_of_nsterm): DEFSYM QUTF8_STRING.
9621 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
9622 (ns_get_local_selection): Declare.
9624 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
9626 * keymap.c (describe_map_tree): Don't insert a double newline at
9627 the end of the buffer (bug#1169) and return whether we inserted
9630 * callint.c (Fcall_interactively): Change "reading args" to
9631 "providing args" to try to clarify what it does (bug#1010).
9633 2011-07-07 Kenichi Handa <handa@m17n.org>
9635 * composite.c (composition_compute_stop_pos): Ignore a static
9636 composition starting before CHARPOS (Bug#8915).
9638 * xdisp.c (handle_composition_prop): Likewise.
9640 2011-07-07 Eli Zaretskii <eliz@gnu.org>
9642 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
9645 2011-07-07 Kenichi Handa <handa@m17n.org>
9647 * character.h (unicode_category_t): New enum type.
9649 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
9650 (Qchar_code_property_table): New variable.
9651 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
9652 (UNIPROP_COMPRESSED_FORM_P): New macros.
9653 (char_table_ascii): Uncompress the compressed values.
9654 (sub_char_table_ref): New arg is_uniprop. Callers changed.
9655 Uncompress the compressed values.
9656 (sub_char_table_ref_and_range): Likewise.
9657 (char_table_ref_and_range): Uncompress the compressed values.
9658 (sub_char_table_set): New arg is_uniprop. Callers changed.
9659 Uncompress the compressed values.
9660 (sub_char_table_set_range): Args changed. Callers changed.
9661 (char_table_set_range): Adjuted for the above change.
9662 (map_sub_char_table): Delete args default_val and parent. Add arg
9663 top. Give decoded values to a Lisp function.
9664 (map_char_table): Adjust for the above change. Give decoded
9665 values to a Lisp function. Gcpro more variables.
9666 (uniprop_table_uncompress)
9667 (uniprop_decode_value_run_length): New functions.
9668 (uniprop_decoder, uniprop_decoder_count): New variables.
9669 (uniprop_get_decoder, uniprop_encode_value_character)
9670 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
9672 (uniprop_encoder, uniprop_encoder_count): New variables.
9673 (uniprop_get_encoder, uniprop_table)
9674 (Funicode_property_table_internal, Fget_unicode_property_internal)
9675 (Fput_unicode_property_internal): New functions.
9676 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
9677 Sunicode_property_table_internal, Sget_unicode_property_internal,
9678 and Sput_unicode_property_internal. Defvar_lisp
9679 char-code-property-alist.
9681 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
9682 Vunicode_category_table.
9684 * font.c (font_range): Adjust for the change of
9685 Vunicode_category_table.
9687 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
9689 * m/iris4d.h: Remove file, move contents ...
9690 * s/irix6-5.h: ... here.
9692 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
9694 Remove unportable assumption about struct layout (Bug#8884).
9695 * alloc.c (mark_buffer):
9696 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
9697 (clone_per_buffer_values): Don't assume that
9698 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
9699 This isn't true in general, and it's particularly not true
9700 if Emacs is configured with --with-wide-int.
9701 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
9702 New macros, used in the buffer.c change.
9704 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
9706 * xsettings.c: Use both GConf and GSettings if both are available.
9707 (store_config_changed_event): Add comment.
9708 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
9709 (store_tool_bar_style_changed): New functions.
9710 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
9711 (struct xsettings): Move font inside HAVE_XFT.
9712 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
9713 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
9714 Move inside HAVE_XFT.
9715 (something_changed_gsettingsCB): Rename from something_changedCB.
9716 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
9718 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
9719 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
9720 (something_changed_gconfCB): Rename from something_changedCB.
9721 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
9722 (parse_settings): Move check for font inside HAVE_XFT.
9723 (read_settings, apply_xft_settings): Add comment.
9724 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
9725 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
9726 call store_font_name_changed.
9727 (xft_settings_event): Add comment.
9728 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
9729 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
9730 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
9731 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
9732 (xsettings_initialize): Call init_gsettings last.
9733 (xsettings_get_system_font, xsettings_get_system_normal_font):
9736 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
9738 Random fixes. E.g., (random) never returned negative values.
9739 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
9740 subseconds part to the entropy, as that's a bit more random.
9741 Prefer signed to unsigned, since the signedness doesn't matter and
9742 in general we prefer signed. When given a limit, use a
9743 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
9744 latter isn't right if USE_2_TAGS_FOR_INTS.
9745 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
9746 not 0..VALMASK. Don't discard "excess" bits that random () returns.
9748 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
9750 * textprop.c (text_property_stickiness):
9751 Obey Vtext_property_default_nonsticky.
9752 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
9753 * w32fns.c (syms_of_w32fns):
9754 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
9756 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
9758 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
9759 This is more efficient than Ffile_directory_p and avoids a minor race.
9761 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
9763 * buffer.c (Foverlay_put): Say what the return value is
9766 * fileio.c (barf_or_query_if_file_exists): Check first if the file
9767 is a directory before asking whether to use the file name
9769 (barf_or_query_if_file_exists): Make the "File is a directory"
9770 error be more correct.
9772 * fns.c (Frequire): Remove the mention of the .gz files, since
9773 that's installation-specific, but keep the mention of
9774 `get-load-suffixes'.
9776 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
9778 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
9779 Report string overflow if the output is too long.
9781 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
9783 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
9784 (syms_of_gnutls): Remove duplicate DEFSYM for
9785 Qgnutls_bootprop_verify_hostname_error, an error for
9786 Qgnutls_bootprop_verify_error (which is no longer used).
9788 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
9789 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
9790 Also (re)move comments that are misplaced or no longer relevant.
9792 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
9794 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
9796 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
9798 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
9799 and background color parameters if they have been changed.
9801 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
9803 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
9805 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
9807 * xsettings.c (SYSTEM_FONT): Define only when used.
9808 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
9810 * keymap.c (access_keymap_1): Now static.
9812 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
9814 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
9815 leave any prefix arg for the up event (Bug#1586).
9817 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
9819 * lread.c (syms_of_lread): Mention single symbols defined by
9820 `defvar' or `defconst' (bug#7154).
9822 * fns.c (Frequire): Mention .el.gz files (bug#7314).
9823 (Frequire): Mention get-load-suffixes.
9825 2011-07-02 Martin Rudalics <rudalics@gmx.at>
9827 * window.h (window): Remove clone_number slot.
9828 * window.c (Fwindow_clone_number, Fset_window_clone_number):
9830 (make_parent_window, make_window, saved_window)
9831 (Fset_window_configuration, save_window_save): Don't deal with
9833 * buffer.c (Qclone_number): Remove declaration.
9834 (sort_overlays, overlay_strings): Don't deal with clone numbers.
9836 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
9838 Add multiple inheritance to keymaps.
9839 * keymap.c (Fmake_composed_keymap): New function.
9840 (Fset_keymap_parent): Simplify.
9841 (fix_submap_inheritance): Remove.
9842 (access_keymap_1): New function extracted from access_keymap to handle
9843 embedded parents and handle lists of maps.
9844 (access_keymap): Use it.
9845 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
9846 (Fcopy_keymap): Handle embedded parents.
9847 (Fcommand_remapping, define_as_prefix): Simplify.
9848 (Fkey_binding): Simplify.
9849 (syms_of_keymap): Move minibuffer-local-completion-map,
9850 minibuffer-local-filename-completion-map,
9851 minibuffer-local-must-match-map, and
9852 minibuffer-local-filename-must-match-map to Elisp.
9853 (syms_of_keymap): Defsubr make-composed-keymap.
9854 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
9855 (parse_menu_item): Trivial simplification.
9857 2011-07-01 Glenn Morris <rgm@gnu.org>
9859 * Makefile.in (SETTINGS_LIBS): Fix typo.
9861 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
9863 * coding.c (Fencode_coding_string): Record the last coding system
9864 used, as the function doc string says (bug#8738).
9866 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
9868 * xsettings.c (store_monospaced_changed): Take new font as arg and
9869 check for change against current_mono_font.
9870 (EMACS_TYPE_SETTINGS): Remove this and related defines.
9871 (emacs_settings_constructor, emacs_settings_get_property)
9872 (emacs_settings_set_property, emacs_settings_class_init)
9873 (emacs_settings_init, gsettings_obj): Remove.
9874 (something_changedCB): New function for HAVE_GSETTINGS.
9875 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
9876 with value as argument.
9877 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
9878 g_settings_new (Bug#8967). Do not create gsettings_obj.
9879 Remove calls to g_settings_bind. Connect something_changedCB to
9882 * xgselect.c: Add defined (HAVE_GSETTINGS).
9883 (xgselect_initialize): Ditto.
9885 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
9886 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
9889 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
9891 * eval.c (struct backtrace): Simplify and port the data structure.
9892 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
9893 signed bit field, as this assumption is not portable and it makes
9894 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
9895 "char debug_on_exit : 1" as this is not portable either; instead,
9896 use the portable "unsigned int debug_on_exit : 1". Remove unused
9897 member evalargs. Remove obsolete comments about cc bombing out.
9899 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
9901 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9902 Let HAVE_GSETTINGS override HAVE_GCONF.
9903 (store_monospaced_changed): New function.
9904 (EMACS_SETTINGS): A new type derived from GObject to handle
9905 GSettings notifications.
9906 (emacs_settings_constructor, emacs_settings_get_property)
9907 (emacs_settings_set_property, emacs_settings_class_init):
9909 (gsettings_client, gsettings_obj): New variables.
9910 (GSETTINGS_SCHEMA): New define.
9911 (something_changedCB): Call store_monospaced_changed.
9912 (init_gsettings): New function.
9913 (xsettings_initialize): Call init_gsettings.
9914 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
9917 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9920 2011-06-29 Martin Rudalics <rudalics@gmx.at>
9922 * window.c (resize_root_window, grow_mini_window)
9923 (shrink_mini_window): Rename Qresize_root_window to
9924 Qwindow_resize_root_window and Qresize_root_window_vertically to
9925 Qwindow_resize_root_window_vertically.
9927 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
9929 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
9931 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
9933 * makefile.w32-in: Redesign dependencies so they reflect more
9934 clearly which files are directly included by each source file,
9935 and not through other includes.
9937 2011-06-27 Martin Rudalics <rudalics@gmx.at>
9939 * buffer.c (Qclone_number): Declare static and DEFSYM it.
9940 (sort_overlays, overlay_strings): When an overlay's clone number
9941 matches the window's clone number process the overlay even if
9942 the overlay's window property doesn't match the current window.
9944 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
9945 (Fwindow_hchild): Rename to Fwindow_left_child.
9946 (Fwindow_next): Rename to Fwindow_next_sibling.
9947 (Fwindow_prev): Rename to Fwindow_prev_sibling.
9948 (resize_window_check): Rename to window_resize_check.
9949 (resize_window_apply): Rename to window_resize_apply.
9950 (Fresize_window_apply): Rename to Fwindow_resize_apply.
9951 (Fdelete_other_windows_internal, resize_frame_windows)
9952 (Fsplit_window_internal, Fdelete_window_internal)
9953 (grow_mini_window, shrink_mini_window)
9954 (Fresize_mini_window_internal): Fix callers accordingly.
9956 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
9958 * emacsgtkfixed.h: State that this is only used with Gtk+3.
9959 (emacs_fixed_set_min_size): Remove.
9960 (emacs_fixed_new): Take frame as argument.
9962 * emacsgtkfixed.c: State that this is only used with Gtk+3.
9963 (_EmacsFixedPrivate): Remove minwidth/height.
9964 Add struct frame *f.
9965 (emacs_fixed_init): Initialize priv->f.
9966 (get_parent_class, emacs_fixed_set_min_size): Remove.
9967 (emacs_fixed_new): Set priv->f to argument.
9968 (emacs_fixed_get_preferred_width)
9969 (emacs_fixed_get_preferred_height): Use min_width/height from
9970 frames size_hint to set minimum and natural (Bug#8919).
9971 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
9972 and use min_width/height from frames size_hint to set
9973 min_width/height (Bug#8919).
9975 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9976 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
9979 2011-06-26 Eli Zaretskii <eliz@gnu.org>
9981 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
9982 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
9985 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
9987 * process.c (wait_reading_process_output): Bypass select if
9988 waiting for a cell while ignoring keyboard input, and input is
9989 pending. Suggested by Jan Djärv (Bug#8869).
9991 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
9993 Use gnulib's dup2 module instead of rolling our own.
9994 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
9996 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9998 * dispnew.c (scrolling_window): Before scrolling, turn off a
9999 mouse-highlight in the window being scrolled.
10001 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
10003 Move DEFSYM to lisp.h and use everywhere.
10005 * character.h (DEFSYM): Move declaration...
10006 * lisp.h (DEFSYM): ...here.
10012 * w32select.c: Don't include character.h.
10014 * alloc.c (syms_of_alloc):
10015 * buffer.c (syms_of_buffer):
10016 * bytecode.c (syms_of_bytecode):
10017 * callint.c (syms_of_callint):
10018 * casefiddle.c (syms_of_casefiddle):
10019 * casetab.c (init_casetab_once):
10020 * category.c (init_category_once, syms_of_category):
10021 * ccl.c (syms_of_ccl):
10022 * cmds.c (syms_of_cmds):
10023 * composite.c (syms_of_composite):
10024 * dbusbind.c (syms_of_dbusbind):
10025 * dired.c (syms_of_dired):
10026 * dispnew.c (syms_of_display):
10027 * doc.c (syms_of_doc):
10028 * editfns.c (syms_of_editfns):
10029 * emacs.c (syms_of_emacs):
10030 * eval.c (syms_of_eval):
10031 * fileio.c (syms_of_fileio):
10032 * fns.c (syms_of_fns):
10033 * frame.c (syms_of_frame):
10034 * fringe.c (syms_of_fringe):
10035 * insdel.c (syms_of_insdel):
10036 * keymap.c (syms_of_keymap):
10037 * lread.c (init_obarray, syms_of_lread):
10038 * macros.c (syms_of_macros):
10039 * msdos.c (syms_of_msdos):
10040 * print.c (syms_of_print):
10041 * process.c (syms_of_process):
10042 * search.c (syms_of_search):
10043 * sound.c (syms_of_sound):
10044 * syntax.c (init_syntax_once, syms_of_syntax):
10045 * terminal.c (syms_of_terminal):
10046 * textprop.c (syms_of_textprop):
10047 * undo.c (syms_of_undo):
10048 * w32.c (globals_of_w32):
10049 * window.c (syms_of_window):
10050 * xdisp.c (syms_of_xdisp):
10051 * xfaces.c (syms_of_xfaces):
10052 * xfns.c (syms_of_xfns):
10053 * xmenu.c (syms_of_xmenu):
10054 * xsettings.c (syms_of_xsettings):
10055 * xterm.c (syms_of_xterm): Use DEFSYM.
10057 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
10059 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
10061 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
10063 Integer and buffer overflow fixes (Bug#8873).
10065 * print.c (printchar, strout): Check for string overflow.
10066 (PRINTPREPARE, printchar, strout):
10067 Don't set size unless allocation succeeds.
10069 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
10070 for sizes. Check for string overflow more accurately.
10071 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
10073 * macros.c: Integer and buffer overflow fixes.
10074 * keyboard.h (struct keyboard.kbd_macro_bufsize):
10075 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
10076 Use ptrdiff_t, not int, for sizes.
10077 Don't increment bufsize until after realloc succeeds.
10078 Check for size-calculation overflow.
10079 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
10081 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
10083 * lread.c: Integer overflow fixes.
10084 (read_integer): Radix is now EMACS_INT, not int,
10085 to improve quality of diagnostics for out-of-range radices.
10086 Calculate buffer size correctly for out-of-range radices.
10087 (read1): Check for integer overflow in radices, and in
10088 read-circle numbers.
10089 (read_escape): Avoid int overflow.
10090 (Fload, openp, read_buffer_size, read1)
10091 (substitute_object_recurse, read_vector, read_list, map_obarray):
10092 Use ptrdiff_t, not int, for sizes.
10093 (read1): Use EMACS_INT, not int, for sizes.
10094 Check for size overflow.
10096 * image.c (cache_image): Check for size arithmetic overflow.
10098 * lread.c: Integer overflow issues.
10099 (saved_doc_string_size, saved_doc_string_length)
10100 (prev_saved_doc_string_size, prev_saved_doc_string_length):
10101 Now ptrdiff_t, not int.
10102 (read1): Don't assume doc string length fits in int. Check for
10103 out-of-range doc string lengths.
10104 (read_list): Don't assume file position fits in int.
10105 (read_escape): Check for hex character overflow.
10107 2011-06-22 Leo Liu <sdl.web@gmail.com>
10109 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
10110 Move to minibuffer.el.
10112 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
10114 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
10115 The following patches are for when GLYPH_DEBUG && !XASSERT.
10116 * dispextern.h (trace_redisplay_p, dump_glyph_string):
10117 * dispnew.c (flush_stdout):
10118 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
10119 Mark as externally visible.
10120 * dispnew.c (check_window_matrix_pointers): Now static.
10121 * dispnew.c (window_to_frame_vpos):
10122 * xfns.c (unwind_create_frame):
10123 * xterm.c (x_check_font): Remove unused local.
10124 * scroll.c (CHECK_BOUNDS):
10125 * xfaces.c (cache_fache): Rename local to avoid shadowing.
10126 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
10127 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
10128 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
10129 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
10131 (debug_method_add): Use va_list and vsprintf rather than relying
10132 on undefined behavior with wrong number of arguments.
10133 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
10134 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
10135 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
10136 since we're not interested in debugging glyphs with old libraries.
10137 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
10138 GCC 4.6.0's static checking.
10140 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
10142 Integer overflow and signedness fixes (Bug#8873).
10143 A few related buffer overrun fixes, too.
10145 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
10147 * dispextern.h (struct face.stipple):
10148 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
10149 (x_bitmap_mask, x_allocate_bitmap_record)
10150 (x_create_bitmap_from_data, x_create_bitmap_from_file)
10151 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
10152 (x_create_bitmap_from_xpm_data):
10153 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
10154 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
10156 * xfaces.c (load_pixmap):
10157 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
10158 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
10159 (.bitmaps_last, struct x_output.icon_bitmap):
10160 Use ptrdiff_t, not int, for bitmap indexes.
10161 (x_allocate_bitmap_record): Check for size overflow.
10162 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
10164 Use ptrdiff_t, not int, for overlay counts.
10165 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
10166 * editfns.c (overlays_around, get_pos_property):
10167 * textprop.c (get_char_property_and_overlay):
10168 * xdisp.c (next_overlay_change, note_mouse_highlight):
10169 * xfaces.c (face_at_buffer_position):
10170 * buffer.c (OVERLAY_COUNT_MAX): New macro.
10171 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
10172 (Fnext_overlay_change, Fprevious_overlay_change)
10173 (mouse_face_overlay_overlaps, Foverlays_in):
10174 Use ptrdiff_t, not int, for sizes.
10175 (overlays_at, overlays_in): Check for size-calculation overflow.
10177 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
10179 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
10180 (x_session_initialize): Do not assume string length fits in int.
10182 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
10183 This is unlikely, but can occur if DPI is outlandish.
10185 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
10186 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
10188 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
10189 * xrdb.c (magic_file_p, search_magic_path):
10190 Omit last arg SUFFIX; it was always 0. All callers changed.
10191 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
10193 * xfont.c (xfont_match): Avoid need for strlen.
10195 * xfns.c: Don't assume strlen fits in int.
10196 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
10198 * xdisp.c (message_log_check_duplicate): Return intmax_t,
10199 not unsigned long, as we prefer signed integers. All callers changed.
10200 Detect integer overflow in repeat count.
10201 (message_dolog): Don't assume print length fits in 39 bytes.
10202 (display_mode_element): Don't assume strlen fits in int.
10204 * termcap.c: Don't assume sizes fit in int and never overflow.
10205 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
10206 (gobble_line): Check for size-calculation overflow.
10208 * minibuf.c (Fread_buffer):
10209 * lread.c (intern, intern_c_string):
10210 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
10211 Don't assume string length fits in int.
10213 * keyboard.c (parse_tool_bar_item):
10214 * gtkutil.c (style_changed_cb): Avoid need for strlen.
10216 * font.c: Don't assume string length fits in int.
10217 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
10218 Use ptrdiff_t, not int.
10219 (font_intern_prop): Don't assume string length fits in int.
10220 Don't assume integer property fits in fixnum.
10221 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
10223 * filelock.c: Fix some buffer overrun and integer overflow issues.
10224 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
10225 Reformulate so as not to need the command string.
10226 Invoke gzip -cd rather than gunzip, as it's more portable.
10227 (lock_info_type, lock_file_1, lock_file):
10228 Don't assume pid_t and time_t fit in unsigned long.
10229 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
10230 (current_lock_owner): Prefer signed type for sizes.
10231 Use memcpy, not strncpy, where memcpy is what is really wanted.
10232 Don't assume (via atoi) that time_t and pid_t fit in int.
10233 Check for time_t and/or pid_t out of range, e.g., via a network share.
10234 Don't alloca where an auto var works fine.
10236 * fileio.c: Fix some integer overflow issues.
10237 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
10238 Don't assume string length fits in int.
10239 (directory_file_name): Don't assume string length fits in long.
10240 (make_temp_name): Don't assume pid fits in int, or that its print
10241 length is less than 20.
10243 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
10245 * coding.c (make_subsidiaries): Don't assume string length fits in int.
10247 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
10249 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
10250 We prefer signed integers, even for size calculations.
10252 * emacs.c: Don't assume string length fits in 'int'.
10253 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
10254 (main): Don't invoke strlen when not needed.
10256 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
10257 (XD_DEBUG_MESSAGE): Don't waste a byte.
10259 * callproc.c (getenv_internal_1, getenv_internal)
10260 (Fgetenv_internal):
10261 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
10263 * lread.c (invalid_syntax): Omit length argument.
10264 All uses changed. This doesn't fix a bug, but it simplifies the
10265 code away from its former Hollerith-constant appearance, and it's
10266 one less 'int' to worry about when looking at integer-overflow issues.
10267 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
10269 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
10270 This didn't break anything, but it didn't help either.
10271 It's confusing to put a bogus integer in a place where the actual
10272 value does not matter.
10273 (LIST_END_P): Remove unused macro and its bogus comment.
10274 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
10276 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
10277 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
10279 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
10280 We prefer signed types, and the value cannot exceed the EMACS_INT
10281 range anyway (because otherwise the length would not be representable).
10282 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
10283 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
10284 This avoids a GCC warning when WIDE_EMACS_INT.
10286 * indent.c (sane_tab_width): New function.
10287 (current_column, scan_for_column, Findent_to, position_indentation)
10288 (compute_motion): Use it. This is just for clarity.
10289 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
10291 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
10293 * lisp.h (lint_assume): New macro.
10294 * composite.c (composition_gstring_put_cache):
10295 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
10297 * editfns.c, insdel.c:
10298 Omit unnecessary forward decls, to simplify future changes.
10300 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
10302 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
10304 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
10305 Use much-faster test for byte-length change.
10306 Don't assume string byte-length fits in 'int'.
10307 Check that character arg fits in 'int'.
10308 (mapcar1): Declare byte as byte, for clarity.
10310 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
10312 * fns.c (concat): Catch string overflow earlier.
10313 Do not rely on integer wraparound.
10315 * dispextern.h (struct it.overlay_strings_charpos)
10316 (struct it.selective): Now EMACS_INT, not int.
10317 * xdisp.c (forward_to_next_line_start)
10318 (back_to_previous_visible_line_start)
10319 (reseat_at_next_visible_line_start, next_element_from_buffer):
10320 Don't arbitrarily truncate the value of 'selective' to int.
10322 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
10324 * composite.c: Don't truncate sizes to 'int'.
10325 (composition_gstring_p, composition_reseat_it)
10326 (composition_adjust_point): Use EMACS_INT, not int.
10327 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
10328 not EMACS_UINT, for indexes.
10330 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
10332 * buffer.c: Include <verify.h>.
10333 (struct sortvec.priority, struct sortstr.priority):
10334 Now EMACS_INT, not int.
10335 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
10336 (struct sortstr.size, record_overlay_string)
10337 (struct sortstrlist.size, struct sortlist.used):
10338 Don't truncate size to int.
10339 (record_overlay_string): Check for size-calculation overflow.
10340 (init_buffer_once): Check at compile-time, not run-time.
10342 2011-06-22 Jim Meyering <meyering@redhat.com>
10344 Don't leak an XBM-image-sized buffer
10345 * image.c (xbm_load): Free the image buffer after using it.
10347 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
10350 * composite.c (find_automatic_composition): Omit needless 'return 0;'
10351 that Sun C diagnosed.
10352 * fns.c (secure_hash): Fix pointer signedness issue.
10353 * intervals.c (static_offset_intervals): New function.
10354 (offset_intervals): Use it.
10356 2011-06-21 Leo Liu <sdl.web@gmail.com>
10359 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
10362 * fns.c (secure_hash): Rename from crypto_hash_function and change
10363 the first arg to accept symbols.
10364 (Fsecure_hash): New primitive.
10365 (syms_of_fns): New symbols.
10367 2011-06-20 Deniz Dogan <deniz@dogan.se>
10369 * process.c (Fset_process_buffer): Clarify return value in
10372 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
10374 * dispnew.c (add_window_display_history): Use BVAR.
10376 * xdisp.c (debug_method_add): Use BVAR.
10377 (check_window_end, dump_glyph_matrix, dump_glyph)
10378 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
10380 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
10383 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
10384 check till after the cache is created in init_frame_faces.
10386 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
10388 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
10390 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
10392 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
10393 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
10394 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
10396 Improve buffer-overflow checking (Bug#8873).
10397 * fileio.c (Finsert_file_contents):
10398 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
10399 Remove the old (too-loose) buffer overflow checks.
10400 They weren't needed, since make_gap checks for buffer overflow.
10401 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
10402 The old code merely checked for Emacs fixnum overflow, and relied
10403 on undefined (wraparound) behavior. The new code avoids undefined
10404 behavior, and also checks for ptrdiff_t and/or size_t overflow.
10406 * editfns.c (Finsert_char): Don't dump core with very negative counts.
10407 Tune. Don't use wider integers than needed. Don't use alloca.
10408 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
10410 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
10412 * insdel.c, lisp.h (buffer_overflow): New function.
10413 (insert_from_buffer_1, replace_range, replace_range_2):
10414 * insdel.c (make_gap_larger):
10415 * editfns.c (Finsert_char):
10416 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
10418 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
10420 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
10422 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
10424 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
10425 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
10427 * fileio.c: Don't assume EMACS_INT fits in off_t.
10428 (emacs_lseek): New static function.
10429 (Finsert_file_contents, Fwrite_region): Use it.
10430 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
10432 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
10434 * fns.c: Don't overflow int when computing a list length.
10435 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
10436 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
10437 truncation on 64-bit hosts. Check for QUIT every
10438 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
10439 faster and is responsive enough.
10440 (Flength): Report an error instead of overflowing an integer.
10441 (Fsafe_length): Return a float if the value is not representable
10442 as a fixnum. This shouldn't happen except in contrived situations.
10443 (Fnthcdr, Fsort): Don't assume list length fits in int.
10444 (Fcopy_sequence): Don't assume vector length fits in int.
10446 * alloc.c: Check that resized vectors' lengths fit in fixnums.
10447 (header_size, word_size): New constants.
10448 (allocate_vectorlike): Don't check size overflow here.
10449 (allocate_vector): Check it here instead, since this is the only
10450 caller of allocate_vectorlike that could cause overflow.
10451 Check that the new vector's length is representable as a fixnum.
10453 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
10454 The previous code was bogus. For example, next_almost_prime (32)
10455 returned 39, which is undesirable as it is a multiple of 3; and
10456 next_almost_prime (24) returned 25, which is a multiple of 5 so
10457 why was the code bothering to check for multiples of 7?
10459 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
10461 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
10463 Variadic C functions now count arguments with ptrdiff_t.
10464 This partly undoes my 2011-03-30 change, which replaced int with size_t.
10465 Back then I didn't know that the Emacs coding style prefers signed int.
10466 Also, in the meantime I found a few more instances where arguments
10467 were being counted with int, which may truncate counts on 64-bit
10468 machines, or EMACS_INT, which may be unnecessarily wide.
10469 * lisp.h (struct Lisp_Subr.function.aMANY)
10470 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
10471 Arg counts are now ptrdiff_t, not size_t.
10472 All variadic functions and their callers changed accordingly.
10473 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
10474 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
10475 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
10476 * callint.c (Fcall_interactively): Check arg count for overflow,
10477 to avoid potential buffer overrun. Use signed char, not 'int',
10478 for 'varies' array, so that we needn't bother to check its size
10479 calculation for overflow.
10480 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
10481 * eval.c (apply_lambda):
10482 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
10483 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
10484 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
10486 * callint.c (Fcall_interactively): Don't use index var as event count.
10488 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
10489 * mem-limits.h (SIZE): Remove; no longer used.
10491 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
10493 Remove unnecessary casts.
10494 * xterm.c (x_term_init):
10495 * xfns.c (x_set_border_pixel):
10496 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
10497 These aren't needed now that we assume ANSI C.
10499 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
10500 It's more likely to cause problems (due to unsigned overflow)
10503 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
10505 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
10507 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
10509 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
10511 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
10513 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
10515 GLYPH_CODE_FACE returns EMACS_INT, not int.
10516 * dispextern.h (merge_faces):
10517 * xfaces.c (merge_faces):
10518 * xdisp.c (get_next_display_element, next_element_from_display_vector):
10519 Don't assume EMACS_INT fits in int.
10521 * character.h (CHAR_VALID_P): Remove unused parameter.
10522 * fontset.c, lisp.h, xdisp.c: All uses changed.
10524 * editfns.c (Ftranslate_region_internal): Omit redundant test.
10526 * fns.c (concat): Minor tuning based on overflow analysis.
10527 This doesn't fix any bugs. Use int to hold character, instead
10528 of constantly refetching from Emacs object. Use XFASTINT, not
10529 XINT, for value known to be a character. Don't bother comparing
10530 a single byte to 0400, as it's always less.
10532 * floatfns.c (Fexpt):
10533 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
10535 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
10538 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
10540 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
10541 Without this fix, on a 64-bit host (aset S 0 4294967386) would
10542 incorrectly succeed when S was a string, because 4294967386 was
10543 truncated before it was used.
10545 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
10546 Otherwise, an out-of-range integer could cause undefined behavior
10549 * composite.c: Use int, not EMACS_INT, for characters.
10550 (fill_gstring_body, composition_compute_stop_pos): Use int, not
10551 EMACS_INT, for values that are known to be in character range.
10552 This doesn't fix any bugs but is the usual style inside Emacs and
10553 may generate better code on 32-bit machines.
10555 Make sure a 64-bit char is never passed to ENCODE_CHAR.
10556 This is for reasons similar to the recent CHAR_STRING fix.
10557 * charset.c (Fencode_char): Check that character arg is actually
10558 a character. Pass an int to ENCODE_CHAR.
10559 * charset.h (ENCODE_CHAR): Verify that the character argument is no
10560 wider than 'int', as a compile-time check to prevent future regressions
10563 * character.c (char_string): Remove unnecessary casts.
10565 Make sure a 64-bit char is never passed to CHAR_STRING.
10566 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
10567 by silently ignoring the top 32 bits, allowing some values
10568 that were far too large to be valid characters.
10569 * character.h: Include <verify.h>.
10570 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
10571 arguments are no wider than unsigned, as a compile-time check
10572 to prevent future regressions in this area.
10574 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
10575 (Fsubst_char_in_region):
10577 * xdisp.c (decode_mode_spec_coding):
10578 Adjust to CHAR_STRING's new requirement.
10579 * editfns.c (Finsert_char, Fsubst_char_in_region):
10580 * fns.c (concat): Check that character args are actually
10581 characters. Without this test, these functions did the wrong
10582 thing with wildly out-of-range values on 64-bit hosts.
10584 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
10585 These casts should not be needed on 32-bit hosts, either.
10586 * keyboard.c (read_char):
10587 * lread.c (Fload): Remove casts to unsigned.
10589 * lisp.h (UNSIGNED_CMP): New macro.
10590 This fixes comparison bugs on 64-bit hosts.
10591 (ASCII_CHAR_P): Use it.
10592 * casefiddle.c (casify_object):
10593 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
10594 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
10595 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
10596 * dispextern.h (FACE_FROM_ID):
10597 * keyboard.c (read_char): Use UNSIGNED_CMP.
10599 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
10600 not to EMACS_INT, to avoid GCC warning.
10602 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
10604 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
10605 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
10606 isn't needed on 32-bit machines.
10608 * buffer.c (Fgenerate_new_buffer_name):
10609 Use EMACS_INT for count, not int.
10610 (advance_to_char_boundary): Return EMACS_INT, not int.
10612 * data.c (Qcompiled_function): Now static.
10614 * window.c (window_body_lines): Now static.
10616 * image.c (gif_load): Rename local to avoid shadowing.
10618 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
10619 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
10620 * alloc.c (make_save_value): Integer argument is now of type
10621 ptrdiff_t, not int.
10622 (mark_object): Use ptrdiff_t, not int.
10623 * lisp.h (pD): New macro.
10624 * print.c (print_object): Use it.
10626 * alloc.c: Use EMACS_INT, not int, to count objects.
10627 (total_conses, total_markers, total_symbols, total_vector_size)
10628 (total_free_conses, total_free_markers, total_free_symbols)
10629 (total_free_floats, total_floats, total_free_intervals)
10630 (total_intervals, total_strings, total_free_strings):
10631 Now EMACS_INT, not int. All uses changed.
10632 (Fgarbage_collect): Compute overall total using a double, so that
10633 integer overflow is less likely to be a problem. Check for overflow
10634 when converting back to an integer.
10635 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
10636 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
10637 These were 'int' variables that could overflow on 64-bit hosts;
10638 they were never used, so remove them instead of repairing them.
10639 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
10640 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
10641 Previously, this ceilinged at INT_MAX, but that doesn't work on
10643 (allocate_pseudovector): Don't use EMACS_INT when int would do.
10645 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
10646 (allocate_vectorlike): Check for ptrdiff_t overflow.
10647 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
10648 when a (possibly-narrower) signed value would do just as well.
10649 We prefer using signed arithmetic, to avoid comparison confusion.
10651 * alloc.c: Catch some string size overflows that we were missing.
10652 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
10653 for convenience in STRING_BYTES_MAX.
10654 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
10655 The definition here is exact; the one in lisp.h was approximate.
10656 (allocate_string_data): Check for string overflow. This catches
10657 some instances we weren't catching before. Also, it catches
10658 size_t overflow on (unusual) hosts where SIZE_MAX <= min
10659 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
10660 and ptrdiff_t and EMACS_INT are both 64 bits.
10662 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
10663 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
10664 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
10666 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
10668 * alloc.c (Fmake_string): Check for out-of-range init.
10670 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
10672 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
10674 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
10676 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
10677 xg_get_default_scrollbar_width.
10679 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
10680 (int_gtk_range_get_value): Move to the scroll bar part of the file.
10681 (style_changed_cb): Call update_theme_scrollbar_width and call
10682 x_set_scroll_bar_default_width and xg_frame_set_char_size for
10683 all frames (Bug#8505).
10684 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
10685 Call gtk_window_set_resizable if HAVE_GTK3.
10686 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
10687 and height if HAVE_GTK3 (Bug#8505).
10688 (scroll_bar_width_for_theme): New variable.
10689 (update_theme_scrollbar_width): New function.
10690 (xg_get_default_scrollbar_width): Move code to
10691 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
10692 (xg_initialize): Call update_theme_scrollbar_width.
10694 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
10696 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
10698 2011-06-12 Martin Rudalics <rudalics@gmx.at>
10700 * frame.c (make_frame): Call other_buffer_safely instead of
10703 * window.c (temp_output_buffer_show): Call display_buffer with
10704 second argument Vtemp_buffer_show_specifiers and reset latter
10705 immediately after the call.
10706 (Vtemp_buffer_show_specifiers): New variable.
10707 (auto_window_vscroll_p, next_screen_context_lines)
10708 (Vscroll_preserve_screen_position): Remove leading asterisks from
10711 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
10713 Fix minor problems found by GCC 4.6.0 static checking.
10714 * buffer.c (Qclone_number): Remove for now, as it's unused.
10715 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
10716 (record_buffer): Remove unused local.
10717 * frame.c (other_visible_frames, frame_buffer_list): Now static.
10718 (set_frame_buffer_list): Remove; unused.
10719 * frame.h (other_visible_frames): Remove decl.
10720 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
10721 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
10722 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
10724 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
10725 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
10726 Define only if HAVE_GPM.
10727 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
10728 (update_hints_inhibit): Remove; never set. All uses removed.
10729 * widgetprv.h (emacsFrameClassRec): Remove decl.
10730 * window.c (delete_deletable_window): Now returns void, since it
10731 wasn't returning anything.
10732 (compare_window_configurations): Remove unused locals.
10733 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
10734 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
10735 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
10736 the same widths as pointers. This follows up on the 2011-05-06 patch.
10737 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
10738 * xterm.h: Likewise.
10739 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
10741 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
10743 * makefile.w32-in: Update dependencies.
10744 (LISP_H): Add lib/intprops.h.
10746 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
10748 * image.c (gif_load): Add animation frame delay to the metadata.
10749 (syms_of_image): Use DEFSYM. New symbol `delay'.
10751 2011-06-11 Martin Rudalics <rudalics@gmx.at>
10753 * window.c (delete_deletable_window): Re-add.
10754 (Fset_window_configuration): Rewrite to handle dead buffers and
10755 consequently deletable windows.
10756 (window_tree, Fwindow_tree): Remove. Supply functionality in
10758 (compare_window_configurations): Simplify code.
10760 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
10762 * image.c (imagemagick_load_image): Fix type mismatch.
10763 (Fimagemagick_types): Likewise.
10765 * window.h (replace_buffer_in_windows): Declare.
10767 2011-06-11 Martin Rudalics <rudalics@gmx.at>
10769 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
10770 Qclone_number. Remove external declaration of Qdelete_window.
10771 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
10773 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
10774 Run Qbuffer_list_update_hook if allowed.
10775 (Fother_buffer): Rewrite doc-string. Major rewrite for new
10776 buffer list implementation.
10777 (other_buffer_safely): New function.
10778 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
10779 calls to replace_buffer_in_windows and
10780 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
10782 (record_buffer): Inhibit quitting and rewrite using quittable
10783 functions. Run Qbuffer_list_update_hook if allowed.
10784 (Frecord_buffer, Funrecord_buffer): New functions.
10785 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
10786 Move switch-to-buffer to window.el.
10787 (bury-buffer): Move to window.el.
10788 (Vbuffer_list_update_hook): New variable.
10790 * lisp.h (other_buffer_safely): Add prototype in buffer.c
10793 * window.h (resize_frame_windows): Move up in code.
10794 (Fwindow_frame): Remove EXFUN.
10795 (replace_buffer_in_all_windows): Remove prototype.
10796 (replace_buffer_in_windows_safely): Add prototype.
10798 * window.c: Declare Qdelete_window static again. Move down
10799 declaration of select_count.
10800 (Fnext_window, Fprevious_window): Rewrite doc-strings.
10801 (Fother_window): Move to window.el.
10802 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
10803 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
10804 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
10806 (replace_buffer_in_windows): Implement by calling
10807 Qreplace_buffer_in_windows.
10808 (replace_buffer_in_all_windows): Remove with some functionality
10809 moved into replace_buffer_in_windows_safely.
10810 (replace_buffer_in_windows_safely): New function.
10811 (select_window_norecord, select_frame_norecord): Move in front
10812 of run_window_configuration_change_hook. Remove now obsolete
10814 (Fset_window_buffer): Rewrite doc-string.
10815 Call Qrecord_window_buffer.
10816 (keys_of_window): Move binding for other-window to window.el.
10818 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
10820 * dispextern.h (struct image): Replace data member, whose int_val
10821 and ptr_val fields were not used by anything, with a single
10824 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
10825 (gif_clear_image, gif_load, imagemagick_load_image)
10826 (gs_clear_image, gs_load): Callers changed.
10828 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
10830 * buffer.h: Include <time.h>, for time_t.
10831 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
10833 Fix minor problems found by static checking.
10835 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
10837 Make identifiers static if they are not used in other modules.
10838 * data.c (Qcompiled_function, Qframe, Qvector):
10839 * image.c (QimageMagick, Qsvg):
10840 * minibuf.c (Qmetadata):
10841 * window.c (resize_window_check, resize_root_window): Now static.
10842 * window.h (resize_window_check, resize_root_window): Remove decls.
10844 * window.c (window_deletion_count, delete_deletable_window):
10846 (window_body_lines): Now static.
10847 (Fdelete_other_windows_internal): Mark vars as initialized.
10848 Make sure 'resize_failed' is initialized.
10849 (run_window_configuration_change_hook): Rename local to avoid shadowing.
10850 (resize_window_apply): Remove unused local.
10851 * window.h (delete_deletable_window): Remove decl.
10853 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
10854 (imagemagick_load_image): Fix pointer signedness problem by changing
10855 last arg from unsigned char * to char *. All uses changed.
10856 Also, fix a local for similar reasons.
10857 Remove unused locals. Remove locals to avoid shadowing.
10858 (fn_rsvg_handle_free): Remove; unused.
10859 (svg_load, svg_load_image): Fix pointer signedness problem.
10860 (imagemagick_load_image): Don't use garbage pointer image_wand.
10862 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
10864 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
10866 * image.c (gif_load): Fix omitted cast error introduced by
10869 2011-06-10 Martin Rudalics <rudalics@gmx.at>
10871 * window.h (resize_proportionally, orig_total_lines)
10872 (orig_top_line): Remove from window structure.
10873 (set_window_height, set_window_width, change_window_heights)
10874 (Fdelete_window): Remove prototypes.
10875 (resize_frame_windows): Remove duplicate declaration.
10877 2011-06-10 Eli Zaretskii <eliz@gnu.org>
10879 * window.h (resize_frame_windows, resize_window_check)
10880 (delete_deletable_window, resize_root_window)
10881 (resize_frame_windows): Declare prototypes.
10883 * window.c (resize_window_apply): Make definition be "static" to
10884 match the prototype.
10886 2011-06-10 Martin Rudalics <rudalics@gmx.at>
10888 * window.c: Remove declarations of Qwindow_size_fixed,
10889 window_min_size_1, window_min_size_2, window_min_size,
10890 size_window, window_fixed_size_p, enlarge_window, delete_window.
10891 Remove static from declaration of Qdelete_window, it's
10892 temporarily needed by Fbury_buffer.
10893 (replace_window): Don't assign orig_top_line and
10895 (Fdelete_window, delete_window): Remove. Window deletion is
10896 handled by window.el.
10897 (window_loop): Remove DELETE_OTHER_WINDOWS case.
10898 Replace Fdelete_window calls with calls to Qdelete_window.
10899 (Fdelete_other_windows): Remove. Deleting other windows is
10900 handled by window.el.
10901 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
10902 handled in window.el.
10903 (window_min_size_2, window_min_size_1, window_min_size): Remove.
10904 Window minimum sizes are handled in window.el.
10905 (shrink_windows, size_window, set_window_height)
10906 (set_window_width, change_window_heights, window_height)
10907 (window_width, CURBEG, CURSIZE, enlarge_window)
10908 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
10909 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
10910 handled in window.el.
10911 (make_dummy_parent): Rename to make_parent_window and give it a
10912 second argument horflag.
10913 (make_window): Don't set resize_proportionally any more.
10914 (Fsplit_window): Remove. Windows are split in window.el.
10915 (save_restore_action, save_restore_orig_size)
10916 (shrink_window_lowest_first, save_restore_orig_size): Remove.
10917 Resize mini windows in window.el.
10918 (grow_mini_window, shrink_mini_window): Implement by calling
10919 Qresize_root_window_vertically, resize_window_check and
10920 resize_window_apply.
10921 (saved_window, Fset_window_configuration, save_window_save):
10922 Do not handle orig_top_line, orig_total_lines, and
10923 resize_proportionally.
10924 (window_min_height, window_min_width): Move to window.el.
10925 (keys_of_window): Move bindings for delete-other-windows,
10926 split-window, delete-window and enlarge-window to window.el.
10928 * buffer.c: Temporarily extern Qdelete_window.
10929 (Fbury_buffer): Temporarily call Qdelete_window instead of
10930 Fdelete_window (Fbury_buffer will move to window.el soon).
10932 * frame.c (set_menu_bar_lines_1): Remove code handling
10933 orig_top_line and orig_total_lines.
10935 * dispnew.c (adjust_frame_glyphs_initially): Don't use
10936 set_window_height but set heights directly.
10937 (change_frame_size_1): Use resize_frame_windows.
10939 * xdisp.c (init_xdisp): Don't use set_window_height but set
10942 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
10943 Use resize_frame_windows instead of change_window_heights and run
10944 run_window_configuration_change_hook.
10946 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
10947 instead of change_window_heights and run
10948 run_window_configuration_change_hook.
10950 2011-06-09 Martin Rudalics <rudalics@gmx.at>
10952 * window.c (replace_window): Rename second argument REPLACEMENT to
10953 NEW. New third argument SETFLAG. Rewrite.
10954 (delete_window, make_dummy_parent): Call replace_window with
10956 (window_list_1): Move down in code.
10957 (run_window_configuration_change_hook): Move set_buffer part
10958 before select_frame_norecord part in order to unwind correctly.
10959 Rename count1 to count.
10960 (recombine_windows, delete_deletable_window, resize_root_window)
10961 (Fdelete_other_windows_internal)
10962 (Frun_window_configuration_change_hook, make_parent_window)
10963 (resize_window_check, resize_window_apply, Fresize_window_apply)
10964 (resize_frame_windows, Fsplit_window_internal)
10965 (Fdelete_window_internal, Fresize_mini_window_internal):
10967 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
10969 2011-06-08 Martin Rudalics <rudalics@gmx.at>
10971 * window.h (window): Add some new members to window structure -
10972 normal_lines, normal_cols, new_total, new_normal, clone_number,
10973 splits, nest, prev_buffers, next_buffers.
10974 (WINDOW_TOTAL_SIZE): Move here from window.c.
10975 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
10977 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
10979 (make_dummy_parent): Set new members of windows structure.
10980 (make_window): Move down in code. Handle new members of window
10982 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
10983 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
10984 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
10985 (Fset_window_prev_buffers, Fwindow_next_buffers)
10986 (Fset_window_next_buffers, Fset_window_clone_number):
10988 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
10989 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
10991 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
10992 Argument WINDOW can be now internal window too.
10993 (Fwindow_use_time): Move up in code.
10994 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
10995 Rewrite doc-string.
10996 (Fset_window_configuration, saved_window)
10997 (Fcurrent_window_configuration, save_window_save): Handle new
10998 members of window structure.
10999 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
11000 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
11001 (syms_of_window): New Lisp objects Qrecord_window_buffer,
11002 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
11003 Qget_mru_window, Qresize_root_window,
11004 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
11005 Qauto_buffer_name; staticpro them.
11007 2011-06-07 Martin Rudalics <rudalics@gmx.at>
11009 * window.c (Fwindow_total_size, Fwindow_left_column)
11010 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
11011 (Fwindow_list_1): New functions.
11012 (window_box_text_cols): Replace with window_body_cols.
11013 (Fwindow_width, Fscroll_left, Fscroll_right):
11014 Use window_body_cols instead of window_box_text_cols.
11015 (delete_window, Fset_window_configuration):
11016 Call delete_all_subwindows with window as argument.
11017 (delete_all_subwindows): Take a window as argument and not a
11018 structure. Rewrite.
11019 (window_loop): Remove handling of GET_LRU_WINDOW and
11020 GET_LARGEST_WINDOW.
11021 (Fget_lru_window, Fget_largest_window): Move to window.el.
11023 * window.h: Extern window_body_cols instead of
11024 window_box_text_cols. delete_all_subwindows now takes a
11025 Lisp_Object as argument.
11027 * indent.c (compute_motion, Fcompute_motion):
11028 Use window_body_cols instead of window_box_text_cols.
11030 * frame.c (delete_frame): Call delete_all_subwindows with root
11031 window as argument.
11033 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
11035 * fns.c (Fputhash): Document return value.
11037 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
11039 * image.c (gif_load): Implement gif89a spec "no disposal" method.
11041 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
11043 Cons<->int and similar integer overflow fixes (Bug#8794).
11045 Check for overflow when converting integer to cons and back.
11046 * charset.c (Fdefine_charset_internal, Fdecode_char):
11047 Use cons_to_unsigned to catch overflow.
11048 (Fencode_char): Use INTEGER_TO_CONS.
11049 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
11050 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
11051 * data.c (long_to_cons, cons_to_long): Remove.
11052 (cons_to_unsigned, cons_to_signed): New functions.
11053 These signal an error for invalid or out-of-range values.
11054 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
11055 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
11056 * font.c (Ffont_variation_glyphs):
11057 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
11058 * lisp.h: Include <intprops.h>.
11059 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
11060 (cons_to_signed, cons_to_unsigned): New decls.
11061 (long_to_cons, cons_to_long): Remove decls.
11062 * undo.c (record_first_change): Use INTEGER_TO_CONS.
11063 (Fprimitive_undo): Use CONS_TO_INTEGER.
11064 * xfns.c (Fx_window_property): Likewise.
11065 * xselect.c: Include <limits.h>.
11066 (x_own_selection, selection_data_to_lisp_data):
11067 Use INTEGER_TO_CONS.
11068 (x_handle_selection_request, x_handle_selection_clear)
11069 (x_get_foreign_selection, Fx_disown_selection_internal)
11070 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
11071 (lisp_data_to_selection_data): Use cons_to_unsigned.
11072 (x_fill_property_data): Use cons_to_signed.
11073 Report values out of range.
11075 Check for buffer and string overflow more precisely.
11076 * buffer.h (BUF_BYTES_MAX): New macro.
11077 * lisp.h (STRING_BYTES_MAX): New macro.
11078 * alloc.c (Fmake_string):
11079 * character.c (string_escape_byte8):
11080 * coding.c (coding_alloc_by_realloc):
11081 * doprnt.c (doprnt):
11082 * editfns.c (Fformat):
11084 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
11085 since they may not be the same number.
11086 * editfns.c (Finsert_char):
11087 * fileio.c (Finsert_file_contents):
11088 Likewise for BUF_BYTES_MAX.
11090 * image.c: Use ptrdiff_t, not int, for sizes.
11091 (slurp_file): Switch from int to ptrdiff_t.
11093 (slurp_file): Check that file size fits in both size_t (for
11094 malloc) and ptrdiff_t (for sanity and safety).
11096 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
11097 if b->modtime has its maximal value.
11099 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
11101 Don't assume time_t can fit into int.
11102 * buffer.h (struct buffer.modtime): Now time_t, not int.
11103 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
11104 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
11106 Minor fixes for signed vs unsigned integers.
11107 * character.h (MAYBE_UNIFY_CHAR):
11108 * charset.c (maybe_unify_char):
11109 * keyboard.c (read_char, reorder_modifiers):
11110 XINT -> XFASTINT, since the integer must be nonnegative.
11111 * ftfont.c (ftfont_spec_pattern):
11112 * keymap.c (access_keymap, silly_event_symbol_error):
11113 XUINT -> XFASTINT, since the integer must be nonnegative.
11114 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
11115 since it makes no difference and we prefer signed.
11116 * keyboard.c (record_char): Use XUINT when all the neighbors do.
11117 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
11120 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
11122 * window.h (Fwindow_frame): Declare.
11124 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
11126 * alloc.c: Simplify handling of large-request failures (Bug#8800).
11127 (SPARE_MEMORY): Always define.
11128 (LARGE_REQUEST): Remove.
11129 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
11131 2011-06-06 Martin Rudalics <rudalics@gmx.at>
11133 * lisp.h: Move EXFUNS for Fframe_root_window,
11134 Fframe_first_window and Fset_frame_selected_window to window.h.
11136 * window.h: Move EXFUNS for Fframe_root_window,
11137 Fframe_first_window and Fset_frame_selected_window here from
11140 * frame.c (Fwindow_frame, Fframe_first_window)
11141 (Fframe_root_window, Fframe_selected_window)
11142 (Fset_frame_selected_window): Move to window.c.
11143 (Factive_minibuffer_window): Move to minibuf.c.
11144 (Fother_visible_frames_p): New function.
11146 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
11148 * window.c (decode_window, decode_any_window): Move up in code.
11149 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
11150 (inhibit_frame_unsplittable): Remove unused variable.
11151 (Fwindow_buffer): Move up and rewrite doc-string.
11152 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
11153 (Fwindow_prev): New functions.
11154 (Fwindow_frame): Move here from frame.c. Accept any window as
11156 (Fframe_root_window, Fframe_first_window)
11157 (Fframe_selected_window): Move here from frame.c. Accept frame
11158 or arbitrary window as argument. Update doc-strings.
11159 (Fminibuffer_window): Move up in code.
11160 (Fwindow_minibuffer_p): Move up in code and simplify.
11161 (Fset_frame_selected_window): Move here from frame.c.
11163 (Fselected_window, select_window, Fselect_window): Move up in
11164 code. Minor doc-string fixes.
11166 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
11168 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
11169 Do not assume that spare memory exists; that assumption is valid
11170 only if SYSTEM_MALLOC.
11171 (LARGE_REQUEST): New macro, so that the issue of large requests
11172 is separated from the issue of spare memory.
11174 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
11176 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
11179 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
11181 * xfns.c (x_set_scroll_bar_default_width): Move declarations
11184 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
11186 * gtkutil.c (xg_get_default_scrollbar_width): New function.
11188 * gtkutil.h: Declare xg_get_default_scrollbar_width.
11190 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
11191 min width by calling x_set_scroll_bar_default_width (Bug#8505).
11193 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
11195 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
11197 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
11199 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
11200 (x_clipboard_manager_save): Add return value.
11201 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
11202 New error handlers.
11203 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
11204 Obey Vx_select_enable_clipboard_manager. Catch errors in
11205 x_clipboard_manager_save (Bug#8779).
11206 (Vx_select_enable_clipboard_manager): New variable.
11207 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
11209 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
11211 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
11213 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11215 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
11216 in the current matrix if keep_current_p is non-zero.
11218 2011-06-04 Eli Zaretskii <eliz@gnu.org>
11220 * bidi.c (bidi_level_of_next_char): Fix last change.
11222 2011-06-03 Eli Zaretskii <eliz@gnu.org>
11224 Support bidi reordering of text covered by display properties.
11226 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
11227 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
11228 (bidi_cache_search, bidi_cache_iterator_state)
11229 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
11230 (bidi_level_of_next_char, bidi_move_to_visually_next):
11231 Support character positions inside a run of characters covered by a
11233 (bidi_paragraph_init, bidi_resolve_explicit_1)
11234 (bidi_level_of_next_char): Call bidi_fetch_char and
11235 bidi_fetch_char_advance instead of FETCH_CHAR and
11236 FETCH_CHAR_ADVANCE.
11237 (bidi_init_it): Initialize new members.
11238 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
11240 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
11241 instead of using explicit *_CHAR codes.
11242 (bidi_resolve_explicit, bidi_resolve_weak):
11243 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
11244 bidirectional text is supported only in multibyte buffers.
11245 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
11246 it to initialize the frame_window_p member of struct bidi_it.
11247 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
11248 (bidi_resolve_explicit, bidi_resolve_weak)
11249 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
11250 bidi_it->nchars is non-positive.
11251 (bidi_level_of_next_char): Don't try to lookup the cache for the
11252 next/previous character if nothing is cached there yet, or if we
11253 were just reseat()'ed to a new position.
11255 * xdisp.c (set_cursor_from_row): Set start and stop points
11256 according to the row's direction when priming the loop that looks
11257 for the glyph on which to display cursor.
11258 (single_display_spec_intangible_p): Function deleted.
11259 (display_prop_intangible_p): Reimplement to call
11260 handle_display_spec instead of single_display_spec_intangible_p.
11261 Accept 3 additional arguments needed by handle_display_spec.
11262 This fixes incorrect cursor motion across display property with complex
11263 values: lists, `(when COND...)' forms, etc.
11264 (single_display_spec_string_p): Support property values that are
11265 lists with the argument STRING its top-level element.
11266 (display_prop_string_p): Fix the condition for processing a
11267 property that is a list to be consistent with handle_display_spec.
11268 (handle_display_spec): New function, refactored from the
11269 last portion of handle_display_prop.
11270 (compute_display_string_pos): Accept additional argument
11271 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
11272 value of a `display' property is a "replacing spec".
11273 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
11274 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
11275 the display property, but just return a value indicating whether
11276 the display property will replace the characters it covers.
11277 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
11278 frame_window_p members of struct bidi_it.
11279 (compute_display_string_pos, compute_display_string_end):
11281 (push_it): Accept second argument POSITION, where pop_it should
11282 jump to continue iteration.
11283 (reseat_1): Initialize bidi_it.disp_pos.
11285 * keyboard.c (adjust_point_for_property): Adjust the call to
11286 display_prop_intangible_p to its new signature.
11288 * dispextern.h (struct bidi_it): New member frame_window_p.
11289 (bidi_init_it): Update prototypes.
11290 (display_prop_intangible_p): Update prototype.
11291 (compute_display_string_pos, compute_display_string_end):
11292 Declare prototypes.
11293 (struct bidi_it): New members nchars and disp_pos. ch_len is now
11296 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
11298 Malloc failure behavior now depends on size of allocation.
11299 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
11300 * lisp.h: Change signatures accordingly.
11301 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
11302 All callers changed. (Bug#8762)
11304 * gnutls.c: Use Emacs's memory allocators.
11305 Without this change, the gnutls library would invoke malloc etc.
11306 directly, which causes problems on non-SYNC_INPUT hosts, and which
11307 runs afoul of improving memory_full behavior. (Bug#8761)
11308 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
11309 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
11310 xfree instead of the default malloc, realloc, free.
11311 (Fgnutls_boot): No need to check for memory allocation failure,
11312 since xmalloc does that for us.
11314 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
11315 * category.c (hash_get_category_set):
11316 * ccl.c (ccl_driver):
11317 * charset.c (Fdefine_charset_internal):
11318 * charset.h (struct charset.hash_index):
11319 * composite.c (get_composition_id, gstring_lookup_cache)
11320 (composition_gstring_put_cache):
11321 * composite.h (struct composition.hash_index):
11322 * dispextern.h (struct image.hash):
11323 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
11324 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
11325 (hashfn_equal, hashfn_user_defined, make_hash_table)
11326 (maybe_resize_hash_table, hash_lookup, hash_put)
11327 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
11328 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
11329 (Fsxhash, Fgethash, Fputhash, Fmaphash):
11330 * image.c (make_image, search_image_cache, lookup_image)
11331 (xpm_put_color_table_h):
11332 * lisp.h (struct Lisp_Hash_Table):
11333 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
11334 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
11335 for hashes and hash indexes, instead of 'unsigned' and 'int'.
11336 * alloc.c (allocate_vectorlike):
11337 Check for overflow in vector size calculations.
11338 * ccl.c (ccl_driver):
11339 Check for overflow when converting EMACS_INT to int.
11340 * fns.c, image.c: Remove unnecessary static decls that would otherwise
11341 need to be updated by these changes.
11342 * fns.c (make_hash_table, maybe_resize_hash_table):
11343 Check for integer overflow with large hash tables.
11344 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
11345 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
11346 (SXHASH_REDUCE): New macro.
11347 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
11348 Use it instead of discarding useful hash info with large hash values.
11349 (sxhash_float): New function.
11350 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
11351 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
11352 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
11353 Rewrite to use FIXNUM_BITS, as this simplifies things.
11354 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
11355 Adjust signatures to match updated version of code.
11356 (consing_since_gc): Now EMACS_INT, since a single hash table can
11357 use more than INT_MAX bytes.
11359 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
11361 Make it possible to build with GCC-4.6+ -O2 -flto.
11363 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
11365 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
11367 * minibuf.c (get_minibuffer, read_minibuf_unwind):
11368 Call minibuffer-inactive-mode.
11370 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
11372 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
11373 Update dependencies.
11375 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
11377 * data.c (init_data): Remove code for UTS, this system is not
11380 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
11382 Don't force ./temacs to start in terminal mode.
11384 * frame.c (make_initial_frame): Initialize faces in all cases, not
11385 only when CANNOT_DUMP is defined.
11386 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
11388 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
11390 * dispnew.c (add_window_display_history): Use const for the string
11391 pointer. Remove declaration, not needed.
11393 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
11395 Use 'inline', not 'INLINE'.
11396 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
11397 * alloc.c, fontset.c (INLINE): Remove.
11398 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
11399 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
11400 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
11401 * gmalloc.c (register_heapinfo): Use inline unconditionally.
11402 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
11404 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
11406 Make it possible to run ./temacs.
11408 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
11409 syms_of_callproc does the same thing. Remove test for
11410 "initialized", do it in the caller.
11411 * emacs.c (main): Avoid calling set_initial_environment when dumping.
11413 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
11415 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
11416 (read_minibuf): Use get_minibuffer.
11417 (syms_of_minibuf): Use DEFSYM.
11418 (Qmetadata): New var.
11419 * data.c (Qbuffer): Don't make it static.
11420 (syms_of_data): Use DEFSYM.
11422 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
11424 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
11425 (CCL_CODE_MIN): New macro.
11427 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
11429 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
11431 * eval.c (Qdebug): Now static.
11432 * lisp.h (Qdebug): Remove decl. This reverts a part of the
11433 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
11434 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
11436 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
11438 * image.c: Various fixes to ImageMagick code comments.
11439 (Fimagemagick_types): Doc fix.
11441 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
11443 Minor fixes prompted by GCC 4.6.0 warnings.
11445 * xselect.c (converted_selections, conversion_fail_tag): Now static.
11447 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
11448 (x_clipboard_manager_save_all): Move extern decl to ...
11449 * xterm.h: ... here, so that it can be checked for consistency.
11451 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
11453 * xselect.c (x_clipboard_manager_save_frame)
11454 (x_clipboard_manager_save_all): New functions.
11455 (Fx_clipboard_manager_save): Lisp function deleted.
11457 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
11458 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
11460 * xterm.h: Update prototype.
11462 2011-05-28 William Xu <william.xwl@gmail.com>
11464 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
11465 exiting (Bug#8239).
11467 2011-05-28 Jim Meyering <meyering@redhat.com>
11469 Avoid a sign-extension bug in crypto_hash_function.
11470 * fns.c (to_uchar): Define.
11471 (crypto_hash_function): Use it to convert some newly-signed
11472 variables to unsigned, to avoid sign-extension bugs. For example,
11473 without this change, (md5 "truc") would evaluate to
11474 45723a2aff78ff4fff7fff1114760e62 rather than the expected
11475 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
11476 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
11478 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
11480 Integer overflow fixes.
11482 * dbusbind.c: Serial number integer overflow fixes.
11483 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
11484 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
11485 to hold a serial number that is too large for a fixnum.
11486 (Fdbus_method_return_internal, Fdbus_method_error_internal):
11487 Check for serial numbers out of range. Decode any serial number
11488 that was so large that it became a float. (Bug#8722)
11490 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
11491 (Fdbus_call_method, Fdbus_call_method_asynchronously):
11492 Use XFASTINT rather than XUINT when numbers are nonnegative.
11493 (xd_append_arg, Fdbus_method_return_internal):
11494 (Fdbus_method_error_internal): Likewise. Also, for unsigned
11495 arguments, check that Lisp number is nonnegative, rather than
11496 silently wrapping negative numbers around. (Bug#8722)
11497 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
11500 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
11502 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
11504 ccl: Add integer overflow checks.
11505 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
11506 (IN_INT_RANGE): New macros.
11507 (ccl_driver): Use them to check for integer overflow when
11508 decoding a CCL program. Many of the new checks are whether XINT (x)
11509 fits in int; it doesn't always, on 64-bit hosts. The new version
11510 doesn't catch all possible integer overflows, but it's an
11511 improvement. (Bug#8719)
11513 * alloc.c (make_event_array): Use XINT, not XUINT.
11514 There's no need for unsigned here.
11516 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
11517 This follows up to the 2011-05-06 change that substituted uintptr_t
11518 for EMACS_INT. This case wasn't caught back then.
11520 Rework Fformat to avoid integer overflow issues.
11521 * editfns.c: Include <float.h> unconditionally, as it's everywhere
11522 now (part of C89). Include <verify.h>.
11523 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
11524 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
11525 (Fformat): Avoid the prepass trying to compute sizes; it was only
11526 approximate and thus did not catch overflow reliably. Instead, walk
11527 through the format just once, formatting and computing sizes as we go,
11528 checking for integer overflow at every step, and allocating a larger
11529 buffer as needed. Keep track separately whether the format is
11530 multibyte. Keep only the most-recently calculated precision, rather
11531 than them all. Record whether each argument has been converted to
11532 string. Use EMACS_INT, not int, for byte and char and arg counts.
11533 Support field widths and precisions larger than INT_MAX. Avoid
11534 sprintf's undefined behavior with conversion specifications such as %#d
11535 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
11536 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
11537 formatting out-of-range floating point numbers with int
11538 formats. (Bug#8668)
11540 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
11542 * data.c: Avoid integer truncation in expressions involving floats.
11543 * data.c: Include <intprops.h>.
11544 (arith_driver): When there's an integer overflow in an expression
11545 involving floating point, convert the integers to floating point
11546 so that the resulting value does not suffer from catastrophic
11547 integer truncation. For example, on a 64-bit host (* 4
11548 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
11549 Do not rely on undefined behavior after integer overflow.
11551 merge count_size_as_multibyte, parse_str_to_multibyte
11552 * character.c, character.h (count_size_as_multibyte):
11553 Rename from parse_str_to_multibyte; all uses changed.
11554 Check for integer overflow.
11555 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
11556 since it's now a duplicate of the other. This is more of
11557 a character than a buffer op, so better that it's in character.c.
11558 * fns.c, print.c: Adjust to above changes.
11560 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
11562 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
11564 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
11566 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
11567 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
11568 (x_clipboard_manager_save): Now static.
11569 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
11571 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
11572 (crypto_hash_function): Now static.
11573 Fix pointer signedness problems. Avoid unnecessary initializations.
11575 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
11577 * termhooks.h (Vselection_alist): Make it terminal-local.
11579 * terminal.c (create_terminal): Initialize it.
11581 * xselect.c: Support for clipboard managers.
11582 (Vselection_alist): Move to termhooks.h as terminal-local var.
11583 (LOCAL_SELECTION): New macro.
11584 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
11585 (symbol_to_x_atom): Remove gratuitous arg.
11586 (x_handle_selection_request, lisp_data_to_selection_data)
11587 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
11588 (x_own_selection, x_get_local_selection, x_convert_selection):
11589 New arg, specifying work frame. Use terminal-local Vselection_alist.
11590 (some_frame_on_display): Delete unused function.
11591 (Fx_own_selection_internal, Fx_get_selection_internal)
11592 (Fx_disown_selection_internal, Fx_selection_owner_p)
11593 (Fx_selection_exists_p): New optional frame arg.
11594 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
11595 (x_handle_selection_clear): Don't treat other terminals with the
11596 same keyboard specially. Use the terminal-local Vselection_alist.
11597 (x_clear_frame_selections): Use Frun_hook_with_args.
11599 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
11601 * xterm.h: Add support for those atoms.
11603 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
11605 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
11606 (converted_selections, conversion_fail_tag): New global variables.
11607 (x_selection_request_lisp_error): Free the above.
11608 (x_get_local_selection): Remove unnecessary code.
11609 (x_reply_selection_request): Args changed; handle arbitrary array
11610 of converted selections stored in converted_selections.
11611 Separate the XChangeProperty and SelectionNotify steps.
11612 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
11613 (x_convert_selection): New function.
11614 (x_handle_selection_event): Simplify.
11615 (x_get_foreign_selection): Don't ignore incoming requests while
11616 waiting for an answer; this will fail when we implement
11617 SAVE_TARGETS, and seems unnecessary anyway.
11618 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
11619 (Vx_sent_selection_functions): Doc fix.
11621 2011-05-26 Leo Liu <sdl.web@gmail.com>
11623 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
11625 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11627 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
11629 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
11630 for fringe update if it has periodic bitmap.
11631 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
11632 and fringe_bitmap_periodic_p.
11634 * fringe.c (get_fringe_bitmap_data): New function.
11635 (draw_fringe_bitmap_1, update_window_fringes): Use it.
11636 (update_window_fringes): Record periodicity of fringe bitmap in glyph
11637 row. Mark glyph row for fringe update if periodicity changed.
11639 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
11640 for fringe update unless it has periodic bitmap.
11642 2011-05-25 Kenichi Handa <handa@m17n.org>
11644 * xdisp.c (get_next_display_element): Set correct it->face_id for
11645 a static composition.
11647 2011-05-24 Leo Liu <sdl.web@gmail.com>
11650 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
11652 * fns.c (crypto_hash_function, Fsha1): New function.
11653 (Fmd5): Use crypto_hash_function.
11654 (syms_of_fns): Add Ssha1.
11656 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
11658 * gnutls.c: Remove unused macros.
11659 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
11660 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
11661 Remove macros that are defined and never used.
11662 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
11664 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
11666 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
11667 (Fx_get_selection_internal): Minor cleanup.
11668 (Fx_own_selection_internal): Rename arguments for consistency with
11671 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
11673 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
11675 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
11677 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
11679 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11681 * dispnew.c (scrolling_window): Don't exclude the case that the
11682 last enabled row in the desired matrix touches the bottom boundary.
11684 2011-05-21 Glenn Morris <rgm@gnu.org>
11686 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
11687 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
11688 and add some more files.
11690 2011-05-20 Eli Zaretskii <eliz@gnu.org>
11692 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
11693 report_file_error introduced by the change from 2011-05-07.
11695 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
11697 * systime.h (Time): Define only if emacs is defined.
11698 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
11699 where the include path doesn't have X11/X.h by default. See
11700 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
11702 2011-05-20 Kenichi Handa <handa@m17n.org>
11704 * composite.c (find_automatic_composition): Fix previous change.
11706 2011-05-20 Glenn Morris <rgm@gnu.org>
11708 * lisp.mk: New file, split from Makefile.in.
11709 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
11710 (shortlisp): Remove.
11711 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
11713 2011-05-19 Glenn Morris <rgm@gnu.org>
11715 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
11716 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
11717 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
11718 (lisp): Set the order to that of loadup.el.
11719 (shortlisp): Make it a copy of $lisp.
11720 (SOME_MACHINE_LISP): Remove.
11721 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
11722 Use just $shortlisp, not $SOME_MACHINE_LISP too.
11724 2011-05-18 Kenichi Handa <handa@m17n.org>
11726 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
11727 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
11728 (find_automatic_composition): Mostly rewrite for efficiency.
11730 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
11732 * makefile.w32-in: Update dependencies.
11734 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
11736 * menu.c: Include limits.h (fixes the MS-Windows build broken by
11737 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
11739 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
11741 Fix some integer overflow issues, such as string length overflow.
11743 * insdel.c (count_size_as_multibyte): Check for string overflow.
11745 * character.c (lisp_string_width): Check for string overflow.
11746 Use EMACS_INT, not int, for string indexes and lengths; in
11747 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
11748 the resulting string length overflows an EMACS_INT; instead,
11749 report a string overflow if no precision given. When checking for
11750 precision exhaustion, use a check that cannot possibly have
11751 integer overflow. (Bug#8675)
11752 * character.h (lisp_string_width): Adjust to new signature.
11754 * alloc.c (string_overflow): New function.
11755 (Fmake_string): Use it. This doesn't change behavior, but saves
11756 a few bytes and will simplify future changes.
11757 * character.c (string_escape_byte8): Likewise.
11758 * lisp.h (string_overflow): New decl.
11760 Fixups, following up to the user-interface timestamp change.
11761 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
11762 for UI timestamps, instead of unsigned long.
11763 * msdos.c (mouse_get_pos): Likewise.
11764 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
11765 * w32gui.h (Time): Define by including "systime.h" rather than by
11766 declaring it ourselves. (Bug#8664)
11768 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
11769 * image.c (clear_image_cache): Likewise.
11771 * term.c (term_mouse_position): Don't assume time_t wraparound.
11773 Be more systematic about user-interface timestamps.
11774 Before, the code sometimes used 'Time', sometimes 'unsigned long',
11775 and sometimes 'EMACS_UINT', to represent these timestamps.
11776 This change causes it to use 'Time' uniformly, as that's what X uses.
11777 This makes the code easier to follow, and makes it easier to catch
11778 integer overflow bugs such as Bug#8664.
11779 * frame.c (Fmouse_position, Fmouse_pixel_position):
11780 Use Time, not unsigned long, for user-interface timestamps.
11781 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
11782 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
11783 * keyboard.h (last_event_timestamp): Likewise.
11784 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
11785 * menu.h (xmenu_show): Likewise.
11786 * term.c (term_mouse_position): Likewise.
11787 * termhooks.h (struct input_event.timestamp): Likewise.
11788 (struct terminal.mouse_position_hook): Likewise.
11789 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
11790 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
11791 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
11792 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
11793 what it was before.
11794 * menu.h, termhooks.h: Include "systime.h", for Time.
11796 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
11797 Don't assume that the difference between two unsigned long values
11798 can fit into an integer. At this point, we know button_down_time
11799 <= event->timestamp, so the difference must be nonnegative, so
11800 there's no need to cast the result if double-click-time is
11801 nonnegative, as it should be; check that it's nonnegative, just in
11802 case. This bug is triggered when events are more than 2**31 ms
11803 apart (about 25 days). (Bug#8664)
11805 * xselect.c (last_event_timestamp): Remove duplicate decl.
11806 (x_own_selection): Remove needless cast to unsigned long.
11808 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
11809 that always fit in int. Use a sentinel instead of a counter, to
11810 avoid a temp and to allay GCC's concerns about possible int overflow.
11811 * frame.h (struct frame): Use int for menu_bar_items_used
11812 instead of EMACS_INT, since it always fits in int.
11814 * menu.c (grow_menu_items): Check for int overflow.
11816 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
11818 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
11819 Before, the code was not consistent. These values cannot exceed
11820 2**31 - 1 so there's no need to make them unsigned.
11821 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
11822 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
11823 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
11825 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
11827 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
11828 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
11829 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
11830 presumably because the widths might not match.
11832 * window.c (size_window): Avoid needless test at loop start.
11834 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
11836 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
11838 2011-05-12 Drew Adams <drew.adams@oracle.com>
11840 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
11842 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11844 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
11845 `width' to `bar_area_x' and `bar_area_width', respectively.
11846 (x_scroll_run): Take account of fringe background extension.
11848 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
11849 Rename local vars `left' and `width' to `bar_area_x' and
11850 `bar_area_width', respectively.
11851 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
11852 background extension.
11854 2011-05-10 Jim Meyering <meyering@redhat.com>
11856 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
11858 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
11860 * image.c (Finit_image_library): Return t for built-in image types,
11861 like pbm and xbm. (Bug#8640)
11863 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
11865 * w32menu.c (set_frame_menubar): Fix submenu allocation.
11867 2011-05-07 Eli Zaretskii <eliz@gnu.org>
11869 * w32console.c (Fset_screen_color): Doc fix.
11870 (Fget_screen_color): New function.
11871 (syms_of_ntterm): Defsubr it.
11873 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
11874 unlink the temporary file if Fcall_process didn't create it in the
11876 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
11877 child process will be redirected to a file specified with `:file'.
11878 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
11879 cue to call_process_cleanup not to close that handle.
11881 2011-05-07 Ben Key <bkey76@gmail.com>
11883 * makefile.w32-in: The bootstrap-temacs rule now makes use of
11884 one of two shell specific rules, either bootstrap-temacs-CMD or
11885 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
11886 to the previous implementation of the bootstrap-temacs rule.
11887 The bootstrap-temacs-CMD rule is similar to the previous
11888 implementation of the bootstrap-temacs rule except that it
11889 makes use of the ESC_CFLAGS variable instead of the CFLAGS
11892 These changes, along with some changes to nt/configure.bat,
11893 nt/gmake.defs, and nt/nmake.defs, are required to extend my
11894 earlier fix to add support for --cflags and --ldflags options
11895 that include quotes so that it works whether make uses cmd or
11898 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
11900 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
11901 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
11903 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
11904 a string. Handle both cases.
11905 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
11906 (Fdbus_register_method): Use Qinvalid_function.
11908 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
11910 * makefile.w32-in: Update dependencies.
11911 (LISP_H): Add inttypes.h and stdin.h.
11912 (PROCESS_H): Add unistd.h.
11914 2011-05-06 Eli Zaretskii <eliz@gnu.org>
11916 * lread.c: Include limits.h (fixes the MS-Windows build broken by
11917 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
11919 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
11921 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
11923 * term.c (vfatal): Remove stray call to va_end.
11924 It's not needed and the C Standard doesn't allow it here anyway.
11926 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
11927 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
11929 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
11932 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
11934 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11936 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
11938 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
11940 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
11942 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
11943 * charset.c (Fdefine_charset_internal): Don't initialize
11944 charset.code_space[15]. The value was garbage, on hosts with
11945 32-bit int (Bug#8600).
11947 * lread.c (read_integer): Be more consistent with string-to-number.
11948 Use string_to_number to do the actual conversion; this avoids
11949 rounding errors and fixes some other screwups. Without this fix,
11950 for example, #x1fffffffffffffff was misread as -2305843009213693952.
11951 (digit_to_number): Move earlier, for benefit of read_integer.
11952 Return -1 if the digit is out of range for the base, -2 if it is
11953 not a digit in any supported base. (Bug#8602)
11955 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
11957 * dispnew.c (scrolling_window): Return 1 if we scrolled,
11958 to match comment at start of function. This also removes a
11959 GCC warning about overflow in a 32+64-bit port.
11961 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
11963 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
11964 Reported by Stefan Monnier in
11965 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
11966 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
11967 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
11969 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
11970 (EMACS_UINTPTR): Likewise, with uintptr_t.
11972 * lisp.h: Prefer 64-bit EMACS_INT if available.
11973 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
11974 on 32-bit hosts that have 64-bit int, so that they can access
11976 However, temporarily disable this change unless the temporary
11977 symbol WIDE_EMACS_INT is defined.
11979 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
11981 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
11982 This removes an assumption that EMACS_INT and long are the same
11983 width as pointers. The assumption is true for Emacs porting targets
11984 now, but we want to make other targets possible.
11985 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
11986 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
11987 In the rest of the code, change types of integers that hold casted
11988 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
11989 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
11990 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
11991 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
11992 No need to cast type when ORing.
11993 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
11994 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
11995 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
11996 assume EMACS_INT is the same width as char *.
11997 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
11998 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
11999 Remove no-longer-needed casts.
12000 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
12001 (xg_tool_bar_help_callback, xg_make_tool_item):
12002 Use EMACS_INTPTR to hold an integer
12003 that will be cast to void *; this can avoid a GCC warning
12004 if EMACS_INT is not the same width as void *.
12005 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
12006 * xdisp.c (display_echo_area_1, resize_mini_window_1):
12007 (current_message_1, set_message_1):
12008 Use a local to convert to proper width without a cast.
12009 * xmenu.c (dialog_selection_callback): Likewise.
12011 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
12012 Also, don't assume VALBITS / RAND_BITS is less than 5,
12013 and don't rely on undefined behavior when shifting a 1 left into
12015 * lisp.h (get_random): Change signature to match.
12017 * lread.c (hash_string): Use size_t, not int, for hash computation.
12018 Normally we prefer signed values; but hashing is special, because
12019 it's better to use unsigned division on hash table sizes so that
12020 the remainder is nonnegative. Also, size_t is the natural width
12021 for hashing into memory. The previous code used 'int', which doesn't
12022 retain enough info to hash well into very large tables.
12023 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
12025 * dbusbind.c: Don't possibly lose pointer info when converting.
12026 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
12027 Use XPNTR rather than XHASH, so that the high-order bits of
12028 the pointer aren't lost when converting through void *.
12030 * eval.c (Fautoload): Don't double-shift a pointer.
12032 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
12034 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
12036 * gnutls.c (DEF_GNUTLS_FN):
12037 * image.c (DEF_IMGLIB_FN): Make function pointers static.
12039 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
12041 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
12044 2011-05-05 Eli Zaretskii <eliz@gnu.org>
12046 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
12047 New version that can reserve upto 2GB of heap space.
12049 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
12051 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
12053 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
12055 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
12056 `gnutls_certificate_set_x509_key_file'.
12058 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
12060 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
12061 Update dependencies.
12063 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
12065 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
12066 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
12067 Remove unused parameter `fildes'.
12068 * process.c (read_process_output, send_process): Don't pass it.
12070 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
12072 Fix previous change: the library cache is defined in w32.c.
12073 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
12074 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
12076 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
12078 Implement dynamic loading of GnuTLS on Windows.
12080 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
12081 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
12082 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
12085 * gnutls.c (Qgnutls_dll): Define.
12086 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
12087 (gnutls_*): Declare function pointers.
12088 (init_gnutls_functions): New function to initialize function pointers.
12089 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
12090 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
12091 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
12092 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
12093 (emacs_gnutls_write, emacs_gnutls_read)
12094 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
12095 (Fgnutls_available_p): New function.
12096 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
12097 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
12098 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
12100 * image.c: Include w32.h.
12101 (Vimage_type_cache): Delete.
12102 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
12103 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
12104 (w32_delayed_load): Move to w32.c.
12106 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
12108 * w32.c (QCloaded_from, Vlibrary_cache): Define.
12109 (w32_delayed_load): Move from image.c. When loading a library, record
12110 its filename in the :loaded-from property of the library id.
12111 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
12112 Initialize and staticpro them.
12113 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
12115 * process.c: Include lisp.h before w32.h, not after.
12116 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
12117 instead of gnutls_record_check_pending.
12119 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
12121 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
12123 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
12124 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
12127 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
12129 * xterm.c (x_set_frame_alpha): Do not set property on anything
12130 else than FRAME_X_OUTER_WINDOW (Bug#8608).
12132 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
12134 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
12136 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
12138 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
12139 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
12140 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
12141 (gnutls_global_initialized, Qgnutls_bootprop_priority)
12142 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
12143 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
12144 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
12145 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
12146 (Qgnutls_bootprop_callbacks_verify): Make static.
12148 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
12150 * callproc.c: Indentation fixup.
12152 * sysdep.c (wait_for_termination_1): Make static.
12153 (wait_for_termination, interruptible_wait_for_termination):
12154 Move after wait_for_termination_1.
12156 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
12158 * sysdep.c (interruptible_wait_for_termination): New function
12159 which is like wait_for_termination, but allows keyboard
12162 * callproc.c (Fcall_process): Add (:file "file") as an option for
12164 (Fcall_process_region): Ditto.
12166 2011-04-30 Eli Zaretskii <eliz@gnu.org>
12168 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
12169 rather than `XVECTOR (FOO)->size'.
12171 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
12172 inttypes.h, as a gnulib replacement is used if it not available in
12175 2011-04-21 Eli Zaretskii <eliz@gnu.org>
12177 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
12178 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
12179 of MOST_POSITIVE_FIXNUM. (Bug#8528)
12181 * coding.c (coding_alloc_by_realloc): Error out if destination
12182 will grow beyond MOST_POSITIVE_FIXNUM.
12183 (decode_coding_emacs_mule): Abort if there isn't enough place in
12184 charbuf for the composition carryover bytes. Reserve an extra
12185 space for up to 2 characters produced in a loop.
12186 (decode_coding_iso_2022): Abort if there isn't enough place in
12187 charbuf for the composition carryover bytes.
12189 2011-04-21 Eli Zaretskii <eliz@gnu.org>
12191 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
12192 aborting when %lld or %lll format is passed.
12193 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
12194 %llo or %llx format is passed. (Bug#8545)
12196 * window.c (window_scroll_line_based): Use a marker instead of
12197 simple variables to record original value of point. (Bug#7952)
12199 * doprnt.c (doprnt): Fix the case where a multibyte sequence
12200 produced by %s or %c overflows available buffer space. (Bug#8545)
12202 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
12204 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
12205 (SIZE_MAX): Move defn after all includes, as they might #define it.
12207 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
12209 * w32.c (init_environment): Warn about defaulting HOME to C:\.
12211 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
12213 * keyboard.c (Qdelayed_warnings_hook): Define.
12214 (command_loop_1): Run `delayed-warnings-hook'
12215 if Vdelayed_warnings_list is non-nil.
12216 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
12217 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
12219 2011-04-28 Eli Zaretskii <eliz@gnu.org>
12221 * doprnt.c (doprnt): Don't return value smaller than the buffer
12222 size if the message was truncated. (Bug#8545).
12224 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
12226 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
12227 (Fx_window_property): #if-0 the whole functions, not just the bodies.
12229 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
12231 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
12233 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
12235 * makefile.w32-in: Update dependencies.
12237 2011-04-27 Eli Zaretskii <eliz@gnu.org>
12239 Improve `doprnt' and its usage. (Bug#8545)
12240 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
12241 `format_end'. Remove support for %l as a conversion specifier.
12242 Don't use xrealloc. Improve diagnostics when the %l size modifier
12243 is used. Update the commentary.
12245 * eval.c (verror): Simplify calculation of size_t.
12247 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
12250 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
12252 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
12255 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
12257 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
12258 This makes this file independent of the recent pseudovector change.
12260 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
12262 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
12264 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
12265 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
12266 Remove unused local.
12267 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
12269 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
12270 GCC 4.6.0 optimizes based on type-based alias analysis.
12271 For example, if b is of type struct buffer * and v of type struct
12272 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
12273 != &v->size, and therefore "v->size = 1; b->size = 2; return
12274 v->size;" must therefore return 1. This assumption is incorrect
12275 for Emacs, since it type-puns struct Lisp_Vector * with many other
12276 types. To fix this problem, this patch adds a new type struct
12277 vectorlike_header that documents the constraints on layout of vectors
12278 and pseudovectors, and helps optimizing compilers not get fooled
12279 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
12280 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
12281 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
12283 (XSETPVECTYPE): Rewrite in terms of new macro.
12284 (XSETPVECTYPESIZE): New macro, specifying both type and size.
12285 This is a bit clearer, and further avoids the possibility of
12286 undesirable aliasing.
12287 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
12288 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
12289 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
12290 since Lisp_Subr is a special case (no "next" field).
12291 (ASIZE): Now uses header.size rather than size.
12292 All previous uses of XVECTOR (foo)->size replaced to use this macro,
12293 to avoid the hassle of writing XVECTOR (foo)->header.size.
12294 (struct vectorlike_header): New type.
12295 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
12296 object, to help avoid aliasing.
12297 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
12298 (SUBRP): Likewise, since Lisp_Subr is a special case.
12299 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
12300 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
12301 (struct Lisp_Hash_Table): Combine first two members into a single
12302 struct vectorlike_header member. All uses of "size" and "next" members
12303 changed to be "header.size" and "header.next".
12304 * buffer.h (struct buffer): Likewise.
12305 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
12306 * frame.h (struct frame): Likewise.
12307 * process.h (struct Lisp_Process): Likewise.
12308 * termhooks.h (struct terminal): Likewise.
12309 * window.c (struct save_window_data, struct saved_window): Likewise.
12310 * window.h (struct window): Likewise.
12311 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
12312 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
12313 * buffer.c (init_buffer_once): Likewise.
12314 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
12316 * process.c (Fformat_network_address): Use local var for size,
12319 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
12321 Make the Lisp reader and string-to-float more consistent (Bug#8525)
12322 * data.c (atof): Remove decl; no longer used or needed.
12323 (digit_to_number): Move to lread.c.
12324 (Fstring_to_number): Use new string_to_number function, to be
12325 consistent with how the Lisp reader treats infinities and NaNs.
12326 Do not assume that floating-point numbers represent EMACS_INT
12327 without losing information; this is not true on most 64-bit hosts.
12328 Avoid double-rounding errors, by insisting on integers when
12329 parsing non-base-10 numbers, as the documentation specifies.
12330 * lisp.h (string_to_number): New decl, replacing ...
12331 (isfloat_string): Remove.
12332 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
12333 (read1): Do not accept +. and -. as integers; this
12334 appears to have been a coding error. Similarly, do not accept
12335 strings like +-1e0 as floating point numbers. Do not report
12336 overflow for integer overflows unless the base is not 10 which
12337 means we have no simple and reliable way to continue.
12338 Break out the floating-point parsing into a new
12339 function string_to_number, so that Fstring_to_number parses
12340 floating point numbers consistently with the Lisp reader.
12341 (digit_to_number): Move here from data.c. Make it static inline.
12342 (E_CHAR, EXP_INT): Remove, replacing with ...
12343 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
12344 (string_to_number): New function, replacing isfloat_string.
12345 This function checks for valid syntax and produces the resulting
12346 Lisp float number too. Rework it so that string-to-number
12347 no longer mishandles examples like "1.0e+". Use strtoumax,
12348 so that overflow for non-base-10 numbers is reported only when
12349 there's no portable and simple way to convert to floating point.
12351 * textprop.c (set_text_properties_1): Rewrite for clarity,
12352 and to avoid GCC warning about integer overflow.
12354 * intervals.h (struct interval): Use EMACS_INT for members
12355 where EMACS_UINT might cause problems. See
12356 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
12357 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
12358 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
12360 (offset_intervals): Tell GCC not to worry about length overflow
12361 when negating a negative length.
12363 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
12364 (overrun_check_free): Likewise.
12366 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
12367 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
12370 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
12371 (gnutls_make_error): Rename local to avoid shadowing.
12372 (gnutls_emacs_global_deinit): ifdef out; not used.
12373 (Fgnutls_boot): Use const for pointer to readonly storage.
12374 Comment out unused local. Fix pointer signedness problems.
12376 * lread.c (openp): Don't stuff size_t into an 'int'.
12377 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
12378 about possible signed overflow.
12380 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
12381 (GDK_KEY_g): Don't define if already defined.
12382 (xg_prepare_tooltip): Avoid pointer signedness problem.
12383 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
12385 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
12386 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
12388 * xfns.c (Fx_window_property): Simplify a bit,
12389 to make a bit faster and to avoid GCC 4.6.0 warning.
12390 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
12392 * fns.c (internal_equal): Don't assume size_t fits in int.
12394 * alloc.c (compact_small_strings): Tighten assertion a little.
12396 Replace pEd with more-general pI, and fix some printf arg casts.
12397 * lisp.h (pI): New macro, generalizing old pEd macro to other
12398 conversion specifiers. For example, use "...%"pI"d..." rather
12399 than "...%"pEd"...".
12400 (pEd): Remove. All uses replaced with similar uses of pI.
12401 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
12402 * alloc.c (check_pure_size): Don't overflow by converting size to int.
12403 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
12404 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
12405 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
12406 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
12407 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
12409 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
12410 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
12411 * print.c (safe_debug_print, print_object): Likewise.
12412 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
12414 Use pI instead of if-then-else-abort. Use %p to avoid casts,
12415 avoiding the 0 flag, which is not portable.
12416 * process.c (Fmake_network_process): Use pI to avoid cast.
12417 * region-cache.c (pp_cache): Likewise.
12418 * xdisp.c (decode_mode_spec): Likewise.
12419 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
12420 behavior on 64-bit hosts with printf arg.
12421 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
12422 (x_stop_queuing_selection_requests): Likewise.
12423 (x_get_window_property): Don't truncate byte count to an 'int'
12426 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
12427 here, since it parses constructs like leading '-' and spaces,
12428 which are not wanted; and it overflows with large numbers.
12429 Instead, simply match F[0-9]+, which is what is wanted anyway.
12431 * alloc.c: Remove unportable assumptions about struct layout.
12432 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
12433 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
12434 (allocate_vectorlike, make_pure_vector): Use the new macros,
12435 plus offsetof, to remove unportable assumptions about struct layout.
12436 These assumptions hold on all porting targets that I know of, but
12437 they are not guaranteed, they're easy to remove, and removing them
12438 makes further changes easier.
12440 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
12441 This doesn't fix a bug but makes the code clearer.
12442 (string_overrun_cookie): Now const. Use initializers that
12443 don't formally overflow signed char, to avoid warnings.
12444 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
12445 can cause Emacs to crash when string overrun checking is enabled.
12446 (allocate_buffer): Don't assume sizeof (struct buffer) is a
12447 multiple of sizeof (EMACS_INT); it need not be, if
12448 alignof(EMACS_INT) < sizeof (EMACS_INT).
12449 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
12451 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
12453 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
12455 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
12457 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
12458 supposed to be handshaking. (Bug#8556)
12459 Reported by Paul Eggert <eggert@cs.ucla.edu>.
12461 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
12463 * lisp.h (Qdebug): List symbol.
12464 * eval.c (Qdebug): Restore global linkage.
12465 * keyboard.c (debug-on-event): New variable.
12466 (handle_user_signal): Break into debugger when debug-on-event
12467 matches the current signal symbol.
12469 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
12471 * alloc.c (check_sblock, check_string_bytes)
12472 (check_string_free_list): Convert to standard C.
12474 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
12476 * w32.c (emacs_gnutls_push): Fix typo.
12478 2011-04-25 Eli Zaretskii <eliz@gnu.org>
12480 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
12481 "cast to pointer from integer of different size".
12483 Improve doprnt and its use in verror. (Bug#8545)
12484 * doprnt.c (doprnt): Document the set of format control sequences
12485 supported by the function. Use SAFE_ALLOCA instead of always
12488 * eval.c (verror): Don't limit the buffer size at size_max-1, that
12489 is one byte too soon. Don't use xrealloc; instead xfree and
12492 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
12494 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
12497 * gnutls.c: Renamed global_initialized to
12498 gnutls_global_initialized. Added internals for the
12499 :verify-hostname-error, :verify-error, and :verify-flags
12500 parameters of `gnutls-boot' and documented those parameters in the
12501 docstring. Start callback support.
12502 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
12503 unless a fatal error occurred. Call gnutls_alert_send_appropriate
12504 on error. Return error code.
12505 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
12506 (emacs_gnutls_read): Likewise.
12507 (Fgnutls_boot): Return handshake error code.
12508 (emacs_gnutls_handle_error): New function.
12509 (wsaerror_to_errno): Likewise.
12511 * w32.h (emacs_gnutls_pull): Add prototype.
12512 (emacs_gnutls_push): Likewise.
12514 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
12515 (emacs_gnutls_push): Likewise.
12517 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
12519 * process.c (wait_reading_process_output): Check if GnuTLS
12520 buffered some data internally if no FDs are set for TLS
12523 * makefile.w32-in (OBJ2): Add gnutls.$(O).
12524 (LIBS): Link to USER_LIBS.
12525 ($(BLD)/gnutls.$(0)): New target.
12527 2011-04-24 Eli Zaretskii <eliz@gnu.org>
12529 * xdisp.c (handle_single_display_spec): Rename the
12530 display_replaced_before_p argument into display_replaced_p, to
12531 make it consistent with the commentary. Fix typos in the
12534 * textprop.c (syms_of_textprop): Remove dead code.
12535 (copy_text_properties): Delete obsolete commentary about an
12536 interface that was deleted long ago. Fix typos in the description
12539 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
12540 to changes in oldXMenu/XMenu.h from 2011-04-16.
12541 <menu_help_message, prev_menu_help_message>: Constify.
12542 (IT_menu_make_room): menu->help_text is now `const char **';
12545 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
12546 to changes in oldXMenu/XMenu.h from 2011-04-16.
12547 (struct XMenu): Declare `help_text' `const char **'.
12549 * xfaces.c <Qunspecified>: Make extern again.
12551 * syntax.c: Include sys/types.h before including regex.h, as
12554 * doc.c (get_doc_string): Improve the format passed to `error'.
12556 * doprnt.c (doprnt): Improve commentary.
12558 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
12560 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
12563 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
12564 changes in globals.h immediately force recompilation.
12565 (TAGS): Depend on $(CURDIR)/m/intel386.h and
12566 $(CURDIR)/s/ms-w32.h.
12567 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
12569 * character.c (Fchar_direction): Function deleted.
12570 (syms_of_character): Don't defsubr it.
12571 <char-direction-table>: Deleted.
12573 2011-04-23 Eli Zaretskii <eliz@gnu.org>
12575 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
12576 * doprnt.c: Include limits.h.
12577 (SIZE_MAX): New macro.
12578 (doprnt): Return a size_t value. 2nd arg is now size_t.
12579 Many local variables are now size_t instead of int or unsigned.
12580 Improve overflow protection. Support `l' modifier for integer
12581 conversions. Support %l conversion. Don't assume an EMACS_INT
12582 argument for integer conversions and for %c.
12584 * lisp.h (doprnt): Restore prototype.
12586 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
12587 $(SRC)/character.h.
12589 * Makefile.in (base_obj): Add back doprnt.o.
12591 * deps.mk (doprnt.o): Add back prerequisites.
12592 (callint.o): Depend on character.h.
12594 * eval.c (internal_lisp_condition_case): Include the handler
12595 representation in the error message.
12596 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
12597 when breaking from the loop.
12599 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
12601 * callint.c (Fcall_interactively): When displaying error message
12602 about invalid control letter, pass the character's codepoint, not
12603 a pointer to its multibyte form. Improve display of the character
12604 in octal and display also its hex code.
12606 * character.c (char_string): Use %x to display the (unsigned)
12607 codepoint of an invalid character, to avoid displaying a bogus
12610 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
12611 `error', not SYMBOL_NAME itself.
12613 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
12614 character arguments to `error'.
12616 * charset.c (check_iso_charset_parameter): Fix incorrect argument
12617 to `error' in error message about FINAL_CHAR argument. Make sure
12618 FINAL_CHAR is a character, and use %c when it is passed as
12619 argument to `error'.
12621 2011-04-23 Eli Zaretskii <eliz@gnu.org>
12623 * s/ms-w32.h (localtime): Redirect to sys_localtime.
12625 * w32.c: Include <time.h>.
12626 (sys_localtime): New function.
12628 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
12630 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
12632 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
12634 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
12636 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
12637 zombies (Bug#8467).
12639 2011-04-19 Eli Zaretskii <eliz@gnu.org>
12641 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
12642 gl_state.e_property when gl_state.object is Qt.
12644 * insdel.c (make_gap_larger): Remove limitation of buffer size
12647 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
12649 * xdisp.c (lookup_glyphless_char_display)
12650 (produce_glyphless_glyph): Handle cons cell entry in
12651 glyphless-char-display.
12652 (Vglyphless_char_display): Document it.
12654 * term.c (produce_glyphless_glyph): Handle cons cell entry in
12655 glyphless-char-display.
12657 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
12659 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
12661 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
12663 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
12664 definition for no-X builds.
12666 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
12668 Static checks with GCC 4.6.0 and non-default toolkits.
12670 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
12672 * process.c (keyboard_bit_set): Define only if SIGIO.
12673 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
12674 (send_process): Repair possible setjmp clobbering.
12676 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
12678 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
12680 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
12682 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
12683 Define only if needed.
12685 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
12686 by pacifying GCC about it. Maybe it's time to retire it?
12687 * xfaces.c (USG, __TIMEVAL__): Likewise.
12689 * dispextern.h (struct redisplay_interface): Rename param
12690 to avoid shadowing.
12691 * termhooks.h (struct terminal): Likewise.
12692 * xterm.c (xembed_send_message): Likewise.
12694 * insdel.c (make_gap_smaller): Define only if
12695 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
12697 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
12700 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
12701 so that we aren't warned about unused symbols.
12703 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
12705 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
12707 * xfns.c (x_real_positions): Mark locals as initialized.
12709 * xmenu.c (xmenu_show): Don't use uninitialized vars.
12711 * xterm.c: Fix problems found by static analysis with other toolkits.
12712 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
12713 (x_dispatch_event): Declare static if USE_GTK, and
12714 define if USE_GTK || USE_X_TOOLKIT.
12715 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
12716 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
12717 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
12718 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
12720 * xmenu.c (menu_help_callback): Pointer type fixes.
12721 Use const pointers when pointing at readonly data. Avoid pointer
12722 signedness clashes.
12723 (FALSE): Remove unused macro.
12724 (update_frame_menubar): Remove unused decl.
12726 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
12728 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
12729 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
12730 (single_menu_item): Rename local to avoid shadowing.
12732 * keyboard.c (make_lispy_event): Remove unused local var.
12734 * frame.c, frame.h (x_get_resource_string): Bring this back, but
12735 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
12737 * bitmaps: Change bitmaps from unsigned char back to the X11
12738 compatible char. Avoid the old compiler warnings about
12739 out-of-range initializers by using, for example, '\xab' rather
12742 * xgselect.c (xgselect_initialize): Check vs interface
12743 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
12745 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
12747 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
12748 to read-only memory.
12750 * fns.c (vector): Remove; this old hack is no longer needed.
12752 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
12754 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
12756 * xrdb.c (x_load_resources): Omit unused local.
12758 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
12759 (x_window): Rename locals to avoid shadowing.
12760 (USG): Use the kludged USG macro, to pacify gcc.
12762 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
12763 (x_term_init): Remove local to avoid shadowing.
12765 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
12767 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
12768 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
12770 2011-04-16 Eli Zaretskii <eliz@gnu.org>
12772 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
12774 Fix regex.c, syntax.c and friends for buffers > 2GB.
12775 * syntax.h (struct gl_state_s): Declare character position members
12778 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
12780 * textprop.c (verify_interval_modification, interval_of):
12781 Declare arguments EMACS_INT.
12783 * intervals.c (adjust_intervals_for_insertion): Declare arguments
12786 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
12788 * indent.c (Fvertical_motion): Local variable it_start is now
12791 * regex.c (re_match, re_match_2, re_match_2_internal)
12792 (bcmp_translate, regcomp, regexec, print_double_string)
12793 (group_in_compile_stack, re_search, re_search_2, regex_compile)
12794 (re_compile_pattern, re_exec): Declare arguments and local
12795 variables `size_t' and `ssize_t' and return values `regoff_t', as
12797 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
12798 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
12799 <compile_stack_type>: `size' and `avail' are now `size_t'.
12801 * regex.h <regoff_t>: Use ssize_t, not int.
12802 (re_search, re_search_2, re_match, re_match_2): Arguments that
12803 specify buffer/string position and length are now ssize_t and
12804 size_t. Return type is regoff_t.
12806 2011-04-16 Ben Key <bkey76@gmail.com>
12808 * nsfont.m: Fixed bugs in ns_get_family and
12809 ns_descriptor_to_entity that were caused by using free to
12810 deallocate memory blocks that were allocated by xmalloc (via
12811 xstrdup). This caused Emacs to crash when compiled with
12812 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
12813 --enable-checking=xmallocoverrun). xfree is now used to
12814 deallocate these memory blocks.
12816 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
12818 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
12820 emacs_write: Accept and return EMACS_INT for sizes.
12821 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
12823 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
12824 Accept and return EMACS_INT.
12825 (emacs_gnutls_write): Return the number of bytes written on
12827 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
12828 (emacs_read, emacs_write): Remove check for negative size, as the
12829 Emacs source code has been audited now.
12830 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
12831 (emacs_read, emacs_write): Use it.
12832 * process.c (send_process): Adjust to the new signatures of
12833 emacs_write and emacs_gnutls_write. Do not attempt to store
12834 a byte offset into an 'int'; it might overflow.
12835 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
12837 * sound.c: Don't assume sizes fit in 'int'.
12838 (struct sound_device.period_size, alsa_period_size):
12839 Return EMACS_INT, not int.
12840 (struct sound_device.write, vox_write, alsa_write):
12841 Accept EMACS_INT, not int.
12842 (wav_play, au_play): Use EMACS_INT to store sizes and to
12843 record read return values.
12845 2011-04-15 Ben Key <bkey76@gmail.com>
12847 * keyboard.c (Qundefined): Don't declare static since it is used
12849 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
12850 static since they are used in nsfont.m.
12852 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
12854 * process.c (Qprocessp): Don't declare static.
12855 * lisp.h (Qprocessp): Declare again.
12857 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
12859 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
12861 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
12863 Improve C-level modularity by making more things 'static'.
12865 Don't publish debugger-only interfaces to other modules.
12866 * lisp.h (safe_debug_print, debug_output_compilation_hack):
12867 (verify_bytepos, count_markers): Move decls to the only modules
12869 * region-cache.h (pp_cache): Likewise.
12870 * window.h (check_all_windows): Likewise.
12871 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
12873 * sysdep.c (croak): Now static, if
12874 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
12875 * syssignal.h (croak): Declare only if not static.
12877 * alloc.c (refill_memory_reserve): Now static if
12878 !defined REL_ALLOC || defined SYSTEM_MALLOC.
12879 * lisp.h (refill_memory_reserve): Declare only if not static.
12881 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
12882 Define only if USE_LUCID.
12884 * xrdb.c (x_customization_string, x_rm_string): Now static.
12886 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
12887 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
12889 * xdisp.c (draw_row_with_mouse_face): Now static.
12890 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
12892 * window.h (check_all_windows): Mark externally visible.
12894 * window.c (window_deletion_count): Now static.
12896 * undo.c: Make symbols static if they're not exported.
12897 (last_undo_buffer, last_boundary_position, pending_boundary):
12900 * textprop.c (interval_insert_behind_hooks): Now static.
12901 (interval_insert_in_front_hooks): Likewise.
12903 * term.c: Make symbols static if they're not exported.
12904 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
12905 (max_frame_lines, tty_set_terminal_modes):
12906 (tty_reset_terminal_modes, tty_turn_off_highlight):
12907 (get_tty_terminal): Now static.
12908 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
12909 * termhooks.h (term_mouse_moveto): Do not declare if
12910 HAVE_WINDOW_SYSTEM.
12911 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
12912 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
12914 * sysdep.c: Make symbols static if they're not exported.
12915 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
12917 (sigprocmask_set, full_mask): Remove; unused.
12918 (wait_debugging): Mark as visible.
12919 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
12920 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
12922 * syntax.c (syntax_temp): Define only if !__GNUC__.
12924 * sound.c (current_sound_device, current_sound): Now static.
12926 * search.c (searchbufs, searchbuf_head): Now static.
12928 * scroll.c (scroll_cost): Remove; unused.
12929 * dispextern.h (scroll_cost): Remove decl.
12931 * region-cache.h (pp_cache): Mark as externally visible.
12933 * process.c: Make symbols static if they're not exported.
12934 (process_tick, update_tick, create_process, chan_process):
12935 (Vprocess_alist, proc_buffered_char, datagram_access):
12936 (fd_callback_data, send_process_frame, process_sent_to): Now static.
12937 (deactivate_process): Mark defn as static, as well as decl.
12938 * lisp.h (create_process): Remove decl.
12939 * process.h (chan_process, Vprocess_alist): Remove decls.
12941 * print.c: Make symbols static if they're not exported.
12942 (print_depth, new_backquote_output, being_printed, print_buffer):
12943 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
12944 (print_interval, print_number_index, initial_stderr_stream):
12946 * lisp.h (Fprinc): Remove decl.
12947 (debug_output_compilation_hack): Mark as externally visible.
12949 * sysdep.c (croak): Move decl from here to syssignal.h.
12950 * syssignal.h (croak): Put it here, so the API can be checked when
12951 'croak' is called from dissociate_if_controlling_tty.
12953 * minibuf.c: Make symbols static if they're not exported.
12954 (minibuf_save_list, choose_minibuf_frame): Now static.
12955 * lisp.h (choose_minibuf_frame): Remove decl.
12957 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
12959 * lread.c: Make symbols static if they're not exported.
12960 (read_objects, initial_obarray, oblookup_last_bucket_number):
12962 (make_symbol): Remove; unused.
12963 * lisp.h (initial_obarray, make_symbol): Remove decls.
12965 * keyboard.c: Make symbols static if they're not exported.
12966 (single_kboard, recent_keys_index, total_keys, recent_keys):
12967 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
12968 (this_single_command_key_start, echoing, last_auto_save):
12969 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
12970 (command_loop, echo_now, keyboard_init_hook, help_char_p):
12971 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
12972 (Vlispy_mouse_stem, double_click_count):
12974 (force_auto_save_soon): Define only if SIGDANGER.
12975 (ignore_mouse_drag_p): Now static if
12976 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
12977 (print_help): Remove; unused.
12978 (stop_character, last_timer_event): Mark as externally visible.
12979 * keyboard.h (ignore_mouse_drag_p): Declare only if
12980 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
12981 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
12982 * lisp.h (echoing): Remove decl.
12983 (force_auto_save_soon): Declare only if SIGDANGER.
12984 * xdisp.c (redisplay_window): Simplify code, to make it more
12985 obvious that ignore_mouse_drag_p is not accessed if !defined
12986 USE_GTK && !defined HAVE_NS.
12988 * intervals.c: Make symbols static if they're not exported.
12989 (merge_properties_sticky, merge_interval_right, delete_interval):
12991 * intervals.h (merge_interval_right, delete_interval): Remove decls.
12993 * insdel.c: Make symbols static if they're not exported.
12994 However, leave prepare_to_modify_buffer alone. It's never
12995 called from outside this function, but that appears to be a bug.
12996 (combine_after_change_list, combine_after_change_buffer):
12997 (adjust_after_replace, signal_before_change): Now static.
12998 (adjust_after_replace_noundo): Remove; unused.
12999 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
13000 (signal_before_change): Remove decls.
13002 * indent.c (val_compute_motion, val_vmotion): Now static.
13004 * image.c: Make symbols static if they're not exported.
13005 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
13007 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
13008 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
13010 * fringe.c (standard_bitmaps): Now static.
13011 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
13013 * frame.c: Make symbols static if they're not exported.
13014 (x_report_frame_params, make_terminal_frame): Now static.
13015 (get_frame_param): Now static, unless HAVE_NS.
13016 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
13017 (x_get_resource_string): Remove; not used.
13018 * frame.h (make_terminal_frame, x_report_frame_params):
13019 (x_get_resource_string); Remove decls.
13020 (x_fullscreen_adjust): Declare only if WINDOWSNT.
13021 * lisp.h (get_frame_param): Declare only if HAVE_NS.
13023 * font.c, fontset.c: Make symbols static if they're not exported.
13024 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
13025 (FACE_SUITABLE_FOR_CHAR_P): Use it.
13026 * font.c (font_close_object): Now static.
13027 * font.h (font_close_object): Remove.
13028 * fontset.c (FONTSET_OBJLIST): Remove.
13029 (free_realized_fontset) #if-0 the body, which does nothing.
13030 (face_suitable_for_char_p): #if-0, as it's never called.
13031 * fontset.h (face_suitable_for_char_p): Remove decl.
13032 * xfaces.c (face_at_string_position):
13033 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
13034 since 0 is always ASCII.
13036 * fns.c (weak_hash_tables): Now static.
13038 * fileio.c: Make symbols static if they're not exported.
13039 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
13040 (Vwrite_region_annotation_buffers): Now static.
13042 * eval.c: Make symbols static if they're not exported.
13043 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
13044 * lisp.h (backtrace_list): Remove decl.
13046 * emacs.c: Make symbols static if they're not exported.
13047 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
13048 (fatal_error_code, fatal_error_signal_hook, standard_args):
13050 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
13051 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
13052 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
13053 * lisp.h (fatal_error_signal_hook): Remove decl.
13054 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
13056 * editfns.c: Move a (normally-unused) function to its only use.
13057 * editfns.c, lisp.h (get_operating_system_release): Remove.
13058 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
13059 worth the hassle of breaking this out.
13061 * xterm.c: Make symbols static if they're not exported.
13062 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
13063 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
13064 (x_destroy_window, x_delete_display):
13066 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
13067 (x_mouse_leave): Remove; unused.
13068 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
13069 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
13070 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
13072 (x_mouse_leave): Declare only if WINDOWSNT.
13073 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
13074 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
13077 * ftxfont.c: Make symbols static if they're not exported.
13078 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
13080 * font.h (ftxfont_driver): Likewise.
13082 * xfns.c: Make symbols static if they're not exported.
13083 (x_last_font_name, x_display_info_for_name):
13084 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
13085 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
13086 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
13087 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
13088 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
13089 (last_show_tip_args): Now static.
13090 (xic_defaut_fontset, xic_create_fontsetname): Define only if
13091 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
13092 (x_screen_planes): Remove; unused.
13093 * dispextern.h (x_screen_planes): Remove decl.
13095 * dispnew.c: Make symbols static if they're not exported.
13096 * dispextern.h (redraw_garbaged_frames, scrolling):
13097 (increment_row_positions): Remove.
13098 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
13099 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
13101 (redraw_garbaged_frames): Remove; unused.
13103 * xfaces.c: Make symbols static if they're not exported.
13104 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
13106 * xterm.h (defined_color): Remove decls.
13107 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
13108 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
13109 (menu_face_changed_default, defined_color, free_realized_face):
13110 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
13111 (ascii_face_of_lisp_face): Remove; unused.
13113 * xdisp.c: Make symbols static if they're not exported.
13114 * dispextern.h (scratch_glyph_row, window_box_edges):
13115 (glyph_to_pixel_coords, set_cursor_from_row):
13116 (get_next_display_element, set_iterator_to_next):
13117 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
13118 (show_mouse_face): Remove decls
13119 * frame.h (message_buf_print): Likewise.
13120 * lisp.h (pop_message, set_message, check_point_in_composition):
13122 * xterm.h (set_vertical_scroll_bar): Likewise.
13123 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
13124 (message_buf_print, scratch_glyph_row, displayed_buffer):
13125 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
13126 (get_next_display_element, show_mouse_face, window_box_edges):
13127 (frame_to_window_pixel_xy, check_point_in_composition):
13128 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
13129 (glyph_to_pixel_coords): Remove; unused.
13131 * dired.c (file_name_completion): Now static.
13133 * dbusbind.c (xd_in_read_queued_messages): Now static.
13135 * lisp.h (circular_list_error, FOREACH): Remove; unused.
13136 * data.c (circular_list_error): Remove.
13138 * commands.h (last_point_position, last_point_position_buffer):
13139 (last_point_position_window): Remove decls.
13140 * keyboard.c: Make these variables static.
13142 * coding.h (coding, code_convert_region, encode_coding_gap):
13144 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
13145 (iso_code_class, detect_coding, code_convert_region): Now static.
13146 (encode_coding_gap): Remove; unused.
13148 * chartab.c (chartab_chars, chartab_bits): Now static.
13150 * charset.h (charset_iso_8859_1): Remove decl.
13151 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
13154 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
13155 * ccl.c (Vccl_program_table): Now static.
13156 (check_ccl_update): Remove; unused.
13158 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
13159 * category.h: ... from here.
13160 * category.c (check_category_table, set_category_set): Now static.
13162 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
13163 * lisp.h: Remove these decls.
13165 * buffer.c (buffer_count): Remove unused var.
13167 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
13168 so that it's not optimized away.
13169 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
13170 * dispextern.h (bidi_dump_cached_states): Remove, since it's
13171 exported only to the debugger.
13173 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
13174 * atimer.h (run_all_atimers): Remove; not exported.
13176 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
13177 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
13178 was inaccessible from Lisp.
13179 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
13180 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
13182 alloc.c: Import and export fewer symbols, and remove unused items.
13183 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
13185 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
13186 it's not optimized away by whole-program optimization.
13187 (message_enable_multibyte, free_misc): Remove.
13188 (catchlist, handlerlist, mark_backtrace):
13189 Declare only if BYTE_MARK_STACK.
13190 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
13191 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
13192 (message_enable_multibyte): Remove decl.
13193 (free_misc, interval_free_list, float_block, float_block_index):
13194 (n_float_blocks, float_free_list, cons_block, cons_block_index):
13195 (cons_free_list, last_marked_index):
13197 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
13198 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
13199 (mark_backtrace): Define only if BYTE_MARK_STACK.
13200 * xdisp.c (message_enable_multibyte): Now static.
13202 Declare Lisp_Object Q* variables to be 'static' if not exported.
13203 This makes it easier for human readers (and static analyzers)
13204 to see whether these variables are used from other modules.
13205 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
13206 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
13207 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
13208 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
13209 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
13210 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
13211 * xmenu.c, xselect.c:
13212 Declare Q* vars static if they are not used in other modules.
13213 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
13214 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
13215 Remove decls of unexported vars.
13216 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
13218 * lisp.h (DEFINE_FUNC): Make sname 'static'.
13220 Make Emacs functions such as Fatom 'static' by default.
13221 This makes it easier for human readers (and static analyzers)
13222 to see whether these functions can be called from other modules.
13223 DEFUN now defines a static function. To make the function external
13224 so that it can be used in other C modules, use the new macro DEFUE.
13225 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
13226 (Finit_image_library):
13227 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
13228 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
13229 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
13230 Remove decls, since these functions are now static.
13231 (Funintern, Fget_internal_run_time): New decls, since these functions
13232 were already external.
13234 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
13235 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
13236 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
13237 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
13238 * keyboard.c, keymap.c, lread.c:
13239 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
13240 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
13241 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
13242 Mark functions with DEFUE instead of DEFUN,
13243 if they are used in other modules.
13244 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
13245 decls for now-static functions.
13246 * buffer.h (Fdelete_overlay): Remove decl.
13247 * callproc.c (Fgetenv_internal): Mark as internal.
13248 * composite.c (Fremove_list_of_text_properties): Remove decl.
13249 (Fcomposition_get_gstring): New forward static decl.
13250 * composite.h (Fcomposite_get_gstring): Remove decl.
13251 * dired.c (Ffile_attributes): New forward static decl.
13252 * doc.c (Fdocumntation_property): New forward static decl.
13253 * eval.c (Ffetch_bytecode): New forward static decl.
13254 (Funintern): Remove extern decl; now in .h file where it belongs.
13255 * fileio.c (Fmake_symbolic_link): New forward static decl.
13256 * image.c (Finit_image_library): New forward static decl.
13257 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
13258 * intervals.h (Fprevious_property_change):
13259 (Fremove_list_of_text_properties): Remove decls.
13260 * keyboard.c (Fthis_command_keys): Remove decl.
13261 (Fcommand_execute): New forward static decl.
13262 * keymap.c (Flookup_key): New forward static decl.
13263 (Fcopy_keymap): Now static.
13264 * keymap.h (Flookup_key): Remove decl.
13265 * process.c (Fget_process): New forward static decl.
13266 (Fprocess_datagram_address): Mark as internal.
13267 * syntax.c (Fsyntax_table_p): New forward static decl.
13268 (skip_chars): Remove duplicate decl.
13269 * textprop.c (Fprevious_property_change): New forward static decl.
13270 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
13272 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
13273 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
13275 * editfns.c (Fformat): Remove unreachable code.
13277 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
13279 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
13282 2011-04-13 Eli Zaretskii <eliz@gnu.org>
13284 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
13285 when at ZV. (Bug#8487)
13287 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
13289 * charset.c (Fclear_charset_maps): Use xfree instead of free.
13291 * keyboard.c (parse_tool_bar_item): Likewise.
13292 * sound.c (sound_cleanup, alsa_close): Likewise.
13293 * termcap.c (tgetent): Likewise.
13294 * xfns.c (x_default_font_parameter): Likewise.
13295 * xsettings.c (read_and_apply_settings): Likewise.
13297 * alloc.c (overrun_check_malloc, overrun_check_realloc)
13298 (overrun_check_free): Protoize.
13300 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
13302 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
13303 since callers should never pass a negative size.
13304 Change the signature to match that of plain 'read' and 'write'; see
13305 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
13306 * lisp.h: Update prototypes of emacs_write and emacs_read.
13308 2011-04-11 Eli Zaretskii <eliz@gnu.org>
13310 * xdisp.c (redisplay_window): Don't try to determine the character
13311 position of the scroll margin if the window start point w->startp
13312 is outside the buffer's accessible region. (Bug#8468)
13314 2011-04-10 Eli Zaretskii <eliz@gnu.org>
13316 Fix write-region and its subroutines for buffers > 2GB.
13317 * fileio.c (a_write, e_write): Modify declaration of arguments and
13318 local variables to support buffers larger than 2GB.
13319 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
13321 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
13322 argument, local variables, and return value.
13324 * lisp.h: Update prototypes of emacs_write and emacs_read.
13326 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
13328 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
13330 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
13332 Fix more problems found by GCC 4.6.0's static checks.
13334 * xdisp.c (vmessage): Use a better test for character truncation.
13336 * charset.c (load_charset_map): <, not <=, for optimization,
13337 and to avoid potential problems with integer overflow.
13338 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
13339 * casetab.c (set_identity, shuffle): Likewise.
13340 * editfns.c (Fformat): Likewise.
13341 * syntax.c (skip_chars): Likewise.
13343 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
13344 This also lets GCC 4.6.0 generate slightly better loop code.
13346 * callint.c (Fcall_interactively): <, not <=, for optimization.
13347 (Fcall_interactively): Count the number of arguments produced,
13348 not the number of arguments given. This is simpler and lets GCC
13349 4.6.0 generate slightly better code.
13351 * ftfont.c: Distingish more carefully between FcChar8 and char.
13352 The previous code passed unsigned char * to a functions like
13353 strlen and xstrcasecmp that expect char *, which does not
13354 conform to the C standard.
13355 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
13356 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
13357 char * when the C standard requires it.
13359 * keyboard.c (read_char): Remove unused var.
13361 * eval.c: Port to Windows vsnprintf (Bug#8435).
13362 Include <limits.h>.
13363 (SIZE_MAX): Define if the headers do not.
13364 (verror): Do not give up if vsnprintf returns a negative count.
13365 Instead, grow the buffer. This ports to Windows vsnprintf, which
13366 does not conform to C99. Problem reported by Eli Zaretskii.
13367 Also, simplify the allocation scheme, by avoiding the need for
13368 calling realloc, and removing the ALLOCATED variable.
13370 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
13372 Remove invocations of doprnt, as Emacs now uses vsnprintf.
13373 But keep the doprint source code for now, as we might revamp it
13374 and use it again (Bug#8435).
13375 * lisp.h (doprnt): Remove.
13376 * Makefile.in (base_obj): Remove doprnt.o.
13377 * deps.mk (doprnt.o): Remove.
13379 error: Print 32- and 64-bit integers portably (Bug#8435).
13380 Without this change, on typical 64-bit hosts error ("...%d...", N)
13381 was used to print both 32- and 64-bit integers N, which relied on
13382 undefined behavior.
13383 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
13384 * lisp.h (error, verror): Mark as printf-like functions.
13385 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
13386 Report overflow in size calculations when allocating printf buffer.
13387 Do not truncate output string at its first null byte.
13388 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
13389 Truncate the output at a character boundary, since vsnprintf does not
13391 * charset.c (check_iso_charset_parameter): Convert internal
13392 character to string before calling 'error', since %c now has the
13394 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
13395 overflow when computing char to be passed to 'error'. Do not
13396 pass Lisp_Object to 'error'; pass the integer instead.
13397 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
13398 formatted with plain %d.
13400 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
13402 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
13404 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
13406 * xterm.c (x_catch_errors): Remove duplicate declaration.
13408 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
13410 * xdisp.c, lisp.h (message_nolog): Remove; unused.
13412 2011-04-10 Jim Meyering <meyering@redhat.com>
13414 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
13415 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
13416 return ssize_t not "int", and use size_t as the buffer length.
13417 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
13418 * gnutls.h: Update declarations.
13419 * process.c (read_process_output): Use ssize_t, to match.
13420 (send_process): Likewise.
13422 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
13424 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
13426 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
13428 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
13429 Use unsigned char, to match FcChar8 type definition.
13431 * xterm.c (handle_one_xevent):
13432 * xmenu.c (create_and_show_popup_menu):
13433 * xselect.c (x_decline_selection_request)
13434 (x_reply_selection_request): Avoid type-punned deref of X events.
13436 2011-04-09 Eli Zaretskii <eliz@gnu.org>
13438 Fix some uses of `int' instead of EMACS_INT.
13439 * search.c (string_match_1, fast_string_match)
13440 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
13441 (scan_buffer, find_next_newline_no_quit)
13442 (find_before_next_newline, search_command, Freplace_match)
13443 (Fmatch_data): Make some `int' variables be EMACS_INT.
13445 * xdisp.c (display_count_lines): 3rd argument and return value now
13446 EMACS_INT. All callers changed.
13447 (pint2hrstr): Last argument is now EMACS_INT.
13449 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
13450 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
13451 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
13452 (decode_coding_utf_16, decode_coding_emacs_mule)
13453 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
13454 (decode_coding_ccl, decode_coding_charset)
13455 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
13456 (decode_coding_iso_2022, decode_coding_emacs_mule)
13457 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
13458 <char_offset, last_offset>: Declare EMACS_INT.
13459 (encode_coding_utf_8, encode_coding_utf_16)
13460 (encode_coding_emacs_mule, encode_invocation_designation)
13461 (encode_designation_at_bol, encode_coding_iso_2022)
13462 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
13463 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
13465 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
13466 (encode_invocation_designation): Last argument P_NCHARS is now
13468 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
13469 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
13471 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
13474 * ccl.c (Fccl_execute_on_string): Declare some variables
13477 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
13479 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
13481 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
13483 * process.c (Fformat_network_address): Doc fix.
13485 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
13487 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
13489 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
13491 * keyboard.c (read_char): Call Lisp function help-form-show,
13492 instead of using internal_with_output_to_temp_buffer.
13493 (Qhelp_form_show): New var.
13494 (syms_of_keyboard): Use DEFSYM macro.
13496 * print.c (internal_with_output_to_temp_buffer): Function deleted.
13498 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
13500 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
13502 * process.c (Flist_processes): Remove to Lisp.
13503 (list_processes_1): Delete.
13505 2011-04-06 Eli Zaretskii <eliz@gnu.org>
13507 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
13509 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
13511 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
13513 Fix more problems found by GCC 4.6.0's static checks.
13515 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
13517 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
13519 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
13521 * xdisp.c (vmessage): Mark as a printf-like function.
13523 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
13525 * sound.c (sound_warning): Don't crash if arg contains a printf format.
13527 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
13528 printf-like functions.
13529 (tiff_load): Add casts to remove these marks before passing them
13530 to system-supplied API.
13532 * eval.c (Fsignal): Remove excess argument to 'fatal'.
13534 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
13535 This avoids several warnings with gcc -Wstrict-overflow.
13536 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
13537 directly, rather than having caller test rule sign. This avoids
13538 some unnecessary tests.
13539 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
13540 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
13541 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
13543 * xfont.c (xfont_text_extents): Remove var that was set but not used.
13544 (xfont_open): Avoid unnecessary tests.
13546 * composite.c (composition_gstring_put_cache): Use unsigned integer.
13548 * composite.h, composite.c (composition_gstring_put_cache):
13549 Use EMACS_INT, not int, for length.
13551 * composite.h (COMPOSITION_DECODE_REFS): New macro,
13552 breaking out part of COMPOSITION_DECODE_RULE.
13553 (COMPOSITION_DECODE_RULE): Use it.
13554 * composite.c (get_composition_id): Remove unused local vars,
13555 by using the new macro.
13557 * textprop.c (set_text_properties_1): Change while to do-while,
13558 since the condition is always true at first.
13560 * intervals.c (graft_intervals_into_buffer): Mark var as used.
13561 (interval_deletion_adjustment): Return unsigned value.
13564 * process.c (list_processes_1, create_pty, read_process_output):
13565 (exec_sentinel): Remove vars that were set but not used.
13566 (create_pty): Remove unnecessary "volatile"s.
13567 (Fnetwork_interface_info): Avoid possibility of int overflow.
13568 (read_process_output): Do adaptive read buffering even if carryover.
13569 (read_process_output): Simplify nbytes computation if buffered.
13571 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
13573 * syntax.c (scan_words): Remove var that was set but not used.
13574 (update_syntax_table): Use unsigned instead of int.
13576 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
13577 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
13578 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
13580 * print.c (print_error_message): Avoid int overflow.
13582 * font.c (font_list_entities): Redo for clarity,
13583 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
13585 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
13586 (font_score): Avoid potential overflow in diff calculation.
13588 * fns.c (substring_both): Remove var that is set but not used.
13589 (sxhash): Redo loop for clarity and to avoid wraparound warning.
13591 * eval.c (funcall_lambda): Rename local to avoid shadowing.
13593 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
13594 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
13595 can always succeed if overflow has undefined behavior.
13597 * search.c (boyer_moore, wordify): Remove vars set but not used.
13598 (wordify): Omit three unnecessary tests.
13600 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
13601 All callers changed. This avoids the need for an unused var.
13603 * casefiddle.c (casify_region): Remove var that is set but not used.
13605 * dired.c (file_name_completion): Remove var that is set but not used.
13607 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
13609 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
13610 (Finsert_file_contents): Remove unnecessary code checking fd.
13612 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
13613 Check for integer overflow on size calculations.
13615 * buffer.c (Fprevious_overlay_change): Remove var that is set
13618 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
13619 Remove vars that are set but not used.
13620 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
13621 (timer_check_2): Mark vars as initialized.
13623 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
13625 * image.c (lookup_image): Remove var that is set but not used.
13626 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
13628 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
13629 that are set but not used.
13631 * xfns.c (make_invisible_cursor): Don't return garbage
13632 if XCreateBitmapFromData fails (Bug#8410).
13634 * xselect.c (x_get_local_selection, x_handle_property_notify):
13635 Remove vars that are set but not used.
13637 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
13638 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
13640 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
13641 Remove var that is set but not used.
13642 (scroll_bar_windows_size): Now size_t, not int.
13643 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
13644 Check for overflow.
13646 * xfaces.c (realize_named_face): Remove vars that are set but not used.
13647 (map_tty_color) [!defined MSDOS]: Likewise.
13649 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
13651 * coding.c: Remove vars that are set but not used.
13652 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
13653 All callers changed.
13654 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
13655 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
13656 (decode_coding_charset): Remove vars that are set but not used.
13658 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
13659 that is set but not used.
13661 * print.c (print_object): Remove var that is set but not used.
13663 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
13664 The gnulib version avoids calling malloc in the usual case,
13665 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
13666 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
13667 * filelock.c (current_lock_owner): Likewise.
13668 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
13669 * sysdep.c: Include allocator.h, careadlinkat.h.
13670 (emacs_no_realloc_allocator): New static constant.
13671 (emacs_readlink): New function.
13672 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
13673 ../lib/careadlinkat.h.
13675 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
13677 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
13678 first non-nil return value).
13680 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
13682 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
13683 if not defined (Bug#8403).
13685 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
13687 * xdisp.c (display_count_lines): Remove parameter `start',
13688 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
13689 (get_char_face_and_encoding): Remove parameter `multibyte_p',
13690 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
13691 (fill_stretch_glyph_string): Remove parameters `row' and `area',
13692 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
13693 and thereabouts. All callers changed.
13694 (get_per_char_metric): Remove parameter `f', unused since
13695 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
13697 2011-04-02 Jim Meyering <meyering@redhat.com>
13699 do not dereference NULL upon failed strdup
13700 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
13701 (ns_get_family): Likewise.
13703 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
13705 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
13707 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
13709 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
13712 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
13714 Add lexical binding.
13716 * window.c (Ftemp_output_buffer_show): New fun.
13717 (Fsave_window_excursion):
13718 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
13720 * lread.c (lisp_file_lexically_bound_p): New function.
13721 (Fload): Bind Qlexical_binding.
13722 (readevalloop): Remove `evalfun' arg.
13723 Bind Qinternal_interpreter_environment.
13724 (Feval_buffer): Bind Qlexical_binding.
13725 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
13727 (syms_of_lread): Declare `lexical-binding'.
13729 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
13731 * keyboard.c (eval_dyn): New fun.
13732 (menu_item_eval_property): Use it.
13734 * image.c (parse_image_spec): Use Ffunctionp.
13736 * fns.c (concat, mapcar1): Accept byte-code-functions.
13738 * eval.c (Fsetq): Handle lexical vars.
13739 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
13740 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
13741 (FletX, Flet): Obey lexical binding.
13742 (Fcommandp): Handle closures.
13743 (Feval): New `lexical' arg.
13744 (eval_sub): New function extracted from Feval. Use it almost
13745 everywhere where Feval was used. Look up vars in lexical env.
13747 (Ffunctionp): Move from subr.el.
13748 (Ffuncall): Handle closures.
13749 (apply_lambda): Remove `eval_flags'.
13750 (funcall_lambda): Handle closures and new byte-code-functions.
13751 (Fspecial_variable_p): New function.
13752 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
13753 but without exporting it to Lisp.
13755 * doc.c (Fdocumentation, store_function_docstring):
13756 * data.c (Finteractive_form): Handle closures.
13758 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
13761 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
13763 (exec_byte_code): New function extracted from Fbyte_code to handle new
13764 calling convention for byte-code-functions. Add new byte-codes.
13766 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
13768 * alloc.c (Fmake_symbol): Init new `declared_special' field.
13770 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
13772 * xdisp.c (redisplay_internal): Fix prototype.
13774 2011-03-31 Eli Zaretskii <eliz@gnu.org>
13776 * xdisp.c (SCROLL_LIMIT): New macro.
13777 (try_scrolling): Use it when setting scroll_limit.
13778 Limit scrolling to 100 screen lines.
13779 (redisplay_window): Even when falling back on "recentering",
13780 position point in the window according to scroll-conservatively,
13781 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
13783 (try_scrolling): When point is above the window, allow searching
13784 as far as scroll_max, or one screenful, to compute vertical
13785 distance from PT to the scroll margin position. This prevents
13786 try_scrolling from unnecessarily failing when
13787 scroll-conservatively is set to a value slightly larger than the
13788 window height. Clean up the case of PT below the margin at bottom
13789 of window: scroll_max can no longer be INT_MAX. When aggressive
13790 scrolling is in use, don't let point enter the opposite scroll
13791 margin as result of the scroll.
13792 (syms_of_xdisp) <scroll-conservatively>: Document the
13793 threshold of 100 lines for never-recentering scrolling.
13795 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
13797 * dispextern.h (move_it_by_lines):
13798 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
13799 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
13800 (message_log_check_duplicate): Remove parameters `prev_bol' and
13801 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
13802 (redisplay_internal): Remove parameter `preserve_echo_area',
13803 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
13805 * indent.c (Fvertical_motion):
13806 * window.c (window_scroll_pixel_based, Frecenter):
13807 Don't pass `need_y_p' to `move_it_by_lines'.
13809 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
13811 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
13812 steal a few bits to be more compact.
13813 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
13814 Remove unneeded casts.
13816 * bytecode.c (Fbyte_code): CAR and CDR can GC.
13818 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
13820 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
13821 binding" message (bug#7967).
13823 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
13825 Fix more problems found by GCC 4.6.0's static checks.
13827 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
13828 Remove unused local var.
13830 * editfns.c (Fmessage_box): Remove unused local var.
13832 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
13833 (note_mode_line_or_margin_highlight, note_mouse_highlight):
13834 Omit unused local vars.
13835 * window.c (shrink_windows): Omit unused local var.
13836 * menu.c (digest_single_submenu): Omit unused local var.
13837 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
13838 Omit unused local var.
13840 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
13841 Don't assume string length fits in int.
13842 (keyremap_step, read_key_sequence): Use size_t for sizes.
13843 (read_key_sequence): Don't check last_real_key_start redundantly.
13845 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
13846 instead of alloca (Bug#8344).
13848 * eval.c (Fbacktrace): Don't assume nargs fits in int.
13849 (Fbacktrace_frame): Don't assume nframes fits in int.
13851 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
13853 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
13856 * term.c (produce_glyphless_glyph): Remove unnecessary test.
13858 * cm.c (calccost): Turn while-do into do-while, for clarity.
13860 * keyboard.c (syms_of_keyboard): Use the same style as later
13861 in this function when indexing through an array. This also
13862 works around GCC bug 48267.
13864 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
13866 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
13868 * chartab.c (sub_char_table_ref_and_range): Redo for slight
13869 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
13871 * keyboard.c, keyboard.h (num_input_events): Now size_t.
13872 This avoids undefined behavior on integer overflow, and is a bit
13873 more convenient anyway since it is compared to a size_t variable.
13875 Variadic C functions now count arguments with size_t, not int.
13876 This avoids an unnecessary limitation on 64-bit machines, which
13877 caused (substring ...) to crash on large vectors (Bug#8344).
13878 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
13879 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
13880 All variadic functions and their callers changed accordingly.
13881 (struct gcpro.nvars): Now size_t, not int. All uses changed.
13882 * data.c (arith_driver, float_arith_driver): Likewise.
13883 * editfns.c (general_insert_function): Likewise.
13884 * eval.c (struct backtrace.nargs, interactive_p)
13885 (internal_condition_case_n, run_hook_with_args, apply_lambda)
13886 (funcall_lambda, mark_backtrace): Likewise.
13887 * fns.c (concat): Likewise.
13888 * frame.c (x_set_frame_parameters): Likewise.
13889 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
13890 0 if not found, not -1. All callers changed.
13892 * alloc.c (garbage_collect): Don't assume stack size fits in int.
13893 (stack_copy_size): Now size_t, not int.
13894 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
13896 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
13898 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
13899 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
13900 All callers changed.
13902 * lisp.h (multibyte_char_to_unibyte):
13903 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
13904 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
13905 * character.h (CHAR_TO_BYTE8):
13906 * cmds.c (internal_self_insert):
13907 * editfns.c (general_insert_function):
13908 * keymap.c (push_key_description):
13909 * search.c (Freplace_match):
13910 * xdisp.c (message_dolog, set_message_1): All callers changed.
13912 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
13914 * keyboard.c (safe_run_hook_funcall): New function.
13915 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
13916 don't set the hook to nil, but remove the offending function instead.
13917 (Qcommand_hook_internal): Remove, unused.
13918 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
13919 Vcommand_hook_internal.
13921 * eval.c (enum run_hooks_condition): Remove.
13922 (funcall_nil, funcall_not): New functions.
13923 (run_hook_with_args): Call each function through a `funcall' argument.
13924 Remove `cond' argument, now redundant.
13925 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
13926 (Frun_hook_with_args_until_failure): Adjust accordingly.
13927 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
13929 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
13931 * dispextern.h (string_buffer_position): Remove declaration.
13933 * print.c (strout): Remove parameter `multibyte', unused since
13934 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
13936 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
13937 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
13938 All callers changed.
13940 * w32.c (_wsa_errlist): Use braces for struct initializers.
13942 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
13943 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
13944 All callers changed.
13945 (string_buffer_position): Likewise. Also, make static (it's never
13946 used outside xdisp.c).
13947 (cursor_row_p): Remove parameter `w', unused since
13948 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
13949 (decode_mode_spec): Remove parameter `precision', introduced during
13950 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
13951 All callers changed.
13953 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
13955 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
13957 2011-03-27 Anders Lindgren <andlind@gmail.com>
13959 * nsterm.m (ns_menu_bar_is_hidden): New variable.
13960 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
13961 (ns_update_auto_hide_menu_bar): New functions.
13962 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
13963 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
13964 ns_constrain_all_frames.
13965 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
13966 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
13968 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
13970 * nsmenu.m (runDialogAt): Remove argument to timer_check.
13972 2011-03-27 Glenn Morris <rgm@gnu.org>
13974 * syssignal.h: Replace RETSIGTYPE with void.
13975 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
13976 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
13977 Replace SIGTYPE with void everywhere.
13978 * s/usg5-4-common.h (SIGTYPE): Remove definition.
13979 * s/template.h (SIGTYPE): Remove commented out definition.
13981 2011-03-26 Eli Zaretskii <eliz@gnu.org>
13983 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
13984 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
13986 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
13988 * w32.c (read_unc_volume): Use parameter `henum', instead of
13989 global variable `wget_enum_handle'.
13991 * keymap.c (describe_vector): Remove parameters `indices' and
13992 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
13993 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
13995 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
13997 * keyboard.c (timer_check): Remove parameter `do_it_now',
13998 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
13999 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
14000 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
14002 * keyboard.c (read_char):
14003 * w32menu.c (w32_menu_display_help):
14004 * xmenu.c (show_help_event, menu_help_callback):
14005 Adjust calls to `show_help_echo'.
14007 * gtkutil.c (xg_maybe_add_timer):
14008 * keyboard.c (readable_events):
14009 * process.c (wait_reading_process_output):
14010 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
14012 * insdel.c (adjust_markers_gap_motion):
14013 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
14014 (gap_left, gap_right): Don't call it.
14016 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
14018 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
14019 incurred during fontification.
14021 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
14023 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
14024 (DEFVAR_PER_BUFFER): Don't pass it.
14026 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
14027 (scrolling_window): Don't pass it.
14029 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
14031 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
14033 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
14035 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
14036 of variables specific to SELinux and computation of `encoded_absname'.
14038 * image.c (XPutPixel): Remove unused variable `height'.
14040 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
14042 * unexw32.c (get_section_info): Remove unused variable `section'.
14044 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
14045 (system_process_attributes): Remove unused variable `sess'.
14046 (sys_read): Remove unused variable `err'.
14048 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
14049 (w32_wnd_proc): Remove unused variable `isdead'.
14050 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
14051 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
14052 (x_create_tip_frame): Remove unused variable `tem'.
14054 * w32inevt.c (w32_console_read_socket):
14055 Remove unused variable `no_events'.
14057 * w32term.c (x_draw_composite_glyph_string_foreground):
14058 Remove unused variable `width'.
14060 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
14062 * w32term.c (x_set_glyph_string_clipping):
14063 Don't pass uninitialized region to CombineRgn.
14065 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
14067 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
14068 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
14069 (Fx_close_connection): Remove unused variable `i'.
14071 * w32font.c (w32font_draw): Return number of glyphs.
14072 (w32font_open_internal): Remove unused variable `i'.
14073 (w32font_driver): Add missing initializer.
14075 * w32menu.c (utf8to16): Remove unused variable `utf16'.
14076 (fill_in_menu): Remove unused variable `items_added'.
14078 * w32term.c (last_mouse_press_frame): Remove static global variable.
14079 (w32_clip_to_row): Remove unused variable `f'.
14080 (x_delete_terminal): Remove unused variable `i'.
14082 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
14083 (NOTHING): Remove unused static global variable.
14084 (uniscribe_check_otf): Remove unused variable `table'.
14085 (uniscribe_font_driver): Add missing initializers.
14087 2011-03-23 Julien Danjou <julien@danjou.info>
14089 * term.c (Fsuspend_tty, Fresume_tty):
14090 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
14091 * window.c (temp_output_buffer_show):
14092 * insdel.c (signal_before_change):
14093 * frame.c (Fhandle_switch_frame):
14094 * fileio.c (Fdo_auto_save):
14095 * emacs.c (Fkill_emacs):
14096 * editfns.c (save_excursion_restore):
14097 * cmds.c (internal_self_insert):
14098 * callint.c (Fcall_interactively):
14099 * buffer.c (Fkill_all_local_variables):
14100 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
14102 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
14103 unconditionally since it does the check itself.
14105 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
14107 Fix more problems found by GCC 4.5.2's static checks.
14109 * coding.c (encode_coding_raw_text): Avoid unnecessary test
14110 the first time through the loop, since we know p0 < p1 then.
14111 This also avoids a gcc -Wstrict-overflow warning.
14113 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
14114 leading to a memory leak, possible in functions like
14115 load_charset_map_from_file that can allocate an unbounded number
14116 of objects (Bug#8318).
14118 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
14119 that could (at least in theory) be that large.
14121 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
14122 This is less likely to overflow, and avoids undefined behavior if
14123 overflow does occur. All callers changed. Use strtoul to scan
14124 for the unsigned long integer.
14125 (pint2hrstr): Simplify and tune code slightly.
14126 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
14128 * scroll.c (do_scrolling): Work around GCC bug 48228.
14129 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
14131 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
14132 This also avoids a warning with gcc -Wstrict-overflow.
14133 (validate_x_resource_name): Simplify count usage.
14134 This also avoids a warning with gcc -Wstrict-overflow.
14136 * fileio.c (Fcopy_file): Report error if fchown or fchmod
14139 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
14141 * process.c (Fmake_network_process): Use socklen_t, not int,
14142 where POSIX says socklen_t is required in portable programs.
14143 This fixes a porting bug on hosts like 64-bit HP-UX, where
14144 socklen_t is wider than int (Bug#8277).
14145 (Fmake_network_process, server_accept_connection):
14146 (wait_reading_process_output, read_process_output):
14149 * process.c: Rename or move locals to avoid shadowing.
14150 (list_processes_1, Fmake_network_process):
14151 (read_process_output_error_handler, exec_sentinel_error_handler):
14152 Rename or move locals.
14153 (Fmake_network_process): Define label "retry_connect" only if needed.
14154 (Fnetwork_interface_info): Fix pointer signedness.
14155 (process_send_signal): Add cast to avoid pointer signedness problem.
14156 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
14157 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
14159 Make tparam.h and terminfo.c consistent.
14160 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
14161 Include tparam.h instead, since it declares them.
14162 * cm.h (PC): Remove extern decl; tparam.h now does this.
14163 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
14164 * terminfo.c: Include tparam.h, to check interfaces.
14165 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
14166 (tparam): Adjust signature to match interface in tparam.h;
14167 this removes some undefined behavior. Check that outstring and len
14168 are zero, which they always are with Emacs.
14169 * tparam.h (PC, BC, UP): New extern decls.
14171 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
14172 (xftfont_open): Rename locals to avoid shadowing.
14174 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
14175 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
14176 (OTF_TAG_SYM): Omit macro if not needed.
14177 (ftfont_list): Remove unused local.
14178 (get_adstyle_property, ftfont_pattern_entity):
14179 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
14180 Rename locals to avoid shadowing.
14182 * xfont.c (xfont_list_family): Mark var as initialized.
14184 * xml.c (make_dom): Now static.
14186 * composite.c (composition_compute_stop_pos): Rename local to
14188 (composition_reseat_it): Remove unused locals.
14189 (find_automatic_composition, composition_adjust_point): Likewise.
14190 (composition_update_it): Mark var as initialized.
14191 (find_automatic_composition): Mark vars as initialized,
14192 with a FIXME (Bug#8290).
14194 character.h: Rename locals to avoid shadowing.
14195 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
14196 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
14197 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
14198 (BUF_DEC_POS): Be more systematic about renaming local temporaries
14199 to avoid shadowing.
14201 * textprop.c (property_change_between_p): Remove; unused.
14203 * intervals.c (interval_start_pos): Now static.
14205 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
14207 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
14208 Rename locals to avoid shadowing.
14210 * sound.c (wav_play, au_play, Fplay_sound_internal):
14211 Fix pointer signedness.
14212 (alsa_choose_format): Remove unused local var.
14213 (wav_play): Initialize a variable to 0, to prevent undefined
14214 behavior (Bug#8278).
14216 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
14218 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
14220 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
14221 clobbering (Bug#8298).
14222 * sysdep.c (sys_subshell): Likewise.
14223 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
14225 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
14226 This should get cleaned up, so that child_setup has the
14227 same signature on all platforms.
14229 * callproc.c (call_process_cleanup): Now static.
14230 (relocate_fd): Rename locals to avoid shadowing.
14232 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
14234 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
14235 not to be necessary, and produces flickering.
14237 2011-03-20 Glenn Morris <rgm@gnu.org>
14239 * config.in: Remove file.
14241 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
14243 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
14244 are now in src/globals.h.
14245 (syms_of_minibuf): Remove spurious & from previous change.
14247 2011-03-20 Leo Liu <sdl.web@gmail.com>
14249 * minibuf.c (completing-read-function): New variable.
14250 (completing-read-default): Rename from completing-read.
14251 (completing-read): Call completing-read-function.
14253 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
14255 * xfaces.c (Fx_load_color_file):
14256 Read color file from absolute filename (bug#8250).
14258 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
14260 * makefile.w32-in: Update dependencies.
14262 2011-03-17 Eli Zaretskii <eliz@gnu.org>
14264 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
14266 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
14268 Fix more problems found by GCC 4.5.2's static checks.
14270 * process.c (make_serial_process_unwind, send_process_trap):
14271 (sigchld_handler): Now static.
14273 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
14274 That way, the code declares only the vars that it needs.
14275 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
14276 * s/cygwin.h (PTY_ITERATION): Likewise.
14277 * s/darwin.h (PTY_ITERATION): Likewise.
14278 * s/gnu-linux.h (PTY_ITERATION): Likewise.
14280 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
14281 * process.c (allocate_pty): Don't declare stb unless it's needed.
14283 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
14284 (CONSTANTLIM): Remove; unused.
14285 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
14286 Define only if needed.
14288 * unexelf.c (unexec): Name an expression,
14289 to avoid gcc -Wbad-function-cast warning.
14290 Use a different way to cause a compilation error if anyone uses
14291 n rather than nn, a way that does not involve shadowing.
14292 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
14294 * deps.mk (unexalpha.o): Remove; unused.
14296 New file unexec.h, the (simple) interface for unexec (Bug#8267).
14297 * unexec.h: New file.
14298 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
14299 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
14300 Depend on unexec.h.
14301 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
14302 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
14303 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
14304 Change as necessary to match prototype in unexec.h.
14306 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
14308 (back_comment, skip_chars): Mark vars as initialized.
14310 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
14311 Rename locals to avoid shadowing.
14313 * lread.c (read1): Rewrite so as not to use empty "else".
14314 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
14316 * print.c (Fredirect_debugging_output): Fix pointer signedess.
14318 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
14319 warning when compiling print.c.
14321 * font.c (font_unparse_fcname): Abort in an "impossible" situation
14322 instead of using an uninitialized var.
14323 (font_sort_entities): Mark var as initialized.
14325 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
14327 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
14328 pointers to constants.
14329 (font_parse_fcname): Remove unused vars.
14330 (font_delete_unmatched): Now static.
14331 (font_get_spec): Remove; unused.
14332 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
14333 (font_update_drivers, Ffont_get_glyphs, font_add_log):
14334 Rename or move locals to avoid shadowing.
14336 * fns.c (require_nesting_list, require_unwind): Now static.
14337 (Ffillarray): Rename locals to avoid shadowing.
14339 * floatfns.c (domain_error2): Define only if needed.
14340 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
14342 * alloc.c (mark_backtrace): Move decl from here ...
14343 * lisp.h: ... to here, so that it can be checked.
14345 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
14346 (Fdefvar): Rewrite so as not to use empty "else".
14347 (lisp_indirect_variable): Name an expression,
14348 to avoid gcc -Wbad-function-cast warning.
14349 (Fdefvar): Rename locals to avoid shadowing.
14351 * callint.c (quotify_arg, quotify_args): Now static.
14352 (Fcall_interactively): Rename locals to avoid shadowing.
14353 Use const pointer when appropriate.
14355 * lisp.h (get_system_name, get_operating_system_release):
14356 Move decls here, to check interfaces.
14357 * process.c (get_operating_system_release): Move decl to lisp.h.
14358 * xrdb.c (get_system_name): Likewise.
14359 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
14360 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
14361 some of which prompt warnings from gcc -Wbad-function-cast.
14362 (Fformat_time_string, Fencode_time, Finsert_char):
14363 (Ftranslate_region_internal, Fformat):
14364 Rename or remove local vars to avoid shadowing.
14365 (Ftranslate_region_internal): Mark var as initialized.
14367 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
14370 * lisp.h (eassert): Check that the argument compiles, even if
14371 ENABLE_CHECKING is not defined.
14373 * data.c (Findirect_variable): Name an expression, to avoid
14374 gcc -Wbad-function-cast warning.
14375 (default_value, arithcompare, arith_driver, arith_error): Now static.
14376 (store_symval_forwarding): Rename local to avoid shadowing.
14377 (Fmake_variable_buffer_local, Fmake_local_variable):
14378 Mark variables as initialized.
14379 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
14381 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
14382 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
14383 Rename locals to avoid shadowing.
14384 (mark_stack): Move local variables into the #ifdef region where
14386 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
14387 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
14389 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
14390 (GC_STRING_CHARS): Remove; not used.
14391 (Fmemory_limit): Cast sbrk's returned value to char *.
14393 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
14394 avoids undefined behavior in theory.
14396 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
14398 Use functions, not macros, for up- and down-casing (Bug#8254).
14399 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
14400 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
14401 to use the following functions instead of these macros.
14402 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
14403 EMACS_INT, since callers assume the returned value fits in int.
14404 (upcase1): Likewise, for UPCASE_TABLE.
14405 (uppercasep, lowercasep, upcase): New static inline functions.
14406 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
14407 the race-condition problem in the old DOWNCASE.
14409 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
14410 Rename locals to avoid shadowing.
14411 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
14412 (regex_compile, re_search_2, re_match_2_internal):
14413 Remove unused local vars.
14414 (FREE_VAR): Rewrite so as not to use empty "else",
14415 which gcc can warn about.
14416 (regex_compile, re_match_2_internal): Mark locals as initialized.
14417 (RETALLOC_IF): Define only if needed.
14418 (WORDCHAR_P): Likewise. This one is never needed, but is used
14419 only in a comment talking about a compiler bug, so put inside
14420 the #if 0 of that comment.
14421 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
14422 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
14425 * search.c (boyer_moore): Rename locals to avoid shadowing.
14426 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
14427 (PREV_CHAR_BOUNDARY): Likewise.
14429 * search.c (simple_search): Remove unused var.
14431 * dired.c (compile_pattern): Move decl from here ...
14432 * lisp.h: ... to here, so that it can be checked.
14433 (struct re_registers): New forward decl.
14435 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
14437 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
14439 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
14440 Rename locals to avoid shadowing.
14441 (Fvertical_motion): Mark locals as initialized.
14443 * casefiddle.c (casify_object, casify_region): Now static.
14444 (casify_region): Mark local as initialized.
14446 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
14448 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
14449 New macros, so that the caller can use some names other than
14450 gcpro1, gcpro2, etc.
14451 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
14453 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
14454 argument, for consistency with GCPRO2_VAR, etc: it is now the
14455 prefix of the variable, not the variable itself. All uses
14457 * dired.c (directory_files_internal, file_name_completion):
14458 Rename locals to avoid shadowing.
14460 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
14461 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
14462 dired.c's scmp function, had undefined behavior.
14463 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
14464 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
14465 * buffer.h: ... to here, because these macros use current_buffer,
14466 and the new implementation with inline functions needs to have
14467 current_buffer in scope now, rather than later when the macros
14469 (downcase, upcase1): New static inline functions.
14470 (DOWNCASE, UPCASE1): Reimplement using these functions.
14471 This avoids undefined behavior in expressions like
14472 DOWNCASE (x) == DOWNCASE (y), which previously suffered
14473 from race conditions in accessing the global variables
14474 case_temp1 and case_temp2.
14475 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
14476 * lisp.h (case_temp1, case_temp2): Remove their decls.
14477 * character.h (ASCII_CHAR_P): Move from here ...
14478 * lisp.h: ... to here, so that the inline functions mentioned
14479 above can use them.
14481 * dired.c (directory_files_internal_unwind): Now static.
14483 * fileio.c (file_name_as_directory, directory_file_name):
14484 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
14486 (file_name_as_directory): Use const pointers when appropriate.
14487 (Fexpand_file_name): Likewise. In particular, newdir might
14488 point at constant storage, so make it a const pointer.
14489 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
14490 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
14492 (Fset_file_times, Finsert_file_contents, auto_save_error):
14493 Rename locals to avoid shadowing.
14495 * minibuf.c (choose_minibuf_frame_1): Now static.
14496 (Ftry_completion, Fall_completions): Rename or remove locals
14497 to avoid shadowing.
14499 * marker.c (bytepos_to_charpos): Remove; unused.
14501 * lisp.h (verify_bytepos, count_markers): New decls,
14502 so that gcc does not warn that these functions aren't declared.
14504 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
14505 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
14506 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
14507 (copy_text): Remove unused local var.
14509 * filelock.c (within_one_second): Now static.
14510 (lock_file_1): Rename local to avoid shadowing.
14512 * buffer.c (fix_overlays_before): Mark locals as initialized.
14513 (fix_start_end_in_overlays): Likewise. This function should be
14514 simplified by using pointers-to-pointers, but that's a different
14516 (switch_to_buffer_1): Now static.
14517 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
14518 (report_overlay_modification): Rename locals to avoid shadowing.
14520 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
14521 Fix pointer signedness issue.
14522 (sys_subshell): Mark local as volatile if checking for lint,
14523 to suppress a gcc -Wclobbered warning that does not seem to be right.
14524 (MAXPATHLEN): Define only if needed.
14526 * process.c (serial_open, serial_configure): Move decls from here ...
14527 * systty.h: ... to here, so that they can be checked.
14529 * fns.c (get_random, seed_random): Move extern decls from here ...
14530 * lisp.h: ... to here, so that they can be checked.
14532 * sysdep.c (reset_io): Now static.
14533 (wait_for_termination_signal): Remove; unused.
14535 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
14536 (copy_keymap_item, append_key, push_text_char_description):
14538 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
14539 (DENSE_TABLE_SIZE): Remove; unused.
14540 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
14541 (describe_map_tree):
14542 Rename locals to avoid shadowing.
14544 * keyboard.c: Declare functions static if they are not used elsewhere.
14545 (echo_char, echo_dash, cmd_error, top_level_2):
14546 (poll_for_input, handle_async_input): Now static.
14547 (read_char, kbd_buffer_get_event, make_lispy_position):
14548 (make_lispy_event, make_lispy_movement, apply_modifiers):
14549 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
14550 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
14551 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
14552 (read_key_sequence, read_char): Mark locals as initialized.
14553 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
14555 * keyboard.h (make_ctrl_char): New decl.
14556 (mark_kboards): Move decl here ...
14557 * alloc.c (mark_kboards): ... from here.
14559 * lisp.h (force_auto_save_soon): New decl.
14561 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
14562 (DEFINE_DUMMY_FUNCTION): New macro.
14563 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
14565 (main): Add casts to avoid warnings
14566 if GCC considers string literals to be constants.
14568 * lisp.h (fatal_error_signal): Add decl, since it's exported.
14570 * dbusbind.c: Pointer signedness fixes.
14571 (xd_signature, xd_append_arg, xd_initialize):
14572 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14573 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14574 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
14575 (Fdbus_register_signal): Use SSDATA when the context wants char *.
14577 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
14578 if GCC considers string literals to be constants.
14579 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
14581 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
14583 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
14584 (print_preprocess, print_object): New macro to fix last change.
14586 * print.c (print_preprocess): Don't forget font objects.
14588 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
14590 * emacs.c (USAGE3): Doc fixes.
14592 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
14594 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
14597 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
14599 * lisp.h (VWindow_system, Qfile_name_history):
14600 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
14601 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
14602 (w32_system_caret_x, w32_system_caret_y): Declare extern.
14604 * w32select.c: Don't #include "keyboard.h".
14605 (run_protected): Add extern declaration for waiting_for_input.
14607 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
14608 * w32console.c (detect_input_pending, read_input_pending)
14609 (encode_terminal_code):
14610 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
14611 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
14612 (w32_system_caret_y, Qfile_name_history):
14613 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
14614 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
14615 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
14616 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
14617 * w32proc.c (Qlocal, report_file_error):
14618 * w32term.c (Vwindow_system, updating_frame):
14619 * w32uniscribe.c (initialized, uniscribe_font_driver):
14620 Remove unneeded extern declarations.
14622 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
14624 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
14626 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
14628 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
14629 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
14630 These macros can no longer be used for assignment.
14632 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
14633 Assign struct members directly, instead of using BUF_BEGV etc.
14634 (record_buffer_markers, fetch_buffer_markers): New functions for
14635 recording and fetching special buffer markers.
14636 (set_buffer_internal_1, set_buffer_temp): Use them.
14638 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
14640 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
14642 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
14643 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
14645 * xdisp.c (hscroll_window_tree):
14646 (reconsider_clip_changes): Use PT instead of BUF_PT.
14648 2011-03-13 Eli Zaretskii <eliz@gnu.org>
14650 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
14651 $(EMACS_ROOT)/lib/intprops.h.
14653 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
14655 Fix more problems found by GCC 4.5.2's static checks.
14657 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
14658 to unsigned char * to avoid compiler diagnostic.
14659 (xg_free_frame_widgets): Make it clear that a local variable is
14660 needed only if USE_GTK_TOOLTIP.
14661 (gdk_window_get_screen): Make it clear that this macro is needed
14662 only if USE_GTK_TOOLTIP.
14663 (int_gtk_range_get_value): New function, which avoids a diagnostic
14664 from gcc -Wbad-function-cast.
14665 (xg_set_toolkit_scroll_bar_thumb): Use it.
14666 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
14667 diagnostic from gcc -Wbad-function-cast.
14668 (get_utf8_string, xg_get_file_with_chooser):
14669 Rename locals to avoid shadowing.
14670 (create_dialog): Move locals to avoid shadowing.
14672 * xgselect.c (xg_select): Remove unused var.
14674 * image.c (four_corners_best): Mark locals as initialized.
14675 (gif_load): Initialize transparent_p to zero (Bug#8238).
14676 Mark another local as initialized.
14677 (my_png_error, my_error_exit): Mark with NO_RETURN.
14679 * image.c (clear_image_cache): Now static.
14680 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
14681 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
14682 (x_edge_detection): Remove unnecessary cast that
14683 gcc -Wbad-function-cast diagnoses.
14684 (gif_load): Fix pointer signedness.
14685 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
14686 (jpeg_load, gif_load): Rename locals to avoid shadowing.
14688 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
14690 Improve quality of tests for time stamp overflow.
14691 For example, without this patch (encode-time 0 0 0 1 1
14692 1152921504606846976) returns the obviously-bogus value (-948597
14693 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
14694 reports time overflow. See
14695 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
14696 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
14697 * editfns.c: Include limits.h and intprops.h.
14698 (TIME_T_MIN, TIME_T_MAX): New macros.
14699 (time_overflow): Move earlier, to before first use.
14700 (hi_time, lo_time): New functions, for an accurate test for
14701 out-of-range times.
14702 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
14703 (Fget_internal_run_time): Don't assume time_t fits in int.
14704 (make_time): Use list2 instead of Fcons twice.
14705 (Fdecode_time): More accurate test for out-of-range times.
14706 (check_tm_member): New function.
14707 (Fencode_time): Use it, to test for out-of-range times.
14708 (lisp_time_argument): Don't rely on undefined left-shift and
14709 right-shift behavior when checking for time stamp overflow.
14711 * editfns.c (time_overflow): New function, refactoring common code.
14712 (Fformat_time_string, Fdecode_time, Fencode_time):
14713 (Fcurrent_time_string): Use it.
14715 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
14716 * dired.c (make_time): Move to ...
14717 * editfns.c (make_time): ... here.
14718 * systime.h: Note the move.
14720 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14722 * fringe.c (update_window_fringes): Remove unused variables.
14724 * unexmacosx.c (copy_data_segment): Also copy __got section.
14727 2011-03-12 Eli Zaretskii <eliz@gnu.org>
14729 * termcap.c [MSDOS]: Include "msdos.h".
14730 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
14731 Constify `char *' arguments and their references according to
14732 prototypes in tparam.h.
14734 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
14736 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
14737 Adapt all references accordingly.
14739 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
14741 2011-03-11 Tom Tromey <tromey@redhat.com>
14743 * buffer.c (syms_of_buffer): Remove obsolete comment.
14745 2011-03-11 Eli Zaretskii <eliz@gnu.org>
14747 * termhooks.h (encode_terminal_code): Declare prototype.
14749 * msdos.c (encode_terminal_code): Don't declare prototype.
14751 * term.c (encode_terminal_code): Now external again, used by
14752 w32console.c and msdos.c.
14754 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
14755 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
14757 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
14759 Fix some minor problems found by GCC 4.5.2's static checks.
14761 * fringe.c (update_window_fringes): Mark locals as initialized
14763 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
14765 * alloc.c (mark_fringe_data): Move decl from here ...
14766 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
14767 to check its interface.
14768 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
14770 * fontset.c (free_realized_fontset): Now static.
14771 (Fset_fontset_font): Rename local to avoid shadowing.
14772 (fontset_font): Mark local as initialized.
14773 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
14775 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
14777 * xselect.c (x_disown_buffer_selections): Remove; not used.
14778 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
14779 (x_own_selection, Fx_disown_selection_internal): Rename locals
14780 to avoid shadowing.
14781 (x_handle_dnd_message): Remove local to avoid shadowing.
14783 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
14784 so that the caller can use some name other than gcpro1.
14785 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
14786 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
14787 (Fx_backspace_delete_keys_p):
14788 Use them to avoid shadowing, and rename vars to avoid shadowing.
14789 (x_decode_color, x_set_name, x_window): Now static.
14790 (Fx_create_frame): Add braces to silence GCC warning.
14791 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
14792 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
14793 Remove unused locals.
14794 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
14795 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
14796 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
14799 * xterm.h (x_mouse_leave): New decl.
14801 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
14802 Remove unused functions.
14803 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
14804 (x_calc_absolute_position): Now static.
14805 (XTread_socket): Don't define label "out" unless it's used.
14806 Don't declare local "event" unless it's used.
14807 (x_iconify_frame, x_free_frame_resources): Don't declare locals
14808 unless they are used.
14809 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
14810 (x_fatal_error_signal): Remove; not used.
14811 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
14812 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
14813 (x_error_catcher, x_connection_closed, x_error_handler):
14814 (x_error_quitter, xembed_send_message, x_iconify_frame):
14815 (my_log_handler): Rename locals to avoid shadowing.
14816 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
14817 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
14819 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
14820 Rename or move locals to avoid shadowing.
14821 (tty_defined_color, merge_face_heights): Now static.
14822 (free_realized_faces_for_fontset): Remove; not used.
14823 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
14824 does not deduce is never used uninitialized.
14825 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
14826 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
14828 * terminal.c (store_terminal_param): Now static.
14830 * xmenu.c (menu_highlight_callback): Now static.
14831 (set_frame_menubar): Remove unused local.
14832 (xmenu_show): Rename parameter to avoid shadowing.
14833 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
14834 since they might point to immutable storage.
14835 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
14836 since it's unused otherwise.
14838 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
14839 Add a FIXME, since the code still doesn't look right. (Bug#8215)
14840 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
14841 avoids a gcc -Wuninitialized diagnostic.
14842 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
14843 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
14844 does not deduce are never used uninitialized.
14846 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
14848 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
14849 * window.c (window_loop, size_window):
14850 (run_window_configuration_change_hook, enlarge_window): Likewise.
14852 * window.c (display_buffer): Now static.
14853 (size_window): Mark variables that gcc -Wuninitialized
14854 does not deduce are never used uninitialized.
14855 * window.h (check_all_windows): New decl, to forestall
14856 gcc -Wmissing-prototypes diagnostic.
14857 * dispextern.h (bidi_dump_cached_states): Likewise.
14859 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
14861 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
14862 Include <limits.h>.
14863 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
14864 and to avoid gcc -Wuninitialized warning.
14865 (load_charset_map): Mark variables that gcc -Wuninitialized
14866 does not deduce are never used uninitialized.
14867 (load_charset): Abort instead of using uninitialized var (Bug#8229).
14869 * coding.c (coding_set_source, coding_set_destination):
14870 Use "else { /* comment */ }" rather than "else /* comment */;"
14871 for clarity, and to avoid gcc -Wempty-body warning.
14872 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
14873 a block, when the outer 'i' will do.
14874 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
14875 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
14876 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
14877 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
14878 (Fdecode_sjis_char, Fdefine_coding_system_internal):
14879 Rename locals to avoid shadowing.
14880 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
14881 * coding.c (emacs_mule_char, encode_invocation_designation):
14882 Now static, since they're not used elsewhere.
14883 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
14884 (decode_coding_object, encode_coding_object, detect_coding_system):
14885 (decode_coding_emacs_mule): Mark variables that gcc
14886 -Wuninitialized does not deduce are never used uninitialized.
14887 (detect_coding_iso_2022): Initialize a local variable that might
14888 be used uninitialized. Leave a FIXME because it's not clear that
14889 this initialization is needed. (Bug#8211)
14890 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
14891 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
14892 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
14893 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
14894 Remove unused macros.
14896 * category.c (hash_get_category_set): Remove unused local var.
14897 (copy_category_table): Now static, since it's not used elsewhere.
14898 * character.c (string_count_byte8): Likewise.
14900 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
14901 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
14903 * chartab.c (copy_sub_char_table): Now static, since it's not used
14905 (sub_char_table_ref_and_range, char_table_ref_and_range):
14906 Rename locals to avoid shadowing.
14907 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
14909 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
14910 (BIDI_BOB): Remove unused macro.
14912 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
14913 deduce are never used uninitialized.
14914 * term.c (encode_terminal_code): Likewise.
14916 * term.c (encode_terminal_code): Now static. Remove unused local.
14918 * tparam.h: New file.
14919 * term.c, tparam.h: Include it.
14920 * deps.mk (term.o, tparam.o): Depend on tparam.h.
14921 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
14922 Move these decls to tparam.h, and make them agree with what
14923 is actually in tparam.c. The previous trick of using incompatible
14924 decls in different modules does not conform to the C standard.
14925 All callers of tparam changed to use tparam's actual API.
14926 * tparam.c (tparam1, tparam, tgoto):
14927 Use const pointers where appropriate.
14929 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
14930 * cm.h (struct cm): Likewise.
14931 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
14932 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
14933 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
14934 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
14935 (turn_on_face, init_tty): Likewise.
14936 * termchar.h (struct tty_display_info): Likewise.
14938 * term.c (term_mouse_position): Rename local to avoid shadowing.
14940 * alloc.c (mark_ttys): Move decl from here ...
14941 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
14943 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
14945 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
14947 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
14949 * search.c (compile_pattern_1): Remove argument regp, unused since
14950 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
14951 (compile_pattern): Don't pass it.
14953 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
14955 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
14956 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
14958 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
14960 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
14962 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
14963 gdk_window_get_screen, gdk_window_get_geometry,
14964 gdk_x11_window_lookup_for_display and GDK_KEY_g.
14965 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
14966 (xg_get_pixbuf_from_pixmap): New function.
14967 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
14968 to Pixmap, take frame as parameter, remove GdkColormap parameter.
14969 Call xg_get_pixbuf_from_pixmap instead of
14970 gdk_pixbuf_get_from_drawable.
14971 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
14972 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
14973 (xg_check_special_colors): Use GtkStyleContext and its functions
14975 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
14976 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
14977 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
14978 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
14979 Call gtk_widget_get_preferred_size.
14980 (xg_frame_resized): gdk_window_get_geometry only takes 5
14982 (xg_win_to_widget, xg_event_is_for_menubar):
14983 Call gdk_x11_window_lookup_for_display.
14984 (xg_set_widget_bg): New function.
14985 (delete_cb): New function.
14986 (xg_create_frame_widgets): Connect delete-event to delete_cb.
14987 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
14988 (xg_set_background_color): Call xg_set_widget_bg.
14989 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
14990 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
14991 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
14992 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
14994 (update_frame_tool_bar): Call gtk_widget_hide.
14995 (xg_initialize): Use GDK_KEY_g.
14997 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
14999 (x_session_initialize): Call gdk_x11_set_sm_client_id.
15001 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
15002 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
15003 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
15005 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
15007 * w32xfns.c (select_palette): Check success of RealizePalette against
15008 GDI_ERROR, not zero.
15010 See ChangeLog.11 for earlier changes.
15012 ;; Local Variables:
15016 Copyright (C) 2011-2012 Free Software Foundation, Inc.
15018 This file is part of GNU Emacs.
15020 GNU Emacs is free software: you can redistribute it and/or modify
15021 it under the terms of the GNU General Public License as published by
15022 the Free Software Foundation, either version 3 of the License, or
15023 (at your option) any later version.
15025 GNU Emacs is distributed in the hope that it will be useful,
15026 but WITHOUT ANY WARRANTY; without even the implied warranty of
15027 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15028 GNU General Public License for more details.
15030 You should have received a copy of the GNU General Public License
15031 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.