Merge from emacs-24; up to 2012-11-23T06:23:28Z!cyd@gnu.org
[emacs.git] / src / ChangeLog
blob0808dad2c936ece8f731f4e29c386c2ce779a911
1 2012-12-03  Chong Yidong  <cyd@gnu.org>
3         * fileio.c (Vauto_save_list_file_name): Doc fix.
5 2012-12-03  Fabrice Popineau  <fabrice.popineau@gmail.com>
7         * w32fns.c: Remove prototype of atof.
8         (syspage_mask): Declared DWORD_PTR, for compatibility with 64-bit
9         builds.
10         (file_dialog_callback): Declared UINT_PTR.
12         * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
13         with 64-bit builds.
15         * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
16         (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
17         defined.
19 2012-12-03  Glenn Morris  <rgm@gnu.org>
21         * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
23 2012-12-02  Paul Eggert  <eggert@cs.ucla.edu>
25         Fix xpalloc confusion after memory is exhausted.
26         * alloc.c (xpalloc): Comment fix.
27         * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
28         and signals an error, do not clear charset_table_size, as
29         charset_table is still valid.
30         * doprnt.c (evxprintf): Clear *BUF after freeing it.
32         Use execve to avoid need to munge environ (Bug#13054).
33         * callproc.c (Fcall_process):
34         * process.c (create_process):
35         Don't save and restore environ; no longer needed.
36         * callproc.c (child_setup):
37         Use execve, not execvp, to preserve environ.
39 2012-12-01  Paul Eggert  <eggert@cs.ucla.edu>
41         * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
43 2012-12-01  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
45         * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
46         display for sliced images (Bug#10500).
48         * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
50 2012-11-30  Juanma Barranquero  <lekktu@gmail.com>
52         * doc.c (Fdocumentation): Re-add handling of function-documentation,
53         accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
55 2012-11-29  Dmitry Antipov  <dmantipov@yandex.ru>
57         * xdisp.c (window_outdated): Remove eassert since it hits
58         some suspicious corner cases (see Bug#13007 and Bug#13012).
59         (mode_line_update_needed): New function.
60         (redisplay_internal, redisplay_window): Use it.
61         (ensure_selected_frame): New function.
62         (redisplay_internal, unwind_redisplay): Use it.
63         (redisplay_internal): Move comment about buffer_shared...
64         (buffer_shared_and_changed): ...near to its real use.
66 2012-11-29  Paul Eggert  <eggert@cs.ucla.edu>
68         * callproc.c (Fcall_process): Don't misreport vfork failure.
70 2012-11-28  Paul Eggert  <eggert@cs.ucla.edu>
72         * callproc.c (Fcall_process): Fix vfork portability problems.
73         Do not assume that fd[0], count, filefd, and save_environ survive
74         vfork.  Fix bug whereby wrong errno value could be reported for
75         pipe failure.  Some minor cleanups, too, as follows.  Move buf and
76         bufsize to the context where they're needed.  Change new_argv to
77         be of type char **, as this is more convenient and avoids casts.
78         (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
79         Now local constants, not macros.
81 2012-11-18  Kenichi Handa  <handa@gnu.org>
83         * font.c (font_unparse_xlfd): Fix previous change.  Keep "const"
84         for the variable "f".
86 2012-11-13  Kenichi Handa  <handa@gnu.org>
88         * font.c (font_unparse_xlfd): Exclude special characters from the
89         generating XLFD name.
91 2012-11-27  Paul Eggert  <eggert@cs.ucla.edu>
93         Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
94         * dired.c (stat_uname, stat_gname):
95         * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
97         Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
98         * dired.c (directory_files_internal, file_name_completion):
99         Assume EAGAIN and EINTR are defined.
101         * fileio.c (Fcopy_file): Assume EISDIR is defined.
102         * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
103         * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
104         * lread.c (readbyte_from_file): Assume EINTR is defined.
105         * process.c (wait_reading_process_output, send_process) [subprocesses]:
106         Assume EIO and EAGAIN are defined.
107         * unexcoff.c (write_segment): Assume EFAULT is defined.
109 2012-11-27  Eli Zaretskii  <eliz@gnu.org>
111         * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
112         (Bug#11964)
114         * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
115         highlighting on the frame was cleared.  Prevents assertion
116         violations when repeatedly clicking on the "Top" link of the
117         "bread-crumbs" in Info buffers.
119 2012-11-25  Paul Eggert  <eggert@cs.ucla.edu>
121         * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
123 2012-11-24  Ken Brown  <kbrown@cornell.edu>
125         * keyboard.c (HAVE_MOUSE):
126         * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
127         were always defined.
129 2012-11-24  Eli Zaretskii  <eliz@gnu.org>
131         * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
132         between bpos_covered and bpos_max.  This fixes cursor display when
133         several display strings follow each other.
135         * .gdbinit (pgx): If the glyph's object is a string, display the
136         pointer to string data, rather than the value of the string object
137         itself (which barfs under CHECK_LISP_OBJECT_TYPE).
139         * indent.c (Fvertical_motion): If the starting position is covered
140         by a display string, return to one position before that, to avoid
141         overshooting it inside move_it_to.  (Bug#12930)
143 2012-11-23  Dmitry Antipov  <dmantipov@yandex.ru>
145         * frame.h (struct frame): Remove display_preempted member
146         since all users are dead long ago.
147         * nsterm.h (struct x_output): Use the only dummy member.
148         * w32menu.c (pending_menu_activation): Remove since not
149         really used.
150         (set_frame_menubar): Adjust user.
151         * w32term.h (struct x_output): Drop outdated #if 0 code.
152         (struct w32_output): Use bitfields for explicit_parent,
153         asked_for_visible and menubar_active members.  Drop
154         unused pending_menu_activation member.
155         * xterm.h (struct x_output): Drop outdated #if 0 code.
156         Use bitfields for explicit_parent, asked_for_visible,
157         has_been_visible and net_wm_state_hidden_seen members.
159 2012-11-23  Eli Zaretskii  <eliz@gnu.org>
161         * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
162         of a literal "/".  (Bug#12955)
163         (gl-stamp): Invoke fc.exe directly, not through cmd.
165 2012-11-23  Paul Eggert  <eggert@cs.ucla.edu>
167         Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
168         * dired.c: Assume HAVE_DIRENT_H.
169         (NAMLEN): Remove, replacing with ...
170         (dirent_namelen): New function.  All uses changed.  Use the GNU macro
171         _D_EXACT_NAMELEN if available, as it's faster than strlen.
172         (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
173         (DIRENTRY_NONEMPTY): Remove.  All callers now assume it's nonzero.
174         * makefile.w32-in (DIR_H): Remove.  All uses replaced with
175         $(NT_INC)/dirent.h.
176         ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
177         * ndir.h: Rename to ../nt/inc/dirent.h.
178         * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
179         Do not include <dirent.h>; no longer needed.
180         * w32.c: Include <dirent.h> rather than "ndir.h".
182 2012-11-23  Chong Yidong  <cyd@gnu.org>
184         * xftfont.c (xftfont_open): Remove duplicate assignment.
186 2012-11-22  Dmitry Antipov  <dmantipov@yandex.ru>
188         * alloc.c (Fgarbage_collect): Unblock input after clearing
189         gc_in_progress to avoid note_mouse_highlight glitch with GC.
190         * frame.h (FRAME_MOUSE_UPDATE): New macro.
191         * msdos.c (IT_frame_up_to_date): Use it here...
192         * w32term.c (w32_frame_up_to_date): ...here...
193         * xterm.c (XTframe_up_to_date): ...and here...
194         * nsterm.m (ns_frame_up_to_date): ...but not here.
195         * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
196         Adjust users.
197         * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
198         Do not check whether GC is in progress.
200 2012-11-22  Dmitry Antipov  <dmantipov@yandex.ru>
202         * xdisp.c (window_buffer_changed): New function.
203         (update_menu_bar, update_tool_bar): Use it to
204         simplify large 'if' statements.
205         (redisplay_internal): Generalize commonly used
206         'tail' and 'frame' local variables.
208 2012-11-22  Eli Zaretskii  <eliz@gnu.org>
210         * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
211         with Windows system header.
213 2012-11-21  Paul Eggert  <eggert@cs.ucla.edu>
215         Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
216         * alloc.c: Assume unistd.h exists.
217         * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
218         * sysdep.c (get_current_dir_name): Assume getcwd exists.
219         (getwd) [USG]: Remove; no longer needed.
220         (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
221         * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
222         * w32.h (getcwd): Remove decl.
224 2012-11-21  Stefan Monnier  <monnier@iro.umontreal.ca>
226         * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
227         Make it set selected_window as well.
228         (update_tool_bar): Use it.
230 2012-11-21  Ken Brown  <kbrown@cornell.edu>
232         * emacs.c (main): Set the G_SLICE environment variable for all
233         Cygwin builds, not just GTK builds.  See
234         https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
236 2012-11-21  Eli Zaretskii  <eliz@gnu.org>
238         * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
239         (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
240         Define for the MSVC compiler.
242         * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
244         * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
245         (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
246         dostounix_filename.  Prevents crashes down the road, because
247         dostounix_filename assumes it gets a unibyte string.  Reported by
248         Michel de Ruiter <michel@sentient.nl>, see
249         http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
251 2012-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>
253         Conflate Qnil and Qunbound for `symbol-function'.
254         * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
255         * lread.c (init_obarray): Set `function' fields to Qnil.
256         * eval.c (Fcommandp): Ignore Qunbound.
257         (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
258         * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
259         Test NILP rather than Qunbound.
260         (Ffmakunbound): Set to Qnil.
261         (Fsymbol_function): Never signal an error.
262         (Finteractive_form): Ignore Qunbound.
264 2012-11-20  Paul Eggert  <eggert@cs.ucla.edu>
266         * eval.c (interactive_p): Remove no-longer-used decl.
268 2012-11-20  Dmitry Antipov  <dmantipov@yandex.ru>
270         * xdisp.c (buffer_shared): Adjust comment.
271         (buffer_shared_and_changed): New function.
272         (prepare_menu_bars, redisplay_internal): Use it to
273         decide whether all windows or frames should be updated.
274         (window_outdated): New function.
275         (text_outside_line_unchanged_p, redisplay_window): Use it.
276         (redisplay_internal): Likewise.  Fix indentation.
278 2012-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>
280         * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
281         (syms_of_eval): Remove corresponding defsubr.
282         * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
284 2012-11-19  Daniel Colascione  <dancol@dancol.org>
286         * w32fns.c (Fx_file_dialog):
287         (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
288         cygwin_convert_file_name*.
290         * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
291         Rename cygwin_convert_path* to cygwin_convert_file_name*.
293 2012-11-18  Paul Eggert  <eggert@cs.ucla.edu>
295         * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
297 2012-11-18  Eli Zaretskii  <eliz@gnu.org>
299         * w32select.c: Include w32common.h before w32term.h, so that
300         windows.h gets included before w32term.h uses some of its
301         features, see below.
303         * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
304         New typedefs.
305         (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
306         New prototypes.
307         (EnumSystemLocales) [_MSC_VER]: Define if undefined.  (Bug#12878)
309 2012-11-18  Jan Djärv  <jan.h.d@swipnet.se>
311         * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
312         (ns_select): Return at once if events are held (Bug#12834).
314 2012-11-18  enami tsugutomo  <tsugutomo.enami@jp.sony.com>
316         * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
317         Needed following 2012-10-20 change.  (Bug#12902)
319 2012-11-18  Juanma Barranquero  <lekktu@gmail.com>
321         * w32proc.c (waitpid): Remove unused label get_result.
323 2012-11-17  Juanma Barranquero  <lekktu@gmail.com>
325         * makefile.w32-in (SYSWAIT_H): New macro.
326         ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
327         ($(BLD)/sysdep.$(O)): Update dependencies.
329 2012-11-17  Paul Eggert  <eggert@cs.ucla.edu>
331         Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
332         * callproc.c (relocate_fd): Assume F_DUPFD.
333         * emacs.c, term.c (O_RDWR): Remove.
334         * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
335         O_NDELAY, since O_NONBLOCK is the standard name for this flag.
336         * nsterm.m: Assume <fcntl.h> exists.
337         * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
338         (create_pty, Fmake_network_process, server_accept_connection)
339         (wait_reading_process_output, init_process_emacs):
340         Assume O_NONBLOCK.
341         (wait_reading_process_output): Put in a special case for WINDOWSNT
342         to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
343         It's not clear this is needed, but it's a more-conservative change.
344         (create_process): Assume FD_CLOEXEC.
345         (create_process, create_pty): Assume O_NOCTTY.
346         * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
347         (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
348         Omit if not DOS_NT, since F_GETFL is not defined there.
349         (serial_open): Assume O_NONBLOCK and O_NOCTTY.
350         * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
351         (O_NOCTTY): Remove.
352         (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
353         lack it, since gnulib guarantees this.
354         * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
356 2012-11-17  Eli Zaretskii  <eliz@gnu.org>
358         * w32.c (faccessat): Pretend that directories have the execute bit
359         set.  Emacs expects that, e.g., in files.el:cd-absolute.
361         * w32proc.c (create_child): Don't clip the PID of the child
362         process to fit into an Emacs integer, as this is no longer a
363         restriction.
364         (waitpid): Rename from sys_wait.  Emulate a Posix 'waitpid' by
365         reaping only the process specified by PID argument, if that is
366         positive.  Use PID instead of dead_child to know which process to
367         reap.  Wait for the child to die only if WNOHANG is not in
368         OPTIONS.
369         (sys_select): Don't set dead_child.
371         * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
372         as it is no longer needed.
374         * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
375         no longer needed.
376         (record_child_status_change): Remove the setting of
377         record_at_most_one_child for the !WNOHANG case.
379 2012-11-17  Paul Eggert  <eggert@cs.ucla.edu>
381         Fix problems in ns port found by static checking.
382         * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
383         (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
384         not to process group.
385         (ns_select): Use emacs_write, not write, as that's more robust
386         in the presence of signals.
387         (fd_handler:): Check for read errors.
389 2012-11-16  Glenn Morris  <rgm@gnu.org>
391         * editfns.c (Fmessage): Mention message-log-max.  (Bug#12849)
393 2012-11-16  Stefan Monnier  <monnier@iro.umontreal.ca>
395         * eval.c (Finteractive_p): Revert lexbind-merge mishap.
397 2012-11-16  Eli Zaretskii  <eliz@gnu.org>
399         * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
400         use the same value of thread handle.
401         (start_timer_thread): If the timer thread exited (due to error),
402         clean up by closing the two handles it used.  Duplicate the caller
403         thread's handle here, so it gets duplicated only once, when
404         launching the timer thread.  Set priority of the timer thread, not
405         the caller thread.
406         (getitimer): Don't duplicate the caller thread's handle here.
407         (Bug#12832)
409 2012-11-16  Jan Djärv  <jan.h.d@swipnet.se>
411         * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
412         called (Bug#12834).
414 2012-11-16  Paul Eggert  <eggert@cs.ucla.edu>
416         Remove no-longer-used pty_max_bytes variable.
417         * process.c (pty_max_bytes): Remove; unused.
418         (send_process): Do not set it.
420 2012-11-15  Juanma Barranquero  <lekktu@gmail.com>
422         * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
423         Update dependencies.
425 2012-11-15  Paul Eggert  <eggert@cs.ucla.edu>
427         * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
428         This follows up on the 2012-09-29 patch that removed indirection
429         for the 'function' field.  Reported by Sergey Vinokurov in
430         <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
432 2012-11-14  Eli Zaretskii  <eliz@gnu.org>
434         * w32.c (faccessat): Rename from sys_faccessat.  (No need to use a
435         different name, as the MS runtime does not have such a function,
436         and probably never will.)  All callers changed.  Ignore DIRFD
437         value if PATH is an absolute file name, to match Posix spec
438         better.  If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
439         symlinks.
441 2012-11-14  Dmitry Antipov  <dmantipov@yandex.ru>
443         * xdisp.c (echo_area_display, redisplay_internal):
444         Omit redundant check whether frame_garbaged is set.
446 2012-11-14  Paul Eggert  <eggert@cs.ucla.edu>
448         Use faccessat, not access, when checking file permissions (Bug#12632).
449         This fixes a bug that has been present in Emacs since its creation.
450         It was reported by Chris Torek in 1983 even before GNU Emacs existed,
451         which must set some sort of record.  (Torek's bug report was against
452         a predecessor of GNU Emacs, but GNU Emacs happened to have the
453         same common flaw.)  See Torek's Usenet posting
454         "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
455         Posted: Fri Apr  8 14:18:56 1983.
456         * Makefile.in (LIB_EACCESS): New macro.
457         (LIBES): Use it.
458         * callproc.c (init_callproc):
459         * charset.c (init_charset):
460         * fileio.c (check_existing, check_executable, check_writable)
461         (Ffile_readable_p):
462         * lread.c (openp, load_path_check):
463         * process.c (allocate_pty):
464         * xrdb.c (file_p):
465         Use effective UID when checking permissions, not real UID.
466         * callproc.c (init_callproc):
467         * charset.c (init_charset):
468         * lread.c (load_path_check, init_lread):
469         Test whether directories are accessible, not merely whether they exist.
470         * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
471         * fileio.c (check_existing, check_executable, check_writable)
472         (Ffile_readable_p):
473         Use symbolic names instead of integers for the flags, as they're
474         portable now.
475         (check_writable): New arg AMODE.  All uses changed.
476         Set errno on failure.
477         (Ffile_readable_p): Use faccessat, not stat + open + close.
478         (Ffile_writable_p): No need to call check_existing + check_writable.
479         Just call check_writable and then look at errno.  This saves a syscall.
480         dir should never be nil; replace an unnecessary runtime check
481         with an eassert.  When checking the parent directory of a nonexistent
482         file, check that the directory is searchable as well as writable, as
483         we can't create files in unsearchable directories.
484         (file_directory_p): New function, which uses 'stat' on most platforms
485         but faccessat with D_OK (for efficiency) if WINDOWSNT.
486         (Ffile_directory_p, Fset_file_times): Use it.
487         (file_accessible_directory_p): New function, which uses a single
488         syscall for efficiency.
489         (Ffile_accessible_directory_p): Use it.
490         * xrdb.c (file_p): Use file_directory_p.
491         * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
492         * lread.c (openp): When opening a file, use fstat rather than
493         stat, as that avoids a permissions race.  When not opening a file,
494         use file_directory_p rather than stat.
495         (dir_warning): First arg is now a usage string, not a format.
496         Use errno.  All uses changed.
497         * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
498         that merely introduced a race.
499         * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
500         changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
501         and similarly for the other O_* flags.
502         * w32.c (sys_faccessat): Rename from sys_access and switch to
503         faccessat's API.  All uses changed.
504         * xrdb.c: Do not include <sys/stat.h>; no longer needed.
505         (magic_db): Rename from magic_file_p.
506         (magic_db, search_magic_path): Return an XrmDatabase rather than a
507         char *, so that we don't have to test for file existence
508         separately from opening the file for reading.  This removes a race
509         fixes a permission-checking problem, and simplifies the code.
510         All uses changed.
511         (file_p): Remove; no longer needed.
513 2012-11-13  Dmitry Antipov  <dmantipov@yandex.ru>
515         Omit glyphs initialization at startup.
516         * dispnew.c (glyphs_initialized_initially_p): Remove.
517         (adjust_frame_glyphs_initially): Likewise.  Adjust users.
518         (Fredraw_frame): Move actual code from here...
519         (redraw_frame): ...to here.  Add eassert.  Adjust comment.
520         (Fredraw_display): Use redraw_frame.
521         * xdisp.c (clear_garbaged_frames): Likewise.
523 2012-11-13  Eli Zaretskii  <eliz@gnu.org>
525         * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
526         passed to pint2str and pint2hrstr to be at most the size of the
527         frame's decode_mode_spec_buffer.  This avoids crashes with very
528         large values of FIELD_WIDTH argument to decode_mode_spec.
529         (Bug#12867)
531 2012-11-13  Paul Eggert  <eggert@cs.ucla.edu>
533         Fix a race with verify-visited-file-modtime (Bug#12863).
534         Since at least 1991 Emacs has ignored an mtime difference of no
535         more than one second, but my guess is that this was to work around
536         file system bugs that were fixed long ago.  Since the race is
537         causing problems now, let's remove that code.
538         * fileio.c (Fverify_visited_file_modtime): Do not accept a file
539         whose time stamp is off by no more than a second.  Insist that the
540         file time stamps match exactly.
542 2012-11-12  Dmitry Antipov  <dmantipov@yandex.ru>
544         * frame.h (struct frame): Convert external_tool_bar member to
545         1-bit unsigned bitfield.
546         * termhooks.h (struct terminal): Remove mouse_moved member since
547         all users are long dead.  Adjust comment on mouse_position_hook.
549 2012-11-12  Dmitry Antipov  <dmantipov@yandex.ru>
551         Simplify by using FOR_EACH_FRAME here and there.
552         * frame.c (next_frame, prev_frame, other_visible_frames)
553         (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
554         * w32term.c (x_window_to_scroll_bar): Likewise.
555         * window.c (window_list): Likewise.
556         * xdisp.c (x_consider_frame_title): Likewise.
557         * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
558         * xfns.c (x_window_to_frame, x_any_window_to_frame)
559         (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
560         * xmenu.c (menubar_id_to_frame): Likewise.
561         * xselect.c (frame_for_x_selection): Likewise.
562         * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
563         (x_window_to_menu_bar): Likewise.
564         * w32fns.c (x_window_to_frame): Likewise.  Adjust comment.
566 2012-11-12  Paul Eggert  <eggert@cs.ucla.edu>
568         * data.c (Qdefalias_fset_function): Now static.
570         Another tweak to vectorlike_header change.
571         * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
572         Remove, and replace all uses with ...
573         (next_in_free_list, set_next_in_free_list):
574         New functions, which respect C's aliasing rules better.
576 2012-11-11  Paul Eggert  <eggert@cs.ucla.edu>
578         * window.c (list4i): Rename from 'quad'.  All uses changed.
579         Needed because <sys/types.h> defines 'quad' on Solaris 10.
581 2012-11-11  Juanma Barranquero  <lekktu@gmail.com>
583         * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
584         warning about mixing declarations and code in ISO C90.
586 2012-11-10  Martin Rudalics  <rudalics@gmx.at>
588         * window.c (Fsplit_window_internal): Set combination limit of
589         new parent window to t iff Vwindow_combination_limit is t;
590         fixing a regression introduced with the change from 2012-09-22.
591         (Fset_window_combination_limit): Fix doc-string.
593 2012-11-10  Eli Zaretskii  <eliz@gnu.org>
595         * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
596         amount when the scroll margins are too large.  When scrolling
597         backwards in the buffer, give up if cannot reach point or the
598         scroll margin within a reasonable number of screen lines.
599         Fixes point position in window under scroll-up/down-aggressively when
600         point is positioned many lines beyond the window top/bottom.
601         (Bug#12811)
603         * ralloc.c (relinquish): If real_morecore fails to return memory
604         to the system, don't crash; instead, leave the last heap
605         unchanged and return.  (Bug#12774)
607 2012-11-09  Stefan Monnier  <monnier@iro.umontreal.ca>
609         * lisp.h (AUTOLOADP): New macro.
610         * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
611         * data.c (Ffset): Remove special ad-advice-info handling.
612         (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
613         (Fsubr_arity): CSE.
614         (Finteractive_form): Simplify.
615         (Fquo): Don't insist on having at least 2 arguments.
616         (Qdefalias_fset_function): New var.
618 2012-11-09  Jan Djärv  <jan.h.d@swipnet.se>
620         * image.c (xpm_make_color_table_h): Change to hashtest_equal.
622         * nsfont.m (Qcondensed, Qexpanded): New variables.
623         (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
624         (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
626 2012-11-09  Dmitry Antipov  <dmantipov@yandex.ru>
628         Fix recently introduced crash on MS-Windows (Bug#12839).
629         * w32term.h (struct scroll_bar): Use convenient header.
630         (SCROLL_BAR_VEC_SIZE): Remove.
631         * w32term.c (x_scroll_bar_create): Use VECSIZE.
633 2012-11-09  Dmitry Antipov  <dmantipov@yandex.ru>
635         Tweak last vectorlike_header change.
636         * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
637         vectorlike object on the free list.  This is introduced to avoid
638         some (but not all) pointer casting and aliasing problems, see
639         http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
640         * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
641         objects.
642         (xvectype, xvecsize): Use them to examine Lisp_Object values.
644 2012-11-09  Jan Djärv  <jan.h.d@swipnet.se>
646         * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
647         been removed, so remove them here also.
649 2012-11-09  Stefan Monnier  <monnier@iro.umontreal.ca>
651         * doc.c (Fdocumentation): Handle new property
652         dynamic-docstring-function to replace the old ad-advice-info.
654 2012-11-09  Paul Eggert  <eggert@cs.ucla.edu>
656         * fns.c (Qeql, hashtest_eq): Now static.
658 2012-11-08  Stefan Monnier  <monnier@iro.umontreal.ca>
660         * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
661         * fns.c (hashfn_eq, hashfn_eql, sxhash):
662         * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
663         * buffer.c (compare_overlays): Use XLI rather than XHASH.
665 2012-11-08  Paul Eggert  <eggert@cs.ucla.edu>
667         Use same hash function for hashfn_profiler as for hash_string etc.
668         * fns.c (SXHASH_COMBINE): Remove.  All uses replaced by sxhash_combine.
669         * lisp.h (sxhash_combine): New inline function, with the contents
670         of the old SXHASH_COMBINE.
671         * profiler.c (hashfn_profiler): Use it, instead of having a
672         special hash function containing a comparison that always yields 1.
674 2012-11-08  Stefan Monnier  <monnier@iro.umontreal.ca>
676         * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
677         (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
678         (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
679         Remove unused vars.
681 2012-11-08  Jan Djärv  <jan.h.d@swipnet.se>
683         * image.c (xpm_make_color_table_h): Fix compiler error because
684         make_hash_table changed.
686 2012-11-08  Thomas Kappler <tkappler@gmail.com> (tiny change)
688         * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
690 2012-11-08  Stefan Monnier  <monnier@iro.umontreal.ca>
692         Use ad-hoc comparison function for the profiler's hash-tables.
693         * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
694         (make_log): Use them.
695         (handle_profiler_signal): Don't inhibit quit any longer since we don't
696         call Fequal any more.
697         (Ffunction_equal): New function.
698         (cmpfn_profiler, hashfn_profiler): New functions.
699         (syms_of_profiler): Initialize them.
700         * lisp.h (struct hash_table_test): New struct.
701         (struct Lisp_Hash_Table): Use it.
702         * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
703         * fns.c (make_hash_table): Take a struct to describe the test.
704         (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
705         (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
706         (hash_lookup, hash_remove_from_table): Move assertion checking of
707         hashfn result here.  Check hash-equality before calling cmpfn.
708         (Fmake_hash_table): Adjust call to make_hash_table.
709         (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
710         (syms_of_fns): Initialize them.
711         * emacs.c (main): Move syms_of_fns earlier.
712         * xterm.c (syms_of_xterm):
713         * category.c (hash_get_category_set): Adjust call to make_hash_table.
714         * print.c (print_object): Adjust to new hash-table struct.
715         * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
717 2012-11-08  Eli Zaretskii  <eliz@gnu.org>
719         * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
720         value of w32-scroll-lock-modifier is neither nil nor one of the
721         known key modifiers.  (Bug#12806)
723 2012-11-08  Dmitry Antipov  <dmantipov@yandex.ru>
725         Shrink struct vectorlike_header to the only size field.
726         * lisp.h (enum pvec_type): Avoid explicit enum member values.
727         Adjust comment.
728         (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
729         PVEC_TYPE_MASK to arrange new bitfield in the vector header.
730         (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
731         (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
732         information from the vector header.  Adjust comment.
733         (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
734         (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
735         layout.
736         (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
737         (struct vectorlike_header): Remove next member.  Adjust comment.
738         (struct Lisp_Subr): Add convenient header.  Adjust comment.
739         (allocate_pseudovector): Adjust prototype.
740         * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
741         (sweep_string, lisp_malloc): Remove useless prototypes.
742         (enum mem_type): Adjust comment.
743         (NEXT_IN_FREE_LIST): New macro.
744         (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
745         (Fmake_bool_vector): Likewise.
746         (struct large_vector): New type to represent allocation unit for
747         the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
748         (large_vectors): Change type to struct large_vector.
749         (allocate_vector_from_block): Simplify.
750         (PSEUDOVECTOR_NBYTES): Replace with...
751         (vector_nbytes): ...new function.  Adjust users.
752         (sweep_vectors): Adjust processing of large vectors.
753         (allocate_vectorlike): Likewise.
754         (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
755         Add easserts.  Adjust XSETPVECTYPESIZE usage.
756         (allocate_buffer): Use BUFFER_PVEC_INIT.
757         (live_vector_p): Adjust to match large vector.
758         * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
759         * buffer.h (struct buffer): Add next member.
760         (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
761         New macros.
762         (FOR_EACH_BUFFER): Adjust to match struct buffer change.
763         * fns.c (internal_equal): Adjust to match enum pvec_type change.
764         (copy_hash_table): Adjust to match vector header change.
765         * lread.c (defsubr): Use XSETPVECTYPE.
766         * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
767         (xvectype): Likewise.  Print PVEC_NORMAL_VECTOR for regular vectors.
768         (xvecsize): New command.
770 2012-11-08  Dmitry Antipov  <dmantipov@yandex.ru>
772         * keyboard.c (event_to_kboard): Do not dereference
773         frame_or_window field of SELECTION_REQUEST_EVENT
774         and SELECTION_CLEAR_EVENT events (Bug#12814).
775         * xterm.h (struct selection_input_event): Adjust comment.
777 2012-11-07  Eli Zaretskii  <eliz@gnu.org>
779         * w32fns.c (modifier_set): Don't report modifiers from toggle key,
780         such as Scroll Lock, if the respective keys are treated as
781         function keys, not as modifiers.  This avoids destroying non-ASCII
782         keyboard input when Scroll Lock is toggled ON.  (Bug#12806)
784 2012-11-07  Dmitry Antipov  <dmantipov@yandex.ru>
786         * xfns.c (Fx_wm_set_size_hint): Use check_x_frame.  Adjust docstring.
788 2012-11-06  Paul Eggert  <eggert@cs.ucla.edu>
790         Restore some duplicate definitions (Bug#12814).
791         This undoes part of the 2012-11-03 changes.  Some people build
792         with plain -g rather than with -g3, and they need the duplicate
793         definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
794         * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
795         Define as macros, as well as as enums or as constants.
797 2012-11-06  Jan Djärv  <jan.h.d@swipnet.se>
799         * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
800         to keypad keys (Bug#12816).
802 2012-11-06  Paul Eggert  <eggert@cs.ucla.edu>
804         Minor adjustments of recently-changed frame functions.
805         * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
806         known to be a frame (we're in the FRAMEP branch).
807         * lisp.h (Qframep): Remove decl.  frame.h declares this.
808         * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
809         since they're meant for Lisp fixnum values.
811 2012-11-06  Dmitry Antipov  <dmantipov@yandex.ru>
813         * window.c (Fwindow_combination_limit): Revert to the only
814         required argument and adjust docstring as suggested in
815         http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
816         by Martin Rudalics <rudalics@gmx.at>.
818 2012-11-06  Dmitry Antipov  <dmantipov@yandex.ru>
820         Widely used frame validity and checking functions.
821         * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
822         * frame.c (decode_live_frame, decode_any_frame): New functions.
823         (delete_frame, Fredirect_frame_focus, Fframe_parameters)
824         (Fframe_parameter, Fframe_char_height, Fframe_char_width)
825         (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
826         (Fframe_pointer_visible_p): Use decode_any_frame.
827         (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
828         (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
829         (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
830         (Fframe_focus): Likewise.  Allow zero number of arguments.
831         Adjust docstring.
832         (frame_buffer_list, frame_buffer_predicate): Remove.
833         * lisp.h (frame_buffer_predicate): Remove prototype.
834         * buffer.c (Fother_buffer): Use decode_any_frame.
835         * xdisp.c (Ftool_bar_lines_needed): Likewise.
836         * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
837         * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
838         (Fclose_font, Ffont_info): Use decode_live_frame.
839         * fontset.c (check_fontset_name): Likewise.
840         * terminal.c (Fframe_terminal): Likewise.
841         * w32fns.c (check_x_frame): Likewise.
842         * window.c (Fminibuffer_window, Fwindow_at)
843         (Fcurrent_window_configuration): Likewise.
844         (Frun_window_configuration_change_hook, Fwindow_resize_apply):
845         Likewise.  Allow zero number of arguments.  Adjust docstring.
846         * dispnew.c (Fredraw_frame): Likewise.
847         * xfaces.c (frame_or_selected_frame): Remove.
848         (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
849         (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
850         (Fframe_face_alist): Use decode_live_frame.
851         * xfns.c (check_x_frame): Likewise.
853 2012-11-06  Dmitry Antipov  <dmantipov@yandex.ru>
855         * window.c (quad): New function.
856         (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
857         (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
858         (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
859         (Fwindow_line_height): Use it.
860         (Fwindow_fringes): Use list3.
861         (Fwindow_scroll_bars): Use list4.
862         (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
863         (Fwindow_combination_limit): Allow zero number of arguments.
865 2012-11-05  Eli Zaretskii  <eliz@gnu.org>
867         * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
869         * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
870         (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
871         file descriptor 2 for standard error.  (Bug#12805)
873 2012-11-05  Chong Yidong  <cyd@gnu.org>
875         * process.c (wait_reading_process_output): Revert previous change.
877 2012-11-05  Paul Eggert  <eggert@cs.ucla.edu>
879         Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
880         This removes code that has been obsolete since around 1990.
881         * callproc.c (Fcall_process):
882         * emacs.c (main):
883         * process.c (create_process):
884         * term.c (dissociate_if_controlling_tty):
885         Assume setsid exists.
886         * callproc.c (child_setup): Assume setpgid exists and behaves as
887         per POSIX.1-1988 or later.
888         * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
889         * emacs.c (shut_down_emacs):
890         * sysdep.c (sys_suspend, init_foreground_group):
891         Assume getpgrp behaves as per POSIX.1-1998 or later.
892         * msdos.c (setpgrp): Remove.
893         (tcgetpgrp, setpgid, setsid): New functions.
894         * systty.h (EMACS_GETPGRP): Remove.  All callers now use getpgrp.
895         * term.c (no_controlling_tty): Remove; unused.
896         * w32proc.c (setpgrp): Remove.
897         (setsid, tcgetpgrp): New functions.
899         Simplify by assuming __fpending.
900         * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
901         (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
902         Do not assume that __fpending's result fits in int.
904 2012-11-04  Paul Eggert  <eggert@cs.ucla.edu>
906         Remove EMACS_OUTQSIZE+sleep hack.
907         * dispnew.c (update_frame_1): Remove hack for terminals slower
908         than 2400 bps, which throttled Emacs by having it sleep.
909         This code hasn't worked since at least 2007, when the multi-tty stuff
910         was added, and anyway those old terminals are long dead.
911         * systty.h (EMACS_OUTQSIZE): Remove; unused.  The macro isn't used even
912         without the dispnew.c change, as dispnew.c doesn't include systty.h.
914         Fix data-loss with --version (Bug#9574).
915         * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
916         as we can't assume that emacs_strerror is initialized, and strerror
917         is good enough here.
918         (main): Invoke atexit earlier, to catch earlier instances of
919         sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
921 2012-11-04  Michael Marchionna  <tralfaz@pacbell.net>
923         * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
924         (keyDown): Remap keypad keys to X11 virtual key codes.
926 2012-11-03  Paul Eggert  <eggert@cs.ucla.edu>
928         Fix data-loss with --batch (Bug#9574).
929         * emacs.c: Include <close-stream.h>.
930         (close_output_streams): New function.
931         (main): Pass it to atexit, so that Emacs closes stdout and stderr
932         and handles errors appropriately.
933         (Fkill_emacs): Don't worry about flushing, as close_output_stream
934         does that now.
936         Fix a race condition that causes Emacs to mess up glib (Bug#8855).
937         The symptom is a diagnostic "GLib-WARNING **: In call to
938         g_spawn_sync(), exit status of a child process was requested but
939         SIGCHLD action was set to SIG_IGN and ECHILD was received by
940         waitpid(), so exit status can't be returned."  The diagnostic
941         is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
942         The real bug is a race condition between Emacs and glib: Emacs
943         does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
944         so that glib can't find it.  Work around the bug by invoking
945         waitpid only on subprocesses that Emacs itself creates.
946         * process.c (create_process, record_child_status_change):
947         Don't use special value -1 in pid field, as the caller now must
948         know the pid rather than having the callee infer it.
949         The inference was sometimes incorrect anyway, due to another race.
950         (create_process): Set new 'alive' member if child is created.
951         (process_status_retrieved): New function.
952         (record_child_status_change): Use it.
953         Accept negative 1st argument, which means to wait for the
954         processes that Emacs already knows about.  Move special-case code
955         for DOS_NT (which lacks WNOHANG) here, from caller.  Keep track of
956         processes that have already been waited for, by testing and
957         clearing new 'alive' member.
958         (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
959         now does this internally.
960         (handle_child_signal): Let record_child_status_change do all
961         the work, since we do not want to reap all exited child processes,
962         only the child processes that Emacs itself created.
963         * process.h (Lisp_Process): New boolean member 'alive'.
965         Omit duplicate definitions no longer needed with gcc -g3.
966         * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
967         (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
968         Define only as macros.  There's no longer any need to also define
969         these symbols as enums or as constants, since we now assume
970         gcc -g3 when debugging.
972 2012-11-03  Eli Zaretskii  <eliz@gnu.org>
974         * lisp.mk: Adjust comments to the fact that term/internal is now
975         loaded from loadup.el.
977         * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
978         (msdos_fatal_signal): New function.
979         (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
980         its argument list.
982         * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
983         for GCC versions before 4.
984         (emacs_raise): Define to call msdos_fatal_signal.
986         * xdisp.c (init_from_display_pos): Fix initialization of the bidi
987         iterator when starting in the middle of a display or overlay
988         string.  (Bug#12745)
990 2012-11-03  Chong Yidong  <cyd@gnu.org>
992         * process.c (wait_reading_process_output): Clean up the last
993         change.
995 2012-11-03  Jim Paris  <jim@jtan.com>  (tiny change)
997         * process.c (wait_reading_process_output): Avoid a race condition
998         with SIGIO delivery (Bug#11536).
1000 2012-11-03  Chong Yidong  <cyd@gnu.org>
1002         * buffer.c (cursor_type): Untabify docstring.
1004 2012-11-03  Dmitry Antipov  <dmantipov@yandex.ru>
1006         * frame.h (struct frame): Drop can_have_scroll_bars member
1007         which is meaningless for a long time.  Adjust comments.
1008         (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
1009         * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
1011 2012-11-03  Dmitry Antipov  <dmantipov@yandex.ru>
1013         * window.c (decode_next_window_args): Update window arg after
1014         calling decode_live_window and so fix crash reported at
1015         http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
1016         by Juanma Barranquero <lekktu@gmail.com>.
1017         (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
1018         * font.c (Ffont_at): Likewise.
1020 2012-11-01  Jan Djärv  <jan.h.d@swipnet.se>
1022         * widget.c (resize_cb): New function.
1023         (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
1024         (EmacsFrameResize): Check if all is up to date before changing frame
1025         size.
1027 2012-11-02  Eli Zaretskii  <eliz@gnu.org>
1029         Implement backtrace output for fatal errors on MS-Windows.
1030         * w32fns.c (CaptureStackBackTrace_proc): New typedef.
1031         (BACKTRACE_LIMIT_MAX): New macro.
1032         (w32_backtrace): New function.
1033         (emacs_abort): Use w32_backtrace when the user chooses not to
1034         attach a debugger.  Update the text of the abort dialog.
1036 2012-11-02  Dmitry Antipov  <dmantipov@yandex.ru>
1038         Window-related stuff cleanup here and there.
1039         * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
1040         Use decode_any_window.
1041         * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
1042         * xdisp.c (Fformat_mode_line): Likewise.
1043         * font.c (Ffont_at): Use decode_live_window.
1044         * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
1045         * window.c (decode_next_window_args): Likewise.
1046         (decode_any_window): Remove static.
1047         * window.h (decode_any_window): Add prototype.
1048         * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
1049         * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
1050         respectively.
1052 2012-11-02  Dmitry Antipov  <dmantipov@yandex.ru>
1054         Remove pad from struct input_event.
1055         * termhooks.h (struct input_event): Remove padding field.
1056         Adjust comment.
1057         * keyboard.c (event_to_kboard): Simplify because frame_or_window
1058         member is never cons for a long time.  Adjust comment.
1059         (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
1060         SELECTION_CLEAR_EVENT has no Lisp_Objects to mark.  Add comment.
1061         * xterm.c (handle_one_xevent): Do not initialize frame_or_window
1062         field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
1064 2012-11-01  Eli Zaretskii  <eliz@gnu.org>
1066         * w32proc.c (getpgrp, setpgid): New functions.  (Bug#12776)
1068 2012-10-31  Paul Eggert  <eggert@cs.ucla.edu>
1070         Fix crash when using Emacs as commit editor for git (Bug#12697).
1071         * callproc.c (setpgrp): Remove macro, as we now use setpgid
1072         and it is configured in conf_post.h.
1073         (Fcall_process): Don't invoke both setsid and setpgid; the former
1074         is enough, if it exists.
1075         * callproc.c (Fcall_process, child_setup):
1076         * process.c (create_process): Use setpgid.
1077         * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
1078         for the real thing.
1079         * dispnew.c (init_display): Initialize the foreground group
1080         if we are running a tty display.
1081         * emacs.c (main): Do not worry about setpgrp; init_display does it now.
1082         * lisp.h (init_foreground_group): New decl.
1083         * sysdep.c (inherited_pgroup): New static var.
1084         (init_foreground_group, tcsetpgrp_without_stopping)
1085         (narrow_foreground_group, widen_foreground_group): New functions.
1086         (init_sys_modes): Narrow foreground group.
1087         (reset_sys_modes): Widen foreground group.
1089 2012-10-31  Michael Albinus  <michael.albinus@gmx.de>
1091         * dbusbind.c: Fix cut'n'waste error.  Use HAVE_DBUS_VALIDATE_INTERFACE.
1093 2012-10-31  Martin Rudalics  <rudalics@gmx.at>
1095         * minibuf.c (read_minibuf): Restore current buffer since
1096         choose_minibuf_frame calling Fset_frame_selected_window may
1097         change it (Bug#12766).
1099 2012-10-30  Jan Djärv  <jan.h.d@swipnet.se>
1101         * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
1103 2012-10-30  Kenichi Handa  <handa@gnu.org>
1105         * font.c (Ffont_at): If WINDOW is specified and it is not
1106         displaying the current buffer, signal an error.
1108 2012-10-29  Daniel Colascione  <dancol@dancol.org>
1110         * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
1111         In preparation for fixing bug#12739, move these functions from
1112         here...
1114         * coding.h, coding.c: ... to here, and compile them only when
1115         WINDOWSNT or CYGWIN.  Moving these functions out of cygw32 proper
1116         lets us write cygw32-agnostic code for the HAVE_NTGUI case.
1118 2012-10-28  Eli Zaretskii  <eliz@gnu.org>
1120         * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
1121         (timer_loop, getitimer, setitimer): Use it instead of
1122         CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
1123         'clock'.
1124         (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
1125         literal 10000.
1127 2012-10-28  Jan Djärv  <jan.h.d@swipnet.se>
1129         * nsterm.m (NO_APPDEFINED_DATA): New define.
1130         (last_appdefined_event_data): New variable
1131         (last_appdefined_event): Remove.
1132         (ns_select): Initialize t from last_appdefined_event_data instead
1133         of [last_appdefined_event data1].
1134         (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
1135         remove last_appdefined_event (Bug#12698).
1137 2012-10-28  Stefan Monnier  <monnier@iro.umontreal.ca>
1139         * frame.c (x_set_font): Catch internal error.
1141 2012-10-27  Eli Zaretskii  <eliz@gnu.org>
1143         Avoid overflow in w32 implementation of interval timers.
1144         When possible, for ITIMER_PROF count only times the main thread
1145         actually executes.
1146         * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
1147         'volatile ULONGLONG' types.  All the other data which was
1148         previously clock_t is now ULONGLONG.  'terminate' is 'volatile int'.
1149         (GetThreadTimes_Proc): New typedef.
1150         (w32_get_timer_time): New function, returns a suitable time value
1151         for the timer.
1152         (timer_loop): Enter critical section when accessing ULONGLONG
1153         values of the itimer_data struct, as these accesses are no longer
1154         atomic.  Call 'w32_get_timer_time' instead of 'clock'.
1155         Remove unused variable.
1156         (init_timers): Initialize s_pfn_Get_Thread_Times.
1157         (start_timer_thread): Don't assign itimer->caller_thread here.
1158         (getitimer): Assign itimer->caller_thread here.
1159         (setitimer): Always call getitimer to get the value of ticks_now.
1160         (sys_spawnve): Avoid compiler warning about format mismatch.
1162 2012-10-26  Eli Zaretskii  <eliz@gnu.org>
1164         * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
1165         mouse movement events if the menu bar is active.  This avoids
1166         producing a busy "hour-glass" cursor by Windows if the mouse
1167         pointer is positioned over a tooltip shown for some menu item.
1169 2012-10-25  Paul Eggert  <eggert@cs.ucla.edu>
1171         Don't assume process IDs fit in int.
1172         * emacs.c (shut_down_emacs) [!DOS_NT]:
1173         * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
1174         * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
1175         Use pid_t, not int, to store process IDs, as 'int'
1176         is not wide enough on a few platforms (e.g., AIX and IRIX).
1178 2012-10-23  Kenichi Handa  <handa@gnu.org>
1180         The following change is to make face-font-rescale-alist work
1181         correctly for non-ASCII fonts.
1183         * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
1184         (font_open_for_lface): Handle Vface_font_rescale_alist.
1186 2012-10-23  Chong Yidong  <cyd@gnu.org>
1188         * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
1190 2012-10-21  Jan Djärv  <jan.h.d@swipnet.se>
1192         * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
1193         for screen font.
1194         (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
1196         * xterm.c (x_focus_changed): Check if daemonp when sending focus in
1197         event (Bug#12681).
1199 2012-10-21  Glenn Morris  <rgm@gnu.org>
1201         * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
1203 2012-10-20  Paul Eggert  <eggert@cs.ucla.edu>
1205         Port to OpenBSD 5.1.
1206         * frame.c (Fmouse_position, Fmouse_pixel_position):
1207         * xdisp.c (produce_stretch_glyph):
1208         Declare local vars only when they're needed.
1209         This is clearer and avoids a warning on OpenBSD about unused vars.
1210         * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
1211         This is safer, and avoids OpenBSD warnings about unused vars.
1212         * keyboard.c (record_menu_key): Remove unnecessary decl.
1213         (poll_timer): Define only if POLL_FOR_INPUT is defined.
1214         * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
1215         as our definition clashes with OpenBSD's.
1216         * xfaces.c (load_face_colors, check_lface_attrs)
1217         (get_lface_attributes_no_remap, get_lface_attributes)
1218         (lface_fully_specified_p, x_supports_face_attributes_p)
1219         (tty_supports_face_attributes_p, face_fontset, realize_face)
1220         (realize_x_face, realize_tty_face):
1221         Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
1222         merely Lisp_Object *.  This is more informative and avoids
1223         a warning on OpenBSD about accessing beyond an object's size.
1225 2012-10-20  Chong Yidong  <cyd@gnu.org>
1227         * lread.c (Fload): Doc fix (Bug#12592).
1229 2012-10-19  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
1231         * font.c (Ffont_at): Fix previous change.
1233 2012-10-19  Eli Zaretskii  <eliz@gnu.org>
1235         * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
1236         See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
1237         for the reasons.
1239         * alloc.c (NSTATICS): Decrease to 0x800.
1241 2012-10-19  Stefan Monnier  <monnier@iro.umontreal.ca>
1243         * fns.c (Fnreverse): Include the problem element when signalling an
1244         error (bug#12677).
1246 2012-10-18  Jan Djärv  <jan.h.d@swipnet.se>
1248         * nsterm.m (ns_select): Check writefds before call to
1249         FD_ISSET (Bug#12668).
1251 2012-10-18  Daniel Colascione  <dancol@dancol.org>
1253         * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
1254         (staticpro): If we run out of staticpro slots, die with an
1255         informative error instead of just calling emacs_abort.
1257 2012-10-18  Martin Rudalics  <rudalics@gmx.at>
1259         Fix two flaws reported by Dmitry Antipov.
1260         * window.c (Ftemp_output_buffer_show): Remove.
1261         (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
1262         (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
1264 2012-10-17  Eli Zaretskii  <eliz@gnu.org>
1266         * makefile.w32-in ($(BLD)/w32.$(O)):
1267         ($(BLD)/vm-limit.$(O)):
1268         ($(BLD)/term.$(O)):
1269         ($(BLD)/unexw32.$(O)):
1270         ($(BLD)/fileio.$(O)):
1271         ($(BLD)/dispnew.$(O)): Update dependencies.
1273         * w32term.h (w32_initialize_display_info, initialize_w32_display):
1274         Add prototypes.
1276         * w32proc.c: Include ctype.h.
1278         * w32.h (init_environment, check_windows_init_file)
1279         (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
1280         (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
1281         (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
1282         (sys_link): Add prototypes.
1284         * w32.c: Include w32select.h.
1285         (sys_access, e_malloc, sys_select): Add prototypes.
1286         (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
1288         * vm-limit.c [WINDOWSNT]: Include w32heap.h.
1290         * unexw32.c: Include lisp.h and w32.h.
1292         * term.c [WINDOWSNT]: Include w32term.h.
1294         * process.c [WINDOWSNT]: Add prototype of sys_select.
1296         * fileio.c [WINDOWSNT]: Include w32.h.
1298         * dispnew.c [WINDOWSNT]: Include w32.h.
1300         * cygw32.c (Fcygwin_convert_path_to_windows)
1301         (Fcygwin_convert_path_from_windows): Use EQ to compare 2
1302         Lisp_Object values.  (Bug#12661)
1304         * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
1305         to Lisp_Object.  (Bug#12661)
1307 2012-10-17  Kenichi Handa  <handa@gnu.org>
1309         * xdisp.c (reseat_1): Make the information stored in it->cmp_it
1310         invalidate.
1312 2012-10-17  Dmitry Antipov  <dmantipov@yandex.ru>
1314         * buffer.c (Fkill_buffer): When unchaining the marker,
1315         reset its buffer pointer to NULL (Bug#12652).
1317 2012-10-17  Dmitry Antipov  <dmantipov@yandex.ru>
1319         Do not verify indirection counters of killed buffers (Bug#12579).
1320         * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
1321         * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
1323 2012-10-16  Dmitry Antipov  <dmantipov@yandex.ru>
1325         * alloc.c (Fmake_byte_code): Fix typo in comment.
1326         * print.c (print_interval): Define as static to match prototype.
1327         * indent.c (disptab_matches_widthtab, recompute_width_table):
1328         Convert to eassert.
1330 2012-10-16  Dmitry Antipov  <dmantipov@yandex.ru>
1332         * editfns.c (get_system_name): Remove.
1333         * lisp.h (get_system_name): Remove prototype.
1334         * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
1335         (get_environ_db): Use Vsystem_name.  Avoid call to strlen.
1337 2012-10-15  Daniel Colascione  <dancol@dancol.org>
1339         * dbusbind.c: Add comment explaining reason for previous change.
1341 2012-10-15  Martin Rudalics  <rudalics@gmx.at>
1343         * window.c (Fwindow_end): Rewrite check whether cached position
1344         can be used (Bug#12600).
1345         (resize_frame_windows, grow_mini_window, shrink_mini_window):
1346         Set windows_or_buffers_changed.
1348 2012-10-15  Daniel Colascione  <dancol@dancol.org>
1350         * dbusbind.c: Fix cygw32 build break when compiling with dbus
1351         enabled by undefining the symbol "interface", which the platform
1352         headers define to something incompatible.
1354 2012-10-14  Daniel Colascione  <dancol@dancol.org>
1356         * image.c (init_tiff_functions, init_imagemagick_functions)
1357         (init_svg_functions): Fix cygw32 build break by using these
1358         functions only when WINDOWSNT _and_ HAVE_NTGUI.
1360 2012-10-14  Jan Djärv  <jan.h.d@swipnet.se>
1362         * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
1364 2012-10-13  Jan Djärv  <jan.h.d@swipnet.se>
1366         * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
1368 2012-10-13  HANATAKA, Shinya  <bogytech@gmail.com>  (tiny change)
1370         * coding.c (detect_coding): Set coding->id before calling
1371         this->detector.
1373 2012-10-13  Andreas Schwab  <schwab@linux-m68k.org>
1375         * fileio.c: Formatting fixes.
1377 2012-10-13  Paul Eggert  <eggert@cs.ucla.edu>
1379         Fix some stat-related races.
1380         * fileio.c (Fwrite_region): Avoid race condition if a file is
1381         removed or renamed by some other process immediately after Emacs
1382         writes it but before Emacs stats it.  Do not assume that stat (or
1383         fstat) succeeds.
1384         * image.c (slurp_file): Resolve the file name with fopen + fstat
1385         rather than stat + fopen.
1386         (pbm_read_file) [0]: Remove unused code with stat race.
1387         * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
1388         Remove ineffective code with stat race.
1390 2012-10-12  Stefan Monnier  <monnier@iro.umontreal.ca>
1392         * doc.c (get_doc_string): Don't signal an error if the file is missing.
1394 2012-10-12  Jan Djärv  <jan.h.d@swipnet.se>
1396         * nsterm.m (hold_event_q): New static variable.
1397         (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
1398         ! q_event_ptr.
1399         (hold_event): New function.
1400         (ns_read_socket): If hold_event_q have events, store them and
1401         return (Bug#12384).
1402         (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
1403         is zero (Bug#12384).
1405 2012-10-12  Juanma Barranquero  <lekktu@gmail.com>
1407         * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
1409 2012-10-12  Eli Zaretskii  <eliz@gnu.org>
1411         * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
1413         * fileio.c (check_existing): New function.
1414         (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
1415         instead of calling 'stat', when what's needed is to check whether
1416         a file exists.  This avoids expensive system calls on MS-Windows.
1417         (Bug#12587)
1419         * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
1421         * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
1422         determine whether a file exists and is not a directory.
1424         * lisp.h (check_existing): Add prototype.
1426 2012-10-12  Jan Djärv  <jan.h.d@swipnet.se>
1428         * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
1430 2012-10-12  Glenn Morris  <rgm@gnu.org>
1432         * buffer.c (Fset_buffer): Doc fix.  (Bug#12624)
1434 2012-10-11  Stefan Monnier  <monnier@iro.umontreal.ca>
1436         * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
1438         * eval.c (Fautoload): Remember previous autoload status in load-history.
1440 2012-10-11  Paul Eggert  <eggert@cs.ucla.edu>
1442         lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
1443         * lread.c (load_each_byte, new_backquote_flag, readchar)
1444         (read_filtered_event, lisp_file_lexically_bound_p)
1445         (safe_to_load_version, Fload, complete_filename_p, openp)
1446         (build_load_history, readevalloop, read_escape, read1)
1447         (string_to_number, read_vector, read_list):
1448         * macros.c (Fstart_kbd_macro):
1449         * marker.c (CONSIDER):
1450         * menu.c (parse_single_submenu, digest_single_submenu)
1451         (find_and_return_menu_selection, Fx_popup_menu):
1452         * minibuf.c (read_minibuf_noninteractive, read_minibuf)
1453         (Ftry_completion):
1454         * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
1455         (ns_menu_show):
1456         * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
1457         (xmenu_show, xdialog_show):
1458         Use bool for booleans.
1459         * lread.c (safe_to_load_version): Rename from safe_to_load_p,
1460         as it's not a predicate.  All uses changed.  Omit unnecessary
1461         buffer termination.
1463 2012-10-11  Dmitry Antipov  <dmantipov@yandex.ru>
1465         * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
1466         (save_excursion_restore): Do not restore mark if it was not saved.
1468 2012-10-11  Paul Eggert  <eggert@cs.ucla.edu>
1470         * marker.c (cached_modiff): EMACS_INT, not int.
1472         * w32select.c (waiting_for_input): Declare by including "keyboard.h"
1473         instead of having a wrong decl.
1474         * nsmenu.m (waiting_for_input): Remove wrong decl.
1476 2012-10-10  Paul Eggert  <eggert@cs.ucla.edu>
1478         keyboard.c, keymap.c: Use bool for booleans.
1479         * dispnew.c (sit_for): Distinguish between 3-way display_option
1480         and boolean do_display.
1481         * keyboard.c (single_kboard, this_command_key_count_reset)
1482         (waiting_for_input, echoing, immediate_quit, input_pending)
1483         (interrupt_input, interrupts_deferred, pop_kboard)
1484         (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
1485         (command_loop_1, adjust_point_for_property)
1486         (safe_run_hooks_error, input_polling_used, read_char):
1487         (help_char_p, readable_events, kbd_buffer_events_waiting)
1488         (kbd_buffer_get_event, timer_check_2, make_lispy_event)
1489         (lucid_event_type_list_p, get_input_pending):
1490         (gobble_input, menu_separator_name_p, menu_bar_item)
1491         (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
1492         (read_char_minibuf_menu_prompt, access_keymap_keyremap)
1493         (keyremap_step, test_undefined, read_key_sequence)
1494         (detect_input_pending, detect_input_pending_ignore_squeezables)
1495         (detect_input_pending_run_timers, requeued_events_pending_p)
1496         (quit_throw_to_read_char, Fset_input_interrupt_mode):
1497         * keymap.c (get_keymap, keymap_parent, keymap_memberp)
1498         (access_keymap_1, access_keymap, map_keymap, get_keyelt)
1499         (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
1500         (accessible_keymaps_1, Fkey_description, push_key_description):
1501         (shadow_lookup, struct where_is_internal_data)
1502         (where_is_internal, Fwhere_is_internal, where_is_internal_1)
1503         (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
1504         (describe_map, describe_vector):
1505         * menu.c (single_menu_item):
1506         * nsmenu.m (ns_update_menubar):
1507         * process.c (wait_reading_process_output):
1508         * search.c (scan_buffer, scan_newline):
1509         Use bool for boolean.
1510         * keyboard.c (timers_run, swallow_events)
1511         (detect_input_pending_run_timers):
1512         * process.c (wait_reading_process_output):
1513         Use unsigned for counter where wraparound-on-overflow is desired,
1514         since unsigned is guaranteed to have that behavior and signed is not.
1515         (read_char): Use ptrdiff_t for string length.
1516         (get_input_pending): Remove first argument, since it was always
1517         the same pointer-to-int (now pointer-to-boolean) &input_pending,
1518         and behave as if it had that value.  Return new value of
1519         input_pending.  All callers changed.
1520         * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
1521         immediate_echo.  Use ptrdiff_t for echo_after_prompt, since it's
1522         a string length.
1523         * keymap.c (push_key_description): Omit last arg, which was always 1.
1524         All callers changed.
1526         * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
1528 2012-10-10  Juanma Barranquero  <lekktu@gmail.com>
1530         * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
1531         ($(BLD)/term.$(O)): Update dependencies.
1533 2012-10-10  Dmitry Antipov  <dmantipov@yandex.ru>
1535         * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
1536         * lisp.h (enum pvec_type): Adjust comments and omit explicit
1537         initializer for PVEC_NORMAL_VECTOR.
1539 2012-10-10  Paul Eggert  <eggert@cs.ucla.edu>
1541         Clean out old termopts cruft.
1542         * termopts.h (flow_control, meta_key): Remove unused decls.
1543         * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
1544         Don't include termopts.h.
1546 2012-10-10  Dmitry Antipov  <dmantipov@yandex.ru>
1548         * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
1550 2012-10-10  Paul Eggert  <eggert@cs.ucla.edu>
1552         * commands.h (immediate_quit): Remove duplicate decl.
1554 2012-10-09  Jan Djärv  <jan.h.d@swipnet.se>
1556         * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
1557         caching.
1558         (nsfont_open): Remove setting of Vfonts_in_cache.
1559         (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
1561 2012-10-09  Eli Zaretskii  <eliz@gnu.org>
1563         * w32fns.c (w32_last_error): Change the return value to DWORD, to
1564         match what GetLastError returns.  Explain why the function is
1565         needed.
1567         * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
1568         'is_tooltip_frame', to avoid confusion with its global namesake.
1570 2012-10-08  Daniel Colascione  <dancol@dancol.org>
1572         * xdisp.c (start_hourglass): Call w32_note_current_window when
1573         HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
1574         build that caused Emacs to display the hourglass cursor forever.
1576         * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
1577         which is broken under remote desktop, calculate the number of
1578         colors available for a display based on the display's number of
1579         planes and number of bits per pixel per plane.  (bug#10397).
1581 2012-10-08  Jan Djärv  <jan.h.d@swipnet.se>
1583         * nsfont.m (Vfonts_in_cache): New variable.
1584         (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
1585         are used.  Add cached fonts to Vfonts_in_cache.
1586         (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
1588 2012-10-08  Juanma Barranquero  <lekktu@gmail.com>
1590         * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
1591         in nt/config.nt.
1592         (FONT_H): Define after FRAME_H.
1593         ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
1594         Update dependencies.
1596         * w32term.c: Remove leftover declaration of keyboard_codepage.
1598 2012-10-08  Eli Zaretskii  <eliz@gnu.org>
1600         * makefile.w32-in (FONT_H): Add $(FRAME_H).
1601         (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
1602         ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
1603         (GLOBAL_SOURCES): Add cygw32.c.
1604         ($(BLD)/unexw32.$(O)):
1605         ($(BLD)/w32.$(O)):
1606         ($(BLD)/w32console.$(O)):
1607         ($(BLD)/w32fns.$(O)):
1608         ($(BLD)/w32heap.$(O)):
1609         ($(BLD)/w32menu.$(O)):
1610         ($(BLD)/w32proc.$(O)): Add w32common.h.
1612         * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
1613         'const char *'.
1614         (x_to_w32_color): Don't modify the argument, modify a copy instead.
1616 2012-10-08  Daniel Colascione  <dancol@dancol.org>
1618         * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
1619         (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
1620         accidental message numbering hole.  Change other messages to
1621         match.
1623         * w32select.h (HAVE_W32SELECT): Remove.
1625         * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1626         w32common.h instead of w32heap.h.
1628         * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
1629         (get_allocation_unit, get_processor_type, get_w32_major_version)
1630         (get_w32_minor_version, sysinfo_cache, osinfo_cache)
1631         (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
1632         (OS_NT, os_subtype, cache_system_info): Move declarations to
1633         w32common.
1635         * w32heap.c: Include w32common.h.
1636         (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
1637         (w32_minor_version, w32_build_number, w32_subtype):
1638         Remove duplicate definitions.
1640         * w32fns.c: Include w32common.h; include w32heap.h only in
1641         WINDOWSNT.
1643         (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
1644         Use `report_file_error' instead of `error' in order to better
1645         inform users of what went wrong.  Increase NTGUI_UNICODE file
1646         dialog box file name length to 32k, the maximum allowed by the NT
1647         kernel.
1649         * w32common.h: New file.
1650         (ROUND_UP, ROUND_DOWN, get_page_size)
1651         (get_allocation_unit, get_processor_type, get_w32_major_version)
1652         (get_w32_minor_version, sysinfo_cache, osinfo_cache)
1653         (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
1654         (OS_NT, os_subtype, cache_system_info): Move here.
1656         * unexw32.c, unexcw.c: Include w32common.h.
1658         * emacs.c (main): Use (defined (WINDOWSNT) || defined
1659         HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
1660         to call syms_of_w32select.
1662         * cygw32.h: Remove obsolete EXFUN declarations.
1664         * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
1666         * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
1667         of w32inevt.o from SOME_MACHINE_OBJECTS.
1669 2012-10-08  Daniel Colascione  <dancol@dancol.org>
1671         * image.c: Permanent fix for JPEG compilation issue --- limit
1672         jpeglib `boolean' redefinition to Cygwin builds.
1674 2012-10-08  Eli Zaretskii  <eliz@gnu.org>
1676         * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
1678         * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
1679         Cygwin.
1681 2012-10-08  Daniel Colascione  <dancol@dancol.org>
1683         * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
1684         w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
1685         w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
1686         w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
1687         keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
1688         emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
1689         Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
1690         operating system.  defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
1691         now a supported configuration.
1693         * Makefile.in: consolidate image variables into LIBIMAGE; add
1694         W32_OBJ and W32_LIBS.  Compile new files.
1696         * conf_post.h:
1697         (_DebPrint) declare tracing facility for W32 debugging.  We need
1698         to unify tracing later.
1700         (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
1701         unconditional use of W32 Unicode functions.  Cygwin runs only on
1702         100% Unicode operating systems.
1704         * cygw32.c: New file.  Define Cygwin-specific facilities.
1705         (Fcygwin_convert_path_to_windows)
1706         (Fcygwin_convert_path_from_windows): New user functions for
1707         accessing Cygwin path-munging routines.
1709         * cygw32.h: New file.
1710         (WCSDATA, to_unicode, from_unicode): Define facilities for storing
1711         UTF-16LE strings temporarily inside non-Lisp-visible string
1712         objects.
1714         (w32_strerror): Just what it says on the tin.
1716         * emacs.c: Make the NS fork-then-exec code for daemon-launching
1717         also run for Cygwin; both systems have the same problem with using
1718         GUI facilities in a forked child.  Also call syms_of_cygw32,
1719         syms_of_w32select in correct places.
1721         (DAEMON_MUST_EXEC): new macro defined to signal that a platform
1722         needs fork-then-exec for daemon launching.
1724         * font.h: Include frame.h.
1726         * image.c: Use the image library cache machinery only when we're
1727         compiling for native WINDOWSNT; Cygwin can use shared libraries
1728         like any other Unixlike system.
1730         * keyboard.c: Clarify a comment regarding the input loop.
1732         * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
1733         functions directly instead of trying to detect at runtime that our
1734         host operating system supports them.  We make this change for two
1735         reasons: Cygwin lacks support for the multibyte character
1736         conversion functions used by the legacy menu code, and Cygwin
1737         never needs to rely on non-Unicode APIs.
1739         * unexw32.c (hinst): Declare extern.
1741         * w32.c: Change header order;
1742         (w32_strerror): Move to w32fns.c because we need it for
1743         non-WINDOWSNT builds.
1745         * w32.h: Add #error macro to make sure we don't include w32.h for
1746         Cygwin builds.  Remove w32select declarations.
1748         * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1749         w32fns.c.  w32console.c is WINDOWSNT-only.
1751         * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
1752         NTGUI_UNICODE tweaks.  (See above.) Change _snprintf to the more
1753         POSIXy alternative.
1754         (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
1755         (w32_major_version, w32_minor_version, w32_build_number)
1756         (os_subtype, sound_type): Define here
1757         (w32_defined_color): Make color parameter const for consistency
1758         with other _defined_color functions.
1759         (w32_createwindow): Unconditionally call w32_init_class instead of
1760         doing so only when hprevinst is non-NULL.  Plumbing hprevinst
1761         through the code is complex and unnecessary because class
1762         registration is practically free.
1763         (w32_name_of_message): New EMACSDEBUG-only function.
1764         (Fset_message_beep): Move here
1765         (Fx_open_connection): Require that the display name for Windows be
1766         "w32" for consistency, emacsclient disambiguation, and maybe, one
1767         day, multi-window-system support.
1768         (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
1769         Cygwin files for W32 GUI facilities, since these clearly don't
1770         expect Cygwin names.
1771         (_DebPrint): Define.
1772         (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
1773         (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
1774         (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
1775         (w32_last_error): Remove.
1777         * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
1779         * w32heap.c (syspage_mask): Declare here.
1780         (cache_system_info): Remove.
1782         * w32inevt.c (faked_key): Define globally, not statically.
1783         (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
1784         (w32_console_toggle_lock_key): Move to w32fns.c.
1786         * w32menu.c: Include setjmp.h.  NTGUI_UNICODE changes throughout.
1788         * w32proc.c (_DebPrint): Move to w32fns.c.
1789         * w32select.c: Include string.h, stdio.h for Cygwin.
1790         * w32select.h: New File.
1792         * w32term.c: Include io.h for non-CYGWIN builds; needed for
1793         get_osfhandle.
1794         (w32_message_fd): New variable.  Under Cygwin, holds the file
1795         descriptor the system used to tell us about pending thread
1796         messages.
1798         (w32_init_term): Remove incorrect calls to fcntl and init_sigio
1799         that prevented compilation under non-WINDOWSNT systems.
1801         (w32_initialize): Open /dev/windows and assign it to
1802         w32_message_fd.  Provide w32 feature.
1804         * w32term.h: Include frame.h, atimer.h.  Declare various frame functions.
1805         (WM_EMACS_INPUT_READY): add.
1806         (prepend_msg, w32_message_fd): Declare globally.
1808         * w32xfns.c:
1809         (keyboard_handle): Use only when WINDOWSNT.
1810         (notify_msg_ready): New function.  Posts a message to the main
1811         thread's message queue under CYGWIN, which wakes up the main
1812         thread from select(2) by making the /dev/windows file descriptor
1813         ready.  Under WINDOWSNT, it sets an event the same way the old
1814         code did.
1816         (post, prepend_msg): Actually call notify_msg_ready instead of
1817         setting the input event directly.
1819 2012-10-07  Eli Zaretskii  <eliz@gnu.org>
1821         * ralloc.c (relinquish): If a heap is ready to be relinquished,
1822         but it still has blocs in it, don't return it to the system,
1823         instead of aborting.  (Bug#12402)
1825 2012-10-07  Jan Djärv  <jan.h.d@swipnet.se>
1827         * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
1829         * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
1830         MAC_OS_X_VERSION_10_6.
1831         (syms_of_nsterm): Remove comment about Panther and above for
1832         ns-antialias-text.
1833         * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
1834         (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
1835         (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
1837         * nsselect.m (ns_string_from_pasteboard): Remove check for >=
1838         MAC_OS_X_VERSION_10_4.
1840         * nsmenu.m (fillWithWidgetValue:): Remove code for <
1841         MAC_OS_X_VERSION_10_2.
1843         * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
1845         * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
1846         (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
1848         * nsterm.m (ns_in_resize): Remove (Bug#12479).
1849         (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
1850         (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
1851         Remove ns_in_resize check.
1852         (ns_clear_frame_area): Remove resize handle code.
1854         * nsfns.m (ns_in_resize): Remove.
1855         (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
1856         Remove ns_in_resize check.
1858 2012-10-07  Paul Eggert  <eggert@cs.ucla.edu>
1860         Improve sys_siglist detection.
1861         * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
1862         defined as a macro, as is done in Solaris.
1863         (sys_siglist_entries): New macro.
1864         (save_strsignal): Use it.
1865         * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
1866         GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
1868 2012-10-06  Jan Djärv  <jan.h.d@swipnet.se>
1870         * nsfns.m (Fx_create_frame): Call x_default_parameter with
1871         fullscreen/Fullscreen.
1873         * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
1874         tobar_height is new.
1876         * nsterm.m (x_make_frame_visible): Check for fullscreen.
1877         (ns_fullscreen_hook): Activate old style fullscreen with a timer.
1878         (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
1879         (windowDidResize:): Check for correct window if old style fullscreen.
1880         Capitalize word in comment.  Remove incorrect comment.
1881         (initFrameFromEmacs:): tbar_height renamed tibar_height.
1882         (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
1883         error in drawing background.
1884         (toggleFullScreen:): Remove comment.  Rearrange calls.
1885         Set toolbar values to zero, save old height in tobar_height.
1886         Restore tool bar height when leaving fullscreen.
1887         (canBecomeMainWindow): New function.
1889 2012-10-06  Paul Eggert  <eggert@cs.ucla.edu>
1891         * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
1893 2012-10-05  Eli Zaretskii  <eliz@gnu.org>
1895         * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
1897         * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
1898         that time stamps of directories could also be changed.
1899         Don't request the too broad GENERIC_WRITE, only the more restrictive
1900         FILE_WRITE_ATTRIBUTES access rights.
1902         * fileio.c (Fset_file_times): Special-case ignoring errors for
1903         directories only on MSDOS, not on MS-Windows.
1905 2012-10-05  Ikumi Keita  <ikumi@ikumi.que.jp>  (tiny change)
1907         * minibuf.c (Fcompleting_read): Doc fix.  (Bug#12555)
1909 2012-10-04  Eli Zaretskii  <eliz@gnu.org>
1911         * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
1912         see whether CreateFile failed.
1914 2012-10-04  Paul Eggert  <eggert@cs.ucla.edu>
1916         * profiler.c (handle_profiler_signal): Inhibit pending signals too,
1917         to avoid similar races.
1918         * keyboard.c (pending_signals): Now bool, not int.
1920         Port timers to OpenBSD, plus check for timer failures.
1921         OpenBSD problem reported by Han Boetes.
1922         * profiler.c (setup_cpu_timer): Check for failure of timer_settime
1923         and/or setitimer.
1924         (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
1925         * syssignal.h (HAVE_ITIMERSPEC): New macro.  This is for platforms
1926         like OpenBSD, which has timer_settime but does not declare it.
1927         OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
1928         whether to use itimerspec-related primitives.  All uses of
1929         HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
1931 2012-10-02  Paul Eggert  <eggert@cs.ucla.edu>
1933         * profiler.c (handle_profiler_signal): Fix a malloc race
1934         that caused Emacs to hang on Fedora 17 when profiling Lisp.
1936 2012-10-02  Jan Djärv  <jan.h.d@swipnet.se>
1938         * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
1940 2012-10-02  Eli Zaretskii  <eliz@gnu.org>
1942         * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
1943         consistent with the change in return value of 'safe_strsignal'.
1945 2012-10-02  Paul Eggert  <eggert@cs.ucla.edu>
1947         Prefer plain 'static' to 'static inline' (Bug#12541).
1948         * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
1949         (bidi_set_sor_type, bidi_push_embedding_level)
1950         (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
1951         (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
1952         (bidi_cache_search, bidi_cache_ensure_space)
1953         (bidi_cache_iterator_state, bidi_cache_find)
1954         (bidi_peek_at_next_level, bidi_set_paragraph_end)
1955         (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
1956         (bidi_explicit_dir_char, bidi_resolve_neutral_1):
1957         Now 'static', not 'static inline'.
1959         Count overruns when profiling; change units to ns.
1960         * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
1961         Give extra weight to samples after overruns, to attempt to count
1962         the time more accurately.
1963         (setup_cpu_timer): Change sampling interval units from ms to ns, since
1964         the underlying primitives nominally do ns.
1965         (Fprofiler_cpu_start): Document the change.  Mention that
1966         the sampling intervals are only approximate.
1968 2012-10-02  Stefan Monnier  <monnier@iro.umontreal.ca>
1970         * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
1972         * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
1973         case for the special 0 coding-system.
1975         * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
1976         (Fmake_overlay): Remove redundant tests.
1977         (fix_start_end_in_overlays): Remove redundant recentering.
1979 2012-10-02  Juanma Barranquero  <lekktu@gmail.com>
1981         * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
1982         Update dependencies.
1984 2012-10-01  Paul Eggert  <eggert@cs.ucla.edu>
1986         Fix a malloc race condition involving strsignal.
1987         A signal can arrive in the middle of a malloc, and Emacs's signal
1988         handler can invoke strsignal, which can invoke malloc, which is
1989         not portable.  This race condition bug makes Emacs hang on GNU/Linux.
1990         Fix it by altering the signal handler so that it does not invoke
1991         strsignal.
1992         * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
1993         * process.c (status_message): Use const pointer, in case strsignal
1994         is #defined to safe_strsignal.
1995         * sysdep.c (sys_siglist, init_signals): Always define and
1996         initialize a substitute sys_siglist if the system does not define
1997         one, even if HAVE_STRSIGNAL.
1998         (safe_strsignal): Rename from strsignal.  Always define,
1999         using sys_siglist.  Return a const pointer.
2000         * syssignal.h (safe_strsignal): New decl.
2001         (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
2003 2012-10-01  Eli Zaretskii  <eliz@gnu.org>
2005         * w32proc.c (timer_loop): Fix code that waits for timer
2006         expiration, to avoid high CPU usage.
2008 2012-10-01  Stefan Monnier  <monnier@iro.umontreal.ca>
2010         * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
2011         (sweep_weak_table): Remove redundant prototypes.
2013 2012-10-01  Fabrice Popineau  <fabrice.popineau@gmail.com>
2015         * emacs.c: Move the inclusion of TERM_HEADER after including
2016         windows.h on WINDOWSNT.  This avoids compilation problems with
2017         MSVC.
2019 2012-10-01  Eli Zaretskii  <eliz@gnu.org>
2021         * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
2022         (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
2023         (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
2024         as the previous version used 'void *'.
2026         * ralloc.c (ROUNDUP): Fix last change.
2027         (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
2028         'size_t'.
2030         * w32proc.c <disable_itimers>: New static flag.
2031         (init_timers): Initialize it to zero, after creating the critical
2032         sections used by the timer threads.
2033         (term_timers): Set to 1 before deleting the critical sections.
2034         (getitimer, setitimer): If disable_itimers is non-zero, return an
2035         error indication without doing anything.  Reported by Fabrice
2036         Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
2037         (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
2038         return results.
2039         [!HAVE_SETITIMER]: Behave as the previous version that didn't
2040         support timers.
2042         * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
2043         term_ntproc after all the other bookkeeping, to get timers working
2044         as long as possible.
2046 2012-10-01  Paul Eggert  <eggert@cs.ucla.edu>
2048         * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
2049         Suggested by Juri Linkov in
2050         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
2052         Prefer plain 'static' to 'static inline' (Bug#12541).
2053         With static functions, modern compilers inline pretty well by
2054         themselves; advice from programmers often hurts as much as it helps.
2055         On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
2056         this change shrinks the text size of the Emacs executable by 1.1%
2057         without affecting CPU significantly in my benchmark.
2058         * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
2059         (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
2060         (mark_maybe_object, mark_maybe_pointer, bounded_number):
2061         * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2062         (bset_auto_fill_function, bset_auto_save_file_format)
2063         (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2064         (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2065         (bset_cache_long_line_scans, bset_case_fold_search)
2066         (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2067         (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2068         (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2069         (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2070         (bset_header_line_format, bset_indicate_buffer_boundaries)
2071         (bset_indicate_empty_lines, bset_invisibility_spec)
2072         (bset_left_fringe_width, bset_major_mode, bset_mark)
2073         (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2074         (bset_name, bset_overwrite_mode, bset_pt_marker)
2075         (bset_right_fringe_width, bset_save_length)
2076         (bset_scroll_bar_width, bset_scroll_down_aggressively)
2077         (bset_scroll_up_aggressively, bset_selective_display)
2078         (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2079         (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
2080         (set_buffer_overlays_after):
2081         * category.c (bset_category_table):
2082         * charset.c (read_hex):
2083         * coding.c (produce_composition, produce_charset)
2084         (handle_composition_annotation, handle_charset_annotation)
2085         (char_encodable_p):
2086         * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
2087         (assign_row, set_frame_matrix_frame, make_current)
2088         (add_row_entry):
2089         * eval.c (set_specpdl_symbol, set_specpdl_old_value):
2090         * fns.c (maybe_resize_hash_table):
2091         * frame.c (fset_buffer_predicate, fset_minibuffer_window):
2092         * gmalloc.c (register_heapinfo):
2093         * image.c (lookup_image_type):
2094         * intervals.c (set_interval_object, set_interval_left)
2095         (set_interval_right, copy_interval_parent, rotate_right)
2096         (rotate_left, balance_possible_root_interval):
2097         * keyboard.c (kset_echo_string, kset_kbd_queue)
2098         (kset_keyboard_translate_table, kset_last_prefix_arg)
2099         (kset_last_repeatable_command, kset_local_function_key_map)
2100         (kset_overriding_terminal_local_map, kset_real_last_command)
2101         (kset_system_key_syms, clear_event, set_prop):
2102         * lread.c (digit_to_number):
2103         * marker.c (attach_marker, live_buffer, set_marker_internal):
2104         * nsterm.m (ns_compute_glyph_string_overhangs):
2105         * process.c (pset_buffer, pset_command)
2106         (pset_decode_coding_system, pset_decoding_buf)
2107         (pset_encode_coding_system, pset_encoding_buf, pset_filter)
2108         (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
2109         (pset_status, pset_tty_name, pset_type, pset_write_queue):
2110         * syntax.c (bset_syntax_table, dec_bytepos):
2111         * terminal.c (tset_param_alist):
2112         * textprop.c (interval_has_some_properties)
2113         (interval_has_some_properties_list):
2114         * window.c (wset_combination_limit, wset_dedicated)
2115         (wset_display_table, wset_hchild, wset_left_fringe_width)
2116         (wset_left_margin_cols, wset_new_normal, wset_new_total)
2117         (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2118         (wset_right_fringe_width, wset_right_margin_cols)
2119         (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
2120         (wset_vertical_scroll_bar_type, wset_window_parameters):
2121         * xdisp.c (wset_base_line_number, wset_base_line_pos)
2122         (wset_column_number_displayed, wset_region_showing)
2123         (window_box_edges, run_window_scroll_functions)
2124         (append_glyph_string_lists, prepend_glyph_string_lists)
2125         (append_glyph_string, set_glyph_string_background_width)
2126         (append_glyph, append_composite_glyph)
2127         (take_vertical_position_into_account):
2128         * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
2129         (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
2130         (lface_hash, lface_same_font_attributes_p, lookup_face):
2131         * xml.c (libxml2_loaded_p):
2132         * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
2133         (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
2134         Now 'static', not 'static inline'.
2136         * bidi.c: Tune.
2137         (bidi_copy_it): Do the whole copy with a single memcpy.
2138         (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
2140         Revert the FOLLOW-SYMLINKS change for file-attributes.
2141         Doing it right would require several changes to Tramp, and there's
2142         not enough time to get that tested before the freeze today.
2143         * dired.c (directory_files_internal, Ffile_attributes):
2144         Undo last change.
2146         * frame.c (x_report_frame_params): Port better to wider ints.
2147         Do not assume that EMACS_UINT is the same width as uprintmax_t,
2148         or that pointers can be printed in 15 decimal digits.
2149         Avoid GCC warnings if EMACS_UINT is wider than a pointer.
2151 2012-09-30  Fabrice Popineau  <fabrice.popineau@supelec.fr>
2153         Support x64 build on MS-Windows.
2154         * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
2155         (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
2156         compatibility with x64.
2157         (x_get_focus_frame): Add prototype.
2159         * w32term.c (w32_draw_underwave): Don't use GCC extensions for
2160         defining an XRectangle structure.
2162         * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
2163         arithmetics for compatibility with x64.
2165         * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
2166         compatibility with x64.
2168         * w32heap.h: Adjust prototypes and declarations.
2170         * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
2171         (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
2172         DWORD, long, and unsigned long, for compatibility with x64.
2173         (allocate_heap) [_WIN64]: Reserve 32GB of memory.
2174         (sbrk): Argument is now of type ptrdiff_t.
2176         * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
2177         less than 0x0500.
2178         (w32_msg_pump): Use WPARAM type for 'result'.
2180         * w32.c (init_environment, get_emacs_configuration): Support AMD64
2181         architecture.
2182         (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
2183         compatibility with x64.
2185         * vm-limit.c (lim_data): Now size_t.
2186         (check_memory_limits): Adjust prototypes of real_morecore and
2187         __morecore to receive argument of type ptrdiff_t.  Use size_t for
2188         five_percent and data_size.
2190         * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
2191         variables, for compatibility with x64.
2192         (rva_to_section, offset_to_section, relocate_offset)
2193         (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
2194         (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
2195         (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
2196         for compatibility with x64.
2198         * sysdep.c (STDERR_FILENO): Define if not already defined.
2200         * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
2201         (__morecore): Argument type is now ptrdiff_t.
2202         (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
2203         (relinquish): Use ptrdiff_t type for 'excess'.
2204         (r_alloc_sbrk): Argument type is now ptrdiff_t.
2206         * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
2207         (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
2208         instead of a literal number.
2210         * gmalloc.c [WINDOWSNT]: Include w32heap.h.
2211         (min): Define only if not already defined.
2213         * frame.c (x_report_frame_params): Use EMACS_UINT for the return
2214         value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
2215         hosts.
2217         * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
2218         'bitmaps' is a pointer.
2220         * dispextern.h (x_bitmap_pixmap): Adjust prototype.
2222         * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
2224 2012-09-30  Paul Eggert  <eggert@cs.ucla.edu>
2226         file-attributes has a new optional arg FOLLOW-SYMLINKS.
2227         * dired.c (directory_files_internal, Ffile_attributes):
2228         New arg follow_symlinks.  All uses changed.
2230 2012-09-30  Stefan Monnier  <monnier@iro.umontreal.ca>
2232         * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
2234 2012-09-30  Eli Zaretskii  <eliz@gnu.org>
2236         Support atimers and CPU profiler via profile.c on MS-Windows.
2237         * w32proc.c (sig_mask, crit_sig): New static variables.
2238         (sys_signal): Support SIGALRM and SIGPROF.
2239         (sigemptyset, sigaddset, sigfillset, sigprocmask)
2240         (pthread_sigmask, setpgrp): Move here from w32.c.  sigaddset,
2241         sigfillset, and sigprocmask are no longer no-ops.
2242         (sigismember): New function.
2243         (struct itimer_data): New definition.
2244         (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
2245         (crit_prof): New static variables.
2246         (MAX_SINGLE_SLEEP): New definition.
2247         (timer_loop, stop_timer_thread, term_timers, init_timers)
2248         (start_timer_thread, getitimer, setitimer): New functions.
2249         (alarm): No longer a no-op, calls setitimer.
2251         * w32.c (term_ntproc): Call term_timers.
2252         (init_ntproc): Make sure all signals are unblocked at startup, to
2253         erase any traces of dumping.  Call init_timers.
2255         * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
2256         Windows-specific code to display the hourglass mouse pointer is no
2257         longer used.
2258         (w32_wnd_proc): Remove code that handled the WM_TIMER message due
2259         to hourglass timer expiration.
2260         (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
2261         Remove, no longer used.
2262         (w32_note_current_window, show_hourglass, hide_hourglass):
2263         New functions, in support of hourglass cursor display similar to other
2264         window systems.
2265         (syms_of_w32fns): Don't initialize hourglass_timer.
2267         * xdisp.c (start_hourglass, cancel_hourglass): Now used on
2268         WINDOWSNT as well.
2269         (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
2271         * w32.h (init_timers, term_timers): Add prototypes.
2273 2012-09-30  Kenichi Handa  <handa@gnu.org>
2275         * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
2276         to the buffer relocation which may be caused by ccl_driver.
2278 2012-09-30  Jan Djärv  <jan.h.d@swipnet.se>
2280         * xfns.c (Fx_file_dialog): Update comment.
2282         * w32fns.c (Fx_file_dialog): Update comment.
2284         * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
2285         Initialize panel name field if OSX >= 10.6.
2287         * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
2289         * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
2291         * nsterm.m (NEW_STYLE_FS): New define.
2292         (ns_fullscreen_hook, windowWillEnterFullScreen)
2293         (windowDidEnterFullScreen, windowWillExitFullScreen)
2294         (windowDidExitFullScreen, toggleFullScreen, handleFS)
2295         (setFSValue): New functions.
2296         (EmacsFSWindow): New implementation.
2297         (canBecomeKeyWindow): New function for EmacsFSWindow.
2298         (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
2299         (dealloc): Release nonfs_window if in fullscreen.
2300         (updateFrameSize:): Call windowDidMove to update top/left.
2301         (windowWillResize:toSize:): Check if frame is still maximized.
2302         (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
2303         next_maximized, maximized_width, maximized_height and nonfs_window.
2304         Call setCollectionBehavior if NEW_STYLE_FS.  Initialize bwidth and
2305         tbar_height.
2306         (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
2307         fullscreen.  Set maximized_width/height.  Act on next_maximized.
2309         * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
2310         (EmacsView): Add variables for fullscreen.
2311         (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
2312         (EmacsFSWindow): New interface for fullscreen.
2314 2012-09-30  Juanma Barranquero  <lekktu@gmail.com>
2316         * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2318 2012-09-30  Chong Yidong  <cyd@gnu.org>
2320         * fns.c (Frandom): Doc fix.
2322 2012-09-30  Martin Rudalics  <rudalics@gmx.at>
2324         * window.c (Vwindow_combination_limit): New default value.
2325         (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
2327 2012-09-30  Paul Eggert  <eggert@cs.ucla.edu>
2329         * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
2330         Suggested by Eli Zaretskii in
2331         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
2333 2012-09-30  Eli Zaretskii  <eliz@gnu.org>
2335         * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
2336         HAVE_TIMER_SETTIME is defined.
2338 2012-09-30  Paul Eggert  <eggert@cs.ucla.edu>
2340         Profiler improvements: more-accurate timers, overflow checks.
2341         * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
2342         signal.h, setjmp.h.  Include systime.h instead.
2343         (saturated_add): New function.
2344         (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
2345         (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
2346         (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
2347         New static vars.
2348         (enum profiler_cpu_running): New enum.
2349         (profiler_cpu_running): Now of that enum type, not bool.
2350         All uses changed to store the new value.
2351         (handle_profiler_signal): Rename from sigprof_handler_1,
2352         for consistency with other handlers.  Do not check whether
2353         cpu_log is a hash-table if garbage collecting, since it
2354         doesn't matter in that case.
2355         (deliver_profiler_signal): Rename from sigprof_handler,
2356         for consistency with other handlers.
2357         (setup_cpu_timer): New function, with much of what used to be in
2358         Fprofiler_cpu_start.  Check for out-of-range argument.
2359         Prefer timer_settime if available, and prefer
2360         thread cputime clocks, then process cputime clocks, then
2361         monotonic clocks, to the old realtime clock.  Use make_timeval
2362         to round more-correctly when falling back to setitimer.
2363         (Fprofiler_cpu_start): Use it.
2364         (Fprofiler_cpu_stop): Prefer timer_settime if available.
2365         Don't assume that passing NULL as the 2nd argument of setitimer
2366         is the same as passing a pointer to all-zero storage.
2367         Ignore SIGPROF afterwards.
2368         (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
2369         * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
2370         non-fatal signal handlers.  Ignore SIGPROF on startup.
2371         * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
2372         in profiler.c, since sysdep.c now uses it.
2374         * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
2375         Suggested by Eli Zaretskii in
2376         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
2378 2012-09-29  Juanma Barranquero  <lekktu@gmail.com>
2380         * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2382 2012-09-29  Stefan Monnier  <monnier@iro.umontreal.ca>
2384         * lisp.h (struct backtrace): Remove indirection for `function' field.
2385         * xdisp.c (redisplay_internal):
2386         * profiler.c (record_backtrace, sigprof_handler_1):
2387         * alloc.c (Fgarbage_collect):
2388         * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
2389         (Fbacktrace_frame): Adjust accordingly.
2391 2012-09-28  Glenn Morris  <rgm@gnu.org>
2393         * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
2394         (Frun_hook_with_args_until_failure): Doc fixes.
2396 2012-09-28  Eli Zaretskii  <eliz@gnu.org>
2398         * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
2399         Qautomatic_redisplay and change the symbol name.  All users changed.
2401 2012-09-28  Tomohiro Matsuyama  <tomo@cx4a.org>
2403         * profiler.c (sigprof_handler): Fix race condition.
2405 2012-09-28  Glenn Morris  <rgm@gnu.org>
2407         * lread.c (lisp_file_lexically_bound_p): Handle #! lines.  (Bug#12528)
2409 2012-09-27  Paul Eggert  <eggert@cs.ucla.edu>
2411         Check more robustly for timer_settime.
2412         * Makefile.in (LIB_TIMER_TIME): New macro.
2413         (LIBES): Add it.
2414         * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
2415         Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
2416         call timer_settime.
2418 2012-09-26  Tomohiro Matsuyama  <tomo@cx4a.org>
2420         * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
2422 2012-09-26  Juanma Barranquero  <lekktu@gmail.com>
2424         * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2426 2012-09-26  Paul Eggert  <eggert@cs.ucla.edu>
2428         * character.h (MAYBE_UNIFY_CHAR): Remove.
2429         * charset.c, charset.h (maybe_unify_char): Now static.
2430         * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
2431         Since this stuff is now private to charset.c, there's no need for
2432         a public macro and no need to inline by hand.
2434 2012-09-26  Tomohiro Matsuyama  <tomo@cx4a.org>
2435             Stefan Monnier  <monnier@iro.umontreal.ca>
2436             Juanma Barranquero  <lekktu@gmail.com>
2438         * profiler.c: New file.
2439         * Makefile.in (base_obj): Add profiler.o.
2440         * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
2441         ($(BLD)/profiler.$(O)): New target.
2442         * emacs.c (main): Call syms_of_profiler.
2443         * alloc.c (Qautomatic_gc): New constant.
2444         (MALLOC_PROBE): New macro.
2445         (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
2446         (total_bytes_of_live_objects): New function.
2447         (Fgarbage_collect): Use it.  Record itself in backtrace_list.
2448         Call malloc_probe for the memory profiler.
2449         (syms_of_alloc): Define Qautomatic_gc.
2450         * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
2451         race condition.
2452         (struct backtrace): Move definition...
2453         * lisp.h (struct backtrace): ..here.
2454         (Qautomatic_gc, profiler_memory_running): Declare vars.
2455         (malloc_probe, syms_of_profiler): Declare functions.
2456         * xdisp.c (Qautomatic_redisplay): New constant.
2457         (redisplay_internal): Record itself in backtrace_list.
2458         (syms_of_xdisp): Define Qautomatic_redisplay.
2460 2012-09-25  Eli Zaretskii  <eliz@gnu.org>
2461 2012-09-25  Juanma Barranquero  <lekktu@gmail.com>
2463         * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
2465 2012-09-25  Paul Eggert  <eggert@cs.ucla.edu>
2467         Prefer POSIX timers if available.
2468         They avoid a race if the timer is too close to the current time.
2469         * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
2470         (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
2471         (init_atimer) [SIGEV_SIGNAL]: Initialize them.
2473 2012-09-25  Eli Zaretskii  <eliz@gnu.org>
2475         * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
2476         CHAR_STRING_ADVANCE.
2477         (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
2478         STRING_CHAR_ADVANCE.
2480 2012-09-25  Juanma Barranquero  <lekktu@gmail.com>
2482         Move Vlibrary_cache to emacs.c and reset before dumping.
2484         * lisp.h (reset_image_types): Declare.
2485         [WINDOWSNT] (Vlibrary_cache): Declare.
2487         * image.c (reset_image_types): New function.
2489         * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
2490         (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
2491         (Fdump_emacs): Reset Vlibrary_cache and image_types.
2493         * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
2494         (globals_of_w32) <Vlibrary_cache>: Do not initialize.
2496         * w32.h (Vlibrary_cache): Do not declare.
2498 2012-09-25  Eli Zaretskii  <eliz@gnu.org>
2500         * w32proc.c (sys_signal): Handle all signals defined by the
2501         MS-Windows runtime, not just SIGCHLD.  Actually install the signal
2502         handlers for signals supported by Windows.  Don't override
2503         term_ntproc as the handler for SIGABRT.
2504         (sigaction): Rewrite to call sys_signal instead of duplicating its
2505         code.
2506         (sys_kill): Improve commentary.
2508         * w32.c (term_ntproc): Accept (and ignore) one argument, for
2509         consistency with a signature of a signal handler.  All callers
2510         changed.
2511         (init_ntproc): Accept an argument DUMPING.  If dumping, don't
2512         install term_ntproc as a signal handler for SIGABRT, as that
2513         should be done by the dumped Emacs.
2515         * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
2517         * w32select.c (term_w32select): Protect against repeated
2518         invocation by setting clipboard_owner to NULL after calling
2519         DestroyWindow.
2521         * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
2522         and term_ntproc to their modified signatures.
2524         * character.c (char_string, string_char): Remove calls to
2525         MAYBE_UNIFY_CHAR.  See the discussion starting at
2526         http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
2527         for the details.
2529 2012-09-25  Chong Yidong  <cyd@gnu.org>
2531         * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
2533 2012-09-24  Stefan Monnier  <monnier@iro.umontreal.ca>
2535         * bytecode.c (exec_byte_code): Signal an error instead of aborting,
2536         when encountering an unknown bytecode.
2538 2012-09-24  Paul Eggert  <eggert@cs.ucla.edu>
2540         image.c, indent.c: Use bool for booleans.
2541         * dispextern.h (struct image_type): Members valid_p, load, init
2542         now return bool, not int.  All uses changed.
2543         * image.c: Omit unnecessary static decls.
2544         (x_create_bitmap_mask, x_build_heuristic_mask):
2545         Return void, not int, since callers don't care about the return value.
2546         (x_create_bitmap_mask, define_image_type, valid_image_p)
2547         (struct image_keyword, parse_image_spec, image_spec_value)
2548         (check_image_size, image_background)
2549         (image_background_transparent, x_clear_image_1)
2550         (postprocess_image, lookup_image, x_check_image_size)
2551         (x_create_x_image_and_pixmap, xbm_image_p)
2552         (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
2553         (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
2554         (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
2555         (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
2556         (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
2557         (png_image_p, init_png_functions, png_load_body, png_load)
2558         (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
2559         (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
2560         (init_gif_functions, gif_load, imagemagick_image_p)
2561         (imagemagick_load_image, imagemagick_load, svg_image_p)
2562         (init_svg_functions, svg_load, svg_load_image, gs_image_p)
2563         (gs_load):
2564         * nsimage.m (ns_load_image):
2565         * nsterm.m (ns_defined_color):
2566         * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
2567         * xfns.c (x_defined_color):
2568         * xterm.c (x_alloc_lighter_color_for_widget)
2569         (x_alloc_nearest_color_1, x_alloc_nearest_color)
2570         (x_alloc_lighter_color):
2571         * indent.c (disptab_matches_widthtab, current_column)
2572         (scan_for_column, string_display_width, indented_beyond_p)
2573         (compute_motion, vmotion, Fvertical_motion):
2574         Use bool for booleans.
2576 2012-09-24  Chong Yidong  <cyd@gnu.org>
2578         * chartab.c (Fset_char_table_default): Obsolete function removed.
2580 2012-09-23  Paul Eggert  <eggert@cs.ucla.edu>
2582         Move pid_t related decls out of lisp.h.
2583         * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
2584         (interruptible_wait_for_termination):
2585         Move these decls from lisp.h to syswait.h, since they use pid_t.
2586         Needed on FreeBSD; see Herbert J. Skuhra in
2587         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
2588         * callproc.c: Include syswait.h.
2590         gnutls.c, gtkutil.c: Use bool for boolean.
2591         * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
2592         (emacs_gnutls_handle_error):
2593         * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
2594         (xg_hide_tooltip, xg_create_frame_widgets)
2595         (create_dialog, xg_uses_old_file_dialog)
2596         (xg_get_file_with_chooser, xg_get_file_with_selection)
2597         (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
2598         (xg_item_label_same_p, xg_update_menubar)
2599         (xg_modify_menubar_widgets, xg_event_is_for_menubar)
2600         (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
2601         (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
2602         (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
2603         (update_frame_tool_bar, free_frame_tool_bar):
2604         * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
2605         * nsmenu.m (ns_update_menubar):
2606         * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
2607         * xfns.c (Fx_show_tip) [USE_GTK]:
2608         Use bool for boolean.
2609         * gtkutil.c (xg_update_frame_menubar):
2610         * xmenu.c (update_frame_menubar):
2611         Return void, not int, since caller ignores return value.
2612         * gtkutil.c (xg_change_toolbar_position):
2613         Return void, not 1.
2615 2012-09-23  Juanma Barranquero  <lekktu@gmail.com>
2617         * makefile.w32-in (BLOCKINPUT_H): Remove.
2618         (SYSSIGNAL_H): New macro.
2619         ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
2620         ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
2621         ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
2622         ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
2623         ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
2624         ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
2625         ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
2626         ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
2627         ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
2628         ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
2629         ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
2630         ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
2631         ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
2632         ($(BLD)/w32xfns.$(O)): Update dependencies.
2634 2012-09-23  Eli Zaretskii  <eliz@gnu.org>
2636         * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
2637         fatal_error_backtrace.
2639         * w32proc.c (sys_kill): Undo last change: don't do anything when
2640         invoked to deliver SIGABRT to our own process.  This is now
2641         handled by emacs_raise.
2643 2012-09-23  Juanma Barranquero  <lekktu@gmail.com>
2645         * w32term.c (w32_read_socket): Remove leftover reference to
2646         interrupt_input_pending.
2648 2012-09-23  Paul Eggert  <eggert@cs.ucla.edu>
2650         Do not use SA_NODEFER.
2651         Problem reported by Dani Moncayo in
2652         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
2653         * alloc.c (die):
2654         * sysdep.c (emacs_abort): Do not reset signal handler.
2655         * emacs.c (terminate_due_to_signal): Reset signal handler here.
2656         * sysdep.c (init_signals): Do not use SA_NODEFER.  It wasn't
2657         wanted even on POSIXish hosts, and it doesn't work on Windows.
2659 2012-09-23  Jan Djärv  <jan.h.d@swipnet.se>
2661         * xterm.c (x_term_init): Call fixup_locale before and after calling
2662         gtk_init (Bug#12392).
2664 2012-09-23  Chong Yidong  <cyd@gnu.org>
2666         * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
2667         Vdynamic_library_alist.
2669         * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
2670         (Fgnutls_available_p): Caller changed.
2672         * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
2673         (Flibxml_parse_xml_region): Likewise.
2675         * dispextern.h (struct image_type): Remove arg from init function.
2677         * image.c (Finit_image_library, lookup_image_type)
2678         (define_image_type): Remove now-unneeded second arg.
2679         (init_xpm_functions, init_png_functions, init_jpeg_functions)
2680         (init_tiff_functions, init_gif_functions, init_svg_functions):
2681         Arglist and w32_delayed_load calling convention changed.
2682         (gs_type): Remove init_gs_functions; there is no such function.
2683         (valid_image_p, make_image): Fix caller to lookup_image_type.
2685 2012-09-23  Paul Eggert  <eggert@cs.ucla.edu>
2687         Simplify and avoid signal-handling races (Bug#12471).
2688         * alloc.c (die):
2689         * sysdep.c (emacs_abort) [HAVE_NTGUI]:
2690         Avoid recursive loop if there's a fatal error in the function itself.
2691         * atimer.c (pending_atimers):
2692         * blockinput.h: Don't include "atimer.h"; no longer needed.
2693         (interrupt_input_pending): Remove.  All uses removed.
2694         pending_signals now counts both atimers and ordinary interrupts.
2695         This is less racy than having three separate pending-signal flags.
2696         (block_input, unblock_input, totally_unblock_input, unblock_input_to)
2697         (input_blocked_p):
2698         Rename from their upper-case counterparts BLOCK_INPUT,
2699         UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
2700         INPUT_BLOCKED_P, and turn into functions.  All uses changed.
2701         This makes it easier to access volatile variables more accurately.
2702         (BLOCK_INPUT_RESIGNAL): Remove.  All uses replaced by unblock_input ().
2703         (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
2704         that's more reliable if the code is buggy and sets
2705         interrupt_input_blocked to a negative value.  All uses changed.
2706         * atimer.c (deliver_alarm_signal):
2707         Remove.  No need to deliver this to the parent; any thread can
2708         handle this signal now.  All uses replaced by underlying handler.
2709         * atimer.c (turn_on_atimers):
2710         * dispnew.c (handle_window_change_signal):
2711         * emacs.c (handle_danger_signal):
2712         * keyboard.c (kbd_buffer_get_event):
2713         Don't reestablish signal handler; not needed with sigaction.
2714         * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
2715         (UNBLOCK_INPUT_TO):
2716         Rework to avoid unnecessary accesses to volatile variables.
2717         (UNBLOCK_INPUT_TO): Now a function.
2718         (totally_unblock_input, unblock_input): New decls.
2719         * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
2720         (init_data): Remove.  Necessary stuff now done in init_signal.
2721         * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
2722         * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
2723         (fatal_error_code): Remove; no longer needed.
2724         (terminate_due_to_signal): Rename from fatal_error_backtrace, since
2725         it doesn't always backtrace.  All uses changed.  No need to reset
2726         signal to default, since sigaction and/or die does that for us now.
2727         Use emacs_raise (FOO), not kill (getpid (), FOO).
2728         (main): Check more-accurately whether we're dumping.
2729         Move fatal-error setup to sysdep.c
2730         * floatfns.c: Do not include "syssignal.h"; no longer needed.
2731         * gtkutil.c (xg_get_file_name, xg_get_font):
2732         Remove no-longer-needed signal-mask manipulation.
2733         * keyboard.c, process.c (POLL_FOR_INPUT):
2734         Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
2735         * keyboard.c (read_avail_input): Remove.
2736         All uses replaced by gobble_input.
2737         (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
2738         (kbd_buffer_store_event_hold, gobble_input):
2739         (record_asynch_buffer_change) [USABLE_SIGIO]:
2740         (store_user_signal_events):
2741         No need to mess with signal mask.
2742         (gobble_input): If blocking input and there are terminals, simply
2743         set pending_signals to 1 and return.  All hooks changed to not
2744         worry about whether input is blocked.
2745         (process_pending_signals): Clear pending_signals before processing
2746         them, in case a signal comes in while we're processing.
2747         By convention callers now test pending_signals before calling us.
2748         (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
2749         New functions, to support changes to blockinput.h.
2750         (handle_input_available_signal): Now extern.
2751         (reinvoke_input_signal): Remove.  All uses replaced by
2752         handle_async_input.
2753         (quit_count): Now volatile, since a signal handler uses it.
2754         (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
2755         All callers changed.  Block SIGINT only if not already blocked.
2756         Clear sigmask reliably, even if Fsignal returns, which it can.
2757         Omit unnecessary accesses to volatile var.
2758         (quit_throw_to_read_char): No need to restore sigmask.
2759         * keyboard.c (gobble_input, handle_user_signal):
2760         * process.c (wait_reading_process_output):
2761         Call signal-handling code rather than killing ourselves.
2762         * lisp.h: Include <float.h>, for...
2763         (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
2764         (pending_signals): Now volatile.
2765         (syms_of_data): Now const if IEEE floating point.
2766         (handle_input_available_signal) [USABLE_SIGIO]:
2767         (terminate_due_to_signal, record_child_status_change): New decls.
2768         * process.c (create_process): Avoid disaster if memory is exhausted
2769         while we're processing a vfork, by tightening the critical section
2770         around the vfork.
2771         (send_process_frame, process_sent_to, handle_pipe_signal)
2772         (deliver_pipe_signal): Remove.  No longer needed, as Emacs now
2773         ignores SIGPIPE.
2774         (send_process): No need for setjmp/longjmp any more, since the
2775         SIGPIPE stuff is now gone.  Instead, report an error if errno
2776         is EPIPE.
2777         (record_child_status_change): Now extern.  PID and W are now args.
2778         Return void, not bool.  All callers changed.
2779         * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
2780         Remove.  All uses removed.  This bug should be fixed now in a
2781         different way.
2782         (wait_for_termination_1): Use waitpid rather than sigsuspend,
2783         and record the child status change directly.  This avoids the
2784         need to futz with the signal mask.
2785         (process_fatal_action): Move here from emacs.c.
2786         (emacs_sigaction_flags): New function, containing
2787         much of what used to be in emacs_sigaction_init.
2788         (emacs_sigaction_init): Use it.  Block nonfatal system signals that are
2789         caught by emacs, to make races less likely.
2790         (deliver_process_signal): Rename from handle_on_main_thread.
2791         All uses changed.
2792         (BACKTRACE_LIMIT_MAX): Now at top level.
2793         (thread_backtrace_buffer, threadback_backtrace_pointers):
2794         New static vars.
2795         (deliver_thread_signal, deliver_fatal_thread_signal):
2796         New functions, for more-accurate delivery of thread-specific signals.
2797         (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
2798         (deliver_arith_signal): Handle in this thread, not
2799         in the main thread, since it's triggered by this thread.
2800         (maybe_fatal_sig): New function.
2801         (init_signals): New arg DUMPING so that we can be more accurate
2802         about whether we're dumping.  Caller changed.
2803         Treat thread-specific signals differently from process-general signals.
2804         Block all signals while handling fatal error; that's safer.
2805         xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
2806         on IEEE hosts.
2807         When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
2808         Ignore SIGPIPE unless batch.
2809         (emacs_backtrace): Output backtrace for the appropriate thread,
2810         which is not necessarily the main thread.
2811         * syssignal.h: Include <stdbool.h>.
2812         (emacs_raise): New macro.
2813         * xterm.c (x_connection_signal): Remove; no longer needed
2814         now that we use sigaction.
2815         (x_connection_closed): No need to mess with sigmask now.
2816         (x_initialize): No need to reset SIGPIPE handler here, since
2817         init_signals does this for us now.
2819 2012-09-23  Jan Djärv  <jan.h.d@swipnet.se>
2821         * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
2822         background rect may be larger (Bug#12245).
2824 2012-09-23  Chong Yidong  <cyd@gnu.org>
2826         * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
2828 2012-09-22  Paul Eggert  <eggert@cs.ucla.edu>
2830         * .gdbinit: Just stop at fatal_error_backtrace.
2831         See Stefan Monnier's request in
2832         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
2833         Remove no-longer-used query of system type.
2835 2012-09-22  Chong Yidong  <cyd@gnu.org>
2837         * search.c (Freplace_match): Doc fix (Bug#12325).
2839         * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
2841         * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
2842         (Fline_end_position): Doc fix.
2844         * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
2846 2012-09-22  Chong Yidong  <cyd@gnu.org>
2848         * dispextern.h (struct image_type): Add new slot, storing a type
2849         initialization function.
2851         * image.c (define_image_type): Call the image initializer function
2852         if it is defined.  Arguments and return value changed.
2853         (valid_image_p, make_image): Callers changed.
2854         (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
2855         (gif_type, imagemagick_type, svg_type, gs_type):
2856         Add initialization functions.
2857         (Finit_image_library): Call lookup_image_type.
2858         (CHECK_LIB_AVAILABLE): Macro deleted.
2859         (lookup_image_type): Call define_image_type here, rather than via
2860         Finit_image_library, and without using CHECK_LIB_AVAILABLE.
2861         (syms_of_image): Move define_image_type calls for xbm_type and
2862         pbm_type to lookup_image_type.
2864 2012-09-22  Eli Zaretskii  <eliz@gnu.org>
2866         * keyboard.c (timer_check_2): Move calculation of 'timers' and
2867         'idle_timers' from here ...
2868         (timer_check): ... to here.  Use Fcopy_sequence to copy the timer
2869         lists, to avoid infloops when the timer does something stupid,
2870         like reinvoke itself with the same or smaller time-out.
2871         (Bug#12447)
2873 2012-09-22  Martin Rudalics  <rudalics@gmx.at>
2875         * window.c (Fsplit_window_internal): Handle only Qt value of
2876         Vwindow_combination_limit separately.
2877         (Qtemp_buffer_resize): New symbol.
2878         (Vwindow_combination_limit): New default value.
2879         Rewrite doc-string.
2881 2012-09-22  Eli Zaretskii  <eliz@gnu.org>
2883         * xdisp.c (next_overlay_string): Initialize it->end_charpos for
2884         the new overlay string.  (Bug#10159)
2886 2012-09-22  Paul Eggert  <eggert@cs.ucla.edu>
2888         * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
2889         or that fprintf is async-signal-safe.  POSIX doesn't require
2890         either assumption.
2892 2012-09-22  Chong Yidong  <cyd@gnu.org>
2894         * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
2895         (Bug#8207).
2897 2012-09-22  Kenichi Handa  <handa@gnu.org>
2899         * composite.c (composition_reseat_it): Handle the case that a
2900         grapheme cluster is not covered by a single font (Bug#12352).
2902 2012-09-21  Chong Yidong  <cyd@gnu.org>
2904         * image.c (define_image_type): Avoid adding duplicate types to
2905         image_types (Bug#12463).  Suggested by Jörg Walter.
2907 2012-09-21  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
2909         * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
2910         (print_load_command_name): Add case LC_DATA_IN_CODE.
2911         (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
2913 2012-09-21  Glenn Morris  <rgm@gnu.org>
2915         * eval.c (Frun_hook_with_args_until_success)
2916         (Frun_hook_with_args_until_failure): Doc fixes.  (Bug#12393)
2918 2012-09-21  Andreas Schwab  <schwab@linux-m68k.org>
2920         * fileio.c (Ffile_selinux_context): Only call freecon when
2921         lgetfilecon succeeded.
2922         (Fset_file_selinux_context): Likewise.  (Bug#12444)
2924 2012-09-21  Eli Zaretskii  <eliz@gnu.org>
2926         * xdisp.c (try_window_reusing_current_matrix): Under bidi
2927         reordering, locate the cursor by calling set_cursor_from_row; if
2928         that fails, clear the desired glyph matrix before returning a
2929         failure indication to the caller.  Fixes leaving garbled display
2930         when fast scrolling with a down-key.  (Bug#12403)
2931         (compute_stop_pos_backwards): Fix a typo that caused crashes while
2932         scrolling through multibyte text.
2934 2012-09-20  Stefan Monnier  <monnier@iro.umontreal.ca>
2936         * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
2937         calling mark_vectorlike since that's the one that marks the window.
2938         (mark_discard_killed_buffers): Mark the final cdr.
2939         * window.h (struct window): Move prev/next_buffers to the
2940         non-standard fields.
2941         * window.c (make_window): Initialize prev/next_buffers manually.
2943 2012-09-20  Paul Eggert  <eggert@cs.ucla.edu>
2945         Omit unused arg EXPECTED from socket hooks.
2946         * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
2947         * nsterm.m (ns_term_init):
2948         * termhooks.h (struct terminal.read_socket_hook):
2949         * w32inevt.c (w32_console_read_socket):
2950         * w32term.c (w32_read_socket):
2951         * xterm.c (XTread_socket):
2952         Omit unused arg EXPECTED.  All callers changed.
2953         (store_user_signal_events): Return void, not int, since callers no
2954         longer care about the return value.  All uses changed.
2956 2012-09-20  Juanma Barranquero  <lekktu@gmail.com>
2958         * w32gui.h (XParseGeometry): Do not declare.
2960 2012-09-19  Paul Eggert  <eggert@cs.ucla.edu>
2962         * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
2963         Ignore 'expected'.  See Eli Zaretskii in
2964         <http://bugs.gnu.org/12471#8> (last line).
2966         * frame.c (read_integer): Remove.  All uses replaced by strtol/strtoul.
2967         (XParseGeometry): Now static.  Substitute extremal values for
2968         values that are out of range.
2970 2012-09-19  Jan Djärv  <jan.h.d@swipnet.se>
2972         * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
2974         * nsfns.m (XParseGeometry): Remove.
2975         (Fx_create_frame): Call x_set_offset to correctly interpret
2976         top_pos in geometry.
2978         * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
2979         (Fx_parse_geometry): If there is a space in string, call
2980         Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
2982 2012-09-17  Eli Zaretskii  <eliz@gnu.org>
2984         * search.c (scan_buffer): Use character positions in calls to
2985         region_cache_forward and region_cache_backward, not byte
2986         positions.  (Bug#12196)
2988         * w32term.c (w32_read_socket): Set pending_signals to 1, like
2989         xterm.c does.  Reported by Daniel Colascione <dancol@dancol.org>.
2991         * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
2992         __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
2993         emacs_blocked_malloc, now deleted.
2995 2012-09-17  Paul Eggert  <eggert@cs.ucla.edu>
2997         Remove no-longer-needed Solaris 2.4 vfork bug workaround.
2998         The workaround was for improving performance on Solaris 2.4, but
2999         is getting in the way now.  Emacs will still work if someone is
3000         still running Solaris 2.4 in a museum somewhere; Sun dropped
3001         support for Solaris 2.4 in 2003.
3002         * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
3003         * process.c (create_process) [HAVE_WORKING_VFORK]:
3004         Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
3005         since Emacs no longer uses vfork on that platform.
3007 2012-09-17  Glenn Morris  <rgm@gnu.org>
3009         * emacs.c: Use COPYRIGHT.
3011 2012-09-16  Paul Eggert  <eggert@cs.ucla.edu>
3013         Remove configure's --without-sync-input option (Bug#12450).
3014         When auditing signal-handling in preparation for cleaning it up,
3015         I found that SYNC_INPUT has race conditions and would be a real
3016         pain to fix.  Since it's an undocumented and deprecated
3017         configure-time option, now seems like a good time to remove it.
3018         Also see <http://bugs.gnu.org/11080#16>.
3019         * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
3020         (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
3021         (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
3022         (malloc_hysteresis):
3023         (check_depth) [XMALLOC_OVERRUN_CHECK]:
3024         (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
3025         (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
3026         (dont_register_blocks, bytes_used_when_reconsidered)
3027         (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
3028         (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
3029         [!SYSTEM_MALLOC && !SYNC_INPUT]:
3030         Remove.  All uses removed.
3031         (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
3032         implementation, one that depends on whether the new macro
3033         XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
3034         is defined.
3035         * atimer.c (run_timers, handle_alarm_signal):
3036         * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
3037         (handle_async_input, process_pending_signals)
3038         (handle_input_available_signal, init_keyboard):
3039         * nsterm.m (ns_read_socket):
3040         * process.c (wait_reading_process_output):
3041         * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
3042         * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
3043         (emacs_write):
3044         * xterm.c (XTread_socket):
3045         Assume SYNC_INPUT.
3046         * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
3047         * eval.c (handling_signal): Remove.  All uses removed.
3048         * lisp.h (ELSE_PENDING_SIGNALS): Remove.
3049         All uses replaced with the SYNC_INPUT version.
3050         (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
3051         Remove decls.
3052         * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3053         Now static.
3055         * font.c (Ffont_shape_gstring): Remove unused local.
3057 2012-09-16  Glenn Morris  <rgm@gnu.org>
3059         * Makefile.in (clean): No longer run nextstep's clean.
3061         * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
3062         (ns_frag): Remove.
3063         (ns-app): Move here from ns.mk, and simplify.
3064         (clean): Simplify nextstep entry.
3065         * ns.mk: Remove file.
3067 2012-09-17  Kenichi Handa  <handa@gnu.org>
3069         * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
3070         not covert the last few charactes.
3072 2012-09-16  Kenichi Handa  <handa@gnu.org>
3074         * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
3075         here, but just check the validity of glyphs in the glyph-string.
3077 2012-09-16  Martin Rudalics  <rudalics@gmx.at>
3079         * window.c (Fwindow_parameter, Fset_window_parameter):
3080         Accept any window as argument (Bug#12452).
3082 2012-09-16  Jan Djärv  <jan.h.d@swipnet.se>
3084         * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
3085         to ns_term_init to avoid memory leak.
3087         * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
3088         explicit retain/release.
3089         (ns_term_init): Only allow one display.  Initialize outerpool and
3090         ns_*_types.
3092 2012-09-15  Paul Eggert  <eggert@cs.ucla.edu>
3094         Port _setjmp fix to POSIXish hosts as well as Microsoft.
3095         * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
3096         it's needed on POSIXish hosts that lack _setjmp.  Attempt to solve
3097         the Microsoft problem in a different way, by altering ../nt/config.nt.
3099 2012-09-15  Eli Zaretskii  <eliz@gnu.org>
3101         * w32xfns.c:
3102         * w32uniscribe.c:
3103         * w32term.c:
3104         * w32select.c:
3105         * w32reg.c:
3106         * w32proc.c:
3107         * w32menu.c:
3108         * w32inevt.c:
3109         * w32heap.c:
3110         * w32font.c:
3111         * w32fns.c:
3112         * w32console.c:
3113         * w32.c:
3114         * w16select.c: Remove inclusion of setjmp.h, as it is now included
3115         by lisp.h.  This completes removal of setjmp.h inclusion
3116         erroneously announced in the previous commit.  (Bug#12446)
3118         * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
3119         more accurate.
3121         * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
3122         not defined as a macro.  The latter happens on MS-Windows.
3123         (Bug#12446)
3125 2012-09-15  Paul Eggert  <eggert@cs.ucla.edu>
3127         Port better to POSIX hosts lacking _setjmp (Bug#12446).
3128         * lisp.h: Include <setjmp.h> here, since we use its symbols here.
3129         Some instances of '#include <setjmp.h>' removed, if the
3130         only reason for the instance was because "lisp.h" was included.
3131         (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
3132         Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
3133         and _longjmp with the new symbols.  Emacs already uses _setjmp if
3134         available, so this change affects only POSIXish hosts that have
3135         sigsetjmp but not _setjmp, such as some versions of Solaris and
3136         Unixware.  (Also, POSIX-2008 marks _setjmp as obsolescent.)
3137         * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
3138         (png_load_body) [HAVE_PNG]:
3139         (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
3140         (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
3141         Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
3142         since PNG requires jmp_buf.  This is the only exception to the
3143         general rule that we now use sys_setjmp and sys_longjmp.
3144         This exception is OK since this code does not change the signal
3145         mask or longjmp out of a signal handler.
3147 2012-09-14  Paul Eggert  <eggert@cs.ucla.edu>
3149         * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
3150         Include "syssignal.h", for 'main_thread'.
3152 2012-09-14  Dmitry Antipov  <dmantipov@yandex.ru>
3154         Avoid out-of-range marker position (Bug#12426).
3155         * insdel.c (replace_range, replace_range_2):
3156         Adjust markers before overlays, as suggested by comments.
3157         (insert_1_both, insert_from_buffer_1, adjust_after_replace):
3158         Remove redundant check before calling offset_intervals.
3160 2012-09-14  Martin Rudalics  <rudalics@gmx.at>
3162         * xdisp.c (Fformat_mode_line): Unconditionally save/restore
3163         current buffer (Bug#12387).
3165 2012-09-14  Juanma Barranquero  <lekktu@gmail.com>
3167         * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
3169 2012-09-13  Paul Eggert  <eggert@cs.ucla.edu>
3171         Use a more backwards-compatible timer format (Bug#12430).
3172         * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
3173         vector element, not from the 4th, since PSECS is now at the end.
3174         (Fcurrent_idle_time): Doc fix.
3176 2012-09-13  Dmitry Antipov  <dmantipov@yandex.ru>
3178         Function to mark objects and remove killed buffers at once.
3179         * alloc.c (discard_killed_buffers): Rename to ...
3180         (mark_discard_killed buffers) ... new name.  Add marking
3181         of remaining objects.  Fix comment.  Adjust users.
3182         (mark_object): Do not touch frame buffer lists here.
3183         * frame.c (delete_frame): Reset frame buffer lists here.
3185 2012-09-13  Paul Eggert  <eggert@cs.ucla.edu>
3187         Better workaround for GNOME bug when --enable-gcc-warnings.
3188         * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
3189         Instead, disable -Wunused-local-typedefs.  See Dmitry Antipov in
3190         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
3192         Simplify SIGIO usage (Bug#12408).
3193         The code that dealt with SIGIO was crufty and confusing, e.g., it
3194         played tricks like "#undef SIGIO" but these tricks were not used
3195         consistently.  Simplify mostly by not #undeffing standard symbols,
3196         e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
3197         or not as we please) rather than "defined SIGIO" (standard symbol
3198         that we probably shouldn't #undef).
3199         * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
3200         Modules that need it can include it.
3201         [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
3202         * dispextern.h (ignore_sigio): New decl.
3203         * emacs.c (shut_down_emacs): Invoke unrequest_sigio
3204         unconditionally, since it's now a no-op if !USABLE_SIGIO.
3205         * emacs.c (shut_down_emacs):
3206         * keyboard.c (kbd_buffer_store_event_hold):
3207         Use ignore_sigio rather than invoking 'signal' directly.
3208         * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
3209         for FIONREAD.
3210         (FIONREAD, SIGIO): Do not #undef.
3211         (tty_read_avail_input): Use #error rather than a syntax error.
3212         * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
3213         for I_PIPE, used by SETUP_SLAVE_PTY.
3214         (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
3215         * sysdep.c (croak): Remove; no longer needed.  This bit of
3216         temporary code, with Fred N. Fish's comment that it's temporary,
3217         has been in Emacs since at least 1992!
3218         (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
3219         Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
3220         * syssignal.h (croak): Remove decl.
3221         (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
3222         * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
3223         now that we're termios-only.
3224         (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
3225         * term.c (dissociate_if_controlling_tty): Use #error rather than
3226         a run-time error.
3228         Work around GCC and GNOME bugs when --enable-gcc-warnings.
3229         * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
3230         to work around GNOME bug 683906.
3231         * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
3232         (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
3233         This works around GCC bug 54561.
3235 2012-09-12  Paul Eggert  <eggert@cs.ucla.edu>
3237         More fixes for 'volatile' and setjmp/longjmp.
3238         * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
3239         * image.c (struct png_load_context) [HAVE_PNG]: New type.
3240         (png_load_body) [HAVE_PNG]:
3241         (jpeg_load_body) [HAVE_JPEG]:
3242         New function, with most of the old parent function's body.
3243         (png_load) [HAVE_PNG]:
3244         (jpeg_load) [HAVE_JPEG]:
3245         Invoke the new function, to avoid longjmp munging our locals.
3246         (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
3247         (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
3248         longjmp is passed 2, as the C standard doesn't guarantee this.
3249         Instead, store the failure code into mgr->failure_code.
3251 2012-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
3253         * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
3254         (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
3255         (syms_of_keyboard): Remove support for unread-command-char.
3257 2012-09-12  Eli Zaretskii  <eliz@gnu.org>
3259         * w32proc.c (sys_kill): If PID is our process ID and the signal is
3260         SIGABRT, call emacs_abort.  Avoids silently exiting upon assertion
3261         violation.  (Bug#12426)
3263 2012-09-12  Paul Eggert  <eggert@cs.ucla.edu>
3265         * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
3267 2012-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
3269         * eval.c: Add `inhibit-debugger'.
3270         (Qinhibit_debugger): New symbol.
3271         (call_debugger): Bind it instead of Qdebug_on_error.
3272         (maybe_call_debugger): Test Vinhibit_debugger.
3273         (syms_of_eval): Define inhibit-debugger.
3274         * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
3275         (syms_of_xdisp): Remove inhibit-debug-on-message.
3277 2012-09-11  Paul Eggert  <eggert@cs.ucla.edu>
3279         Avoid _setjmp/_longjmp problems with local nonvolatile variables.
3280         If a nonvolatile local variable is written before a _longjmp to
3281         the frame containing the variable, and is read after the _longjmp,
3282         the value read is indeterminate.  Some local variables of type
3283         'struct handler' and 'struct catchtag' are used in this way, so
3284         mark each of their slots as volatile if the slot can be set before
3285         _longjmp and read afterwards.
3286         * lisp.h (struct handler): var and chosen_clause are now volatile.
3287         (struct catchtag): val, next, and pdlcount are now volatile.
3289         * bidi.c (bidi_push_it, bidi_pop_it):
3290         * fns.c (copy_hash_table):
3291         * image.c (define_image_type):
3292         * keyboard.c (kbd_buffer_store_event_hold):
3293         * process.c (Fprocess_send_eof):
3294         * xfaces.c (x_create_gc) [HAVE_NS]:
3295         * xgselect.c (xg_select):
3296         Prefer assignment to memcpy when either will do.
3298         * alloc.c (discard_killed_buffers): Tune and simplify a bit.
3299         Use pointer-to-a-pointer to simplify and avoid a NILP check each
3300         time an item is removed.  No need to mark this function 'inline';
3301         the compiler knows better than we do.
3303 2012-09-11  Jan Djärv  <jan.h.d@swipnet.se>
3305         * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
3306         (updateFrameSize:): Add delay parameter to updateFrameSize, send it
3307         to change_frame_size (Bug#12388).
3308         (windowDidResize:): Pass YES to updateFrameSize.
3310         * nsterm.h: Add delay parameter to updateFrameSize.
3312 2012-09-11  Dmitry Antipov  <dmantipov@yandex.ru>
3314         Discard killed buffers from deleted window and frame objects.
3315         This reduces an amount of references to killed buffers and
3316         helps GC to reclaim them faster.
3317         * alloc.c (discard_killed_buffers): New function.
3318         (mark_object): Use it for deleted windows and frames.
3319         (mark_object): If symbol's value is set up for a killed buffer
3320         or deleted frame, restore its global binding.
3321         * data.c (swap_in_global_binding): Add GC notice.
3322         (swap_in_symval_forwarding): Use convenient set_blv_where.
3323         * window.c (wset_next_buffers, wset_prev_buffers): Move ...
3324         * window.h: ... to here.
3326 2012-09-11  Dmitry Antipov  <dmantipov@yandex.ru>
3328         Convenient macro to check whether the buffer is live.
3329         * buffer.h (BUFFER_LIVE_P): New macro.
3330         * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
3331         * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
3333 2012-09-11  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
3335         * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
3336         composition cases (Bug#12364).
3338         * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
3339         overhang of succeeding glyphs overlapping box cursor.
3341         * w32term.c (x_draw_glyph_string): Likewise.
3343 2012-09-11  Paul Eggert  <eggert@cs.ucla.edu>
3345         Simplify, document, and port floating-point (Bug#12381).
3346         The porting part of this patch fixes bugs on non-IEEE platforms
3347         with frexp, ldexp, logb.
3348         * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
3349         Now static.
3350         * floatfns.c: Simplify discussion of functions that Emacs doesn't
3351         support, by removing commented-out code and briefly listing the
3352         C89 functions excluded.  The commented-out stuff was confusing
3353         maintenance, e.g., we thought we needed cbrt but it was commented out.
3354         (logb): Remove decl; no longer needed.
3355         (isfinite): New macro, if not already supplied.
3356         (isnan): Don't replace any existing macro.
3357         (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
3358         are present on all C89 platforms.
3359         (Ffrexp): Do not special-case zero, as frexp does the right thing
3360         for that case.
3361         (Flogb): Do not use logb, as it doesn't have the desired meaning
3362         on hosts that use non-base-2 floating point.  Instead, stick with
3363         frexp, which is C89 anyway.  Do not pass an infinity or a NaN to
3364         frexp, to avoid getting an unspecified result.
3366         * xdisp.c (Qinhibit_debug_on_message): Now static.
3368 2012-09-10  Jan Djärv  <jan.h.d@swipnet.se>
3370         * nsterm.m (ns_update_begin): Set clip path to whole view by using
3371         NSBezierPath (Bug#12131).
3373 2012-09-10  Chong Yidong  <cyd@gnu.org>
3375         * fns.c (Fdelq, Fdelete): Doc fix.
3377 2012-09-10  Paul Eggert  <eggert@cs.ucla.edu>
3379         * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
3380         (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
3382 2012-09-09  Stefan Monnier  <monnier@iro.umontreal.ca>
3384         * lisp.h (make_lisp_ptr): New macro to replace XSET.
3385         (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
3386         Use it.
3388 2012-09-09  Eli Zaretskii  <eliz@gnu.org>
3390         * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
3391         left fringe if the window has a left margin.  This avoids leaving
3392         traces of the cursor because its leftmost pixel is not drawn over.
3394         * dispnew.c (update_window_line): When the left margin area of a
3395         screen line is updated, set the redraw_fringe_bitmaps_p flag of
3396         that screen line.  (Bug#12277)
3398 2012-09-09  Paul Eggert  <eggert@cs.ucla.edu>
3400         Assume C89 or later for math functions (Bug#12381).
3401         This simplifies the code, and makes it a bit smaller and faster,
3402         and (most important) makes it easier to clean up signal handling
3403         since we can stop worring about floating-point exceptions in
3404         library code.  That was a problem before C89, but the problem
3405         went away many years ago on all practical Emacs targets.
3406         * data.c, image.c, lread.c, print.c:
3407         Don't include <math.h>; no longer needed.
3408         * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
3409         might be autoconfigured, as that never happens.
3410         * data.c (fmod):
3411         * doprnt.c (DBL_MAX_10_EXP):
3412         * print.c (DBL_DIG):
3413         Remove.  C89 or later always defines these.
3414         * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
3415         (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
3416         (arith_error, domain_error, domain_error2):
3417         Remove all this pre-C89 cruft.  Do not include <errno.h> as that's
3418         no longer needed -- we simply return what C returns.  All uses removed.
3419         (IN_FLOAT, IN_FLOAT2): Remove.  All uses replaced with
3420         the wrapped code.
3421         (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
3422         Remove.  All uses expanded, as these macros are no longer used
3423         more than once and are now more trouble than they're worth.
3424         (Ftan): Use tan, not sin / cos.
3425         (Flogb): Assume C89 frexp.
3426         (fmod_float): Assume C89 fmod.
3427         (matherr) [HAVE_MATHERR]: Remove; no longer needed.
3428         (init_floatfns): Remove.  All uses removed.
3430 2012-09-08  Jan Djärv  <jan.h.d@swipnet.se>
3432         * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
3433         compositeToPoint for OSX < 10.6 (Bug#12390).
3435 2012-09-08  Paul Eggert  <eggert@cs.ucla.edu>
3437         * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
3438         This produces more-accurate results.
3440 2012-09-08  Jan Djärv  <jan.h.d@swipnet.se>
3442         * nsterm.m (updateFrameSize): Call setFrame: on the view when size
3443         changes (Bug#12088).
3445 2012-09-08  Chong Yidong  <cyd@gnu.org>
3447         * syntax.c (Fstring_to_syntax): Doc fix.
3449 2012-09-08  Jan Djärv  <jan.h.d@swipnet.se>
3451         * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
3452         in the internal border.
3453         (x_set_window_size): Remove static variables and their usage.
3454         (ns_redraw_scroll_bars): Fix NSTRACE arg.
3455         (ns_after_update_window_line, ns_draw_fringe_bitmap):
3456         Remove fringe/internal border adjustment (Bug#11052).
3457         (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
3458         (ns_draw_window_cursor): Remove fringe/internal border adjustment.
3459         (ns_fix_rect_ibw): Remove.
3460         (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
3461         (ns_dumpglyphs_box_or_relief): Ditto.
3462         (ns_maybe_dumpglyphs_background): Remove fringe/internal border
3463         adjustment.
3464         (ns_dumpglyphs_image): Ditto.
3465         (ns_dumpglyphs_stretch): Fix coding style.  Remove fringe/internal
3466         border adjustment.
3467         (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
3468         their usage.  Add fringe_extended_p and its use as in other terms.
3469         (ns_judge_scroll_bars): Code style fix.  Call updateFrameSize if
3470         scroll bar was removed.
3471         (updateFrameSize): New function.
3472         (windowDidResize): Move code to updateFrameSize and call it.
3474         * nsterm.h (EmacsView): Add updateFrameSize.
3476 2012-09-07  Chong Yidong  <cyd@gnu.org>
3478         * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
3480         * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
3482 2012-09-07  Paul Eggert  <eggert@cs.ucla.edu>
3484         More signal-handler cleanup (Bug#12327).
3485         * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
3486         Problem introduced when merging patches.  Noted by Eli Zaretskii in
3487         <http://bugs.gnu.org/12327#67>.
3488         * floatfns.c: Comment fix.
3489         * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
3490         SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
3491         and anyway the declaration is harmless even if SIGDANGER is not defined.
3492         * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
3493         defined BROKEN_FIONREAD).  systty.h formerly did this, but other
3494         source files not surprisingly expected syssignal.h to define, or
3495         not define, SIGIO, and it's cleaner to do it that way, for consistency.
3496         Include <sys/ioctl.h>, for FIONREAD.
3497         * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
3498         This eliminates a problem whereby other files mysteriously had
3499         to include "syssignal.h" before including "systty.h" if they
3500         wanted to use "#ifdef SIGIO".
3502 2012-09-07  Eli Zaretskii  <eliz@gnu.org>
3504         * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
3506         * w32.c (sigemptyset): Empty the set.
3507         (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
3509         * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
3511 2012-09-07  Dmitry Antipov  <dmantipov@yandex.ru>
3513         * alloc.c (mark_buffer): Revert unsafe marking optimization.
3514         (mark_object): Likewise for frame objects.
3516 2012-09-07  Paul Eggert  <eggert@cs.ucla.edu>
3518         * syssignal.h (handle_on_main_thread): Always declare,
3519         even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
3520         This ports to platforms without HAVE_PTHREAD.
3522 2012-09-06  Paul Eggert  <eggert@cs.ucla.edu>
3524         Signal-handler cleanup (Bug#12327).
3525         Emacs's signal handlers were written in the old 4.2BSD style with
3526         sigblock and sigmask and so forth, and this led to some
3527         inefficiencies and confusion.  Rewrite these to use
3528         pthread_sigmask etc. without copying signal sets around.  Also,
3529         get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
3530         'signal', and instead use functions that do not attempt to take
3531         over the system name space.  This patch causes Emacs's text
3532         segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
3533         * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
3534         Do not include <signal.h> or "syssignal.h", as these
3535         modules do not use signals.
3536         * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
3537         * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
3538         Do not include <signal.h>, as "syssignal.h" does that for us now.
3539         * atimer.c (sigmask_atimers): New function.
3540         (block_atimers, unblock_atimers): New functions,
3541         replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
3542         All uses replaced.
3543         * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
3544         no longer needed here.
3545         * emacs.c (main): Inspect existing signal handler with sigaction,
3546         so that there's no need to block and unblock SIGHUP.
3547         * sysdep.c (struct save_signal): New member 'action', replacing
3548         old member 'handler'.
3549         (save_signal_handlers, restore_signal_handlers):
3550         Use sigaction instead of 'signal' to save and restore.
3551         (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
3552         New function.  All users of 'signal' modified to use set_sighandler
3553         if they're writeonly, and to use sys_signal if they're read+write.
3554         (emacs_sigaction_init, forwarded_signal): New functions.
3555         (sys_signal): Remove.  All uses replaced by calls to sigaction
3556         and emacs_sigaction_init, or by direct calls to 'signal'.
3557         (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
3558         (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
3559         all uses replaced by pthread_sigmask etc. calls.
3560         * syssignal.h: Include <signal.h>.
3561         (emacs_sigaction_init, forwarded_signal): New decls.
3562         (SIGMASKTYPE): Remove.  All uses replaced by its definiens, sigset_t.
3563         (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
3564         (sigmask, sys_sigmask): Remove; no longer needed.
3565         (sigpause): Remove.  All uses replaced by its definiens, sigsuspend.
3566         (sigblock, sigunblock, sigfree):
3567         (sigsetmask) [!defined sigsetmask]:
3568         Remove.  All uses replaced by pthread_sigmask.
3569         (signal): Remove.  Its remaining uses (with SIG_DFL and SIG_IGN)
3570         no longer need to be replaced, and its typical old uses
3571         are now done via emacs_sigaction_init and sigaction.
3572         (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
3573         (sys_sigdel): Remove; unused.
3574         (NSIG): Remove a FIXME; the code's fine.  Remove an unnecessary ifdef.
3576 2012-09-06  Eli Zaretskii  <eliz@gnu.org>
3578         * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
3579         SIGCHLD handling on systems that don't have WNOHANG.  (Bug#12327)
3581 2012-09-06  Dmitry Antipov  <dmantipov@yandex.ru>
3583         Explicitly mark buffer_defaults and buffer_local_symbols.
3584         * alloc.c (Fgarbage_collect): Mark buffer_defaults and
3585         mark_local_symbols here.
3586         (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
3587         since special buffers aren't marked here any more.
3588         (allocate_buffer): Chain new buffer with all_buffers here...
3589         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
3590         not here.
3591         (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
3592         (syms_of_buffer): Remove staticpro of the above.
3593         (init_buffer_once): Set names for buffer_defaults and
3594         buffer_local_symbols.
3596 2012-09-06  Paul Eggert  <eggert@cs.ucla.edu>
3598         Use bool for booleans in font-related modules.
3599         * font.c (font_intern_prop, font_style_to_value)
3600         (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
3601         (generate_otf_features, font_check_otf_features, font_check_otf)
3602         (font_match_p, font_list_entities, font_at):
3603         * fontset.c (fontset_id_valid_p, reorder_font_vector
3604         (fontset_find_font, Fset_fontset_font)
3605         (face_suitable_for_char_p) [0]:
3606         * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
3607         (ftfont_open, ftfont_text_extents, ftfont_check_otf):
3608         (m17n_flt_initialized, ftfont_shape_by_flt):
3609         * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
3610         * nsfont.m (nsfont_draw):
3611         * w32font.c (w32font_draw):
3612         * w32term.c (x_draw_glyphless_glyph_string_foreground):
3613         Use bool for booleans.
3614         * font.h: Adjust to above API changes.
3615         (struct font, struct font_driver, struct font_driver_list):
3616         Use bool for booleans.
3617         (struct font): Remove useless member encoding_type.
3618         All users removed.
3619         * fontset.c, xftfont.c: Omit unnecessary static decls.
3621 2012-09-06  Dmitry Antipov  <dmantipov@yandex.ru>
3623         * alloc.c (mark_object): Revert window marking code
3624         since it's unsafe for the Fset_window_configuration.
3626 2012-09-05  Paul Eggert  <eggert@cs.ucla.edu>
3628         Fix race conditions with signal handlers and errno (Bug#12327).
3629         Be more systematic about preserving errno whenever a signal
3630         handler returns, even if it's not in the main thread.  Do this by
3631         renaming signal handlers to distinguish between signal delivery
3632         and signal handling.  All uses changed.
3633         * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
3634         * data.c (deliver_arith_signal): Rename from arith_error.
3635         * dispnew.c (deliver_window_change_signal): Rename from
3636         window_change_signal.
3637         * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
3638         (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
3639         * keyboard.c (deliver_input_available_signal): Rename from
3640         input_available_signal.
3641         (deliver_user_signal): Rename from handle_user_signal.
3642         (deliver_interrupt_signal): Rename from interrupt_signal.
3643         * process.c (deliver_pipe_signal): Rename from send_process_trap.
3644         (deliver_child_signal): Rename from sigchld_handler.
3645         * atimer.c (handle_alarm_signal):
3646         * data.c (handle_arith_signal):
3647         * dispnew.c (handle_window_change_signal):
3648         * emacs.c (handle_fatal_signal, handle_danger_signal):
3649         * keyboard.c (handle_input_available_signal):
3650         * keyboard.c (handle_user_signal, handle_interrupt_signal):
3651         * process.c (handle_pipe_signal, handle_child_signal):
3652         New functions, with the actual signal-handling code taken from the
3653         original respective signal handlers, sans the sporadic attempts to
3654         preserve errno, since that's now done by handle_on_main_thread.
3655         * atimer.c (alarm_signal_handler): Remove unnecessary decl.
3656         * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
3657         * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3658         Move to sysdep.c.
3659         (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3660         Move initialization of main_thread to sysdep.c's init_signals.
3661         * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
3662         our usage, and simplifies the mainline code.
3663         (record_child_status_change): New static function, as a helper
3664         for handle_child_signal, and with most of the old child handler's
3665         contents.
3666         (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
3667         (handle_child_signal): Use the above.
3668         * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3669         Moved here from emacs.c.
3670         (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
3671         code moved here from emacs.c's main function.
3672         * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3673         replacing the old SIGNAL_THREAD_CHECK.  All uses changed.
3674         This lets callers save and restore errno properly.
3676 2012-09-05  Dmitry Antipov  <dmantipov@yandex.ru>
3678         Remove redundant or unused things here and there.
3679         * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
3680         * conf_post.h (RE_TRANSLATE): Use char_table_translate.
3681         * editfns.c (Fcompare_buffer_substrings): Likewise.
3682         * frame.h (struct terminal, struct font_driver_list):
3683         Remove redundant declarations.
3684         * window.h (Qleft, Qright): Likewise.
3686 2012-09-05  Dmitry Antipov  <dmantipov@yandex.ru>
3688         Do not mark objects from deleted buffers, windows and frames.
3689         * alloc.c (mark_buffer): Mark just the buffer if it is dead.
3690         (mark_object): Likewise for windows and frames.
3692 2012-09-05  Dmitry Antipov  <dmantipov@yandex.ru>
3694         * alloc.c (valid_lisp_object_p): Treat killed buffers,
3695         buffer_defaults and buffer_local_symbols as valid objects.
3696         Return special value to denote them.
3698 2012-09-05  Paul Eggert  <eggert@cs.ucla.edu>
3700         * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
3701         * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
3702         (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
3703         (file_name_absolute_p, Fsubstitute_in_file_name):
3704         (check_executable, check_writable, Ffile_accessible_directory_p)
3705         (Fset_file_selinux_context, Fdefault_file_modes)
3706         (Finsert_file_contents, choose_write_coding_system)
3707         (Fwrite_region, build_annotations, a_write, e_write)
3708         (Fdo_auto_save):
3709         * filelock.c (boot_time_initialized, get_boot_time)
3710         (get_boot_time_1, lock_file_1, within_one_second):
3711         * floatfns.c (in_float):
3712         * fns.c (concat, internal_equal, Frequire, base64_encode_1)
3713         (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
3714         (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
3715         * lisp.h (struct Lisp_Hash_Table.cmpfn):
3716         * window.c (compare_window_configurations):
3717         Use bool for booleans.
3718         * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
3719         (Fdefault_file_modes): Now mode_t, not int, for modes.
3720         (Fdo_auto_save): Set a boolean to 1 rather than using ++.
3721         (internal_delete_file): Now returns void, not a (boolean) int,
3722         since nobody was looking at the return value.
3723         * lisp.h, window.h: Adjust to above API changes.
3725         * xdisp.c (set_message): Simplify and reindent last change.
3727 2012-09-05  Juanma Barranquero  <lekktu@gmail.com>
3729         * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
3731 2012-09-04  Lars Ingebrigtsen  <larsi@gnus.org>
3733         * eval.c (call_debugger): Make the function non-static so that we
3734         can call it from set_message.
3736         * xdisp.c (set_message): Implement the new variable `debug-on-message'.
3737         (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
3739 2012-09-04  Paul Eggert  <eggert@cs.ucla.edu>
3741         Give more-useful info on a fatal error (Bug#12328).
3742         * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
3743         (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
3744         of doing the work ourselves.
3745         * emacs.c (fatal_error_signal): Let fatal_error_backtrace
3746         do most of the work.
3747         (fatal_error_backtrace): New function, taken from the guts
3748         of the old fatal_error_signal, but with a new option to output
3749         a backtrace.
3750         (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
3751         info about the signal than just its number.
3752         * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
3753         * sysdep.c: Include <execinfo.h>
3754         (emacs_backtrace): New function, taken partly from the previous
3755         code of the 'die' function.
3756         (emacs_abort): Call fatal_error_backtrace rather than abort.
3758 2012-09-04  Stefan Monnier  <monnier@iro.umontreal.ca>
3760         * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
3761         eager (load-time) macro-expansion.
3762         * lisp.mk (lisp): Add macroexp.
3764 2012-09-04  Paul Eggert  <eggert@cs.ucla.edu>
3766         Simplify redefinition of 'abort' (Bug#12316).
3767         Do not try to redefine the 'abort' function.  Instead, redo
3768         the code so that it calls 'emacs_abort' rather than 'abort'.
3769         This removes the need for the NO_ABORT configure-time macro
3770         and makes it easier to change the abort code to do a backtrace.
3771         * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
3772         * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
3773         Remove; sysdep.c's emacs_abort now takes its place.
3774         * lisp.h (emacs_abort): New decl.  All calls from Emacs code to
3775         'abort' changed to use 'emacs_abort'.
3776         * msdos.c (dos_abort) [defined abort]: Remove; not used.
3777         (abort) [!defined abort]: Rename to ...
3778         (emacs_abort): ... new name.
3779         * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
3780         the place of the old 'abort' in emacs.c.
3781         * w32.c, w32fns.c (abort): Do not #undef.
3782         * w32.c (emacs_abort): Rename from w32_abort.
3784 2012-09-04  Eli Zaretskii  <eliz@gnu.org>
3786         * w32uniscribe.c (uniscribe_shape): Reverse the sign of
3787         offsets[j].dv, since the y axis of the screen coordinates points
3788         down, while the y axis of the font definition coordinates points
3789         up.  This fixes display of Arabic diacritics such as KASRA and
3790         KASRATAN.  (Bug#11860)
3792 2012-09-04  Paul Eggert  <eggert@cs.ucla.edu>
3794         Be more systematic about _setjmp vs setjmp.
3795         * alloc.c (test_setjmp, mark_stack):
3796         * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
3797         (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
3798         (png_load, my_error_exit, jpeg_load):
3799         * process.c (send_process_trap, send_process):
3800         Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
3801         The underscored versions are up to 30x faster on some hosts.
3802         Formerly, the code used setjmp+longjmp sometimes and
3803         _setjmp+_longjmp at other times, with no particular reason to
3804         prefer setjmp+longjmp.
3806 2012-09-03  Paul Eggert  <eggert@cs.ucla.edu>
3808         Fix minor problem found by static checking.
3809         * buffer.c (Fdelete_all_overlays): Return nil.
3811 2012-09-03  Martin Rudalics  <rudalics@gmx.at>
3813         * buffer.c (Fdelete_all_overlays): New function.
3815 2012-09-03  Chong Yidong  <cyd@gnu.org>
3817         * gtkutil.c: Add extern decl for Qxft.
3819 2012-09-02  Paul Eggert  <eggert@cs.ucla.edu>
3821         * emacs.c, eval.c: Use bool for boolean.
3822         * emacs.c (initialized, inhibit_window_system, running_asynch_code):
3823         (malloc_using_checking) [DOUG_LEA_MALLOC]:
3824         (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
3825         (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
3826         (main, decode_env_path, Fdaemon_initialized):
3827         * eval.c (call_debugger, Finteractive_p, interactive_p):
3828         (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
3829         (maybe_call_debugger, Fbacktrace):
3830         * process.c (read_process_output, exec_sentinel):
3831         Use bool for booleans.
3832         * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
3833         All callers changed.
3834         * eval.c (interactive_p): Omit always-true boolean argument
3835         EXCLUDE_SUBRS_P.  All callers changed.
3836         * dispextern.h, lisp.h: Reflect above API changes.
3837         * firstfile.c (dummy): Use the address of 'main', whose signature
3838         won't change, instead of the address of 'initialize', whose
3839         signature just changed from int to bool.
3840         * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
3841         * msdos.c (fatal_error_in_progress): ... from here.
3842         * xdisp.c (redisplaying_p): Now a boolean.  Set it to 1 instead
3843         of incrementing it.
3844         (redisplay_internal, unwind_redisplay): Simply clear
3845         REDISPLAYING_P when unwinding, instead of saving its previous,
3846         always-false value and then restoring it.
3848         Clean up some extern decls.
3849         Mostly, this hoists extern decls out of .c files and into .h files.
3850         That way, we're more likely to catch errors if the interfaces change.
3851         * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
3852         declare xg_mark_data.
3853         * dispextern.h (x_frame_parm_handlers):
3854         * font.h (Qxft):
3855         * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
3856         (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
3857         (Qultra_bold, Qoblique, Qitalic):
3858         Move extern decl here from .c file.
3859         * alloc.c (xg_mark_data) [USE_GTK]:
3860         * doc.c (Qclosure):
3861         * eval.c (Qlexical_binding):
3862         * fns.c (time) [!HAVE_UNISTD_H]:
3863         * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
3864         (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
3865         * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
3866         * lread.c (Qinternal_interpreter_environment):
3867         * minibuf.c (Qbuffer):
3868         * process.c (QCfamily, QCfilter):
3869         * widget.c (free_frame_faces):
3870         * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
3871         * xfont.c (x_clear_errors):
3872         * xterm.c (x_frame_parm_handlers):
3873         Remove now-redundant extern decls.
3874         * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
3875         * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
3876         Now static.
3877         * xfaces.c: Remove unnecessary static decls.
3878         * xterm.c (updating_frame): Remove decl of nonexistent object.
3880         * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
3881         when building globals.h, as the objects that are not built on
3882         this host are not needed to compile C files on this host.
3884 2012-09-02  Jan Djärv  <jan.h.d@swipnet.se>
3886         * gtkutil.h: Remove prototype for x_wm_set_size_hint.
3888         * frame.h: Add missing prototype for x_wm_set_size_hint.
3890 2012-09-02  Paul Eggert  <eggert@cs.ucla.edu>
3892         * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
3893         * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
3894         (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
3895         (Fsubstitute_command_keys):
3896         * editfns.c (region_limit, find_field, Fconstrain_to_field)
3897         (save_excursion_save, save_excursion_restore)
3898         (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
3899         (format_time_string, general_insert_function)
3900         (make_buffer_string, make_buffer_string_both)
3901         (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
3902         * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
3903         (copy_text, insert_1, insert_1_both, insert_from_string)
3904         (insert_from_string_before_markers, insert_from_string_1)
3905         (insert_from_buffer, insert_from_buffer_1, replace_range)
3906         (replace_range_2, del_range_1, del_range_byte, del_range_both)
3907         (del_range_2, modify_region):
3908         * intervals.c (intervals_equal, balance_possible_root_interval)
3909         (adjust_intervals_for_insertion, merge_properties_sticky)
3910         (graft_intervals_into_buffer, lookup_char_property)
3911         (adjust_for_invis_intang, set_point_both)
3912         (get_property_and_range, compare_string_intervals)
3913         (set_intervals_multibyte_1, set_intervals_multibyte):
3914         * keyboard.c (decode_timer):
3915         Use bool for boolean.
3916         * intervals.h, lisp.h, systime.h: Reflect above API changes.
3917         * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
3919 2012-09-02  Chong Yidong  <cyd@gnu.org>
3921         * keymap.c (push_key_description): Print M-TAB as C-M-i
3922         (Bug#11758).
3924 2012-09-02  Juanma Barranquero  <lekktu@gmail.com>
3926         * makefile.w32-in (CCL_H, W32FONT_H): New macros.
3927         (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
3928         ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
3929         ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
3930         ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
3931         ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
3932         ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3934 2012-09-01  Eli Zaretskii  <eliz@gnu.org>
3936         * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
3937         more than one grapheme cluster passed to the shaper: compute the
3938         offset adjustment values separately for each cluster.  (Bug#11860)
3940         * image.c: Restore mistakenly removed inclusion of w32.h.  Without
3941         it, GCC doesn't see prototypes of w32_delayed_load, and complains
3942         about implicit conversions from integer to pointer.
3944 2012-09-01  Daniel Colascione  <dancol@dancol.org>
3946         * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
3947         system used too early.
3949 2012-09-01  Paul Eggert  <eggert@cs.ucla.edu>
3951         Better seed support for (random).
3952         * emacs.c (main): Call init_random.
3953         * fns.c (Frandom): Set the seed from a string argument, if given.
3954         Remove long-obsolete Gentzel cruft.
3955         * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
3956         (init_random): New function.
3958 2012-09-01  Daniel Colascione  <dancol@dancol.org>
3960         * xterm.h: Add header guards.  Declare x_menubar_window_to_frame.
3961         Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
3962         x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
3963         x_wm_set_size_hint, x_query_colors, x_real_positions,
3964         x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
3965         x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
3966         all of which have been moved to common code.
3968         * xfaces.c: Include TERM_HEADER instead of listing all possible
3969         window-system headers.
3971         * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
3972         to match header.
3974         * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
3975         directly accessing frame internals.
3977         * w32font.h: Include font.h.  Define syms_of_w32font and
3978         globals_of_w32font.
3980         * process.c: Include TERM_HEADER instead of listing all possible
3981         window-system headers.
3983         * nsterm.h: Remove declarations now in frame.h.
3984         Define FRAME_X_SCREEN, FRAME_X_VISUAL.
3986         * menu.c: Include TERM_HEADER instead of listing all possible
3987         window-system headers.
3989         * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
3990         window system.
3992         * keyboard.c: Include TERM_HEADER instead of listing all possible
3993         window-system headers.
3995         * image.c: Include TERM_HEADER instead of listing all possible
3996         window-system headers.  Declare Vlibrary_cache when compiling for
3997         Windows.
3999         * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
4000         window system declarations.
4002         * frame.h: Move common functions here: set_frame_menubar,
4003         x_set_window_size, x_sync, x_get_focus_frame,
4004         x_set_mouse_position, x_set_mouse_pixel_position,
4005         x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
4006         x_char_width, x_char_height, x_pixel_width, x_pixel_height,
4007         x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
4008         x_activate_menubar, x_real_positions, x_bitmap_icon,
4009         x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
4010         and x_query_colors.
4012         * frame.c: Include TERM_HEADER instead of listing all possible
4013         window-system headers.
4015         * font.c: Include TERM_HEADER instead of listing all possible
4016         window-system headers.
4018         * emacs.c: Include TERM_HEADER.
4020         * dispnew.c: Include TERM_HEADER instead of listing all possible
4021         window-system headers.
4023         * ccl.h: Include character.h.
4025         * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
4026         the current window system; include in list of objects to link into
4027         Emacs.
4029 2012-08-31  Dmitry Antipov  <dmantipov@yandex.ru>
4031         Remove mark_ttys function and fix tty_display_info initialization.
4032         * lisp.h (mark_ttys): Remove prototype.
4033         * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
4034         to mark_ttys because all possible values of 'top_frame' slot are
4035         the frames which are reachable from Vframe_list.
4036         * term.c (mark_ttys): Remove.
4037         (init_tty): Safely initialize 'top_frame' slot with Qnil.
4039 2012-08-31  Dmitry Antipov  <dmantipov@yandex.ru>
4041         Change struct frame bitfields from unsigned char to unsigned.
4042         * frame.h (struct frame): Change type of 'display_preempted',
4043         'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
4044         'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
4045         'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
4046         bitfields from unsigned char to unsigned.
4048 2012-08-31  Dmitry Antipov  <dmantipov@yandex.ru>
4050         Remove unused member of struct x_output and struct w32_output.
4051         * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
4052         * w32term.h (struct w32_output): Likewise.
4054 2012-08-30  Jan Djärv  <jan.h.d@swipnet.se>
4056         * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
4057         does not become zero (Bug#12234).
4059 2012-08-30  Paul Eggert  <eggert@cs.ucla.edu>
4061         * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
4062         for GCC 4.7.1 x86-64.
4064 2012-08-30  Glenn Morris  <rgm@gnu.org>
4066         * lread.c (init_lread): For out-of-tree builds, only add the
4067         source directory's site-lisp dir to the load-path if it exists,
4068         consistent with in-tree builds.  (Bug#12302)
4070 2012-08-28  Jan Djärv  <jan.h.d@swipnet.se>
4072         * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
4073         button_values to NULL.  Call setStykeMask so dialogs get a close button.
4074         (windowShouldClose:): Set window_closed.
4075         (dealloc): New member, free button_values.
4076         (process_dialog:): Make member function.  Remove window argument,
4077         replace window with self.  Count buttons and allocate and store values
4078         in button_values.
4079         (addButton:value:row:): value is int with the name tag.  Call setTag
4080         with tag.  Remove return self, declare return value as void.
4081         (addString:row:): Remove return self, declare return value as void.
4082         (addSplit): Remove return self, declare return value as void.
4083         (clicked:): Remove return self, declare return value as void.
4084         Set dialog_return to button_values[seltag].  Code formatting change.
4085         (initFromContents:isQuestion:): Adjust call to process_dialog.
4086         Code formatting change.
4087         (timeout_handler:): Set timer_fired to YES.
4088         (runDialogAt:): Set timer_fired to NO.
4089         Handle click on close button as quit.
4091         * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
4092         Add window_closed and button_values.  Add void as return value for
4093         add(Button|String|Split).  addButton takes int instead of Lisp_Object.
4094         Add process_dialog as new member.
4096 2012-08-28  Eli Zaretskii  <eliz@gnu.org>
4098         * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
4099         is not one of the heaps we manage.  (Bug#12242)
4101 2012-08-28  Glenn Morris  <rgm@gnu.org>
4103         * eval.c (Fcalled_interactively_p): Doc fix.  (Bug#11747)
4105 2012-08-28  Martin Rudalics  <rudalics@gmx.at>
4107         * window.c (Fset_window_configuration): Remove handling of
4108         auto-buffer-name window parameter.  Install revision of reverted
4109         fix.
4111 2012-08-28  Dmitry Antipov  <dmantipov@yandex.ru>
4113         Do not allow to set major mode for a dead buffer.
4114         * buffer.c (Fset_buffer_major_mode): Signal an error
4115         if the buffer is dead.
4116         (Fother_buffer, other_buffer_safely): Remove redundant
4117         nested declaration.
4119 2012-08-28  Dmitry Antipov  <dmantipov@yandex.ru>
4121         Always use set_buffer_if_live to restore original buffer at unwind.
4122         * buffer.h (record_unwind_current_buffer): New function.
4123         * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
4124         * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
4125         * undo.c, window.c: Adjust users.
4126         * buffer.c (set_buffer_if_live): Fix comment.
4128 2012-08-28  Dmitry Antipov  <dmantipov@yandex.ru>
4130         Fix usage of set_buffer_internal.
4131         * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
4132         * buffer.c (set_buffer_if_live): Use set_buffer_internal.
4133         * coding.c (decode_coding): Omit redundant test.
4134         * fileio.c (decide_coding_unwind): Likewise.
4135         * fns.c (secure_hash): Likewise.
4136         * insdel.c (modify_region): Likewise.
4137         * keyboard.c (command_loop_1): Likewise.
4138         * print.c (PRINTFINISH): Likewise.
4139         * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
4141 2012-08-27  Paul Eggert  <eggert@cs.ucla.edu>
4143         * dispnew.c: Use bool for boolean.
4144         (frame_garbaged, display_completed, delayed_size_change)
4145         (fonts_changed_p, add_window_display_history)
4146         (add_frame_display_history, verify_row_hash)
4147         (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
4148         (row_equal_p, realloc_glyph_pool)
4149         (allocate_matrices_for_frame_redisplay)
4150         (showing_window_margins_p)
4151         (adjust_frame_glyphs_for_frame_redisplay)
4152         (build_frame_matrix_from_leaf_window, make_current)
4153         (mirrored_line_dance, mirror_line_dance, update_frame)
4154         (update_window_tree, update_single_window)
4155         (check_current_matrix_flags, update_window, update_text_area)
4156         (update_window_line, set_window_update_flags, scrolling_window)
4157         (update_frame_1, scrolling, buffer_posn_from_coords)
4158         (do_pending_window_change, change_frame_size)
4159         (change_frame_size_1, sit_for):
4160         Use bool for boolean.
4161         (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
4162         and remove last int (actually boolean) argument, which was always 0.
4163         All callers changed.
4164         * dispextern.h, frame.h, lisp.h: Reflect above API changes.
4165         * dispextern.h (struct composition_it): Use bool for boolean.
4166         (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
4167         (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
4168         * dired.c (file_name_completion):
4169         Use bool for boolean.  (This was missed in an earlier change.)
4171 2012-08-27  Martin Rudalics  <rudalics@gmx.at>
4173         * window.c (Fset_window_configuration): Revert first part of
4174         last change.
4176 2012-08-27  Jan Djärv  <jan.h.d@swipnet.se>
4178         * nsterm.h (NSPanel): New class variable dialog_return.
4180         * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
4181         Initialize dialog_return.
4182         (windowShouldClose:): Use stop instead of stopModalWithCode.
4183         (clicked:): Ditto, and also set dialog_return (Bug#12258).
4184         (timeout_handler:): Use stop instead of abortModal.  Send a dummy
4185         event.
4186         (runDialogAt:): Make ret Lisp_Object.  Set it from dialog_return when
4187         modal loop returns.
4189 2012-08-27  Paul Eggert  <eggert@cs.ucla.edu>
4191         * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
4192         * composite.c (find_composition, composition_gstring_p)
4193         (composition_reseat_it, find_automatic_composition):
4194         * data.c (let_shadows_buffer_binding_p)
4195         (let_shadows_global_binding_p, set_internal, make_blv)
4196         (Fmake_variable_buffer_local, Fmake_local_variable)
4197         (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
4198         (cons_to_signed, arith_driver):
4199         * dbusbind.c (xd_in_read_queued_messages):
4200         * dired.c (directory_files_internal, file_name_completion):
4201         Use bool for booleans.
4202         * dired.c (file_name_completion):
4203         * process.h (fd_callback):
4204         Omit int (actually boolean) argument.  It wasn't being used.
4205         All uses changed.
4206         * composite.h, lisp.h: Reflect above API changes.
4208         * cmds.c, coding.c: Use bool for booleans.
4209         * cmds.c (move_point, Fself_insert_command):
4210         * coding.h (struct composition status, struct coding_system):
4211         * coding.c (detect_coding_utf_8, encode_coding_utf_8)
4212         (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
4213         (emacs_mule_char, decode_coding_emacs_mule)
4214         (encode_coding_emacs_mule, detect_coding_iso_2022)
4215         (decode_coding_iso_2022, encode_invocation_designation)
4216         (encode_designation_at_bol, encode_coding_iso_2022)
4217         (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
4218         (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
4219         (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
4220         (encode_coding_raw_text, detect_coding_charset)
4221         (decode_coding_charset, encode_coding_charset, detect_eol)
4222         (detect_coding, get_translation_table, produce_chars)
4223         (consume_chars, reused_workbuf_in_use)
4224         (make_conversion_work_buffer, code_conversion_save)
4225         (decode_coding_object, encode_coding_object)
4226         (detect_coding_system, char_encodable_p)
4227         (Funencodable_char_position, code_convert_region)
4228         (code_convert_string, code_convert_string_norecord)
4229         (Fset_coding_system_priority):
4230         * fileio.c (Finsert_file_contents):
4231         Use bool for booleans.
4232         * coding.h, lisp.h: Reflect above API changes.
4233         * coding.c: Remove unnecessary static function decls.
4234         (detect_coding): Use unsigned, not signed, to copy an unsigned field.
4235         (decode_coding, encode_coding, decode_coding_gap): Return 'void',
4236         not a boolean 'int', since callers never look at the return value.
4237         (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
4238         * coding.h (decoding_buffer_size, encoding_buffer_size)
4239         (emacs_mule_string_char): Remove unused extern decls.
4240         (struct iso_2022_spec, struct coding_system):
4241         Use 'unsigned int : 1' for boolean fields, since there's more than one.
4242         (struct emacs_mule_spec): Remove unused field 'full_support'.
4243         All initializations removed.
4244         * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
4246 2012-08-27  Dmitry Antipov  <dmantipov@yandex.ru>
4248         Fix spare memory change (Bug#12286).
4249         * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
4250         (valid_lisp_object_p): Likewise.
4252 2012-08-27  Martin Rudalics  <rudalics@gmx.at>
4254         * window.c (Fset_window_configuration): Record any window's old
4255         buffer if it's replaced (see Bug#8789).  If the new current
4256         buffer doesn't appear in the selected window, go to its old
4257         point (Bug#12208).
4259 2012-08-27  Dmitry Antipov  <dmantipov@yandex.ru>
4261         Special MEM_TYPE_SPARE to denote reserved memory.
4262         * alloc.c (enum mem_type): New memory type.
4263         (refill_memory_reserve): Use new type for spare memory.
4264         This prevents live_cons_p and live_string_p from incorrect
4265         detection of uninitialized objects from spare memory as live.
4267 2012-08-26  Paul Eggert  <eggert@cs.ucla.edu>
4269         Spelling fixes.
4270         * Makefile.in (.PHONY): versioclean -> versionclean.
4272         Remove unused external symbols.
4273         * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
4274         * window.c (Qwindow_valid_p, decode_valid_window):
4275         Now static, not extern.
4276         * data.c (Qinterval): Remove; unused.
4277         (syms_of_data): Do not define 'interval'.
4278         * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
4279         * window.h (decode_valid_window):
4280         Remove decls.
4282         * character.c, charset.c, chartab.c: Use bool for booleans.
4283         * character.c (lisp_string_width, string_count_byte8)
4284         (string_escape_byte8):
4285         * charset.c (charset_map_loaded, load_charset_map, read_hex):
4286         (load_charset_map_from_file, map_charset_chars)
4287         (Fdefine_charset_internal, define_charset_internal)
4288         (Fdeclare_equiv_charset, find_charsets_in_text)
4289         (Ffind_charset_region, char_charset, Fiso_charset):
4290         * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
4291         (sub_char_table_set, sub_char_table_set_range)
4292         (char_table_set_range, optimize_sub_char_table)
4293         (map_sub_char_table):
4294         Use bool for boolean.
4295         * character.c (str_to_unibyte): Omit last boolean argument; it was
4296         always 0.  All callers changed.
4297         * character.h, charset.h: Adjust to match previous changes.
4298         * character.h (char_printable_p): Remove decl of nonexistent function.
4299         * charset.h (struct charset): Members code_linear_p, iso_chars_96,
4300         ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
4301         are all boolean, so make them single-bit bitfields.
4303         * lisp.h (ASET): Remove attempt to detect side effects.
4304         It was meant to be temporary and it often doesn't work,
4305         because when IDX has side effects the behavior of IDX==IDX
4306         is undefined.  See Stefan Monnier in
4307         <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
4309 2012-08-26  Barry OReilly  <gundaetiapo@gmail.com>  (tiny change)
4311         * lisp.h (functionp): New function (extracted from Ffunctionp).
4312         (FUNCTIONP): Use it.
4313         * eval.c (Ffunctionp): Use it.
4315 2012-08-25  Paul Eggert  <eggert@cs.ucla.edu>
4317         * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
4318         as that's faster and simpler than static storage.  Don't bother
4319         with the g_main_context_query overhead if g_main_context_pending
4320         says no events are pending.
4321         (gfds, gfds_size): Remove these static vars.
4322         (xgselect_initialize): Remove; no longer needed.
4323         All uses and decls removed.
4325         * emacs.c (fatal_error_signal_hook): Remove.
4326         All uses removed.  This leftover from old code was always 0.
4328         * casefiddle.c, casetab.c, category.c: Use bool for boolean.
4329         * casefiddle.c (casify_object, casify_region):
4330         * casetab.c (set_case_table):
4331         * category.c, category.h (word_boundary_p):
4332         * category.h (CHAR_HAS_CATEGORY):
4333         Use bool for booleans, instead of int.
4335 2012-08-25  Eli Zaretskii  <eliz@gnu.org>
4337         * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
4339 2012-08-25  Paul Eggert  <eggert@cs.ucla.edu>
4341         On assertion failure, print backtrace if available.
4342         * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
4343         (die) [ENABLE_CHECKING]: Print a backtrace if available.
4344         * Makefile.in (LIB_EXECINFO): New macro.
4345         (LIBES): Use it.
4347         * bytecode.c, callint.c, callproc.c: Use bool for boolean.
4348         * bytecode.c (exec_byte_code):
4349         * callint.c (check_mark, Fcall_interactively):
4350         * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
4351         (getenv_internal, sync_process_alive, call_process_exited):
4352         * lisp.h (USE_SAFE_ALLOCA):
4353         Use bool for booleans, instead of int.
4354         * lisp.h, process.h: Adjust prototypes to match above changes.
4355         * callint.c (Fcall_interactively): Don't assume the mark's
4356         offset fits in 'int'.
4358 2012-08-24  Paul Eggert  <eggert@cs.ucla.edu>
4360         * buffer.c, buffer.h: Use bool for boolean.
4361         * buffer.c (reset_buffer_local_variables)
4362         (buffer_lisp_local_variables, Fset_buffer_modified_p)
4363         (Frestore_buffer_modified_p, Fset_buffer_multibyte):
4364         (overlays_at, overlays_in, mouse_face_overlay_overlaps)
4365         (overlay_touches_p, overlay_strings, Foverlay_put)
4366         (report_overlay_modification, call_overlay_mod_hooks):
4367         (mmap_enlarge, mmap_set_vars):
4368         * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
4369         Use bool for booleans, instead of int.
4370         * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
4371         since the 1-or-0 return value is always ignored anyway.
4372         (mmap_initialized_p):
4373         * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
4374         * buffer.h, lisp.h: Adjust prototypes to match above changes.
4376 2012-08-23  Paul Eggert  <eggert@cs.ucla.edu>
4378         * bidi.c: Use bool for boolean.
4379         This is a bit more readable, and makes the text segment of bidi.o
4380         0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
4381         Presumably it's faster too.
4382         (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
4383         Now bool.
4384         (bidi_cache_find_level_change, bidi_cache_iterator_state)
4385         (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
4386         (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
4387         (bidi_explicit_dir_char, bidi_level_of_next_char)
4388         (bidi_find_other_level_edge, bidi_move_to_visually_next):
4389         Use bool for booleans, instead of int.
4390         * dispextern.h (bidi_init_it, bidi_paragraph_init)
4391         (bidi_unshelve_cache): Adjust decls to match code.
4393 2012-08-23  Martin Rudalics  <rudalics@gmx.at>
4395         * keyboard.c (Fposn_at_x_y): Do not allow internal window as
4396         argument.
4398 2012-08-23  Paul Eggert  <eggert@cs.ucla.edu>
4400         * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
4401         * atimer.h: Include <stdbool.h>.
4403 2012-08-22  Dan Nicolaescu  <dann@gnu.org>
4405         * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
4406         compile time tests instead of run time tests on systems that do
4407         not use them.
4408         (FRAME_MAC_P): Remove leftover from deleted code.
4409         * frame.c (syms_of_frame): Remove leftover from deleted code.
4411 2012-08-22  Jan Djärv  <jan.h.d@swipnet.se>
4413         * nsterm.m (insertText:): Don't clear modifiers if code is space.
4415 2012-08-22  Paul Eggert  <eggert@cs.ucla.edu>
4417         * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
4418         Otherwise, the compiler complains about (A?B:C) where B is void
4419         and C is Lisp_Object.  This fixes an incompatibility with Sun C 5.12.
4420         (fontset_add): Return void, for FONTSET_ADD.
4422 2012-08-21  Paul Eggert  <eggert@cs.ucla.edu>
4424         * alloc.c: Use bool for booleans.
4425         (gc_in_progress, abort_on_gc)
4426         (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
4427         (dont_register_blocks) [GC_MALLOC_CHECK]:
4428         (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
4429         (check_string_bytes, make_specified_string, memory_full)
4430         (live_string_p, live_cons_p, live_symbol_p, live_float_p)
4431         (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
4432         (mark_stack, valid_pointer_p, make_pure_string)
4433         (Fgarbage_collect, survives_gc_p, gc_sweep):
4434         Use bool for booleans, instead of int.
4435         (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
4436         Remove unused local.
4437         * alloc.c (PURE_POINTER_P):
4438         * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
4439         * editfns.c (Fformat):
4440         * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
4441         (Fdo_auto_save):
4442         * fns.c (sweep_weak_table):
4443         * lisp.h (suppress_checking, push_message, survives_gc_p)
4444         (make_pure_string, gc_in_progress, abort_on_gc):
4445         * lread.c (readchar, read1):
4446         * print.c (Fprin1_to_string):
4447         * xdisp.c (push_message):
4448         Use bool for booleans affected directly or indirectly by
4449         alloc.c's changes.
4451         Make recently-introduced setters macros.
4452         * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
4453         (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
4454         (set_fontset_default, set_fontset_fallback): Rename from their
4455         upper-case counterparts, and make them functions rather than macros.
4456         This is more consistent with the other recently-introduced setters.
4457         These don't need to be inline, since they're local.
4459 2012-08-21  Jan Djärv  <jan.h.d@swipnet.se>
4461         * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
4462         the loop (Bug#12247).
4464 2012-08-21  Paul Eggert  <eggert@cs.ucla.edu>
4466         * lisp.h (vcopy): Use memcpy rather than our own loop.
4467         This fixes a performance regression introduced by the recent
4468         addition of vcopy.  This means 'vcopy' will need to be modified
4469         for a copying collector, but that's OK.  Also, tighten the
4470         checking in the assertion.
4472 2012-08-21  Eli Zaretskii  <eliz@gnu.org>
4474         * w32uniscribe.c (uniscribe_shape): Fix producing gstring
4475         components for RTL text (Bug#11860).  Adjust X-OFFSET of each
4476         non-base glyph for the width of the base character, according to
4477         what x_draw_composite_glyph_string_foreground expects.
4478         Generate WADJUST value according to composition_gstring_width's
4479         expectations, to produce correct width of the composed character.
4480         Reverse the sign of the DU offset produced by ScriptPlace.
4482 2012-08-21  Paul Eggert  <eggert@cs.ucla.edu>
4484         * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
4486 2012-08-21  Dmitry Antipov  <dmantipov@yandex.ru>
4488         Avoid direct writes to contents member of struct Lisp_Vector.
4489         * lisp.h (vcopy): New function to copy data into vector.
4490         * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
4491         * fns.c (Ffillarray): Use ASET.
4492         * keyboard.c (timer_check_2): Use AREF and ASET.
4493         (append_tool_bar_item, Frecent_keys): Use vcopy.
4494         * lread.c (read_vector): Use ASET.
4495         * msdos.c (Frecent_doskeys): Use vcopy.
4496         * xface.c (Finternal_copy_lisp_face): Use vcopy.
4497         (Finternal_merge_in_global_face): Use ASET and vcopy.
4498         * xfont.c (xfont_list_pattern): Likewise.
4500 2012-08-21  Martin Rudalics  <rudalics@gmx.at>
4502         * window.c (Fwindow_point): For the selected window always return
4503         the position of its buffer's point.
4504         (Fset_window_point): For the selected window always go in its
4505         buffer to the specified position.
4507 2012-08-21  Dmitry Antipov  <dmantipov@yandex.ru>
4509         Setter macros for fontsets.
4510         * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
4511         (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
4512         (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
4513         Adjust users.
4515 2012-08-20  Glenn Morris  <rgm@gnu.org>
4517         * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
4518         Don't assume that `ln -f' works.
4520 2012-08-20  Eli Zaretskii  <eliz@gnu.org>
4522         * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
4523         and later about non-assignments with no effect.  See discussion at
4524         http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
4525         details.
4527 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
4529         Inline setter functions for Lisp_Objects slots of struct specbinding.
4530         * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
4531         Adjust users.
4533 2012-08-20  Martin Rudalics  <rudalics@gmx.at>
4535         * window.c (select_window): Always make selected window's buffer
4536         current.
4538 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
4540         Use AREF and ASET for docstrings of category tables.
4541         * category.h (CATEGORY_DOCSTRING): Use AREF.
4542         (SET_CATEGORY_DOCSTRING): Use ASET.
4543         * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
4545 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
4547         Inline setter functions for hash table members.
4548         * lisp.h (set_hash_key, set_hash_value, set_hash_next)
4549         (set_hash_hash, set_hash_index): Rename with _slot suffix.
4550         (set_hash_key_and_value, set_hash_index, set_hash_next)
4551         (set_hash_hash): New functions.
4552         * charset.c, fns.c: Adjust users.
4554 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
4556         Inline getter and setter functions for per-buffer values.
4557         * buffer.h (per_buffer_default, set_per_buffer_default)
4558         (per_buffer_value, set_per_buffer_value): New functions.
4559         (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
4560         * buffer.c, data.c: Adjust users.
4562 2012-08-20  Juanma Barranquero  <lekktu@gmail.com>
4564         * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
4566 2012-08-19  Paul Eggert  <eggert@cs.ucla.edu>
4568         Rely on <config.h> + <unistd.h> to declare 'environ',
4569         as gnulib does this if the system doesn't.
4570         * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
4571         Remove declaration.  MS-Windows declares it on stdlib.h which is
4572         included by conf_post.h.
4573         * emacs.c (environ) [DOUG_LEA_MALLOC]:
4574         * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
4575         * vm-limit.c: Include <unistd.h>, for 'environ'.
4577         * unexaix.c, unexcoff.c: Include "mem-limits.h".
4578         (start_of_data): Remove decl; mem-limits.h provides it.
4580         * xdisp.c (handle_invisible_prop): Make it a bit faster
4581         and avoid a gcc -Wmaybe-uninitialized diagnostic.
4583 2012-08-19  Chong Yidong  <cyd@gnu.org>
4585         * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
4586         ends (Bug#3874).
4588 2012-08-19  Andreas Schwab  <schwab@linux-m68k.org>
4590         * .gdbinit: Use call instead of set when calling a function in the
4591         inferior.
4593         * data.c (set_internal): Don't use set_blv_found.
4594         (Fkill_local_variable): Likewise.
4596 2012-08-18  Alp Aker  <alp.tekin.aker@gmail.com>
4598         * nsfont.m (ns_ascii_average_width): Ensure the string
4599         ascii_printable is initialized with a null-terminated character
4600         array.  Otherwise, it can contain undesired extra characters.
4602 2012-08-18  Paul Eggert  <eggert@cs.ucla.edu>
4604         port new setting code to Sun C 5.8 2005/10/13
4605         * chartab.c, lisp.h (char_table_set, char_table_set_range):
4606         Return void, not Lisp_Object.  Otherwise, the compiler
4607         complains about (A?B:C) where B is void and C is Lisp_Object
4608         when compiling CHAR_TABLE_SET, due to the recent change to
4609         the API of sub_char_table_set_contents.
4611 2012-08-18  Chong Yidong  <cyd@gnu.org>
4613         * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
4614         for the string case (Bug#3874).
4616 2012-08-18  Paul Eggert  <eggert@cs.ucla.edu>
4618         * buffer.h (BSET): Remove (Bug#12215).
4619         Replace all uses with calls to new setter functions.
4620         (bset_bidi_paragraph_direction, bset_case_canon_table)
4621         (bset_case_eqv_table, bset_directory, bset_display_count)
4622         (bset_display_time, bset_downcase_table)
4623         (bset_enable_multibyte_characters, bset_filename, bset_keymap)
4624         (bset_last_selected_window, bset_local_var_alist)
4625         (bset_mark_active, bset_point_before_scroll, bset_read_only)
4626         (bset_truncate_lines, bset_undo_list, bset_upcase_table)
4627         (bset_width_table):
4628         * buffer.c (bset_abbrev_mode, bset_abbrev_table)
4629         (bset_auto_fill_function, bset_auto_save_file_format)
4630         (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
4631         (bset_bidi_display_reordering, bset_buffer_file_coding_system)
4632         (bset_cache_long_line_scans, bset_case_fold_search)
4633         (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
4634         (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
4635         (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
4636         (bset_fringe_indicator_alist, bset_fringes_outside_margins)
4637         (bset_header_line_format, bset_indicate_buffer_boundaries)
4638         (bset_indicate_empty_lines, bset_invisibility_spec)
4639         (bset_left_fringe_width, bset_major_mode, bset_mark)
4640         (bset_minor_modes, bset_mode_line_format, bset_mode_name)
4641         (bset_name, bset_overwrite_mode, bset_pt_marker)
4642         (bset_right_fringe_width, bset_save_length)
4643         (bset_scroll_bar_width, bset_scroll_down_aggressively)
4644         (bset_scroll_up_aggressively, bset_selective_display)
4645         (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
4646         (bset_word_wrap, bset_zv_marker):
4647         * category.c (bset_category_table):
4648         * syntax.c (bset_syntax_table):
4649         New setter functions.
4651         * process.h (PSET): Remove (Bug#12215).
4652         Replace all uses with calls to new setter functions.
4653         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4654         (PROCESS_INLINE): New macro.
4655         (pset_childp): New setter function.
4656         (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
4657         * process.c (PROCESS_INLINE):
4658         Define to EXTERN_INLINE, so that the corresponding functions
4659         are compiled into code.
4660         (pset_buffer, pset_command, pset_decode_coding_system)
4661         (pset_decoding_buf, pset_encode_coding_system)
4662         (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
4663         (pset_plist, pset_sentinel, pset_status, pset_tty_name)
4664         (pset_type, pset_write_queue): New setter functions.
4666         * window.h (WSET): Remove (Bug#12215).
4667         Replace all uses with calls to new setter functions.
4668         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4669         (WINDOW_INLINE): New macro.
4670         (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
4671         (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
4672         (wset_total_lines, wset_vertical_scroll_bar)
4673         (wset_window_end_pos, wset_window_end_valid)
4674         (wset_window_end_vpos): New setter functions.
4675         * window.c (WINDOW_INLINE):
4676         Define to EXTERN_INLINE, so that the corresponding functions
4677         are compiled into code.
4678         (wset_combination_limit, wset_dedicated, wset_display_table)
4679         (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
4680         (wset_new_normal, wset_new_total, wset_next_buffers)
4681         (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
4682         (wset_prev_buffers, wset_right_fringe_width)
4683         (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
4684         (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
4685         (wset_window_parameters):
4686         * xdisp.c (wset_base_line_number, wset_base_line_pos)
4687         (wset_column_number_displayed, wset_region_showing):
4688         New setter functions.
4690         * termhooks.h (TSET): Remove (Bug#12215).
4691         Replace all uses with calls to new setter functions.
4692         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4693         (TERMHOOKS_INLINE): New macro.
4694         (tset_charset_list, tset_selection_alist): New setter functions.
4695         * terminal.c (TERMHOOKS_INLINE):
4696         Define to EXTERN_INLINE, so that the corresponding functions
4697         are compiled into code.
4698         (tset_param_alist): New setter function.
4700 2012-08-17  Paul Eggert  <eggert@cs.ucla.edu>
4702         * keyboard.h (KSET): Remove (Bug#12215).
4703         Replace all uses with calls to new setter functions.
4704         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4705         (KEYBOARD_INLINE): New macro.
4706         (kset_default_minibuffer_frame, kset_defining_kbd_macro)
4707         (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
4708         (kset_prefix_arg, kset_system_key_alist, kset_window_system):
4709         New setter functions.
4710         * keyboard.c (KEYBOARD_INLINE):
4711         Define to EXTERN_INLINE, so that the corresponding functions
4712         are compiled into code.
4713         (kset_echo_string, kset_kbd_queue)
4714         (kset_keyboard_translate_table, kset_last_prefix_arg)
4715         (kset_last_repeatable_command, kset_local_function_key_map)
4716         (kset_overriding_terminal_local_map, kset_real_last_command)
4717         (kset_system_key_syms): New setter functions.
4719         * frame.h (FSET): Remove (Bug#12215).
4720         Replace all uses with calls to new setter functions.
4721         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4722         (FRAME_INLINE): New macro.
4723         (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
4724         (fset_current_tool_bar_string, fset_desired_tool_bar_string)
4725         (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
4726         (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
4727         (fset_param_alist, fset_root_window, fset_scroll_bars)
4728         (fset_selected_window, fset_title, fset_tool_bar_items)
4729         (fset_tool_bar_position, fset_tool_bar_window): New functions.
4730         * frame.c (FRAME_INLINE):
4731         Define to EXTERN_INLINE, so that the corresponding functions
4732         are compiled into code.
4733         (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
4735         A few more naming-convention fixes for getters and setters.
4736         * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
4737         and rename from buffer_overlays_set_before.
4738         (set_buffer_overlays_after): Move here from buffer.h, and rename
4739         from buffer_overlays_set_after.
4740         * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
4741         All uses changed.
4742         (set_buffer_intervals): Rename from buffer_set_intervals.
4743         * intervals.c (set_interval_object): Move here from intervals.h,
4744         and rename from interval_set_object.
4745         (set_interval_left): Move here from intervals.h, and rename from
4746         interval_set_left.
4747         (set_interval_right): Move here from intervals.h, and rename from
4748         interval_set_right.
4749         (copy_interval_parent): Move here from intervals.h, and rename from
4750         interval_copy_parent.
4751         * intervals.h (set_interval_parent): Rename from interval_set_parent.
4752         (set_interval_plist): Rename from interval_set_plist.
4753         Return void, not Lisp_Object, since no caller uses the result.
4754         * lisp.h (string_intervals): Rename from string_get_intervals.
4755         (set_string_intervals): Rename from string_set_intervals.
4757         * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
4758         (set_char_table_contents): Rename from char_table_set_contents.
4759         (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
4760         All uses changed.  See the end of
4761         <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
4763         * lisp.h (CSET): Remove (Bug#12215).
4764         (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
4765         (set_char_table_purpose): New functions,
4766         replacing CSET.  All uses changed.  For example, replace
4767         "CSET (XCHAR_TABLE (char_table), parent, parent);" with
4768         "set_char_table_parent (char_table, parent);".
4769         The old version was confusing because it used the same name
4770         'parent' for two different things.
4772 2012-08-17  Dmitry Antipov  <dmantipov@yandex.ru>
4774         Functions to get and set Lisp_Object fields of buffer-local variables.
4775         * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
4776         (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
4777         (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
4778         * data.c, eval.c, frame.c: Adjust users.
4780 2012-08-17  Chong Yidong  <cyd@gnu.org>
4782         * xfaces.c (merge_face_vectors): If the target font specfies a
4783         font spec, make the font's attributes take precedence over
4784         directly-specified attributes.
4785         (merge_face_ref): Recognize :font.
4787 2012-08-17  Dmitry Antipov  <dmantipov@yandex.ru>
4789         Do not use memcpy for copying intervals.
4790         * intervals.c (reproduce_interval): New function.
4791         (reproduce_tree, reproduce_tree_obj): Use it.
4792         (reproduce_tree_obj): Remove prototype.
4794 2012-08-17  Paul Eggert  <eggert@cs.ucla.edu>
4796         * lisp.h (duration_to_sec_usec): Remove unused decl.
4798 2012-08-17  Alp Aker  <alp.tekin.aker@gmail.com>
4800         * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
4801         to an allocated instance of NSString, not to the class itself.
4803 2012-08-17  Juanma Barranquero  <lekktu@gmail.com>
4805         * makefile.w32-in (C_CTYPE_H): New macro.
4806         (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
4807         ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
4808         ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
4810 2012-08-16  Paul Eggert  <eggert@cs.ucla.edu>
4812         Use ASCII tests for character types.
4813         * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
4814         * xfns.c, xterm.c:
4815         Don't include <ctype.h>; was not needed.
4816         * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
4817         * sysdep.c, xfaces.c:
4818         Include <c-ctype.h> instead of <ctype.h>.
4819         * nsterm.m: Include <c-ctype.h>.
4820         * charset.c (read_hex):
4821         * doc.c (Fsnarf_documentation):
4822         * fileio.c (IS_DRIVE) [WINDOWSNT]:
4823         (DRIVE_LETTER) [DOS_NT]:
4824         (Ffile_name_directory, Fexpand_file_name)
4825         (Fsubstitute_in_file_name):
4826         * font.c (font_parse_xlfd, font_parse_fcname):
4827         * frame.c (x_set_font_backend):
4828         * gtkutil.c (xg_get_font):
4829         * image.c (xbm_scan, xpm_scan, pbm_scan_number):
4830         * nsimage.m (hexchar):
4831         * nsterm.m (ns_xlfd_to_fontname):
4832         * sysdep.c (system_process_attributes):
4833         * xfaces.c (hash_string_case_insensitive):
4834         Use C-locale tests instead of locale-specific tests for character
4835         types, since we want the ASCII interpretation here, not the
4836         interpretation suitable for whatever happens to be the current locale.
4838 2012-08-16  Martin Rudalics  <rudalics@gmx.at>
4840         Consistently check windows for validity/liveness
4841         (Bug#11984, Bug#12025, Bug#12026).
4842         * lisp.h (CHECK_VALID_WINDOW): New macro.
4843         * window.c (decode_window): Rename to decode_live_window.
4844         (decode_valid_window, Fwindow_valid_p): New functions.
4845         (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
4846         (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
4847         (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
4848         (Fwindow_prev_sibling, Fwindow_combination_limit)
4849         (Fset_window_combination_limit, Fwindow_use_time)
4850         (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
4851         (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
4852         (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
4853         (Fwindow_hscroll, Fset_window_hscroll)
4854         (Fwindow_redisplay_end_trigger)
4855         (Fset_window_redisplay_end_trigger, Fwindow_edges)
4856         (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
4857         (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
4858         (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
4859         (Fwindow_end, Fset_window_point, Fset_window_start)
4860         (Fpos_visible_in_window_p, Fwindow_line_height)
4861         (Fwindow_dedicated_p, Fset_window_dedicated_p)
4862         (Fwindow_prev_buffers, Fset_window_prev_buffers)
4863         (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
4864         (Fset_window_parameter, Fwindow_display_table)
4865         (Fset_window_display_table, Fdelete_other_windows_internal)
4866         (Fset_window_buffer, Fset_window_new_total)
4867         (Fset_window_new_normal, Fdelete_window_internal)
4868         (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
4869         (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
4870         (Fwindow_scroll_bars): Check whether argument window is a valid or
4871         live window.  Update doc-strings.
4872         (syms_of_window): New symbol Qwindow_valid_p.
4873         * keyboard.c (Fposn_at_x_y): Check whether argument
4874         frame_or_window denotes a valid window.
4876 2012-08-16  Dmitry Antipov  <dmantipov@yandex.ru>
4878         Fix previous char table change.
4879         * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
4880         * chartab.c (optimize_sub_char_table): Likewise.
4882 2012-08-16  Chong Yidong  <cyd@gnu.org>
4884         * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
4886         * xfont.c (xfont_open):
4887         * xftfont.c (xftfont_open): Set the font's max_width field.
4889         * nsfont.m (nsfont_open): Similar to the Xft backend, set
4890         min_width to space_width and average_width to the average over
4891         printable ASCII characters.
4892         (ns_char_width): Code cleanup.
4893         (ns_ascii_average_width): New utility function.
4895         * font.h (struct font): Update comments.
4897 2012-08-16  Dmitry Antipov  <dmantipov@yandex.ru>
4899         Simple interface to set Lisp_Object fields of character tables.
4900         * lisp.h (CSET): New macro.
4901         (char_table_set_extras, char_table_set_contents)
4902         (sub_char_table_set_contents): New function.
4903         * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
4904         * syntax.c: Adjust users.
4906 2012-08-16  Stefan Monnier  <monnier@iro.umontreal.ca>
4908         * eval.c (eval_sub): Bind lexical-binding.
4909         * lread.c (Qlexical_binding): Make non-static.
4911 2012-08-15  Jan Djärv  <jan.h.d@swipnet.se>
4913         * nsmenu.m (popupSession): Remove.
4914         (pop_down_menu): Remove endModalSession.
4915         (timeout_handler:): New method.
4916         (runDialogAt:): Get next timeout.  Start a NSTimer with that timeout.
4917         Call runModalForWindow.  Check timer_fired when it returns.
4918         If not set, cancel timer and break out of loop.
4919         Otherwise loop again, with a new timeout.
4921         * nsterm.m: Include fcntl.h if present.
4922         (fd_entry, t_readfds, inNsSelect): Remove.
4923         (select_writefds, select_valid, select_timeout, selfds)
4924         (select_mutex, apploopnr): Add.
4925         (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
4926         Otherwise call kbd_buffer_store_event.
4927         (ns_send_appdefined): Remove release of fd_entry.
4928         (ns_read_socket): Always send appdefined.  Remove inNsSelect check.
4929         Increment and decrement apploopnr.
4930         (ns_select): If no file descriptors, just do a NSTimer.
4931         Otherwise copy read/write masks and start select thread (fd_handler).
4932         Start main loop and wait for application defined event.
4933         Inform select thread to stop selecting after main loop is exited.
4934         (ns_term_init): Create selfds pipe and set non-blocking.
4935         Initialize select_mutex.  Start the select thread (fd_handler).
4936         (fd_handler:): Loop forever, wait for info from the main thread
4937         to either start or stop selecting.  When select returns, send
4938         and appdefined event.
4939         (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
4940         If not call kbd_buffer_store_event.
4942         * nsterm.h (EmacsApp): fd_handler takes id argument.
4943         (EmacsDialogPanel): Add timer_fired and timeout_handler.
4945         * gtkutil.c (xg_mark_data): Use FRAME_X_P.
4947 2012-08-15  Eli Zaretskii  <eliz@gnu.org>
4949         * region-cache.c (move_cache_gap): Update gap_len using the actual
4950         growth of the boundaries array.  Do not change cache_len.
4951         (Bug#12196)
4953 2012-08-15  Dmitry Antipov  <dmantipov@yandex.ru>
4955         Generalize and cleanup font subsystem checks.
4956         * font.h (FONT_DEBUG, font_assert): Remove.
4957         * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
4958         Change font_assert to eassert.  Use eassert where appropriate.
4960 2012-08-15  Dmitry Antipov  <dmantipov@yandex.ru>
4962         * gtkutil.c (xg_get_font): Use pango_units_to_double.
4964 2012-08-15  Chong Yidong  <cyd@gnu.org>
4966         * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
4967         When using the new font chooser, use gtk_font_chooser_get_font_desc to
4968         extract the font descriptor instead of just the font name.
4969         In that case, return a font spec instead of a string.
4970         (x_last_font_name): Move to this file from xfns.c.
4972         * xfns.c (Fx_select_font): The return value can also be a font
4973         spec.  Move x_last_font_name management to gtkutil.c.
4975         * xfaces.c: Make font weight and style symbols non-static.
4977 2012-08-15  Stefan Monnier  <monnier@iro.umontreal.ca>
4979         * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
4980         (bug#12117).
4982 2012-08-14  Stefan Monnier  <monnier@iro.umontreal.ca>
4984         * alloc.c (Fgarbage_collect): Use plural form consistently.
4986 2012-08-14  Eli Zaretskii  <eliz@gnu.org>
4988         * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
4989         iteration through the command loop.  Fixes a problem whereby mouse
4990         movements are ignored until the first mouse click.
4992 2012-08-14  Paul Eggert  <eggert@cs.ucla.edu>
4994         Use bool, not int, for Lisp booleans.
4995         This is more natural, and on my platform (GCC 4.7.1 x86-64) it
4996         makes Emacs a bit smaller and presumably a bit faster.
4997         * lisp.h: Include <stdbool.h>.
4998         (struct Lisp_Boolfwd, defvar_bool):
4999         * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
5000         * regex.c [!emacs]: Include <stdbool.h>.
5001         (false, true): Remove; <stdbool.h> does this for us now.
5003 2012-08-14  Chong Yidong  <cyd@gnu.org>
5005         * character.c (Fcharacterp): Doc fix (Bug#12076).
5007         * data.c (Findirect_variable): Doc fix (Bug#11040).
5009         * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
5011         * editfns.c (Fformat): Doc fix (Bug#12059).
5012         (Fsave_current_buffer): Doc fix (Bug#11542).
5014 2012-08-14  Barry OReilly  <gundaetiapo@gmail.com>  (tiny change)
5016         * keyboard.c (access_keymap_keyremap): Accept anonymous functions
5017         (bug#12022).
5019 2012-08-14  Martin Rudalics  <rudalics@gmx.at>
5021         * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
5022         (delete_frame, Fmake_frame_invisible, Ficonify_frame):
5023         * minibuf.c (choose_minibuf_frame, read_minibuf):
5024         * w32fns.c (x_create_tip_frame):
5025         * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
5026         Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
5028 2012-08-14  Paul Eggert  <eggert@cs.ucla.edu>
5030         * intervals.c (offset_intervals): Remove obsolete comment.
5032 2012-08-14  Andreas Schwab  <schwab@linux-m68k.org>
5034         * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
5036 2012-08-14  Gergely Risko  <gergely@risko.hu>
5038         * coding.c (decode_coding): Record buffer modification before
5039         disabling undo_list (Bug#11773).
5041 2012-08-14  Dmitry Antipov  <dmantipov@yandex.ru>
5043         Revert and cleanup some recent overlay changes.
5044         * buffer.h (enum overlay_type): Remove.
5045         (buffer_get_overlays, buffer_set_overlays): Likewise.
5046         (buffer_set_overlays_before, buffer_set_overlays_after):
5047         New function.  Adjust users.
5048         (unchain_both): Add eassert.
5050 2012-08-14  Dmitry Antipov  <dmantipov@yandex.ru>
5052         * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
5054 2012-08-14  Paul Eggert  <eggert@cs.ucla.edu>
5056         * gtkutil.c (xg_mark_data): Don't assume C99.
5058 2012-08-13  Jan Djärv  <jan.h.d@swipnet.se>
5060         * gtkutil.c (xg_frame_tb_info): New struct.
5061         (TB_INFO_KEY): New define.
5062         (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
5063         (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
5064         (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
5065         if not present.
5066         (update_frame_tool_bar): Return early if data in xg_frame_tb_info
5067         is up to date.  Otherwise store new data.
5068         (free_frame_tool_bar): Free xg_frame_tb_info if present.
5070 2012-08-13  Dmitry Antipov  <dmantipov@yandex.ru>
5072         Use KSET for write access to Lisp_Object members of struct kboard.
5073         * keyboard.h (KSET): New macro.
5074         * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
5075         * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
5076         * xterm.c: Adjust users.
5078 2012-08-13  Dmitry Antipov  <dmantipov@yandex.ru>
5080         Use BSET for write access to Lisp_Object members of struct buffer.
5081         * buffer.h (BSET): New macro.
5082         * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
5083         * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
5084         * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
5085         * window.c, xdisp.c, xfns.c: Adjust users.
5087 2012-08-11  BT Templeton  <bpt@hcoop.net>  (tiny change)
5089         * lread.c (syms_of_lread): Initialize Vlexical_binding.
5091 2012-08-11  Jan Djärv  <jan.h.d@swipnet.se>
5093         * nsterm.m (not_in_argv): New function.
5094         (application:openFile, application:openTempFile:):
5095         (application:openFileWithoutUI:, application:openFiles:): Open file
5096         if not_in_argv returns non-zero (bug#12171).
5098         * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
5099         (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
5100         Define for Gtk+ versions less than 3.2.
5101         (xg_get_font_name): Use those functions/macros here.
5102         Reported by Frans Oilinki <moilinki@gmail.com>.
5104 2012-08-11  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
5106         * unexmacosx.c (copy_data_segment): Copy initialized data in
5107         statically linked libraries from input file rather than memory.
5109         * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
5110         LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
5111         (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
5113 2012-08-10  Glenn Morris  <rgm@gnu.org>
5115         * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
5116         * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
5118 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
5120         Fix last change to allow compilation with low optimization levels.
5121         * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
5122         Reported by Jan Djärv <jan.h.d@swipnet.se>.
5124 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
5126         Use common inline syntax in intervals.h.
5127         * intervals.h (INTERVALS_INLINE): New macro.
5128         Change all users from LISP_INLINE.
5130 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
5132         Define Qnone once for all platforms.
5133         * frame.c (Qnone): Define here.
5134         (syms_of_frame): DEFSYM it.
5135         * lisp.h (Qnone): New declaration.
5136         * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
5137         * xfns.c: Remove duplication.  Adjust users.
5139 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
5141         Remove unused macros from intervals.h.
5142         * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
5143         * intervals.c: Adjust comment.
5145 2012-08-10  Eli Zaretskii  <eliz@gnu.org>
5147         * w32fns.c <w32_unicode_gui>: New static variable.
5148         (globals_of_w32fns): Initialize it according to os_subtype.
5149         (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
5150         testing os_subtype.
5152 2012-08-10  Joakim Hårsman  <joakim.harsman@gmail.com>  (tiny change)
5153             Eli Zaretskii  <eliz@gnu.org>
5155         Fix bug #10299 with Unicode characters sent by customized
5156         keyboards created by MSKLC.
5157         * w32fns.c (INIT_WINDOW_CLASS): New macro.
5158         (w32_init_class): Use it to initialize the Emacs class with either
5159         ANSI or Unicode API calls.
5160         (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
5161         later.
5162         (w32_wnd_proc): If the character code sent by WM_CHAR or
5163         WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
5164         original message.  Call DefWindowProcW on NT and later.
5166 2012-08-10  Glenn Morris  <rgm@gnu.org>
5168         * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
5170         * lisp.h (DIRECTORY_SEP): Let configure set it.
5172 2012-08-09  Dmitry Antipov  <dmantipov@yandex.ru>
5174         Use TSET for write access to Lisp_Object slots of struct terminal.
5175         * termhooks.h (TSET): New macro.
5176         * coding.c, terminal.c, xselect.c: Adjust users.
5178 2012-08-08  Stefan Monnier  <monnier@iro.umontreal.ca>
5180         * xdisp.c (safe_eval_handler): Remove prototype.  Receive args describing
5181         the failing expression, include them in the error message.
5182         * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
5183         * lisp.h (internal_condition_case_n): Update declaration.
5185 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
5187         Inline functions to examine and change buffer overlays.
5188         * buffer.c (unchain_both): New function.
5189         * buffer.h (buffer_get_overlays, buffer_set_overlays):
5190         (buffer_has_overlays): New function.
5191         (enum overlay_type): New enum.
5192         * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
5193         * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
5195 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
5197         Inline functions to examine and change buffer intervals.
5198         * alloc.c (mark_interval_tree): Remove.
5199         (MARK_INTERVAL_TREE): Simplify.
5200         (UNMARK_BALANCE_INTERVALS): Remove.  Adjust users.
5201         * intervals.c (buffer_balance_intervals): New function.
5202         (graft_intervals_into_buffer): Adjust indentation.
5203         (set_intervals_multibyte): Simplify.
5204         * buffer.h (BUF_INTERVALS): Remove.
5205         (buffer_get_intervals, buffer_set_intervals): New function.
5206         * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
5207         * intervals.c, textprop.c: Adjust users.
5209 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
5211         Inline functions to examine and change string intervals.
5212         * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
5213         (string_get_intervals, string_set_intervals): New function.
5214         * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
5215         * lread.c, print.c, textprop.c: Adjust users.
5217 2012-08-08  Glenn Morris  <rgm@gnu.org>
5219         * lisp.mk (lisp): Remove language/persian.elc.
5221 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
5223         Cleanup intervals.
5224         * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
5225         (NULL_INTERVAL_P): Likewise.  Adjust users.
5226         (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
5227         Adjust comment.  Move under #if 0.
5228         * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
5229         * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
5231 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
5233         Check total length of intervals with eassert.
5234         * intervals.h (CHECK_TOTAL_LENGTH): Remove.
5235         * intervals.c: Change all users to eassert.
5237 2012-08-07  Eli Zaretskii  <eliz@gnu.org>
5239         * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
5240         Rename fields to match removal of FGET and WGET and disuse of
5241         INTERNAL_FIELD in Lisp_Cons.
5243 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
5245         Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
5246         * lisp.h (struct Lisp_Symbol): Change xname to meaningful
5247         name since all xname users are fixed long time ago.  Do not
5248         use INTERNAL_FIELD.
5249         (set_symbol_name, set_symbol_function, set_symbol_plist):
5250         (set_symbol_next, set_overlay_plist): New function.
5251         (struct Lisp_Cons): Do not use INTERNAL_FIELD.
5252         (struct Lisp_Overlay): Likewise.
5253         (CVAR, MVAR, SVAR): Remove.
5254         * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
5255         * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
5256         * xterm.c: Adjust users.
5257         * .gdbinit: Change to use name field of struct Lisp_Symbol
5258         where appropriate.
5260 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
5262         Basic functions to set Lisp_Object and pointer slots of intervals.
5263         * intervals.h (interval_set_parent, interval_set_object):
5264         (interval_set_left, interval_set_right, interval_set_plist):
5265         (interval_copy_parent): New function.
5266         (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
5267         (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
5268         Adjust indentation.
5269         (INTERVAL_SIZE): Remove.  Adjust users.
5270         * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
5272 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
5274         Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
5275         * process.h (PGET): Remove.
5276         (struct Lisp_Process): Do not use INTERNAL_FIELD.
5277         * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
5279 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
5281         Drop WGET and revert read access to Lisp_Objects slots of struct window.
5282         * window.h (WGET): Remove.
5283         (struct window): Do not use INTERNAL_FIELD.
5284         * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5285         * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5286         * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
5287         * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
5288         * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
5289         Adjust users.
5291 2012-08-07  Chong Yidong  <cyd@gnu.org>
5293         * window.c (Fwindow_edges, Fwindow_pixel_edges)
5294         (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
5295         (Fdelete_window_internal): Signal an error if the window is not on
5296         a live frame (Bug#12025).
5298 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
5300         Drop FGET and revert read access to Lisp_Objects slots of struct frame.
5301         * frame.h (FGET): Remove.
5302         (struct frame): Do not use INTERNAL_FIELD.
5303         * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
5304         * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
5305         * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5306         * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
5308 2012-08-06  Juanma Barranquero  <lekktu@gmail.com>
5310         * w32.c: Silence compiler warnings.
5311         (map_w32_filename): Remove unused variable `is_fat'.
5312         (chase_symlinks): Add parentheses around expression.
5314 2012-08-06  Glenn Morris  <rgm@gnu.org>
5316         * sysdep.c: Respect BROKEN_GETWD.
5318         * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
5319         Let configure handle it.
5320         (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
5322 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
5324         Use GCALIGNMENT where appropriate.
5325         * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
5326         (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
5327         (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
5329 2012-08-06  Eli Zaretskii  <eliz@gnu.org>
5331         * w32menu.c (set_frame_menubar, initialize_frame_menubar):
5332         Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5334 2012-08-06  Stefan Monnier  <monnier@iro.umontreal.ca>
5336         * buffer.h (struct buffer): Revert `indirections' to a simple int;
5337         that should be sufficient for everyone.
5339 2012-08-06  Jan Djärv  <jan.h.d@swipnet.se>
5341         * keyboard.c (timer_check_2): Add break so timer_check returns next
5342         timeout.
5344 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
5346         Fix Windows build errors introduced after converting to WGET and WSET.
5347         * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
5348         Reported by Andy Moreton <andrewjmoreton@gmail.com>.
5350 2012-08-06  Jan Djärv  <jan.h.d@swipnet.se>
5352         * nsterm.m (ns_frame_rehighlight): Use FSET.
5354         * nsmenu.m (ns_update_menubar): Use FSET.
5356 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
5358         Separate read and write access to Lisp_Object slots of Lisp_Process.
5359         * process.h (PGET, PSET): New macros similar to AREF and ASET.
5360         * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
5362 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
5364         Separate read and write access to Lisp_Object slots of struct window.
5365         * window.h (WGET, WSET): New macros similar to AREF and ASET.
5366         * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5367         * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5368         * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
5369         * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
5370         * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
5371         Adjust users.
5373 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
5375         Fix Windows build errors introduced after converting to FGET and FSET.
5376         * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
5377         (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
5378         (w32_judge_scroll_bars): Change to use FSET.
5379         Reported by Andy Moreton <andrewjmoreton@gmail.com>.
5381 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
5383         Fix replacement typo.
5384         * window.c (replace_window): Set root_window instead of
5385         selected_window.  This fixes a total window subsystem
5386         malfunction reported by Bastien Guerry <bzg@gnu.org>.
5388 2012-08-06  Glenn Morris  <rgm@gnu.org>
5390         * lisp.mk (lisp): Add language/persian.elc.
5392 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
5394         Separate read and write access to Lisp_Object slots of struct frame.
5395         * frame.h (FGET, FSET): New macros similar to AREF and ASET.
5396         * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
5397         * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
5398         * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5399         * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
5401 2012-08-05  Andreas Schwab  <schwab@linux-m68k.org>
5403         * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
5405 2012-08-05  Dmitry Antipov  <dmantipov@yandex.ru>
5407         Generalize common compile-time constants.
5408         * lisp.h (header_size, bool_header_size, word_size): Now here.
5409         (struct Lisp_Vector): Add comment.
5410         (struct Lisp_Bool_Vector): Move up to define handy constants.
5411         (VECSIZE, PSEUDOVECSIZE): Simplify.
5412         (SAFE_ALLOCA_LISP): Use new constant.  Adjust indentation.
5413         * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
5414         * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
5415         * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
5416         * xfont.c, xmenu.c: Use word_size where appropriate.
5418 2012-08-05  Lawrence Mitchell  <wence@gmx.li>
5420         * search.c (Freplace_match): Treat \? in the replacement text
5421         literally (Bug#8161).
5423 2012-08-05  Chong Yidong  <cyd@gnu.org>
5425         * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
5426         * frame.c (Vdelete_frame_functions):
5427         * emacs.c (Vkill_emacs_hook): Doc fix.
5429 2012-08-04  Eli Zaretskii  <eliz@gnu.org>
5431         * xfns.c (x_set_menu_bar_lines): Fix compilation error in
5432         --with-x-toolkit=no builds.
5433         Reported by Carsten Mattner <carstenmattner@gmail.com>.
5435 2012-08-04  Chong Yidong  <cyd@gnu.org>
5437         * syntax.c (Fmodify_syntax_entry): Doc fix.
5439 2012-08-04  Eli Zaretskii  <eliz@gnu.org>
5441         Fix startup warnings about ../site-lisp on MS-Windows.  (Bug#11959)
5442         * w32.c (init_environment): Change the default values of many
5443         environment variables in dflt_envvars[] to NULL, to avoid pushing
5444         them into environment when they were not already defined.
5445         Remove the code that deletes site-lisp subdirectories from the default
5446         value of EMACSLOADPATH, as it is no longer needed.
5447         (check_windows_init_file): Now external, not static.
5448         Use Vload_path as is, without adding anything, as this function is now
5449         called when Vload_path is already set up.
5451         * w32.h (check_windows_init_file): Add prototype.
5453         * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
5454         directory, ignore the /*/i386/ tail in Vinvocation_directory, for
5455         compatibility with Posix platforms.
5456         (main): Move the call to check_windows_init_file to here from
5457         w32.c.
5458         (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
5459         any, in the DEFALT argument into the root of the Emacs build or
5460         installation tree, as appropriate.
5462         * callproc.c (init_callproc_1): Call decode_env_path instead of
5463         doing its equivalent by hand.
5464         (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
5465         the code that sets Vexec_path run on MS-Windows.
5467         * lread.c (init_lread): Add comments to #ifdef's.
5469         * msdos.c (dos_set_window_size, IT_update_begin)
5470         (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
5471         instead of direct references.
5473 2012-08-04  Paul Eggert  <eggert@cs.ucla.edu>
5475         Export DEFAULT_REHASH_* to GDB.
5476         * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
5477         Now constants, not macros.
5479 2012-08-03  Paul Eggert  <eggert@cs.ucla.edu>
5481         Remove unnecessary casts involving pointers.
5482         These casts are no longer needed now that we assume C89 or later,
5483         since they involve casting to or from void *.
5484         * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
5485         (make_pure_float, make_pure_vector):
5486         * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
5487         * macros.c (Fstart_kbd_macro):
5488         * menu.c (find_and_return_menu_selection):
5489         * minibuf.c (read_minibuf_noninteractive):
5490         * sysdep.c (closedir):
5491         * xdisp.c (x_produce_glyphs):
5492         * xfaces.c (compare_fonts_by_sort_order):
5493         * xfns.c (x_real_positions, select_visual):
5494         * xselect.c (x_stop_queuing_selection_requests)
5495         (x_get_window_property, x_get_window_property_as_lisp_data):
5496         * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
5497         Remove unnecessary pointer casts.
5498         * alloc.c (record_xmalloc): New function.
5499         * lisp.h (record_xmalloc): New decl.
5500         (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
5501         more like a function.  This is because the pointer cast is not
5502         needed.  All uses changed.
5503         * print.c (print_string, print_error_message): Avoid length recalc.
5505         Improve fix for macroexp crash with debugging (Bug#12118).
5506         * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
5507         ARRAY_MARK_FLAG when checking subscripts, because ASET is
5508         not supposed to be invoked from the garbage collector.
5509         See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
5510         (gc_aset): New function, which is like ASET but can be
5511         used in the garbage collector.
5512         (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
5513         (set_hash_index): Use it instead of ASET.
5515 2012-08-03  Eli Zaretskii  <eliz@gnu.org>
5517         Support symlinks on latest versions of MS-Windows.
5518         * w32.c: Include winioctl.h and aclapi.h.
5519         (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
5520         (revert_to_self): Forward declarations of static functions.
5521         <static BOOL g_b_init_get_security_info>:
5522         <g_b_init_create_symbolic_link>: New static flags.
5523         (globals_of_w32): Initialize them to zero.
5524         (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
5525         (map_w32_filename): Improve commentary.  Simplify switch.
5526         (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
5527         headers (most versions of MinGW w32api don't).
5528         (get_security_info, create_symbolic_link)
5529         (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
5530         New functions.
5531         (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
5532         in the argument file name.
5533         (sys_access): Call unc_volume_file_attributes only if
5534         GetFileAttributes fails with network-related error codes.
5535         (sys_rename): Diagnose renaming of a symlink when the user doesn't
5536         have the required privileges.
5537         (get_file_security_desc_by_name): Rename from
5538         get_file_security_desc.
5539         (stat_worker): New function, with most of the guts of 'stat', and
5540         with addition of handling of symlinks and support for 'lstat'.
5541         If possible, get file's attributes and security information by
5542         handle, not by name.  Produce S_IFLNK bit for symlinks, when
5543         called from 'lstat'.
5544         (stat, lstat): New functions, call 'stat_worker'.
5545         (symlink, readlink, careadlinkat): Rewritten to create and resolve
5546         symlinks when the underlying filesystem supports them.
5548 2012-08-02  Paul Eggert  <eggert@cs.ucla.edu>
5550         Fix macroexp crash on Windows with debugging (Bug#12118).
5551         * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
5552         checking subscripts; problem introduced with the recent
5553         "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
5554         (ARRAY_MARK_FLAG): Now a macro as well as a constant,
5555         since it's used in non-static inline functions now.
5557         * xfaces.c (face_at_buffer_position, face_for_overlay_string):
5558         Don't assume buffer size fits in 'int'.  Remove unused local.
5560         Use C99-style 'extern inline' if available.
5561         * buffer.h (BUFFER_INLINE):
5562         * category.h (CATEGORY_INLINE):
5563         * character.h (CHARACTER_INLINE):
5564         * charset.h (CHARSET_INLINE):
5565         * composite.h (COMPOSITE_INLINE):
5566         * dispextern.h (DISPEXTERN_INLINE):
5567         * lisp.h (LISP_INLINE):
5568         * systime.h (SYSTIME_INLINE):
5569         New macro, replacing 'static inline' in this header.
5570         * buffer.h, category.h, character.h, charset.h, composite.h:
5571         * dispextern.h, lisp.h, systime.h:
5572         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5573         * alloc.c (LISP_INLINE):
5574         * buffer.c (BUFFER_INLINE):
5575         * category.c (CATEGORY_INLINE):
5576         * character.c (CHARACTER_INLINE):
5577         * charset.c (CHARSET_INLINE):
5578         * composite.c (COMPOSITE_INLINE):
5579         * dispnew.c (DISPEXTERN_INLINE):
5580         * sysdep.c (SYSTIME_INLINE):
5581         Define to EXTERN_INLINE, so that the corresponding functions
5582         are compiled into code.
5583         * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
5584         (INLINE_HEADER_END): New macros.
5585         * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
5586         since it's used in non-static inline functions now.
5587         (VALMASK) [!USE_LSB_TAG]: Likewise.
5589 2012-08-02  Glenn Morris  <rgm@gnu.org>
5591         * s/: Remove empty directory.
5593         * s/ms-w32.h: Move to ../nt/inc.
5594         * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
5595         Update for new ms-w32.h location.
5597 2012-08-02  Paul Eggert  <eggert@cs.ucla.edu>
5599         Port to Solaris 8.
5600         * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
5602 2012-08-02  Glenn Morris  <rgm@gnu.org>
5604         * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
5605         hard-coding the path separator.
5607 2012-08-01  Paul Eggert  <eggert@cs.ucla.edu>
5609         Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
5610         This how ASET and AREF are supposed to work, and makes
5611         it easier to think about future improvements.  See
5612         <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
5613         * charset.h (set_charset_attr): New function.
5614         All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
5615         * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
5616         (aref_addr): New function.  All uses of &AREF(...) changed.
5617         (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
5618         (set_hash_index): New functions.  All lvalue-style uses of
5619         HASH_KEY etc. changed.
5620         * keyboard.c (set_prop): New function.  All lvalue-style uses
5621         of PROP changed.
5623 2012-08-01  Alp Aker  <alp.tekin.aker@gmail.com>
5625         * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
5626         (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
5627         (EmacsScroller-dealloc): Adjust to use WVAR.  (Bug#12114)
5628         * nsfns.m (ns_set_name_as_filename): Likewise.
5629         * nsmenu.m (ns_update_menubar): Likewise.
5630         * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
5632 2012-08-01  Eli Zaretskii  <eliz@gnu.org>
5634         * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
5635         Adapt to latest changes in field names of the corresponding Lisp
5636         objects.
5638         * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
5640 2012-08-01  Glenn Morris  <rgm@gnu.org>
5642         * s/msdos.h: Remove file.
5643         * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
5644         * Makefile.in (S_FILE): Remove.
5645         (config_h): Remove S_FILE.
5647 2012-08-01  Juanma Barranquero  <lekktu@gmail.com>
5649         * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
5650         Remove; moved to nt/config.nt.
5652 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
5654         Use INTERNAL_FIELD for conses and overlays.
5655         * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
5656         Remove obsolete comment.
5657         (MVAR): New macro.
5658         (struct Lisp_Overlay): Use INTERNAL_FIELD.
5659         * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
5661 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
5663         Use INTERNAL_FIELD for symbols.
5664         * lisp.h (SVAR): New macro.  Adjust users.
5665         * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
5666         * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
5668 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
5670         Use INTERNAL_FIELD for processes.
5671         * process.h (PVAR): New macro.  Adjust style.
5672         (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
5673         * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
5675 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
5677         Use INTERNAL_FIELD for windows.
5678         * window.h (WVAR): New macro.
5679         (struct window): Change Lisp_Object members to INTERNAL_FIELD.
5680         * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5681         * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5682         * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
5683         * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
5684         * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
5686 2012-08-01  Paul Eggert  <eggert@cs.ucla.edu>
5688         * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
5690 2012-08-01  Glenn Morris  <rgm@gnu.org>
5692         * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
5693         Move to configure.ac.
5695 2012-08-01  Juanma Barranquero  <lekktu@gmail.com>
5697         * makefile.w32-in (CONFIG_H): Update dependencies.
5698         (CONF_POST_H): New macro.
5700         * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
5702 2012-07-31  Glenn Morris  <rgm@gnu.org>
5704         * Makefile.in (S_FILE): No longer set by configure.
5706         * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
5707         is available.
5708         (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
5710         * process.h (NULL_DEVICE):
5711         * emacs.c (SEPCHAR):
5712         * editfns.c (USER_FULL_NAME): Let configure set them.
5714         * s/README, s/template.h: Remove files.
5716         * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
5718         * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
5719         Move to configure.ac.
5721 2012-07-31  Eli Zaretskii  <eliz@gnu.org>
5723         * .gdbinit (xframe): Adapt to introduction of FVAR and the
5724         resulting renaming of 'struct frame' members.
5726         * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
5728         * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
5729         after introduction of FVAR.
5731 2012-07-31  Jan Djärv  <jan.h.d@swipnet.se>
5733         * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
5735         * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
5736         instead of compositeToPoint.
5737         (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
5739         * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
5741 2012-07-31  Dmitry Antipov  <dmantipov@yandex.ru>
5743         Generalize INTERNAL_FIELD between buffers, keyboards and frames.
5744         * lisp.h (INTERNAL_FIELD): New macro.
5745         * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
5746         (BVAR): Change to use INTERNAL_FIELD.
5747         * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
5748         (KVAR): Change to use INTERNAL_FIELD.
5749         * frame.h (FVAR): New macro.
5750         (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
5751         * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
5752         * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
5753         * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5754         * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
5756 2012-07-31  Dmitry Antipov  <dmantipov@yandex.ru>
5758         Miscellaneous fixes for non-default X toolkits.
5759         * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
5760         * xterm.c (x_frame_of_widget): Remove redundant prototype.
5761         Move under #ifdef USE_LUCID.
5762         (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
5763         definition and usage to avoid warnings.
5765 2012-07-31  Jan Djärv  <jan.h.d@swipnet.se>
5767         * nsterm.m (openFiles): Fix previous checkin.
5769 2012-07-31  Paul Eggert  <eggert@cs.ucla.edu>
5771         * indent.c (compute_motion): Remove unused local.
5773 2012-07-31  Glenn Morris  <rgm@gnu.org>
5775         * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
5777         * conf_post.h [USG5_4]:
5778         Move remaining contents of s/usg5-4-common.h here.
5779         * s/usg5-4-common.h: Remove file.
5781         * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
5782         * s/irix6-5.h: Remove file.
5784         * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
5785         * s/darwin.h: Remove file.
5787         * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
5788         * s/hpux10-20.h: Remove file, which is now empty.
5790 2012-07-30  Glenn Morris  <rgm@gnu.org>
5792         * conf_post.h: New, split from configure.ac's AH_BOTTOM.
5793         * Makefile.in (config_h): Add conf_post.h.
5794         * makefile.w32-in (CONFIG_H): Add conf_post.h.
5796 2012-07-30  Jan Djärv  <jan.h.d@swipnet.se>
5798         * nsterm.m (ns_do_open_file): New variable.
5799         (ns_term_init): Set ns_do_open_file to YES after run returns.
5800         (openFile, openTempFile, openFileWithoutUI, openFiles):
5801         Open files only if ns_do_open_file.
5803 2012-07-30  Paul Eggert  <eggert@cs.ucla.edu>
5805         * lisp.h (SWITCH_ENUM_CAST): Remove.  All uses removed.
5806         This no-op macro hasn't been needed for many years.
5807         * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
5809         Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
5810         * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
5811         * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
5812         gdb_make_enums_visible.
5813         (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
5814         (DIRECTORY_SEP): Now a constant, not a macro.
5816 2012-07-30  Eli Zaretskii  <eliz@gnu.org>
5818         * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
5819         w32_kbd_patch_key as the 2nd arg.  (Bug#12082)
5821         * w32term.c <w32_keyboard_codepage>: Renamed from
5822         keyboard_codepage and now external.  All users changed.
5824         * w32term.h: Add declaration of w32_keyboard_codepage.
5826         * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
5827         the codepage to translate keys to Unicode.  If this argument is
5828         -1, use the value returned by GetConsoleCP.  All callers changed.
5830 2012-07-30  Paul Eggert  <eggert@cs.ucla.edu>
5832         Update .PHONY listings in makefiles.
5833         * Makefile.in (.PHONY): Add all, mostlyclean, clean,
5834         bootstrap-clean, distclean, maintainer-clean, versioclean,
5835         extraclean, frc.
5837         * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
5838         This is a bit clearer.  Fix some commentary typos.
5840 2012-07-30  Glenn Morris  <rgm@gnu.org>
5842         * s/netbsd.h: Let configure include signal.h if needed.
5843         Remove file, which is now empty.
5845         * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
5846         Let configure set them.
5847         * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
5848         No more need to undefine.
5850 2012-07-30  Andreas Schwab  <schwab@linux-m68k.org>
5852         * keymap.c (Fkey_description): Don't remove 0x80 bit from
5853         non-single-byte char when adding meta modifier.  (Bug#12090)
5855 2012-07-30  Dmitry Antipov  <dmantipov@yandex.ru>
5857         Convert safe_call to use variable number of arguments.
5858         * xdisp.c (safe_call): Convert to use varargs.  Adjust users.
5859         (safe_call2): Fix comment.
5860         * lisp.h (safe_call): Adjust prototype.
5861         * coding.c (encode_coding_object): Change to use safe_call2.
5862         * xfaces.c (merge_face_heights): Change to use safe_call1.
5864 2012-07-30  Glenn Morris  <rgm@gnu.org>
5866         * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
5867         does that unconditionally.  Remove file, which is now empty.
5869         * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
5870         Remove empty files.
5872 2012-07-30  Paul Eggert  <eggert@cs.ucla.edu>
5874         Export to GDB most of lisp.h's remaining object-like macros.
5875         * lisp.h (min, max): Move earlier, because they're used earlier now.
5876         (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
5877         (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
5878         (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
5879         (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
5880         (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
5881         (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
5882         (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
5883         (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
5884         Now constants, for GDB.  They need not be macros.
5885         (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
5886         Now constants, for GDB, as well as macros, for static initializers.
5887         (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
5888         Move to after the definition of struct Lisp_Char_Table,
5889         since the former now needs that type defined.
5890         (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
5891         (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
5892         (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
5893         New enums, for gdb_make_enums_visible.
5894         (GLYPH_MODE_LINE_FACE): Remove; unused.
5895         * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
5896         (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
5897         CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
5898         enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
5899         enum maxargs, enum MAX_ALLOCA.
5900         (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
5901         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
5902         no longer needed, now that they are done in lisp.h.
5904 2012-07-30  Dmitry Antipov  <dmantipov@yandex.ru>
5906         Cleanup string bytes checking.
5907         * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove.  Convert
5908         all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
5909         (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
5910         (check_sblock, compact_small_strings): Simplify.
5912 2012-07-29  Paul Eggert  <eggert@cs.ucla.edu>
5914         * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
5915         These macros are confusing and no longer need to be defined, as
5916         the enum values now suffice.  All uses replaced with definiens.
5917         (Lisp_Int1, Lisp_String): Define directly; this is clearer.
5919 2012-07-29  Juanma Barranquero  <lekktu@gmail.com>
5921         * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
5922         ($(BLD)/w32console.$(O)): Update dependencies.
5924 2012-07-29  Dmitry Antipov  <dmantipov@yandex.ru>
5926         Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
5927         * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
5928         time.  Adjust users.
5929         (CHECK_CONS_LIST): Remove.  Convert all users to check_cons_list.
5931 2012-07-29  Jan Djärv  <jan.h.d@swipnet.se>
5933         * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
5934         setting sitelisp (Bug#12010).
5936 2012-07-29  Eli Zaretskii  <eliz@gnu.org>
5938         * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
5940         * w32heap.c (cache_system_info):
5941         * w32.c (sys_rename):
5942         * w32proc.c (find_child_console, sys_kill): All users changed.
5944 2012-07-29  Paul Eggert  <eggert@cs.ucla.edu>
5946         * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
5948 2012-07-29  Eli Zaretskii  <eliz@gnu.org>
5950         * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
5952 2012-07-29  Dmitry Antipov  <dmantipov@yandex.ru>
5954         Cleanup statistics calculation in Fgarbage_collect.
5955         * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
5956         Fix zombies percentage calculation.  Simplify elapsed time calculation.
5958 2012-07-29  Dmitry Antipov  <dmantipov@yandex.ru>
5960         Generalize marker debugging code under MARKER_DEBUG and use eassert.
5961         * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
5962         (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
5963         (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
5964         (replace_range, replace_range_2, del_range_2): Change to eassert.
5965         * marker.c (byte_char_debug_check): Adjust style.
5967 2012-07-29  Paul Eggert  <eggert@cs.ucla.edu>
5969         Don't use the abbreviation "win" to refer to Windows (Bug#10421).
5970         * regex.c (MAX_BUF_SIZE): Remove some incorrect and
5971         long-ago-commented-out code that talks about "WIN32".
5972         * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
5973         All uses changed.
5975 2012-07-28  Paul Eggert  <eggert@cs.ucla.edu>
5977         Use Gnulib stdalign module (Bug#9772, Bug#9960).
5978         * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
5979         Simplify by using alignof.
5980         (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
5981         * lisp.h: Include <stdalign.h>.
5982         (GCALIGNMENT): New macro and constant.
5983         (DECL_ALIGN): Remove.  All uses replaced by alignas (GCALIGNMENT).
5984         (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
5985         (stdalign): New macro, if not already defined.
5987 2012-07-28  Eli Zaretskii  <eliz@gnu.org>
5989         Fix non-ASCII input in non-GUI frames on MS-Windows.  (Bug#12055)
5990         * w32inevt.c: Include w32inevt.h.
5991         (w32_read_console_input): New inline function, calls either
5992         ReadConsoleInputA or ReadConsoleInputW, depending on the value of
5993         w32_console_unicode_input.
5994         (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
5995         (w32_kbd_patch_key, key_event): Use the codepage returned by
5996         GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
5997         (key_event): use uChar.UnicodeChar only if
5998         w32_console_unicode_input is non-zero.
6000         * w32console.c: Include w32heap.h.
6001         <w32_console_unicode_input>: New global variable.
6002         (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
6003         family of Windows, zero otherwise.
6005         * w32inevt.h: Declare w32_console_unicode_input.
6007         * xdisp.c (init_iterator): Don't reference tip_frame in a build
6008         --without-x.  (Bug#11742)
6010 2012-07-27  Paul Eggert  <eggert@cs.ucla.edu>
6012         Adjust GDB to reflect pvec_type changes (Bug#12036).
6013         * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
6014         2012-07-04 changes to pseudovector representation.
6015         Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
6017 2012-07-27  Michael Albinus  <michael.albinus@gmx.de>
6019         * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
6020         bus address.
6021         (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
6023 2012-07-27  Eli Zaretskii  <eliz@gnu.org>
6025         * alloc.c (listn): Fix the order the arguments are consed onto the
6026         list.
6028         * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
6029         enumeration constants, as PURE and HEAP are too general, and clash
6030         with other headers and sources, such as gmalloc.c and the
6031         MS-Windows system headers.  All users changed.
6033 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
6035         Revert last save_excursion_save and save_excursion_restore changes.
6036         * alloc.c, editfns.c, marker.c, lisp.h: Revert.
6037         Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
6039 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
6041         Fix recently-introduced typos in Windows port.
6042         Reported by Martin Rudalics <rudalics@gmx.at>.
6043         * w32.c (init_environment): Replace comma with semicolon.
6044         * w32fns.c (syms_of_w32fns): Add missing parenthesis.
6046 2012-07-27  Paul Eggert  <eggert@cs.ucla.edu>
6048         Improve GDB symbol export (Bug#12036).
6049         * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
6050         arms of an 'if', not using conditional expressions; otherwise GDB
6051         complains about the types in the unevaluated arm when the argument
6052         is an integer literal.
6053         (xgetint): Simplify expression.
6054         * alloc.c (gdb_make_enums_visible): New constant.  This ports to
6055         GCC 3.4.2 the export of symbols to GDB.  Problem reported by Eli
6056         Zaretskii in <http://bugs.gnu.org/12036#13>.
6057         * lisp.h (PUBLISH_TO_GDB): Remove.  All uses removed.  No longer
6058         needed now that we have gdb_make_enums_visible.
6059         (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
6060         (enum enum_USE_LSB_TAG):
6061         New enum types, packaging up enums that need to be exported to GDB.
6063 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
6065         Utility function to make a list from specified amount of objects.
6066         * lisp.h (enum constype): New datatype.
6067         (listn): New prototype.
6068         * alloc.c (listn): New function.
6069         (Fmemory_use_count, syms_of_alloc): Use it.
6070         * buffer.c (syms_of_buffer): Likewise.
6071         * callint.c (syms_of_callint): Likewise.
6072         * charset.c (define_charset_internal): Likewise.
6073         * coding.c (syms_of_coding): Likewise.
6074         * keymap.c (syms_of_keymap): Likewise.
6075         * search.c (syms_of_search): Likewise.
6076         * syntax.c (syms_of_syntax): Likewise.
6077         * w32.c (init_environment): Likewise.
6078         * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
6079         * xdisp.c (syms_of_xdisp): Likewise.
6080         * xfns.c (syms_of_xfns): Likewise.
6082 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
6084         Fast save_excursion_save and save_excursion_restore.
6085         * lisp.h (struct Lisp_Excursion): New data type.
6086         (PVEC_EXCURSION): New pseudovector type.
6087         (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
6088         to deal with it.  Adjust comments.
6089         (init_marker, attach_marker): New prototype.
6090         (unchain_marker): Adjust prototype.
6091         * marker.c (attach_marker): Change to global.
6092         (init_marker): New function.
6093         * alloc.c (Fmake_marker, build_marker): Use it.
6094         (build_marker): More easserts.
6095         (mark_object): Handle struct Lisp_Excursion.
6096         * editfns.c (save_excursion_save, save_excursion_restore):
6097         Reimplement to use struct Lisp_Excursion.  Add comments.
6099 2012-07-26  Paul Eggert  <eggert@cs.ucla.edu>
6101         Fix export of symbols to GDB (Bug#12036).
6102         * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
6103         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
6104         emacs.c, as this is a more-suitable home.  Had this been done earlier
6105         the fix for 12036 would have avoided some of the problems noted in
6106         <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
6107         would have been more obvious.
6108         * emacs.c: Do not include <verify.h>; no longer needed.
6109         (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
6110         (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
6111         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
6112         Remove; now done in lisp.h.
6113         * lisp.h (PUBLISH_TO_GDB): New macro.
6114         (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
6115         (DATA_SEG_BITS): Use it.
6116         (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
6117         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
6118         * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
6119         not be usable in #if.  This simplifies things.
6121 2012-07-26  Juanma Barranquero  <lekktu@gmail.com>
6123         * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
6125 2012-07-26  Paul Eggert  <eggert@cs.ucla.edu>
6127         Simplify export of symbols to GDB (Bug#12036).
6128         * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
6129         $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
6130         (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
6131         Adjust to changes in lisp.h and emacs.c, by using
6132         CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
6133         of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
6134         INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
6135         gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
6136         instead of gdb_valbits.
6137         (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
6138         PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
6139         instead of gdb_array_mark_flag.
6140         (xboolvector): Get size from $->size, not $->header.size.
6141         Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
6142         (xreload, hook-run, hookpost-run): Remove.
6143         * emacs.c: Include <verify.h>.
6144         (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
6145         (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
6146         Remove.
6147         (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
6148         (gdb_USE_LSB_TAG): New enum constants.
6149         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
6150         Also define these as enum constants, so they're visible to GDB.
6151         (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
6152         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
6153         as constants, so they're visible to GDB.
6154         * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
6155         (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
6156         Now enum constants, not macros, so they're visible to GDB.
6157         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
6158         more convenient now.  All uses changed.
6159         (VALMASK) [USE_LSB_TAG]: Also define in this case.
6160         * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
6162 2012-07-26  Dmitry Antipov  <dmantipov@yandex.ru>
6164         Explicitly free restriction data that are not needed anymore.
6165         * editfns.c (save_restriction_restore): Free restriction data.
6167 2012-07-26  Stefan Monnier  <monnier@iro.umontreal.ca>
6169         * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
6170         add argument, tune behavior, and adjust all callers.
6172 2012-07-25  Paul Eggert  <eggert@cs.ucla.edu>
6174         Use typedef for EMACS_INT, EMACS_UINT.
6175         * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
6176         than macros.  This simplifies debugging in the usual case, since
6177         it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
6178         and it allows expressions involving EMACS_INT casts.
6179         * .gdbinit (xreload): Simplify by using EMACS_INT cast.
6181 2012-07-25  Jan Djärv  <jan.h.d@swipnet.se>
6183         * nsterm.m (ns_read_socket): Return early if there is a modal
6184         window (Bug#12043).
6186 2012-07-25  Martin Rudalics  <rudalics@gmx.at>
6188         * frame.c (Fredirect_frame_focus): In doc-string don't mention
6189         that FOCUS-FRAME can be omitted.
6191 2012-07-25  Dmitry Antipov  <dmantipov@yandex.ru>
6193         Adjust buffer text indirection counters at the end of Fkill_buffer.
6194         * buffer.c (Fkill_buffer): Adjust indirection counters when the
6195         buffer is definitely dead.  This should really fix an issue reported
6196         by Christoph Scholtes again.  (Bug#12007).
6197         (init_buffer_once): Initialize indirection counters of
6198         buffer_defaults and buffer_local_symbols (for sanity and safety).
6200 2012-07-24  Eli Zaretskii  <eliz@gnu.org>
6202         * xdisp.c (init_iterator): Don't compute dimensions of truncation
6203         and continuation glyphs on tooltip frames, leave them at zero.
6204         Avoids continued lines in tooltips.  (Bug#11832)
6206 2012-07-24  Dmitry Antipov  <dmantipov@yandex.ru>
6208         Simplify copy_overlay.
6209         * buffer.c (copy_overlay): Simplify.  Use build_marker.
6210         * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
6212 2012-07-23  Eli Zaretskii  <eliz@gnu.org>
6214         * print.c (print_object): Don't crash when a frame's name is nil
6215         or invalid.  (Bug#12025)
6217         * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
6218         it signals an error when a tooltip frame is being created.
6220 2012-07-23  Dmitry Antipov  <dmantipov@yandex.ru>
6222         Cleanup miscellaneous objects allocation and initialization.
6223         * alloc.c (allocate_misc): Change to static.  Add argument to
6224         specify the subtype.  Adjust comment and users.
6225         (build_overlay): New function.
6226         * buffer.c (copy_overlays, Fmake_overlay): Use it.
6227         * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
6228         (allocate_misc): Remove prototype.
6229         (build_overlay): Add prototype.
6231 2012-07-23  Dmitry Antipov  <dmantipov@yandex.ru>
6233         Swap buffer text indirection counters in Fbuffer_swap_text.
6234         * buffer.c (Fbuffer_swap_text): Swap indirections too.
6235         This avoids crash reported by Christoph Scholtes at
6236         http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
6238 2012-07-22  Jan Djärv  <jan.h.d@swipnet.se>
6240         * nsmenu.m (Popdown_data): New struct.
6241         (pop_down_menu): p->pointer is Popdown_data.  Release the pool and
6242         free Popdown_data.
6243         (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
6244         (initWithContentRect): Make imgView and contentView non-static
6245         and autorelease them.  Also autorelease img and matrix (Bug#12005).
6246         (dealloc): Remove (Bug#12005).
6248 2012-07-22  Dmitry Antipov  <dmantipov@yandex.ru>
6250         Adjust consing_since_gc when objects are explicitly freed.
6251         * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
6252         (Fgarbage_collect): Use it.  Change minimum to 1/10 of default.
6253         (free_cons, free_misc): Subtract object size from consing_since_gc.
6255 2012-07-22  Dmitry Antipov  <dmantipov@yandex.ru>
6257         Simplify and cleanup markers positioning code.
6258         * marker.c (attach_marker): More useful eassert.
6259         (live_buffer, set_marker_internal): New function.
6260         (Fset_marker, set_marker_restricted): Use set_marker_internal.
6261         (set_marker_both, set_marker_restricted_both): Use live_buffer.
6263 2012-07-22  Paul Eggert  <eggert@cs.ucla.edu>
6265         * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
6266         as it's limited by the amount of memory, not by INT_MAX.
6268 2012-07-21  Eli Zaretskii  <eliz@gnu.org>
6270         * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
6271         in special-event-map.  See the discussion at
6272         http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
6273         for the reasons.
6275         * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
6276         info.dwItemData.  Fixes crashes on 64-bit Windows.
6277         Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
6279 2012-07-21  Jan Djärv  <jan.h.d@swipnet.se>
6281         * nsterm.m (accessibilityAttributeValue): New function.  (Bug#11134).
6282         (conversationIdentifier): Return value is NSInteger.
6283         * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
6285 2012-07-21  Chong Yidong  <cyd@gnu.org>
6287         * window.c (decode_any_window): Signal an error if the window is
6288         on a dead frame (Bug#11984).
6290 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
6292         Add indirection counting to speed up Fkill_buffer.
6293         * buffer.h (struct buffer): New member.
6294         * buffer.c (Fget_buffer_create): Set indirection counter to 0.
6295         (Fmake_indirect_buffer): Set indirection counter to -1, increment
6296         base buffer indirection counter.
6297         (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
6298         (Fkill_buffer): Adjust indirection counters as needed, don't walk
6299         through buffer list if indirection counter is 0.
6301 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
6303         Extend the value returned by Fgarbage_collect with heap statistics.
6304         * alloc.c (Qheap): New symbol.
6305         (syms_of_alloc): DEFSYM it.
6306         (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
6307         (Fmemory_free): Remove.
6308         (syms_of_alloc): Don't defsubr it.
6309         * buffer.c (Fcompact_buffer): Remove.
6310         (syms_of_buffer): Don't defsubr it.
6312 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
6314         Make maybe_gc inline.
6315         Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
6316         * lisp.h (consing_since_gc, gc_relative_threshold)
6317         (memory_full_cons_threshold): Revert declaration.
6318         (maybe_gc): Remove prototype, define as inline.
6319         * alloc.c: Remove old commented-out code.
6320         (consing_since_gc, gc_relative_threshold)
6321         (memory_full_cons_threshold): Revert to global.
6322         (maybe_gc): Remove.
6324 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
6326         Simple wrapper for make_unibyte_string, adjust font_open_by_name.
6327         * lisp.h (build_unibyte_string): New function.
6328         * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
6329         * sysdep.c, w32fns.c, xfns.c: Use it.
6330         * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
6331         of type Lisp_Object to avoid redundant calls to make_unibyte_string.
6332         Adjust users accordingly.
6333         * font.h (font_open_by_name): Adjust prototype.
6335 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
6337         Cleanup calls to Fgarbage_collect.
6338         * lisp.h (maybe_gc): New prototype.
6339         (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
6340         Remove declarations.
6341         * alloc.c (maybe_gc): New function.
6342         (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
6343         Make them static.
6344         * bytecode.c (MAYBE_GC): Use maybe_gc.
6345         * eval.c (eval_sub, Ffuncall): Likewise.
6346         * keyboard.c (read_char): Likewise.  Adjust call to maybe_gc
6347         to avoid dependency from auto-save feature.
6349 2012-07-19  Paul Eggert  <eggert@cs.ucla.edu>
6351         * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
6352         (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
6353         'for_each_per_buffer_object_at'.
6354         All uses changed.  It's better to use upper-case for macros that
6355         cannot be implemented as functions, to give the reader a clue
6356         that they're special.
6358 2012-07-19  Stefan Monnier  <monnier@iro.umontreal.ca>
6360         * alloc.c (Fgarbage_collect): Tweak docstring.
6362 2012-07-19  Dmitry Antipov  <dmantipov@yandex.ru>
6364         Tweak the value returned from Fgarbage_collect again.
6365         * alloc.c (Fgarbage_collect): New return value, as confirmed in
6366         http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
6367         Adjust documentation.
6368         (total_vector_bytes): Rename to total_vector_slots, adjust
6369         accounting.
6370         (total_free_vector_bytes): Rename to total_free_vector_slots,
6371         adjust accounting.
6372         (Qstring_bytes, Qvector_slots): New symbols.
6373         (syms_of_alloc): DEFSYM them.
6375 2012-07-19  Dmitry Antipov  <dmantipov@yandex.ru>
6377         Buffer compaction primitive which may be used from Lisp.
6378         * buffer.c (compact_buffer, Fcompact_buffer): New function.
6379         (syms_of_buffer): Register Fcompact_buffer.
6380         * alloc.c (Fgarbage_collect): Use compact_buffer.
6381         * buffer.h (compact_buffer): New prototype.
6382         (struct buffer_text): New member.
6384 2012-07-19  Dmitry Antipov  <dmantipov@yandex.ru>
6386         New macro to iterate over all buffers, miscellaneous cleanups.
6387         * lisp.h (all_buffers): Remove declaration.
6388         * buffer.h (all_buffers): Add declaration, with comment.
6389         (for_each_buffer): New macro.
6390         * alloc.c (Fgarbage_collect, mark_object): Use it.
6391         * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
6392         (init_buffer): Likewise.
6393         * data.c (Fset_default): Likewise.
6394         * coding.c (code_conversion_restore): Remove redundant check
6395         for dead buffer.
6396         * buffer.c (Fkill_buffer): Likewise.  Remove obsolete comment.
6398 2012-07-18  Andreas Schwab  <schwab@linux-m68k.org>
6400         Fix bug that created negative-length intervals.
6401         * intervals.c (merge_interval_right, merge_interval_left):
6402         Do not zero out this interval if it is absorbed by its children,
6403         as this interval's total length doesn't change in that case.  See
6404         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
6406 2012-07-18  Paul Eggert  <eggert@cs.ucla.edu>
6408         * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
6409         when invoking (make-bool-vector N t) and N is a positive
6410         multiple of 8 -- the last 8 bits were mistakenly cleared.
6412         Remove some struct layout assumptions in bool vectors.
6413         * alloc.c (bool_header_size): New constant.
6414         (header_size, word_size): Move earlier, as they're now used earlier.
6415         Use 'word_size' in a few more places, where it's appropriate.
6416         (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
6417         padding before the data member of a bool vector.
6418         (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
6419         than doing the check by hand with an abort ().
6421 2012-07-18  Stefan Monnier  <monnier@iro.umontreal.ca>
6423         * eval.c (Fdefvar): Don't check constants since we only set the var if
6424         it's not yet defined anyway (bug#11904).
6426         * lisp.h (last_undo_boundary): Declare new var.
6427         * keyboard.c (command_loop_1): Set it.
6428         * cmds.c (Fself_insert_command): Use it to only remove boundaries that
6429         were auto-added by the command loop (bug#11774).
6431 2012-07-18  Andreas Schwab  <schwab@linux-m68k.org>
6433         * w32font.c (Qsymbol): Remove local definition.
6434         (syms_of_w32font): Don't DEFSYM it.
6436 2012-07-18  Dmitry Antipov  <dmantipov@yandex.ru>
6438         Fix sweep_vectors to handle large bool vectors correctly.
6439         * alloc.c (sweep_vectors): Account total_vector_bytes for
6440         bool vectors larger than VBLOCK_BYTES_MAX.
6442 2012-07-18  Chong Yidong  <cyd@gnu.org>
6444         * frame.c (x_set_frame_parameters): Revert bogus change introduced
6445         in 2012-05-25 commit by Paul Eggert (Bug#11738).
6447 2012-07-18  Dmitry Antipov  <dmantipov@yandex.ru>
6449         Return more descriptive data from Fgarbage_collect.
6450         Suggested by Stefan Monnier in
6451         http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
6452         * alloc.c (bounded_number): New function.
6453         (total_buffers, total_vectors): New variable.
6454         (total_string_size): Rename to total_string_bytes, adjust users.
6455         (total_vector_size): Rename to total_vector_bytes, adjust users.
6456         (sweep_vectors): Account total_vectors and total_vector_bytes.
6457         (Fgarbage_collect): New return value.  Adjust documentation.
6458         (gc_sweep): Account total_buffers.
6459         (Fmemory_free, Fmemory_use_counts): Use bounded_number.
6460         (VECTOR_SIZE): Remove.
6461         * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
6462         (Qinterval, Qmisc): New symbols.
6463         (syms_of_data): Initialize them.
6464         * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
6465         (Qcons, Qbuffer): New declarations.
6467 2012-07-17  Paul Eggert  <eggert@cs.ucla.edu>
6469         * alloc.c (Fmemory_free): Account for memory-free's own storage.
6470         Round up, not down.  Improve doc.
6472 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
6474         Restore old code in allocate_string_data to avoid Faset breakage.
6475         Reported by Julien Danjou <julien@danjou.info> in
6476         http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
6477         * alloc.c (allocate_string_data): Restore old code with minor
6478         adjustments, fix comment to explain this subtle issue.
6480 2012-07-17  Eli Zaretskii  <eliz@gnu.org>
6482         Remove FILE_SYSTEM_CASE.
6483         * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
6485         * fileio.c (FILE_SYSTEM_CASE): Don't define.
6486         (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
6487         Fixes problems on MS-DOS with Vtemp_file_name_pattern when
6488         call-process-region passes it through expand-file-name.
6490         * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
6492 2012-07-17  Andreas Schwab  <schwab@linux-m68k.org>
6494         Fix crash when creating indirect buffer (Bug#11917)
6495         * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
6496         Don't handle unbound variables specially if non-zero.
6497         (Fbuffer_local_variables): Pass zero.
6498         (clone_per_buffer_values): Pass non-zero.
6500 2012-07-17  Andreas Schwab  <schwab@linux-m68k.org>
6502         * gnutls.c (emacs_gnutls_handshake): Revert last change.  Add QUIT
6503         to make the loop interruptible.
6505 2012-07-17  Andreas Schwab  <schwab@linux-m68k.org>
6507         * gnutls.c (emacs_gnutls_handshake): Only retry if
6508         GNUTLS_E_INTERRUPTED.
6510 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
6512         Cleanup and convert miscellaneous checks to eassert.
6513         * alloc.c (mark_interval): Fix comment, partially rephrase
6514         old comment from intervals.h (see below).
6515         * intervals.c (find_interval, adjust_intervals_for_insertion)
6516         (delete_interval, adjust_intervals_for_deletion)
6517         (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
6518         Convert to eassert.
6519         (adjust_intervals_for_insertion, make_new_interval):
6520         Remove obsolete and unused code.
6521         * intervals.h (struct interval): Remove obsolete comment.
6522         * textprotp.c (erase_properties): Remove unused code.
6523         (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
6524         (Fremove_list_of_text_properties): Convert to eassert.
6526 2012-07-17  Chong Yidong  <cyd@gnu.org>
6528         * editfns.c (Finsert_char): Doc fix.
6530 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
6532         Fix previous change to make Fmemory_free always accurate.
6533         * alloc.c (make_interval): Update total_free_intervals.
6534         (make_float): Likewise for total_free_floats.
6535         (free_cons, Fcons): Likewise for total_free_conses.
6536         (SETUP_ON_FREE_LIST, allocate_vector_from_block):
6537         Likewise for total_free_vector_bytes.
6538         (Fmake_symbol): Likewise for total_free_symbols.
6539         (bytes_free): Remove.
6541 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
6543         Simple free memory accounting feature.
6544         * alloc.c (bytes_free, total_free_vector_bytes): New variable.
6545         (sweep_vectors): Accumulate size of free vectors.
6546         (Fgarbage_collect): Setup bytes_free.
6547         (Fmemory_free): New function.
6548         (syms_of_alloc): Register it.
6550 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
6552         Cleanup overlays checking.
6553         * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
6554         * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
6555         eassert and OVERLAYP.
6556         (sort_overlays): Change to use OVERLAYP.
6558 2012-07-16  René Kyllingstad  <Rene@Kyllingstad.com>  (tiny change)
6560         * editfns.c (Finsert_char): Make it interactive, and make the
6561         second arg optional.  Copy interactive spec and docstring from
6562         ucs-insert.
6564 2012-07-17  Paul Eggert  <eggert@cs.ucla.edu>
6566         * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
6567         Unlike the other wrapped functions, fabs has an unspecified
6568         effect on errno.
6570 2012-07-16  Jan Djärv  <jan.h.d@swipnet.se>
6572         * nsterm.m (keyDown): Interpret flags without left/right bits
6573         as the left key (Bug#11670).
6575 2012-07-16  Dmitry Antipov  <dmantipov@yandex.ru>
6577         Remove empty and useless init functions.
6578         * lisp.h (init_character_once, init_fns, init_image)
6579         (init_filelock, init_sound): Remove prototype.
6580         * character.c (init_character_once): Remove.
6581         * filelock.c (init_filelock): Likewise.
6582         * fns.c (init_fns): Likewise.
6583         * image.c (init_image): Likewise.
6584         * sound.c (init_sound): Likewise.
6585         * emacs.c (main): Adjust accordingly.
6587 2012-07-16  Dmitry Antipov  <dmantipov@yandex.ru>
6589         * gtkutil.h: Tiny cleanups.
6590         (use_old_gtk_file_dialog): Remove useless declaration.
6591         (xg_uses_old_file_dialog): Add suggested const attribute.
6593 2012-07-15  Eli Zaretskii  <eliz@gnu.org>
6595         * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
6596         (bidi_paragraph_init): Use it to limit search forward for a strong
6597         directional character in abnormally large paragraphs full of
6598         neutral or weak characters.  (Bug#11943)
6600 2012-07-15  Stefano Facchini  <stefano.facchini@gmail.com>  (tiny change)
6602         * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
6603         the toolbar (Bug#9451).
6604         (xg_make_tool_item): Give the widget event box a transparent
6605         background.
6607 2012-07-15  Dmitry Antipov  <dmantipov@yandex.ru>
6609         Cleanup basic allocation variables and functions.
6610         * alloc.c (ignore_warnings, init_intervals, init_float)
6611         (init_cons, init_symbol, init_marker): Remove.
6612         (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
6613         (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
6614         (cons_block_index): Initialize to CONS_BLOCK_SIZE.
6615         (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
6616         (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
6617         (staticidx, init_alloc_once, init_strings, free_ablock):
6618         Remove redundant initialization.
6619         * fns.c (init_weak_hash_tables): Remove.
6620         * lisp.h (init_weak_hash_tables): Remove prototype.
6622 2012-07-15  Dmitry Antipov  <dmantipov@yandex.ru>
6624         Use zero_vector where appropriate.
6625         * alloc.c (zero_vector): Define as Lisp_Object.  Adjust users
6626         accordingly.
6627         * lisp.h (zero_vector): New declaration.
6628         * font.c (null_vector): Remove.
6629         (syms_of_font): Remove initialization and staticpro.
6630         (font_list_entities, font_find_for_lface): Change to use zero_vector.
6631         * keymap.c (Faccessible_keymaps): Likewise.
6633 2012-07-15  Leo Liu  <sdl.web@gmail.com>
6635         * fringe.c: Fix typo in comments.
6637 2012-07-14  Leo Liu  <sdl.web@gmail.com>
6639         * fringe.c: Add a new bitmap exclamation-mark.
6641 2012-07-14  Eli Zaretskii  <eliz@gnu.org>
6643         * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
6645         * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
6646         (HAVE_MENUS): Don't define, defined by editing config.in with
6647         msdos/sed2v2.inp.
6648         (GMALLOC_INHIBIT_VALLOC): Don't define.
6649         (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
6651 2012-07-14  Juanma Barranquero  <lekktu@gmail.com>
6653         * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
6655 2012-07-14  Glenn Morris  <rgm@gnu.org>
6657         * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
6658         * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
6659         Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
6661 2012-07-13  Glenn Morris  <rgm@gnu.org>
6663         * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
6665         * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
6666         * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
6668 2012-07-13  Jan Djärv  <jan.h.d@swipnet.se>
6670         * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
6671         (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
6672         (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
6673         (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
6674         where appropriate.
6675         (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
6676         as boolean expression.
6677         (x_set_window_size): Remove unused variable toolbar.
6678         (ns_get_color_default, ns_mod_to_lisp): Remove.
6679         (ns_mouse_position): Remove unused variables xchar and ychar.
6680         (ns_compute_glyph_string_overhangs): Remove unused variable face.
6681         (ns_set_vertical_scroll_bar): Remove unused variable count.
6682         (ns_delete_terminal): Remove unused variable i.
6683         (ns_term_init): Remove unused variables r, g and b.
6684         (mouseDown): Remove unused variable window.
6685         (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
6686         (initFrameFromEmacs): Remove unused variable vbextra.
6687         (mouseEntered): Remove unused variables p and dpyinfo.
6688         (mouseExited): Remove unused variables p and r.
6689         (ns_define_frame_cursor, ns_clear_frame_area)
6690         (ns_draw_window_cursor, ns_initialize_display_info): Make static.
6691         (menuDown): Assign [sender tag] to variable and cast the variable.
6693         * nsterm.h (menuDown): Add id as type to argument sender.
6694         (ns_display_info_for_name): Add Lisp_Object argument.
6695         (ns_term_init): Add Lisp_Object argument.
6696         (ns_map_event_to_object): Add void argument.
6697         (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
6698         prototype with arguments and only declare if __OBJC__.
6699         (nxatoms_of_nsselect): Add void argument.
6700         (ns_lisp_to_cursor_type): Add Lisp_Object argument.
6701         (ns_alloc_autorelease_pool): Add void argument.
6702         (ns_release_autorelease_pool): Add void* argument.
6703         (ns_get_defaults_value): Add const char* argument.
6705         * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
6706         (initFromContents): Use SSDATA where appropriate.
6707         (ns_update_menubar): Add braces to ambigous if-else.
6708         (initWithTitle): Put () around assignment in if statement.
6709         (ns_menu_show): Remove unused variables window and keymap.
6710         (update_frame_tool_bar): Remove unused variable selected_p.
6711         (initWithContentRect): Remove unused variable this_cmd_name.
6713         * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
6714         appropriate.
6715         (setXBMColor): Remove unused variable len.
6716         (setPixmapData): Put () around assignment in loop statement.
6718         * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
6719         (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
6720         where appropriate.
6721         (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
6722         around assignment in loop statement.
6723         (nsfont_open): Remove unused variable i.
6724         (nsfont_open): Remove unused variable len.
6725         (nsfont_draw): Remove unused variable cs.
6727         * nsfns.m (x_set_icon_name, ns_set_name_internal)
6728         (ns_set_name_as_filename, ns_implicitly_set_icon_type)
6729         (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
6730         (Fns_get_resource, Fns_set_resource, Fx_open_connection)
6731         (Fns_font_name, Fns_perform_service)
6732         (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
6733         (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
6734         (ns_set_name): Remove unused variable view.
6735         (x_set_menu_bar_lines): Remove unused variable olines.
6736         (x_set_tool_bar_lines): Remove unused variable root_window.
6737         (Fns_list_colors): Put () around assignment in while statement.
6738         (Fns_perform_service): Remove unused variable len.
6739         (Fns_display_usable_bounds): Remove unused variable top.
6740         (syms_of_nsfns): Remove unused variable i.
6742         * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
6743         memcpy (Bug#11907).
6745 2012-07-13  Kalle Kankare  <kalle.kankare@iki.fi>  (tiny change)
6747         * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
6748         and free it with DestroyExceptionInfo (Bug#11558).
6750 2012-07-13  Juanma Barranquero  <lekktu@gmail.com>
6752         * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
6753         (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
6754         Set here, not in nt/config.nt.
6756 2012-07-13  Eli Zaretskii  <eliz@gnu.org>
6758         * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
6759         cursor overflow into the last glyph on display line when the right
6760         fringe is off.  (Bug#11832)
6762 2012-07-13  Paul Eggert  <eggert@cs.ucla.edu>
6764         * xdisp.c (produce_special_glyphs): Now static.
6765         * dispextern.h (produce_special_glyphs): Remove decl.
6767 2012-07-13  Glenn Morris  <rgm@gnu.org>
6769         * s/bsd-common.h, s/cygwin.h: Remove empty files.
6770         * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
6772         * s/usg5-4-common.h (USG, USG5):
6773         * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
6774         * s/sol2-6.h (SOLARIS2):
6775         * s/irix6-5.h (IRIX6_5):
6776         * s/hpux10-20.h (USG, USG5, HPUX):
6777         * s/gnu-linux.h (USG, GNU_LINUX):
6778         * s/freebsd.h (BSD_SYSTEM):
6779         * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
6780         * s/cygwin.h (CYGWIN):
6781         * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
6782         * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
6784 2012-07-13  BT Templeton  <bpt@hcoop.net>  (tiny change)
6786         * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
6788 2012-07-13  Glenn Morris  <rgm@gnu.org>
6790         * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
6792         * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
6794         * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
6795         * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
6797 2012-07-12  Glenn Morris  <rgm@gnu.org>
6799         * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
6801         * process.c (init_process_emacs): Rename from init_process.
6802         The old name is also the name of a Mach system call.
6803         * lisp.h, emacs.c: Update for this name change.
6804         * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
6805         longer needed.
6807 2012-07-12  Eli Zaretskii  <eliz@gnu.org>
6809         * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
6810         memmove call that removes glyphs covered by the left truncation
6811         glyph.  Improve commentary.
6812         (display_line): Fix display of continuation glyphs on GUI frames
6813         when the right fringe is turned off and variable-size fonts are
6814         used in the window.  Move the code that appends a stretch glyph to
6815         produce_special_glyphs, so that it could be used for truncation
6816         and continuation glyphs alike.
6817         (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
6818         glyph of a suitably computed width, to align the special glyphs at
6819         the window margin.  Code moved from display_line.  (Bug#11832)
6821 2012-07-12  Glenn Morris  <rgm@gnu.org>
6823         * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
6825         * s/gnu-linux.h, s/hpux10-20.h:
6826         Do not unconditionally define HAVE_XRMSETDATABASE.
6828         * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
6830 2012-07-12  Paul Eggert  <eggert@cs.ucla.edu>
6832         Fix typos that broke OS X build.
6833         Reported by Randal L. Schwartz in
6834         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
6835         * nsterm.m (ns_timeout): Add missing local decl.
6836         (ns_get_color): snprintf -> sprintf, to fix typo.
6838 2012-07-12  Glenn Morris  <rgm@gnu.org>
6840         * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
6841         * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
6842         * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
6843         Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
6845         * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
6846         Move PTY_OPEN to configure.
6848         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6849         * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
6850         * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
6852 2012-07-12  Dmitry Antipov  <dmantipov@yandex.ru>
6854         Use empty_unibyte_string where applicable.
6855         * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
6856         * lread.c (read1): Likewise.
6857         * xsettings.c (syms_of_xsettings): Likewise.
6859 2012-07-12  Glenn Morris  <rgm@gnu.org>
6861         * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
6862         * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
6863         * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
6864         * s/hpux10-20.h (RUN_TIME_REMAP):
6865         * s/bsd-common.h (TABDLY): Move to configure.
6867         * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
6869         * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
6871         * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
6872         (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
6874         * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
6876         * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
6877         * s/template.h: Move NARROWPROTO to configure.
6879 2012-07-11  Glenn Morris  <rgm@gnu.org>
6881         * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
6882         unused since 2011-01-17 change to systty.h.
6884         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
6885         * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
6886         Move HAVE_PTYS and HAVE_SOCKETS to configure.
6888 2012-07-11  Paul Eggert  <eggert@cs.ucla.edu>
6890         * s/sol2-6.h (HAVE_LIBKSTAT): Remove.  (Bug#11914)
6892 2012-07-11  Glenn Morris  <rgm@gnu.org>
6894         * s/darwin.h, s/gnu-linux.h, s/template.h:
6895         Move INTERRUPT_INPUT to configure.
6897 2012-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
6899         Minor adjustments to interning code.
6900         * lisp.h (intern, intern_c_string): Redefine as static inline
6901         wrappers for intern_1 and intern_c_string_1, respectively.
6902         (intern_1, intern_c_string_1): Rename prototypes.
6903         * lread.c (intern_1, intern_c_string_1, oblookup):
6904         Simplify Vobarray checking.
6905         * font.c (font_intern_prop): Likewise.  Adjust comment.
6906         * w32font.c (intern_font_name): Likewise.
6908 2012-07-11  Andreas Schwab  <schwab@linux-m68k.org>
6910         * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
6912         * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
6913         of Fcar/Fcdr if possible.
6914         * font.c (check_otf_features): Likewise.
6915         * fontset.c (Fnew_fontset): Likewise.
6916         * gnutls.c (Fgnutls_boot): Likewise.
6917         * minibuf.c (read_minibuf): Likewise.
6918         * msdos.c (IT_set_frame_parameters): Likewise.
6919         * xmenu.c (Fx_popup_dialog): Likewise.
6920         * w32menu.c (Fx_popup_dialog): Likewise.
6922 2012-07-11  Glenn Morris  <rgm@gnu.org>
6924         * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
6925         since nothing has defined it on these platforms.
6927         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
6928         * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
6930         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6931         * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
6932         Move CLASH_DETECTION to configure.
6934         * s/gnu.h: Remove file, which is now empty.
6936         * s/gnu.h, s/gnu-linux.h:
6937         Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
6939 2012-07-11  John Wiegley  <johnw@newartisans.com>
6941         * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
6942         function attribute, so we only use it if it exists in the
6943         compiler.
6945 2012-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
6947         Avoid call to strlen in fast_c_string_match_ignore_case.
6948         * search.c (fast_c_string_match_ignore_case): Change to use
6949         length argument.  Adjust users accordingly.
6950         * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
6952 2012-07-11  Paul Eggert  <eggert@cs.ucla.edu>
6954         Assume mkdir, rmdir.
6955         * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
6956         * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
6958         Assume rename.
6959         * sysdep.c (rename) [!HAVE_RENAME]: Remove.
6961         Assume perror.
6962         * s/hpux10-20.h (HAVE_PERROR): Remove.
6963         * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
6964         Remove dummy definition, as this problem was obsolete long ago.
6966         Assume strerror.
6967         * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
6969 2012-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
6971         Avoid calls to strlen in font processing functions.
6972         * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
6973         (font_open_by_name): Change to use length argument.
6974         Adjust users accordingly.
6975         * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
6976         Adjust prototypes.
6977         * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
6978         Change to return ptrdiff_t.
6979         (xfont_list_pattern, xfont_match): Use length returned by
6980         xfont_decode_coding_xlfd.
6981         * xfns.c (x_default_font_parameter): Omit useless xstrdup.
6983 2012-07-11  Glenn Morris  <rgm@gnu.org>
6985         * s/darwin.h, s/freebsd.h, s/netbsd.h:
6986         Move DONT_REOPEN_PTY to configure.
6988         * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
6989         * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
6991 2012-07-10  Paul Eggert  <eggert@cs.ucla.edu>
6993         Remove "#define unix" that is no longer needed (Bug#11905).
6994         * s/aix4-2.h (unix): Remove; no longer needed.
6996         EMACS_TIME simplification (Bug#11875).
6997         This replaces macros (which typically do not work in GDB)
6998         with functions, typedefs and enums, making the code easier to debug.
6999         The functional style also makes code easier to read and maintain.
7000         * systime.h: Include <sys/time.h> on all hosts, not just if
7001         WINDOWSNT, since 'struct timeval' is needed in general.
7002         (EMACS_TIME): Now a typedef, not a macro.
7003         (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
7004         not macros.
7005         (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
7006         (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
7007         (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
7008         (EMACS_TIME_LE): Now functions, not macros.
7009         (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
7010         (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
7011         which are not functions.  All uses rewritten to use:
7012         (make_emacs_time): New function.
7013         (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
7014         (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
7015         not functions.  All uses rewritten to use the following, respectively:
7016         (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
7017         (add_emacs_time, sub_emacs_time): New functions.
7018         * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
7019         * fileio.c (Fcopy_file):
7020         * xterm.c (XTflash): Get the current time closer to when it's used.
7021         * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
7023         * bytecode.c (targets): Suppress -Woverride-init warnings.
7025         Simplify by avoiding confusing use of strncpy etc.
7026         * doc.c (Fsnarf_documentation):
7027         * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
7028         * frame.c (Fmake_terminal_frame):
7029         * gtkutil.c (get_utf8_string):
7030         * lread.c (openp):
7031         * nsmenu.m (ns_update_menubar):
7032         * regex.c (regerror):
7033         Prefer memcpy to strncpy and strncat when either will do.
7034         * fileio.c (Fsubstitute_in_file_name):
7035         * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
7036         (menu_separator_name_p):
7037         * nsmenu.m (ns_update_menubar):
7038         Prefer memcmp to strncmp when either will do.
7039         * nsterm.m: Include <ftoastr.h>.
7040         (ns_get_color):
7041         * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
7042         Prefer snprintf to strncpy.
7043         * nsterm.m (ns_term_init):
7044         * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
7045         * nsterm.m (ns_term_init):
7046         Avoid the need for strncpy, by using build_string or
7047         make_unibyte_string directly.  Use dtoastr, not snprintf.
7048         * process.c (Fmake_network_process): Diagnose service names that
7049         are too long, rather than silently truncating them or creating
7050         non-null-terminated names.
7051         (Fnetwork_interface_info): Likewise, for interface names.
7052         * sysdep.c (system_process_attributes) [GNU_LINUX]:
7053         Prefer sprintf to strncat.
7054         * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
7055         Prefer vsnprintf to vsprintf + strncpy.
7057 2012-07-10  Glenn Morris  <rgm@gnu.org>
7059         * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
7060         Clarify fallback case.
7062 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
7064         Use XCAR and XCDR instead of Fcar and Fcdr where possible.
7065         * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
7066         * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
7067         * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7068         where argument type is known to be a Lisp_Cons.
7070 2012-07-10  Tom Tromey  <tromey@redhat.com>
7072         * bytecode.c (BYTE_CODE_THREADED): New macro.
7073         (BYTE_CODES): New macro.  Replaces all old byte-code defines.
7074         (enum byte_code_op): New type.
7075         (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
7076         (exec_byte_code): Use them.  Use token threading when applicable.
7078 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
7080         Optimize pure C strings initialization.
7081         * lisp.h (make_pure_string): Fix prototype.
7082         (build_pure_c_string): New function, defined as static inline.  This
7083         provides a better opportunity to optimize away calls to strlen when
7084         the function is called with compile-time constant argument.
7085         * alloc.c (make_pure_c_string): Fix comment.  Change to add nchars
7086         argument, adjust users accordingly.  Use build_pure_c_string where
7087         appropriate.
7088         * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
7089         * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
7090         * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
7092 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
7094         Avoid calls to strlen in miscellaneous functions.
7095         * buffer.c (init_buffer): Use precalculated len, adjust if needed.
7096         * font.c (Ffont_xlfd_name): Likewise.  Change to call make_string.
7097         * lread.c (openp): Likewise.
7099 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
7101         Avoid calls to strlen in path processing functions.
7102         * fileio.c (file_name_as_directory): Add comment.  Change to add
7103         srclen argument and return the length of result.  Adjust users
7104         accordingly.
7105         (directory_file_name): Fix comment.  Change to add srclen argument,
7106         swap 1st and 2nd arguments to obey the common convention.
7107         Adjust users accordingly.
7108         * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
7110 2012-07-10  Glenn Morris  <rgm@gnu.org>
7112         * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
7113         Move PENDING_OUTPUT_COUNT definition to configure.
7115         * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
7116         * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
7117         * s/gnu.h (DATA_START): Move definitions to configure.
7119         * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
7120         We include usg5-4-common.h, which defines them both.
7122         * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
7123         O_RDONLY already includes it).
7125         Stop ns builds setting the EMACSLOADPATH environment variable.
7126         * nsterm.m (ns_load_path): Rename from ns_init_paths.
7127         Now it does not set EMACSLOADPATH, just returns the load-path string.
7128         * nsterm.h: Update accordingly.
7129         * lread.c [HAVE_NS]: Include nsterm.h.
7130         (init_lread) [HAVE_NS]: Use ns_load_path.
7131         * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
7133 2012-07-09  Glenn Morris  <rgm@gnu.org>
7135         * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
7136         since the included bsd-common.h does so.
7138         Stop ns builds setting the EMACSPATH environment variable.
7139         * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
7140         (ns_init_paths): Do not set EMACSPATH.
7141         * nsterm.h (ns_exec_path): Add it.
7142         * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
7143         Use ns_exec_path.
7145         * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
7147 2012-07-09  Paul Eggert  <eggert@cs.ucla.edu>
7149         * process.c (wait_reading_process_output): 'waitchannels' was unset
7150         when read_kbd || !NILP (wait_for_cell); fix this.
7152         Add GCC-style 'const' attribute to functions that can use it.
7153         * character.h (char_resolve_modifier_mask):
7154         * keyboard.h (make_ctrl_char):
7155         * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
7156         (init_character_once, next_almost_prime, init_fns, init_image)
7157         (flush_pending_output, init_sound):
7158         * mem-limits.h (start_of_data):
7159         * menu.h (finish_menu_items):
7160         Add ATTRIBUTE_CONST.
7161         * emacs.c (DEFINE_DUMMY_FUNCTION):
7162         Declare the dummy function with ATTRIBUTE_CONST.
7163         * lisp.h (Fbyteorder, Fmax_char, Fidentity):
7164         Add decls with ATTRIBUTE_CONST.
7166         Minor improvements to make_formatted_string.
7167         * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
7168         where int is good enough, as vsprintf returns an int.
7169         * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
7171 2012-07-09  Dmitry Antipov  <dmantipov@yandex.ru>
7173         Use make_formatted_string to avoid double length calculation.
7174         * lisp.h (make_formatted_string): New prototype.
7175         * alloc.c (make_formatted_string): New function.
7176         * buffer.c (Fgenerate_new_buffer_name): Use it.
7177         * dbusbind.c (syms_of_dbusbind): Likewise.
7178         * editfns.c (Fcurrent_time_zone): Likewise.
7179         * filelock.c (get_boot_time): Likewise.
7180         * frame.c (make_terminal_frame, set_term_frame_name)
7181         (x_report_frame_params): Likewise.
7182         * image.c (gs_load): Likewise.
7183         * minibuf.c (get_minibuffer): Likewise.
7184         * msdos.c (dos_set_window_size): Likewise.
7185         * process.c (make_process): Likewise.
7186         * xdisp.c (ensure_echo_area_buffers): Likewise.
7187         * xsettings.c (apply_xft_settings): Likewise.
7189 2012-07-09  Glenn Morris  <rgm@gnu.org>
7191         Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
7192         * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
7193         (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
7194         * nsterm.h (ns_etc_directory): Add it.
7195         * callproc.c [HAVE_NS]: Include nsterm.h.
7196         (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
7198 2012-07-09  Dmitry Antipov  <dmantipov@yandex.ru>
7200         Move marker debugging code under MARKER_DEBUG.
7201         * marker.c (MARKER_DEBUG): Move marker debugging code under
7202         #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
7203         for bootstrap with --enable-checking (~3x slowdown reported
7204         by Juanma Barranquero <lekktu@gmail.com>).
7205         (verify_bytepos): Move under #ifdef MARKER_DEBUG.
7207 2012-07-08  Paul Eggert  <eggert@cs.ucla.edu>
7209         * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
7210         See <http://bugs.gnu.org/11825#29>.
7212 2012-07-08  Eli Zaretskii  <eliz@gnu.org>
7214         * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
7215         has no font, use the frame's font.  (Bug#11813)
7216         (display_line): Add commentary about displaying truncation glyphs
7217         on GUI frames.
7218         (produce_special_glyphs): Move here from term.c.
7220         * term.c (produce_special_glyphs): Move to xdisp.c.
7222         * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
7223         section.
7225 2012-07-07  Andreas Schwab  <schwab@linux-m68k.org>
7227         * xdisp.c (display_line): Avoid warning about implicit declaration
7228         of FRAME_FONT.
7230         * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
7232         * lisp.h: Remove empty conditional.
7234 2012-07-07  Paul Eggert  <eggert@cs.ucla.edu>
7236         * lread.c (load_path_check): Now static.
7238         Fix some minor --with-ns problems found by static checking.
7239         * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
7240         (x_set_font) [!HAVE_X_WINDOWS]:
7241         * image.c (xpm_load_image) [HAVE_NS]:
7242         (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
7243         (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
7244         Remove unused local.
7245         (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
7246         (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
7247         * image.c (x_create_bitmap_from_file) [HAVE_NS]:
7248         (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
7249         * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
7250         * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
7251         Fix pointer signedness problem.
7252         * xfaces.c (FRAME_X_FONT_TABLE):
7253         * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
7255 2012-07-07  Glenn Morris  <rgm@gnu.org>
7257         * lread.c (load_path_check): New function, split from init_lread.
7258         (init_lread): Reorganize.  Motivation:
7259         If EMACSLOADPATH is set, check/warn about that rather than the
7260         defaults, which we are not going to use.  Hence we can remove
7261         the turn_off_warning and WINDOWSNT || HAVE_NS tests.
7262         Don't warn if site-lisp directories are missing.
7263         If not installed, start from a blank load-path, since
7264         PATH_LOADSEARCH refers to the eventual installation directories.
7266 2012-07-07  Eli Zaretskii  <eliz@gnu.org>
7268         Support truncation and continuation glyphs on GUI frames, when
7269         fringes are disabled.  (Bug#11832)
7270         * xdisp.c (init_iterator): Get dimensions of truncation and
7271         continuation glyphs even if on GUI frames.
7272         Adjust it->last_visible_x on GUI frames when the left or right fringes,
7273         or both, are absent.
7274         (start_display, move_it_in_display_line_to): Handle the case of a
7275         GUI frame without a fringe to display continuation or truncation
7276         glyphs.
7277         (insert_left_trunc_glyphs): Support GUI frames: make sure
7278         truncation glyphs overwrite enough glyphs from the current line to
7279         have sufficient space in pixels.
7280         (display_line): Support truncation and continuation glyphs on GUI
7281         frames.  If some spare pixels are left on the line after inserting
7282         the truncation glyphs, fill that space with a stretch glyph of a
7283         suitably computed width.
7285         * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
7286         produce_glyphs, to support GUI sessions.
7288 2012-07-07  Paul Eggert  <eggert@cs.ucla.edu>
7290         * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
7292         * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
7294         Do not require float-time's arg to fit in time_t (Bug#11825).
7295         This works better on hosts where time_t is unsigned, and where
7296         float-time is applied to the (negative) difference between two times.
7297         * editfns.c (decode_time_components): Last arg is now double *,
7298         not int *, and means to store all the result as a double, without
7299         worrying about whether the seconds part fits in time_t.
7300         All callers changed.
7301         (lisp_time_argument): Remove last int * arg, as it's no longer needed.
7302         All callers changed.
7303         (Ffloat_time): Do not fail merely because the specified time falls
7304         outside of time_t range.
7306 2012-07-07  Glenn Morris  <rgm@gnu.org>
7308         * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
7309         * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
7310         * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
7312 2012-07-07  Juanma Barranquero  <lekktu@gmail.com>
7314         * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
7315         Update dependencies.
7317         * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
7319 2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>
7321         Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
7322         * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
7323         * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
7324         * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
7325         * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
7326         * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
7328         * xfont.c (compare_font_names): Redo to omit the need for casts.
7330 2012-07-06  Andreas Schwab  <schwab@linux-m68k.org>
7332         * xfns.c (Fx_change_window_property): Doc fix.
7333         * w32fns.c (Fx_change_window_property): Doc fix.
7335         * w32fns.c (Fx_window_property): Accept the same arguments as the
7336         X Windows version.  Doc fix.
7337         * xfns.c (Fx_window_property): Doc fix.  (Bug#11870)
7339 2012-07-06  Juanma Barranquero  <lekktu@gmail.com>
7340             Eli Zaretskii  <eliz@gnu.org>
7342         * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
7343         Windows-specific code from nt/config.nt moved here.
7344         Obsolete settings removed.
7346 2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>
7348         * process.c: Avoid unnecessary calls to gettime.
7349         (wait_reading_process_output): Don't get the time of day
7350         when gobbling data immediately and not waiting, as there's no need
7351         for it in that case.  This removes a FIXME.
7353 2012-07-06  Jan Djärv  <jan.h.d@swipnet.se>
7355         * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
7356         is defined (Bug#11768).
7358 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
7360         Fix marker debugging code.
7361         * marker.c (byte_char_debug_check): Do not perform the check
7362         if buffer is not multibyte.
7363         (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
7364         Call byte_char_debug_check with correct arguments.
7366 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
7368         Compile marker debugging code only if ENABLE_CHECKING is defined.
7369         * marker.c (byte_char_debug_check, count_markers):
7370         Use only if ENABLE_CHECKING is defined.
7371         (byte_debug_flag): Remove.
7372         (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
7373         Always call byte_char_debug_check if ENABLE_CHECKING is defined.
7375 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
7377         Avoid code repetition in marker-related functions.
7378         * marker.c (attach_marker): New function.
7379         (Fset_marker, set_marker_restricted, set_marker_both)
7380         (set_marker_restricted_both): Use it.
7381         (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
7382         Consistently rename charno to charpos.
7383         (marker_position): Add eassert.
7384         (marker_byte_position): Convert to eassert.
7386 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
7388         Simplify list operations in unchain_overlay and unchain_marker.
7389         * buffer.c (unchain_overlay): Simplify.  Add comment.
7390         * marker.c (unchain_marker): Simplify.  Fix comments.
7392 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
7394         Introduce fast path for the widely used marker operation.
7395         * alloc.c (build_marker): New function.
7396         * lisp.h (build_marker): New prototype.
7397         * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
7398         * composite.c (autocmp_chars): Likewise.
7399         * editfns.c (buildmark): Remove.
7400         (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
7401         (save_restriction_save): Use build_marker.
7402         * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
7403         * window.c (save_window_save): Likewise.
7405 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
7407         Do not use Fdelete_overlay in delete_all_overlays
7408         to avoid redundant calls to unchain_overlay.
7409         * buffer.c (drop_overlay): New function.
7410         (delete_all_overlays, Fdelete_overlay): Use it.
7411         * minibuf.c (get_minibuffer): Fix comment.
7413 2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>
7415         Port to OpenBSD 5.1 amd64.
7416         * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
7417         This is needed for OpenBSD, and should be harmless on all BSD systems.
7418         Also, include <sys/sysctl.h>, as it should be available on all
7419         BSD_SYSTEM hosts given that we're already calling sysctl in that case.
7420         (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
7421         use p_pid member, not kp_proc.pid.
7423 2012-07-06  Glenn Morris  <rgm@gnu.org>
7425         * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
7427 2012-07-05  Paul Eggert  <eggert@cs.ucla.edu>
7429         More xmalloc and related cleanup.
7430         * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
7431         * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
7432         * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
7433         * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
7434         * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
7435         * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
7436         * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
7437         * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
7438         * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
7439         * xterm.c:
7440         Omit needless casts involving void * pointers and allocation.
7441         Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
7442         as the former is more robust if P's type is changed.
7443         Prefer xzalloc to xmalloc + memset 0.
7444         Simplify malloc-or-realloc to realloc.
7445         Don't worry about xmalloc returning a null pointer.
7446         Prefer xstrdup to xmalloc + strcpy.
7447         * editfns.c (Fmessage_box): Grow message_text by at least 80 when
7448         growing it.
7449         * keyboard.c (apply_modifiers_uncached): Prefer local array to
7450         alloca of a constant.
7452 2012-07-05  Eli Zaretskii  <eliz@gnu.org>
7454         * xdisp.c (display_line): Fix horizontal pixel coordinates when
7455         hscroll is larger than the line width.  Fixes long and futile
7456         looping inside extend_face_to_end_of_line (on a TTY) producing
7457         glyphs that are not needed and thrown away.
7459 2012-07-05  Dmitry Antipov  <dmantipov@yandex.ru>
7461         * marker.c (set_marker_restricted_both): Simplify by using
7462         clip_to_bounds.
7464 2012-07-05  Paul Eggert  <eggert@cs.ucla.edu>
7466         * editfns.c (region_limit): Simplify by using clip_to_bounds.
7468 2012-07-05  Jan Djärv  <jan.h.d@swipnet.se>
7470         * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
7471         not defined (Bug#11768).
7472         (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
7473         (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
7474         (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
7475         followed by gtk_box_set_homogeneous (Bug#11768).
7476         (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
7477         (update_theme_scrollbar_width, xg_create_scroll_bar):
7478         Use gtk_scrollbar_new (Bug#11768).
7479         (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
7480         (is_box_type): New function (Bug#11768).
7481         (xg_tool_item_stale_p): Call is_box_type.
7482         (xg_initialize): Get settings by calling gtk_settings_get_for_screen
7483         with default display (Bug#11768).
7485 2012-07-05  Eli Zaretskii  <eliz@gnu.org>
7487         * xdisp.c (window_hscroll_limited): New function.
7488         (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
7489         coordinates when window's hscroll is set to insanely large
7490         values.  (Bug#11857)
7492 2012-07-05  Juanma Barranquero  <lekktu@gmail.com>
7494         * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
7495         ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
7497 2012-07-05  Dmitry Antipov  <dmantipov@yandex.ru>
7499         Cleanup xmalloc.
7500         * lisp.h (xzalloc): New prototype.  Omit needless casts.
7501         * alloc.c (xzalloc): New function.  Omit needless casts.
7502         * charset.c: Omit needless casts.  Convert all calls to
7503         xmalloc with following memset to xzalloc.
7504         * dispnew.c: Likewise.
7505         * fringe.c: Likewise.
7506         * image.c: Likewise.
7507         * sound.c: Likewise.
7508         * term.c: Likewise.
7509         * w32fns.c: Likewise.
7510         * w32font.c: Likewise.
7511         * w32term.c: Likewise.
7512         * xfaces.c: Likewise.
7513         * xfns.c: Likewise.
7514         * xterm.c: Likewise.
7515         * atimer.c: Omit needless casts.
7516         * buffer.c: Likewise.
7517         * callproc.c: Likewise.
7518         * ccl.c: Likewise.
7519         * coding.c: Likewise.
7520         * composite.c: Likewise.
7521         * doc.c: Likewise.
7522         * doprnt.c: Likewise.
7523         * editfns.c: Likewise.
7524         * emacs.c: Likewise.
7525         * eval.c: Likewise.
7526         * filelock.c: Likewise.
7527         * fns.c: Likewise.
7528         * gtkutil.c: Likewise.
7529         * keyboard.c: Likewise.
7530         * lisp.h: Likewise.
7531         * lread.c: Likewise.
7532         * minibuf.c: Likewise.
7533         * msdos.c: Likewise.
7534         * print.c: Likewise.
7535         * process.c: Likewise.
7536         * region-cache.c: Likewise.
7537         * search.c: Likewise.
7538         * sysdep.c: Likewise.
7539         * termcap.c: Likewise.
7540         * terminal.c: Likewise.
7541         * tparam.c: Likewise.
7542         * w16select.c: Likewise.
7543         * w32.c: Likewise.
7544         * w32reg.c: Likewise.
7545         * w32select.c: Likewise.
7546         * w32uniscribe.c: Likewise.
7547         * widget.c: Likewise.
7548         * xdisp.c: Likewise.
7549         * xmenu.c: Likewise.
7550         * xrdb.c: Likewise.
7551         * xselect.c: Likewise.
7553 2012-07-05  Paul Eggert  <eggert@cs.ucla.edu>
7555         * fileio.c (time_error_value): Check the right error number.
7556         Problem reported by Troels Nielsen in
7557         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
7559 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
7561         * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
7562         This should be fixed in a better way; see Eli Zaretskii in
7563         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
7564         (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
7566         * fileio.c (time_error_value): Rename from special_mtime.
7567         The old name's problems were noted by Eli Zaretskii in
7568         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
7570         * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
7571         This variable's comment says Emacs needs at least one GDB-visible
7572         symbol of type enum pvec_type, to work around GDB problems.
7573         The symbol's value doesn't matter.
7575         * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
7576         that causes compilation to fail on pre-C99 compilers.
7578 2012-07-04  Juanma Barranquero  <lekktu@gmail.com>
7580         * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
7581         (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
7583 2012-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
7585         * buffer.c (init_buffer_once): Fix initialization of
7586         headers for buffer_defaults and buffer_local_symbols.
7587         Reported by Juanma Barranquero <lekktu@gmail.com>.
7589 2012-07-04  Stefan Monnier  <monnier@iro.umontreal.ca>
7591         Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
7592         * lisp.h (enum pvec_type): Use fewer bits.
7593         (PSEUDOVECTOR_SIZE_BITS): New constant.
7594         (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
7595         (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
7596         change in pvec_type.
7597         (PSEUDOVECTOR_TYPEP): New macro.
7598         (TYPED_PSEUDOVECTORP): Use it.
7599         * fns.c (internal_equal): Adapt code to extract pvectype.
7600         * emacs.c (gdb_pvec_type): Update type.
7601         * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
7602         (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
7603         (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
7604         (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
7605         (sweep_vectors): Use it.  Use local var `total_bytes' instead of
7606         abusing vector->header.next.nbytes.
7607         (live_vector_p): Use PVEC_TYPE.
7608         (mark_object): Adapt code to extract pvectype.  Use switch.
7610 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
7612         * doprnt.c (doprnt): Don't assume string length fits in 'int'.
7613         Tighten new eassert a bit.
7615 2012-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
7617         Fix compilation with --enable-gcc-warnings and -O1
7618         optimization level.
7619         * doprnt.c (doprnt): Change type of tem to int, initialize
7620         to avoid compiler warning.  Add eassert.
7621         * search.c (simple_search): Initialize match_byte to avoid
7622         compiler warning.  Add eassert.
7624 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
7626         Avoid weird behavior with large horizontal scrolls.
7627         Without this change, for example, large hscroll values would
7628         mess up Emacs's display on Fedora 15 x86, presumably due to
7629         overflows in int calculations in the display code.
7630         Also, if buffers had long lines, Emacs would freeze.
7631         * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
7632         (set_window_hscroll): New function, containing the old guts of
7633         Fset_window_hscroll.  Return the clipped value.
7634         (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
7635         This avoids the need to check against PTRDIFF_MAX.
7637         * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
7639 2012-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
7641         * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
7643 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
7645         * regex.c: Suppress GCC warning on RHEL 6.  (Bug#11207)
7646         Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
7647         since GCC 4.4.6 issues a bogus warning for them.
7649         Fix bugs in file timestamp newness comparisons.
7650         * fileio.c (Ffile_newer_than_file_p):
7651         * lread.c (Fload): Use full timestamp resolution of files,
7652         not just the 1-second resolution, so that files that are only
7653         slightly newer still count as newer.
7654         * fileio.c (Ffile_newer_than_file_p): Don't assume file
7655         timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
7657 2012-07-03  Paul Eggert  <eggert@cs.ucla.edu>
7659         * fileio.c: Improve handling of file time marker.  (Bug#11852)
7660         (special_mtime): New function.
7661         (Finsert_file_contents, Fverify_visited_file_modtime):
7662         Use it to set special mtime values consistently.
7664 2012-07-03  Andreas Schwab  <schwab@linux-m68k.org>
7666         * fileio.c (Finsert_file_contents): Properly handle st_mtime
7667         marker for non-existing file.  (Bug#11852)
7669 2012-07-03  Glenn Morris  <rgm@gnu.org>
7671         * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
7672         and did not make it into globals.h).
7674 2012-07-03  Tom Tromey  <tromey@redhat.com>
7676         * window.c (Fset_window_margins, Fset_window_fringes)
7677         (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
7678         * textprop.c (Fprevious_property_change): No longer static.
7679         * syntax.c (Fsyntax_table_p): No longer static.
7680         * process.c (Fget_process, Fprocess_datagram_address): No longer
7681         static.
7682         * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
7683         * keyboard.c (Fcommand_execute): No longer static.
7684         Remove EXFUN.
7685         * insdel.c (Fcombine_after_change_execute): No longer static.
7686         * image.c (Finit_image_library): No longer static.
7687         * fileio.c (Fmake_symbolic_link): No longer static.
7688         * eval.c (Ffetch_bytecode): No longer static.
7689         * editfns.c (Fuser_full_name): No longer static.
7690         * doc.c (Fdocumentation_property, Fsnarf_documentation):
7691         No longer static.
7692         * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
7693         static.
7694         * dired.c (Ffile_attributes): No longer static.
7695         * composite.c (Fcomposition_get_gstring): No longer static.
7696         * callproc.c (Fgetenv_internal): No longer static.
7698         * ccl.h: Remove EXFUNs.
7699         * buffer.h: Remove EXFUNs.
7700         * dispextern.h: Remove EXFUNs.
7701         * intervals.h: Remove EXFUNs.
7702         * fontset.h: Remove EXFUN.
7703         * font.h: Remove EXFUNs.
7704         * dosfns.c (system_process_attributes): Remove EXFUN.
7705         * keymap.h: Remove EXFUNs.
7706         * lisp.h: Remove EXFUNs.
7707         * w32term.h: Remove EXFUNs.
7708         * window.h: Remove EXFUNs.
7709         * xsettings.h: Remove EXFUN.
7710         * xterm.h: Remove EXFUN.
7712 2012-07-03  Glenn Morris  <rgm@gnu.org>
7714         * lisp.h (Frandom): Make it visible to C.
7715         * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
7716         buffer for invisible buffers.  (Bug#1229)
7718 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
7720         Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
7721         values which aren't power of 2.
7722         * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
7723         Verify its value and the value of VECTOR_BLOCK_SIZE.  Adjust users
7724         accordingly.
7726 2012-07-03  Stefan Monnier  <monnier@iro.umontreal.ca>
7728         * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
7730         * alloc.c (mark_object): Revert part of last patch to use `switch'.
7732 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
7734         * alloc.c (allocate_vector_block): Remove redundant
7735         calls to mallopt if DOUG_LEA_MALLOC is defined.
7736         (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
7737         avoid calls to mallopt if zero_vector is returned.
7739 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
7741         * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
7742         is enabled, avoid dereferencing NULL current_sblock if
7743         running undumped.
7745 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
7747         Cleanup basic buffer management.
7748         * buffer.h (struct buffer): Change layout to use generic vector
7749         marking code.  Fix some comments.  Change type of 'clip_changed'
7750         to bitfield.  Remove unused #ifndef old.
7751         (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
7752         (GET_OVERLAYS_AT): Fix indentation.
7753         (for_each_per_buffer_object_at): New macro.
7754         * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
7755         (Fbuffer_local_variables): Use it.
7756         (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
7757         * alloc.c (allocate_buffer): Adjust to match new layout of
7758         struct buffer.  Fix comment.
7759         (mark_overlay): New function.
7760         (mark_buffer): Use it.  Use mark_vectorlike to mark normal
7761         Lisp area of struct buffer.
7762         (mark_object): Use it.  Adjust marking of misc objects
7763         and related comments.
7765 2012-07-02  Paul Eggert  <eggert@cs.ucla.edu>
7767         * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
7768         wrapper that is not needed because the wrapped code is a no-op (zero
7769         machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
7770         This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
7772 2012-07-02  Dmitry Antipov  <dmantipov@yandex.ru>
7774         * alloc.c (mark_buffer): Simplify.  Remove prototype.
7775         (mark_object): Add comment.  Reorganize marking of vector-like
7776         objects.  Use CHECK_LIVE for all vector-like objects except buffers
7777         and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
7778         Avoid redundant calls to mark_vectorlike for bool vectors.
7780 2012-06-30  Glenn Morris  <rgm@gnu.org>
7782         * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
7784         * epaths.in (PATH_SITELOADSEARCH): New.
7785         * lread.c (init_lread): Use PATH_SITELOADSEARCH.
7786         This is rather than relying on --enable-locallisppath elements
7787         having "site-lisp" in their names.  (Bug#10208#25, 11658)
7789 2012-06-30  Eli Zaretskii  <eliz@gnu.org>
7791         * w32proc.c (sys_select): Accept and ignore one more argument.
7793         * w32.c (emacs_gnutls_pull): Call select with one more argument.
7795         * sysselect.h [DOS_NT]: Don't include sys/select.h.
7796         (pselect) [!MS_DOS]: Redirect to sys_select.
7798         * sysdep.c: Don't include dos.h and dosfns.h.
7800         * process.c (sys_select):
7801         * msdos.c (sys_select): Accept one more argument and ignore it.
7803         * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
7804         adapt data types and code to that.
7806         * dosfns.c:
7807         * msdos.c (gettime, settime): Define away the prototypes in dos.h,
7808         which clashes with the gnulib function of the same name.
7810 2012-06-30  Andreas Schwab  <schwab@linux-m68k.org>
7812         * font.c (font_style_to_value, font_style_symbolic)
7813         (font_prop_validate_style): Add type checks for values in
7814         font_style_table.
7816         * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
7817         argument.
7818         * character.c, charset.c, menu.c, process.c, window.c: Adjust all
7819         uses.
7821 2012-06-29  Eli Zaretskii  <eliz@gnu.org>
7823         * xdisp.c (try_window_id): Undo last change.
7825         * w32.c (getwd): Adjust commentary about startup_dir.
7826         (init_environment): Always call sys_access, even in non-MSVC
7827         builds.  Don't chdir to the directory of the Emacs executable.
7828         This undoes code from 1997 which was justified by the need to
7829         "avoid conflicts when removing and renaming directories".  But its
7830         downside was that every relative file name was being interpreted
7831         relative to the directory of the Emacs executable, which can never
7832         be TRT.  In particular, it broke sys_access when called with
7833         relative file names.
7834         (sys_access): Map GetLastError to errno.
7836 2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
7838         * window.h (struct window): Change type of 'fringes_outside_margins'
7839         to bitfield.  Fix comment.  Adjust users accordingly.
7840         (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
7841         Adjust comment.
7842         * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
7843         to ptrdiff_t.
7845 2012-06-29  Andreas Schwab  <schwab@linux-m68k.org>
7847         * gnutls.c (emacs_gnutls_handshake):
7848         Add QUIT to make the loop interruptible.
7850 2012-06-29  Glenn Morris  <rgm@gnu.org>
7852         * charset.c (init_charset): Make lack of etc/charsets fatal.
7854 2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
7856         * editfns.c (region_limit): Fix type mismatch.
7858 2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
7860         * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
7861         undefined.  Convert from xassert to eassert.
7862         * nsmenu.m: Convert from xassert to eassert.
7863         * nsterm.m: Likewise.
7865 2012-06-28  Stefan Monnier  <monnier@iro.umontreal.ca>
7867         * editfns.c (region_limit): Clip to narrowing (bug#11770).
7869 2012-06-28  Paul Eggert  <eggert@cs.ucla.edu>
7871         Avoid integer overflow on scroll-left and scroll-right.
7872         * window.c (HSCROLL_MAX): New macro.
7873         (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
7874         overflow when requested scroll falls outside ptrdiff_t range.
7876 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
7878         * window.h (struct window): Change type of 'hscroll',
7879         'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
7880         'last_modified' and 'last_overlay_modified' to EMACS_INT.
7881         Adjust users accordingly.
7882         * xdisp.c (try_cursor_movement): Replace type check with eassert.
7883         * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
7884         from EMACS_INT to ptrdiff_t.
7885         (make_window): Omit redundant initialization.
7887 2012-06-28  Juanma Barranquero  <lekktu@gmail.com>
7889         * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
7891 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
7893         * window.h (struct window): Change type of 'use_time' and
7894         'sequence_number' from Lisp_Object to int.
7895         * frame.c (make_frame): Adjust users accordingly.
7896         * print.c (print_object): Likewise.
7897         * window.c (select_window, Fwindow_use_time, make_parent_window)
7898         (make_window): Likewise.
7900 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
7902         * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
7903         enabled with --enable-checking=[all,glyphs] configure option.
7904         Fix GLYPH_DEBUG usage assuming that it may be undefined,
7905         adjust comments accordingly.
7906         * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
7907         undefined, adjust comments accordingly.
7908         * image.c: Likewise.
7909         * scroll.c: Likewise.
7910         * w32fns.c: Likewise.
7911         * w32term.c: Likewise.
7912         * xdisp.c: Likewise.
7913         * xfaces.c: Likewise.
7914         * xfns.c: Likewise.
7915         * xterm.c: Likewise.
7917 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
7919         Generalize run-time debugging checks.
7920         * dispextern.h (XASSERTS): Remove.
7921         * fontset.c (xassert): Remove.
7922         Convert from xassert to eassert.
7923         * alloc.c: Convert from xassert to eassert.
7924         * bidi.c: Likewise.
7925         * dispnew.c: Likewise.
7926         * fns.c: Likewise.
7927         * fringe.c: Likewise.
7928         * ftfont.c: Likewise.
7929         * gtkutil.c: Likewise.
7930         * image.c: Likewise.
7931         * keyboard.c: Likewise.
7932         * menu.c: Likewise.
7933         * process.c: Likewise.
7934         * scroll.c: Likewise.
7935         * sound.c: Likewise.
7936         * term.c: Likewise.
7937         * w32console.c: Likewise.
7938         * w32fns.c: Likewise.
7939         * w32term.c: Likewise.
7940         * window.c: Likewise.
7941         * xdisp.c: Likewise.
7942         * xfaces.c: Likewise.
7943         * xfns.c: Likewise.
7944         * xselect.c: Likewise.
7945         * xterm.c: Likewise.
7947 2012-06-27  Stefan Monnier  <monnier@iro.umontreal.ca>
7949         * fns.c (maybe_resize_hash_table): Output message when growing the
7950         purify-hashtable.
7952 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
7954         * alloc.c (allocate_string_data): Remove dead code.
7955         * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
7956         avoid GCC warning about unused macro.
7958 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
7960         * alloc.c (allocate_string): Omit intervals initialization.
7961         * alloc.c (make_uninit_multibyte_string): Initialize intervals
7962         as in make_pure_string and make_pure_c_string.
7964 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
7966         * alloc.c (allocate_string): Fix last change.
7968 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
7970         * alloc.c (allocate_string): Remove two redundant calls
7971         to memset, add explicit initialization where appropriate.
7973 2012-06-27  Glenn Morris  <rgm@gnu.org>
7975         * lisp.mk (lisp): Remove paths.elc.
7977 2012-06-27  Chong Yidong  <cyd@gnu.org>
7979         * doc.c (Fsubstitute_command_keys): Fix punctuation.
7981 2012-06-26  John Wiegley  <johnw@newartisans.com>
7983         * unexmacosx.c (copy_data_segment): Add two section names used
7984         on Mac OS X Lion: __mod_init_func and __mod_term_func.
7986         * alloc.c (mark_memory): Do not check with -faddress-sanitizer
7987         when building with Clang.
7989 2012-06-26  Stefan Monnier  <monnier@iro.umontreal.ca>
7991         * eval.c (Fapply): Allow calling it with a single argument.
7993 2012-06-26  Eli Zaretskii  <eliz@gnu.org>
7995         * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
7996         _stricmp and _strnicmp.
7997         (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
7999 2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
8001         * alloc.c (allocate_window): Zero out non-Lisp part of newly
8002         allocated window.
8003         (allocate_process): Likewise for new process.
8004         (allocate_terminal): Change to use offsetof.
8005         (allocate_frame): Likewise.
8006         * frame.c (make_frame): Omit redundant initialization.
8007         * window.c (make_parent_window): Use memset.
8008         (make_window): Omit redundant initialization.
8009         * process.c (make_process): Omit redundant initialization.
8010         * terminal.c (create_terminal): Likewise.
8012 2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
8014         * term.c (delete_tty): Remove redundant call to memset.
8016 2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
8018         * alloc.c: Remove build_string.
8019         * lisp.h: Define build_string as static inline.  This provides
8020         a better opportunity to optimize away calls to strlen when the
8021         function is called with compile-time constant argument.
8022         * image.c (imagemagick_error): Convert to build_string.
8023         * w32proc.c (sys_spawnve): Likewise.
8024         * xterm.c (x_term_init): Likewise.
8026 2012-06-26  Paul Eggert  <eggert@cs.ucla.edu>
8028         Use sprintf return value instead of invoking strlen on result.
8029         In the old days this wasn't portable, since some sprintf
8030         implementations returned char *.  But they died out years ago and
8031         Emacs already assumes sprintf returns int.
8032         Similarly for float_to_string.
8033         This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
8034         * ccl.c (ccl_driver):
8035         * character.c (string_escape_byte8):
8036         * data.c (Fnumber_to_string):
8037         * doprnt.c (doprnt):
8038         * print.c (print_object):
8039         * xdisp.c (message_dolog):
8040         * xfns.c (syms_of_xfns):
8041         Use sprintf or float_to_string result to avoid need to call strlen.
8042         * data.c (Fnumber_to_string):
8043         Use make_unibyte_string, since the string must be ASCII.
8044         * lisp.h, print.c (float_to_string): Now returns int length.
8045         * term.c (produce_glyphless_glyph):
8046         Use sprintf result rather than recomputing it.
8048         Clean out last vestiges of the old HAVE_CONFIG_H stuff.
8049         * Makefile.in (ALL_CFLAGS):
8050         * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
8051         * gmalloc.c, regex.c: Include <config.h> unconditionally.
8053 2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
8055         * dispextern.h (xstrcasecmp): Define to library function
8056         strcasecmp if available.
8057         * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
8059 2012-06-25  Andreas Schwab  <schwab@linux-m68k.org>
8061         * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
8062         Avoid comma operator.
8063         * menu.c (push_submenu_start, push_submenu_end)
8064         (push_left_right_boundary, push_menu_pane): Likewise.
8065         * msdos.c (dos_rawgetc): Likewise.
8067 2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
8069         * xfns.c (xic_create_fontsetname): Remove redundant calls
8070         to memset.
8072 2012-06-25  Paul Eggert  <eggert@cs.ucla.edu>
8074         * gtkutil.c (get_utf8_string): Remove redundant assignment.
8075         sprintf already null-terminates its output.
8077         * xfns.c (x_window): Remove redundant cast.
8079 2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
8081         * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
8082         `const char *' to `char *' to avoid compiler warning.
8084 2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
8086         * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
8087         instead of truncating it to 63 (admittedly a generous limit).
8089         * process.c: Fix spelling and caps in comments.
8091 2012-06-24  Dan Nicolaescu  <dann@ics.uci.edu>
8093         * emacs.c (setpgrp): Remove definition, unused.
8094         * sysdep.c (setpgrp): Remove definition, not used in this file.
8096 2012-06-24  Juanma Barranquero  <lekktu@gmail.com>
8098         * makefile.w32-in: Update dependencies.
8100 2012-06-24  Eli Zaretskii  <eliz@gnu.org>
8102         * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
8103         (SYSTIME_H): Add nt/inc/sys/time.h.
8105         * systime.h [WINDOWSNT]: Include sys/time.h.
8107         * s/ms-w32.h (struct timespec): Definition moved from
8108         nt/inc/sys/time.h.  Suggested by Paul Eggert <eggert@cs.ucla.edu>.
8110 2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
8112         Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
8113         * buffer.h (buffer_slot_type_mismatch):
8114         * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
8115         * eval.c (unwind_to_catch):
8116         * image.c (my_png_error, my_error_exit):
8117         * keyboard.c (quit_throw_to_read_char, user_error)
8118         (Fexit_recursive_edit, Fabort_recursive_edit):
8119         * lisp.h (die, args_out_of_range, args_out_of_range_3)
8120         (wrong_type_argument, buffer_overflow, __executable_start)
8121         (memory_full, buffer_memory_full, string_overflow, Fthrow)
8122         (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
8123         (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
8124         (fatal):
8125         (child_setup) [!DOS_NT]:
8126         * lread.c (end_of_file_error, invalid_syntax):
8127         * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
8128         * puresize.h (pure_write_error):
8129         * search.c (matcher_overflow):
8130         * sound.c (sound_perror, alsa_sound_perror):
8131         * sysdep.c, syssignal.h (croak):
8132         * term.c (maybe_fatal, vfatal):
8133         * textprop.c (text_read_only):
8134         * undo.c (user_error):
8135         * unexmacosx.c (unexec_error):
8136         * xterm.c (x_ins_del_lines, x_delete_glyphs):
8137         Use _Noreturn rather than NO_RETURN.
8138         No need for separate decl merely because of _Noreturn.
8139         * sound.c (sound_warning, parse_sound):
8140         Remove unnecessary forward decls.
8142 2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
8144         Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
8145         * lisp.h (WAIT_READING_MAX): New macro.
8146         * dispnew.c (Fsleep_for, sit_for):
8147         * keyboard.c (kbd_buffer_get_event):
8148         * process.c (Faccept_process_output):
8149         Use it to avoid bogus compiler warnings with obsolescent GCC versions.
8150         This improves on the previous patch, which introduced a bug
8151         when time_t is unsigned and as wide as intmax_t.
8152         See <http://bugs.gnu.org/9000#51>.
8154 2012-06-23  Eli Zaretskii  <eliz@gnu.org>
8156         * dispnew.c (sit_for, Fsleep_for):
8157         * keyboard.c (kbd_buffer_get_event):
8158         * process.c (Faccept_process_output): Avoid compiler warnings when
8159         comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
8161 2012-06-23  Juanma Barranquero  <lekktu@gmail.com>
8163         * makefile.w32-in: Update dependencies.
8165         * w32.c (ltime): Add return type and declare static.
8166         (w32_get_internal_run_time): Remove usused variable `time_100ns'.
8168 2012-06-23  Paul Eggert  <eggert@cs.ucla.edu>
8170         * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
8171         Privately reported by Herbert J. Skuhra.
8172         (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
8173         All uses changed.
8174         (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
8175         not make_lisp_timeval, when the argument is of type EMACS_TIME.
8177 2012-06-23  Eli Zaretskii  <eliz@gnu.org>
8179         * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
8180         last argument of make_unibyte_string.
8182         * keyboard.c (kbd_buffer_get_event): Include the codepage and the
8183         language ID in the event parameters.
8185         * w32term.c (w32_read_socket): Put the new keyboard codepage into
8186         event.code, not the obscure "character set ID".
8188 2012-06-23  Chong Yidong  <cyd@gnu.org>
8190         * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
8192 2012-06-23  Eli Zaretskii  <eliz@gnu.org>
8194         Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
8195         * w32.c (fdutimens): New function.
8197         * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
8199         * s/ms-w32.h (pselect): Redirect to sys_select.
8201         * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
8203         * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
8204         in the logic of incrementing and decrementing the value of
8205         use_relocatable_buffers.
8207 2012-06-23  Paul Eggert  <eggert@cs.ucla.edu>
8209         * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
8210         Privately reported by Herbert J. Skuhra.
8211         [__FreeBSD__]: Remove "*/" typo after "#include".
8212         (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
8213         (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
8214         (TIMEVAL, system_process_attributes) [__FreeBSD__]:
8215         Don't assume EMACS_TIME and struct timeval are the same type.
8217 2012-06-22  Paul Eggert  <eggert@cs.ucla.edu>
8219         Support higher-resolution time stamps (Bug#9000).
8220         The time stamps are only nanosecond-resolution at the C level,
8221         since that's the best that any real-world system supports now.
8222         But they are picosecond-resolution at the Lisp level, as that's
8223         easy, and leaves room for future OS improvements.
8225         * Makefile.in (LIB_CLOCK_GETTIME): New macro.
8226         (LIBES): Use it.
8228         * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
8229         Don't get current time unless it's needed.
8231         * atimer.c: Include <sys/time.h> unconditionally, since gnulib
8232         now provides it if it's absent.
8233         (start_atimer): Port to higher-res time stamps.
8234         Check for time stamp overflow.  Don't get current time more
8235         often than is needed.
8237         * buffer.h (struct buffer): Buffer modtime now has high resolution.
8238         Include systime.h, not time.h.
8239         (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
8241         * dired.c: Include stat-time.h.
8242         (Ffile-attributes): File times now have higher resolution.
8244         * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
8245         (struct image): Timestamp now has higher resolution.
8247         * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
8248         has at least microseconds now.  All uses removed.
8249         (update_frame, update_single_window, update_window, update_frame_1)
8250         (Fsleep_for, sit_for): Port to higher-resolution time stamps.
8251         (duration_to_sec_usec): Remove; no longer needed.
8253         * editfns.c (time_overflow): Now extern.
8254         (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
8255         (float-time, Fformat_time_string, Fcurrent_time_string)
8256         (Fcurrent_time_zone): Accept and generate higher-resolution
8257         time stamps.
8258         (make_time_tail, make_lisp_time, dissassemble_lisp_time)
8259         (decode_time_components, lisp_seconds_argument): New functions.
8260         (make_time): Now static.
8261         (lisp_time_argument): Now returns EMACS_TIME.  New arg ppsec.
8262         Report an error if the time is invalid, rather than having the caller
8263         do that.
8265         * fileio.c: Include <stat-time.h>
8266         (Fcopy_file): Copy higher-resolution time stamps.
8267         Prefer to set the time stamp via a file descriptor if that works.
8268         (Fset_file_times, Finsert_file_contents, Fwrite_region)
8269         (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
8270         (Fvisited_file_modtime, Fset_visited_file_modtime):
8271         Support higher-resolution time stamps.
8273         * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
8275         * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
8277         * image.c (prepare_image_for_display, clear_image_cache)
8278         (lookup_image): Port to higer-resolution time stamps.
8280         * keyboard.c (start_polling, bind_polling_period):
8281         Check for time stamp overflow.
8282         (read_char, kbd_buffer_get_event, timer_start_idle)
8283         (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
8284         (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
8285         Port to higher-resolution time stamps.  Do not assume time_t is signed.
8286         (decode_timer): New function.  Timers are now vectors of length 9,
8287         not 8, to accommodate the picosecond component.
8288         (timer_check_2): Use it.
8290         * nsterm.m (select_timeout, timeval_subtract): Remove.
8291         (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
8292         as they're a bit more accurate and handle overflow better.
8293         (ns_select): Change prototype to be compatible with pselect.
8294         (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
8295         * nsterm.h (ns_select): Adjust prototype.
8297         * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
8298         us-resolution time stamps.
8299         (sys_select): Use the new EMACS_TIME_SIGN macro instead.
8301         * lread.c (read_filtered_event): Port to ns-resolution time stamps.
8303         * lisp.h (time_overflow): New decl.
8304         (wait_reading_process_output): First arg is now intmax_t, not int,
8305         to accommodate larger waits.
8307         * process.h (struct Lisp_Process.read_output_delay):
8308         Now counts nanoseconds, not microseconds.
8309         * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
8310         EMACS_HAS_USECS.
8311         (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
8312         (wait_reading_process_output):
8313         Port to ns-resolution time stamps.
8314         (Faccept_process_output, wait_reading_process_output):
8315         Check for time stamp overflow.  Do not assume time_t is signed.
8316         (select_wrapper): Remove; we now use pselect.
8317         (Fprocess_attributes): Now generates ns-resolution time stamps.
8319         * sysdep.c: Include utimens.h.  Don't include utime.h
8320         or worry about struct utimbuf; gnulib does that for us now.
8321         (gettimeofday): Remove; gnulib provides a substitute.
8322         (make_timeval): New function.
8323         (set_file_times): Now sets ns-resolution time stamps.
8324         New arg FD; all uses changed.
8325         (time_from_jiffies, ltime_from_jiffies, get_up_time)
8326         (system_process_attributes):
8327         Now returns ns-resolution time stamp.  All uses changed.
8328         Check for time stamp overflow.
8330         * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
8331         provides a substitute now.
8333         * systime.h: Include timespec.h rather than sys/time.h and time.h,
8334         since it guarantees struct timespec.
8335         (EMACS_TIME): Now struct timespec, so that we can support
8336         ns-resolution time stamps.
8337         (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
8338         (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
8339         (EMACS_USECS): Remove.
8340         (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
8341         so multiply the arg by 1000 before storing it.
8342         (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
8343         New macros.
8344         (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
8345         Port to ns-resolution time stamps.
8346         (EMACS_TIME_NEG_P): Remove; replaced by....
8347         (EMACS_TIME_SIGN): New macro.
8348         (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
8349         (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
8350         (set_file_times, make_time, lisp_time_argument): Adjust signature.
8351         (make_timeval, make_lisp_time, decode_time_components): New decls.
8352         (EMACS_TIME_CMP): Remove; no longer used.  Plus, it was buggy, in
8353         that it mishandled time_t overflow.  You can't compare by subtracting!
8354         (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
8355         (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
8357         * term.c: Include <sys/time.h>.
8358         (timeval_to_Time): New function, for proper overflow wraparound.
8359         (term_mouse_position, term_mouse_click): Use it.
8361         * undo.c (record_first_change): Support higher-resolution time stamps
8362         in the undo buffer.
8363         (Fprimitive_undo): Use them when restoring time stamps.
8365         * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
8366         (w32_get_internal_run_time):
8367         Port to higher-resolution Emacs time stamps.
8368         (ltime): Now accepts single 64-bit integer, as that's more convenient
8369         for callers.
8371         * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
8373         * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
8374         for compatibility with pselect.  Support ns-resolution time stamps.
8376         * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
8378         * xselect.c (wait_for_property_change, x_get_foreign_selection):
8379         Check for time stamp overflow, and support ns-resolution time stamps.
8381         * xterm.c: Don't include sys/time.h; gnulib does that for us now.
8382         Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
8383         (timeval_subtract): Remove; no longer needed.
8384         (XTflash, XTring_bell, x_wait_for_event):
8385         Port to ns-resolution time stamps.  Don't assume time_t is signed.
8387 2012-06-22  Chong Yidong  <cyd@gnu.org>
8389         * xdisp.c (x_consider_frame_title): Revert last change.
8391 2012-06-22  Eli Zaretskii  <eliz@gnu.org>
8393         * alloc.c (NSTATICS): Enlarge to 0x650.  Otherwise, Emacs compiled
8394         with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
8395         aborts in staticpro during startup.  (Without -DBYTE_CODE_METER,
8396         staticidx goes up to 1597 out of 1600 = 0x640.)
8398 2012-06-20  Paul Eggert  <eggert@cs.ucla.edu>
8400         * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
8401         Otherwise, the umask might be mistakenly 0 while handling input signals.
8403 2012-06-19  Stefan Monnier  <monnier@iro.umontreal.ca>
8405         * minibuf.c (Fread_string): Bind minibuffer-completion-table.
8407 2012-06-19  Dmitry Antipov  <dmantipov@yandex.ru>
8409         * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
8410         * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
8411         * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
8412         access to `contents' member of Lisp_Vector objects with AREF and ASET
8413         where appropriate.
8415 2012-06-19  Chong Yidong  <cyd@gnu.org>
8417         * frame.c (delete_frame): When selecting a frame on a different
8418         text terminal, do not alter the terminal's top-frame.
8420         * xdisp.c (format_mode_line_unwind_data): Record the target
8421         frame's selected window and its terminal's top-frame.
8422         (unwind_format_mode_line): Restore them.
8423         (x_consider_frame_title, display_mode_line, Fformat_mode_line):
8424         Callers changed.
8425         (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
8426         since tty frames can be explicitly named.
8427         (prepare_menu_bars): Likewise.
8429         * term.c (Ftty_top_frame): New function.
8431 2012-06-18  Paul Eggert  <eggert@cs.ucla.edu>
8433         Port byte-code-meter to modern targets.
8434         * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
8435         !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG.  Problem with
8436         CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
8437         <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
8438         (METER_1, METER_2): Simplify.
8440 2012-06-18  Stefan Monnier  <monnier@iro.umontreal.ca>
8442         * data.c (Fdefalias): Return `symbol' (bug#11686).
8444 2012-06-18  Martin Rudalics  <rudalics@gmx.at>
8446         * buffer.c (Fkill_buffer): Don't throw an error when the buffer
8447         gets killed during executing of this function (Bug#11665).
8448         Try to always return Qt when the buffer has been actually killed.
8449         (Vkill_buffer_query_functions): In doc-string say that functions
8450         run by this hook should not change the current buffer.
8452 2012-06-18  Paul Eggert  <eggert@cs.ucla.edu>
8454         Fix recently-introduced process.c problems found by static checking.
8455         * process.c (write_queue_push, write_queue_pop, send_process):
8456         Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
8457         (write_queue_pop): Fix pointer signedness problem.
8458         (send_process): Remove unused local.
8460 2012-06-17  Chong Yidong  <cyd@gnu.org>
8462         * xdisp.c (redisplay_internal): No need to redisplay terminal
8463         frames that are not on top.
8465 2012-06-17  Troels Nielsen  <bn.troels@gmail.com>
8467         * process.c (make_process): Initialize write_queue.
8468         (write_queue_push, write_queue_pop): New functions.
8469         (send_process): Use them to maintain correct ordering of process
8470         writes (Bug#10815).
8472 2012-06-17  Paul Eggert  <eggert@cs.ucla.edu>
8474         * lisp.h (eassert): Assume C89 or later.
8475         This removes the need for CHECK.
8476         (CHECK): Remove.  Its comments about always evaluating its
8477         argument were confusing, as 'eassert' typically does not evaluate
8478         its argument.
8480         * coding.c (produce_chars): Use ptrdiff_t, not int.
8482         * xterm.c (x_draw_underwave): Check for integer overflow.
8483         This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
8485 2012-06-17  Jan Djärv  <jan.h.d@swipnet.se>
8487         * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
8488         referenced (Bug#11583).
8490 2012-06-16  Aurelien Aptel  <aurelien.aptel@gmail.com>
8492         Implement wave-style variant of underlining.
8493         * dispextern.h (face_underline_type): New enum.
8494         (face): Add field for underline type.
8495         * nsterm.m (ns_draw_underwave): New function.
8496         (ns_draw_text_decoration): Use it.
8497         * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
8498         New functions.
8499         (x_draw_glyph_string): Use them.
8500         * xfaces.c (Qline, Qwave): New Lisp objects.
8501         (check_lface_attrs, merge_face_ref)
8502         (Finternal_set_lisp_face_attribute, realize_x_face):
8503         Handle wave-style underline face attributes.
8504         * xterm.c (x_draw_underwave): New function.
8505         (x_draw_glyph_string): Use it.
8507 2012-06-16  Juanma Barranquero  <lekktu@gmail.com>
8509         * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
8510         ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
8511         ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
8512         ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
8513         ($(BLD)/w32select.$(O)): Update dependencies.
8515 2012-06-16  Andreas Schwab  <schwab@linux-m68k.org>
8517         * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
8518         (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
8519         * character.c (_fetch_multibyte_char_p): Remove.
8520         * alloc.c: Include "character.h" before "buffer.h".
8521         * bidi.c: Likewise.
8522         * buffer.c: Likewise.
8523         * bytecode.c: Likewise.
8524         * callint.c: Likewise.
8525         * callproc.c: Likewise.
8526         * casefiddle.c: Likewise.
8527         * casetab.c: Likewise.
8528         * category.c: Likewise.
8529         * cmds.c: Likewise.
8530         * coding.c: Likewise.
8531         * composite.c: Likewise.
8532         * dired.c: Likewise.
8533         * dispnew.c: Likewise.
8534         * doc.c: Likewise.
8535         * dosfns.c: Likewise.
8536         * editfns.c: Likewise.
8537         * emacs.c: Likewise.
8538         * fileio.c: Likewise.
8539         * filelock.c: Likewise.
8540         * font.c: Likewise.
8541         * fontset.c: Likewise.
8542         * fringe.c: Likewise.
8543         * indent.c: Likewise.
8544         * insdel.c: Likewise.
8545         * intervals.c: Likewise.
8546         * keyboard.c: Likewise.
8547         * keymap.c: Likewise.
8548         * lread.c: Likewise.
8549         * macros.c: Likewise.
8550         * marker.c: Likewise.
8551         * minibuf.c: Likewise.
8552         * nsfns.m: Likewise.
8553         * nsmenu.m: Likewise.
8554         * print.c: Likewise.
8555         * process.c: Likewise.
8556         * regex.c: Likewise.
8557         * region-cache.c: Likewise.
8558         * search.c: Likewise.
8559         * syntax.c: Likewise.
8560         * term.c: Likewise.
8561         * textprop.c: Likewise.
8562         * undo.c: Likewise.
8563         * unexsol.c: Likewise.
8564         * w16select.c: Likewise.
8565         * w32fns.c: Likewise.
8566         * w32menu.c: Likewise.
8567         * window.c: Likewise.
8568         * xdisp.c: Likewise.
8569         * xfns.c: Likewise.
8570         * xmenu.c: Likewise.
8571         * xml.c: Likewise.
8572         * xselect.c: Likewise.
8574 2012-06-16  Eli Zaretskii  <eliz@gnu.org>
8576         * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
8577         If all the glyphs of the glyph row came from strings, and we have no
8578         cursor positioning clues, put the cursor on the first glyph of the
8579         row.
8580         (handle_face_prop): Use chunk-relative overlay string index when
8581         indexing into it->string_overlays array.  (Bug#11653)
8582         (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
8583         the rightmost.  (Bug#11720)
8585 2012-06-16  Andreas Schwab  <schwab@linux-m68k.org>
8587         * category.h (CHAR_HAS_CATEGORY): Define as inline.
8588         (CATEGORY_MEMBER): Enforce 1/0 value.
8589         * category.c (_temp_category_set): Remove.
8591 2012-06-16  Eli Zaretskii  <eliz@gnu.org>
8593         * window.c (Fdelete_other_windows_internal)
8594         (Fdelete_window_internal): Don't access frame's mouse highlight
8595         info of the initial frame.  (Bug#11677)
8597 2012-06-14  Paul Eggert  <eggert@cs.ucla.edu>
8599         * .gdbinit (xgetint): Fix recently-introduced paren typo.
8600         Assume USE_2_TAGS_FOR_INTS.
8601         (xreload): Adjust $tagmask width to match recent lisp.h change.
8603         Simplify lisp.h in minor ways that should not affect code.
8604         * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
8605         (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
8606         (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
8607         Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
8608         (INTTYPEBITS): New macro, for clarity.
8609         (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
8610         (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
8611         Simplify now that USE_LSB_TAG is always defined.
8612         (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
8613         (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
8615 2012-06-13  Juanma Barranquero  <lekktu@gmail.com>
8617         * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
8619 2012-06-13  Glenn Morris  <rgm@gnu.org>
8621         * s/bsd-common.h (BSD4_3):
8622         * s/usg5-4-common.h (USG5_4): No longer define; unused.
8624 2012-06-13  Andreas Schwab  <schwab@linux-m68k.org>
8626         * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
8627         instead of union.
8628         (XLI, XIL): Define.
8629         (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
8630         Use them.
8631         * emacs.c (gdb_use_struct): Rename from gdb_use_union.
8632         * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
8633         * alloc.c (widen_to_Lisp_Object): Remove.
8634         (mark_memory): Use XIL instead of widen_to_Lisp_Object.
8635         * frame.c (delete_frame): Remove outdated comment.
8636         * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
8637         USE_LISP_UNION_TYPE.
8638         (Fw32_unregister_hot_key): Likewise.
8639         (Fw32_toggle_lock_key): Likewise.
8640         * w32menu.c (add_menu_item): Likewise.
8641         (w32_menu_display_help): Use XIL instead of checking
8642         USE_LISP_UNION_TYPE.
8643         * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
8644         (init_heap): Likewise.
8645         * w32term.c (w32_read_socket): Update comment.
8647 2012-06-13  Glenn Morris  <rgm@gnu.org>
8649         * s/usg5-4-common.h, src/s/unixware.h:
8650         Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
8652         * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
8654 2012-06-13  Paul Eggert  <eggert@cs.ucla.edu>
8656         USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
8657         * alloc.c (make_number) [!defined make_number]:
8658         Remove, as lisp.h always defines this now.
8659         (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
8660         (roundup_size): Verify that it is a power of 2.
8661         * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
8662         * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
8663         * lisp.h (USE_LSB_TAG): Allow the builder to compile with
8664         -DUSE_LSB_TAG=0, to override the automatically-selected default.
8665         USE_LSB_TAG now is always defined to be either 0 or 1.
8666         All uses changed.
8667         (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
8668         code works fine either way, and efficiency is not a concern here,
8669         as the union type is for debugging, not for production.
8670         (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
8671         Use an inline function on all platforms when using the union type,
8672         since this is simpler and 'static inline' can be used portably
8673         within Emacs now.
8674         (LISP_INITIALLY_ZERO): New macro.
8675         (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
8676         (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
8678 2012-06-12  Glenn Morris  <rgm@gnu.org>
8680         * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
8682         * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
8684         * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
8685         Move BROKEN_SIGIO to configure.
8687         * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
8688         Move NO_TERMIO to configure.
8690 2012-06-12  Chong Yidong  <cyd@gnu.org>
8692         * image.c (imagemagick_load_image): Use MagickFlattenImage if
8693         MagickMergeImageLayers is undefined.  Use pixel pusher loop if
8694         MagickExportImagePixels is undefined.
8696 2012-06-12  Paul Eggert  <eggert@cs.ucla.edu>
8698         * image.c (imagemagick_load_image): Remove unused label.
8700 2012-06-11  Glenn Morris  <rgm@gnu.org>
8702         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
8703         * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
8704         * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
8705         * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
8707 2012-06-11  Stefan Monnier  <monnier@iro.umontreal.ca>
8709         * alloc.c (make_byte_code): New function.
8710         (Fmake_byte_code): Use it.  Don't purify here.
8711         * lread.c (read1): Use it as well to avoid extra allocation.
8713 2012-06-11  Chong Yidong  <cyd@gnu.org>
8715         * image.c (imagemagick_load_image): Implement transparency.
8717 2012-06-10  Andreas Schwab  <schwab@linux-m68k.org>
8719         * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
8720         account for preceding backslashes.  (Bug#11663)
8722 2012-06-09  Chong Yidong  <cyd@gnu.org>
8724         * term.c: Support italics in capable terminals (Bug#9652).
8725         (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
8726         (turn_on_face): Output using TS_enter_italic_mode if available.
8727         Don't handle unused blinking and alt-charset cases.
8728         (turn_off_face): Handle italic case; discard unused tty_blinking_p
8729         and tty_alt_charset_p cases.
8730         (tty_capable_p, init_tty): Support italics.
8732         * termchar.h (struct tty_display_info): Add field for italics.
8733         Remove unused blink field.
8735         * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
8736         Handle slant.
8738         * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
8739         (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
8740         tty_alt_charset_p.  Add tty_italic_p.
8742 2012-06-09  Michael Albinus  <michael.albinus@gmx.de>
8744         * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
8745         dbus_type_is_basic if available.
8746         (xd_extract_signed, xd_extract_unsigned): Rename from
8747         extract_signed and extract_unsigned, respectively.  Adapt callers.
8749 2012-06-09  Chong Yidong  <cyd@gnu.org>
8751         * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
8753         * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
8754         case (Bug#9752).
8756 2012-06-08  Paul Eggert  <eggert@cs.ucla.edu>
8758         * xdisp.c (vmessage): Treat frame message as multibyte.
8759         Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
8760         would generate the diagnostic "Making \302\247 buffer-local while
8761         let-bound!".
8763 2012-06-08  Eli Zaretskii  <eliz@gnu.org>
8765         * dispnew.c (showing_window_margins_p): Undo last change, which
8766         was done due to an inadvertent commit.
8767         (adjust_frame_glyphs_for_frame_redisplay): Do call
8768         showing_window_margins_p.
8770 2012-06-08  Stefan Monnier  <monnier@iro.umontreal.ca>
8772         * eval.c (Fmake_var_non_special): New primitive.
8773         (syms_of_eval): Defsubr it.
8774         * lread.c (syms_of_lread): Mark `values' as lexically scoped.
8776 2012-06-08  Juanma Barranquero  <lekktu@gmail.com>
8778         * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
8779         function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
8781 2012-06-08  Eli Zaretskii  <eliz@gnu.org>
8783         * alloc.c (allocate_vectorlike): Fix last change.
8785 2012-06-08  Dmitry Antipov  <dmantipov@yandex.ru>
8787         Block-based vector allocation of small vectors.
8788         * lisp.h (struct vectorlike_header): New field `nbytes',
8789         adjust comment accordingly.
8790         * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
8791         to denote vector blocks.  Adjust users (live_vector_p,
8792         mark_maybe_pointer, valid_lisp_object_p) accordingly.
8793         (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
8794         (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
8795         (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
8796         (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
8797         (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
8798         (roundup_size): New constant.
8799         (struct vector_block): New data type.
8800         (vector_blocks, vector_free_lists, zero_vector): New variables.
8801         (all_vectors): Rename to `large_vectors'.
8802         (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
8803         (sweep_vectors): New functions.
8804         (allocate_vectorlike): Return `zero_vector' as the only vector of
8805         0 items.  Allocate new vector from block if vector size is less than
8806         or equal to VBLOCK_BYTES_MAX.
8807         (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
8808         (init_alloc_once): Add call to init_vectors.
8810 2012-06-08  Stefan Monnier  <monnier@iro.umontreal.ca>
8812         * eval.c (Fmacroexpand): Stop if the macro returns the same form.
8814 2012-06-07  Paul Eggert  <eggert@cs.ucla.edu>
8816         * doprnt.c (doprnt): Truncate multibyte char correctly.
8817         Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
8818         would mishandle a string argument "Xc" if X was a multibyte
8819         character of length 2: it would truncate after X's first byte
8820         rather than including all of X.
8822 2012-06-06  Chong Yidong  <cyd@gnu.org>
8824         * buffer.c (word_wrap): Doc fix.
8826 2012-06-04  Paul Eggert  <eggert@cs.ucla.edu>
8828         * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
8830 2012-06-03  Glenn Morris  <rgm@gnu.org>
8832         * xdisp.c (tool-bar-style): Doc fix.
8834 2012-06-03  Ulrich Müller  <ulm@gentoo.org>
8836         * Makefile.in (PAXCTL): Define.
8837         (temacs$(EXEEXT)): Disable memory randomization for the temacs
8838         binary via PaX flags if the paxctl utility is available.
8839         (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
8840         Restore PaX flags to their default.  (Bug#11398)
8842 2012-06-03  Chong Yidong  <cyd@gnu.org>
8844         * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
8845         buffer (Bug#11226).
8847 2012-06-03  Chong Yidong  <cyd@gnu.org>
8849         * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
8850         (note_mode_line_or_margin_highlight): If there is no help echo,
8851         use mode-line-default-help-echo.  Handle the case where the mouse
8852         position is past the end of the mode line string.
8854         * buffer.c (buffer_local_value_1): New function, split from
8855         Fbuffer_local_value; can return Qunbound.
8856         (Fbuffer_local_value): Use it.
8857         (Vmode_line_format): Docstring tweaks.
8859 2012-06-02  Paul Eggert  <eggert@cs.ucla.edu>
8861         * sysdep.c (system_process_attributes): Improve comment.
8863 2012-06-02  Stefan Monnier  <monnier@iro.umontreal.ca>
8865         * keyboard.c: Export real-this-command to Elisp.
8866         (syms_of_keyboard): Rename real_this_command to Vreal_this_command
8867         and DEFVAR it.  Update all users.
8869 2012-06-02  Paul Eggert  <eggert@cs.ucla.edu>
8871         * minibuf.c (Fassoc_string): Remove duplicate declaration.
8873         * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
8874         Convert pctcpu and pctmem to Lisp float properly.
8875         Let the compiler fold better, as 100.0/0x8000 is exact.
8877 2012-06-02  Andreas Schwab  <schwab@linux-m68k.org>
8879         * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
8880         cons_block.
8882 2012-06-01  Paul Eggert  <eggert@cs.ucla.edu>
8884         * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
8886 2012-06-01  Dmitry Antipov  <dmantipov@yandex.ru>
8888         For a 'struct window', replace some Lisp_Object fields to
8889         bitfields where appropriate, remove unused fields.
8890         * window.h (struct window): Remove unused 'last_mark_x' and
8891         'last_mark_y' fields.  Rename 'mini_p' field to 'mini',
8892         change its type from Lisp_Object to bitfield.
8893         Change type of 'force_start', 'optional_new_start',
8894         'last_had_star', 'update_mode_line' and 'start_at_line_beg'
8895         fields from Lisp_Object to bitfield.  Adjust users accordingly.
8897 2012-05-31  Paul Eggert  <eggert@cs.ucla.edu>
8899         Pacify gcc -Wdouble-precision when using Xaw.
8900         * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
8901         [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
8902         Use 'float' consistently, rather than 'float' in most places
8903         and 'double' in a couple of places.
8905 2012-05-31  Eli Zaretskii  <eliz@gnu.org>
8907         * xdisp.c (handle_stop): Detect whether we have overlay strings
8908         loaded by testing it->current.overlay_string_index to be
8909         non-negative, instead of checking whether n_overlay_strings is
8910         positive.  (Bug#11587)
8912 2012-05-31  Chong Yidong  <cyd@gnu.org>
8914         * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
8916         * doc.c (Fsubstitute_command_keys): Doc fix.
8918 2012-05-31  Eli Zaretskii  <eliz@gnu.org>
8920         * search.c (search_buffer): Remove calls to
8921         r_alloc_inhibit_buffer_relocation, as it is now called by
8922         maybe_unify_char, which was the cause of relocation of buffer text
8923         in bug#11519.
8925 2012-05-31  Eli Zaretskii  <eliz@gnu.org>
8927         * charset.c (maybe_unify_char): Inhibit relocation of buffer text
8928         for the duration of call to load_charset, to avoid problems with
8929         callers of maybe_unify_char that access buffer text through C
8930         pointers.
8932         * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
8933         decrement the inhibition flag, instead of just setting or
8934         resetting it.
8936 2012-05-31  Paul Eggert  <eggert@cs.ucla.edu>
8938         Remove obsolete '#define static' cruft.
8939         * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
8940         This #undef was "temporary" in 2000; it is no longer needed
8941         now that '#define static' has gone away.
8942         * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
8943         (gray_bitmap_bits): Remove; no longer needed.
8944         All uses replaced with definiens.
8945         * xterm.c: Include "bitmaps/gray.xbm".
8947 2012-05-30  Paul Eggert  <eggert@cs.ucla.edu>
8949         Clean up __executable_start, monstartup when --enable-profiling.
8950         The following changes affect the code only when profiling.
8951         * dispnew.c (__executable_start): Rename from safe_bcopy.
8952         Define only on platforms that need it.
8953         * emacs.c: Include <sys/gmon.h> when profiling.
8954         (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
8955         (__executable_start): Remove decl, since lisp.h does it now.
8956         (safe_bcopy): Remove decl; no longer has that name.
8957         (main): Coalesce #if into single bit of code, for simplicity.
8958         Cast pointers to uintptr_t, since standard libraries want integers
8959         and not pointers.
8960         * lisp.h (__executable_start): New decl.
8962 2012-05-31  Glenn Morris  <rgm@gnu.org>
8964         * image.c (Fimagemagick_types): Doc fix.
8966 2012-05-30  Jim Meyering  <meyering@redhat.com>
8968         * callproc.c (Fcall_process_region): Include directory component
8969         in mkstemp error message (Bug#11586).
8971 2012-05-30  Paul Eggert  <eggert@cs.ucla.edu>
8973         * alloc.c, lisp.h (make_pure_vector): Now static.
8975 2012-05-30  Stefan Monnier  <monnier@iro.umontreal.ca>
8977         * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
8978         Move to byte-run.el.
8979         (Fautoload): Do the hash-doc more carefully.
8980         * data.c (Fdefalias): Purify definition, except for keymaps.
8981         (Qdefun): Move from eval.c.
8982         * lisp.h (Qdefun): Remove.
8983         * lread.c (read1): Tiny simplification.
8985 2012-05-29  Troels Nielsen  <bn.troels@gmail.com>
8987         Do not create empty overlays with the evaporate property (Bug#9642).
8988         * buffer.c (Fmove_overlay): Reinstate the earlier fix for
8989         Bug#9642, but explicitly check that the buffer the overlay would
8990         be moved to is live and rearrange lines to make sure that errors
8991         will not put the overlay in an inconsistent state.
8992         (Fdelete_overlay): Cosmetics.
8994 2012-05-28  Eli Zaretskii  <eliz@gnu.org>
8996         * w32term.c (my_bring_window_to_top): New function.
8997         (x_raise_frame): Use handle returned by DeferWindowPos, which
8998         could be different from the original one.
8999         Call my_bring_window_to_top instead of my_set_foreground_window.
9000         (Bug#11513)
9002         * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
9003         by calling BringWindowToTop.
9005         * w32term.h (WM_EMACS_BRINGTOTOP): New message.
9006         (WM_EMACS_END): Increase by one.
9008 2012-05-28  Paul Eggert  <eggert@cs.ucla.edu>
9010         * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
9011         This avoids undefined behavior that might cause the eassert
9012         to not catch an out-of-range value.
9014 2012-05-28  Juanma Barranquero  <lekktu@gmail.com>
9016         * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
9017         Update dependencies.
9019 2012-05-27  Eli Zaretskii  <eliz@gnu.org>
9021         * bidi.c (bidi_mirror_char): Fix last change.
9023 2012-05-27  Andreas Schwab  <schwab@linux-m68k.org>
9025         * unexmacosx.c (copy_data_segment): Truncate after 16 characters
9026         when referring to sectname field in printf format.
9028 2012-05-27  Paul Eggert  <eggert@cs.ucla.edu>
9030         * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
9031         Only r_alloc_inhibit_buffer_relocation needed to be added;
9032         the others were already declared.
9034         * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
9035         before checking whether it's out of range.  Put the check inside
9036         eassert.  See
9037         <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
9039 2012-05-27  Ken Brown  <kbrown@cornell.edu>
9041         * callproc.c (Fcall_process): Restore a line that was accidentally
9042         commented out in the 2011-02-13 change (bug#11547).
9044 2012-05-27  Eli Zaretskii  <eliz@gnu.org>
9046         * lisp.h [REL_ALLOC]: Add prototypes for external functions
9047         defined on ralloc.c.
9049         * buffer.c [REL_ALLOC]: Remove prototypes of
9050         r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
9051         they are now on lisp.h.
9053         * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
9055         * search.c (search_buffer): Use it to inhibit relocation of buffer
9056         text while re_search_2 is doing its job, because re_search_2 is
9057         passed C pointers to buffer text.  (Bug#11519)
9059         * msdos.c (internal_terminal_init) <Vwindow_system_version>:
9060         Update value to 24.
9062         * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
9063         state after an additional call to move_it_in_display_line_to, keep
9064         the values of it->max_ascent and it->max_descent found for the
9065         entire line.
9066         (pos_visible_p): Revert the comparison against bottom_y to what it
9067         was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
9068         (Bug#11464)
9070 2012-05-26  Paul Eggert  <eggert@cs.ucla.edu>
9072         Fix coding-related core dumps with gcc -ftrapv.
9073         The code was computing A - B, where A and B are pointers, and B is
9074         random garbage.  This can lead to core dumps on platforms that
9075         have special pointer registers, and it also leads to core dumps on
9076         x86-64 when compiled with gcc -ftrapv.  The fix is to compute
9077         A - B only when B is initialized properly.
9078         * coding.c (coding_set_source, coding_set_destination): Return void.
9079         (coding_change_source, coding_change_destinations): New functions,
9080         with the old behaviors of coding_set_source and coding_set_destination.
9081         All callers that need an offset changed to use these new functions.
9083 2012-05-26  Glenn Morris  <rgm@gnu.org>
9085         * nsterm.m (ns_init_paths): Don't mess with INFOPATH.  (Bug#2791)
9087 2012-05-26  Eli Zaretskii  <eliz@gnu.org>
9089         Extend mouse support on W32 text-mode console.
9090         * xdisp.c (draw_row_with_mouse_face):
9091         Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
9093         * w32console.c: Include window.h.
9094         (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
9095         New functions.
9096         (initialize_w32_display): Initialize mouse-highlight data.
9098         * w32inevt.c: Include termchar.h and window.h.
9099         (do_mouse_event): Support mouse-autoselect-window.  When the mouse
9100         moves, call note_mouse_highlight.  If help_echo changed, call
9101         gen_help_event to produce help-echo message in the echo area.
9102         Call clear_mouse_face if mouse_face_hidden is set in the mouse
9103         highlight info.
9105 2012-05-26  Paul Eggert  <eggert@cs.ucla.edu>
9107         * lread.c (read1): Simplify slightly to avoid an overflow warning
9108         with GCC 4.7.0 on x86-64.
9110 2012-05-26  Eli Zaretskii  <eliz@gnu.org>
9112         * bidi.c (bidi_mirror_char): Revert last change: an int is
9113         definitely wide enough here.
9115 2012-05-25  Paul Eggert  <eggert@cs.ucla.edu>
9117         Fix integer width and related bugs (Bug#9874).
9118         * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
9119         (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
9120         (string_bytes, check_sblock, allocate_string_data):
9121         (compact_small_strings, Fmake_bool_vector, make_string)
9122         (make_unibyte_string, make_multibyte_string)
9123         (make_string_from_bytes, make_specified_string)
9124         (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
9125         (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
9126         (mark_vectorlike):
9127         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9128         (allocate_pseudovector):
9129         Use int, not EMACS_INT, where int is wide enough.
9130         (inhibit_garbage_collection, Fgarbage_collect):
9131         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9132         * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
9133         int might not be wide enough.
9134         (bidi_cache_search, bidi_cache_find, bidi_init_it)
9135         (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
9136         (bidi_at_paragraph_end, bidi_find_paragraph_start)
9137         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
9138         (bidi_level_of_next_char, bidi_move_to_visually_next):
9139         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9140         * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
9141         (Fkill_buffer, Fset_buffer_major_mode)
9142         (advance_to_char_boundary, Fbuffer_swap_text)
9143         (Fset_buffer_multibyte, overlays_at, overlays_in)
9144         (overlay_touches_p, struct sortvec, record_overlay_string)
9145         (overlay_strings, recenter_overlay_lists)
9146         (adjust_overlays_for_insert, adjust_overlays_for_delete)
9147         (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
9148         (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
9149         (Foverlay_recenter, last_overlay_modification_hooks_used)
9150         (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
9151         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9152         (validate_region): Omit unnecessary test for b <= e,
9153         since that's guaranteed by the previous test.
9154         (adjust_overlays_for_delete): Avoid pos + length overflow.
9155         (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
9156         (report_overlay_modification):
9157         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9158         (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
9159         Omit pointer cast, which isn't needed anyway, and doesn't work
9160         after the EMACS_INT -> ptrdiff_t change.
9161         (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
9162         * buffer.h: Adjust decls to match defn changes elsewhere.
9163         (struct buffer_text, struct buffer):
9164         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9165         Use EMACS_INT, not int, where int might not be wide enough.
9166         * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
9167         not int, to avoid needless 32-bit limit on 64-bit hosts.
9168         (exec_byte_code): Use tighter memory-full test, one that checks
9169         for alloca overflow.  Don't compute the address of the object just
9170         before an array, as that's not portable.  Use EMACS_INT, not
9171         ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
9172         * callint.c (Fcall_interactively):
9173         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9174         * callproc.c (call_process_kill, Fcall_process):
9175         Don't assume pid_t fits into an Emacs fixnum.
9176         (call_process_cleanup, Fcall_process, child_setup):
9177         Don't assume pid_t fits into int.
9178         (call_process_cleanup, Fcall_process, delete_temp_file)
9179         (Fcall_process_region):
9180         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9181         (Fcall_process): Simplify handling of volatile integers.
9182         Use int, not EMACS_INT, where int will do.
9183         * casefiddle.c (casify_object, casify_region, operate_on_word)
9184         (Fupcase_word, Fdowncase_word, Fcapitalize_word):
9185         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9186         (casify_object): Avoid integer overflow when overallocating buffer.
9187         * casetab.c (set_identity, shuffle): Prefer int to unsigned when
9188         either works.  Use lint_assume to convince GCC 4.6.1 that it's OK.
9189         * category.c (Fchar_category_set): Don't assume fixnum fits in int.
9190         * category.h (CATEGORYP): Don't assume arg is nonnegative.
9191         * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
9192         integers are now checked earlier.  All uses replaced with XINT.
9193         (ccl_driver):
9194         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9195         For CCL_MapSingle, check that content and value are in int range.
9196         (ccl_driver, Fregister_code_conversion_map):
9197         Check that Vcode_version_map_vector is a vector.
9198         (resolve_symbol_ccl_program): Check that vector header is in range.
9199         Always copy the vector, so that we can check its contents reliably
9200         now rather than having to recheck each instruction as it's being
9201         executed.  Check that vector words fit in 'int'.
9202         (ccl_get_compiled_code, Fregister_ccl_program)
9203         (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
9204         program indexes, to avoid needless 32-bit limit on 64-bit hosts.
9205         (Fccl_execute, Fccl_execute_on_string): Check that initial reg
9206         contents are in range.
9207         (Fccl_execute_on_string): Check that status is in range.
9208         * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
9209         * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
9210         Accept and return EMACS_INT, not int, because callers can pass values
9211         out of 'int' range.
9212         (c_string_width, strwidth, lisp_string_width, chars_in_text)
9213         (multibyte_chars_in_text, parse_str_as_multibyte)
9214         (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
9215         (str_as_unibyte, str_to_unibyte, string_count_byte8)
9216         (string_escape_byte8, Fget_byte):
9217         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9218         (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
9219         avoid mishandling large integers.
9220         * character.h: Adjust decls to match defn changes elsewhere.
9221         * charset.c (load_charset_map_from_file, find_charsets_in_text)
9222         (Ffind_charset_region):
9223         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9224         (load_charset_map_from_file): Redo idx calculation to avoid overflow.
9225         (load_charset_map_from_vector, Fdefine_charset_internal):
9226         Don't assume fixnum fits in int.
9227         (load_charset_map_from_vector, Fmap_charset_chars):
9228         Remove now-unnecessary CHECK_NATNUMs.
9229         (Fdefine_charset_internal): Check ranges here, more carefully.
9230         Don't rely on undefined behavior with signed left shift overflow.
9231         Don't assume unsigned int fits into fixnum, or that fixnum fits
9232         into unsigned int.  Don't require max_code to be a valid fixnum;
9233         that's not true for gb10830 4-byte on a 32-bit host.  Allow
9234         invalid_code to be a cons, for the same reason.  Require code_offset
9235         to be a character.  Avoid int overflow if max_char is close
9236         to INT_MAX.
9237         (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
9238         this is intended anyway and avoids some undefined behavior.
9239         (load_charset_map): Pass unsigned, not int, as 2nd arg of
9240         INDEX_TO_CODE_POINT, as that's what it expects.
9241         (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
9242         * charset.h (DECODE_CHAR): Return int, not unsigned;
9243         this is what was intended anyway, and it avoids undefined behavior.
9244         (CHARSET_OFFSET): Remove unused macro, instead of fixing its
9245         integer-overflow issues.
9246         (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
9247         Formerly, it returned EMACS_INT on 64-bit hosts in the common case
9248         where the argument is EMACS_INT, and this behavior is not intended.
9249         * chartab.c (Fmake_char_table, Fset_char_table_range)
9250         (uniprop_get_decoder, uniprop_get_encoder):
9251         Don't assume fixnum fits in int.
9252         * cmds.c (move_point): New function, that does the gist of
9253         Fforward_char and Fbackward_char, but does so while checking
9254         for integer overflow more accurately.
9255         (Fforward_char, Fbackward_char): Use it.
9256         (Fforward_line, Fend_of_line, internal_self_insert)
9257         (internal_self_insert):
9258         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9259         Fix a FIXME, by checking for integer overflow when calculating
9260         target_clm and actual_clm.
9261         * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
9262         (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
9263         (ASSURE_DESTINATION, coding_alloc_by_realloc)
9264         (coding_alloc_by_making_gap, alloc_destination)
9265         (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
9266         (encode_coding_utf_16, detect_coding_emacs_mule)
9267         (decode_coding_emacs_mule, encode_coding_emacs_mule)
9268         (detect_coding_iso_2022, decode_coding_iso_2022)
9269         (encode_invocation_designation, encode_designation_at_bol)
9270         (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
9271         (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
9272         (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
9273         (encode_coding_ccl, encode_coding_raw_text)
9274         (detect_coding_charset, decode_coding_charset)
9275         (encode_coding_charset, detect_eol, decode_eol, produce_chars)
9276         (produce_composition, produce_charset, produce_annotation)
9277         (decode_coding, handle_composition_annotation)
9278         (handle_charset_annotation, consume_chars, decode_coding_gap)
9279         (decode_coding_object, encode_coding_object, detect_coding_system)
9280         (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
9281         (code_convert_region, code_convert_string)
9282         (Fdefine_coding_system_internal)
9283         (coding_set_source, coding_set_destination):
9284         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9285         (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
9286         (Fdefine_coding_system_internal):
9287         Don't assume fixnums fit in int.
9288         (decode_coding_gap, decode_coding_object, encode_coding_object)
9289         (Fread_coding_system, Fdetect_coding_region)
9290         (Funencodable_char_position, Fcheck_coding_systems_region)
9291         (get_translation, handle_composition_annotation, consume_chars):
9292         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9293         (consume_chars): Rewrite to not calculate an address outside buffer.
9294         (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
9295         Don't access memory outside of the args array.
9296         (Fdefine_coding_system_internal): Check for charset-id overflow.
9297         (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
9298         result of ENCODE_CHAR.
9299         * coding.h: Adjust decls to match defn changes elsewhere.
9300         (struct coding_system):
9301         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9302         * composite.c (get_composition_id, find_composition)
9303         (run_composition_function, update_compositions)
9304         (compose_text, composition_gstring_put_cache)
9305         (composition_gstring_p, composition_gstring_width)
9306         (fill_gstring_header, fill_gstring_body, autocmp_chars)
9307         (composition_compute_stop_pos, composition_reseat_it)
9308         (composition_update_it, struct position_record)
9309         (find_automatic_composition, composition_adjust_point)
9310         (Fcomposition_get_gstring, Ffind_composition_internal):
9311         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9312         (update_compositions):
9313         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9314         * composite.h: Adjust decls to match defn changes elsewhere.
9315         (struct composition):
9316         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9317         * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
9318         Do not attempt to compute the address of the object just before a
9319         buffer; this is not portable.
9320         (Faref, Faset):
9321         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9322         (Faset): Use int, not EMACS_INT, where int is wide enough.
9323         (Fstring_to_number): Don't assume fixnums fit in int.
9324         (Frem): Don't assume arg is nonnegative.
9325         * dbusbind.c (xd_append_arg): Check for integers out of range.
9326         (Fdbus_call_method): Don't overflow the timeout int.
9327         (extract_signed, extract_unsigned): New functions.
9328         (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
9329         (xd_get_connection_references): Return ptrdiff_t, not int.
9330         All uses changed.
9331         (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
9332         (xd_read_message_1):
9333         Use int, not unsigned, where the dbus API uses int.
9334         (Fdbus_message_internal): Don't overflow mtype.
9335         (syms_of_dbusbind): Allocate right-sized buffer for integers.
9336         * dired.c (directory_files_internal, file_name_completion, scmp)
9337         (file_name_completion_stat):
9338         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9339         (file_name_completion): Don't overflow matchcount.
9340         (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
9341         * dispextern.h: Adjust decls to match defn changes elsewhere.
9342         (struct text_pos, struct glyph, struct bidi_saved_info)
9343         (struct bidi_string_data, struct bidi_it, struct composition_it)
9344         (struct it):
9345         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9346         (struct display_pos, struct composition_it, struct it):
9347         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9348         * dispnew.c (increment_matrix_positions)
9349         (increment_row_positions, mode_line_string)
9350         (marginal_area_string):
9351         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9352         (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
9353         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9354         (duration_to_sec_usec): New function, to check for overflow better.
9355         (Fsleep_for, sit_for): Use it.
9356         * doc.c (get_doc_string, store_function_docstring):
9357         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9358         (get_doc_string, Fsnarf_documentation):
9359         Use int, not EMACS_INT, where int is wide enough.
9360         (get_doc_string):
9361         Use SAFE_ALLOCA, not alloca.
9362         Check for overflow when converting EMACS_INT to off_t.
9363         * doprnt.c (doprnt):
9364         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9365         * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
9366         Don't assume uid_t fits into fixnum.
9367         (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
9368         (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
9369         (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
9370         (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
9371         (general_insert_function)
9372         (Finsert_char, make_buffer_string, make_buffer_string_both)
9373         (update_buffer_properties, Fbuffer_substring)
9374         (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
9375         (Fsubst_char_in_region, check_translation)
9376         (Ftranslate_region_internal, save_restriction_restore, Fformat)
9377         (transpose_markers, Ftranspose_regions):
9378         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9379         (clip_to_bounds): Move to lisp.h as an inline function).
9380         (Fconstrain_to_field): Don't assume integers are nonnegative.
9381         (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
9382         (Fsubst_char_in_region, Fsave_restriction):
9383         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9384         (Femacs_pid): Don't assume pid_t fits into fixnum.
9385         (lo_time): Use int, not EMACS_INT, when int suffices.
9386         (lisp_time_argument): Check for usec out of range.
9387         (Fencode_time): Don't assume fixnum fits in int.
9388         (Fuser_login_name, Fuser_full_name): Signal an error
9389         if a uid argument is out of range, rather than relying on
9390         undefined behavior.
9391         (Fformat_time_string): Remove now-unnecessary check.
9392         lisp_time_argument checks for out-of-range usec now.
9393         Use ptrdiff_t, not size_t, where ptrdiff_t will do.
9394         * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
9395         (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
9396         (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
9397         (init_cmdargs, Fdump_emacs):
9398         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9399         (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
9400         the bottom (typically) 32 bits of the fixnum.
9401         * eval.c (specpdl_size, call_debugger):
9402         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9403         (when_entered_debugger, Fbacktrace_debug):
9404         Don't assume fixnum can fit in int.
9405         (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
9406         the object just before a buffer; this is not portable.
9407         (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
9408         (grow_specpdl, unbind_to):
9409         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9410         (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
9411         (grow_specpdl): Simplify allocation by using xpalloc.
9412         (Fprog1, Fprog2): Don't assume list length fits in int.  Simplify.
9413         * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
9414         (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
9415         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9416         (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
9417         (a_write, e_write):
9418         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9419         (Fcopy_file, non_regular_nbytes, read_non_regular)
9420         (Finsert_file_contents):
9421         Use int, not EMACS_INT, where int is wide enough.
9422         (READ_BUF_SIZE): Verify that it fits in int.
9423         (Finsert_file_contents): Check that counts are in proper range,
9424         rather than assuming fixnums fit into ptrdiff_t etc.
9425         Don't assume fixnums fit into int.
9426         * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
9427         * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
9428         (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
9429         (string_char_to_byte, string_byte_to_char)
9430         (string_make_multibyte, string_to_multibyte)
9431         (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
9432         (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
9433         (substring_both, Fdelete, internal_equal, Ffillarray)
9434         (Fclear_string, mapcar1)
9435         (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
9436         (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
9437         (larger_vector, make_hash_table, maybe_resize_hash_table)
9438         (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
9439         (Fmaphash, secure_hash):
9440         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9441         (concat): Check for string index and length overflow.
9442         (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
9443         (Frequire):
9444         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9445         (larger_vector): New API (vec, incr_min, size_max) replaces old
9446         one (vec, new_size, init).  This catches size overflow.
9447         INIT was removed because it was always Qnil.
9448         All callers changed.
9449         (INDEX_SIZE_BOUND): New macro, which calculates more precisely
9450         the upper bound on a hash table index size.
9451         (make_hash_table, maybe_resize_hash_table): Use it.
9452         (secure_hash): Computer start_byte and end_byte only after
9453         they're known to be in ptrdiff_t range.
9454         * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
9455         (Ffont_get_glyphs, Ffont_at):
9456         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9457         (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
9458         (Flist_fonts, Fopen_font):
9459         Don't assume fixnum can fit in int.
9460         (check_gstring): Don't assume index can fit in int.
9461         (font_match_p): Check that fixnum is a character, not a nonnegative
9462         fixnum, since the later code needs to stuff it into an int.
9463         (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
9464         (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
9465         conversion overflow issues.
9466         (Fopen_font): Check for integer out of  range.
9467         (Ffont_get_glyphs): Don't assume index can fit in int.
9468         * font.h: Adjust decls to match defn changes elsewhere.
9469         * fontset.c (reorder_font_vector): Redo score calculation to avoid
9470         integer overflow.
9471         (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
9472         printmax_t, where ptrdiff_t is wide enough.
9473         (Finternal_char_font):
9474         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9475         * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
9476         (Fset_frame_height, Fset_frame_width, Fset_frame_size)
9477         (Fset_frame_position, x_set_frame_parameters)
9478         (x_set_line_spacing, x_set_border_width)
9479         (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
9480         Check that fixnums are in proper range for system types.
9481         (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
9482         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9483         (Fmodify_frame_parameters): Don't assume fixnum fits in int.
9484         Use SAFE_ALLOCA_LISP, not alloca.
9485         * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
9486         intptr_t is wide enough.
9487         * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
9488         (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
9489         (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
9490         Check for fixnum out of range.
9491         * ftfont.c (ftfont_list): Don't assume index fits in int.
9492         Check that fixnums are in proper range for system types.
9493         (ftfont_shape_by_flt):
9494         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9495         * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
9496         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9497         (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
9498         Check that fixnums are in proper range for system types.
9499         * gnutls.h: Adjust decls to match defn changes elsewhere.
9500         * gtkutil.c (xg_dialog_run):
9501         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9502         (update_frame_tool_bar):
9503         Check that fixnums are in proper range for system types.
9504         * image.c (parse_image_spec): Redo count calculation to avoid overflow.
9505         (lookup_image): Check that fixnums are in range for system types.
9506         * indent.c (last_known_column, last_known_column_point):
9507         (current_column_bol_cache):
9508         (skip_invisible, current_column, check_display_width):
9509         (check_display_width, scan_for_column, current_column_1)
9510         (Findent_to, Fcurrent_indentation, position_indentation)
9511         (indented_beyond_p, Fmove_to_column, compute_motion):
9512         (Fcompute_motion, Fvertical_motion):
9513         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9514         (last_known_column_modified): Use EMACS_INT, not int.
9515         (check_display_width):
9516         (Fcompute_motion):
9517         Check that fixnums and floats are in proper range for system types.
9518         (compute_motion): Don't assume index or fixnum fits in int.
9519         (compute_motion, Fcompute_motion):
9520         Use int, not EMACS_INT, when it is wide enough.
9521         (vmotion): Omit local var start_hpos that is always 0; that way
9522         we don't need to worry about overflow in expressions involving it.
9523         * indent.h: Adjust decls to match defn changes elsewhere.
9524         (struct position):
9525         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9526         Use int, not EMACS_INT, where int is wide enough.
9527         Remove unused members ovstring_chars_done and tab_offset;
9528         all uses removed.
9529         * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
9530         (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
9531         (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
9532         (make_gap, copy_text, insert, insert_and_inherit)
9533         (insert_before_markers, insert_before_markers_and_inherit)
9534         (insert_1, count_combining_before, count_combining_after)
9535         (insert_1_both, insert_from_string)
9536         (insert_from_string_before_markers, insert_from_string_1)
9537         (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
9538         (adjust_after_replace, adjust_after_insert, replace_range)
9539         (replace_range_2, del_range, del_range_1, del_range_byte)
9540         (del_range_both, del_range_2, modify_region)
9541         (prepare_to_modify_buffer, signal_before_change)
9542         (signal_after_change, Fcombine_after_change_execute):
9543         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9544         * intervals.c (traverse_intervals, rotate_right, rotate_left)
9545         (balance_an_interval, split_interval_right, split_interval_left)
9546         (find_interval, next_interval, update_interval)
9547         (adjust_intervals_for_insertion, delete_node, delete_interval)
9548         (interval_deletion_adjustment, adjust_intervals_for_deletion)
9549         (static_offset_intervals, offset_intervals)
9550         (merge_interval_right, merge_interval_left, make_new_interval)
9551         (graft_intervals_into_buffer, temp_set_point_both)
9552         (temp_set_point, set_point, adjust_for_invis_intang)
9553         (set_point_both, move_if_not_intangible, get_property_and_range)
9554         (get_local_map, copy_intervals, copy_intervals_to_string)
9555         (compare_string_intervals, set_intervals_multibyte_1):
9556         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9557         * intervals.h: Adjust decls to match defn changes elsewhere.
9558         (struct interval):
9559         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9560         * keyboard.c (this_command_key_count, this_single_command_key_start)
9561         (before_command_key_count, before_command_echo_length, echo_now)
9562         (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
9563         (command_loop_1, safe_run_hooks, read_char, timer_check_2)
9564         (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
9565         (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
9566         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9567         (last_non_minibuf_size, last_point_position, echo_truncate)
9568         (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
9569         (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
9570         (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
9571         (stuff_buffered_input):
9572         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9573         (last_auto_save, command_loop_1, read_char):
9574         Use EMACS_INT, not int, to avoid integer overflow.
9575         (record_char): Avoid overflow in total_keys computation.
9576         (parse_modifiers_uncached): Redo index calculation to avoid overflow.
9577         * keyboard.h: Adjust decls to match defn changes elsewhere.
9578         * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
9579         (Fkey_description, Fdescribe_vector, Flookup_key):
9580         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9581         (click_position): New function, to check that positions are in range.
9582         (Fcurrent_active_maps):
9583         (describe_command):
9584         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9585         (Faccessible_keymaps, Fkey_description):
9586         (preferred_sequence_p):
9587         Don't assume fixnum can fit into int.
9588         (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
9589         Check for integer overflow in size calculations.
9590         (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
9591         avoid mishandling large integers.
9592         * lisp.h: Adjust decls to match defn changes elsewhere.
9593         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
9594         (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
9595         (struct Lisp_Marker):
9596         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9597         (clip_to_bounds): Now an inline function, moved here from editfns.c.
9598         (GLYPH_CODE_P): Check for overflow in system types, subsuming the
9599         need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
9600         All callers changed.
9601         (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
9602         Assume the arg has valid form, since it always does.
9603         (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
9604         unsigned integer system type.
9605         (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
9606         (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
9607         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9608         (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
9609         (duration_to_sec_usec): New decl.
9610         * lread.c (read_from_string_index, read_from_string_index_byte)
9611         (read_from_string_limit, readchar, unreadchar, openp)
9612         (read_internal_start, read1, oblookup):
9613         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9614         (Fload, readevalloop, Feval_buffer, Feval_region):
9615         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9616         (openp): Check for out-of-range argument to 'access'.
9617         (read1): Use int, not EMACS_INT, where int is wide enough.
9618         Don't assume fixnum fits into int.
9619         Fix off-by-one error that can read outside a buffer.
9620         (read_filtered_event): Use duration_to_sec_usec
9621         to do proper overflow checking on durations.
9622         * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
9623         in size calculation.
9624         (Fexecute_kbd_macro):
9625         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9626         * marker.c (cached_charpos, cached_bytepos, CONSIDER)
9627         (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
9628         (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
9629         (set_marker_both, set_marker_restricted_both, marker_position)
9630         (marker_byte_position, Fbuffer_has_markers_at):
9631         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9632         (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
9633         * menu.c (ensure_menu_items): Rename from grow_menu_items.
9634         It now merely ensures that the menu is large enough, without
9635         necessarily growing it, as this avoids some integer overflow issues.
9636         All callers changed.
9637         (keymap_panes, parse_single_submenu, Fx_popup_menu):
9638         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9639         (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
9640         Use SAFE_ALLOCA_LISP, not alloca.
9641         (find_and_return_menu_selection): Avoid unnecessary casts of pointers
9642         to EMACS_INT.  Check that fixnums are in proper range for system types.
9643         * minibuf.c (minibuf_prompt_width, string_to_object)
9644         (Fminibuffer_contents, Fminibuffer_contents_no_properties)
9645         (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
9646         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9647         (get_minibuffer, read_minibuf_unwind):
9648         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9649         (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
9650         this simplifies overflow checking.  All callers changed.
9651         (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
9652         (Ftest_completion):
9653         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9654         * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
9655         (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
9656         Check that fixnums are in proper range for system types.
9657         (Fx_create_frame, Fx_show_tip):
9658         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9659         * nsfont.m (ns_findfonts, nsfont_list_family):
9660         Don't assume fixnum fits in long.
9661         * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
9662         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9663         (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
9664         wide enough.
9665         * nsselect.m (ns_get_local_selection, clean_local_selection_data):
9666         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9667         * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
9668         (PRINTDECLARE, PRINTPREPARE):
9669         (strout, print_string):
9670         (print, print_preprocess, print_check_string_charset_prop)
9671         (print_object):
9672         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9673         (PRINTDECLARE):
9674         (temp_output_buffer_setup, Fprin1_to_string, print_object):
9675         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9676         (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
9677         (printchar, strout): Use xpalloc to catch size calculation overflow.
9678         (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
9679         (print_error_message): Use SAFE_ALLOCA, not alloca.
9680         (print_object): Use int, not EMACS_INT, where int is wide enough.
9681         (print_depth, new_backquote_output, print_number_index):
9682         Use ptrdiff_t, not int, where int might not be wide enough.
9683         * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
9684         (Fset_process_window_size, Fformat_network_address)
9685         (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
9686         (sigchld_handler):
9687         Check that fixnums are in proper range for system types.
9688         (Fsignal_process): Simplify by avoiding a goto.
9689         Check for process-ids out of pid_t range rather than relying on
9690         undefined behavior.
9691         (process_tick, update_tick): Use EMACS_INT, not int.
9692         (Fformat_network_address, read_process_output, send_process)
9693         (Fprocess_send_region, status_notify):
9694         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9695         (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
9696         (wait_reading_process_output, read_process_output, exec_sentinel):
9697         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9698         (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
9699         (Faccept_process_output): Use duration_to_sec_usec to do proper
9700         overflow checking on durations.
9701         (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
9702         Don't assume pid_t fits in int.
9703         * process.h (struct Lisp_Process): Members tick and update_tick
9704         are now of type EMACS_INT, not int.
9705         * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
9706         configured --with-wide-int.
9707         * scroll.c (calculate_scrolling, calculate_direct_scrolling)
9708         (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
9709         * search.c (looking_at_1, string_match_1):
9710         (fast_string_match, fast_c_string_match_ignore_case)
9711         (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
9712         (scan_newline, find_before_next_newline, search_command)
9713         (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
9714         (set_search_regs, wordify):
9715         (Freplace_match):
9716         (Fmatch_data):
9717         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9718         (string_match_1, search_buffer, set_search_regs):
9719         (Fmatch_data):
9720         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9721         (wordify): Check for overflow in size calculation.
9722         (Freplace_match): Avoid potential buffer overflow in search_regs.start.
9723         (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
9724         Check that fixnums are in proper range for system types.
9725         * sound.c (struct sound_device)
9726         (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
9727         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9728         (Fplay_sound_internal):
9729         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9730         * syntax.c (struct lisp_parse_state, find_start_modiff)
9731         (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
9732         (Fparse_partial_sexp):
9733         Don't assume fixnums can fit in int.
9734         (struct lisp_parse_state, find_start_pos, find_start_value)
9735         (find_start_value_byte, find_start_begv)
9736         (update_syntax_table, char_quoted, dec_bytepos)
9737         (find_defun_start, prev_char_comend_first, back_comment):
9738         (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
9739         (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
9740         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9741         (Finternal_describe_syntax_value): Check that match_lisp is a
9742         character, not an integer, since the code stuffs it into int.
9743         (scan_words, scan_sexps_forward):
9744         Check that fixnums are in proper range for system types.
9745         (Fforward_word):
9746         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9747         (scan_sexps_forward):
9748         Use CHARACTERP, not INTEGERP, since the value must fit into int.
9749         (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
9750         * syntax.h: Adjust decls to match defn changes elsewhere.
9751         (struct gl_state_s):
9752         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9753         (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
9754         MOST_POSITIVE_FIXNUM.
9755         * sysdep.c (wait_for_termination_1, wait_for_termination)
9756         (interruptible_wait_for_termination, mkdir):
9757         Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
9758         (emacs_read, emacs_write):
9759         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9760         (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
9761         and double all fit in int.
9762         * term.c (set_tty_color_mode):
9763         Check that fixnums are in proper range for system types.
9764         * termhooks.h (struct input_event):
9765         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9766         * textprop.c (validate_interval_range, interval_of)
9767         (Fadd_text_properties, set_text_properties_1)
9768         (Fremove_text_properties, Fremove_list_of_text_properties)
9769         (Ftext_property_any, Ftext_property_not_all)
9770         (copy_text_properties, text_property_list, extend_property_ranges)
9771         (verify_interval_modification):
9772         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9773         (Fnext_single_char_property_change)
9774         (Fprevious_single_char_property_change):
9775         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9776         (copy_text_properties):
9777         Check for integer overflow in index calculation.
9778         * undo.c (last_boundary_position, record_point, record_insert)
9779         (record_delete, record_marker_adjustment, record_change)
9780         (record_property_change):
9781         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9782         (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
9783         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9784         * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
9785         (Fx_hide_tip, Fx_file_dialog):
9786         * w32menu.c (set_frame_menubar):
9787         Use ptrdiff_t, not int, for consistency with rest of code.
9788         * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
9789         (select_window, Fdelete_other_windows_internal)
9790         (window_scroll_pixel_based, window_scroll_line_based)
9791         (Frecenter, Fset_window_configuration):
9792         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9793         (Fset_window_hscroll, run_window_configuration_change_hook)
9794         (set_window_buffer, temp_output_buffer_show, scroll_command)
9795         (Fscroll_other_window, Frecenter):
9796         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9797         (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
9798         Don't assume fixnum fits in int.
9799         (Fset_window_scroll_bars):
9800         Check that fixnums are in proper range for system types.
9801         * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
9802         (string_pos, c_string_pos, number_of_chars, init_iterator)
9803         (in_ellipses_for_invisible_text_p, init_from_display_pos)
9804         (compute_stop_pos, next_overlay_change, compute_display_string_pos)
9805         (compute_display_string_end, handle_face_prop)
9806         (face_before_or_after_it_pos, handle_invisible_prop)
9807         (handle_display_prop, handle_display_spec, handle_single_display_spec)
9808         (display_prop_intangible_p, string_buffer_position_lim)
9809         (string_buffer_position, handle_composition_prop, load_overlay_strings)
9810         (get_overlay_strings_1, get_overlay_strings)
9811         (iterate_out_of_display_property, forward_to_next_line_start)
9812         (back_to_previous_visible_line_start, reseat, reseat_to_string)
9813         (get_next_display_element, set_iterator_to_next)
9814         (get_visually_first_element, compute_stop_pos_backwards)
9815         (handle_stop_backwards, next_element_from_buffer)
9816         (move_it_in_display_line_to, move_it_in_display_line)
9817         (move_it_to, move_it_vertically_backward, move_it_by_lines)
9818         (add_to_log, message_dolog, message_log_check_duplicate)
9819         (message2, message2_nolog, message3, message3_nolog
9820         (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
9821         (current_message_1, truncate_echo_area, truncate_message_1)
9822         (set_message, set_message_1, store_mode_line_noprop)
9823         (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
9824         (text_outside_line_unchanged_p, check_point_in_composition)
9825         (reconsider_clip_changes)
9826         (redisplay_internal, set_cursor_from_row, try_scrolling)
9827         (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
9828         (redisplay_window, find_last_unchanged_at_beg_row)
9829         (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
9830         (trailing_whitespace_p, find_row_edges, display_line)
9831         (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
9832         (display_mode_element, store_mode_line_string)
9833         (pint2str, pint2hrstr, decode_mode_spec)
9834         (display_count_lines, display_string, draw_glyphs)
9835         (x_produce_glyphs, x_insert_glyphs)
9836         (rows_from_pos_range, mouse_face_from_buffer_pos)
9837         (fast_find_string_pos, mouse_face_from_string_pos)
9838         (note_mode_line_or_margin_highlight, note_mouse_highlight):
9839         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9840         (safe_call, init_from_display_pos, handle_fontified_prop)
9841         (handle_single_display_spec, load_overlay_strings)
9842         (with_echo_area_buffer, setup_echo_area_for_printing)
9843         (display_echo_area, echo_area_display)
9844         (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
9845         (update_tool_bar, hscroll_window_tree, redisplay_internal)
9846         (redisplay_window, dump_glyph_row, display_mode_line)
9847         (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
9848         (handle_display_spec, display_prop_string_p):
9849         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9850         (handle_single_display_spec, build_desired_tool_bar_string)
9851         (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
9852         (get_specified_cursor_type):
9853         Check that fixnums are in proper range for system types.
9854         (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
9855         (Flookup_image_map):
9856         Don't assume fixnums fit in int.
9857         (compare_overlay_entries):
9858         Avoid mishandling comparisons due to subtraction overflow.
9859         (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
9860         (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
9861         (handle_tool_bar_click):
9862         Use int, not unsigned, since we prefer signed and the signedness
9863         doesn't matter here.
9864         (get_next_display_element, next_element_from_display_vector):
9865         Use int, not EMACS_INT, when int is wide enough.
9866         (start_hourglass): Use duration_to_sec_usec to do proper
9867         overflow checking on durations.
9868         * xfaces.c (Fbitmap_spec_p):
9869         Check that fixnums are in proper range for system types.
9870         (compare_fonts_by_sort_order):
9871         Avoid mishandling comparisons due to subtraction overflow.
9872         (Fx_family_fonts, realize_basic_faces):
9873         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9874         (Fx_family_fonts):
9875         Don't assume fixnum fits in int.
9876         Use SAFE_ALLOCA_LISP, not alloca.
9877         (merge_face_heights): Remove unnecessary cast to EMACS_INT.
9878         (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
9879         (face_at_buffer_position, face_for_overlay_string)
9880         (face_at_string_position):
9881         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9882         (merge_faces): Use int, not EMACS_INT, where int is wide enough.
9883         * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
9884         (Fx_show_tip):
9885         Check that fixnums are in proper range for system types.
9886         (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
9887         (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
9888         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9889         (Fx_change_window_property): Don't assume fixnums fit in int.
9890         * xfont.c (xfont_chars_supported):
9891         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9892         * xmenu.c (Fx_popup_dialog, set_frame_menubar)
9893         (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
9894         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9895         * xml.c (parse_region):
9896         * xrdb.c (magic_file_p):
9897         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9898         * xselect.c (TRACE1): Don't assume pid_t promotes to int.
9899         (x_get_local_selection, x_reply_selection_request)
9900         (x_handle_selection_request, wait_for_property_change):
9901         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9902         (selection_data_to_lisp_data): Use short, not EMACS_INT, where
9903         short is wide enough.
9904         (x_send_client_event): Don't assume fixnum fits in int.
9905         * xterm.c (x_x_to_emacs_modifiers):
9906         Don't assume EMACS_INT overflows nicely into int.
9907         (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
9908         may come from Lisp.
9909         (handle_one_xevent): NATNUMP can eval its arg twice.
9910         (x_connection_closed):
9911         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9912         * xterm.h: Adjust decls to match defn changes elsewhere.
9913         (struct scroll_bar): Use struct vectorlike_header
9914         rather than rolling our own approximation.
9915         (SCROLL_BAR_VEC_SIZE): Remove; not used.
9917 2012-05-25  Glenn Morris  <rgm@gnu.org>
9919         * lisp.mk (lisp): Update for more files being compiled now.
9921 2012-05-25  Stefan Monnier  <monnier@iro.umontreal.ca>
9923         * lread.c: Remove `read_pure' which makes no difference.
9924         (read_pure): Remove var.
9925         (unreadpure): Remove function.
9926         (readevalloop): Don't call read_list with -1 flag.
9927         (read1, read_vector): Don't test read_pure any more.
9928         (read_list): Simplify.
9930         * fileio.c, character.h: Minor style tweaks.
9932 2012-05-24  Dmitry Antipov  <dmantipov@yandex.ru>
9934         * window.h (clip_changed): Remove useless declaration.
9936 2012-05-22  Juanma Barranquero  <lekktu@gmail.com>
9938         * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
9939         (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
9941 2012-05-22  Paul Eggert  <eggert@cs.ucla.edu>
9943         Remove src/m/*.
9944         This directory predates autoconf and is no longer needed nowadays.
9945         Move its few remaining bits of functionality to where they're needed.
9946         * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
9947         * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
9948         * m/template.h: Remove.
9949         * Makefile.in (M_FILE): Remove.  All uses removed.
9950         * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
9951         * lisp.h (USE_LSB_TAG):
9952         * mem-limits.h (EXCEEDS_LISP_PTR):
9953         Use VAL_MAX, not VALBITS, in #if.
9954         * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
9955         (EMACS_UINT): Define unconditionally now.
9956         (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
9957         (BITS_PER_EMACS_INT): New constants, replacing
9958         what used to be in config.h, but not useful in #if.
9959         (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
9960         define them any more.
9961         (VAL_MAX): New macro.
9962         (VALMASK): Use it.
9963         * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
9964         BITS_PER_EMACS_INT, in #if.
9965         * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
9966         (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
9967         * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
9968         * s/ms-w32.h (DATA_START):
9969         Move here from removed file m/intel386.h.
9970         * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
9971         * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
9973 2012-05-21  Paul Eggert  <eggert@cs.ucla.edu>
9975         Assume C89 or later.
9976         * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
9977         * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
9978         (xrealloc):
9979         * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
9980         * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
9981         * textprop.c, tparam.c (NULL): Remove.
9982         * ralloc.c, vm-limit.c (POINTER): Assume void * works.
9983         * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
9984         * regex.h (_RE_ARGS): Remove.  All uses rewritten to use prototypes.
9985         * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
9986         * xterm.c (input_signal_count): Assume volatile works.
9988 2012-05-21  Ken Brown  <kbrown@cornell.edu>
9990         * xgselect.c (xg_select): Fix first argument in call to 'select'
9991         (bug#11508).
9993 2012-05-20  Ken Brown  <kbrown@cornell.edu>
9995         * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
9996         [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
9998 2012-05-19  Ken Brown  <kbrown@cornell.edu>
10000         * xfns.c (x_in_use): Remove `static' qualifier.
10001         * xterm.h (x_in_use): Declare.
10002         * xgselect.c: Include xterm.h.
10003         (xg_select): Test `x_in_use' instead of `inhibit_window_system'
10004         and `display_arg' (bug#9754).
10006 2012-05-19  Paul Eggert  <eggert@cs.ucla.edu>
10008         * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
10010         * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
10011         * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
10013 2012-05-18  Eli Zaretskii  <eliz@gnu.org>
10015         Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
10017         * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
10018         (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
10020         * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
10021         reference to image_cache->refcount.
10022         (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
10024 2012-05-17  Juri Linkov  <juri@jurta.org>
10026         * search.c (Fword_search_regexp, Fword_search_backward)
10027         (Fword_search_forward, Fword_search_backward_lax)
10028         (Fword_search_forward_lax): Move functions to isearch.el
10029         (bug#10145, bug#11381).
10031 2012-05-16  Paul Eggert  <eggert@cs.ucla.edu>
10033         * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
10035 2012-05-15  Stefan Monnier  <monnier@iro.umontreal.ca>
10037         * lread.c (init_obarray): Declare Qt and Qnil as special.
10039 2012-05-14  Glenn Morris  <rgm@gnu.org>
10041         * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
10042         Put "libexec" before "bin", for the sake of init_callproc_1.
10044 2012-05-14  Paul Eggert  <eggert@cs.ucla.edu>
10046         * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
10048         * unexaix.c: Port to more-recent AIX compilers.
10049         (report_error, report_error_1, make_hdr, copy_sym)
10050         (mark_x, adjust_lnnoptrs, unrelocate_symbols):
10051         Make arguments const char *, not char *, to avoid violations of C
10052         standard and to fix some AIX warnings reported by Gilles Pion.
10054 2012-05-14  Eli Zaretskii  <eliz@gnu.org>
10056         * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
10057         already have overlays loaded.
10058         (handle_single_display_spec): Before returning without displaying
10059         fringe bitmap, synchronize the bidi iterator with the main display
10060         iterator, by calling iterate_out_of_display_property.
10061         (iterate_out_of_display_property): Detect buffer iteration by
10062         testing that it->string is a Lisp string.
10063         (get_next_display_element): When the current object is exhausted,
10064         and there's something on it->stack, call set_iterator_to_next to
10065         proceed with what's on the stack, instead of returning zero.
10066         (set_iterator_to_next): If called at the end of a Lisp string,
10067         proceed to consider_string_end without incrementing string
10068         position.  Don't increment display vector index past the end of
10069         the display vector.  (Bug#11417)
10070         (pos_visible_p): Don't report a position visible when move_it_to
10071         stopped at the last line of window, which happens to be scanned
10072         backwards by the bidi iteration.  (Bug#11464)
10074 2012-05-14  Eli Zaretskii  <eliz@gnu.org>
10076         * xdisp.c (handle_single_display_spec): Return 1 for left-margin
10077         and right-margin display specs even if the spec is invalid or we
10078         are on a TTY, and thus unable to display on the fringes.
10079         That's because the text with the property will not be displayed anyway,
10080         so we need to signal to the caller that this is a "replacing"
10081         display spec.  This fixes display when the spec is invalid or we
10082         are on a TTY.
10084 2012-05-14  Paul Eggert  <eggert@cs.ucla.edu>
10086         * unexaix.c (make_hdr): Fix typo in prototype.
10087         This bug broke the build on AIX.  Problem reported by Gilles Pion.
10089 2012-05-14  Michael Albinus  <michael.albinus@gmx.de>
10091         * keyboard.c (kbd_buffer_get_event): Read special events also in
10092         batch mode.  (Bug#11415)
10094 2012-05-12  Glenn Morris  <rgm@gnu.org>
10096         * ns.mk: Update for ns_appbindir no longer having trailing "/".
10098 2012-05-12  Eli Zaretskii  <eliz@gnu.org>
10100         * lisp.mk (lisp): Add newcomment.elc.
10102 2012-05-12  Glenn Morris  <rgm@gnu.org>
10104         * Makefile.in (MKDIR_P): New, set by configure.
10105         * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
10107 2012-05-11  Paul Eggert  <eggert@cs.ucla.edu>
10109         Remove unused function hourglass_started.
10110         * dispextern.h (hourglass_started):
10111         * w32fns.c (hourglass_started):
10112         * xdisp.c (hourglass_started): Remove.
10114 2012-05-10  Juanma Barranquero  <lekktu@gmail.com>
10116         * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
10117         Update dependencies.
10119 2012-05-10  Paul Eggert  <eggert@cs.ucla.edu>
10121         * xgselect.c (xg_select): Put maxfds+1 into a var.
10122         This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
10124         * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
10126 2012-05-10  Dave Abrahams  <dave@boostpro.com>
10128         * filelock.c (syms_of_filelock): New boolean create-lockfiles.
10129         (lock_file): If create_lockfiles is 0, do nothing.  (Bug#11227)
10131 2012-05-09  Michael Albinus  <michael.albinus@gmx.de>
10133         * dbusbind.c (xd_registered_buses): New internal Lisp object.
10134         Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
10135         (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
10136         Initialize xd_registered_buses.
10138 2012-05-09  Paul Eggert  <eggert@cs.ucla.edu>
10140         Untag more efficiently if USE_LSB_TAG.
10141         This is based on a proposal by YAMAMOTO Mitsuharu in
10142         <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
10143         For an admittedly artificial (nth 8000 longlist) benchmark on
10144         Fedora 15 x86-64, this yields a 25% CPU speedup.  Also, it shrinks
10145         Emacs's overall text size by 1%.
10146         * lisp.h (XUNTAG): New macro.
10147         (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
10148         (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
10149         (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
10150         * eval.c (Fautoload):
10151         * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
10152         * frame.h (XFRAME): Use XUNTAG.
10154         Port recent dbusbind.c changes to 32-bit --with-wide-int.
10155         * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
10156         Remove unportable assumptions about print widths of types like
10157         dbus_uint32_t.
10158         (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
10159         intptr_t when converting between pointer and integer, to avoid GCC
10160         warnings about wrong width.
10162 2012-05-09  Eli Zaretskii  <eliz@gnu.org>
10164         * w32proc.c (new_child): Force Windows to reserve only 64KB of
10165         stack for each reader_thread, instead of defaulting to 8MB
10166         determined by the linker.  This avoids failures in creating
10167         subprocesses on Windows 7, see the discussion in this thread:
10168         http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
10170 2012-05-07  Jérémy Compostella  <jeremy.compostella@gmail.com>
10172         Fix up display of the *Minibuf-0* buffer in the mini window.
10173         * keyboard.c (read_char): Don't clear the echo area if there's no
10174         message to clear.
10175         * xdisp.c (redisplay_internal): Redisplay the mini window (with the
10176         contents of *Minibuf-0*) if there's no message displayed in its stead.
10178 2012-05-07  Michael Albinus  <michael.albinus@gmx.de>
10180         * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
10181         batch mode.
10183 2012-05-06  Chong Yidong  <cyd@gnu.org>
10185         * lisp.mk (lisp): Update.
10187 2012-05-05  Jim Meyering  <meyering@redhat.com>
10189         * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
10191 2012-05-04  Stefan Monnier  <monnier@iro.umontreal.ca>
10193         * data.c (PUT_ERROR): New macro.
10194         (syms_of_data): Use it.  Add new error type `user-error'.
10195         * undo.c (user_error): New function.
10196         (Fprimitive_undo): Use it.
10197         * print.c (print_error_message): Adjust print style for `user-error'.
10198         * keyboard.c (user_error): New function.
10199         (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
10201 2012-05-03  Paul Eggert  <eggert@cs.ucla.edu>
10203         Do not limit current-time-string to years 1000..9999.
10204         * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
10205         (Fcurrent_time_string): Support any year that is supported by the
10206         underlying localtime representation.  Don't use asctime, as it
10207         has undefined behavior for years outside the range -999..9999.
10209 2012-05-02  Paul Eggert  <eggert@cs.ucla.edu>
10211         Fix race conditions involving setenv, gmtime, localtime, asctime.
10212         Without this fix, interrupts could mess up code that uses these
10213         nonreentrant functions, since setting TZ invalidates existing
10214         tm_zone or tzname values, and since most of these functions return
10215         pointers to static storage.
10216         * editfns.c (format_time_string, Fdecode_time, Fencode_time)
10217         (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
10218         Grow the critical sections to include not just invoking
10219         localtime/gmtime, but also accessing these functions' results
10220         including their tm_zone values if any, and any related TZ setting.
10221         (format_time_string): Last arg is now struct tm *, not struct tm **,
10222         so that the struct tm is saved in the critical section.
10223         All callers changed.  Simplify allocation of initial buffer, partly
10224         motivated by the fact that memory allocation needs to be outside
10225         the critical section.
10227 2012-05-02  Dmitry Antipov  <dmantipov@yandex.ru>
10229         * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
10230         with RESET_INTERVAL.
10232         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
10233         Remove duplicated buffer name initialization.
10235 2012-05-02  Jim Meyering  <jim@meyering.net>
10237         * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
10239         * xfns.c (x_window): Use xstrdup (Bug#11375).
10241 2012-05-02  Eli Zaretskii  <eliz@gnu.org>
10243         * xdisp.c (pos_visible_p): If already at a newline from the
10244         display string before the 'while' loop, don't walk back the glyphs
10245         from it3.glyph_row.  Solves assertion violation when the display
10246         string begins with a newline (egg.el).  (Bug#11367)
10248 2012-05-01  Stefan Monnier  <monnier@iro.umontreal.ca>
10250         * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
10251         Move to simple.el.
10253 2012-05-01  Glenn Morris  <rgm@gnu.org>
10255         * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
10256         s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
10257         and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
10258         All were removed before 23.1.
10260         * dispnew.c: Remove HAVE_LIBNCURSES test;
10261         it is always true on relevant platforms.
10263         * Makefile.in (LD_SWITCH_X_SITE_RPATH):
10264         Rename from LD_SWITCH_X_SITE_AUX_RPATH.
10266         * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
10268 2012-04-30  Andreas Schwab  <schwab@linux-m68k.org>
10270         * .gdbinit (xpr): Remove checks for no longer existing misc types.
10271         (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
10272         Remove.
10274 2012-04-28  Paul Eggert  <eggert@cs.ucla.edu>
10276         Do not avoid creating empty evaporating overlays (Bug#9642).
10277         * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
10278         That is, do not delete an evaporating overlay if it becomes
10279         empty after its bounds are adjusted to fit within its buffer.
10280         This fix caused other problems, and I'm reverting it until we get
10281         to the bottom of them.
10283 2012-04-27  Chong Yidong  <cyd@gnu.org>
10285         * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
10287 2012-04-27  Eli Zaretskii  <eliz@gnu.org>
10289         * xdisp.c (pos_visible_p): If the window start position is beyond
10290         ZV, start the display from buffer beginning.  Prevents assertion
10291         violation in init_iterator when the minibuffer window is scrolled
10292         via the scroll bar.
10294         * window.c (window_scroll_pixel_based): Likewise.
10296 2012-04-27  Chong Yidong  <cyd@gnu.org>
10298         * keymap.c (where_is_internal): Doc fix (Bug#10872).
10300 2012-04-27  Glenn Morris  <rgm@gnu.org>
10302         * fileio.c (Fcopy_file, Fset_file_selinux_context):
10303         Ignore ENOTSUP failures from setfilecon functions.  (Bug#11245)
10305 2012-04-27  Eli Zaretskii  <eliz@gnu.org>
10307         * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
10308         Don't overrun array limits of glyph row's used[] array.  (Bug#11288)
10310 2012-04-26  Eli Zaretskii  <eliz@gnu.org>
10312         * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
10313         display element, check also the underlying string or buffer
10314         character.  (Bug#11341)
10316         * w32menu.c: Include w32heap.h.
10317         (add_menu_item): If the call to AppendMenuW (via
10318         unicode_append_menu) fails, disable Unicode menus only if we are
10319         running on Windows 9X/Me.
10321 2012-04-24  Andreas Schwab  <schwab@linux-m68k.org>
10323         * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
10324         (xgetint): Add missing shift for LSB tags.
10326 2012-04-24  Martin Rudalics  <rudalics@gmx.at>
10328         * keyboard.c (read_char): Don't wipe echo area for select window
10329         events: These might get delayed via `mouse-autoselect-window'
10330         (Bug#11304).
10332 2012-04-24  Juanma Barranquero  <lekktu@gmail.com>
10334         * gnutls.c (init_gnutls_functions): Protect against (unlikely)
10335         manipulation of :loaded-from data.
10337 2012-04-23  Juanma Barranquero  <lekktu@gmail.com>
10339         * gnutls.c (init_gnutls_functions): The value of :loaded-from is
10340         now a cons (bug#11311).
10342 2012-04-23  Paul Eggert  <eggert@cs.ucla.edu>
10344         Do not create empty overlays with the evaporate property (Bug#9642).
10345         * buffer.c (Fmove_overlay): Delete an evaporating overlay
10346         if it becomes empty after its bounds are adjusted to fit within
10347         its buffer.  Without this fix, in a nonempty buffer (let ((o
10348         (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
10349         yields an empty overlay that has the evaporate property, which is
10350         not supposed to happen.
10352         Fix minor GTK3 problems found by static checking.
10353         * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
10354         (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
10355         (struct _EmacsFixedClass, emacs_fixed_get_type):
10356         Move decls here from emacsgtkfixed.h, since they needn't be public.
10357         (emacs_fixed_get_type): Now static.
10358         (emacs_fixed_class_init): Omit unused local.
10359         (emacs_fixed_child_type): Remove; unused.
10360         * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
10361         (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
10362         (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
10363         (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
10364         (EMACS_FIXED_GET_CLASS): Remove; unused.
10365         * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
10367         * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
10368         Problem reported by Juanma Barranquero for Windows -Wunused-function.
10370 2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
10372         Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
10373         * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
10374         (__malloc_size_t, __malloc_ptrdiff_t):
10375         Remove.  All uses removed, replaced by the definiens if needed,
10376         since we can assume C89 or better now.
10377         Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
10378         (protect_malloc_state, align, get_contiguous_space)
10379         (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
10380         (malloc_atfork_handler_child, malloc_enable_thread)
10381         (malloc_initialize_1, __malloc_initialize, morecore_nolock)
10382         (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
10383         (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
10384         (special_realloc, _realloc_internal_nolock, _realloc_internal)
10385         (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
10386         (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
10387         Define using prototypes, not old style.
10388         (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
10389         Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
10390         (align): Don't assume that signed integer overflow wraps around.
10391         Omit unused local var.
10392         (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
10393         (_free_internal_nolock, memalign, mallochook, reallochook):
10394         Omit no-longer-needed casts.
10395         (valloc): Use getpagesize, not __getpagesize.
10396         (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
10397         (struct hdr): The 'magic' member is now size_t, not unsigned long.
10399         * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
10401 2012-04-22  Michael Albinus  <michael.albinus@gmx.de>
10403         Move functions from C to Lisp.  Make non-blocking method calls
10404         the default.  Implement further D-Bus standard interfaces.
10406         * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
10407         (QCdbus_request_name_allow_replacement)
10408         (QCdbus_request_name_replace_existing)
10409         (QCdbus_request_name_do_not_queue)
10410         (QCdbus_request_name_reply_primary_owner)
10411         (QCdbus_request_name_reply_in_queue)
10412         (QCdbus_request_name_reply_exists)
10413         (QCdbus_request_name_reply_already_owner): Move to dbus.el.
10414         (QCdbus_registered_serial, QCdbus_registered_method)
10415         (QCdbus_registered_signal): New Lisp objects.
10416         (XD_DEBUG_MESSAGE): Use sizeof.
10417         (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
10418         (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
10419         (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
10420         (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
10421         (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
10422         (xd_signature, xd_append_arg): Allow float for integer types.
10423         (xd_get_connection_references): New function.
10424         (xd_get_connection_address): Rename from xd_initialize.
10425         Return cached address.
10426         (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
10427         (xd_close_bus): Rename from Fdbus_close_bus.  Not needed on Lisp
10428         level.
10429         (Fdbus_init_bus): New optional arg PRIVATE.  Cache address.
10430         Return number of refcounts.
10431         (Fdbus_get_unique_name): Make stronger parameter check.
10432         (Fdbus_message_internal): New defun.
10433         (Fdbus_call_method, Fdbus_call_method_asynchronously)
10434         (Fdbus_method_return_internal, Fdbus_method_error_internal)
10435         (Fdbus_send_signal, Fdbus_register_service)
10436         (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
10437         (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
10438         (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
10439         (Vdbus_compiled_version, Vdbus_runtime_version)
10440         (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
10441         (Vdbus_message_type_method_return, Vdbus_message_type_error)
10442         (Vdbus_message_type_signal): New defvars.
10443         (Vdbus_registered_buses, Vdbus_registered_objects_table):
10444         Adapt docstring.
10446 2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
10448         Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
10449         * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
10450         Do not assume ptrdiff_t is the same width as 'int'.
10452         * alloc.c: Handle unusual debugging option combinations.
10453         (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
10454         since the two debugging options are incompatible.
10455         (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
10456         is defined.
10457         (mem_init, mem_insert, mem_insert_fixup):
10458         Define if GC_MARK_STACK || GC_MALLOC_CHECK.
10459         (NEED_MEM_INSERT): Remove; no longer needed.
10461 2012-04-22  Leo Liu  <sdl.web@gmail.com>
10463         * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
10465 2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
10467         * sysdep.c [__FreeBSD__]: Minor cleanups.
10468         (list_system_processes, system_process_attributes) [__FreeBSD__]:
10469         Use Emacs indenting style more consistently.  Avoid some casts.
10470         Use 'double' consistently rather than mixing 'float' and 'double'.
10472 2012-04-21  Eduard Wiebe  <usenet@pusto.de>
10474         * sysdep.c (list_system_processes, system_process_attributes):
10475         Add implementation for FreeBSD (Bug#5243).
10477 2012-04-21  Andreas Schwab  <schwab@linux-m68k.org>
10479         * lisp.mk (lisp): Update.
10481 2012-04-20  Paul Eggert  <eggert@cs.ucla.edu>
10483         * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
10484         It is never used otherwise.
10486 2012-04-20  Stefan Monnier  <monnier@iro.umontreal.ca>
10488         * print.c (print_preprocess): Only check print_depth if print-circle
10489         is nil.
10490         (print_object): Check for cycles even when print-circle is nil and
10491         print-gensym is t, but only check print_depth if print-circle is nil.
10493 2012-04-20  Chong Yidong  <cyd@gnu.org>
10495         * process.c (wait_reading_process_output): If EIO occurs on a pty,
10496         set the status to "failed" and ensure that sentinel is run.
10498 2012-04-20  Glenn Morris  <rgm@gnu.org>
10500         * process.c (Fset_process_inherit_coding_system_flag)
10501         (Fset_process_query_on_exit_flag): Doc fix (mention return value).
10502         (Fmake_network_process, Fmake_serial_process): Doc fix.
10504 2012-04-20  Eli Zaretskii  <eliz@gnu.org>
10506         * xdisp.c (string_buffer_position_lim): Limit starting position to
10507         BEGV.
10508         (set_cursor_from_row): If called for a mode-line or header-line
10509         row, return zero immediately.
10510         (try_cursor_movement): If inside continuation line, don't back up
10511         farther than the first row after the header line, if any.
10512         Don't consider the header-line row as "partially visible", even if
10513         MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero.  (Bug#11261)
10515 2012-04-20  Atsuo Ohki  <ohki@gssm.otsuka.tsukuba.ac.jp>  (tiny change)
10517         * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
10518         (bug#11238).
10520 2012-04-20  Teodor Zlatanov  <tzz@lifelogs.com>
10521 2012-04-18  Paul Eggert  <eggert@cs.ucla.edu>
10523         configure: new option --enable-gcc-warnings (Bug#11207)
10524         * Makefile.in (C_WARNINGS_SWITCH): Remove.
10525         (WARN_CFLAGS, WERROR_CFLAGS): New macros.
10526         (ALL_CFLAGS): Use new macros rather than old.
10527         * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
10528         * regex.c: Ignore -Wstrict-overflow.  If !emacs, also ignore
10529         -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
10530         -Wunused-result, -Wunused-variable.  This should go away once
10531         the Emacs and Gnulib regex code is merged.
10532         (xmalloc, xrealloc): Now static.
10534 2012-04-17  Paul Eggert  <eggert@cs.ucla.edu>
10536         * dired.c (Fsystem_groups): Remove unused local.
10538 2012-04-17  Glenn Morris  <rgm@gnu.org>
10540         * dired.c (Fsystem_users): Doc fix.
10542 2012-04-17  Dmitry Antipov  <dmantipov@yandex.ru>
10544         * dired.c (Fsystem_users, Fsystem_groups): New functions.  (Bug#7900)
10545         (syms_of_dired): Add them.
10547 2012-04-16  Paul Eggert  <eggert@cs.ucla.edu>
10549         Fix minor alloc.c problems found by static checking.
10550         * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
10551         New extern decls, to avoid calling undeclared functions.
10552         (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
10553         && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
10554         GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
10555         (NEED_MEM_INSERT): New macro.
10556         (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
10557         Remove one incorrect comment and fix another.
10559         Fix minor ralloc.c problems found by static checking.
10560         See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
10561         * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
10562         (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
10563         (r_alloc_sbrk): Now static.
10565         Improve ralloc.c interface checking.
10566         See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
10567         * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
10568         (r_alloc_free) [REL_ALLOC]: Move decls from here ...
10569         * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
10570         [REL_ALLOC]: ... to here, to check interface.
10571         * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
10572         Remove decls.  This fixes an "It stinks!".
10574         * alloc.c (which_symbols): Fix alignment issue / type clash.
10576 2012-04-15  Andreas Schwab  <schwab@linux-m68k.org>
10578         * lisp.h (struct Lisp_Symbol): Remove explicit padding.
10579         (struct Lisp_Misc_Any): Likewise.
10580         (struct Lisp_Free): Likewise.
10581         * alloc.c (union aligned_Lisp_Symbol): Define.
10582         (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
10583         aligned_Lisp_Symbol instead of struct Lisp_Symbol.
10584         (union aligned_Lisp_Misc): Define.
10585         (MARKER_BLOCK_SIZE, struct marker_block): Use union
10586         aligned_Lisp_Misc instead of union Lisp_Misc.
10587         (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
10589 2012-04-14  Paul Eggert  <eggert@cs.ucla.edu>
10591         Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
10592         * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
10593         * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
10594         * s/netbsd.h, s/sol2-6.h:
10595         Remove definition of GC_MARK_STACK, since the default now works.
10596         * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
10597         Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
10598         no longer the default.
10599         * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
10601 2012-04-14  Atsuo Ohki  <ohki@gssm.otsuka.tsukuba.ac.jp>  (tiny change)
10603         * lread.c (lisp_file_lexically_bound_p):
10604         Fix hang at ";-*-\n" (bug#11238).
10606 2012-04-14  Eli Zaretskii  <eliz@gnu.org>
10608         * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
10609         "unchanged" if its end.pos is beyond ZV.  (Bug#11199)
10611 2012-04-14  Jan Djärv  <jan.h.d@swipnet.se>
10613         * nsterm.m (constrainFrameRect): Always constrain when there is only
10614         one screen (Bug#10962).
10616 2012-04-13  Ken Brown  <kbrown@cornell.edu>
10618         * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
10620 2012-04-13  Reuben Thomas  <rrt@sc3d.org>
10622         * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
10624 2012-04-11  Daniel Colascione  <dancol@dancol.org>
10626         * s/cygwin.h: The vfork the #define in cygwin.h was protecting
10627         against is gone.  It's better to use vfork now so that when Cygwin
10628         gains a new, working vfork, we use it automatically (bug#10398).
10630 2012-04-11  Stefan Monnier  <monnier@iro.umontreal.ca>
10632         * window.c (save_window_save): Obey window-point-insertion-type.
10634 2012-04-11  Glenn Morris  <rgm@gnu.org>
10636         * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
10638 2012-04-11  Stefan Monnier  <monnier@iro.umontreal.ca>
10640         * alloc.c (lisp_align_malloc): Remove unneeded prototype.
10642 2012-04-10  Jason S. Cornez  <jcornez@ravenpack.com>  (tiny change)
10644         * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
10645         (force_quit_count): New var.
10646         (handle_interrupt): Use it.
10648 2012-04-10  Juanma Barranquero  <lekktu@gmail.com>
10650         * w32.c (w32_delayed_load): Record the full path of the library
10651         being loaded (bug#10424).
10653 2012-04-09  Glenn Morris  <rgm@gnu.org>
10655         * doc.c (Fsnarf_documentation): Check variables, functions are bound,
10656         not just in the obarray, before snarfing them.  (Bug#11036)
10658         * Makefile.in ($(leimdir)/leim-list.el):
10659         Pass EMACS rather than BUILT_EMACS.
10661 2012-04-09  Teodor Zlatanov  <tzz@lifelogs.com>
10663         * process.c (make_process):
10664         * process.h: Add integer `gnutls_handshakes_tried' member to
10665         process struct.
10667         * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
10668         Add convenience `GNUTLS_LOG2i' macro.
10670         * gnutls.c (gnutls_log_function2i): Convenience log function.
10671         (emacs_gnutls_read): Use new log functions,
10672         `gnutls_handshakes_tried' process member, and
10673         `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
10674         attempts per process (connection).
10676 2012-04-09  Chong Yidong  <cyd@gnu.org>
10678         * eval.c (Fuser_variable_p, user_variable_p_eh)
10679         (lisp_indirect_variable): Functions deleted.
10680         (Fdefvar): Caller changed.
10682         * callint.c (Finteractive, Fcall_interactively):
10683         * minibuf.c (Fread_variable): Callers changed.
10685 2012-04-09  Eli Zaretskii  <eliz@gnu.org>
10687         * xdisp.c (set_cursor_from_row): If the display string appears in
10688         the buffer at position that is closer to point than the position
10689         after the display string, display the cursor on the first glyph of
10690         the display string.  Fixes cursor display when a 'display' text
10691         property immediately follows invisible text.  (Bug#11094)
10693 2012-04-09  Paul Eggert  <eggert@cs.ucla.edu>
10695         composite.c: use 'double' consistently
10696         * composite.c (get_composition_id): Use 'double' consistently
10697         instead of converting 'float' to 'double' and vice versa; this is
10698         easier to understand and avoids a GCC warning.
10700 2012-04-09  Glenn Morris  <rgm@gnu.org>
10702         * Makefile.in: Generate leim-list with bootstrap-emacs, in
10703         preparation for dumping it with emacs.  (Bug#4789)
10704         (leimdir): New variable.
10705         ($(leimdir)/leim-list.el): New rule.
10706         (emacs$(EXEEXT)): Depend on leim-list.el.
10708         * buffer.c (Qucs_set_table_for_input): Remove.  (Bug#9821)
10709         (Fget_buffer_create): Don't call Qucs_set_table_for_input.
10710         (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
10712 2012-04-08  Andreas Schwab  <schwab@linux-m68k.org>
10714         * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
10715         proper alignment.
10717 2012-04-07  Juanma Barranquero  <lekktu@gmail.com>
10719         * xml.c (init_libxml2_functions) [WINDOWSNT]:
10720         Remove unused local variable.
10722 2012-04-07  Paul Eggert  <eggert@cs.ucla.edu>
10724         Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
10725         * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
10726         (mark_memory): Mark Lisp_Objects only if pointers might hide in
10727         objects, as mark_maybe_pointer will catch them otherwise.
10728         (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
10729         * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
10731 2012-04-07  Paul Eggert  <eggert@cs.ucla.edu>
10733         Fix typo that broke non-Windows builds.
10734         * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
10736 2012-04-07  Eli Zaretskii  <eliz@gnu.org>
10738         Support building on MS-Windows with libxml2.
10740         * makefile.w32-in (OBJ2): Add xml.$(O).
10741         (GLOBAL_SOURCES): Add xml.c.
10742         ($(BLD)/xml.$(O)): New dependency list.
10744         * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
10745         (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
10746         (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
10747         [!WINDOWSNT]: New macros.
10748         (init_libxml2_functions, libxml2_loaded_p): New functions.
10749         (parse_region): Call fn_xmlCheckVersion instead of using the macro
10750         LIBXML_TEST_VERSION.  Call libxml2 functions via the fn_* macros.
10751         (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
10752         Calls xmlCleanupParser only if libxml2 was loaded (or statically
10753         linked in).
10754         (Flibxml_parse_html_region, Flibxml_parse_xml_region):
10755         Call init_libxml2_functions before calling libxml2 functions.
10756         (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
10758         * emacs.c: Don't include libxml/parser.h.
10759         (shut_down_emacs): Call xml_cleanup_parser, instead of calling
10760         xmlCleanupParser directly.
10762         * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
10764 2012-04-07  Eli Zaretskii  <eliz@gnu.org>
10766         * indent.c (Fvertical_motion): If there is a display string at
10767         point, use it.vpos to compute how many lines to backtrack after
10768         move_it_to point.  (Bug#11133)
10770 2012-04-06  Eli Zaretskii  <eliz@gnu.org>
10772         * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
10773         * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
10774         about subtle differences between FETCH_CHAR* and STRING_CHAR*
10775         macros related to unification of CJK characters.  For the details,
10776         see the discussion following the message here:
10777         http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
10779 2012-04-04  Chong Yidong  <cyd@gnu.org>
10781         * keyboard.c (Vdelayed_warnings_list): Doc fix.
10783 2012-04-01  Eli Zaretskii  <eliz@gnu.org>
10785         * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
10786         instead of alloca.  (Bug#11138)
10788 2012-04-01  Andreas Schwab  <schwab@linux-m68k.org>
10790         * w32menu.c (is_simple_dialog): Properly check lisp types.
10791         (Bug#11141)
10793 2012-03-31  Eli Zaretskii  <eliz@gnu.org>
10795         * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
10796         position we get to after a call to move_it_to fails the
10797         IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
10798         only if we wind up in a string from display property.  (Bug#11063)
10800         * window.c (Fdelete_other_windows_internal): Invalidate the row
10801         and column information about mouse highlight, so that redisplay
10802         restores it after reallocating the glyph matrices.  (Bug#7464)
10804         * xdisp.c (set_cursor_from_row): If `cursor' property on a display
10805         string comes from a `display' text property, use the buffer
10806         position of that property as if we actually saw that position in
10807         the row's glyphs.
10808         (move_it_by_lines): Remove the assertion that
10809         "it->current_x == 0 && it->hpos == 0" which can be legitimately
10810         violated when there's a before-string at the beginning of a line.
10811         (Bug#11063)
10813 2012-03-30  Eli Zaretskii  <eliz@gnu.org>
10815         * xdisp.c (append_space_for_newline): If the default face was
10816         remapped, use the remapped face for the appended newline.
10817         (extend_face_to_end_of_line): Use the remapped default face for
10818         extending the face to the end of the line.
10819         (display_line): Call extend_face_to_end_of_line when the default
10820         face was remapped.  (Bug#11068)
10822 2012-03-29  Eli Zaretskii  <eliz@gnu.org>
10824         * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
10826 2012-03-28  Stefan Monnier  <monnier@iro.umontreal.ca>
10828         * keyboard.c (safe_run_hooks_error): Don't unquote strings.
10830 2012-03-27  Glenn Morris  <rgm@gnu.org>
10832         * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
10833         Doc fixes.
10835 2012-03-26  Kenichi Handa  <handa@m17n.org>
10837         * dispextern.h (struct glyph): Fix previous change.  Change the
10838         bit length of glyphless.ch to 25 (Bug#11082).
10840 2012-03-26  Chong Yidong  <cyd@gnu.org>
10842         * keyboard.c (Vselection_inhibit_update_commands): New variable.
10843         (command_loop_1): Use it; inhibit selection update for
10844         handle-select-window too (Bug#8996).
10846 2012-03-25  Fabrice Popineau  <fabrice.popineau@supelec.fr>
10848         * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
10850 2012-03-25  Kenichi Handa  <handa@m17n.org>
10852         * dispextern.h (struct glyph): Change the bit length of
10853         glyphless.ch to 22 to make the member glyphless fit in 32 bits.
10855 2012-03-24  Eli Zaretskii  <eliz@gnu.org>
10857         * s/ms-w32.h (tzname): Include time.h before redirecting to
10858         _tzname.  Fixes the MSVC build.  (Bug#9960)
10860 2012-03-24  Andreas Schwab  <schwab@linux-m68k.org>
10862         * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
10863         characters.
10865         * xterm.c (XTread_socket): Only modify handling_signal if
10866         !SYNC_INPUT.  (Bug#11080)
10868 2012-03-23  Eli Zaretskii  <eliz@gnu.org>
10870         * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
10871         FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES.  Prevents crashes
10872         when fetching a multibyte character consumes more bytes than
10873         CHAR_BYTES returns, due to unification of CJK characters in
10874         string_char.  (Bug#11073)
10876 2012-03-23  Troels Nielsen  <bn.troels@gmail.com>  (tiny change)
10878         * process.c (wait_reading_process_output): Handle pty disconnect
10879         by refraining from sending oneself a SIGCHLD (bug#10933).
10881 2012-03-22  Chong Yidong  <cyd@gnu.org>
10883         * dispextern.h (struct it): New member string_from_prefix_prop_p.
10885         * xdisp.c (push_prefix_prop): Rename from push_display_prop.
10886         Mark string as coming from a prefix property.
10887         (handle_face_prop): Use default face for prefix strings (Bug#4281).
10888         (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
10890 2012-03-21  Chong Yidong  <cyd@gnu.org>
10892         * xfaces.c (Vface_remapping_alist): Doc fix.
10894 2012-03-20  Eli Zaretskii  <eliz@gnu.org>
10896         * w32proc.c (Fw32_set_console_codepage)
10897         (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
10898         Doc fixes.
10900 2012-03-20  Chong Yidong  <cyd@gnu.org>
10902         * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
10903         to reflect default non-nil value of redisplay-dont-pause.
10905 2012-03-19  Kenichi Handa  <handa@m17n.org>
10907         * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
10908         it fit in a valid range (Bug#11003).
10910 2012-03-18  Eli Zaretskii  <eliz@gnu.org>
10912         * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
10913         that is not from display property, accept the row as a "cursor
10914         row" if one of the string's character has a non-nil `cursor'
10915         property.  Fixes cursor positioning when there are newlines in
10916         overlay strings, e.g. in icomplete.el.  (Bug#11035)
10918 2012-03-12  Paul Eggert  <eggert@cs.ucla.edu>
10920         * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
10922 2012-03-12  Chong Yidong  <cyd@gnu.org>
10924         * eval.c (inhibit_lisp_code): Rename from
10925         inhibit_window_configuration_change_hook; move from window.c.
10927         * xfns.c (unwind_create_frame_1, Fx_create_frame):
10928         * window.c (run_window_configuration_change_hook)
10929         (syms_of_window): Callers changed.
10931 2012-03-11  Chong Yidong  <cyd@gnu.org>
10933         * keymap.c (Fkey_description): Doc fix (Bug#9700).
10935         * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
10937 2012-03-10  Chong Yidong  <cyd@gnu.org>
10939         * frame.c (other_visible_frames): Don't assume the selected frame
10940         is visible (Bug#10955).
10942 2012-03-09  Stefan Monnier  <monnier@iro.umontreal.ca>
10944         * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
10946 2012-03-08  Jan Djärv  <jan.h.d@swipnet.se>
10948         * gtkutil.c (x_wm_set_size_hint): Use one row in call to
10949         FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
10950         zero (Bug#10954).
10952 2012-03-03  Glenn Morris  <rgm@gnu.org>
10954         * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
10956 2012-03-02  Eli Zaretskii  <eliz@gnu.org>
10958         * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
10959         position past the first glyph_row that ends at ZV.  (Bug#10902)
10960         (redisplay_window, next_element_from_string): Fix typos in
10961         comments.
10962         (redisplay_window): Pass to move_it_vertically the margin in
10963         pixels, not in screen lines.
10965 2012-03-02  Glenn Morris  <rgm@gnu.org>
10967         * buffer.c (buffer-list-update-hook): Doc fix.
10969 2012-02-29  Eli Zaretskii  <eliz@gnu.org>
10971         * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
10972         push_it before setting up the iterator for the first overlay
10973         string, even if we have an empty string loaded.
10974         (next_overlay_string): If there's an empty string on the iterator
10975         stack, pop the stack.  (Bug#10903)
10977 2012-02-25  Paul Eggert  <eggert@cs.ucla.edu>
10979         Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
10980         Suggested by Stefan Monnier in
10981         <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
10982         * alloc.c (widen_to_Lisp_Object): New static function.
10983         (mark_memory): Also mark Lisp_Objects by fetching pointer words
10984         and widening them to Lisp_Objects.  This would work even if
10985         USE_LSB_TAG is defined and wide integers are used, which might
10986         happen in a future version of Emacs.
10988 2012-02-25  Chong Yidong  <cyd@gnu.org>
10990         * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
10991         Doc fix.
10993         * xselect.c (Fx_selection_exists_p): Doc fix.
10994         (x_clipboard_manager_save_all): Print an informative message
10995         before saving to clipboard manager.
10997 2012-02-24  Chong Yidong  <cyd@gnu.org>
10999         * keyboard.c (process_special_events): Handle all X selection
11000         requests in kbd_buffer, not just the next one (Bug#8869).
11002 2012-02-23  Chong Yidong  <cyd@gnu.org>
11004         * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
11005         call when setting menu-bar-lines and tool-bar-lines parameters.
11006         (unwind_create_frame_1): New helper function.
11008         * window.c (inhibit_window_configuration_change_hook): New var.
11009         (run_window_configuration_change_hook): Obey it.
11010         (syms_of_window): Initialize it.
11012 2012-02-22  Chong Yidong  <cyd@gnu.org>
11014         * xterm.c (x_draw_image_relief): Add missing type check for
11015         Vtool_bar_button_margin (Bug#10743).
11017 2012-02-21  Chong Yidong  <cyd@gnu.org>
11019         * fileio.c (Vfile_name_handler_alist): Doc fix.
11021         * buffer.c (Fget_file_buffer): Protect against invalid file
11022         handler return value.
11024 2012-02-20  Paul Eggert  <eggert@cs.ucla.edu>
11026         * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
11027         when computing $valmask.
11029         Fix crash due to non-contiguous EMACS_INT (Bug#10780).
11030         * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
11031         (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
11032         It's useless in that case, and it can cause problems on hosts
11033         that allocate halves of EMACS_INT values separately.
11034         Reported by Dan Horák.  Diagnosed by Andreas Schwab in
11035         <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
11036         * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
11037         UINTPTR_MAX >> VALBITS == 0.  This is required by the above change;
11038         it avoids undefined behavior on hosts where shifting right by more
11039         than the word width has undefined behavior.
11041 2012-02-19  Chong Yidong  <cyd@gnu.org>
11043         * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
11044         (Funhandled_file_name_directory, Ffile_name_as_directory)
11045         (Fdirectory_file_name, Fexpand_file_name)
11046         (Fsubstitute_in_file_name): Protect against invalid file handler
11047         return values (Bug#10845).
11049 2012-02-18  Eli Zaretskii  <eliz@gnu.org>
11051         * .gdbinit (pitx): Fix incorrect references to fields of the
11052         iterator stack.
11054 2012-02-17  Chong Yidong  <cyd@gnu.org>
11056         * syntax.c (Fscan_lists): Doc fix (Bug#10833).
11058 2012-02-15  Paul Eggert  <eggert@cs.ucla.edu>
11060         * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
11061         <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
11063 2012-02-15  Chong Yidong  <cyd@gnu.org>
11065         * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
11066         marked as special.  Also, starting docstrings with * is obsolete.
11068 2012-02-13  Andreas Schwab  <schwab@linux-m68k.org>
11070         * gnutls.c (emacs_gnutls_write): Fix last change.
11072 2012-02-13  Lars Ingebrigtsen  <larsi@gnus.org>
11074         * gnutls.c (emacs_gnutls_write): Set errno appropriately for
11075         send_process.
11077 2012-02-13  Stefan Monnier  <monnier@iro.umontreal.ca>
11079         * keymap.c (Fsingle_key_description): Handle char ranges.
11081 2012-02-12  Chong Yidong  <cyd@gnu.org>
11083         * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
11084         as that creates a dangerous corner case.
11086         * window.c (Fdelete_window_internal): Invalidate the mouse
11087         highlight (Bug#9904).
11089 2012-02-12  Glenn Morris  <rgm@gnu.org>
11091         * xselect.c (Fx_own_selection_internal)
11092         (Fx_get_selection_internal, Fx_disown_selection_internal)
11093         (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
11094         * nsselect.m (Fx_own_selection_internal)
11095         (Fx_disown_selection_internal, Fx_selection_exists_p)
11096         (Fx_selection_owner_p, Fx_get_selection_internal):
11097         Sync docs and argument specs with the xselect.c versions.
11099 2012-02-11  Lars Ingebrigtsen  <larsi@gnus.org>
11101         * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
11103 2012-02-11  Eli Zaretskii  <eliz@gnu.org>
11105         * w32select.c (Fx_selection_exists_p): Sync doc string and
11106         argument list with xselect.c.  (Bug#10783)
11108         * w16select.c (Fx_selection_exists_p): Sync doc string and
11109         argument list with xselect.c.  (Bug#10783)
11111 2012-02-10  Glenn Morris  <rgm@gnu.org>
11113         * fns.c (Fsecure_hash): Doc fix.
11115 2012-02-09  Kenichi Handa  <handa@m17n.org>
11117         * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
11119 2012-02-07  Chong Yidong  <cyd@gnu.org>
11121         * buffer.c (Fbuffer_local_variables)
11122         (buffer_lisp_local_variables): Handle unbound vars correctly;
11123         don't let Qunbound leak into Lisp.
11125 2012-02-07  Glenn Morris  <rgm@gnu.org>
11127         * image.c (Fimagemagick_types): Doc fix.
11129         * image.c (imagemagick-render-type): Change it from a lisp object
11130         to an integer.  Move the doc here from the lisp manual.
11131         Treat all values not equal to 0 the same.
11133 2012-02-06  Chong Yidong  <cyd@gnu.org>
11135         * doc.c (store_function_docstring): Avoid applying docstring of
11136         alias to base function (Bug#2603).
11138 2012-02-04  Andreas Schwab  <schwab@linux-m68k.org>
11140         * .gdbinit (pp1, pv1): Remove redundant defines.
11141         (pr): Use pp.
11143 2012-02-04  Chong Yidong  <cyd@gnu.org>
11145         * nsterm.m: Declare a global (Bug#10694).
11147 2012-02-04  Eli Zaretskii  <eliz@gnu.org>
11149         * w32.c (get_emacs_configuration_options):
11150         Include --enable-checking, if specified, in the return value.
11152 2012-02-04  Martin Rudalics  <rudalics@gmx.at>
11154         * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
11155         after rounding frame sizes.  (Bug#9723)
11157 2012-02-04  Eli Zaretskii  <eliz@gnu.org>
11159         * keyboard.c (adjust_point_for_property): Don't position point
11160         before BEGV.  (Bug#10696)
11162 2012-02-03  Paul Eggert  <eggert@cs.ucla.edu>
11164         Handle overflow when computing char display width (Bug#9496).
11165         * character.c (char_width): Return EMACS_INT, not int.
11166         (char_width, c_string_width): Check for overflow when
11167         computing the width; this is possible now that individual
11168         characters can have unbounded width.  Problem introduced
11169         by merge from Emacs 23 on 2012-01-19.
11171 2012-02-02  Michael Albinus  <michael.albinus@gmx.de>
11173         * dbusbind.c (Fdbus_register_method): Mention the return value
11174         :ignore in the docstring.
11176 2012-02-02  Glenn Morris  <rgm@gnu.org>
11178         * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
11180         * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11181         Unconditionally set to t.  (Bug#10673)
11182         * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11183         * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
11184         * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
11186 2012-02-02  Kenichi Handa  <handa@m17n.org>
11188         (x_produce_glyphs): Cancel previous change.  If cmp->glyph_len is
11189         0, do not call append_composite_glyph.
11191 2012-02-02  Kenichi Handa  <handa@m17n.org>
11193         * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
11194         NULL (Bug#6988).
11195         (x_produce_glyphs): If the component of a composition is a null
11196         string, set it->pixel_width to 1 to avoid zero-width glyph.
11198 2012-02-01  Eli Zaretskii  <eliz@gnu.org>
11200         * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
11201         first 2 arguments are identical.  This makes inserting large
11202         output from a subprocess an order of magnitude faster on
11203         MS-Windows, where all sbrk'ed memory is always contiguous.
11205 2012-01-31  Glenn Morris  <rgm@gnu.org>
11207         * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11208         * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
11209         * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
11211 2012-01-29  Glenn Morris  <rgm@gnu.org>
11213         * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
11215 2012-01-28  Samuel Thibault  <sthibault@debian.org>  (tiny change)
11217         * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
11219 2012-01-28  Chong Yidong  <cyd@gnu.org>
11221         * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
11223 2012-01-26  Chong Yidong  <cyd@gnu.org>
11225         * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
11227         * search.c (Fsearch_forward, Fsearch_backward): Document negative
11228         repeat counts (Bug#10507).
11230 2012-01-26  Glenn Morris  <rgm@gnu.org>
11232         * lread.c (syms_of_lread): Doc fix.
11234 2012-01-25  HIROSHI OOTA  <nil@mad.dog.cx>  (tiny change)
11236         * coding.c (encode_designation_at_bol): Change return value to
11237         EMACS_INT.
11239 2012-01-25  Chong Yidong  <cyd@gnu.org>
11241         * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
11243 2012-01-21  Chong Yidong  <cyd@gnu.org>
11245         * floatfns.c (Fcopysign): Make the second argument non-optional,
11246         since nil is not allowed anyway.
11248 2012-01-21  Andreas Schwab  <schwab@linux-m68k.org>
11250         * process.c (read_process_output): Use p instead of XPROCESS (proc).
11251         (send_process): Likewise.
11253 2012-01-19  Martin Rudalics  <rudalics@gmx.at>
11255         * window.c (save_window_save, Fcurrent_window_configuration)
11256         (Vwindow_persistent_parameters): Do not use Qstate.
11257         Rewrite doc-strings.
11259 2012-01-19  Kenichi Handa  <handa@m17n.org>
11261         * character.c (char_width): New function.
11262         (Fchar_width, c_string_width, lisp_string_width):
11263         Use char_width (Bug#9496).
11265 2012-01-16  Martin Rudalics  <rudalics@gmx.at>
11267         * window.c (Vwindow_persistent_parameters): New variable.
11268         (Fset_window_configuration, save_window_save): Handle persistent
11269         window parameters.
11271 2012-01-14  Eli Zaretskii  <eliz@gnu.org>
11273         * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
11274         thrashing the stack of the thread.  (Bug#9087)
11276 2012-01-12  Paul Eggert  <eggert@cs.ucla.edu>
11278         * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
11280 2012-01-11  Eli Zaretskii  <eliz@gnu.org>
11282         * xdisp.c (rows_from_pos_range): Handle the case where the
11283         highlight ends on a newline.  (Bug#10464)
11284         (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
11285         he end column for display of highlight that ends on a newline
11286         before a R2L line.
11288 2012-01-11  Glenn Morris  <rgm@gnu.org>
11290         * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
11291         from load-path also when installation-directory is nil.  (Bug#10208)
11293 2012-01-10  Glenn Morris  <rgm@gnu.org>
11295         * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
11297         * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
11298         Update template values to be closer to their typical values these days.
11300 2012-01-09  Eli Zaretskii  <eliz@gnu.org>
11302         * xdisp.c (rows_from_pos_range): Accept additional argument
11303         DISP_STRING, and accept any glyph in a row whose object is that
11304         string as eligible for mouse highlight.  Fixes mouse highlight of
11305         display strings from overlays.  (Bug#10464)
11307 2012-01-07  Paul Eggert  <eggert@cs.ucla.edu>
11309         emacs: fix an auto-save permissions race condition (Bug#10400)
11310         * fileio.c (auto_saving_dir_umask): New static var.
11311         (Fmake_directory_internal): Use it.
11312         (do_auto_save_make_dir): Set it, instead of invoking chmod after
11313         creating the directory.  The old code temporarily assigns
11314         too-generous permissions to the directory.
11315         (do_auto_save_eh): Clear it.
11316         (Fdo_auto_save): Catch all errors, not just file errors, so
11317         that the var is always cleared.
11319 2012-01-07  Eli Zaretskii  <eliz@gnu.org>
11321         * search.c (scan_buffer): Pass character positions to
11322         know_region_cache, not byte positions.  (Bug#6540)
11324 2012-01-07  LynX  <_LynX@bk.ru>  (tiny change)
11326         * w32.c (sys_rename): Report EXDEV when rename of a directory
11327         fails because the target is on another logical disk.  (Bug#10284)
11329 2012-01-07  David Benjamin  <davidben@mit.edu>  (tiny change)
11331         * xterm.c (x_embed_request_focus): New function.
11333         * xterm.h: Add prototype.
11335         * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
11337 2012-01-05  Glenn Morris  <rgm@gnu.org>
11339         * emacs.c (emacs_copyright): Update short copyright year to 2012.
11341 2012-01-01  Eli Zaretskii  <eliz@gnu.org>
11343         * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
11344         Load gnutls_transport_set_lowat only if GnuTLS version is below
11345         2.11.1.
11346         (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
11347         GnuTLS versions below 2.11.1.
11349 2011-12-31  Antoine Levitt  <antoine.levitt@gmail.com>
11351         * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
11352         to the doc string advising against its use for altering the way
11353         windows are scrolled.
11355 2011-12-28  Kenichi Handa  <handa@m17n.org>
11357         * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
11358         coding-system ASCII compatible only when it does not produce BOM
11359         on encoding (Bug#10383).
11361 2011-12-26  Jan Djärv  <jan.h.d@swipnet.se>
11363         * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
11364         can scroll.
11365         (create_and_show_popup_menu): Always use menu_position_func for
11366         Gtk3 (Bug#10361).
11368 2011-12-24  Andreas Schwab  <schwab@linux-m68k.org>
11370         * callint.c (Fcall_interactively): Don't truncate prompt string.
11372 2011-12-23  Eli Zaretskii  <eliz@gnu.org>
11374         * xdisp.c (handle_invisible_prop): Handle correctly an invisible
11375         property that ends at ZV, so that the bidi iteration could be
11376         resumed from there (after widening).  (Bug#10360)
11378 2011-12-22  Jan Djärv  <jan.h.d@swipnet.se>
11380         * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
11382 2011-12-21  Jan Djärv  <jan.h.d@swipnet.se>
11384         * nsterm.m (x_free_frame_resources):
11385         Release f->output_data.ns->miniimage.
11386         (ns_index_color): Fix indentation.  Do not retain
11387         color_table->colors[i].
11389         * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
11390         before returning.
11392         * nsfns.m (x_set_background_color): Assign return value from
11393         ns_index_color to face-background instead of NSColor*.
11394         (ns_implicitly_set_icon_type): Fix indentation.
11395         Change assignment in for loop to comparison.
11397         * emacs.c (ns_pool): New variable.
11398         (main): Assign ns_pool.
11399         (Fkill_emacs): Call ns_release_autorelease_pool.
11401         * nsfont.m (ns_spec_to_descriptor): Fix indentation,
11402         autorelease fdesc, release fdAttrs and tdict.
11403         (ns_get_covering_families): Release charset.
11404         (ns_findfonts): Release NSFontDescriptor created with new.
11405         (ns_uni_to_glyphs): Fix indentation.
11406         (setString): Release attrStr before assigning new value.
11408 2011-12-18  Jan Djärv  <jan.h.d@swipnet.se>
11410         * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
11411         and NS_IMPL_COCOA.
11412         (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
11413         (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
11415 2011-12-18  David Reitter  <reitter@cmu.edu>
11417         * nsterm.m (ns_term_init): Subscribe for notifications
11418         NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
11419         to method trackingNotification in EmacsMenu.
11421         * nsmenu.m (trackingMenu): New variable.
11422         (trackingNotification): New method (from Aquamacs).
11423         (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
11424         from Aquamacs (Bug#7030).
11426 2011-12-18  Jan Djärv  <jan.h.d@swipnet.se>
11428         * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
11429         (symbol_to_nsstring): Fix indentation.
11430         (ns_symbol_to_pb): New function.
11431         (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
11432         (Fns_rotate_cut_buffers_internal): Remove.
11433         (Fns_store_selection_internal): Rename from
11434         Fns_store_cut_buffer_internal.
11435         (ns_get_foreign_selection, Fx_own_selection_internal)
11436         (Fx_disown_selection_internal, Fx_selection_exists_p)
11437         (Fns_get_selection_internal, Fns_store_selection_internal):
11438         Use ns_symbol_to_pb and check if return value is nil.
11439         (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT.  Remove defsubr
11440         Sns_rotate_cut_buffers_internal.  Sns_get_cut_buffer_internal
11441         renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
11442         renamed to Sns_store_selection_internal.
11443         (ns_handle_selection_request): Move code to Fx_own_selection_internal
11444         and remove this function.
11445         (ns_handle_selection_clear): Remove, never used.
11446         (Fx_own_selection_internal): Move code from ns_handle_selection_request
11447         here.
11449 2011-12-17  Ken Brown  <kbrown@cornell.edu>
11451         * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
11452         GID is unknown (Bug#10257).
11454 2011-12-17  Paul Eggert  <eggert@cs.ucla.edu>
11456         * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
11457         (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
11458         which caused a build failure on GNU/Linux IA-64.  This problem was
11459         introduced by my 2011-10-07 patch.
11461 2011-12-15  Juri Linkov  <juri@jurta.org>
11463         * image.c (imagemagick_error): New function.  (Bug#10112)
11464         (imagemagick_load_image): Comment out `MagickSetResolution' call.
11465         Use `imagemagick_error' where ImageMagick functions return
11466         `MagickFalse'.
11467         (Fimagemagick_types): Add `Fnreverse' to return the list in the
11468         proper order.
11470 2011-12-15  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
11472         * xftfont.c (xftfont_draw): Use the font metrics of s->font to
11473         fill background (Bug#8992).
11475 2011-12-13  Martin Rudalics  <rudalics@gmx.at>
11477         * window.c (Vwindow_combination_resize)
11478         (Vwindow_combination_limit): Use t instead of non-nil in
11479         doc-strings.
11480         (Vrecenter_redisplay): Add first sentence of doc-string on
11481         separate line.
11482         (Frecenter): Fix doc-string typo.
11484 2011-12-11  Kenichi Handa  <handa@m17n.org>
11486         * coding.c (Funencodable_char_position): Pay attention to the
11487         buffer text relocation (Bug#9389).
11489 2011-12-10  Jan Djärv  <jan.h.d@swipnet.se>
11491         * xterm.c (x_term_init): Move call to gdk_window_add_filter before
11492         gtk_init (Bug#10100).
11494 2011-12-10  Eli Zaretskii  <eliz@gnu.org>
11496         * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
11497         IT->string is nil.  (Bug#10263)
11499 2011-12-10  Jan Djärv  <jan.h.d@swipnet.se>
11501         * nsterm.h (x_free_frame_resources): Declare.
11503         * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
11504         (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
11506         * nsterm.h (ns_get_defaults_value): Declare.
11508         * nsterm.m (ns_default): Call ns_get_defaults_value.
11510 2011-12-09  Eli Zaretskii  <eliz@gnu.org>
11512         * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
11513         (Bug#10170)
11515 2011-12-09  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
11517         * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
11518         that where the value of an _OBJC_* symbol points to is in the .bss
11519         section (Bug#10240).
11521 2011-12-08  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
11523         * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
11524         after the loop to call ccl_driver at least once (Bug#8619).
11526 2011-12-08  Kenichi Handa  <handa@m17n.org>
11528         * ftfont.c (get_adstyle_property): Fix previous change
11529         (Bug#10233).
11531 2011-12-07  Juanma Barranquero  <lekktu@gmail.com>
11533         * w32.c (init_environment): If no_site_lisp, remove site-lisp
11534         dirs from the default value of EMACSLOADPATH (bug#10208).
11536 2011-12-07  Glenn Morris  <rgm@gnu.org>
11538         * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
11539         installation and source directories as well.  (Bug#10208)
11541 2011-12-06  Chong Yidong  <cyd@gnu.org>
11543         * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
11545 2011-12-06  Glenn Morris  <rgm@gnu.org>
11547         * process.c (start_process_unwind): Treat any pid <= 0, except -2,
11548         as an error, not just -1.  (Bug#10217)
11550 2011-12-05  Chong Yidong  <cyd@gnu.org>
11552         * keyboard.c (process_special_events): New function.
11553         (swallow_events, Finput_pending_p): Use it (Bug#10195).
11555 2011-12-05  Paul Eggert  <eggert@cs.ucla.edu>
11557         * coding.c (encode_designation_at_bol): Don't use uninitialized
11558         local variable (Bug#9318).
11560 2011-12-05  Kenichi Handa  <handa@m17n.org>
11562         * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
11563         return Qnil (Bug#8046, Bug#10193).
11565 2011-12-05  Kenichi Handa  <handa@m17n.org>
11567         * coding.c (encode_designation_at_bol): New args charbuf_end and
11568         dst.  Return the number of produced bytes.  Callers changed.
11569         (coding_set_source): Return how many bytes coding->source was
11570         relocated.
11571         (coding_set_destination): Return how many bytes
11572         coding->destination was relocated.
11573         (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
11574         (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
11576 2011-12-05  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
11578         * coding.c (CODING_CHAR_CHARSET_P): New macro.
11579         (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
11580         macro (Bug#9318).
11582 2011-12-05  Andreas Schwab  <schwab@linux-m68k.org>
11584         The following changes are to fix Bug#9318.
11586         * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
11587         (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
11588         (encode_coding_iso_2022, encode_coding_sjis)
11589         (encode_coding_big5, encode_coding_charset): Use the above macros.
11591 2011-12-05  Juanma Barranquero  <lekktu@gmail.com>
11593         * lisp.h (process_quit_flag): Fix external declaration.
11595 2011-12-04  Stefan Monnier  <monnier@iro.umontreal.ca>
11597         Don't macro-inline non-performance-critical code.
11598         * eval.c (process_quit_flag): New function.
11599         * lisp.h (QUIT): Use it.
11601 2011-12-04  Jan Djärv  <jan.h.d@swipnet.se>
11603         * nsfns.m (get_geometry_from_preferences): New function.
11604         (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
11606 2011-12-04  Andreas Schwab  <schwab@linux-m68k.org>
11608         * emacs.c (Qkill_emacs): Define.
11609         (syms_of_emacs): Initialize it.
11610         * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
11611         Qquit_flag to `kill-emacs' instead.
11612         (quit_throw_to_read_char): Add parameter `from_signal'.
11613         All callers changed.  Call Fkill_emacs if requested and safe.
11614         * lisp.h (QUIT): Call Fkill_emacs if requested.
11616 2011-12-03  Jan Djärv  <jan.h.d@swipnet.se>
11618         * widget.c (update_wm_hints): Return if wmshell is null.
11619         (widget_update_wm_size_hints): New function.
11621         * widget.h (widget_update_wm_size_hints): Declare.
11623         * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
11624         widget_update_wm_size_hints (Bug#10104).
11626 2011-12-03  Eli Zaretskii  <eliz@gnu.org>
11628         * xdisp.c (handle_invisible_prop): If the invisible text ends just
11629         before a newline, prepare the bidi iterator for consuming the
11630         newline, and keep the current paragraph direction.  (Bug#10183)
11631         (redisplay_window): Don't let `margin' become negative.  (Bug#10192)
11633 2011-12-02  Juri Linkov  <juri@jurta.org>
11635         * search.c (Fword_search_regexp): New Lisp function created from
11636         `wordify'.  Change type of arg `lax' from `int' to `Lisp_Object'.
11637         (Fword_search_backward, Fword_search_forward)
11638         (Fword_search_backward_lax, Fword_search_forward_lax):
11639         Use `Fword_search_regexp' instead of `wordify'.  Doc fix.
11640         (syms_of_search): Define `Sword_search_regexp'.  (Bug#10145)
11642 2011-12-01  Stefan Monnier  <monnier@iro.umontreal.ca>
11644         * fileio.c (Finsert_file_contents): Move after-change-function call
11645         to before the "handled:" label, since all "goto handled" appear in
11646         cases where the *-change-functions have already been properly called
11647         (bug#10117).
11649 2011-12-01  Andreas Schwab  <schwab@linux-m68k.org>
11651         * keyboard.c (interrupt_signal): Don't call kill-emacs when
11652         waiting for input.  (Bug#10169)
11654 2011-11-30  Eli Zaretskii  <eliz@gnu.org>
11656         * dispnew.c (adjust_glyph_matrix): Remove the assertion that
11657         verifies glyph row's hash code--we have just reallocated the
11658         glyphs, so their contents can be complete garbage.  (Bug#10164)
11660 2011-11-30  Juanma Barranquero  <lekktu@gmail.com>
11662         * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
11664 2011-11-30  Eli Zaretskii  <eliz@gnu.org>
11666         * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
11667         attributes are tested _before_ calling verify_row_hash, to protect
11668         against GCC re-ordering of the tests.  (Bug#10164)
11670 2011-11-29  Jan Djärv  <jan.h.d@swipnet.se>
11672         * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
11674         * xterm.c (handle_one_xevent): Only set async_visible and friends
11675         if net_wm_state_hidden_seen is non-zero (Bug#10002)
11676         (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
11677         _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
11679 2011-11-28  Paul Eggert  <eggert@cs.ucla.edu>
11681         Remove GCPRO-related macros that exist only to avoid shadowing locals.
11682         * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
11683         (GCPRO6_VAR, UNGCPRO_VAR): Remove.  See
11684         <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
11685         All uses changed to use GCPRO1 etc.
11686         (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
11687         Revert to old implementation (i.e., before 2011-03-11).
11689 2011-11-28  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
11691         * dispnew.c (scrolling_window): Truncate overlaps in copy destination
11692         of scroll runs so as to avoid assigning disabled bogus rows and
11693         unnecessary graphics copy operations.
11695 2011-11-27  Eli Zaretskii  <eliz@gnu.org>
11697         * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
11698         (snprintf) [_MSC_VER]: Redirect to _snprintf.
11699         (strtoll) [_MSC_VER]: Redirect to _strtoi64.
11700         (malloc, free, realloc, calloc): Redirect to e_* only when
11701         compiling Emacs.
11703         * lisp.h (GCTYPEBITS): Move before first use.
11704         (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
11705         (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
11706         this macro definition.
11708         * s/ms-w32.h (tzname): Redirect to _tzname for all values of
11709         _MSC_VER.
11711 2011-11-27  Jan Djärv  <jan.h.d@swipnet.se>
11713         * gtkutil.c (xg_create_frame_widgets):
11714         Call gtk_window_set_has_resize_grip (FALSE) if that function is
11715         present with Gtk+ 2.0.
11717 2011-11-26  Paul Eggert  <eggert@cs.ucla.edu>
11719         * fileio.c (Finsert_file_contents): Undo previous change; see
11720         <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
11722 2011-11-26  Paul Eggert  <eggert@cs.ucla.edu>
11724         Rename locals to avoid shadowing.
11725         * fileio.c (Finsert_file_contents):
11726         Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
11727         * process.c (wait_reading_process_output):
11728         Rename inner 'proc' to 'p' to avoid shadowing.
11729         Indent for consistency with usual Emacs style.
11731 2011-11-25  Eli Zaretskii  <eliz@gnu.org>
11733         * xdisp.c (redisplay_window): If cursor row is not fully visible
11734         after recentering, and scroll-conservatively is set to a large
11735         number, scroll window by a few more lines to make the cursor fully
11736         visible and out of scroll-margin.  (Bug#10105)
11737         (start_display): Don't move to the next line if the display should
11738         start at a newline that is part of a display vector or an overlay
11739         string.  (Bug#10119)
11741 2011-11-24  Juri Linkov  <juri@jurta.org>
11743         * image.c (imagemagick_load_image): Move `MagickSetResolution' down
11744         after the `MagickPingImage' call.  (Bug#10112)
11746 2011-11-23  Chong Yidong  <cyd@gnu.org>
11748         * window.c (Fcoordinates_in_window_p): Accept only live windows.
11750 2011-11-23  Martin Rudalics  <rudalics@gmx.at>
11752         * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
11753         making another buffer current.  (Bug#10114)
11755 2011-11-23  Glenn Morris  <rgm@gnu.org>
11757         * font.c (font_find_for_lface) [HAVE_NS]: Ignore case.  (Bug#2526)
11759 2011-11-23  Chong Yidong  <cyd@gnu.org>
11761         * xdisp.c (compute_stop_pos): Check validity of end_charpos before
11762         using it (Bug#5984).
11764 2011-11-22  Eli Zaretskii  <eliz@gnu.org>
11766         * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
11767         and header-lines, as they don't have one computed for them.
11768         (Bug#10098)
11770         * .gdbinit (prow): Make displayed values more self-explaining.
11771         Add row's hash code.
11773 2011-11-21  Lars Magne Ingebrigtsen  <larsi@gnus.org>
11775         * process.c (wait_reading_process_output): Fix asynchrounous
11776         GnuTLS socket handling on some versions of the GnuTLS library.
11777         (wait_reading_process_output): Add comment and URL.
11779 2011-11-21  Jan Djärv  <jan.h.d@swipnet.se>
11781         * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
11783 2011-11-21  Chong Yidong  <cyd@gnu.org>
11785         * window.c (Fnext_window, Fprevious_window): Doc fix.
11787 2011-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>
11789         * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
11791 2011-11-20  Juanma Barranquero  <lekktu@gmail.com>
11793         * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
11795 2011-11-20  Martin Rudalics  <rudalics@gmx.at>
11797         * window.c (Fset_window_combination_limit): Rename argument
11798         STATUS to LIMIT.
11799         (Vwindow_combination_limit): Remove "status" from doc-string.
11801 2011-11-20  Andreas Schwab  <schwab@linux-m68k.org>
11803         * m/ibms390.h: Remove.
11804         * m/ibms390x.h: Don't include "ibms390.h".
11806 2011-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>
11808         * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
11809         Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
11811 2011-11-20  Juanma Barranquero  <lekktu@gmail.com>
11813         * casetab.c (Fset_case_table):
11814         * charset.c (Fcharset_after): Fix typos.
11816 2011-11-20  Paul Eggert  <eggert@cs.ucla.edu>
11818         Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
11819         Otherwise, valgrind does not work on some platforms.
11820         Problem reported by Andreas Schwab in
11821         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
11822         * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
11823         is set, removing the need for VIRT_ADDRESS_VARIES.
11824         (PURE_P): Use a more-efficient implementation that needs just one
11825         comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
11826         number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
11827         to 4 (xorl, subq, cmpq, setbe).
11828         * alloc.c (pure): Always extern now, since that's the
11829         VIRT_ADDR_VARIES behavior.
11830         (PURE_POINTER_P): Use a single comparison, not two, for
11831         consistency with the new puresize.h.
11832         * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
11833         * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
11834         Remove VIRT_ADDR_VARIES no longer needed.
11836 2011-11-19  Eli Zaretskii  <eliz@gnu.org>
11838         * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
11839         (erase_phys_cursor, update_window_cursor, show_mouse_face)
11840         (cursor_in_mouse_face_p): If the cursor position is out of bounds,
11841         behave as if the cursor position were at the window margin.
11843         * window.c (get_phys_cursor_glyph): If the window is hscrolled,
11844         and the cursor position is out of bounds, behave as if the cursor
11845         position were at the window margin.  (Bug#10075)
11847 2011-11-18  Chong Yidong  <cyd@gnu.org>
11849         * window.c (Fwindow_combination_limit): Make first argument
11850         non-optional, since it is meaningless for live windows like the
11851         selected window.
11853 2011-11-18  Dmitry Antipov  <dmantipov@yandex.ru>
11855         * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
11857 2011-11-18  Stefan Monnier  <monnier@iro.umontreal.ca>
11859         * intervals.c: Fix grafting over the whole buffer (bug#10071).
11860         (graft_intervals_into_buffer): Simplify.
11862 2011-11-18  Eli Zaretskii  <eliz@gnu.org>
11864         * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
11865         hash values of the two rows.
11866         (copy_row_except_pointers): Preserve the used[] arrays and the
11867         hash values of the two rows.  (Bug#10035)
11868         (add_row_entry): Add xassert to verify that ROW's hash code is valid.
11870         * xdisp.c (row_hash): New function, body extracted from
11871         compute_line_metrics.
11872         (compute_line_metrics): Call row_hash, instead of computing the
11873         hash code inline.
11875         * dispnew.c (verify_row_hash): Call row_hash for computing the
11876         hash code of a row, instead of duplicating code from xdisp.c.
11878         * dispextern.h (row_hash): Add prototype.
11880 2011-11-18  Tassilo Horn  <tassilo@member.fsf.org>
11882         * frame.c (delete_frame): Don't delete the terminal when the last
11883         X frame is closed if emacs is built with GTK toolkit.
11885 2011-11-17  Juanma Barranquero  <lekktu@gmail.com>
11887         * window.c (syms_of_window) <window-combination-resize>: Fix typo.
11889 2011-11-17  Martin Rudalics  <rudalics@gmx.at>
11891         * window.c (Vwindow_splits): Rename to
11892         Vwindow_combination_resize.  Suggested by Juri Linkov.
11893         (Fsplit_window_internal): Use Vwindow_combination_resize instead
11894         of Vwindow_splits.
11896 2011-11-16  Juanma Barranquero  <lekktu@gmail.com>
11898         * nsfns.m (Fns_font_name):
11899         * window.c (syms_of_window) <window-combination-limit>: Fix typos.
11901 2011-11-16  Martin Rudalics  <rudalics@gmx.at>
11903         * window.h (window): Rename slot "nest" to "combination_limit".
11904         * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
11905         (Fset_window_nest): Rename to Fset_window_combination_limit.
11906         (Vwindow_nest): Rename to Vwindow_combination_limit.
11907         (recombine_windows, make_parent_window, make_window)
11908         (Fsplit_window_internal, saved_window)
11909         (Fset_window_configuration, save_window_save): Rename all
11910         occurrences of window_nest to window_combination_limit.
11912 2011-11-15  Juanma Barranquero  <lekktu@gmail.com>
11914         * image.c (imagemagick_load_image): Fix typo.
11916 2011-11-14  Eli Zaretskii  <eliz@gnu.org>
11918         * xdisp.c (display_line): Move the call to
11919         highlight_trailing_whitespace before the call to
11920         compute_line_metrics, since the latter needs to see the final
11921         faces of all the glyphs to compute ROW's hash value.
11922         Fixes assertion violations in row_equal_p.  (Bug#10035)
11924 2011-11-14  Juanma Barranquero  <lekktu@gmail.com>
11926         * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
11927         just return (bug#10044).
11929 2011-11-12  Eli Zaretskii  <eliz@gnu.org>
11931         * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
11932         with user-defined heap size.  Bump the default size of the temacs
11933         heap to 27MB, to avoid memory warning when running temacs.
11934         ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
11936         * dispnew.c (scrolling_window): Fix incorrect indices in accessing
11937         current_matrix and desired_matrix.  (Bug#9990)
11938         (verify_row_hash) [XASSERTS]: New function.
11939         (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
11940         that the hash value of glyph rows is correct.
11942 2011-11-12  Martin Rudalics  <rudalics@gmx.at>
11944         * window.h (window): Remove splits slot.
11945         * window.c (Fwindow_splits, Fset_window_splits): Remove.
11946         (Fdelete_other_windows_internal, make_parent_window)
11947         (make_window, Fsplit_window_internal, Fdelete_window_internal)
11948         (Fset_window_configuration, save_window_save): Don't deal with
11949         split status of windows.
11950         (saved_window): Remove splits slot.
11951         (Vwindow_splits): Rewrite doc-string.
11953 2011-11-11  Jan Djärv  <jan.h.d@swipnet.se>
11955         * xfns.c (unwind_create_frame):
11956         * nsfns.m (unwind_create_frame):
11957         * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
11958         Vframe_list (Bug#9999).
11960 2011-11-11  Dmitry Antipov  <dmantipov@yandex.ru>
11962         * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
11964 2011-11-11  Kenichi Handa  <handa@m17n.org>
11966         * callproc.c (Fcall_process): Set the member dst_multibyte of
11967         process_coding.
11969 2011-11-11  Johan Bockgård  <bojohan@gnu.org>
11971         * xdisp.c (fill_composite_glyph_string): Always set s->face, to
11972         avoid a crash (bug#9496).
11974 2011-11-09  Chong Yidong  <cyd@gnu.org>
11976         * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
11977         (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
11979 2011-11-08  Paul Eggert  <eggert@cs.ucla.edu>
11981         * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
11983 2011-11-08  Paul Eggert  <eggert@cs.ucla.edu>
11985         Avoid some portability problems by eschewing 'extern inline' functions.
11986         The trivial performance wins aren't worth the portability hassles; see
11987         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
11988         et seq.
11989         * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11990         (window_box_width, window_box_left, window_box_left_offset)
11991         (window_box_right, window_box_right_offset): Undo previous change,
11992         by removing the "extern"s.
11993         * intervals.c (adjust_intervals_for_insertion)
11994         (adjust_intervals_for_deletion): Undo previous change,
11995         making these static again.
11996         (offset_intervals, temp_set_point_both, temp_set_point)
11997         (copy_intervals_to_string): No longer inline.
11998         * xdisp.c (window_text_bottom_y, window_box_width)
11999         (window_box_height, window_box_left_offset)
12000         (window_box_right_offset, window_box_left, window_box_right)
12001         (window_box): No longer inline.
12003 2011-11-08  Chong Yidong  <cyd@gnu.org>
12005         * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
12006         (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
12007         Signal an error if not a live window.
12008         (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
12009         (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
12011 2011-11-07  Juanma Barranquero  <lekktu@gmail.com>
12013         * lisp.h (syms_of_abbrev): Remove declaration.
12014         Reported by CHENG Gao <chenggao@royau.me>.
12016 2011-11-07  Eli Zaretskii  <eliz@gnu.org>
12018         * w32.c (check_windows_init_file): Don't look for term/w32-win.el
12019         if Vpurify_flag is non-nil.  Fixes a crash when running w32 build
12020         of temacs in GUI mode.
12022 2011-11-07  Martin Rudalics  <rudalics@gmx.at>
12024         * window.h: Declare delete_all_child_windows instead of
12025         delete_all_subwindows.
12026         * window.c (Fwindow_nest, Fset_window_nest)
12027         (Fset_window_new_total, Fset_window_new_normal)
12028         (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
12029         (delete_all_subwindows): Rename to delete_all_child_windows.
12030         (Fdelete_other_windows_internal, Fset_window_configuration):
12031         Call delete_all_child_windows instead of delete_all_subwindows.
12032         * frame.c (delete_frame): Call delete_all_child_windows instead
12033         of delete_all_subwindows.
12035 2011-11-07  Paul Eggert  <eggert@cs.ucla.edu>
12037         * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
12038         This is also needed for porting to any host where GC_MARK_STACK is
12039         not GC_MAKE_GCPROS_NOOPS.
12040         (which_symbols): Use it.
12042 2011-11-07  Kenichi Handa  <handa@m17n.org>
12044         * coding.c (coding_set_destination): Check coding->src_pos only
12045         when coding->src_object is a buffer (bug#9910).
12047         * process.c (send_process): Set the member src_multibyte of coding
12048         to 0 (bug#9911) when sending a unibyte text.
12050         * callproc.c (Fcall_process): Set the member src_multibyte of
12051         process_coding to 0 (bug#9912).
12053 2011-11-06  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
12055         * xmenu.c (cleanup_widget_value_tree): New function.
12056         (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
12057         calling free_menubar_widget_value_tree directly (Bug#9830).
12059 2011-11-06  Paul Eggert  <eggert@cs.ucla.edu>
12061         Fix some portability problems with 'inline'.
12062         * dispextern.h (window_box, window_box_height, window_text_bottom_y)
12063         (window_box_width, window_box_left, window_box_left_offset)
12064         (window_box_right, window_box_right_offset): Declare extern.
12065         Otherwise, these inline functions do not conform to C99 and
12066         are miscompiled by Microsoft compilers.  Reported by Eli Zaretskii in
12067         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
12068         * intervals.c (adjust_intervals_for_insertion)
12069         (adjust_intervals_for_deletion): Now extern, because otherwise the
12070         extern inline functions 'offset_intervals' couldn't refer to it.
12071         (static_offset_intervals): Remove.
12072         (offset_intervals): Rewrite using the old contents of
12073         static_offset_intervals.  The old version didn't conform to C99
12074         because an extern inline function contained a reference to an
12075         identifier with static linkage.
12077 2011-11-06  Andreas Schwab  <schwab@linux-m68k.org>
12079         * keyboard.c (interrupt_signal): Don't call kill-emacs while in
12080         GC.
12082 2011-11-06  Eli Zaretskii  <eliz@gnu.org>
12084         * xdisp.c (init_iterator, reseat_to_string): Don't set the
12085         iterator's bidi_p flag if Vpurify_flag is non-nil.  (Bug#9963)
12086         (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
12087         return Qleft_to_right.
12089 2011-11-06  Chong Yidong  <cyd@gnu.org>
12091         * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
12092         (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
12093         (Fset_window_splits, Fwindow_nest, Fset_window_nest)
12094         (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
12095         (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
12096         (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
12097         (Fwindow_vscroll): Doc fix.
12098         (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
12099         argument, since it makes no sense to pass a live window and for
12100         consistency with window-child.
12102 2011-11-05  Christoph Scholtes  <cschol2112@googlemail.com>
12104         * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
12105         support MSVC.
12107 2011-11-05  Jason Rumney  <jasonr@gnu.org>
12109         * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
12110         (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
12111         fonts (Bug#6029).
12112         (add_font_entity_to_list): Fix logic errors in mixed boolean and
12113         bitwise arithmetic preventing use of unicode-sip and non-truetype
12114         opentype fonts.
12116 2011-11-05  Eli Zaretskii  <eliz@gnu.org>
12118         * s/ms-w32.h (fstat, stat, utime): Move redirections to
12119         "emacs"-only part.
12121         * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
12122         initialization code to keep similarity to xfns.c after changes
12123         from 2011-11-05.
12125 2011-11-05  Jan Djärv  <jan.h.d@swipnet.se>
12127         * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
12128         (unwind_create_frame): New function (Bug#9943).
12129         (Fx_create_frame): Restructure code to be more similar to the one in
12130         xfns.c.  Call record_unwind_protect with unwind_create_frame (Bug#9943).
12131         Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
12132         Move terminal->reference_count++ just before making the frame official
12133         (Bug#9943).
12135         * nsterm.m (x_free_frame_resources): New function.
12136         (x_destroy_window): Move code to x_free_frame_resources.
12138         * xfns.c (unwind_create_frame): Fix comment.
12139         (Fx_create_frame, x_create_tip_frame):
12140         Move terminal->reference_count++ just before making the frame
12141         official.  Move initialization of image_cache_refcount and
12142         dpyinfo_refcount before calling init_frame_faces (Bug#9943).
12144 2011-11-05  Eli Zaretskii  <eliz@gnu.org>
12146         Support MSVC build with newer versions of Visual Studio.
12147         * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
12148         Nmake barfs on that.  Use $(OBJ*_c) variables instead, defined on
12149         nt/gmake.defs.
12151         * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
12152         which are not supported by MSVC.
12153         (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
12154         (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
12155         bitfields.
12156         (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
12157         types in bitfields.
12158         (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
12160         * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
12162 2011-11-05  Fabrice Popineau  <fabrice.popineau@supelec.fr>  (tiny change)
12164         Support MSVC build with newer versions of Visual Studio.
12165         * w32.c: Don't include w32api.h for MSVC.
12166         (init_environment) [_MSC_VER]: Call sys_access, not _access.
12168         * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
12169         [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
12170         (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
12171         (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
12172         e_* cousins.
12173         (alloca) [_MSC_VER]: Define to _alloca.
12175         * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
12177         * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
12179 2011-11-04  Eli Zaretskii  <eliz@gnu.org>
12181         * xdisp.c (note_mouse_highlight): If either of
12182         previous/next-single-property-change returns nil, treat that as
12183         the beginning or the end of the buffer.  (Bug#9955)
12185 2011-11-04  Jan Djärv  <jan.h.d@swipnet.se>
12187         * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
12188         label is not null (Bug#9951).
12189         (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
12190         may be NULL.
12192 2011-11-04  Eli Zaretskii  <eliz@gnu.org>
12194         * window.c (Fwindow_body_size): Mention in the doc string that the
12195         return value is in frame's canonical units.  (Bug#9949)
12197 2011-11-03  Eli Zaretskii  <eliz@gnu.org>
12199         * xdisp.c (note_mouse_highlight): Initialize `area'.  (Bug#9947)
12201         * w32fns.c (unwind_create_frame): If needed, free the glyph
12202         matrices of the partially constructed frame.  (Bug#9943)
12203         * xfns.c (unwind_create_frame): Likewise.
12205 2011-11-01  Eli Zaretskii  <eliz@gnu.org>
12207         * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
12208         Don't stop backward scan on the continuation glyph, even though
12209         its CHARPOS is positive.
12210         (mouse_face_from_buffer_pos, note_mouse_highlight):
12211         Rename cover_string to disp_string.
12213 2011-11-01  Martin Rudalics  <rudalics@gmx.at>
12215         * window.c (temp_output_buffer_show): Don't use
12216         Vtemp_buffer_show_specifiers.
12217         (Vtemp_buffer_show_specifiers): Remove unused variable.
12219 2011-10-30  Eli Zaretskii  <eliz@gnu.org>
12221         * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
12222         past the beginning of the current glyph matrix.
12224 2011-10-30  Adam Sjøgren  <asjo@koldfront.dk>  (tiny change)
12226         * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
12227         (x_error_handler): Ignore BadMatch for X_SetInputFocus for
12228         HAVE_GTK3 (Bug#9869).
12230         * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
12231         type to GDK_NOTHING so valgrind does not complain (Bug#9901).
12233         * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
12235         * xterm.c: Declare x_handle_net_wm_state to return int.
12236         (handle_one_xevent): Check if we are iconified but don't have
12237         _NET_WM_STATE_HIDDEN.  If do, treat as deiconify (Bug#9893).
12238         (get_current_wm_state): Return non-zero if not hidden,
12239         check for _NET_WM_STATE_HIDDEN (Bug#9893).
12240         (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
12241         (x_handle_net_wm_state): Return what get_current_wm_state returns.
12242         (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
12244 2011-10-29  Paul Eggert  <eggert@cs.ucla.edu>
12246         * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
12247         so that this new function doesn't get optimized away by a
12248         whole-program optimizer.  Make the 2nd arg EMACS_INT, not int.
12250 2011-10-29  Andreas Schwab  <schwab@linux-m68k.org>
12252         * frame.h (MOUSE_HL_INFO): Remove excess parens.
12254 2011-10-29  Eli Zaretskii  <eliz@gnu.org>
12256         Fix the `xbytecode' command.
12257         * .gdbinit (xprintbytestr): New command.
12258         (xwhichsymbols): Rename from `which'; all callers changed.
12259         (xbytecode): Print the byte-code string as well.
12261 2011-10-29  Kim Storm  <storm@cua.dk>
12263         * alloc.c (which_symbols): New function.
12265 2011-10-29  Andreas Schwab  <schwab@linux-m68k.org>
12267         * minibuf.c (read_minibuf_noninteractive): Allow reading empty
12268         line.  (Bug#9903)
12270 2011-10-29  Glenn Morris  <rgm@gnu.org>
12272         * process.c (wait_reading_process_output): Revert 2009-08-30 change.
12273         Not clear what it was for, and it causes various bugs.  (Bug#9839)
12275 2011-10-28  Eli Zaretskii  <eliz@gnu.org>
12277         * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
12278         possible random value that matches one of those tested as
12279         condition to clear the mouse face.
12281 2011-10-28  Chong Yidong  <cyd@gnu.org>
12283         * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
12285 2011-10-28  Dan Nicolaescu  <dann@ics.uci.edu>
12287         * window.c (make_window): Initialize phys_cursor_on_p.
12289 2011-10-28  Stefan Monnier  <monnier@iro.umontreal.ca>
12291         * lisp.h (struct Lisp_Symbol): Update comments.
12293 2011-10-28  Juanma Barranquero  <lekktu@gmail.com>
12295         * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
12297 2011-10-28  Eli Zaretskii  <eliz@gnu.org>
12299         Fix Emacs on Windows 9X (bug#8562).  Thanks to oslsachem
12300         <oslsachem@gmail.com> for helping to debug this.
12302         * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
12303         (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
12304         (g_b_init_get_glyph_outline_w): New static variables.
12305         (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
12306         (GetGlyphOutlineW_Proc): New typedefs.
12307         (w32_load_unicows_or_gdi32, get_outline_metrics_w)
12308         (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
12309         New functions.
12310         (w32font_open_internal, compute_metrics):
12311         Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
12312         instead of calling the "wide" APIs directly.
12314         * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
12316         * w32.h (syms_of_w32font): Add prototype.
12318 2011-10-27  Juanma Barranquero  <lekktu@gmail.com>
12320         * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
12321         (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
12322         (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
12323         (Fmove_to_window_line): Doc fix.
12325 2011-10-27  Chong Yidong  <cyd@gnu.org>
12327         * process.c (make_process): Set gnutls_state to NULL.
12329         * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
12330         non-NULL, regardless of GNUTLS_INITSTAGE.
12331         (Fgnutls_boot): Cleanups.  Call emacs_gnutls_deinit if we signal
12332         an error.  Set process slots as soon as we allocate them.
12334         * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
12336 2011-10-27  Chong Yidong  <cyd@gnu.org>
12338         * gnutls.c (emacs_gnutls_deinit): New function.
12339         Deallocate credentials structures as well as calling gnutls_deinit.
12340         (Fgnutls_deinit, Fgnutls_boot): Use it.
12342         * process.c (make_process): Initialize GnuTLS credentials to NULL.
12343         (deactivate_process): Call emacs_gnutls_deinit.
12345 2011-10-27  Juanma Barranquero  <lekktu@gmail.com>
12347         * image.c (x_create_x_image_and_pixmap):
12348         * w32.c (sys_rename, w32_delayed_load):
12349         * w32font.c (fill_in_logfont):
12350         * w32reg.c (x_get_string_resource): Silence compiler warnings.
12352 2011-10-26  Juanma Barranquero  <lekktu@gmail.com>
12354         * w32fns.c (w32_default_color_map): New function,
12355         extracted from Fw32_default_color_map.
12356         (Fw32_default_color_map, Fx_open_connection): Use it.  (Bug#9785)
12358 2011-10-25  Paul Eggert  <eggert@cs.ucla.edu>
12360         * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
12362 2011-10-25  Stefan Monnier  <monnier@iro.umontreal.ca>
12364         * keyboard.c (test_undefined): New function (bug#9751).
12365         (read_key_sequence): Use it to detect when a key is bound to `undefined'.
12367 2011-10-25  Enami Tsugutomo  <tsugutomo.enami@jp.sony.com>
12369         * sysdep.c (init_sys_modes): Fix the check for the controlling
12370         terminal (Bug#6649).
12372 2011-10-20  Eli Zaretskii  <eliz@gnu.org>
12374         * dispextern.h (struct bidi_it): New member next_en_type.
12376         * bidi.c (bidi_line_init): Initialize the next_en_type member.
12377         (bidi_resolve_explicit_1): When next_en_pos is valid for the
12378         current character, check also for next_en_type being WEAK_EN.
12379         (bidi_resolve_weak): Don't enter the expensive loop if the current
12380         position is before next_en_pos.  Record the bidi type of the first
12381         non-ET, non-BN character we find, in addition to its position.
12382         (bidi_level_of_next_char): Invalidate next_en_type when
12383         next_en_pos is over-stepped.
12385 2011-10-20  Paul Eggert  <eggert@cs.ucla.edu>
12387         Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
12388         * editfns.c: Rewrite current-time-zone so that it invokes
12389         the equivalent of (format-time-string "%Z") to get the time zone name.
12390         This fixes a bug when the time zone name contains characters that
12391         need converting from the system time locale to Emacs internal format.
12392         This fixes a shortcoming that I introduced in my 1999-10-19 patch:
12393         that patch fixed format-time-string to do the conversion, but
12394         I forgot to fix current-time-zone.
12395         (format_time_string): New function, containing most of
12396         what Fformat_time_string used to contain.
12397         (Fformat_time_string): Rewrite in terms of format_time_string.
12398         This doesn't change this function's behavior.
12399         (current-time-zone): Rewrite to use format_time_string.
12400         This fixes the bug reported by Michael Schierl in
12401         <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
12402         Jason Rumney's 2007-06-07 change worked around this bug, but
12403         didn't fix it.
12404         * systime.h (tzname, timezone): Remove no-longer-used declarations.
12406 2011-10-19  Eli Zaretskii  <eliz@gnu.org>
12408         * xdisp.c (start_display): If the character at POS is displayed
12409         via a display vector, reset IT->current.dpvec_index to zero.
12410         (try_window_reusing_current_matrix): If a line ends in a display
12411         vector or the next line starts in a display vector, continue
12412         redrawing the window even though the character position of
12413         start_row was reached.
12414         (Bug#9771, part 2)
12416 2011-10-18  Chong Yidong  <cyd@gnu.org>
12418         * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
12419         with nobreak-char-display too.
12421 2011-10-18  Eli Zaretskii  <eliz@gnu.org>
12423         Fix part 3 of bug#9771.
12424         * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
12425         (bidi_resolve_neutral): Don't enter the expensive loop looking for
12426         non-neutral characters if the current character is a paragraph
12427         separator (a.k.a. Newline).  This avoids running the same
12428         expensive loop twice, once when we consume the preceding newline
12429         and the other time when the line actually needs to be displayed.
12430         Avoid the loop when we see neutrals on the base embedding level
12431         following a character whose directionality is the same as the
12432         paragraph's.  This avoids running the expensive loop when a line
12433         ends in a long sequence of neutrals, like control characters.
12434         Add assertion against STRONG_AL type.  Slightly rearrange code
12435         that determines the type of a neutral given the first non-neutral
12436         that follows it.
12437         (bidi_level_of_next_char): Set next_en_pos to zero when
12438         invalidating its info.
12440 2011-10-17  Eli Zaretskii  <eliz@gnu.org>
12442         * xdisp.c (push_display_prop): Determine whether to record string
12443         or buffer position by IT->string, not by IT->method.  Allow
12444         GET_FROM_DISPLAY_VECTOR as IT->method on entry.  (Bug#9771, part 4)
12445         (move_it_vertically_backward): Don't look for character position
12446         immediately after the newline when in a continuation line.
12447         (Bug#9771, part 1)
12449 2011-10-15  Martin Rudalics  <rudalics@gmx.at>
12451         * window.c (coordinates_in_window): Rewrite and delabelize
12452         vertical border check.  (Bug#5357) (Bug#9618)
12454 2011-10-14  Stefan Monnier  <monnier@iro.umontreal.ca>
12456         * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
12457         errors in XSetWindowBorder (bug#9310).
12459 2011-10-13  Dmitry Antipov  <dmantipov@yandex.ru>
12461         * editfns.c (Fset_time_zone_rule): Replace free with xfree to
12462         avoid crash when xmalloc overrun checking is enabled.
12464 2011-10-13  Eli Zaretskii  <eliz@gnu.org>
12466         * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
12467         itb.paragraph_dir to NEUTRAL_DIR.  Fixes an occasional incorrect
12468         cursor motion with <left> and <right> arrow keys.
12470         * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
12471         some callers set that themselves.
12473 2011-10-12  Eli Zaretskii  <eliz@gnu.org>
12475         * xdisp.c (find_row_edges): Handle the case where ROW comes from a
12476         display string and the previous row comes from the same string and
12477         is empty.  (Bug#9739)  (Bug#9738)
12479 2011-10-12  Stefan Monnier  <monnier@iro.umontreal.ca>
12481         * doc.c (get_doc_string): Encode file name (bug#9735).
12483 2011-10-12  Eli Zaretskii  <eliz@gnu.org>
12485         * bidi.c (bidi_level_of_next_char):
12486         * xdisp.c (get_visually_first_element): Remove old incorrect
12487         comments regarding the Unicode Line Separator character.
12489         * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
12491 2011-10-12  Dmitry Antipov  <dmantipov@yandex.ru>
12493         * alloc.c (Fgc_status): Do not access beyond zombies array
12494         boundary if nzombies > MAX_ZOMBIES.
12495         * alloc.c (dump_zombies): Add missing format specifier.
12497 2011-10-12  Paul Eggert  <eggert@cs.ucla.edu>
12499         * xdisp.c (set_cursor_from_row): Simplify conditionals,
12500         to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
12502         * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
12503         Some packages use them to denote characters with modifiers.
12505 2011-10-11  Andreas Schwab  <schwab@linux-m68k.org>
12507         * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
12508         (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
12509         matching a pp-number.  Rename parameter var to var1.
12511 2011-10-11  Stefan Monnier  <monnier@iro.umontreal.ca>
12513         * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
12515 2011-10-08  Glenn Morris  <rgm@gnu.org>
12517         * callint.c (Fcall_interactively): Give a more explicit error for the
12518         'c' case with a non-character input.  (Bug#8479)
12520 2011-10-08  Eli Zaretskii  <eliz@gnu.org>
12522         * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
12523         lines.
12524         (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
12525         lines that are hscrolled on the left.
12527         * dispnew.c (buffer_posn_from_coords): Account for a possible
12528         presence of header-line.  (Bug#4426)
12530 2011-10-07  Stefan Monnier  <monnier@iro.umontreal.ca>
12532         * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
12533         Don't advertise functionality which we discourage or doesn't work.
12535 2011-10-07  Paul Eggert  <eggert@cs.ucla.edu>
12537         * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
12538         or sizeof.  __alignof__ gives the wrong answer on Fedora x86-64
12539         with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
12540         this makes Emacs dump core during garbage collection on rare
12541         occasions.  sizeof is obviously inferior to offsetof here, so
12542         stick with offsetof.
12543         (GC_POINTER_ALIGNMENT): New macro.
12544         (mark_memory): Omit 3rd (offset) arg; caller changed.
12545         Don't assume EMACS_INT alignment is the same as pointer alignment.
12547 2011-10-03  Stefan Monnier  <monnier@iro.umontreal.ca>
12549         * keyboard.c (read_key_sequence_remapped): New var.
12550         (read_key_sequence): Compute remapping in the right buffer.
12551         (command_loop_1): Use read_key_sequence's remapping directly.
12553 2011-10-02  Stefan Monnier  <monnier@iro.umontreal.ca>
12555         * dired.c (file_name_completion): Don't expand file name.
12556         (Ffile_name_completion, Ffile_name_all_completions): Expand file name
12557         before checking file name handler.
12559         * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
12560         they've been requested explicitly (bug#9591).
12562 2011-10-01  Andreas Schwab  <schwab@linux-m68k.org>
12564         * keymap.c (Fsingle_key_description): Use make_specified_string
12565         instead of build_string to build string from push_key_description.
12566         (Bug#5193)
12568 2011-09-30  Paul Eggert  <eggert@cs.ucla.edu>
12570         * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
12571         This fixes a Y2038 bug on 64-bit hosts.
12572         * buffer.c (reset_buffer):
12573         * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
12574         (Fclear_buffer_auto_save_failure):
12575         Use 0, not -1, to represent an unset failure time, since time_t
12576         might not be signed.
12578         Remove dependency on glibc malloc internals.
12579         * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12580         Move back here from lisp.h, but with their new implementations.
12581         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
12582         (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
12583         * charset.c (charset_table_init): New static var.
12584         (syms_of_charset): Use it instead of xmalloc.  This removes a
12585         dependency on glibc malloc internals.  See Eli Zaretskii's comment in
12586         <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
12587         * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12588         Move back to alloc.c.
12589         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
12590         (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
12592 2011-09-30  Jan Djärv  <jan.h.d@swipnet.se>
12594         * nsterm.m (windowDidResize): Call x_set_window_size only when
12595         ns_in_resize is true.  Otherwise set pixelwidth/height and
12596         call change_frame_size (Bug#9628).
12598 2011-09-30  Paul Eggert  <eggert@cs.ucla.edu>
12600         Port --enable-checking=all to Fedora 14 x86-64.
12601         * charset.c (syms_of_charset): Also account for glibc malloc's
12602         internal overhead when calculating the initial malloc maximum.
12604         Port --enable-checking=all to Fedora 14 x86.
12605         * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12606         Move to lisp.h.
12607         (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
12608         (overrun_check_realloc, overrun_check_free):
12609         Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
12610         That way, xmalloc returns a properly-aligned pointer even if
12611         XMALLOC_OVERRUN_CHECK is defined.  The old debugging code happened
12612         to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
12613         * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
12614         into account when calculating the initial malloc maximum.
12615         * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12616         Move here from alloc.c, so that charset.c can use it too.
12617         Properly align; the old code wasn't right for common 32-bit hosts
12618         when configured with --enable-checking=all.
12619         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
12620         (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
12622 2011-09-29  Eli Zaretskii  <eliz@gnu.org>
12624         * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
12625         use EDOM.
12627 2011-09-28  Eli Zaretskii  <eliz@gnu.org>
12629         * xdisp.c (compute_display_string_end): If there's no display
12630         string at CHARPOS, return -1.
12632         * bidi.c (bidi_fetch_char): When compute_display_string_end
12633         returns a negative value, treat the character as a normal
12634         character not covered by a display string.  (Bug#9624)
12636 2011-09-28  Juanma Barranquero  <lekktu@gmail.com>
12638         * lread.c (Fread_from_string): Fix typo in docstring.
12640 2011-09-27  Eli Zaretskii  <eliz@gnu.org>
12642         * xdisp.c (handle_invisible_prop): If invisible text ends on a
12643         newline, reseat the iterator instead of bidi-iterating there one
12644         character at a time.  (Bug#9610)
12645         (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
12646         TO_CHARPOS if the bidi iterator is at base embedding level.
12648 2011-09-27  Andreas Schwab  <schwab@linux-m68k.org>
12650         * lread.c (readevalloop): Use correct code for NBSP.
12651         (read1): Likewise.  (Bug#9608)
12653 2011-09-25  Michael Albinus  <michael.albinus@gmx.de>
12655         * dbusbind.c (Fdbus_register_signal): When service is not
12656         registered, use nil in Vdbus_registered_objects_table.  (Bug#9581)
12658 2011-09-25  Glenn Morris  <rgm@gnu.org>
12660         * buffer.c (truncate-lines): Doc fix.
12662 2011-09-24  Chong Yidong  <cyd@stupidchicken.com>
12664         * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
12665         (Fset_window_next_buffers): Doc fix.
12667 2011-09-24  Glenn Morris  <rgm@gnu.org>
12669         * minibuf.c (read_minibuf): Disable line truncation.  (Bug#5715)
12671 2011-09-24  Paul Eggert  <eggert@cs.ucla.edu>
12673         Fix minor problems found by static checking.
12674         * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
12675         * indent.c (Fvertical_motion): Fix == vs = typo.
12677 2011-09-24  Eli Zaretskii  <eliz@gnu.org>
12679         * dispnew.c (syms_of_display) <redisplay-dont-pause>:
12680         Default value is now t.  Doc fix.
12682         * indent.c (Fvertical_motion): Compute and apply the overshoot
12683         logic when moving up, not only when moving down.  Fix the
12684         confusing name and values of the it_overshoot_expected variable;
12685         logic changes accordingly.  (Bug#9254) (Bug#9549)
12687         * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
12688         CHARPOS is covered by a display string which includes newlines.
12689         (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
12690         is covered by a display string with embedded newlines.
12692 2011-09-24  Michael Albinus  <michael.albinus@gmx.de>
12694         * dbusbind.c (Fdbus_register_signal): Add match rule to
12695         Vdbus_registered_objects_table.  (Bug#9581)
12696         (Fdbus_register_method, Vdbus_registered_objects_table):
12697         Fix docstring.
12699 2011-09-24  Jim Meyering  <meyering@redhat.com>
12701         do not ignore write error for any output size
12702         The previous change was incomplete.
12703         While it makes emacs --batch detect the vast majority of stdout
12704         write failures, errors were still ignored whenever the output size is
12705         k * (BUFSIZ+1) - 4.  E.g., on a system with BUFSIZ of 4096,
12706           $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
12707               && echo FAIL: ignored write error
12708           FAIL: ignored write error
12709           $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
12710               && echo FAIL: ignored write error
12711           FAIL: ignored write error
12712         * emacs.c (Fkill_emacs): Also test ferror.  (Bug#9574)
12714 2011-09-23  Andreas Schwab  <schwab@linux-m68k.org>
12716         * emacs.c (Fkill_emacs): In noninteractive mode exit
12717         non-successfully if a write error occurred on stdout.  (Bug#9574)
12719 2011-09-21  Eli Zaretskii  <eliz@gnu.org>
12721         * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
12722         the xassert test.
12724         * dispextern.h (struct it): Update the comment documenting what
12725         can it->OBJECT be.
12727 2011-09-20  Eli Zaretskii  <eliz@gnu.org>
12729         * xdisp.c (set_cursor_from_row): If the row ends in a newline from
12730         a display string, extend search for cursor position to end of row.
12731         (find_row_edges): If the row ends in a newline from a display
12732         string, increment its MATRIX_ROW_END_CHARPOS by one.  (Bug#9549)
12733         Handle the case of a display string with multiple newlines.
12734         (Fcurrent_bidi_paragraph_direction): Fix search for previous
12735         non-empty line.  Fixes confusing cursor motion with arrow keys at
12736         the beginning of a line that starts with whitespace.
12738 2011-09-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12740         * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
12741         (bug#9493).
12743 2011-09-18  Chong Yidong  <cyd@stupidchicken.com>
12745         * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
12746         boolean (Bug#9154).
12748 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
12750         * xdisp.c (display_line): Record maximum and minimum buffer
12751         positions even if no glyphs were produced (e.g., by a zero-width
12752         stretch).  Fixes bug#9530 on a TTY.  Under word-wrap, don't record
12753         buffer positions that will be removed from the glyph row because
12754         they don't fit.
12755         (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
12756         column is beyond frame width: don't subtract 1 "pixel" when
12757         computing width of the stretch.
12758         (reseat_at_next_visible_line_start): Undo the change made on
12759         2011-09-17 that saved paragraph information and restored it after
12760         the call to `reseat'.  (Bug#9545)
12762 2011-09-18  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
12764         * xdisp.c (expose_window): Save original value of phys_cursor_on_p
12765         and turn window cursor on if cleared (Bug#9415).
12767 2011-09-18  Andreas Schwab  <schwab@linux-m68k.org>
12769         * search.c (boyer_moore): Take unibyte characters from pattern
12770         literally.  (Bug#9458)
12772 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
12774         * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
12776 2011-09-18  Paul Eggert  <eggert@cs.ucla.edu>
12778         Fix minor problem found by static checking.
12779         * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
12780         initialized, to pacify gcc -Wuninitialized.
12782         * fileio.c: Report proper errno when syscall falls.
12783         (Finsert_file_contents): Save and restore errno,
12784         so that report_file_error outputs the correct diagnostic.
12785         (Fwrite_region) [CLASH_DETECTION]: Likewise.
12787 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
12789         * .gdbinit (pgx): Fix references to fields of `struct glyph'.
12791 2011-09-17  Eli Zaretskii  <eliz@gnu.org>
12793         * xdisp.c (produce_stretch_glyph): Another fix for changes made on
12794         2011-08-30T17:32:44Z!eliz@gnu.org.  (Bug#9530)
12796 2011-09-17  Eli Zaretskii  <eliz@gnu.org>
12798         * xdisp.c (reseat_at_next_visible_line_start): Keep information
12799         about the current paragraph and restore it after the call to reseat.
12801         * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
12802         (bidi_find_paragraph_start): Search back for paragraph beginning
12803         at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
12804         (bidi_move_to_visually_next): Only trigger paragraph-related
12805         computations when the last character is a newline or at EOB, not
12806         just any NEUTRAL_B.  (Bug#9470)
12808         * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
12809         truncated lines if point is covered by a display string.  (Bug#9524)
12811 2011-09-16  Paul Eggert  <eggert@cs.ucla.edu>
12813         * xselect.c: Relax test for outgoing X longs (Bug#9498).
12814         (cons_to_x_long): New function.
12815         (lisp_data_to_selection_data): Use it.  Correct the test for
12816         short-versus-long data; it was negated.  Break out of vector
12817         loop, for efficiency, when a long datum is discovered.
12819 2011-09-16  Stefan Monnier  <monnier@iro.umontreal.ca>
12821         * eval.c (Fquote): Document its non-consing behavior (bug#9482).
12823 2011-09-16  Eli Zaretskii  <eliz@gnu.org>
12825         * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
12826         GCC PR/17406) by declaring this function with external scope.
12828 2011-09-15  Paul Eggert  <eggert@cs.ucla.edu>
12830         * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
12831         Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
12833 2011-09-15  Andreas Schwab  <schwab@linux-m68k.org>
12835         * editfns.c (Fformat): Correctly handle text properties on "%%".
12837 2011-09-15  Eli Zaretskii  <eliz@gnu.org>
12839         * xterm.c (x_draw_composite_glyph_string_foreground):
12840         * w32term.c (x_draw_composite_glyph_string_foreground):
12841         * term.c (encode_terminal_code):
12842         * composite.c (composition_update_it, get_composition_id):
12843         * xdisp.c (get_next_display_element)
12844         (fill_composite_glyph_string): Add comments about special meaning
12845         of TAB characters in a composition.
12847 2011-09-15  Paul Eggert  <eggert@cs.ucla.edu>
12849         * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
12850         This occurs when processing a multibyte format.
12851         Problem reported by Wolfgang Jenker.
12853 2011-09-15  Johan Bockgård  <bojohan@gnu.org>
12855         * xdisp.c (try_cursor_movement): Only check for exact match if
12856         cursor hpos found by set_cursor_from_row is valid.  (Bug#9495)
12858 2011-09-14  Paul Eggert  <eggert@cs.ucla.edu>
12860         Remove unused external symbols.
12861         * dispextern.h (calc_pixel_width_or_height): Remove decl.
12862         * xdisp.c (calc_pixel_width_or_height): Now static.
12863         * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
12864         * indent.c (check_display_width):
12865         * w32term.c: Fix comment to match code.
12866         * xterm.c, xterm.h (x_catching_errors): Remove.
12868 2011-09-14  Paul Eggert  <eggert@cs.ucla.edu>
12870         * xselect.c: Use signed conversions more consistently (Bug#9498).
12871         (selection_data_to_lisp_data): Assume incoming selection data are
12872         signed integers, not unsigned.  This is to be consistent with
12873         outgoing selection data, which was modified to use signed integers
12874         in as part of the fix to Bug#9196 in response to Jan D.'s comment
12875         in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
12876         expects long, not unsigned long.
12878 2011-09-14  Eli Zaretskii  <eliz@gnu.org>
12880         * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
12881         computation of loop end.  Reported by Johan Bockgård
12882         <bojohan@gnu.org>.
12884 2011-09-13  Chong Yidong  <cyd@stupidchicken.com>
12886         * frame.c (Fother_visible_frames_p): Function deleted.
12888 2011-09-12  Eli Zaretskii  <eliz@gnu.org>
12890         * indent.c (compute_motion): Process display vector front to back
12891         rather than the other way around.  (Bug#2496)
12893 2011-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
12895         * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
12897 2011-09-11  Chong Yidong  <cyd@stupidchicken.com>
12899         * minibuf.c (Fread_from_minibuffer): Doc fix.
12901 2011-09-11  Eli Zaretskii  <eliz@gnu.org>
12903         * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
12904         2011-08-30T17:32:44Z!eliz@gnu.org.  (Bug#9475)
12906 2011-09-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12908         * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
12909         value for non-existent files.
12911 2011-09-11  Eli Zaretskii  <eliz@gnu.org>
12913         * fileio.c (Finsert_file_contents): If the file cannot be opened,
12914         set its "size" to -1.  This will set the modtime_size field of
12915         the corresponding buffer to -1, which is what
12916         verify-visited-file-modtime expects for files that do not exist.
12917         (Bug#9139)
12919 2011-09-11  Paul Eggert  <eggert@cs.ucla.edu>
12921         * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
12922         here ...
12923         * lisp.h: ... from here.  push_key_description is no longer
12924         defined in keyboard.c, so its declaration should not be in
12925         lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
12926         logically belongs with push_key_description.
12928 2011-09-10  Paul Eggert  <eggert@cs.ucla.edu>
12930         * buffer.h: Include <sys/types.h> instead of <time.h>.
12931         Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
12932         Problem reported by Herbert J. Skuhra.
12934 2011-09-10  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12936         * xml.c (parse_region): Make the parsing work for
12937         non-comment-starting XML files again (bug#9144).
12939 2011-09-10  Andreas Schwab  <schwab@linux-m68k.org>
12941         * image.c (gif_load): Fix calculation of bottom and right corner.
12942         (Bug#9468)
12944 2011-09-10  Eli Zaretskii  <eliz@gnu.org>
12946         * xdisp.c (MAX_DISP_SCAN): Decrease to 250.  Prevents sluggish
12947         redisplay in small windows.
12949 2011-09-09  Eli Zaretskii  <eliz@gnu.org>
12951         * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
12953 2011-09-08  Martin Rudalics  <rudalics@gmx.at>
12955         * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
12956         Operate on live windows only.
12958 2011-09-08  Juanma Barranquero  <lekktu@gmail.com>
12960         * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
12962 2011-09-07  Eli Zaretskii  <eliz@gnu.org>
12964         * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
12965         only under bidi iteration.
12967 2011-09-07  Jan Djärv  <jan.h.d@swipnet.se>
12969         * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
12971 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
12973         isnan: Fix porting problem to Solaris 10 with bundled gcc.
12974         Without this fix, the command to link temacs failed due to an
12975         undefined symbol __builtin_isnan.  This is because
12976         /usr/include/iso/math_c99.h #defines isnan(x) to
12977         __builtin_isnan(x), but the bundled gcc, which identifies itself
12978         as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
12979         a __builtin_isnan.
12980         * floatfns.c (isnan): #undef, and then #define to a clone of
12981         what's in data.c.
12982         (Fisnan): Always define, since it's always available now.
12983         (syms_of_floatfns): Always define isnan at the Lisp level.
12985 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
12987         * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
12989 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
12991         * fileio.c: Fix bugs with large file offsets (Bug#9428).
12992         The previous code assumed that file offsets (off_t values) fit in
12993         EMACS_INT variables, which is not true on typical 32-bit hosts.
12994         The code messed up by falsely reporting buffer overflow in cases
12995         such as (insert-file-contents "big" nil 1 2) into an empty buffer
12996         when "big" contains more than 2**29 bytes, even though this
12997         inserts just one byte and does not overflow the buffer.
12998         (Finsert_file_contents): Store file offsets as off_t
12999         values, not as EMACS_INT values.  Check for overflow when
13000         converting between EMACS_INT and off_t.  When checking for
13001         buffer overflow or for overlap, take the offsets into account.
13002         Don't use EMACS_INT for small values where int suffices.
13003         When checking for overlap, fix a typo: ZV was used where
13004         ZV_BYTE was intended.
13005         (Fwrite_region): Don't assume off_t fits into 'long'.
13006         * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
13008 2011-09-05  Michael Albinus  <michael.albinus@gmx.de>
13010         * dbusbind.c (xd_signature_cat): Rename from signature_cat.
13012 2011-09-04  Paul Eggert  <eggert@cs.ucla.edu>
13014         sprintf-related integer and memory overflow issues (Bug#9412).
13016         * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
13017         (esprintf, exprintf, evxprintf): New functions.
13018         * keyboard.c (command_loop_level): Now EMACS_INT, not int.
13019         (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
13020         (modify_event_symbol): Do not assume that the length of
13021         name_alist_or_stem is safe to alloca and fits in int.
13022         (Fexecute_extended_command): Likewise for function name and binding.
13023         (Frecursion_depth): Wrap around reliably on integer overflow.
13024         * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
13025         since some callers pass EMACS_INT values.
13026         (Fsingle_key_description): Don't crash if symbol name contains more
13027         than MAX_ALLOCA bytes.
13028         * minibuf.c (minibuf_level): Now EMACS_INT, not int.
13029         (get_minibuffer): Arg is now EMACS_INT, not int.
13030         * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
13031         (esprintf, exprintf, evxprintf): New decls.
13032         * window.h (command_loop_level, minibuf_level): Reflect API changes.
13034         * dbusbind.c (signature_cat): New function.
13035         (xd_signature, Fdbus_register_signal):
13036         Do not overrun buffer; instead, report string overflow.
13038         * dispnew.c (add_window_display_history): Don't overrun buffer.
13039         Truncate instead; this is OK since it's just a log.
13041         * editfns.c (Fcurrent_time_zone): Don't overrun buffer
13042         even if the time zone offset is outlandishly large.
13043         Don't mishandle offset == INT_MIN.
13045         * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
13046         when creating daemon; the previous buffer-overflow check was incorrect.
13048         * eval.c (verror): Simplify by rewriting in terms of evxprintf,
13049         which has the guts of the old verror function.
13051         * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
13052         use SAFE_ALLOCA instead.  Use esprintf to avoid int-overflow issues.
13054         * font.c: Include <float.h>, for DBL_MAX_10_EXP.
13055         (font_unparse_xlfd): Don't blindly alloca long strings.
13056         Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
13057         fits in int, when using sprintf.  Use single snprintf to count
13058         length of string rather than counting it via multiple sprintfs;
13059         that's simpler and more reliable.
13060         (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
13061         (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
13062         sprintf, in case result does not fit in int.
13064         * fontset.c (num_auto_fontsets): Now printmax_t, not int.
13065         (fontset_from_font): Print it.
13067         * frame.c (tty_frame_count): Now printmax_t, not int.
13068         (make_terminal_frame, set_term_frame_name): Print it.
13069         (x_report_frame_params): In X, window IDs are unsigned long,
13070         not signed long, so print them as unsigned.
13071         (validate_x_resource_name): Check for implausibly long names,
13072         and don't assume name length fits in 'int'.
13073         (x_get_resource_string): Don't blindly alloca invocation name;
13074         use SAFE_ALLOCA.  Use esprintf, not sprintf, in case result does
13075         not fit in int.
13077         * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
13078         (xg_check_special_colors, xg_set_geometry):
13079         Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
13081         * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
13082         Use esprintf, not sprintf, in case result does not fit in int.
13084         * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
13085         (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
13086         it as a large positive number.
13087         (Fexecute_kbd_macro): Don't assume repeat count fits in int.
13088         * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
13090         * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
13091         in case result does not fit in int.
13093         * print.c (float_to_string): Detect width overflow more reliably.
13094         (print_object): Make sprintf buffer a bit bigger, to avoid potential
13095         buffer overrun.  Don't assume list length fits in 'int'.  Treat
13096         print length of 0 as 0, not as infinity; to be consistent with other
13097         uses of print length in this function.  Don't overflow print length
13098         index.  Don't assume hash table size fits in 'long', or that
13099         vectorlike size fits in 'unsigned long'.
13101         * process.c (make_process): Use printmax_t, not int, to format
13102         process-name gensyms.
13104         * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
13106         * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
13107         to avoid potential buffer overrun.
13109         * xfaces.c (x_update_menu_appearance): Don't overrun buffer
13110         if X resource line is longer than 512 bytes.
13112         * xfns.c (x_window): Make sprintf buffer a bit bigger
13113         to avoid potential buffer overrun.
13115         * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
13117         * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
13119 2011-09-04  Paul Eggert  <eggert@cs.ucla.edu>
13121         Integer overflow fixes for scrolling, etc.
13122         Without these, Emacs silently mishandles large integers sometimes.
13123         For example, "C-u 4294967297 M-x recenter" was treated as if
13124         it were "C-u 1 M-x recenter" on a typical 64-bit host.
13126         * xdisp.c (try_window_id): Check Emacs fixnum range before
13127         converting to 'int'.
13129         * window.c (window_scroll_line_based, Frecenter):
13130         Check that an Emacs fixnum is in range before assigning it to 'int'.
13131         (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
13132         values converted from Emacs fixnums.
13133         (Frecenter): Don't wrap around a line count if it is out of 'int'
13134         range; instead, treat it as an extreme value.
13135         (Fset_window_configuration, compare_window_configurations):
13136         Use ptrdiff_t, not int, for index that might exceed 2 GiB.
13138         * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
13139         that can exceed INT_MAX.  Check that EMACS_INT value is in range
13140         before assigning it to the (possibly-narrower) index.
13141         (match_limit): Don't assume that a fixnum can fit in 'int'.
13143         * print.c (print_object): Use ptrdiff_t, not int, for index that can
13144         exceed INT_MAX.
13146         * indent.c (position_indentation): Now takes ptrdiff_t, not int.
13147         (Fvertical_motion): Don't wrap around LINES values that don't fit
13148         in 'int'.  Instead, treat them as extreme values.  This is good
13149         enough for windows, which can't have more than INT_MAX lines anyway.
13151 2011-09-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
13153         * Require libxml/parser.h to avoid compilation warning.
13155         * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
13157         * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
13158         since this reportedly can destroy thread storage.
13160 2011-08-30  Chong Yidong  <cyd@stupidchicken.com>
13162         * syntax.c (find_defun_start): Update all cache variables if
13163         exiting early (Bug#9401).
13165 2011-08-30  Eli Zaretskii  <eliz@gnu.org>
13167         * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
13169         * xdisp.c (produce_stretch_glyph): No longer static, compiled also
13170         when HAVE_WINDOW_SYSTEM is not defined.  Support both GUI and TTY
13171         frames.  Call tty_append_glyph in the TTY case.  (Bug#9402)
13173         * term.c (tty_append_glyph): New function.
13174         (produce_stretch_glyph): Static function and its prototype deleted.
13176         * dispextern.h (produce_stretch_glyph, tty_append_glyph):
13177         Add prototypes.
13179 2011-08-29  Paul Eggert  <eggert@cs.ucla.edu>
13181         * image.c (parse_image_spec): Check for nonnegative, not for positive,
13182         when checking :margin (Bug#9390).
13183         (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
13184         Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
13185         so that the name doesn't mislead.  All uses changed.
13187 2011-08-28  Johan Bockgård  <bojohan@gnu.org>
13189         * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
13190         set_tty_hooks.
13192 2011-08-27  Eli Zaretskii  <eliz@gnu.org>
13194         * xdisp.c (move_it_to): Don't bail out early when reaching
13195         position beyond to_charpos, if we are scanning backwards.
13196         (move_it_vertically_backward): When DY == 0, make sure we get to
13197         the first character in the line after the newline.
13199 2011-08-27  Paul Eggert  <eggert@cs.ucla.edu>
13201         * ccl.c: Improve and simplify overflow checking (Bug#9196).
13202         (ccl_driver): Do not generate an out-of-range pointer.
13203         (Fccl_execute_on_string): Remove unnecessary check for
13204         integer overflow, noted by Stefan Monnier in
13205         <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
13206         Remove a FIXME that didn't need fixing.
13207         Simplify the newly-introduced buffer reallocation code.
13209 2011-08-27  Juanma Barranquero  <lekktu@gmail.com>
13211         * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
13213 2011-08-26  Paul Eggert  <eggert@cs.ucla.edu>
13215         Integer and memory overflow issues (Bug#9196).
13217         * doc.c (get_doc_string): Rework so that
13218         get_doc_string_buffer_size is the actual buffer size, rather than
13219         being 1 less than the actual buffer size; this makes xpalloc more
13220         convenient.
13222         * image.c (x_allocate_bitmap_record, cache_image):
13223         * xselect.c (Fx_register_dnd_atom):
13224         Simplify previous changes by using xpalloc.
13226         * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
13227         since either will do and ptrdiff_t is convenient with xpalloc.
13229         * charset.c (charset_table_size)
13230         (struct charset_sort_data.priority): Now ptrdiff_t.
13231         (charset_compare): Don't overflow if priorities differ greatly.
13232         (Fsort_charsets): Don't assume list length fits in int.
13233         Check for size-calculation overflow when allocating sort data.
13234         (syms_of_charset): Allocate an initial charset table that is
13235         just under 64 KiB, to avoid problems with glibc malloc and mmap.
13237         * cmds.c (internal_self_insert): Check for size-calculation overflow.
13239         * composite.h (struct composition.glyph_len): Now int, not unsigned.
13240         The actual value is always <= INT_MAX, and leaving it unsigned made
13241         overflow checking harder.
13243         * dispextern.h (struct glyph_matrix.rows_allocated)
13244         (struct face_cache.size): Now ptrdiff_t, for convenience in use
13245         with xpalloc.  The values are still always <= INT_MAX.
13247         * indent.c (compute_motion): Adjust to region_cache_forward sig change.
13249         * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
13250         (SAFE_NALLOCA): New macro.
13252         * region-cache.c (struct boundary.pos, find_cache_boundary)
13253         (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
13254         (set_cache_region, invalidate_region_cache)
13255         (revalidate_region_cache, know_region_cache, region_cache_forward)
13256         (region_cache_backward, pp_cache):
13257         Use ptrdiff_t, not EMACS_INT, since either will do.  This is needed
13258         so that ptrdiff_t * can be passed to xpalloc.
13259         (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
13260         beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
13261         (pp_cache): Don't assume cache_len fits in int.
13262         * region-cache.h: Adjust extern decls to match.
13264         * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
13265         EMACS_INT, since either will do, for xpalloc.
13267         * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
13268         (xnmalloc, xnrealloc, xpalloc): New functions.
13270         * bidi.c (bidi_shelve_header_size): New constant.
13271         (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
13272         (bidi_cache_ensure_space): Avoid integer overflow when allocating.
13274         * bidi.c (bidi_cache_shrink):
13275         * buffer.c (overlays_at, overlays_in, record_overlay_string)
13276         (overlay_strings):
13277         Don't update size of array until after memory allocation succeeds,
13278         because xmalloc/xrealloc may not return.
13279         (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
13280         now that we have proper integer overflow checking.
13281         (record_overlay_string, overlay_strings): Catch overflows when
13282         calculating size of overlay_str_buf.
13284         * callproc.c (Fcall_process): Check for size overflow when
13285         calculating size of args2.
13286         (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
13287         Normally we prefer signed values, but sticking with ptrdiff_t would
13288         require adding more-complicated checks.
13290         * ccl.c (Fccl_execute_on_string): Check for memory overflow.
13291         Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
13292         Redo buffer-overflow calculations to avoid integer overflow.
13293         Add a FIXME comment where memory seems to be over-allocated.
13295         * character.c (Fstring): Check for size-calculation overflow.
13297         * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
13298         unnecessary integer overflow.  Check for size overflow.
13299         (encode_coding_object): Don't update size until xmalloc succeeds.
13301         * composite.c (get_composition_id): Check for overflow in glyph
13302         length calculations.
13304         Integer and memory overflow fixes for display code.
13305         * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
13306         * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
13307         (scrolling_window): Check for overflow in size calculations.
13308         (line_draw_cost, realloc_glyph_pool, add_row_entry):
13309         Don't assume glyph table len fits in int.
13310         (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
13311         (row_table_size): Now ptrdiff_t, not int.
13312         (scrolling_window): Avoid overflow in size calculations.
13313         Don't update size until allocation succeeds.
13314         * fns.c (concat): Check for overflow in size calculations.
13315         (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
13316         * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
13317         (NEXT_ALMOST_PRIME_LIMIT): New constant.
13319         * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
13320         (get_doc_string): Check for size calculation overflow.
13321         Don't update size until allocation succeeds.
13322         (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
13323         EMACS_INT, where ptrdiff_t will do.
13324         (Fsubstitute_command_keys): Check for string overflow.
13326         * editfns.c (set_time_zone_rule): Don't assume environment length
13327         fits in int.
13328         (message_length): Now ptrdiff_t, not int.
13329         (Fmessage_box): Don't update size until allocation succeeds.
13330         Don't assume message length fits in int.
13331         (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
13333         * emacs.c (main): Do not reallocate argv, since there is a null at
13334         the end that can be overwritten, and this way there's no need to
13335         worry about size-calculation overflow.
13336         (sort_args): Check for size-calculation overflow.
13338         * eval.c (init_eval_once, grow_specpdl): Don't update size until
13339         alloc succeeds.
13340         (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
13342         * frame.c (set_menu_bar_lines, x_set_frame_parameters)
13343         (x_set_scroll_bar_width, x_figure_window_size):
13344         Check for integer overflow.
13345         (x_set_alpha): Do not assume XINT fits in int.
13347         * frame.h (struct frame): Use int, not EMACS_INT, where int works.
13348         This is for the members text_lines, text_cols, total_lines, total_cols,
13349         where the system imposes an 'int' limit.
13351         * fringe.c (Fdefine_fringe_bitmap):
13352         Don't update size until alloc works.
13354         * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
13355         (ftfont_shape_by_flt): Check for integer overflow in size calculations.
13357         * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
13358         Check for size-calculation overflow.
13359         (get_utf8_string): Use ptrdiff_t, not size_t, where either will
13360         do, as we prefer signed integers.
13361         (id_to_widget.max_size, id_to_widget.used)
13362         (xg_store_widget_in_map, xg_remove_widget_from_map)
13363         (xg_get_widget_from_map, xg_get_scroll_id_for_window)
13364         (xg_remove_scroll_bar, xg_update_scrollbar_pos):
13365         Use and return ptrdiff_t, not int.
13366         (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
13367         * gtkutil.h: Change prototypes to match the above.
13369         * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
13370         are duplicate now that they've been promoted to lisp.h.
13371         (x_allocate_bitmap_record, x_alloc_image_color)
13372         (make_image_cache, cache_image, xpm_load):
13373         Don't update size until alloc is done.
13374         (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
13375         (x_detect_edges):
13376         Check for size calculation overflow.
13377         (ct_colors_allocated_max): New constant.
13378         (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
13379         overflow.
13381         * keyboard.c (read_char, menu_bar_items, tool_bar_items)
13382         (read_char_x_menu_prompt, read_char_minibuf_menu_width)
13383         (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
13384         Use ptrdiff_t, not int, to count maps.
13385         (read_char_minibuf_menu_prompt): Check for overflow in size
13386         calculations.  Don't update size until allocation succeeds.
13387         Redo calculations to avoid overflow.
13388         * keyboard.h: Change prototypes to match the above.
13390         * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
13391         to count maps.
13392         (current_minor_maps): Check for size calculation overflow.
13393         * keymap.h: Change prototypes to match the above.
13395         * lread.c (read1, init_obarray): Don't update size until alloc done.
13397         * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
13398         (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
13400         * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
13401         Now ptrdiff_t, not int.
13402         * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
13403         (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
13405         * process.c (Fnetwork_interface_list): Check for overflow
13406         in size calculation.
13408         * region-cache.c (move_cache_gap): Check for size calculation overflow.
13410         * scroll.c (do_line_insertion_deletion_costs): Check for size calc
13411         overflow.  Don't bother calling xmalloc when xrealloc will do.
13413         * search.c (Freplace_match): Check for size calculation overflow.
13414         (Fset_match_data): Don't assume list lengths fit in 'int'.
13416         * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
13417         for command line length.  Do not attempt to address one before the
13418         beginning of an array, as that's not portable.
13420         * term.c (max_frame_lines): Remove; unused.
13421         (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
13422         not int.
13423         (encode_terminal_code, calculate_costs): Check for size
13424         calculation overflow.
13425         (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
13426         table lengths and related sizes.  Don't update size until alloc
13427         done.  Redo calculations to avoid overflow.
13428         (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
13430         * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
13431         subtracting pointers.
13432         (gobble_line): Check for overflow more carefully.  Don't update size
13433         until alloc done.
13435         * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
13436         Don't update size until alloc done.
13437         Redo size calculations to avoid overflow.
13438         Check for size calculation overflow.
13439         (main) [DEBUG]: Fix typo in invoking tparam1.
13441         * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
13442         Use ptrdiff_t, not int, for sizes.
13443         (store_mode_line_noprop_char): Don't update size until alloc done.
13445         * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
13446         Use ptrdiff_t, not int, for sizes.
13447         (Finternal_make_lisp_face, cache_face):
13448         Check for size calculation overflow.
13449         (cache_face): Treat size calculation overflows as if they were
13450         memory exhaustion (the usual treatment), rather than aborting.
13452         * xfns.c (x_encode_text, x_set_name_internal)
13453         (Fx_change_window_property): Use ptrdiff_t, not int, to count
13454         sizes, since they can exceed INT_MAX in size.  Check for size
13455         calculation overflow.
13457         * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
13458         (xg_select): Check for size calculation overflow.
13459         Don't update size until alloc done.
13461         * xrdb.c (get_environ_db): Don't assume path length fits in int,
13462         as sprintf is limited to int lengths.
13464         * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
13465         (X_LONG_MIN): New macros.
13466         Use them to make the following changes clearer.
13467         (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
13468         This change doesn't affect the value now, but it may help remind
13469         future maintainers not to raise the value too much later.
13470         (SELECTION_QUANTUM): Remove, replacing with ...
13471         (selection_quantum): ... new function, which avoids overflow.
13472         All uses changed.
13473         (struct selection_data.size): Now ptrdiff_t, not int, to avoid
13474         assumption that selection length fits in 'int'.
13475         (x_reply_selection_request, x_handle_selection_request)
13476         (x_get_window_property, receive_incremental_selection)
13477         (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
13478         (lisp_data_to_selection_data, clean_local_selection_data):
13479         Use ptrdiff_t, not int, to record length of selection.
13480         (x_reply_selection_request, x_get_window_property)
13481         (receive_incremental_selection, x_property_data_to_lisp):
13482         Redo calculations to avoid overflow.
13483         (x_reply_selection_request): When sending hint, ceiling it at
13484         X_LONG_MAX rather than relying on wraparound overflow to send
13485         something.
13486         (x_get_window_property, receive_incremental_selection)
13487         (lisp_data_to_selection_data, x_property_data_to_lisp):
13488         Check for size-calculation overflow.
13489         (x_get_window_property, receive_incremental_selection)
13490         (lisp_data_to_selection_data, Fx_register_dnd_atom):
13491         Don't store size until memory allocation succeeds.
13492         (x_get_window_property): Plug memory leak on memory exhaustion.
13493         Don't double-block input; malloc is safe here.  Don't assume 2**34
13494         - 4 fits in unsigned long.  Add an xassert to check
13495         XGetWindowProperty overflow.  Be more careful about overflow
13496         calculations, and distinguish size from memory overflow better.
13497         (receive_incremental_selection): When tracing, don't assume
13498         unsigned int is less than INT_MAX.
13499         (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
13500         harmful) conversions of unsigned short to int.
13501         (lisp_data_to_selection_data): Don't assume that integers
13502         in the range -65535 through -1 fit in an X unsigned short.
13503         Don't assume that ULONG_MAX == X_ULONG_MAX.  Don't store into
13504         result parameters unless successful.  Rely on cons_to_unsigned
13505         to report problems with elements; the old code wasn't right anyway.
13506         (x_check_property_data): Check for int overflow; we cannot use
13507         a wider type due to X limits.
13508         (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
13510         * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
13512         * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
13513         (x_term_init): Check for size calculation overflow.
13514         (x_color_cells): Don't store size until memory allocation succeeds.
13515         (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
13516         Don't assume alloca size is less than MAX_ALLOCA.
13517         (x_term_init): Don't assume length fits in int (sprintf is limited
13518         to int size).
13520         Use ptrdiff_t for composition IDs.
13521         * character.c (lisp_string_width):
13522         * composite.c (composition_table_size, n_compositions)
13523         (get_composition_id, composition_gstring_from_id):
13524         * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
13525         * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
13526         * window.c (Frecenter):
13527         Use ptrdiff_t, not int, for composition IDs.
13528         * composite.c (get_composition_id): Check for integer overflow.
13529         * composite.h: Adjust prototypes to match the above changes.
13531         Use ptrdiff_t for hash table indexes.
13532         * category.c (hash_get_category_set):
13533         * ccl.c (ccl_driver):
13534         * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
13535         * coding.c (coding_system_charset_list, detect_coding_system):
13536         * coding.h (struct coding_system.id):
13537         * composite.c (get_composition_id, gstring_lookup_cache):
13538         * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
13539         * image.c (xpm_get_color_table_h):
13540         * lisp.h (hash_lookup, hash_put):
13541         * minibuf.c (Ftest_completion):
13542         Use ptrdiff_t for hash table indexes, not int (which is too
13543         narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
13544         32-bit --with-wide-int hosts).
13546         * charset.c (Fdefine_charset_internal): Check for integer overflow.
13547         Add a FIXME comment about memory leaks.
13548         (syms_of_charset): Don't assume xmalloc returns.
13550         Don't assume that stated character widths fit in int.
13551         * character.c (Fchar_width, c_string_width, lisp_string_width):
13552         * character.h (CHAR_WIDTH):
13553         * indent.c (MULTIBYTE_BYTES_WIDTH):
13554         Use sanitize_char_width to avoid undefined and/or bad behavior
13555         with outlandish widths.
13556         * character.h (sanitize_tab_width): Rename from sanitize_width,
13557         now that we have two such functions.  All uses changed.
13558         (sanitize_char_width): New inline function.
13560         Don't assume that tab-width fits in int.
13561         * character.h (sanitize_width): New inline function.
13562         (SANE_TAB_WIDTH): New macro.
13563         (ASCII_CHAR_WIDTH): Use it.
13564         * indent.c (sane_tab_width): Remove.  All uses replaced by
13565         SANE_TAB_WIDTH (current_buffer).
13566         * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
13568         * fileio.c: Integer overflow issues with file modes.
13569         (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
13571         * charset.c (read_hex): New arg OVERFLOW.  All uses changed.
13572         Remove unreachable code.
13573         (read_hex, load_charset_map_from_file): Check for integer overflow.
13575         * xterm.c: Don't go over XClientMessageEvent limit.
13576         (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
13577         (x_send_scroll_bar_event): Likewise.  Check that the size does not
13578         exceed limits imposed by XClientMessageEvent, as well as the usual
13579         ptrdiff_t and size_t limits.
13581         * keyboard.c: Overflow, signedness and related fixes.
13582         (make_lispy_movement): Use same integer type in forward decl
13583         that is used in the definition.
13584         (read_key_sequence, keyremap_step):
13585         Change bufsize argument back to int, undoing my 2011-03-30 change.
13586         We prefer signed types, and int is wide enough here.
13587         (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
13588         than TYPE_MAXIMUM (EMACS_INT) / 2.  Don't let the label size grow
13589         larger than STRING_BYTES_BOUND.  Use ptrdiff_t for Emacs string
13590         length, not size_t.  Use ptrdiff_t for index, not int.
13591         (keyremap_step, read_key_sequence): Redo bufsize check to avoid
13592         possibility of integer overflow.
13594         Overflow, signedness and related fixes for images.
13596         * dispextern.h (struct it.stack[0].u.image.image_id)
13597         (struct_it.image_id, struct image.id, struct image_cache.size)
13598         (struct image_cache.used, struct image_cache.ref_count):
13599         * gtkutil.c (update_frame_tool_bar):
13600         * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
13601         (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
13602         (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
13603         * nsmenu.m (update_frame_tool_bar):
13604         * xdisp.c (calc_pixel_width_or_height):
13605         * xfns.c (image_cache_refcount):
13606         Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
13607         on typical 64-bit hosts.
13609         * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
13610         (x_bitmap_pixmap, x_create_x_image_and_pixmap):
13611         Omit unnecessary casts to int.
13612         (parse_image_spec): Check that integers fall into 'int' range
13613         when the callers expect that.
13614         (image_ascent): Redo ascent calculation to avoid int overflow.
13615         (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
13616         (lookup_image): Remove unnecessary tests.
13617         (xbm_image_p): Locals are now of int, not EMACS_INT,
13618         since parse_image_check makes sure they fit into int.
13619         (png_load, gif_load, svg_load_image):
13620         Prefer int to unsigned where either will do.
13621         (tiff_handler): New function, combining the cores of the
13622         old tiff_error_handler and tiff_warning_handler.
13623         This function is rewritten to use vsnprintf and thereby avoid
13624         stack buffer overflows.  It uses only the features of vsnprintf
13625         that are common to both POSIX and native Microsoft.
13626         (tiff_error_handler, tiff_warning_handler): Use it.
13627         (tiff_load, gif_load, imagemagick_load_image):
13628         Don't assume :index value fits in 'int'.
13629         (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
13630         (imagemagick_load_image): Check that crop parameters fit into
13631         the integer types that MagickCropImage accepts.  Don't assume
13632         Vimagemagick_render_type has a nonnegative value.  Don't assume
13633         size_t fits in 'long'.
13634         (gs_load): Use printmax_t to print the widest integers possible.
13635         Check for integer overflow when computing image height and width.
13637 2011-08-26  Eli Zaretskii  <eliz@gnu.org>
13639         * xdisp.c (redisplay_window): Don't force window start if point
13640         will be invisible in the resulting window.  (Bug#9324)
13642 2011-08-25  Eli Zaretskii  <eliz@gnu.org>
13644         * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
13645         the display spec is of the form `(space ...)'.
13646         (handle_display_spec): Return the value returned by
13647         handle_single_display_spec, not just 1 or zero.
13648         (handle_single_display_spec): If the display spec is of the form
13649         `(space ...)', and specifies display in the text area, return 2
13650         rather than 1.
13651         (try_cursor_movement): Check for the need to scroll more
13652         accurately, and prefer exact match for point under bidi.
13653         Don't advance `row' beyond the last row of the window.
13655         * dispextern.h (struct bidi_it): Rename the disp_prop_p member
13656         into disp_prop; all users changed.
13658         * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
13659         DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
13660         for the text covered by the display property.
13662 2011-08-25  Chong Yidong  <cyd@stupidchicken.com>
13664         * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
13665         Change return value to nil.
13666         (Frecord_buffer): Delete unused function.
13668 2011-08-24  Eli Zaretskii  <eliz@gnu.org>
13670         * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
13671         buffers, return left-to-right.
13672         (set_cursor_from_row): Consider candidate row a win if its glyph
13673         represents a newline and point is on that newline.  Fixes cursor
13674         positioning on the newline at EOL of R2L text within L2R
13675         paragraph, and vice versa.
13676         (try_cursor_movement): Check continued rows, in addition to
13677         continuation rows.  Fixes unwarranted scroll when point enters a
13678         continued line of R2L text within an L2R paragraph, or vice versa.
13679         (cursor_row_p): Consider the case of point being equal to
13680         MATRIX_ROW_END_CHARPOS.  Prevents cursor being stuck when moving
13681         from the end of a short line to the beginning of a continued line
13682         of R2L text within L2R paragraph.
13683         (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
13684         composed characters.
13686         * bidi.c (bidi_check_type): Use xassert.
13687         (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
13688         members.
13690 2011-08-23  Eli Zaretskii  <eliz@gnu.org>
13692         * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
13693         a character.
13695 2011-08-23  Chong Yidong  <cyd@stupidchicken.com>
13697         * nsfont.m (ns_otf_to_script): Fix typo.
13699 2011-08-22  Kenichi Handa  <handa@m17n.org>
13701         * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
13702         extra slot even if the purpose is char-code-property-table.
13704 2011-08-23  Eli Zaretskii  <eliz@gnu.org>
13706         * xdisp.c (redisplay_window): When computing centering_position,
13707         account for the height of the header line.  (Bug#8874)
13709         * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
13710         instead of CHAR_TO_BYTE.  Fixes a crash when a completion
13711         candidate is selected by the mouse, and that candidate has a
13712         composed character under the mouse.
13714         * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1.  Fixes pixel
13715         coordinates reported by pos-visible-in-window-p for a composed
13716         character in column zero.
13718 2011-08-23  Stefan Monnier  <monnier@iro.umontreal.ca>
13720         * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
13722 2011-08-22  Eli Zaretskii  <eliz@gnu.org>
13724         * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
13725         consider it a hit if to_charpos is anywhere in the range of the
13726         composed buffer positions.
13728 2011-08-22  Chong Yidong  <cyd@stupidchicken.com>
13730         * image.c (gif_load): Don't assume that each subimage has the same
13731         dimensions as the base image.  Handle disposal method that is
13732         "undefined" by the gif spec (Bug#9335).
13734 2011-08-20  Chong Yidong  <cyd@stupidchicken.com>
13736         * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
13737         (Fcondition_case): Document `debug' symbol in error handler.
13739 2011-08-19  Eli Zaretskii  <eliz@gnu.org>
13741         * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
13742         face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
13743         from an Org mode buffer to a Speedbar frame.
13745         * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
13746         a composition, take its buffer position from IT->cmp_it.charpos.
13747         Fixes cursor positioning at the beginning of a line that begins
13748         with a composed character.
13750 2011-08-18  Eli Zaretskii  <eliz@gnu.org>
13752         * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
13753         character bidirectional type, use STRONG_L instead.  Fixes crashes
13754         in a buffer produced by `describe-categories'.
13756         * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
13757         members before the level stack, so they would be saved and
13758         restored when copying iterator state.  Fixes incorrect reordering
13759         around TABs covered by display properties.
13761 2011-08-18  Andreas Schwab  <schwab@linux-m68k.org>
13763         * process.c (Fnetwork_interface_list): Correctly determine buffer size.
13765 2011-08-17  Chong Yidong  <cyd@stupidchicken.com>
13767         * eval.c (internal_condition_case, internal_condition_case_1)
13768         (internal_condition_case_2, internal_condition_case_n):
13769         Remove unnecessary aborts (Bug#9081).
13771 2011-08-17  Eli Zaretskii  <eliz@gnu.org>
13773         * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
13774         has no `load' handler, try opening the file locally.  (Bug#9311)
13776 2011-08-16  Ken Brown  <kbrown@cornell.edu>
13778         * gmalloc.c: Expand comment.
13780 2011-08-16  Eli Zaretskii  <eliz@gnu.org>
13782         * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
13783         if it fails the cursor_row_p test.  Fixes cursor positioning at ZV.
13785 2011-08-16  Ken Brown  <kbrown@cornell.edu>
13787         Fix memory allocation problems in Cygwin build (Bug#9273).
13789         * unexcw.c ( __malloc_initialized): Declare external variable.
13790         (fixup_executable): Force the dumped emacs to reinitialize malloc.
13792         * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
13793         New variables.
13794         (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
13795         dumped emacs.
13796         (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
13797         in the static heap.
13798         [CYGWIN] (special_realloc): New function.
13799         (_realloc_internal_nolock) [CYGWIN]: Use the new function on
13800         requests to realloc storage in the static heap.
13802 2011-08-15  Paul Eggert  <eggert@cs.ucla.edu>
13804         * bidi.c (bidi_initialize): Remove unused local.
13806 2011-08-15  Eli Zaretskii  <eliz@gnu.org>
13808         * bidimirror.h:
13809         * biditype.h: Remove file.
13810         * makefile.w32-in ($(BLD)/bidi.$(O)):
13811         * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
13813         * dispextern.h: Fix a typo in the comment to bidi_type_t.
13815         * chartab.c: Improve commentary for the uniprop_table API.
13817         * bidi.c (bidi_paragraph_init): Support zero value of
13818         bidi_ignore_explicit_marks_for_paragraph_level.
13819         (bidi_initialize): Use uniprop_table instead of including
13820         biditype.h and bidimirror.h.
13822         * xdisp.c (move_it_in_display_line_to): Don't reset pixel
13823         coordinates of the iterator when restoring from ppos_it.
13824         (Bug#9296)
13826 2011-08-14  Kenichi Handa  <handa@m17n.org>
13828         * process.c (create_process): Call setup_process_coding_systems
13829         after the pid of the process is set to -1 (Bug#8162).
13831 2011-08-14  Eli Zaretskii  <eliz@gnu.org>
13833         * xdisp.c (move_it_in_display_line_to): Don't invoke
13834         IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
13835         ppos_it.  Fixes vertical cursor motion when line beginning is
13836         covered by an image.  (Bug#9296)
13838 2011-08-14  Jan Djärv  <jan.h.d@swipnet.se>
13840         * nsterm.h (ns_run_ascript): Declare.
13841         (NSAPP_DATA2_RUNASSCRIPT): Define.
13843         * nsfns.m (as_script, as_result, as_status): New static variables.
13844         (ns_run_ascript): New function.
13845         (Fns_do_applescript): Set variables as_*.  Make an NSApplicationDefined
13846         event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
13847         the event loop.  Get status from as_status (Bug#7276).
13849         * nsterm.m (sendEvent): If event is NSApplicationDefined and
13850         data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
13851         the event loop (Bug#7276).
13853 2011-08-14  Andreas Schwab  <schwab@linux-m68k.org>
13855         * gnutls.c (QCgnutls_bootprop_priority)
13856         (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
13857         (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
13858         (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
13859         (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
13860         (QCgnutls_bootprop_verify_hostname_error)
13861         (QCgnutls_bootprop_callbacks_verify): Rename from
13862         Qgnutls_bootprop_..., all uses changed.
13864         * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
13865         uses changed.
13867 2011-08-14  Paul Eggert  <eggert@cs.ucla.edu>
13869         * xfaces.c (Qframe_set_background_mode): Now static.
13870         * dispextern.h (Qframe_set_background_mode): Remove decl.
13872         * process.c (Fnetwork_interface_info): Declare local only if needed.
13874 2011-08-13  Jan Djärv  <jan.h.d@swipnet.se>
13876         * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
13877         (Fnetwork_interface_list): Allocate in increments of bytes instead
13878         of sizeof (struct ifreq).  Iterate over ifconf.ifc_req by counting
13879         bytes (Bug#8477).  Count bytes correctly when ifr_addr is a struct
13880         sockaddr.
13881         (struct ifflag_def): notrailers is smart on OSX.
13882         (Fnetwork_interface_info): Handle case when ifr_flags is negative.
13883         Get hardware address with getifaddrs if available.
13885 2011-08-12  Eli Zaretskii  <eliz@gnu.org>
13887         * xdisp.c (iterate_out_of_display_property): xassert that
13888         IT->position is set to within IT->object's boundaries.  Break from
13889         the loop as soon as EOB is reached; avoids infloops in redisplay
13890         when IT->position is set up wrongly due to some bug.
13891         Set IT->current to match the bidi iterator unconditionally.
13892         (push_display_prop): Allow GET_FROM_STRING as IT->method on
13893         entry.  Force push_it to save on the stack the current
13894         buffer/string position, to be restored by pop_it.  Fix flags in
13895         the iterator structure wrt the object coming from a display
13896         property, as `line-prefix' and `wrap-prefix' are not ``replacing''
13897         properties.  (Bug#9284)
13899 2011-08-09  Andreas Schwab  <schwab@linux-m68k.org>
13901         * fontset.c (fontset_get_font_group): Add proper type checks.
13902         (Bug#9172)
13904 2011-08-09  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
13906         * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
13907         and LC_VERSION_MIN_MACOSX.
13908         (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
13909         (dump_it) [LC_FUNCTION_STARTS]: Use it.
13911 2011-08-08  Eli Zaretskii  <eliz@gnu.org>
13913         * xdisp.c (forward_to_next_line_start): Allow to use the
13914         no-display-properties-and-no-overlays under bidi display.
13915         Set disp_pos in the bidi iterator to avoid searches for display
13916         properties and overlays.
13918 2011-08-08  Chong Yidong  <cyd@stupidchicken.com>
13920         * editfns.c (Fset_time_zone_rule): Document relationship with the
13921         setenv function.
13923         * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
13924         the font entity extracted from the cache (Bug#8109).
13926 2011-08-07  Chong Yidong  <cyd@stupidchicken.com>
13928         * composite.c (autocmp_chars): Don't reset point.  That is done by
13929         restore_point_unwind (Bug#5984).
13931 2011-08-07  Juri Linkov  <juri@jurta.org>
13933         * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
13934         to show the arg `TIME' instead of `TIMEVAL'.
13936 2011-08-06  Eli Zaretskii  <eliz@gnu.org>
13938         * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
13939         display property strides EOL and includes a newline, as in
13940         longlines-mode.  (Bug#9254)
13941         (move_it_in_display_line_to): Fix vertical-motion in a buffer with
13942         word-wrap under bidirectional display.  (Bug#9224)
13944         * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
13945         is non-zero, even if the data buffer is NULL.  Fixes a crash in
13946         vertical-motion with longlines-mode.  (Bug#9254)
13948 2011-08-05  Eli Zaretskii  <eliz@gnu.org>
13950         * bidi.c <bidi_cache_total_alloc>: Now static.
13951         (bidi_initialize): Initialize bidi_cache_total_alloc.
13953         * xdisp.c (display_line): Release buffer allocated for shelved bidi
13954         cache.  (Bug#9221)
13956         * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
13957         amount allocated this far in `bidi_cache_total_alloc'.
13958         (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
13959         non-zero, only free the data buffer without restoring the cache
13960         contents.  All callers changed.
13962         * dispextern.h (bidi_unshelve_cache): Update prototype.
13964         * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
13965         (move_it_in_display_line, move_it_to)
13966         (move_it_vertically_backward, move_it_by_lines): Replace the call
13967         to xfree to an equivalent call to bidi_unshelve_cache.
13968         (move_it_in_display_line_to): Fix logic of returning
13969         MOVE_POS_MATCH_OR_ZV in the bidi case.  (Bug#9224)
13971 2011-08-05  Eli Zaretskii  <eliz@gnu.org>
13973         * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
13974         came from a string character with a `cursor' property.  (Bug#9229)
13976 2011-08-04  Jan Djärv  <jan.h.d@swipnet.se>
13978         * Makefile.in (LIB_PTHREAD): New variable.
13979         (LIBES): Add LIB_PTHREAD (Bug#9216).
13981         * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
13982         Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
13984 2011-08-04  Andreas Schwab  <schwab@linux-m68k.org>
13986         * regex.c (re_iswctype): Remove some redundant boolean conversions.
13988 2011-08-04  Jan Djärv  <jan.h.d@swipnet.se>
13990         * xterm.c (x_find_topmost_parent): New function.
13991         (x_set_frame_alpha): Find topmost parent window with
13992         x_find_topmost_parent and set the property there also (bug#9181).
13993         (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
13995 2011-08-04  Paul Eggert  <eggert@cs.ucla.edu>
13997         * callproc.c (Fcall_process): Avoid vfork clobbering
13998         the local vars buffer, coding_systems, current_dir.
14000 2011-08-03  Stefan Monnier  <monnier@iro.umontreal.ca>
14002         * keymap.c (Fmake_composed_keymap): Move to subr.el.
14004 2011-08-03  Paul Eggert  <eggert@cs.ucla.edu>
14006         * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
14007         so that it is not optimized away.
14009         * xdisp.c (compute_display_string_pos): Remove unused local.
14011 2011-08-02  Eli Zaretskii  <eliz@gnu.org>
14013         Fix slow cursor motion and scrolling in large buffers with
14014         selective display, like Org Mode buffers.  (Bug#9218)
14016         * dispextern.h (struct bidi_it): New member disp_prop_p.
14018         * xdisp.c: Remove one-slot cache of display string positions.
14019         (compute_display_string_pos): Accept an additional argument
14020         DISP_PROP_P; callers changed.  Scan at most 5K characters forward
14021         for a display string or property.  If found, set DISP_PROP_P
14022         non-zero.
14024         * bidi.c (bidi_fetch_char): Accept an additional argument
14025         DISP_PROP_P, and pass it to compute_display_string_pos.
14026         Only handle text covered by a display string if DISP_PROP_P is returned
14027         non-zero.  All callers of bidi_fetch_char changed.
14029 2011-08-02  Stefan Monnier  <monnier@iro.umontreal.ca>
14031         * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
14033 2010-12-03  Don March  <don@ohspite.net>
14035         * keymap.c (Fdefine_key): Fix non-prefix key error message when
14036         last character M-[char] is translated to ESC [char] (bug#7541).
14038 2011-08-02  Kenichi Handa  <handa@m17n.org>
14040         * lisp.h (uniprop_table): Extern it.
14042         * chartab.c (uniprop_table): Make it non-static.
14044 2011-08-01  Eli Zaretskii  <eliz@gnu.org>
14046         * xdisp.c (forward_to_next_line_start): Accept additional argument
14047         BIDI_IT_PREV, and store into it the state of the bidi iterator had
14048         on the newline.
14049         (reseat_at_next_visible_line_start): Use the bidi iterator state
14050         returned by forward_to_next_line_start to restore the state of
14051         it->bidi_it after backing up to previous newline.  (Bug#9212)
14053 2011-07-30  Andreas Schwab  <schwab@linux-m68k.org>
14055         * regex.c (re_comp): Protoize.
14056         (re_exec): Fix return type.
14057         (regexec): Fix type of `ret'.  (Bug#9203)
14059 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
14061         * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
14062         This is needed if max-image-size is a floating-point number.
14064 2011-07-28  Andreas Schwab  <schwab@linux-m68k.org>
14066         * print.c (print_object): Print empty symbol as ##.
14068         * lread.c (read1): Read ## as empty symbol.
14070 2011-07-28  Alp Aker  <alp.tekin.aker@gmail.com>
14072         * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
14073         setting frame foreground color (Bug#9175).
14074         (x_set_background_color): Likewise.
14076         * nsmenu.m (-setText): Size tooltip dimensions precisely to
14077         contents (Bug#9176).
14078         (EmacsTooltip -init): Remove bezels and add shadows to
14079         tooltip windows.
14081         * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
14082         or scroll bar (Bug#8470).
14084         * nsfont.m (nsfont_open): Remove assignment to voffset and
14085         unnecessary vars hshink, expand, hd, full_height, min_height.
14086         (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
14088         * nsterm.h (nsfont_info): Remove voffset field.
14090 2011-07-28  Alp Aker  <alp.tekin.aker@gmail.com>
14092         Implement strike-through and overline on NextStep (Bug#8863).
14094         * nsfont.m (nsfont_open): Use underline position provided by font,
14095         instead of hard-coded value of 2.
14096         (nsfont_draw): Call ns_draw_text_decoration instead.
14098         * nsterm.h: Add declaration for ns_draw_text_decoration.
14100         * nsterm.m (ns_draw_text_decoration): New function for drawing
14101         underline, overline, and strike-through.
14102         (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
14103         ns_draw_text_decoration.  Change treatment of cursor drawing to
14104         accommodate underlining, etc.
14106 2011-07-28  Eli Zaretskii  <eliz@gnu.org>
14108         * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
14109         default.
14111 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
14113         * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
14114         Without this fix, if a signal arrives just after memory fills up,
14115         'malloc' might be invoked reentrantly.
14117         * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
14118         In other words, assume that every image size is allowed, on non-X
14119         hosts.  This assumption is probably wrong, but it lets Emacs compile.
14121 2011-07-28  Andreas Schwab  <schwab@linux-m68k.org>
14123         * regex.c (re_iswctype): Convert return values to boolean.
14125 2011-07-28  Eli Zaretskii  <eliz@fencepost.gnu.org>
14127         * xdisp.c (compute_display_string_pos): Don't use cached display
14128         string position if the buffer had its restriction changed.
14129         (Bug#9184)
14131 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
14133         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14135 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
14137         Integer signedness and overflow and related fixes.  (Bug#9079)
14139         * bidi.c: Integer size and overflow fixes.
14140         (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
14141         (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
14142         (bidi_cache_find_level_change, bidi_cache_ensure_space)
14143         (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
14144         (bidi_find_other_level_edge):
14145         Use ptrdiff_t instead of EMACS_INT where either will do.
14146         This works better on 32-bit hosts configured --with-wide-int.
14147         (bidi_cache_ensure_space): Check for size-calculation overflow.
14148         Use % rather than repeated addition, for better worst-case speed.
14149         Don't set bidi_cache_size until after xrealloc returns, because it
14150         might not return.
14151         (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
14152         (bidi_cache_ensure_space): Also check that the bidi cache size
14153         does not exceed that of the largest Lisp string or buffer.  See Eli
14154         Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
14156         * alloc.c (__malloc_size_t): Remove.
14157         All uses replaced by size_t.  See Andreas Schwab's note
14158         <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
14160         * image.c: Improve checking for integer overflow.
14161         (check_image_size): Assume that f is nonnull, since
14162         it is always nonnull in practice.  This is one less thing to
14163         worry about when checking for integer overflow later.
14164         (x_check_image_size): New function, which checks for integer
14165         overflow issues inside X.
14166         (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
14167         This removes the need for a memory_full check.
14168         (xbm_image_p): Rewrite to avoid integer multiplication overflow.
14169         (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
14170         (xbm_read_bitmap_data): Change locals back to 'int', since
14171         their values must fit in 'int'.
14172         (xpm_load_image, png_load, tiff_load):
14173         Invoke x_create_x_image_and_pixmap earlier,
14174         to avoid much needless work if the image is too large.
14175         (tiff_load): Treat overly large images as if
14176         x_create_x_image_and_pixmap failed, not as malloc failures.
14177         (gs_load): Use x_check_image_size.
14179         * gtkutil.c: Omit integer casts.
14180         (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
14181         (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
14183         * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
14185         * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
14186         Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
14187         would wrongly return t on a 64-bit host.
14189         * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
14190         The plain *_OVERFLOW macros run afoul of GCC bug 49705
14191         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
14192         and therefore cause GCC to emit a bogus diagnostic in some cases.
14194         * image.c: Integer signedness and overflow and related fixes.
14195         This is not an exhaustive set of fixes, but it's time to
14196         record what I've got.
14197         (lookup_pixel_color, check_image_size): Remove redundant decls.
14198         (check_image_size): Don't assume that arbitrary EMACS_INT values
14199         fit in 'int', or that arbitrary 'double' values fit in 'int'.
14200         (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
14201         (tiff_load, imagemagick_load_image):
14202         Check for overflow in size calculations.
14203         (x_create_x_image_and_pixmap): Remove unnecessary test for
14204         xmalloc returning NULL; that can't happen.
14205         (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
14206         (xpm_color_bucket): Use better integer hashing function.
14207         (xpm_cache_color): Don't possibly over-allocate memory.
14208         (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
14209         (gif_memory_source):
14210         Use ptrdiff_t, not int or size_t, to record sizes.
14211         (png_load): Don't assume values greater than 2**31 fit in 'int'.
14212         (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
14213         either works, as we prefer signed integers.
14214         (tiff_read_from_memory, tiff_write_from_memory):
14215         Return tsize_t, not size_t, since that's what the TIFF API wants.
14216         (tiff_read_from_memory): Don't fail simply because the read would
14217         go past EOF; instead, return a short read.
14218         (tiff_load): Omit no-longer-needed casts.
14219         (Fimagemagick_types): Don't assume size fits into 'int'.
14221         Improve hashing quality when configured --with-wide-int.
14222         * fns.c (hash_string): New function, taken from sxhash_string.
14223         Do not discard information about ASCII character case; this
14224         discarding is no longer needed.
14225         (sxhash-string): Use it.  Change sig to match it.  Caller changed.
14226         * lisp.h: Declare it.
14227         * lread.c (hash_string): Remove, since we now use fns.c's version.
14228         The fns.c version returns a wider integer if --with-wide-int is
14229         specified, so this should help the quality of the hashing a bit.
14231         * emacs.c: Integer overflow minor fix.
14232         (heap_bss_diff): Now uprintmax_t, not unsigned long.  All used changed.
14233         Define only if GNU_LINUX.
14234         (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
14236         * dispnew.c: Integer signedness and overflow fixes.
14237         Remove unnecessary forward decls, that were a maintenance hassle.
14238         (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
14239         All uses changed.
14240         (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
14241         (scrolling_window): Use ptrdiff_t, not int, for byte count.
14242         (prepare_desired_row, line_draw_cost):
14243         Use int, not unsigned, where either works.
14244         (save_current_matrix, restore_current_matrix):
14245         Use ptrdiff_t, not size_t, where either works.
14246         (init_display): Check for overflow more accurately, and without
14247         relying on undefined behavior.
14249         * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
14250         Remove, replacing with the new symbols in lisp.h.  All uses changed.
14251         * fileio.c (make_temp_name):
14252         * filelock.c (lock_file_1, lock_file):
14253         * xdisp.c (message_dolog):
14254         Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
14255         Use pMd etc. instead.
14256         * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
14257         replacing the pWIDE etc. symbols removed from editfns.c.
14259         * keyboard.h (num_input_events): Now uintmax_t.
14260         This is (very slightly) less likely to mess up due to wraparound.
14261         All uses changed.
14263         * buffer.c: Integer signedness fixes.
14264         (alloc_buffer_text, enlarge_buffer_text):
14265         Use ptrdiff_t rather than size_t when either will do, as we prefer
14266         signed integers.
14268         * alloc.c: Integer signedness and overflow fixes.
14269         Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
14270         (__malloc_size_t): Default to size_t, not to int.
14271         (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
14272         (Fgarbage_collect, mark_object_loop_halt, mark_object):
14273         Prefer ptrdiff_t to size_t when either would do, as we prefer
14274         signed integers.
14275         (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
14276         (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
14277         Now const.  Initialize with values that are in range even if char
14278         is signed.
14279         (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
14280         (xmalloc_put_size, xmalloc_get_size): New functions.  All uses changed.
14281         These functions do the right thing with sizes > 2**32.
14282         (check_depth): Now ptrdiff_t, not int.
14283         (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
14284         Adjust to new way of storing sizes.  Check for size overflow bugs
14285         in rest of code.
14286         (STRING_BYTES_MAX): Adjust to new overheads.  The old code was
14287         slightly wrong anyway, as it missed one instance of
14288         XMALLOC_OVERRUN_CHECK_OVERHEAD.
14289         (refill_memory_reserve): Omit needless cast to size_t.
14290         (mark_object_loop_halt): Mark as externally visible.
14292         * xselect.c: Integer signedness and overflow fixes.
14293         (Fx_register_dnd_atom, x_handle_dnd_message):
14294         Use ptrdiff_t, not size_t, since we prefer signed.
14295         (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
14296         * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
14297         x_dnd_atoms_size and x_dnd_atoms_length.
14299         * doprnt.c: Prefer signed to unsigned when either works.
14300         * eval.c (verror):
14301         * doprnt.c (doprnt):
14302         * lisp.h (doprnt):
14303         * xdisp.c (vmessage):
14304         Use ptrdiff_t, not size_t, when using or implementing doprnt,
14305         since the sizes cannot exceed ptrdiff_t bounds anyway, and we
14306         prefer signed arithmetic to avoid comparison confusion.
14307         * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
14308         but is a bit tricky.
14310         Assume freestanding C89 headers, string.h, stdlib.h.
14311         * data.c, doprnt.c, floatfns.c, print.c:
14312         Include float.h unconditionally.
14313         * gmalloc.c: Assume C89-at-least behavior for preprocessor,
14314         limits.h, stddef.h, string.h.  Use memset instead of 'flood'.
14315         * regex.c: Likewise for stddef.h, string.h.
14316         (ISASCII): Remove; can assume it returns 1 now.  All uses removed.
14317         * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
14318         * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
14319         (STDC_HEADERS): Remove obsolete defines.
14320         * sysdep.c: Include limits.h unconditionally.
14322         Assume support for memcmp, memcpy, memmove, memset.
14323         * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
14324         * regex.c (memcmp, memcpy):
14325         Remove; we assume C89 now.
14327         * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
14328         (__malloc_safe_bcopy): Remove; no longer needed.
14330         * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
14331         Use EMACS_INT, not EMACS_UINT, for sizes.  The code works equally
14332         well either way, and we prefer signed to unsigned.
14334 2011-07-27  Lars Magne Ingebrigtsen  <larsi@gnus.org>
14336         * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
14337         closes the connection while we're reading (bug#9182).
14339 2011-07-25  Jan Djärv  <jan.h.d@swipnet.se>
14341         * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
14342         are specified (Bug#9168).
14344 2011-07-25  Paul Eggert  <eggert@cs.ucla.edu>
14346         * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
14347         Found by GCC static checking and --with-wide-int on a 32-bit host.
14349 2011-07-25  Eli Zaretskii  <eliz@gnu.org>
14351         * xdisp.c (compute_display_string_pos): Fix logic of caching
14352         previous display string position.  Initialize cached_prev_pos to
14353         -1.  Fixes slow-down at the beginning of a buffer.
14355 2011-07-24  Eli Zaretskii  <eliz@gnu.org>
14357         * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
14358         for attrs[LFACE_FONTSET_INDEX].
14360 2011-07-23  Paul Eggert  <eggert@cs.ucla.edu>
14362         * xml.c (parse_region): Remove unused local
14363         that was recently introduced.
14365 2011-07-23  Eli Zaretskii  <eliz@gnu.org>
14367         * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
14368         2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
14370         * xdisp.c (move_it_in_display_line_to): Record the best matching
14371         position for TO_CHARPOS while scanning the line, and restore it on
14372         exit if none of the characters scanned was an exact match.
14373         Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
14374         when exact match is impossible due to invisible text, and the
14375         lines are truncated.
14377 2011-07-23  Jan Djärv  <jan.h.d@swipnet.se>
14379         * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
14380         for OSX >= 10.7.
14382 2011-07-22  Eli Zaretskii  <eliz@gnu.org>
14384         Fix a significant slow-down of cursor motion with C-n, C-p,
14385         C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
14386         auto-repeat under bidi redisplay in fontified buffers.
14387         * xdisp.c (compute_stop_pos_backwards): New function.
14388         (next_element_from_buffer): Call compute_stop_pos_backwards to
14389         find a suitable prev_stop when we find ourselves before
14390         base_level_stop.
14391         (reseat): Don't look for prev_stop, as that could mean a very long
14392         run.
14393         <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
14394         <cached_disp_overlay_modiff>: Cache for last found display string
14395         position.
14396         (compute_display_string_pos): Return the cached position if asked
14397         about the same buffer in the same area of character positions, and
14398         the buffer wasn't changed since the time the display string
14399         position was cached.
14401 2011-07-22  Eli Zaretskii  <eliz@gnu.org>
14403         * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
14404         is an integer, which is important for empty lines.  (Bug#9149)
14406 2011-07-22  Chong Yidong  <cyd@stupidchicken.com>
14408         * frame.c (Fmodify_frame_parameters): In tty case, update the
14409         default face if necessary (Bug#4238).
14411 2011-07-21  Chong Yidong  <cyd@stupidchicken.com>
14413         * editfns.c (Fstring_to_char): No need to explain what a character
14414         is in the docstring (Bug#6576).
14416 2011-07-20  Lars Magne Ingebrigtsen  <larsi@gnus.org>
14418         * xml.c (parse_region): Make sure we always return a tree.
14420 2011-07-20  HAMANO Kiyoto  <khiker.mail@gmail.com>
14422         * xml.c (parse_region): If a document contains only comments,
14423         return that, too.
14425 2011-07-20  Lars Magne Ingebrigtsen  <larsi@gnus.org>
14427         * xml.c (make_dom): Return comments, too.
14429 2011-07-19  Paul Eggert  <eggert@cs.ucla.edu>
14431         Port to OpenBSD.
14432         See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
14433         and the surrounding thread.
14434         * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
14435         rather than fgets, and retry after EINTR.  Otherwise, 'emacs
14436         --batch -f byte-compile-file' fails on OpenBSD if an inactivity
14437         timer goes off.
14438         * s/openbsd.h (BROKEN_SIGIO): Define.
14439         * unexelf.c (unexec) [__OpenBSD__]:
14440         Don't update the .mdebug section of the Alpha COFF symbol table.
14442 2011-07-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
14444         * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
14445         (bug#8460).
14447 2011-07-18  Paul Eggert  <eggert@cs.ucla.edu>
14449         * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
14450         This fixes some race conditions on the permissions of any newly
14451         created file.
14453         * alloc.c (valid_pointer_p): Use pipe, not open.
14454         This fixes some permissions issues when debugging.
14456         * fileio.c (Fcopy_file): Adjust mode if fchown fails.  (Bug#9002)
14457         If fchown fails to set both uid and gid, try to set just gid,
14458         as that is sometimes allowed.  Adjust the file's mode to eliminate
14459         setuid or setgid bits that are inappropriate if fchown fails.
14461 2011-07-18  Stefan Monnier  <monnier@iro.umontreal.ca>
14463         * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
14464         to compare Lisp_Objects.
14465         * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
14466         global_gnutls_log_level, don't mistake it for a Lisp_Object.
14467         (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
14469 2011-07-17  Andreas Schwab  <schwab@linux-m68k.org>
14471         * lread.c (read_integer): Unread even EOF character.
14472         (read1): Likewise.  Properly record start position of symbol.
14474         * lread.c (read1): Read `#:' as empty uninterned symbol if no
14475         symbol character follows.
14477 2011-07-17  Paul Eggert  <eggert@cs.ucla.edu>
14479         * fileio.c (Fcopy_file): Pacify gcc re fchown.  (Bug#9002)
14480         This works around a problem with the previous change to Fcopy_file.
14481         Recent glibc declares fchown with __attribute__((warn_unused_result)),
14482         and without this change, GCC might complain about discarding
14483         fchown's return value.
14485 2011-07-16  Juanma Barranquero  <lekktu@gmail.com>
14487         * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
14489 2011-07-16  Paul Eggert  <eggert@cs.ucla.edu>
14491         * fileio.c (Fcopy_file): Don't diagnose fchown failures.  (Bug#9002)
14493 2011-07-16  Lars Magne Ingebrigtsen  <larsi@gnus.org>
14495         * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
14496         it's used from the C level.
14498         * process.c: Use the same condition for POLL_FOR_INPUT in both
14499         keyboard.c and process.c (bug#1858).
14501 2011-07-09  Lawrence Mitchell  <wence@gmx.li>
14503         * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
14504         (Fgnutls_boot): Use it.
14506 2011-07-15  Andreas Schwab  <schwab@linux-m68k.org>
14508         * doc.c (Fsubstitute_command_keys): Revert last change.
14510 2011-07-15  Lars Magne Ingebrigtsen  <larsi@gnus.org>
14512         * doc.c (Fsubstitute_command_keys): Clarify that \= really only
14513         quotes the next character, and doesn't affect other longer
14514         sequences (bug#8935).
14516         * lread.c (syms_of_lread): Clarify that is isn't only
14517         `eval-buffer' and `eval-defun' that's affected by
14518         `lexical-binding' (bug#8460).
14520 2011-07-15  Eli Zaretskii  <eliz@gnu.org>
14522         * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
14523         bidi redisplay when a line includes both an image and is truncated.
14525 2011-07-14  Paul Eggert  <eggert@cs.ucla.edu>
14527         Fix minor problems found by static checking.
14528         * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
14529         (elsz): Now a signed constant, not a size_t var.  We prefer signed
14530         types to unsigned, to avoid integer comparison confusion.  Without
14531         this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
14532         "cannot optimize loop, the loop counter may overflow", a symptom
14533         of the confusion.
14534         * indent.c (Fvertical_motion): Mark locals as initialized.
14535         * xdisp.c (reseat_to_string): Fix pointer signedness issue.
14537 2011-07-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
14539         * search.c (Fre_search_backward): Mention `case-fold-search' in
14540         all the re_search_* functions (bug#8138).
14542         * keyboard.c (Fopen_dribble_file): Document when the file is
14543         closed (bug#8056).
14545 2011-07-14  Eli Zaretskii  <eliz@gnu.org>
14547         * bidi.c (bidi_dump_cached_states): Fix format of displaying
14548         bidi_cache_idx.
14550         Support bidi reordering of display and overlay strings.
14551         * xdisp.c (compute_display_string_pos)
14552         (compute_display_string_end): Accept additional argument STRING.
14553         (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
14554         (reseat_to_string): Initialize bidi_it->string.s and
14555         bidi_it->string.schars.
14556         (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
14557         NULL (avoids a crash in bidi_paragraph_init).
14558         Initialize itb.string.lstring.
14559         (init_iterator): Call bidi_init_it only of a valid
14560         buffer position was specified.  Initialize paragraph_embedding to
14561         L2R.
14562         (reseat_to_string): Initialize the bidi iterator.
14563         (display_string): If we need to ignore text properties of
14564         LISP_STRING, set IT->stop_charpos to IT->end_charpos.  (The
14565         original value of -1 will not work with bidi.)
14566         (compute_display_string_pos): First arg is now struct
14567         `text_pos *'; all callers changed.  Support display properties on
14568         Lisp strings.
14569         (compute_display_string_end): Support display properties on Lisp
14570         strings.
14571         (init_iterator, reseat_1, reseat_to_string): Initialize the
14572         string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
14573         when iterating on a string not from display properties).
14574         (compute_display_string_pos, compute_display_string_end):
14575         Fix calculation of the object to scan.  Fixes an error when using
14576         arrow keys.
14577         (next_element_from_buffer): Don't abort when IT_CHARPOS is before
14578         base_level_stop; instead, set base_level_stop to BEGV.
14579         Fixes crashes in vertical-motion.
14580         (next_element_from_buffer): Improve commentary for when
14581         the iterator is before prev_stop.
14582         (init_iterator): Initialize bidi_p from the default value of
14583         bidi-display-reordering, not from buffer-local value.  Use the
14584         buffer-local value only if initializing for buffer iteration.
14585         (handle_invisible_prop): Support invisible properties on strings
14586         that are being bidi-reordered.
14587         (set_iterator_to_next): Support bidi reordering of C strings and
14588         Lisp strings.
14589         (next_element_from_string): Support bidi reordering of Lisp
14590         strings.
14591         (handle_stop_backwards): Support Lisp strings as well.
14592         (display_string): Support display of R2L glyph rows.
14593         Use IT_STRING_CHARPOS when displaying from a Lisp string.
14594         (init_iterator): Don't initialize it->bidi_p for strings
14595         here.
14596         (reseat_to_string): Initialize it->bidi_p for strings here.
14597         (next_element_from_string, next_element_from_c_string)
14598         (next_element_from_buffer): Add xassert's for correspondence
14599         between IT's object being iterated and it->bidi_it.string
14600         structure.
14601         (face_before_or_after_it_pos): Support bidi iteration.
14602         (next_element_from_c_string): Handle the case of the first string
14603         character that is not the first one in the visual order.
14604         (get_visually_first_element): New function, refactored from common
14605         parts of next_element_from_buffer, next_element_from_string, and
14606         next_element_from_c_string.
14607         (tool_bar_lines_needed, redisplay_tool_bar)
14608         (display_menu_bar): Force left-to-right direction.  Add a FIXME
14609         comment for making that be controlled by a user option.
14610         (push_it, pop_it): Save and restore the state of the
14611         bidi iterator.  Save and restore the bidi_p flag.
14612         (pop_it): Iterate out of display property for string iteration as
14613         well.
14614         (iterate_out_of_display_property): Support iteration over strings.
14615         (handle_single_display_spec): Set up it->bidi_it for iteration
14616         over a display string, and call bidi_init_it.
14617         (handle_single_display_spec, next_overlay_string)
14618         (get_overlay_strings_1, push_display_prop): Set up the bidi
14619         iterator for displaying display or overlay strings.
14620         (forward_to_next_line_start): Don't use the shortcut if
14621         bidi-iterating.
14622         (back_to_previous_visible_line_start): If handle_display_prop
14623         pushed the iterator stack, restore the internal state of the bidi
14624         iterator by calling bidi_pop_it same number of times.
14625         (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
14626         and we are bidi-iterating, don't decrement the iterator position;
14627         instead, set the first_elt flag in the bidi iterator, to produce
14628         the same effect.
14629         (reseat_1): Remove redundant setting of string_from_display_prop_p.
14630         (push_display_prop): xassert that we are iterating a buffer.
14631         (push_it, pop_it): Save and restore paragraph_embedding member.
14632         (handle_single_display_spec, next_overlay_string)
14633         (get_overlay_strings_1, reseat_1, reseat_to_string)
14634         (push_display_prop): Set up the `unibyte' member of bidi_it.string
14635         correctly.  Don't assume unibyte strings are not bidi-reordered.
14636         (compute_display_string_pos)
14637         (compute_display_string_end): Fix handling the case of C string.
14638         (push_it, pop_it): Save and restore from_disp_prop_p.
14639         (handle_single_display_spec, push_display_prop): Set the
14640         from_disp_prop_p flag.
14641         (get_overlay_strings_1): Reset the from_disp_prop_p flag.
14642         (pop_it): Call iterate_out_of_display_property only if we are
14643         popping after iteration over a string that came from a display
14644         property.  Fix a typo in popping stretch info.  Add an assertion
14645         for verifying that the iterator position is in sync with the bidi
14646         iterator.
14647         (handle_single_display_spec, get_overlay_strings_1)
14648         (push_display_prop): Fix initialization of paragraph direction for
14649         string when that of the parent object is not yet determined.
14650         (reseat_1): Call bidi_init_it to resync the bidi
14651         iterator with IT's position.  (Bug#7616)
14652         (find_row_edges): If ROW->start.pos gives position
14653         smaller than min_pos, use it as ROW->minpos.  (Bug#7616)
14654         (handle_stop, back_to_previous_visible_line_start, reseat_1):
14655         Reset the from_disp_prop_p flag.
14656         (SAVE_IT, RESTORE_IT): New macros.
14657         (pos_visible_p, face_before_or_after_it_pos)
14658         (back_to_previous_visible_line_start)
14659         (move_it_in_display_line_to, move_it_in_display_line)
14660         (move_it_to, move_it_vertically_backward, move_it_by_lines)
14661         (try_scrolling, redisplay_window, display_line): Use them when
14662         saving a temporary copy of the iterator and restoring it back.
14663         (back_to_previous_visible_line_start, reseat_1)
14664         (init_iterator): Empty the bidi cache "stack".
14665         (move_it_in_display_line_to): If iterator ended up at
14666         EOL, but we never saw any buffer positions smaller than
14667         to_charpos, return MOVE_POS_MATCH_OR_ZV.  Fixes vertical cursor
14668         motion in bidi-reordered lines.
14669         (move_it_in_display_line_to): Record prev_method and prev_pos
14670         immediately before the call to set_iterator_to_next.  Fixes cursor
14671         motion in bidi-reordered lines with stretch glyphs and strings
14672         displayed in margins.  (Bug#8133) (Bug#8867)
14673         Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
14674         TO_CHARPOS.
14675         (pos_visible_p): Support positions in bidi-reordered lines.
14676         Save and restore bidi cache.
14678         * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
14679         (bidi_paragraph_info): Delete unused struct.
14680         (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
14681         (bidi_cache_start): New variable.
14682         (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
14683         to zero.
14684         (bidi_cache_fetch_state, bidi_cache_search)
14685         (bidi_cache_find_level_change, bidi_cache_iterator_state)
14686         (bidi_cache_find, bidi_peek_at_next_level)
14687         (bidi_level_of_next_char, bidi_find_other_level_edge)
14688         (bidi_move_to_visually_next): Compare cache index with
14689         bidi_cache_start rather than with zero.
14690         (bidi_fetch_char): Accept new argument STRING; all callers
14691         changed.  Support iteration over a string.  Support strings with
14692         display properties.  Support unibyte strings.  Fix the type of
14693         `len' according to what STRING_CHAR_AND_LENGTH expects.
14694         (bidi_paragraph_init, bidi_resolve_explicit_1)
14695         (bidi_resolve_explicit, bidi_resolve_weak)
14696         (bidi_level_of_next_char, bidi_move_to_visually_next):
14697         Support iteration over a string.
14698         (bidi_set_sor_type, bidi_resolve_explicit_1)
14699         (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
14700         can now be zero (for strings); special values 0 and -1 were
14701         changed to -1 and -2, respectively.
14702         (bidi_char_at_pos): New function.
14703         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
14704         Call it instead of FETCH_MULTIBYTE_CHAR.
14705         (bidi_move_to_visually_next): Abort if charpos or bytepos were not
14706         initialized to valid values.
14707         (bidi_init_it): Don't initialize charpos and bytepos with invalid
14708         values.
14709         (bidi_level_of_next_char): Allow the sentinel "position" to pass
14710         the test for valid cached positions.  Fix the logic for looking up
14711         the sentinel state in the cache.  GCPRO the Lisp string we are
14712         iterating.
14713         (bidi_push_it, bidi_pop_it): New functions.
14714         (bidi_initialize): Initialize the bidi cache start stack pointer.
14715         (bidi_cache_ensure_space): New function, refactored from part of
14716         bidi_cache_iterator_state.  Don't assume the required size is just
14717         one BIDI_CACHE_CHUNK away.
14718         (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
14719         (bidi_count_bytes, bidi_char_at_pos): New functions.
14720         (bidi_cache_search): Don't assume bidi_cache_last_idx is
14721         always valid if bidi_cache_idx is valid.
14722         (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
14723         is valid if it's going to be used.
14724         (bidi_shelve_cache, bidi_unshelve_cache): New functions.
14725         (bidi_cache_fetch_state, bidi_cache_search)
14726         (bidi_cache_find_level_change, bidi_cache_ensure_space)
14727         (bidi_cache_iterator_state, bidi_cache_find)
14728         (bidi_find_other_level_edge, bidi_cache_start_stack):
14729         All variables related to cache indices are now EMACS_INT.
14731         * dispextern.h (struct bidi_string_data): New structure.
14732         (struct bidi_it): New member `string'.  Make flag members be 1-bit
14733         fields, and put them last in the struct.
14734         (compute_display_string_pos, compute_display_string_end):
14735         Update prototypes.
14736         (bidi_push_it, bidi_pop_it): Add prototypes.
14737         (struct iterator_stack_entry): New members bidi_p,
14738         paragraph_embedding, and from_disp_prop_p.
14739         (struct it): Member bidi_p is now a bit field 1 bit wide.
14740         (bidi_shelve_cache, bidi_unshelve_cache):
14741         Declare prototypes.
14743         * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
14744         (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
14745         and vector-like objects.
14747         * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
14748         cache around display iteration.
14750         * window.c (Fwindow_end, window_scroll_pixel_based)
14751         (displayed_window_lines, Frecenter): Save and restore the bidi
14752         cache around display iteration.
14754 2011-07-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
14756         * editfns.c (Fdelete_region): Clarify the use of the named
14757         parameters (bug#6788).
14759 2011-07-14  Martin Rudalics  <rudalics@gmx.at>
14761         * indent.c (Fvertical_motion): Set and restore w->pointm when
14762         saving and restoring the window's buffer (Bug#9006).
14764 2011-07-13  Lars Magne Ingebrigtsen  <larsi@gnus.org>
14766         * editfns.c (Fstring_to_char): Clarify just what is returned
14767         (bug#6576).  Text by Eli Zaretskii.
14769 2011-07-13  Juanma Barranquero  <lekktu@gmail.com>
14771         * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
14773 2011-07-13  Eli Zaretskii  <eliz@gnu.org>
14775         * buffer.c (mmap_find): Fix a typo.
14777 2011-07-13  Johan Bockgård  <bojohan@gnu.org>
14779         Fix execution of x selection hooks.
14780         * xselect.c (Qx_lost_selection_functions)
14781         (Qx_sent_selection_functions): New vars.
14782         (syms_of_xselect): DEFSYM them.
14783         (x_handle_selection_request): Pass Qx_sent_selection_functions
14784         rather than Vx_sent_selection_functions to Frun_hook_with_args.
14785         (x_handle_selection_clear,x_clear_frame_selections):
14786         Pass Qx_lost_selection_functions rather than
14787         Vx_lost_selection_functions to Frun_hook_with_args.
14789 2011-07-13  Paul Eggert  <eggert@cs.ucla.edu>
14791         * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
14792         The old code sometimes used this field without initializing it.
14794         * alloc.c (gc_sweep): Don't read past end of array.
14795         In theory, the old code could also have corrupted Emacs internals,
14796         though it'd be very unlikely.
14798 2011-07-12  Andreas Schwab  <schwab@linux-m68k.org>
14800         * character.c (Fcharacterp): Don't advertise optional ignored
14801         argument.  (Bug#4026)
14803 2011-07-12  Lars Magne Ingebrigtsen  <larsi@gnus.org>
14805         * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
14806         key" (bug#4257).
14808         * window.c (Fset_window_start): Doc fix (bug#4199).
14809         (Fset_window_hscroll): Ditto.
14811 2011-07-12  Paul Eggert  <eggert@cs.ucla.edu>
14813         Fix minor new problems caught by GCC 4.6.1.
14814         * term.c (init_tty): Remove unused local.
14815         * xsettings.c (store_monospaced_changed): Define this function only
14816         if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
14817         not used otherwise.
14819 2011-07-12  Chong Yidong  <cyd@stupidchicken.com>
14821         * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
14823 2011-07-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
14825         * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
14826         are the mini-buffer and the echo area (bug#3320).
14828         * term.c (init_tty): Remove support for supdup, c10 and perq
14829         terminals, which are no longer supported (bug#1482).
14831 2011-07-10  Johan Bockgård  <bojohan@gnu.org>
14833         * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
14835 2011-07-10  Jan Djärv  <jan.h.d@swipnet.se>
14837         * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
14838         for non-popups (Bug#3642).
14840 2011-07-10  Andreas Schwab  <schwab@linux-m68k.org>
14842         * alloc.c (reset_malloc_hooks): Protoize.
14843         * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
14844         (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
14845         * cm.c (losecursor): Likewise.
14846         * data.c (fmod): Likewise.
14847         * dispnew.c (swap_glyphs_in_rows): Likewise.
14848         * emacs.c (memory_warning_signal): Likewise.
14849         * floatfns.c (float_error): Likewise.
14850         * font.c (check_gstring, check_otf_features, otf_tag_symbol)
14851         (otf_open, font_otf_capability, generate_otf_features)
14852         (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
14853         Likewise.
14854         * image.c (pbm_read_file): Likewise.
14855         * indent.c (string_display_width): Likewise.
14856         * intervals.c (check_for_interval, search_for_interval)
14857         (inc_interval_count, count_intervals, root_interval)
14858         (adjust_intervals_for_insertion, make_new_interval): Likewise.
14859         * lread.c (defalias): Likewise.
14860         * ralloc.c (r_alloc_check): Likewise.
14861         * regex.c (set_image_of_range_1, set_image_of_range)
14862         (regex_grow_registers): Likewise.
14863         * sysdep.c (strerror): Likewise.
14864         * termcap.c (valid_filename_p, tprint, main): Likewise.
14865         * tparam.c (main): Likewise.
14866         * unexhp9k800.c (run_time_remap, save_data_space)
14867         (update_file_ptrs, read_header, write_header, calculate_checksum)
14868         (copy_file, copy_rest, display_header): Likewise.
14869         * widget.c (mark_shell_size_user_specified, create_frame_gcs):
14870         Likewise.
14871         * xdisp.c (check_it): Likewise.
14872         * xfaces.c (register_color, unregister_color, unregister_colors):
14873         Likewise.
14874         * xfns.c (print_fontset_result): Likewise.
14875         * xrdb.c (member, fatal, main): Likewise.
14877 2011-07-10  Paul Eggert  <eggert@cs.ucla.edu>
14879         Fix minor problems found by static checking (Bug#9031).
14880         * chartab.c (char_table_set_range, map_sub_char_table):
14881         Remove unused locals.
14882         (uniprop_table): Now static.
14883         * composite.c (_work_char): Remove unused static var.
14885 2011-07-09  Juanma Barranquero  <lekktu@gmail.com>
14887         * chartab.c (uniprop_table_uncompress): Remove unused local variable.
14889 2011-07-09  Jan Djärv  <jan.h.d@swipnet.se>
14891         * gtkutil.c (qttip_cb): Remove code without function.
14893 2011-07-09  Eli Zaretskii  <eliz@gnu.org>
14895         * w32.c (pthread_sigmask): New stub.
14897 2011-07-08  Paul Eggert  <eggert@cs.ucla.edu>
14899         Use pthread_sigmask, not sigprocmask (Bug#9010).
14900         sigprocmask is portable only for single-threaded applications, and
14901         Emacs can be multi-threaded when it uses GTK.
14902         * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
14903         (LIBES): Use it.
14904         * callproc.c (Fcall_process):
14905         * process.c (create_process):
14906         * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
14907         Use pthread_sigmask, not sigprocmask.
14909 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
14911         * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
14912         (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
14913         wrong (Bug#8591).
14915 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
14917         * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
14918         Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
14919         (xg_hide_tooltip): Fix comment.
14921         * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
14922         in registerServicesMenuSendTypes.
14923         (validRequestorForSendType): Don't check ns_return_types.
14925         * nsfns.m (Fx_open_connection): Put NSStringPboardType into
14926         ns_return_type.
14928 2011-07-08  Jason Rumney  <jasonr@gnu.org>
14930         * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
14931         SH_SHOW for hidden windows (Bug#5482).
14933         * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
14934         frame struct members of non-existent frames (Bug#6284).
14936 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
14938         * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
14939         variable firstTime not needed on OSX >= 10.6.
14940         (setPosition): setFloatValue:knobProportion: is deprecated on OSX
14941         >= 10.5.  Use setKnobProportion, setDoubleValue.
14943         * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
14944         (MAC_OS_X_VERSION_10_5): Define if not defined.
14945         (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
14946         (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
14947         (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
14949         * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
14950         cString and lossyCString on OSX >= 10.4.
14952         * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
14953         sizeToFit on OSX >= 10.2.
14955         * nsimage.m (allocInitFromFile): Don't use deprecated method
14956         bestRepresentationForDevice on OSX >= 10.6.
14958         * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
14959         to avoid warning.
14961         * emacs.c: Declare unexec_init_emacs_zone.
14963         * nsgui.h: Fix compiler warning about gnulib redefining verify.
14965         * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
14967         * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
14968         on svcsMenu (Bug#8842).
14970         * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
14971         ns_return_types.
14972         (Fns_list_services): Just return Qnil on 10.6, code not working there.
14974         * nsterm.m (QUTF8_STRING): Declare.
14975         (initFrameFromEmacs): Call registerServicesMenuSendTypes.
14976         (validRequestorForSendType): Return type is (id).
14977         Change indexOfObjectIdenticalTo to indexOfObject.
14978         Check if we have local selection before returning self (Bug#8842).
14979         (writeSelectionToPasteboard): Put local selection into paste board
14980         if we have a local selection (Bug#8842).
14981         (syms_of_nsterm): DEFSYM QUTF8_STRING.
14983         * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
14984         (ns_get_local_selection): Declare.
14986 2011-07-07  Lars Magne Ingebrigtsen  <larsi@gnus.org>
14988         * keymap.c (describe_map_tree): Don't insert a double newline at
14989         the end of the buffer (bug#1169) and return whether we inserted
14990         something.
14992         * callint.c (Fcall_interactively): Change "reading args" to
14993         "providing args" to try to clarify what it does (bug#1010).
14995 2011-07-07  Kenichi Handa  <handa@m17n.org>
14997         * composite.c (composition_compute_stop_pos): Ignore a static
14998         composition starting before CHARPOS (Bug#8915).
15000         * xdisp.c (handle_composition_prop): Likewise.
15002 2011-07-07  Eli Zaretskii  <eliz@gnu.org>
15004         * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
15005         (Bug#9015)
15007 2011-07-07  Kenichi Handa  <handa@m17n.org>
15009         * character.h (unicode_category_t): New enum type.
15011         * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
15012         (Qchar_code_property_table): New variable.
15013         (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
15014         (UNIPROP_COMPRESSED_FORM_P): New macros.
15015         (char_table_ascii): Uncompress the compressed values.
15016         (sub_char_table_ref): New arg is_uniprop.  Callers changed.
15017         Uncompress the compressed values.
15018         (sub_char_table_ref_and_range): Likewise.
15019         (char_table_ref_and_range): Uncompress the compressed values.
15020         (sub_char_table_set): New arg is_uniprop.  Callers changed.
15021         Uncompress the compressed values.
15022         (sub_char_table_set_range): Args changed.  Callers changed.
15023         (char_table_set_range): Adjuted for the above change.
15024         (map_sub_char_table): Delete args default_val and parent.  Add arg
15025         top.  Give decoded values to a Lisp function.
15026         (map_char_table): Adjust for the above change.  Give decoded
15027         values to a Lisp function.  Gcpro more variables.
15028         (uniprop_table_uncompress)
15029         (uniprop_decode_value_run_length): New functions.
15030         (uniprop_decoder, uniprop_decoder_count): New variables.
15031         (uniprop_get_decoder, uniprop_encode_value_character)
15032         (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
15033         New functions.
15034         (uniprop_encoder, uniprop_encoder_count): New variables.
15035         (uniprop_get_encoder, uniprop_table)
15036         (Funicode_property_table_internal, Fget_unicode_property_internal)
15037         (Fput_unicode_property_internal): New functions.
15038         (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
15039         Sunicode_property_table_internal, Sget_unicode_property_internal,
15040         and Sput_unicode_property_internal.  Defvar_lisp
15041         char-code-property-alist.
15043         * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
15044         Vunicode_category_table.
15046         * font.c (font_range): Adjust for the change of
15047         Vunicode_category_table.
15049 2011-07-07  Dan Nicolaescu  <dann@ics.uci.edu>
15051         * m/iris4d.h: Remove file, move contents ...
15052         * s/irix6-5.h: ... here.
15054 2011-07-06  Paul Eggert  <eggert@cs.ucla.edu>
15056         Remove unportable assumption about struct layout (Bug#8884).
15057         * alloc.c (mark_buffer):
15058         * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
15059         (clone_per_buffer_values): Don't assume that
15060         sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
15061         This isn't true in general, and it's particularly not true
15062         if Emacs is configured with --with-wide-int.
15063         * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
15064         New macros, used in the buffer.c change.
15066 2011-07-05  Jan Djärv  <jan.h.d@swipnet.se>
15068         * xsettings.c: Use both GConf and GSettings if both are available.
15069         (store_config_changed_event): Add comment.
15070         (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
15071         (store_tool_bar_style_changed): New functions.
15072         (store_monospaced_changed): Add comment.  Call dpyinfo_valid.
15073         (struct xsettings): Move font inside HAVE_XFT.
15074         (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
15075         (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
15076         Move inside HAVE_XFT.
15077         (something_changed_gsettingsCB): Rename from something_changedCB.
15078         Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
15079         also.
15080         (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
15081         (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT.  Move inside HAVE_XFT.
15082         (something_changed_gconfCB): Rename from something_changedCB.
15083         Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
15084         (parse_settings): Move check for font inside HAVE_XFT.
15085         (read_settings, apply_xft_settings): Add comment.
15086         (read_and_apply_settings): Add comment.  Call map_tool_bar_style and
15087         store_tool_bar_style_changed.  Move check for font inside HAVE_XFT and
15088         call store_font_name_changed.
15089         (xft_settings_event): Add comment.
15090         (init_gsettings): Add comment.  Get values for GSETTINGS_TOOL_BAR_STYLE
15091         and GSETTINGS_FONT_NAME.  Move check for fonts within HAVE_XFT.
15092         (init_gconf): Add comment.  Get values for GCONF_TOOL_BAR_STYLE
15093         and GCONF_FONT_NAME.  Move check for fonts within HAVE_XFT.
15094         (xsettings_initialize): Call init_gsettings last.
15095         (xsettings_get_system_font, xsettings_get_system_normal_font):
15096         Add comment.
15098 2011-07-05  Paul Eggert  <eggert@cs.ucla.edu>
15100         Random fixes.  E.g., (random) never returned negative values.
15101         * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
15102         subseconds part to the entropy, as that's a bit more random.
15103         Prefer signed to unsigned, since the signedness doesn't matter and
15104         in general we prefer signed.  When given a limit, use a
15105         denominator equal to INTMASK + 1, not to VALMASK + 1, because the
15106         latter isn't right if USE_2_TAGS_FOR_INTS.
15107         * sysdep.c (get_random): Return a value in the range 0..INTMASK,
15108         not 0..VALMASK.  Don't discard "excess" bits that random () returns.
15110 2011-07-04  Stefan Monnier  <monnier@iro.umontreal.ca>
15112         * textprop.c (text_property_stickiness):
15113         Obey Vtext_property_default_nonsticky.
15114         (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
15115         * w32fns.c (syms_of_w32fns):
15116         * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
15118 2011-07-04  Paul Eggert  <eggert@cs.ucla.edu>
15120         * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
15121         This is more efficient than Ffile_directory_p and avoids a minor race.
15123 2011-07-04  Lars Magne Ingebrigtsen  <larsi@gnus.org>
15125         * buffer.c (Foverlay_put): Say what the return value is
15126         (bug#7835).
15128         * fileio.c (barf_or_query_if_file_exists): Check first if the file
15129         is a directory before asking whether to use the file name
15130         (bug#7564).
15131         (barf_or_query_if_file_exists): Make the "File is a directory"
15132         error be more correct.
15134         * fns.c (Frequire): Remove the mention of the .gz files, since
15135         that's installation-specific, but keep the mention of
15136         `get-load-suffixes'.
15138 2011-07-04  Paul Eggert  <eggert@cs.ucla.edu>
15140         * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
15141         Report string overflow if the output is too long.
15143 2011-07-04  Juanma Barranquero  <lekktu@gmail.com>
15145         * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
15146         (syms_of_gnutls): Remove duplicate DEFSYM for
15147         Qgnutls_bootprop_verify_hostname_error, an error for
15148         Qgnutls_bootprop_verify_error (which is no longer used).
15150         * eval.c (find_handler_clause): Remove parameters `sig' and `data',
15151         unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca.  All callers changed.
15152         Also (re)move comments that are misplaced or no longer relevant.
15154 2011-07-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
15156         * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
15158 2011-07-03  Chong Yidong  <cyd@stupidchicken.com>
15160         * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
15161         and background color parameters if they have been changed.
15163 2011-07-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
15165         * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
15167 2011-07-03  Paul Eggert  <eggert@cs.ucla.edu>
15169         * xsettings.c (SYSTEM_FONT): Define only when used.
15170         No need to define when HAVE_GSETTINGS || !HAVE_XFT.
15172         * keymap.c (access_keymap_1): Now static.
15174 2011-07-02  Chong Yidong  <cyd@stupidchicken.com>
15176         * keyboard.c (command_loop_1): If a down-mouse event is unbound,
15177         leave any prefix arg for the up event (Bug#1586).
15179 2011-07-02  Lars Magne Ingebrigtsen  <larsi@gnus.org>
15181         * lread.c (syms_of_lread): Mention single symbols defined by
15182         `defvar' or `defconst' (bug#7154).
15184         * fns.c (Frequire): Mention .el.gz files (bug#7314).
15185         (Frequire): Mention get-load-suffixes.
15187 2011-07-02  Martin Rudalics  <rudalics@gmx.at>
15189         * window.h (window): Remove clone_number slot.
15190         * window.c (Fwindow_clone_number, Fset_window_clone_number):
15191         Remove.
15192         (make_parent_window, make_window, saved_window)
15193         (Fset_window_configuration, save_window_save): Don't deal with
15194         clone numbers.
15195         * buffer.c (Qclone_number): Remove declaration.
15196         (sort_overlays, overlay_strings): Don't deal with clone numbers.
15198 2011-07-02  Stefan Monnier  <monnier@iro.umontreal.ca>
15200         Add multiple inheritance to keymaps.
15201         * keymap.c (Fmake_composed_keymap): New function.
15202         (Fset_keymap_parent): Simplify.
15203         (fix_submap_inheritance): Remove.
15204         (access_keymap_1): New function extracted from access_keymap to handle
15205         embedded parents and handle lists of maps.
15206         (access_keymap): Use it.
15207         (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
15208         (Fcopy_keymap): Handle embedded parents.
15209         (Fcommand_remapping, define_as_prefix): Simplify.
15210         (Fkey_binding): Simplify.
15211         (syms_of_keymap): Move minibuffer-local-completion-map,
15212         minibuffer-local-filename-completion-map,
15213         minibuffer-local-must-match-map, and
15214         minibuffer-local-filename-must-match-map to Elisp.
15215         (syms_of_keymap): Defsubr make-composed-keymap.
15216         * keyboard.c (menu_bar_items): Use map_keymap_canonical.
15217         (parse_menu_item): Trivial simplification.
15219 2011-07-01  Glenn Morris  <rgm@gnu.org>
15221         * Makefile.in (SETTINGS_LIBS): Fix typo.
15223 2011-07-01  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
15225         * coding.c (Fencode_coding_string): Record the last coding system
15226         used, as the function doc string says (bug#8738).
15228 2011-07-01  Jan Djärv  <jan.h.d@swipnet.se>
15230         * xsettings.c (store_monospaced_changed): Take new font as arg and
15231         check for change against current_mono_font.
15232         (EMACS_TYPE_SETTINGS): Remove this and related defines.
15233         (emacs_settings_constructor, emacs_settings_get_property)
15234         (emacs_settings_set_property, emacs_settings_class_init)
15235         (emacs_settings_init, gsettings_obj): Remove.
15236         (something_changedCB): New function for HAVE_GSETTINGS.
15237         (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
15238         with value as argument.
15239         (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
15240         g_settings_new (Bug#8967).  Do not create gsettings_obj.
15241         Remove calls to g_settings_bind.  Connect something_changedCB to
15242         "changed".
15244         * xgselect.c: Add defined (HAVE_GSETTINGS).
15245         (xgselect_initialize): Ditto.
15247         * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
15248         (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
15249         xg_select.
15251 2011-07-01  Paul Eggert  <eggert@cs.ucla.edu>
15253         * eval.c (struct backtrace): Simplify and port the data structure.
15254         Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
15255         signed bit field, as this assumption is not portable and it makes
15256         Emacs crash when compiled with Sun C 5.8 on sparc.  Do not use
15257         "char debug_on_exit : 1" as this is not portable either; instead,
15258         use the portable "unsigned int debug_on_exit : 1".  Remove unused
15259         member evalargs.  Remove obsolete comments about cc bombing out.
15261 2011-06-30  Jan Djärv  <jan.h.d@swipnet.se>
15263         * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
15264         Let HAVE_GSETTINGS override HAVE_GCONF.
15265         (store_monospaced_changed): New function.
15266         (EMACS_SETTINGS): A new type derived from GObject to handle
15267         GSettings notifications.
15268         (emacs_settings_constructor, emacs_settings_get_property)
15269         (emacs_settings_set_property, emacs_settings_class_init):
15270         New functions.
15271         (gsettings_client, gsettings_obj): New variables.
15272         (GSETTINGS_SCHEMA): New define.
15273         (something_changedCB): Call store_monospaced_changed.
15274         (init_gsettings): New function.
15275         (xsettings_initialize): Call init_gsettings.
15276         (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
15277         to NULL.
15279         * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
15280         GCONF_CFLAGS/LIBS.
15282 2011-06-29  Martin Rudalics  <rudalics@gmx.at>
15284         * window.c (resize_root_window, grow_mini_window)
15285         (shrink_mini_window): Rename Qresize_root_window to
15286         Qwindow_resize_root_window and Qresize_root_window_vertically to
15287         Qwindow_resize_root_window_vertically.
15289 2011-06-28  Paul Eggert  <eggert@cs.ucla.edu>
15291         * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
15293 2011-06-27  Juanma Barranquero  <lekktu@gmail.com>
15295         * makefile.w32-in: Redesign dependencies so they reflect more
15296         clearly which files are directly included by each source file,
15297         and not through other includes.
15299 2011-06-27  Martin Rudalics  <rudalics@gmx.at>
15301         * buffer.c (Qclone_number): Declare static and DEFSYM it.
15302         (sort_overlays, overlay_strings): When an overlay's clone number
15303         matches the window's clone number process the overlay even if
15304         the overlay's window property doesn't match the current window.
15306         * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
15307         (Fwindow_hchild): Rename to Fwindow_left_child.
15308         (Fwindow_next): Rename to Fwindow_next_sibling.
15309         (Fwindow_prev): Rename to Fwindow_prev_sibling.
15310         (resize_window_check): Rename to window_resize_check.
15311         (resize_window_apply): Rename to window_resize_apply.
15312         (Fresize_window_apply): Rename to Fwindow_resize_apply.
15313         (Fdelete_other_windows_internal, resize_frame_windows)
15314         (Fsplit_window_internal, Fdelete_window_internal)
15315         (grow_mini_window, shrink_mini_window)
15316         (Fresize_mini_window_internal): Fix callers accordingly.
15318 2011-06-26  Jan Djärv  <jan.h.d@swipnet.se>
15320         * emacsgtkfixed.h: State that this is only used with Gtk+3.
15321         (emacs_fixed_set_min_size): Remove.
15322         (emacs_fixed_new): Take frame as argument.
15324         * emacsgtkfixed.c: State that this is only used with Gtk+3.
15325         (_EmacsFixedPrivate): Remove minwidth/height.
15326         Add struct frame *f.
15327         (emacs_fixed_init): Initialize priv->f.
15328         (get_parent_class, emacs_fixed_set_min_size): Remove.
15329         (emacs_fixed_new): Set priv->f to argument.
15330         (emacs_fixed_get_preferred_width)
15331         (emacs_fixed_get_preferred_height): Use min_width/height from
15332         frames size_hint to set minimum and natural (Bug#8919).
15333         (XSetWMSizeHints, XSetWMNormalHints): Override these functions
15334         and use min_width/height from frames size_hint to set
15335         min_width/height (Bug#8919).
15337         * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
15338         (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
15339         Fix indentation.
15341 2011-06-26  Eli Zaretskii  <eliz@gnu.org>
15343         * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
15344         bidi_at_paragraph_end, since fast_looking_at doesn't like to be
15345         called at ZV.
15347 2011-06-26  Chong Yidong  <cyd@stupidchicken.com>
15349         * process.c (wait_reading_process_output): Bypass select if
15350         waiting for a cell while ignoring keyboard input, and input is
15351         pending.  Suggested by Jan Djärv (Bug#8869).
15353 2011-06-25  Paul Eggert  <eggert@cs.ucla.edu>
15355         Use gnulib's dup2 module instead of rolling our own.
15356         * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
15358 2011-06-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
15360         * dispnew.c (scrolling_window): Before scrolling, turn off a
15361         mouse-highlight in the window being scrolled.
15363 2011-06-24  Juanma Barranquero  <lekktu@gmail.com>
15365         Move DEFSYM to lisp.h and use everywhere.
15367         * character.h (DEFSYM): Move declaration...
15368         * lisp.h (DEFSYM): ...here.
15370         * gnutls.c:
15371         * minibuf.c:
15372         * w32menu.c:
15373         * w32proc.c:
15374         * w32select.c: Don't include character.h.
15376         * alloc.c (syms_of_alloc):
15377         * buffer.c (syms_of_buffer):
15378         * bytecode.c (syms_of_bytecode):
15379         * callint.c (syms_of_callint):
15380         * casefiddle.c (syms_of_casefiddle):
15381         * casetab.c (init_casetab_once):
15382         * category.c (init_category_once, syms_of_category):
15383         * ccl.c (syms_of_ccl):
15384         * cmds.c (syms_of_cmds):
15385         * composite.c (syms_of_composite):
15386         * dbusbind.c (syms_of_dbusbind):
15387         * dired.c (syms_of_dired):
15388         * dispnew.c (syms_of_display):
15389         * doc.c (syms_of_doc):
15390         * editfns.c (syms_of_editfns):
15391         * emacs.c (syms_of_emacs):
15392         * eval.c (syms_of_eval):
15393         * fileio.c (syms_of_fileio):
15394         * fns.c (syms_of_fns):
15395         * frame.c (syms_of_frame):
15396         * fringe.c (syms_of_fringe):
15397         * insdel.c (syms_of_insdel):
15398         * keymap.c (syms_of_keymap):
15399         * lread.c (init_obarray, syms_of_lread):
15400         * macros.c (syms_of_macros):
15401         * msdos.c (syms_of_msdos):
15402         * print.c (syms_of_print):
15403         * process.c (syms_of_process):
15404         * search.c (syms_of_search):
15405         * sound.c (syms_of_sound):
15406         * syntax.c (init_syntax_once, syms_of_syntax):
15407         * terminal.c (syms_of_terminal):
15408         * textprop.c (syms_of_textprop):
15409         * undo.c (syms_of_undo):
15410         * w32.c (globals_of_w32):
15411         * window.c (syms_of_window):
15412         * xdisp.c (syms_of_xdisp):
15413         * xfaces.c (syms_of_xfaces):
15414         * xfns.c (syms_of_xfns):
15415         * xmenu.c (syms_of_xmenu):
15416         * xsettings.c (syms_of_xsettings):
15417         * xterm.c (syms_of_xterm): Use DEFSYM.
15419 2011-06-24  Teodor Zlatanov  <tzz@lifelogs.com>
15421         * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
15423 2011-06-23  Paul Eggert  <eggert@cs.ucla.edu>
15425         Integer and buffer overflow fixes (Bug#8873).
15427         * print.c (printchar, strout): Check for string overflow.
15428         (PRINTPREPARE, printchar, strout):
15429         Don't set size unless allocation succeeds.
15431         * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
15432         for sizes.  Check for string overflow more accurately.
15433         Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
15435         * macros.c: Integer and buffer overflow fixes.
15436         * keyboard.h (struct keyboard.kbd_macro_bufsize):
15437         * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
15438         Use ptrdiff_t, not int, for sizes.
15439         Don't increment bufsize until after realloc succeeds.
15440         Check for size-calculation overflow.
15441         (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
15443         * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
15445         * lread.c: Integer overflow fixes.
15446         (read_integer): Radix is now EMACS_INT, not int,
15447         to improve quality of diagnostics for out-of-range radices.
15448         Calculate buffer size correctly for out-of-range radices.
15449         (read1): Check for integer overflow in radices, and in
15450         read-circle numbers.
15451         (read_escape): Avoid int overflow.
15452         (Fload, openp, read_buffer_size, read1)
15453         (substitute_object_recurse, read_vector, read_list, map_obarray):
15454         Use ptrdiff_t, not int, for sizes.
15455         (read1): Use EMACS_INT, not int, for sizes.
15456         Check for size overflow.
15458         * image.c (cache_image): Check for size arithmetic overflow.
15460         * lread.c: Integer overflow issues.
15461         (saved_doc_string_size, saved_doc_string_length)
15462         (prev_saved_doc_string_size, prev_saved_doc_string_length):
15463         Now ptrdiff_t, not int.
15464         (read1): Don't assume doc string length fits in int.  Check for
15465         out-of-range doc string lengths.
15466         (read_list): Don't assume file position fits in int.
15467         (read_escape): Check for hex character overflow.
15469 2011-06-22  Leo Liu  <sdl.web@gmail.com>
15471         * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
15472         Move to minibuffer.el.
15474 2011-06-22  Paul Eggert  <eggert@cs.ucla.edu>
15476         Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
15477         The following patches are for when GLYPH_DEBUG && !XASSERT.
15478         * dispextern.h (trace_redisplay_p, dump_glyph_string):
15479         * dispnew.c (flush_stdout):
15480         * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
15481         Mark as externally visible.
15482         * dispnew.c (check_window_matrix_pointers): Now static.
15483         * dispnew.c (window_to_frame_vpos):
15484         * xfns.c (unwind_create_frame):
15485         * xterm.c (x_check_font): Remove unused local.
15486         * scroll.c (CHECK_BOUNDS):
15487         * xfaces.c (cache_fache): Rename local to avoid shadowing.
15488         * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
15489         * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
15490         (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
15491         (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
15492         Now static.
15493         (debug_method_add): Use va_list and vsprintf rather than relying
15494         on undefined behavior with wrong number of arguments.
15495         (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
15496         Don't assume ptrdiff_t and EMACS_INT are the same width as int.
15497         In this code, it's OK to assume C99 behavior for ptrdiff_t formats
15498         since we're not interested in debugging glyphs with old libraries.
15499         * xfaces.c (cache_face): Move debugging code earlier; this pacifies
15500         GCC 4.6.0's static checking.
15502 2011-06-22  Paul Eggert  <eggert@cs.ucla.edu>
15504         Integer overflow and signedness fixes (Bug#8873).
15505         A few related buffer overrun fixes, too.
15507         * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
15509         * dispextern.h (struct face.stipple):
15510         * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
15511         (x_bitmap_mask, x_allocate_bitmap_record)
15512         (x_create_bitmap_from_data, x_create_bitmap_from_file)
15513         (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
15514         (x_create_bitmap_from_xpm_data):
15515         * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
15516         * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
15517         (.bitmaps_last):
15518         * xfaces.c (load_pixmap):
15519         * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
15520         * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
15521         (.bitmaps_last, struct x_output.icon_bitmap):
15522         Use ptrdiff_t, not int, for bitmap indexes.
15523         (x_allocate_bitmap_record): Check for size overflow.
15524         * dispextern.h, lisp.h: Adjust to API changes elsewhere.
15526         Use ptrdiff_t, not int, for overlay counts.
15527         * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
15528         * editfns.c (overlays_around, get_pos_property):
15529         * textprop.c (get_char_property_and_overlay):
15530         * xdisp.c (next_overlay_change, note_mouse_highlight):
15531         * xfaces.c (face_at_buffer_position):
15532         * buffer.c (OVERLAY_COUNT_MAX): New macro.
15533         (overlays_at, overlays_in, sort_overlays, Foverlays_at)
15534         (Fnext_overlay_change, Fprevious_overlay_change)
15535         (mouse_face_overlay_overlaps, Foverlays_in):
15536         Use ptrdiff_t, not int, for sizes.
15537         (overlays_at, overlays_in): Check for size-calculation overflow.
15539         * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
15541         * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
15542         (x_session_initialize): Do not assume string length fits in int.
15544         * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
15545         This is unlikely, but can occur if DPI is outlandish.
15547         * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
15548         * xselect.c (Fx_get_atom_name): Avoid need for strlen.
15550         * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
15551         * xrdb.c (magic_file_p, search_magic_path):
15552         Omit last arg SUFFIX; it was always 0.  All callers changed.
15553         (magic_file_p): Use ptrdiff_t, not int.  Check for size overflow.
15555         * xfont.c (xfont_match): Avoid need for strlen.
15557         * xfns.c: Don't assume strlen fits in int.
15558         (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
15560         * xdisp.c (message_log_check_duplicate): Return intmax_t,
15561         not unsigned long, as we prefer signed integers.  All callers changed.
15562         Detect integer overflow in repeat count.
15563         (message_dolog): Don't assume print length fits in 39 bytes.
15564         (display_mode_element): Don't assume strlen fits in int.
15566         * termcap.c: Don't assume sizes fit in int and never overflow.
15567         (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
15568         (gobble_line): Check for size-calculation overflow.
15570         * minibuf.c (Fread_buffer):
15571         * lread.c (intern, intern_c_string):
15572         * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
15573         Don't assume string length fits in int.
15575         * keyboard.c (parse_tool_bar_item):
15576         * gtkutil.c (style_changed_cb): Avoid need for strlen.
15578         * font.c: Don't assume string length fits in int.
15579         (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
15580         Use ptrdiff_t, not int.
15581         (font_intern_prop): Don't assume string length fits in int.
15582         Don't assume integer property fits in fixnum.
15583         * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
15585         * filelock.c: Fix some buffer overrun and integer overflow issues.
15586         (get_boot_time): Don't assume gzip command string fits in 100 bytes.
15587         Reformulate so as not to need the command string.
15588         Invoke gzip -cd rather than gunzip, as it's more portable.
15589         (lock_info_type, lock_file_1, lock_file):
15590         Don't assume pid_t and time_t fit in unsigned long.
15591         (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
15592         (current_lock_owner): Prefer signed type for sizes.
15593         Use memcpy, not strncpy, where memcpy is what is really wanted.
15594         Don't assume (via atoi) that time_t and pid_t fit in int.
15595         Check for time_t and/or pid_t out of range, e.g., via a network share.
15596         Don't alloca where an auto var works fine.
15598         * fileio.c: Fix some integer overflow issues.
15599         (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
15600         Don't assume string length fits in int.
15601         (directory_file_name): Don't assume string length fits in long.
15602         (make_temp_name): Don't assume pid fits in int, or that its print
15603         length is less than 20.
15605         * data.c (Fsubr_name): Rewrite to avoid a strlen call.
15607         * coding.c (make_subsidiaries): Don't assume string length fits in int.
15609         * callproc.c (child_setup): Rewrite to avoid two strlen calls.
15611         * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
15612         We prefer signed integers, even for size calculations.
15614         * emacs.c: Don't assume string length fits in 'int'.
15615         (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
15616         (main): Don't invoke strlen when not needed.
15618         * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
15619         (XD_DEBUG_MESSAGE): Don't waste a byte.
15621         * callproc.c (getenv_internal_1, getenv_internal)
15622         (Fgetenv_internal):
15623         * buffer.c (init_buffer): Don't assume string length fits in 'int'.
15625         * lread.c (invalid_syntax): Omit length argument.
15626         All uses changed.  This doesn't fix a bug, but it simplifies the
15627         code away from its former Hollerith-constant appearance, and it's
15628         one less 'int' to worry about when looking at integer-overflow issues.
15629         (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
15631         * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
15632         This didn't break anything, but it didn't help either.
15633         It's confusing to put a bogus integer in a place where the actual
15634         value does not matter.
15635         (LIST_END_P): Remove unused macro and its bogus comment.
15636         (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
15638         * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
15639         This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
15640         implementation.
15641         (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
15642         We prefer signed types, and the value cannot exceed the EMACS_INT
15643         range anyway (because otherwise the length would not be representable).
15644         (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
15645         not EMACS_UINT and EMACS_INT, when converting pointer to integer.
15646         This avoids a GCC warning when WIDE_EMACS_INT.
15648         * indent.c (sane_tab_width): New function.
15649         (current_column, scan_for_column, Findent_to, position_indentation)
15650         (compute_motion): Use it.  This is just for clarity.
15651         (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
15653         * image.c (xbm_image_p): Don't assume stated width, height fit in int.
15655         * lisp.h (lint_assume): New macro.
15656         * composite.c (composition_gstring_put_cache):
15657         * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
15659         * editfns.c, insdel.c:
15660         Omit unnecessary forward decls, to simplify future changes.
15662         * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
15664         * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
15666         * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
15667         Use much-faster test for byte-length change.
15668         Don't assume string byte-length fits in 'int'.
15669         Check that character arg fits in 'int'.
15670         (mapcar1): Declare byte as byte, for clarity.
15672         * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
15674         * fns.c (concat): Catch string overflow earlier.
15675         Do not rely on integer wraparound.
15677         * dispextern.h (struct it.overlay_strings_charpos)
15678         (struct it.selective): Now EMACS_INT, not int.
15679         * xdisp.c (forward_to_next_line_start)
15680         (back_to_previous_visible_line_start)
15681         (reseat_at_next_visible_line_start, next_element_from_buffer):
15682         Don't arbitrarily truncate the value of 'selective' to int.
15684         * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
15686         * composite.c: Don't truncate sizes to 'int'.
15687         (composition_gstring_p, composition_reseat_it)
15688         (composition_adjust_point): Use EMACS_INT, not int.
15689         (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
15690         not EMACS_UINT, for indexes.
15692         * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
15694         * buffer.c: Include <verify.h>.
15695         (struct sortvec.priority, struct sortstr.priority):
15696         Now EMACS_INT, not int.
15697         (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
15698         (struct sortstr.size, record_overlay_string)
15699         (struct sortstrlist.size, struct sortlist.used):
15700         Don't truncate size to int.
15701         (record_overlay_string): Check for size-calculation overflow.
15702         (init_buffer_once): Check at compile-time, not run-time.
15704 2011-06-22  Jim Meyering  <meyering@redhat.com>
15706         Don't leak an XBM-image-sized buffer
15707         * image.c (xbm_load): Free the image buffer after using it.
15709 2011-06-21  Paul Eggert  <eggert@cs.ucla.edu>
15711         Port to Sun C.
15712         * composite.c (find_automatic_composition): Omit needless 'return 0;'
15713         that Sun C diagnosed.
15714         * fns.c (secure_hash): Fix pointer signedness issue.
15715         * intervals.c (static_offset_intervals): New function.
15716         (offset_intervals): Use it.
15718 2011-06-21  Leo Liu  <sdl.web@gmail.com>
15720         * deps.mk (fns.o):
15721         * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
15722         sha512.h.
15724         * fns.c (secure_hash): Rename from crypto_hash_function and change
15725         the first arg to accept symbols.
15726         (Fsecure_hash): New primitive.
15727         (syms_of_fns): New symbols.
15729 2011-06-20  Deniz Dogan  <deniz@dogan.se>
15731         * process.c (Fset_process_buffer): Clarify return value in
15732         docstring.
15734 2011-06-18  Chong Yidong  <cyd@stupidchicken.com>
15736         * dispnew.c (add_window_display_history): Use BVAR.
15738         * xdisp.c (debug_method_add): Use BVAR.
15739         (check_window_end, dump_glyph_matrix, dump_glyph)
15740         (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
15742         * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
15743         Likewise.
15745         * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
15746         check till after the cache is created in init_frame_faces.
15748 2011-06-17  Stefan Monnier  <monnier@iro.umontreal.ca>
15750         * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
15752 2011-06-16  Paul Eggert  <eggert@cs.ucla.edu>
15754         * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
15755         Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
15756         hosts with pre-C99 libraries, because pD is wrongly defined to "t".
15758         Improve buffer-overflow checking (Bug#8873).
15759         * fileio.c (Finsert_file_contents):
15760         * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
15761         Remove the old (too-loose) buffer overflow checks.
15762         They weren't needed, since make_gap checks for buffer overflow.
15763         * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
15764         The old code merely checked for Emacs fixnum overflow, and relied
15765         on undefined (wraparound) behavior.  The new code avoids undefined
15766         behavior, and also checks for ptrdiff_t and/or size_t overflow.
15768         * editfns.c (Finsert_char): Don't dump core with very negative counts.
15769         Tune.  Don't use wider integers than needed.  Don't use alloca.
15770         Use a bigger 'string' buffer.  Rewrite to avoid 'n > 0' test.
15772         * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
15774         * insdel.c, lisp.h (buffer_overflow): New function.
15775         (insert_from_buffer_1, replace_range, replace_range_2):
15776         * insdel.c (make_gap_larger):
15777         * editfns.c (Finsert_char):
15778         * fileio.c (Finsert_file_contents): Use it, to normalize wording.
15780         * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
15782 2011-06-15  Paul Eggert  <eggert@cs.ucla.edu>
15784         Integer overflow and signedness fixes (Bug#8873, Bug#8828).
15786         * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
15787         (GET_CCL_RANGE, IN_INT_RANGE): Use it.
15789         * fileio.c: Don't assume EMACS_INT fits in off_t.
15790         (emacs_lseek): New static function.
15791         (Finsert_file_contents, Fwrite_region): Use it.
15792         Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
15794         * fns.c (Fload_average): Don't assume 100 * load average fits in int.
15796         * fns.c: Don't overflow int when computing a list length.
15797         * fns.c (QUIT_COUNT_HEURISTIC): New constant.
15798         (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
15799         truncation on 64-bit hosts.  Check for QUIT every
15800         QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
15801         faster and is responsive enough.
15802         (Flength): Report an error instead of overflowing an integer.
15803         (Fsafe_length): Return a float if the value is not representable
15804         as a fixnum.  This shouldn't happen except in contrived situations.
15805         (Fnthcdr, Fsort): Don't assume list length fits in int.
15806         (Fcopy_sequence): Don't assume vector length fits in int.
15808         * alloc.c: Check that resized vectors' lengths fit in fixnums.
15809         (header_size, word_size): New constants.
15810         (allocate_vectorlike): Don't check size overflow here.
15811         (allocate_vector): Check it here instead, since this is the only
15812         caller of allocate_vectorlike that could cause overflow.
15813         Check that the new vector's length is representable as a fixnum.
15815         * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
15816         The previous code was bogus.  For example, next_almost_prime (32)
15817         returned 39, which is undesirable as it is a multiple of 3; and
15818         next_almost_prime (24) returned 25, which is a multiple of 5 so
15819         why was the code bothering to check for multiples of 7?
15821         * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
15823         * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
15825         Variadic C functions now count arguments with ptrdiff_t.
15826         This partly undoes my 2011-03-30 change, which replaced int with size_t.
15827         Back then I didn't know that the Emacs coding style prefers signed int.
15828         Also, in the meantime I found a few more instances where arguments
15829         were being counted with int, which may truncate counts on 64-bit
15830         machines, or EMACS_INT, which may be unnecessarily wide.
15831         * lisp.h (struct Lisp_Subr.function.aMANY)
15832         (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
15833         Arg counts are now ptrdiff_t, not size_t.
15834         All variadic functions and their callers changed accordingly.
15835         (struct gcpro.nvars): Now size_t, not size_t.  All uses changed.
15836         * bytecode.c (exec_byte_code): Check maxdepth for overflow,
15837         to avoid potential buffer overrun.  Don't assume arg counts fit in 'int'.
15838         * callint.c (Fcall_interactively): Check arg count for overflow,
15839         to avoid potential buffer overrun.  Use signed char, not 'int',
15840         for 'varies' array, so that we needn't bother to check its size
15841         calculation for overflow.
15842         * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
15843         * eval.c (apply_lambda):
15844         * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
15845         (struct textprop_rec.argnum): Now ptrdiff_t, not int.  All uses changed.
15846         (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
15848         * callint.c (Fcall_interactively): Don't use index var as event count.
15850         * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
15851         * mem-limits.h (SIZE): Remove; no longer used.
15853         * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
15855         Remove unnecessary casts.
15856         * xterm.c (x_term_init):
15857         * xfns.c (x_set_border_pixel):
15858         * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
15859         These aren't needed now that we assume ANSI C.
15861         * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
15862         It's more likely to cause problems (due to unsigned overflow)
15863         than to cure them.
15865         * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
15867         * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
15869         * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
15871         * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
15873         * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
15875         * lread.c (Fload): Don't compare a possibly-garbage time_t value.
15877         GLYPH_CODE_FACE returns EMACS_INT, not int.
15878         * dispextern.h (merge_faces):
15879         * xfaces.c (merge_faces):
15880         * xdisp.c (get_next_display_element, next_element_from_display_vector):
15881         Don't assume EMACS_INT fits in int.
15883         * character.h (CHAR_VALID_P): Remove unused parameter.
15884         * fontset.c, lisp.h, xdisp.c: All uses changed.
15886         * editfns.c (Ftranslate_region_internal): Omit redundant test.
15888         * fns.c (concat): Minor tuning based on overflow analysis.
15889         This doesn't fix any bugs.  Use int to hold character, instead
15890         of constantly refetching from Emacs object.  Use XFASTINT, not
15891         XINT, for value known to be a character.  Don't bother comparing
15892         a single byte to 0400, as it's always less.
15894         * floatfns.c (Fexpt):
15895         * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
15897         * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
15898         for characters.
15900         * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
15902         * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
15903         Without this fix, on a 64-bit host (aset S 0 4294967386) would
15904         incorrectly succeed when S was a string, because 4294967386 was
15905         truncated before it was used.
15907         * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
15908         Otherwise, an out-of-range integer could cause undefined behavior
15909         on a 64-bit host.
15911         * composite.c: Use int, not EMACS_INT, for characters.
15912         (fill_gstring_body, composition_compute_stop_pos): Use int, not
15913         EMACS_INT, for values that are known to be in character range.
15914         This doesn't fix any bugs but is the usual style inside Emacs and
15915         may generate better code on 32-bit machines.
15917         Make sure a 64-bit char is never passed to ENCODE_CHAR.
15918         This is for reasons similar to the recent CHAR_STRING fix.
15919         * charset.c (Fencode_char): Check that character arg is actually
15920         a character.  Pass an int to ENCODE_CHAR.
15921         * charset.h (ENCODE_CHAR): Verify that the character argument is no
15922         wider than 'int', as a compile-time check to prevent future regressions
15923         in this area.
15925         * character.c (char_string): Remove unnecessary casts.
15927         Make sure a 64-bit char is never passed to CHAR_STRING.
15928         Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
15929         by silently ignoring the top 32 bits, allowing some values
15930         that were far too large to be valid characters.
15931         * character.h: Include <verify.h>.
15932         (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
15933         arguments are no wider than unsigned, as a compile-time check
15934         to prevent future regressions in this area.
15935         * data.c (Faset):
15936         * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
15937         (Fsubst_char_in_region):
15938         * fns.c (concat):
15939         * xdisp.c (decode_mode_spec_coding):
15940         Adjust to CHAR_STRING's new requirement.
15941         * editfns.c (Finsert_char, Fsubst_char_in_region):
15942         * fns.c (concat): Check that character args are actually
15943         characters.  Without this test, these functions did the wrong
15944         thing with wildly out-of-range values on 64-bit hosts.
15946         Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
15947         These casts should not be needed on 32-bit hosts, either.
15948         * keyboard.c (read_char):
15949         * lread.c (Fload): Remove casts to unsigned.
15951         * lisp.h (UNSIGNED_CMP): New macro.
15952         This fixes comparison bugs on 64-bit hosts.
15953         (ASCII_CHAR_P): Use it.
15954         * casefiddle.c (casify_object):
15955         * character.h (ASCII_BYTE_P, CHAR_VALID_P)
15956         (SINGLE_BYTE_CHAR_P, CHAR_STRING):
15957         * composite.h (COMPOSITION_ENCODE_RULE_VALID):
15958         * dispextern.h (FACE_FROM_ID):
15959         * keyboard.c (read_char): Use UNSIGNED_CMP.
15961         * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
15962         not to EMACS_INT, to avoid GCC warning.
15964         * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
15966         * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
15967         The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
15968         isn't needed on 32-bit machines.
15970         * buffer.c (Fgenerate_new_buffer_name):
15971         Use EMACS_INT for count, not int.
15972         (advance_to_char_boundary): Return EMACS_INT, not int.
15974         * data.c (Qcompiled_function): Now static.
15976         * window.c (window_body_lines): Now static.
15978         * image.c (gif_load): Rename local to avoid shadowing.
15980         * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
15981         (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
15982         * alloc.c (make_save_value): Integer argument is now of type
15983         ptrdiff_t, not int.
15984         (mark_object): Use ptrdiff_t, not int.
15985         * lisp.h (pD): New macro.
15986         * print.c (print_object): Use it.
15988         * alloc.c: Use EMACS_INT, not int, to count objects.
15989         (total_conses, total_markers, total_symbols, total_vector_size)
15990         (total_free_conses, total_free_markers, total_free_symbols)
15991         (total_free_floats, total_floats, total_free_intervals)
15992         (total_intervals, total_strings, total_free_strings):
15993         Now EMACS_INT, not int.  All uses changed.
15994         (Fgarbage_collect): Compute overall total using a double, so that
15995         integer overflow is less likely to be a problem.  Check for overflow
15996         when converting back to an integer.
15997         (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
15998         (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
15999         These were 'int' variables that could overflow on 64-bit hosts;
16000         they were never used, so remove them instead of repairing them.
16001         (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
16002         (inhibit_garbage_collection): Set gc_cons_threshold to max value.
16003         Previously, this ceilinged at INT_MAX, but that doesn't work on
16004         64-bit machines.
16005         (allocate_pseudovector): Don't use EMACS_INT when int would do.
16007         * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
16008         (allocate_vectorlike): Check for ptrdiff_t overflow.
16009         (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
16010         when a (possibly-narrower) signed value would do just as well.
16011         We prefer using signed arithmetic, to avoid comparison confusion.
16013         * alloc.c: Catch some string size overflows that we were missing.
16014         (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
16015         for convenience in STRING_BYTES_MAX.
16016         (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
16017         The definition here is exact; the one in lisp.h was approximate.
16018         (allocate_string_data): Check for string overflow.  This catches
16019         some instances we weren't catching before.  Also, it catches
16020         size_t overflow on (unusual) hosts where SIZE_MAX <= min
16021         (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
16022         and ptrdiff_t and EMACS_INT are both 64 bits.
16024         * character.c, coding.c, doprnt.c, editfns.c, eval.c:
16025         All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
16026         * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
16028         * character.c (string_escape_byte8): Fix nbytes/nchars typo.
16030         * alloc.c (Fmake_string): Check for out-of-range init.
16032 2011-06-15  Stefan Monnier  <monnier@iro.umontreal.ca>
16034         * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
16036 2011-06-14  Jan Djärv  <jan.h.d@swipnet.se>
16038         * xfns.c (x_set_scroll_bar_default_width): Remove argument to
16039         xg_get_default_scrollbar_width.
16041         * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
16042         (int_gtk_range_get_value): Move to the scroll bar part of the file.
16043         (style_changed_cb): Call update_theme_scrollbar_width and call
16044         x_set_scroll_bar_default_width and xg_frame_set_char_size for
16045         all frames (Bug#8505).
16046         (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
16047         Call gtk_window_set_resizable if HAVE_GTK3.
16048         (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
16049         and height if HAVE_GTK3 (Bug#8505).
16050         (scroll_bar_width_for_theme): New variable.
16051         (update_theme_scrollbar_width): New function.
16052         (xg_get_default_scrollbar_width): Move code to
16053         update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
16054         (xg_initialize): Call update_theme_scrollbar_width.
16056         * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
16058         * emacsgtkfixed.c, emacsgtkfixed.h: New files.
16060 2011-06-12  Martin Rudalics  <rudalics@gmx.at>
16062         * frame.c (make_frame): Call other_buffer_safely instead of
16063         other_buffer.
16065         * window.c (temp_output_buffer_show): Call display_buffer with
16066         second argument Vtemp_buffer_show_specifiers and reset latter
16067         immediately after the call.
16068         (Vtemp_buffer_show_specifiers): New variable.
16069         (auto_window_vscroll_p, next_screen_context_lines)
16070         (Vscroll_preserve_screen_position): Remove leading asterisks from
16071         doc-strings.
16073 2011-06-12  Paul Eggert  <eggert@cs.ucla.edu>
16075         Fix minor problems found by GCC 4.6.0 static checking.
16076         * buffer.c (Qclone_number): Remove for now, as it's unused.
16077         (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
16078         (record_buffer): Remove unused local.
16079         * frame.c (other_visible_frames, frame_buffer_list): Now static.
16080         (set_frame_buffer_list): Remove; unused.
16081         * frame.h (other_visible_frames): Remove decl.
16082         * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
16083         * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
16084         (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
16085         if HAVE_GPM.
16086         * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
16087         * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
16088         Define only if HAVE_GPM.
16089         * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
16090         (update_hints_inhibit): Remove; never set.  All uses removed.
16091         * widgetprv.h (emacsFrameClassRec): Remove decl.
16092         * window.c (delete_deletable_window): Now returns void, since it
16093         wasn't returning anything.
16094         (compare_window_configurations): Remove unused locals.
16095         * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
16096         * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
16097         (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
16098         the same widths as pointers.  This follows up on the 2011-05-06 patch.
16099         * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
16100         * xterm.h: Likewise.
16101         (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
16103 2011-06-12  Juanma Barranquero  <lekktu@gmail.com>
16105         * makefile.w32-in: Update dependencies.
16106         (LISP_H): Add lib/intprops.h.
16108 2011-06-11  Chong Yidong  <cyd@stupidchicken.com>
16110         * image.c (gif_load): Add animation frame delay to the metadata.
16111         (syms_of_image): Use DEFSYM.  New symbol `delay'.
16113 2011-06-11  Martin Rudalics  <rudalics@gmx.at>
16115         * window.c (delete_deletable_window): Re-add.
16116         (Fset_window_configuration): Rewrite to handle dead buffers and
16117         consequently deletable windows.
16118         (window_tree, Fwindow_tree): Remove.  Supply functionality in
16119         window.el.
16120         (compare_window_configurations): Simplify code.
16122 2011-06-11  Andreas Schwab  <schwab@linux-m68k.org>
16124         * image.c (imagemagick_load_image): Fix type mismatch.
16125         (Fimagemagick_types): Likewise.
16127         * window.h (replace_buffer_in_windows): Declare.
16129 2011-06-11  Martin Rudalics  <rudalics@gmx.at>
16131         * buffer.c: New Lisp objects Qbuffer_list_update_hook and
16132         Qclone_number.  Remove external declaration of Qdelete_window.
16133         (Fbuffer_list): Rewrite doc-string.  Minor restructuring of
16134         code.
16135         (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
16136         Run Qbuffer_list_update_hook if allowed.
16137         (Fother_buffer): Rewrite doc-string.  Major rewrite for new
16138         buffer list implementation.
16139         (other_buffer_safely): New function.
16140         (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
16141         calls to replace_buffer_in_windows and
16142         replace_buffer_in_windows_safely.  Run Qbuffer_list_update_hook
16143         if allowed.
16144         (record_buffer): Inhibit quitting and rewrite using quittable
16145         functions.  Run Qbuffer_list_update_hook if allowed.
16146         (Frecord_buffer, Funrecord_buffer): New functions.
16147         (switch_to_buffer_1, Fswitch_to_buffer): Remove.
16148         Move switch-to-buffer to window.el.
16149         (bury-buffer): Move to window.el.
16150         (Vbuffer_list_update_hook): New variable.
16152         * lisp.h (other_buffer_safely): Add prototype in buffer.c
16153         section.
16155         * window.h (resize_frame_windows): Move up in code.
16156         (Fwindow_frame): Remove EXFUN.
16157         (replace_buffer_in_all_windows): Remove prototype.
16158         (replace_buffer_in_windows_safely): Add prototype.
16160         * window.c: Declare Qdelete_window static again.  Move down
16161         declaration of select_count.
16162         (Fnext_window, Fprevious_window): Rewrite doc-strings.
16163         (Fother_window): Move to window.el.
16164         (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
16165         cases.  Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
16166         (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
16167         window.el.
16168         (replace_buffer_in_windows): Implement by calling
16169         Qreplace_buffer_in_windows.
16170         (replace_buffer_in_all_windows): Remove with some functionality
16171         moved into replace_buffer_in_windows_safely.
16172         (replace_buffer_in_windows_safely): New function.
16173         (select_window_norecord, select_frame_norecord): Move in front
16174         of run_window_configuration_change_hook.  Remove now obsolete
16175         declarations.
16176         (Fset_window_buffer): Rewrite doc-string.
16177         Call Qrecord_window_buffer.
16178         (keys_of_window): Move binding for other-window to window.el.
16180 2011-06-11  Chong Yidong  <cyd@stupidchicken.com>
16182         * dispextern.h (struct image): Replace data member, whose int_val
16183         and ptr_val fields were not used by anything, with a single
16184         lisp_val object.
16186         * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
16187         (gif_clear_image, gif_load, imagemagick_load_image)
16188         (gs_clear_image, gs_load): Callers changed.
16190 2011-06-10  Paul Eggert  <eggert@cs.ucla.edu>
16192         * buffer.h: Include <time.h>, for time_t.
16193         Needed to build on FreeBSD 8.2.  Problem reported by Herbert J. Skuhra.
16195         Fix minor problems found by static checking.
16197         * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
16199         Make identifiers static if they are not used in other modules.
16200         * data.c (Qcompiled_function, Qframe, Qvector):
16201         * image.c (QimageMagick, Qsvg):
16202         * minibuf.c (Qmetadata):
16203         * window.c (resize_window_check, resize_root_window): Now static.
16204         * window.h (resize_window_check, resize_root_window): Remove decls.
16206         * window.c (window_deletion_count, delete_deletable_window):
16207         Remove; unused.
16208         (window_body_lines): Now static.
16209         (Fdelete_other_windows_internal): Mark vars as initialized.
16210         Make sure 'resize_failed' is initialized.
16211         (run_window_configuration_change_hook): Rename local to avoid shadowing.
16212         (resize_window_apply): Remove unused local.
16213         * window.h (delete_deletable_window): Remove decl.
16215         * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
16216         (imagemagick_load_image): Fix pointer signedness problem by changing
16217         last arg from unsigned char * to char *.  All uses changed.
16218         Also, fix a local for similar reasons.
16219         Remove unused locals.  Remove locals to avoid shadowing.
16220         (fn_rsvg_handle_free): Remove; unused.
16221         (svg_load, svg_load_image): Fix pointer signedness problem.
16222         (imagemagick_load_image): Don't use garbage pointer image_wand.
16224         * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
16226 2011-06-10  Chong Yidong  <cyd@stupidchicken.com>
16228         * image.c (gif_load): Fix omitted cast error introduced by
16229         2011-06-06 change.
16231 2011-06-10  Martin Rudalics  <rudalics@gmx.at>
16233         * window.h (resize_proportionally, orig_total_lines)
16234         (orig_top_line): Remove from window structure.
16235         (set_window_height, set_window_width, change_window_heights)
16236         (Fdelete_window): Remove prototypes.
16237         (resize_frame_windows): Remove duplicate declaration.
16239 2011-06-10  Eli Zaretskii  <eliz@gnu.org>
16241         * window.h (resize_frame_windows, resize_window_check)
16242         (delete_deletable_window, resize_root_window)
16243         (resize_frame_windows): Declare prototypes.
16245         * window.c (resize_window_apply): Make definition be "static" to
16246         match the prototype.
16248 2011-06-10  Martin Rudalics  <rudalics@gmx.at>
16250         * window.c: Remove declarations of Qwindow_size_fixed,
16251         window_min_size_1, window_min_size_2, window_min_size,
16252         size_window, window_fixed_size_p, enlarge_window, delete_window.
16253         Remove static from declaration of Qdelete_window, it's
16254         temporarily needed by Fbury_buffer.
16255         (replace_window): Don't assign orig_top_line and
16256         orig_total_lines.
16257         (Fdelete_window, delete_window): Remove.  Window deletion is
16258         handled by window.el.
16259         (window_loop): Remove DELETE_OTHER_WINDOWS case.
16260         Replace Fdelete_window calls with calls to Qdelete_window.
16261         (Fdelete_other_windows): Remove.  Deleting other windows is
16262         handled by window.el.
16263         (window_fixed_size_p): Remove.  Fixed-sizeness of windows is
16264         handled in window.el.
16265         (window_min_size_2, window_min_size_1, window_min_size): Remove.
16266         Window minimum sizes are handled in window.el.
16267         (shrink_windows, size_window, set_window_height)
16268         (set_window_width, change_window_heights, window_height)
16269         (window_width, CURBEG, CURSIZE, enlarge_window)
16270         (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
16271         (Fenlarge_window, Fshrink_window): Remove.  Window resizing is
16272         handled in window.el.
16273         (make_dummy_parent): Rename to make_parent_window and give it a
16274         second argument horflag.
16275         (make_window): Don't set resize_proportionally any more.
16276         (Fsplit_window): Remove.  Windows are split in window.el.
16277         (save_restore_action, save_restore_orig_size)
16278         (shrink_window_lowest_first, save_restore_orig_size): Remove.
16279         Resize mini windows in window.el.
16280         (grow_mini_window, shrink_mini_window): Implement by calling
16281         Qresize_root_window_vertically, resize_window_check and
16282         resize_window_apply.
16283         (saved_window, Fset_window_configuration, save_window_save):
16284         Do not handle orig_top_line, orig_total_lines, and
16285         resize_proportionally.
16286         (window_min_height, window_min_width): Move to window.el.
16287         (keys_of_window): Move bindings for delete-other-windows,
16288         split-window, delete-window and enlarge-window to window.el.
16290         * buffer.c: Temporarily extern Qdelete_window.
16291         (Fbury_buffer): Temporarily call Qdelete_window instead of
16292         Fdelete_window (Fbury_buffer will move to window.el soon).
16294         * frame.c (set_menu_bar_lines_1): Remove code handling
16295         orig_top_line and orig_total_lines.
16297         * dispnew.c (adjust_frame_glyphs_initially): Don't use
16298         set_window_height but set heights directly.
16299         (change_frame_size_1): Use resize_frame_windows.
16301         * xdisp.c (init_xdisp): Don't use set_window_height but set
16302         heights directly.
16304         * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
16305         Use resize_frame_windows instead of change_window_heights and run
16306         run_window_configuration_change_hook.
16308         * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
16309         instead of change_window_heights and run
16310         run_window_configuration_change_hook.
16312 2011-06-09  Martin Rudalics  <rudalics@gmx.at>
16314         * window.c (replace_window): Rename second argument REPLACEMENT to
16315         NEW.  New third argument SETFLAG.  Rewrite.
16316         (delete_window, make_dummy_parent): Call replace_window with
16317         third argument 1.
16318         (window_list_1): Move down in code.
16319         (run_window_configuration_change_hook): Move set_buffer part
16320         before select_frame_norecord part in order to unwind correctly.
16321         Rename count1 to count.
16322         (recombine_windows, delete_deletable_window, resize_root_window)
16323         (Fdelete_other_windows_internal)
16324         (Frun_window_configuration_change_hook, make_parent_window)
16325         (resize_window_check, resize_window_apply, Fresize_window_apply)
16326         (resize_frame_windows, Fsplit_window_internal)
16327         (Fdelete_window_internal, Fresize_mini_window_internal):
16328         New functions.
16329         (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
16331 2011-06-08  Martin Rudalics  <rudalics@gmx.at>
16333         * window.h (window): Add some new members to window structure -
16334         normal_lines, normal_cols, new_total, new_normal, clone_number,
16335         splits, nest, prev_buffers, next_buffers.
16336         (WINDOW_TOTAL_SIZE): Move here from window.c.
16337         (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
16339         * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
16340         Remove.
16341         (make_dummy_parent): Set new members of windows structure.
16342         (make_window): Move down in code.  Handle new members of window
16343         structure.
16344         (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
16345         (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
16346         (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
16347         (Fset_window_prev_buffers, Fwindow_next_buffers)
16348         (Fset_window_next_buffers, Fset_window_clone_number):
16349         New functions.
16350         (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
16351         (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
16352         Doc-string fixes.
16353         (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
16354         Argument WINDOW can be now internal window too.
16355         (Fwindow_use_time): Move up in code.
16356         (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
16357         Rewrite doc-string.
16358         (Fset_window_configuration, saved_window)
16359         (Fcurrent_window_configuration, save_window_save): Handle new
16360         members of window structure.
16361         (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
16362         (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
16363         (syms_of_window): New Lisp objects Qrecord_window_buffer,
16364         Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
16365         Qget_mru_window, Qresize_root_window,
16366         Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
16367         Qauto_buffer_name; staticpro them.
16369 2011-06-07  Martin Rudalics  <rudalics@gmx.at>
16371         * window.c (Fwindow_total_size, Fwindow_left_column)
16372         (Fwindow_top_line, window_body_lines, Fwindow_body_size)
16373         (Fwindow_list_1): New functions.
16374         (window_box_text_cols): Replace with window_body_cols.
16375         (Fwindow_width, Fscroll_left, Fscroll_right):
16376         Use window_body_cols instead of window_box_text_cols.
16377         (delete_window, Fset_window_configuration):
16378         Call delete_all_subwindows with window as argument.
16379         (delete_all_subwindows): Take a window as argument and not a
16380         structure.  Rewrite.
16381         (window_loop): Remove handling of GET_LRU_WINDOW and
16382         GET_LARGEST_WINDOW.
16383         (Fget_lru_window, Fget_largest_window): Move to window.el.
16385         * window.h: Extern window_body_cols instead of
16386         window_box_text_cols.  delete_all_subwindows now takes a
16387         Lisp_Object as argument.
16389         * indent.c (compute_motion, Fcompute_motion):
16390         Use window_body_cols instead of window_box_text_cols.
16392         * frame.c (delete_frame): Call delete_all_subwindows with root
16393         window as argument.
16395 2011-06-07  Daniel Colascione  <dan.colascione@gmail.com>
16397         * fns.c (Fputhash): Document return value.
16399 2011-06-06  Chong Yidong  <cyd@stupidchicken.com>
16401         * image.c (gif_load): Implement gif89a spec "no disposal" method.
16403 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
16405         Cons<->int and similar integer overflow fixes (Bug#8794).
16407         Check for overflow when converting integer to cons and back.
16408         * charset.c (Fdefine_charset_internal, Fdecode_char):
16409         Use cons_to_unsigned to catch overflow.
16410         (Fencode_char): Use INTEGER_TO_CONS.
16411         * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
16412         (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
16413         * data.c (long_to_cons, cons_to_long): Remove.
16414         (cons_to_unsigned, cons_to_signed): New functions.
16415         These signal an error for invalid or out-of-range values.
16416         * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
16417         * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
16418         * font.c (Ffont_variation_glyphs):
16419         * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
16420         * lisp.h: Include <intprops.h>.
16421         (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
16422         (cons_to_signed, cons_to_unsigned): New decls.
16423         (long_to_cons, cons_to_long): Remove decls.
16424         * undo.c (record_first_change): Use INTEGER_TO_CONS.
16425         (Fprimitive_undo): Use CONS_TO_INTEGER.
16426         * xfns.c (Fx_window_property): Likewise.
16427         * xselect.c: Include <limits.h>.
16428         (x_own_selection, selection_data_to_lisp_data):
16429         Use INTEGER_TO_CONS.
16430         (x_handle_selection_request, x_handle_selection_clear)
16431         (x_get_foreign_selection, Fx_disown_selection_internal)
16432         (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
16433         (lisp_data_to_selection_data): Use cons_to_unsigned.
16434         (x_fill_property_data): Use cons_to_signed.
16435         Report values out of range.
16437         Check for buffer and string overflow more precisely.
16438         * buffer.h (BUF_BYTES_MAX): New macro.
16439         * lisp.h (STRING_BYTES_MAX): New macro.
16440         * alloc.c (Fmake_string):
16441         * character.c (string_escape_byte8):
16442         * coding.c (coding_alloc_by_realloc):
16443         * doprnt.c (doprnt):
16444         * editfns.c (Fformat):
16445         * eval.c (verror):
16446         Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
16447         since they may not be the same number.
16448         * editfns.c (Finsert_char):
16449         * fileio.c (Finsert_file_contents):
16450         Likewise for BUF_BYTES_MAX.
16452         * image.c: Use ptrdiff_t, not int, for sizes.
16453         (slurp_file): Switch from int to ptrdiff_t.
16454         All uses changed.
16455         (slurp_file): Check that file size fits in both size_t (for
16456         malloc) and ptrdiff_t (for sanity and safety).
16458         * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
16459         if b->modtime has its maximal value.
16461         * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
16463         Don't assume time_t can fit into int.
16464         * buffer.h (struct buffer.modtime): Now time_t, not int.
16465         * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
16466         * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
16468         Minor fixes for signed vs unsigned integers.
16469         * character.h (MAYBE_UNIFY_CHAR):
16470         * charset.c (maybe_unify_char):
16471         * keyboard.c (read_char, reorder_modifiers):
16472         XINT -> XFASTINT, since the integer must be nonnegative.
16473         * ftfont.c (ftfont_spec_pattern):
16474         * keymap.c (access_keymap, silly_event_symbol_error):
16475         XUINT -> XFASTINT, since the integer must be nonnegative.
16476         (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
16477         since it makes no difference and we prefer signed.
16478         * keyboard.c (record_char): Use XUINT when all the neighbors do.
16479         (access_keymap): NATNUMP -> INTEGERP, since the integer must be
16480         nonnegative.
16482 2011-06-06  Stefan Monnier  <monnier@iro.umontreal.ca>
16484         * window.h (Fwindow_frame): Declare.
16486 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
16488         * alloc.c: Simplify handling of large-request failures (Bug#8800).
16489         (SPARE_MEMORY): Always define.
16490         (LARGE_REQUEST): Remove.
16491         (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
16493 2011-06-06  Martin Rudalics  <rudalics@gmx.at>
16495         * lisp.h: Move EXFUNS for Fframe_root_window,
16496         Fframe_first_window and Fset_frame_selected_window to window.h.
16498         * window.h: Move EXFUNS for Fframe_root_window,
16499         Fframe_first_window and Fset_frame_selected_window here from
16500         lisp.h.
16502         * frame.c (Fwindow_frame, Fframe_first_window)
16503         (Fframe_root_window, Fframe_selected_window)
16504         (Fset_frame_selected_window): Move to window.c.
16505         (Factive_minibuffer_window): Move to minibuf.c.
16506         (Fother_visible_frames_p): New function.
16508         * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
16510         * window.c (decode_window, decode_any_window): Move up in code.
16511         (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
16512         (inhibit_frame_unsplittable): Remove unused variable.
16513         (Fwindow_buffer): Move up and rewrite doc-string.
16514         (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
16515         (Fwindow_prev): New functions.
16516         (Fwindow_frame): Move here from frame.c.  Accept any window as
16517         argument.
16518         (Fframe_root_window, Fframe_first_window)
16519         (Fframe_selected_window): Move here from frame.c.  Accept frame
16520         or arbitrary window as argument.  Update doc-strings.
16521         (Fminibuffer_window): Move up in code.
16522         (Fwindow_minibuffer_p): Move up in code and simplify.
16523         (Fset_frame_selected_window): Move here from frame.c.
16524         Marginal rewrite.
16525         (Fselected_window, select_window, Fselect_window): Move up in
16526         code.  Minor doc-string fixes.
16528 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
16530         * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
16531         Do not assume that spare memory exists; that assumption is valid
16532         only if SYSTEM_MALLOC.
16533         (LARGE_REQUEST): New macro, so that the issue of large requests
16534         is separated from the issue of spare memory.
16536 2011-06-05  Andreas Schwab  <schwab@linux-m68k.org>
16538         * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
16539         format.  (Bug#8806)
16541         * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
16543         * xfns.c (x_set_scroll_bar_default_width): Move declarations
16544         before statements.
16546 2011-06-05  Jan Djärv  <jan.h.d@swipnet.se>
16548         * gtkutil.c (xg_get_default_scrollbar_width): New function.
16550         * gtkutil.h: Declare xg_get_default_scrollbar_width.
16552         * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
16553         min width by calling x_set_scroll_bar_default_width (Bug#8505).
16555 2011-06-05  Juanma Barranquero  <lekktu@gmail.com>
16557         * xdisp.c (single_display_spec_intangible_p): Remove declaration.
16559 2011-06-04  Chong Yidong  <cyd@stupidchicken.com>
16561         * xselect.c (x_clipboard_manager_save): Remove redundant arg.
16562         (x_clipboard_manager_save): Add return value.
16563         (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
16564         New error handlers.
16565         (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
16566         Obey Vx_select_enable_clipboard_manager.  Catch errors in
16567         x_clipboard_manager_save (Bug#8779).
16568         (Vx_select_enable_clipboard_manager): New variable.
16569         (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
16571 2011-06-04  Dan Nicolaescu  <dann@ics.uci.edu>
16573         * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
16575 2011-06-04  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
16577         * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
16578         in the current matrix if keep_current_p is non-zero.
16580 2011-06-04  Eli Zaretskii  <eliz@gnu.org>
16582         * bidi.c (bidi_level_of_next_char): Fix last change.
16584 2011-06-03  Eli Zaretskii  <eliz@gnu.org>
16586         Support bidi reordering of text covered by display properties.
16588         * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
16589         (bidi_fetch_char, bidi_fetch_char_advance): New functions.
16590         (bidi_cache_search, bidi_cache_iterator_state)
16591         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
16592         (bidi_level_of_next_char, bidi_move_to_visually_next):
16593         Support character positions inside a run of characters covered by a
16594         display string.
16595         (bidi_paragraph_init, bidi_resolve_explicit_1)
16596         (bidi_level_of_next_char): Call bidi_fetch_char and
16597         bidi_fetch_char_advance instead of FETCH_CHAR and
16598         FETCH_CHAR_ADVANCE.
16599         (bidi_init_it): Initialize new members.
16600         (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
16601         definitions.
16602         (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
16603         instead of using explicit *_CHAR codes.
16604         (bidi_resolve_explicit, bidi_resolve_weak):
16605         Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
16606         bidirectional text is supported only in multibyte buffers.
16607         (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
16608         it to initialize the frame_window_p member of struct bidi_it.
16609         (bidi_cache_iterator_state, bidi_resolve_explicit_1)
16610         (bidi_resolve_explicit, bidi_resolve_weak)
16611         (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
16612         bidi_it->nchars is non-positive.
16613         (bidi_level_of_next_char): Don't try to lookup the cache for the
16614         next/previous character if nothing is cached there yet, or if we
16615         were just reseat()'ed to a new position.
16617         * xdisp.c (set_cursor_from_row): Set start and stop points
16618         according to the row's direction when priming the loop that looks
16619         for the glyph on which to display cursor.
16620         (single_display_spec_intangible_p): Function deleted.
16621         (display_prop_intangible_p): Reimplement to call
16622         handle_display_spec instead of single_display_spec_intangible_p.
16623         Accept 3 additional arguments needed by handle_display_spec.
16624         This fixes incorrect cursor motion across display property with complex
16625         values: lists, `(when COND...)' forms, etc.
16626         (single_display_spec_string_p): Support property values that are
16627         lists with the argument STRING its top-level element.
16628         (display_prop_string_p): Fix the condition for processing a
16629         property that is a list to be consistent with handle_display_spec.
16630         (handle_display_spec): New function, refactored from the
16631         last portion of handle_display_prop.
16632         (compute_display_string_pos): Accept additional argument
16633         FRAME_WINDOW_P.  Call handle_display_spec to determine whether the
16634         value of a `display' property is a "replacing spec".
16635         (handle_single_display_spec): Accept 2 additional arguments BUFPOS
16636         and FRAME_WINDOW_P.  If IT is NULL, don't set up the iterator from
16637         the display property, but just return a value indicating whether
16638         the display property will replace the characters it covers.
16639         (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
16640         frame_window_p members of struct bidi_it.
16641         (compute_display_string_pos, compute_display_string_end):
16642         New functions.
16643         (push_it): Accept second argument POSITION, where pop_it should
16644         jump to continue iteration.
16645         (reseat_1): Initialize bidi_it.disp_pos.
16647         * keyboard.c (adjust_point_for_property): Adjust the call to
16648         display_prop_intangible_p to its new signature.
16650         * dispextern.h (struct bidi_it): New member frame_window_p.
16651         (bidi_init_it): Update prototypes.
16652         (display_prop_intangible_p): Update prototype.
16653         (compute_display_string_pos, compute_display_string_end):
16654         Declare prototypes.
16655         (struct bidi_it): New members nchars and disp_pos.  ch_len is now
16656         EMACS_INT.
16658 2011-06-02  Paul Eggert  <eggert@cs.ucla.edu>
16660         Malloc failure behavior now depends on size of allocation.
16661         * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
16662         * lisp.h: Change signatures accordingly.
16663         * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
16664         All callers changed.  (Bug#8762)
16666         * gnutls.c: Use Emacs's memory allocators.
16667         Without this change, the gnutls library would invoke malloc etc.
16668         directly, which causes problems on non-SYNC_INPUT hosts, and which
16669         runs afoul of improving memory_full behavior.  (Bug#8761)
16670         (fn_gnutls_global_set_mem_functions): New macro or function pointer.
16671         (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
16672         xfree instead of the default malloc, realloc, free.
16673         (Fgnutls_boot): No need to check for memory allocation failure,
16674         since xmalloc does that for us.
16676         Remove arbitrary limit of 2**31 entries in hash tables.  (Bug#8771)
16677         * category.c (hash_get_category_set):
16678         * ccl.c (ccl_driver):
16679         * charset.c (Fdefine_charset_internal):
16680         * charset.h (struct charset.hash_index):
16681         * composite.c (get_composition_id, gstring_lookup_cache)
16682         (composition_gstring_put_cache):
16683         * composite.h (struct composition.hash_index):
16684         * dispextern.h (struct image.hash):
16685         * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
16686         (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
16687         (hashfn_equal, hashfn_user_defined, make_hash_table)
16688         (maybe_resize_hash_table, hash_lookup, hash_put)
16689         (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
16690         (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
16691         (Fsxhash, Fgethash, Fputhash, Fmaphash):
16692         * image.c (make_image, search_image_cache, lookup_image)
16693         (xpm_put_color_table_h):
16694         * lisp.h (struct Lisp_Hash_Table):
16695         * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
16696         * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
16697         for hashes and hash indexes, instead of 'unsigned' and 'int'.
16698         * alloc.c (allocate_vectorlike):
16699         Check for overflow in vector size calculations.
16700         * ccl.c (ccl_driver):
16701         Check for overflow when converting EMACS_INT to int.
16702         * fns.c, image.c: Remove unnecessary static decls that would otherwise
16703         need to be updated by these changes.
16704         * fns.c (make_hash_table, maybe_resize_hash_table):
16705         Check for integer overflow with large hash tables.
16706         (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
16707         Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
16708         (SXHASH_REDUCE): New macro.
16709         (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
16710         Use it instead of discarding useful hash info with large hash values.
16711         (sxhash_float): New function.
16712         (sxhash): Use it.  No more need for "& INTMASK" due to above changes.
16713         * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
16714         (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
16715         Rewrite to use FIXNUM_BITS, as this simplifies things.
16716         (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
16717         Adjust signatures to match updated version of code.
16718         (consing_since_gc): Now EMACS_INT, since a single hash table can
16719         use more than INT_MAX bytes.
16721 2011-06-01  Dan Nicolaescu  <dann@ics.uci.edu>
16723         Make it possible to build with GCC-4.6+ -O2 -flto.
16725         * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
16727 2011-06-01  Stefan Monnier  <monnier@iro.umontreal.ca>
16729         * minibuf.c (get_minibuffer, read_minibuf_unwind):
16730         Call minibuffer-inactive-mode.
16732 2011-05-31  Juanma Barranquero  <lekktu@gmail.com>
16734         * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
16735         Update dependencies.
16737 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
16739         * data.c (init_data): Remove code for UTS, this system is not
16740         supported anymore.
16742 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
16744         Don't force ./temacs to start in terminal mode.
16746         * frame.c (make_initial_frame): Initialize faces in all cases, not
16747         only when CANNOT_DUMP is defined.
16748         * dispnew.c (init_display): Remove CANNOT_DUMP condition.
16750 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
16752         * dispnew.c (add_window_display_history): Use const for the string
16753         pointer.  Remove declaration, not needed.
16755 2011-05-31  Paul Eggert  <eggert@cs.ucla.edu>
16757         Use 'inline', not 'INLINE'.
16758         <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
16759         * alloc.c, fontset.c (INLINE): Remove.
16760         * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
16761         * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
16762         * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
16763         * gmalloc.c (register_heapinfo): Use inline unconditionally.
16764         * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
16766 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
16768         Make it possible to run ./temacs.
16770         * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
16771         syms_of_callproc does the same thing.  Remove test for
16772         "initialized", do it in the caller.
16773         * emacs.c (main): Avoid calling set_initial_environment when dumping.
16775 2011-05-31  Stefan Monnier  <monnier@iro.umontreal.ca>
16777         * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
16778         (read_minibuf): Use get_minibuffer.
16779         (syms_of_minibuf): Use DEFSYM.
16780         (Qmetadata): New var.
16781         * data.c (Qbuffer): Don't make it static.
16782         (syms_of_data): Use DEFSYM.
16784 2011-05-31  Paul Eggert  <eggert@cs.ucla.edu>
16786         * ccl.c (CCL_CODE_RANGE): Allow negative numbers.  (Bug#8751)
16787         (CCL_CODE_MIN): New macro.
16789 2011-05-30  Paul Eggert  <eggert@cs.ucla.edu>
16791         * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
16793         * eval.c (Qdebug): Now static.
16794         * lisp.h (Qdebug): Remove decl.  This reverts a part of the
16795         2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
16796         2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
16798 2011-05-29  Chong Yidong  <cyd@stupidchicken.com>
16800         * image.c: Various fixes to ImageMagick code comments.
16801         (Fimagemagick_types): Doc fix.
16803 2011-05-29  Paul Eggert  <eggert@cs.ucla.edu>
16805         Minor fixes prompted by GCC 4.6.0 warnings.
16807         * xselect.c (converted_selections, conversion_fail_tag): Now static.
16809         * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
16810         (x_clipboard_manager_save_all): Move extern decl to ...
16811         * xterm.h: ... here, so that it can be checked for consistency.
16813 2011-05-29  Chong Yidong  <cyd@stupidchicken.com>
16815         * xselect.c (x_clipboard_manager_save_frame)
16816         (x_clipboard_manager_save_all): New functions.
16817         (Fx_clipboard_manager_save): Lisp function deleted.
16819         * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
16820         * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
16822         * xterm.h: Update prototype.
16824 2011-05-28  William Xu  <william.xwl@gmail.com>
16826         * nsterm.m (ns_term_shutdown): Synchronize user defaults before
16827         exiting (Bug#8239).
16829 2011-05-28  Jim Meyering  <meyering@redhat.com>
16831         Avoid a sign-extension bug in crypto_hash_function.
16832         * fns.c (to_uchar): Define.
16833         (crypto_hash_function): Use it to convert some newly-signed
16834         variables to unsigned, to avoid sign-extension bugs.  For example,
16835         without this change, (md5 "truc") would evaluate to
16836         45723a2aff78ff4fff7fff1114760e62 rather than the expected
16837         45723a2af3788c4ff17f8d1114760e62.  Reported by Antoine Levitt in
16838         https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
16840 2011-05-27  Paul Eggert  <eggert@cs.ucla.edu>
16842         Integer overflow fixes.
16844         * dbusbind.c: Serial number integer overflow fixes.
16845         (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
16846         (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
16847         to hold a serial number that is too large for a fixnum.
16848         (Fdbus_method_return_internal, Fdbus_method_error_internal):
16849         Check for serial numbers out of range.  Decode any serial number
16850         that was so large that it became a float.  (Bug#8722)
16852         * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
16853         (Fdbus_call_method, Fdbus_call_method_asynchronously):
16854         Use XFASTINT rather than XUINT when numbers are nonnegative.
16855         (xd_append_arg, Fdbus_method_return_internal):
16856         (Fdbus_method_error_internal): Likewise.  Also, for unsigned
16857         arguments, check that Lisp number is nonnegative, rather than
16858         silently wrapping negative numbers around.  (Bug#8722)
16859         (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
16860         (Bug#8722)
16862         * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
16864         * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
16866         ccl: Add integer overflow checks.
16867         * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
16868         (IN_INT_RANGE): New macros.
16869         (ccl_driver): Use them to check for integer overflow when
16870         decoding a CCL program.  Many of the new checks are whether XINT (x)
16871         fits in int; it doesn't always, on 64-bit hosts.  The new version
16872         doesn't catch all possible integer overflows, but it's an
16873         improvement.  (Bug#8719)
16875         * alloc.c (make_event_array): Use XINT, not XUINT.
16876         There's no need for unsigned here.
16878         * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
16879         This follows up to the 2011-05-06 change that substituted uintptr_t
16880         for EMACS_INT.  This case wasn't caught back then.
16882         Rework Fformat to avoid integer overflow issues.
16883         * editfns.c: Include <float.h> unconditionally, as it's everywhere
16884         now (part of C89).  Include <verify.h>.
16885         (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
16886         (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
16887         (Fformat): Avoid the prepass trying to compute sizes; it was only
16888         approximate and thus did not catch overflow reliably.  Instead, walk
16889         through the format just once, formatting and computing sizes as we go,
16890         checking for integer overflow at every step, and allocating a larger
16891         buffer as needed.  Keep track separately whether the format is
16892         multibyte.  Keep only the most-recently calculated precision, rather
16893         than them all.  Record whether each argument has been converted to
16894         string.  Use EMACS_INT, not int, for byte and char and arg counts.
16895         Support field widths and precisions larger than INT_MAX.  Avoid
16896         sprintf's undefined behavior with conversion specifications such as %#d
16897         and %.0c.  Fix bug with strchr succeeding on '\0' when looking for
16898         flags.  Fix bug with (format "%c" 256.0).  Avoid integer overflow when
16899         formatting out-of-range floating point numbers with int
16900         formats.  (Bug#8668)
16902         * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
16904         * data.c: Avoid integer truncation in expressions involving floats.
16905         * data.c: Include <intprops.h>.
16906         (arith_driver): When there's an integer overflow in an expression
16907         involving floating point, convert the integers to floating point
16908         so that the resulting value does not suffer from catastrophic
16909         integer truncation.  For example, on a 64-bit host (* 4
16910         most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
16911         Do not rely on undefined behavior after integer overflow.
16913         merge count_size_as_multibyte, parse_str_to_multibyte
16914         * character.c, character.h (count_size_as_multibyte):
16915         Rename from parse_str_to_multibyte; all uses changed.
16916         Check for integer overflow.
16917         * insdel.c, lisp.h (count_size_as_multibyte): Remove,
16918         since it's now a duplicate of the other.  This is more of
16919         a character than a buffer op, so better that it's in character.c.
16920         * fns.c, print.c: Adjust to above changes.
16922 2011-05-27  Stefan Monnier  <monnier@iro.umontreal.ca>
16924         * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
16926 2011-05-27  Paul Eggert  <eggert@cs.ucla.edu>
16928         * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
16929         (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
16930         (x_clipboard_manager_save): Now static.
16931         (Fx_clipboard_manager_save): Rename local to avoid shadowing.
16933         * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
16934         (crypto_hash_function): Now static.
16935         Fix pointer signedness problems.  Avoid unnecessary initializations.
16937 2011-05-27  Chong Yidong  <cyd@stupidchicken.com>
16939         * termhooks.h (Vselection_alist): Make it terminal-local.
16941         * terminal.c (create_terminal): Initialize it.
16943         * xselect.c: Support for clipboard managers.
16944         (Vselection_alist): Move to termhooks.h as terminal-local var.
16945         (LOCAL_SELECTION): New macro.
16946         (x_atom_to_symbol): Handle x_display_info_for_display fail case.
16947         (symbol_to_x_atom): Remove gratuitous arg.
16948         (x_handle_selection_request, lisp_data_to_selection_data)
16949         (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
16950         (x_own_selection, x_get_local_selection, x_convert_selection):
16951         New arg, specifying work frame.  Use terminal-local Vselection_alist.
16952         (some_frame_on_display): Delete unused function.
16953         (Fx_own_selection_internal, Fx_get_selection_internal)
16954         (Fx_disown_selection_internal, Fx_selection_owner_p)
16955         (Fx_selection_exists_p): New optional frame arg.
16956         (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
16957         (x_handle_selection_clear): Don't treat other terminals with the
16958         same keyboard specially.  Use the terminal-local Vselection_alist.
16959         (x_clear_frame_selections): Use Frun_hook_with_args.
16961         * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
16963         * xterm.h: Add support for those atoms.
16965 2011-05-26  Chong Yidong  <cyd@stupidchicken.com>
16967         * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
16968         (converted_selections, conversion_fail_tag): New global variables.
16969         (x_selection_request_lisp_error): Free the above.
16970         (x_get_local_selection): Remove unnecessary code.
16971         (x_reply_selection_request): Args changed; handle arbitrary array
16972         of converted selections stored in converted_selections.
16973         Separate the XChangeProperty and SelectionNotify steps.
16974         (x_handle_selection_request): Rewrite to handle MULTIPLE target.
16975         (x_convert_selection): New function.
16976         (x_handle_selection_event): Simplify.
16977         (x_get_foreign_selection): Don't ignore incoming requests while
16978         waiting for an answer; this will fail when we implement
16979         SAVE_TARGETS, and seems unnecessary anyway.
16980         (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
16981         (Vx_sent_selection_functions): Doc fix.
16983 2011-05-26  Leo Liu  <sdl.web@gmail.com>
16985         * editfns.c (Ftranspose_regions): Allow empty regions.  (Bug#8699)
16987 2011-05-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
16989         * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
16991         * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
16992         for fringe update if it has periodic bitmap.
16993         (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
16994         and fringe_bitmap_periodic_p.
16996         * fringe.c (get_fringe_bitmap_data): New function.
16997         (draw_fringe_bitmap_1, update_window_fringes): Use it.
16998         (update_window_fringes): Record periodicity of fringe bitmap in glyph
16999         row.  Mark glyph row for fringe update if periodicity changed.
17001         * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
17002         for fringe update unless it has periodic bitmap.
17004 2011-05-25  Kenichi Handa  <handa@m17n.org>
17006         * xdisp.c (get_next_display_element): Set correct it->face_id for
17007         a static composition.
17009 2011-05-24  Leo Liu  <sdl.web@gmail.com>
17011         * deps.mk (fns.o):
17012         * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
17014         * fns.c (crypto_hash_function, Fsha1): New function.
17015         (Fmd5): Use crypto_hash_function.
17016         (syms_of_fns): Add Ssha1.
17018 2011-05-22  Paul Eggert  <eggert@cs.ucla.edu>
17020         * gnutls.c: Remove unused macros.
17021         (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
17022         (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
17023         Remove macros that are defined and never used.
17024         Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
17026 2011-05-22  Chong Yidong  <cyd@stupidchicken.com>
17028         * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
17029         (Fx_get_selection_internal): Minor cleanup.
17030         (Fx_own_selection_internal): Rename arguments for consistency with
17031         select.el.
17033 2011-05-22  Paul Eggert  <eggert@cs.ucla.edu>
17035         * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
17037 2011-05-22  Chong Yidong  <cyd@stupidchicken.com>
17039         * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
17041 2011-05-21  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
17043         * dispnew.c (scrolling_window): Don't exclude the case that the
17044         last enabled row in the desired matrix touches the bottom boundary.
17046 2011-05-21  Glenn Morris  <rgm@gnu.org>
17048         * Makefile.in ($(etc)/DOC): Make second command line even shorter.
17049         (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
17050         and add some more files.
17052 2011-05-20  Eli Zaretskii  <eliz@gnu.org>
17054         * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
17055         report_file_error introduced by the change from 2011-05-07.
17057 2011-05-20  Paul Eggert  <eggert@cs.ucla.edu>
17059         * systime.h (Time): Define only if emacs is defined.
17060         This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
17061         where the include path doesn't have X11/X.h by default.  See
17062         <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
17064 2011-05-20  Kenichi Handa  <handa@m17n.org>
17066         * composite.c (find_automatic_composition): Fix previous change.
17068 2011-05-20  Glenn Morris  <rgm@gnu.org>
17070         * lisp.mk: New file, split from Makefile.in.
17071         * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
17072         (shortlisp): Remove.
17073         ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
17075 2011-05-19  Glenn Morris  <rgm@gnu.org>
17077         * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
17078         (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
17079         (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
17080         (lisp): Set the order to that of loadup.el.
17081         (shortlisp): Make it a copy of $lisp.
17082         (SOME_MACHINE_LISP): Remove.
17083         ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
17084         Use just $shortlisp, not $SOME_MACHINE_LISP too.
17086 2011-05-18  Kenichi Handa  <handa@m17n.org>
17088         * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
17089         (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
17090         (find_automatic_composition): Mostly rewrite for efficiency.
17092 2011-05-18  Juanma Barranquero  <lekktu@gmail.com>
17094         * makefile.w32-in: Update dependencies.
17096 2011-05-18  Christoph Scholtes  <cschol2112@googlemail.com>
17098         * menu.c: Include limits.h (fixes the MS-Windows build broken by
17099         2011-06-18T18:49:19Z!cyd@stupidchicken.com).
17101 2011-05-18  Paul Eggert  <eggert@cs.ucla.edu>
17103         Fix some integer overflow issues, such as string length overflow.
17105         * insdel.c (count_size_as_multibyte): Check for string overflow.
17107         * character.c (lisp_string_width): Check for string overflow.
17108         Use EMACS_INT, not int, for string indexes and lengths; in
17109         particular, 2nd arg is now EMACS_INT, not int.  Do not crash if
17110         the resulting string length overflows an EMACS_INT; instead,
17111         report a string overflow if no precision given.  When checking for
17112         precision exhaustion, use a check that cannot possibly have
17113         integer overflow.  (Bug#8675)
17114         * character.h (lisp_string_width): Adjust to new signature.
17116         * alloc.c (string_overflow): New function.
17117         (Fmake_string): Use it.  This doesn't change behavior, but saves
17118         a few bytes and will simplify future changes.
17119         * character.c (string_escape_byte8): Likewise.
17120         * lisp.h (string_overflow): New decl.
17122         Fixups, following up to the user-interface timestamp change.
17123         * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
17124         for UI timestamps, instead of unsigned long.
17125         * msdos.c (mouse_get_pos): Likewise.
17126         * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
17127         * w32gui.h (Time): Define by including "systime.h" rather than by
17128         declaring it ourselves.  (Bug#8664)
17130         * dispextern.h (struct image): Don't assume time_t <= unsigned long.
17131         * image.c (clear_image_cache): Likewise.
17133         * term.c (term_mouse_position): Don't assume time_t wraparound.
17135         Be more systematic about user-interface timestamps.
17136         Before, the code sometimes used 'Time', sometimes 'unsigned long',
17137         and sometimes 'EMACS_UINT', to represent these timestamps.
17138         This change causes it to use 'Time' uniformly, as that's what X uses.
17139         This makes the code easier to follow, and makes it easier to catch
17140         integer overflow bugs such as Bug#8664.
17141         * frame.c (Fmouse_position, Fmouse_pixel_position):
17142         Use Time, not unsigned long, for user-interface timestamps.
17143         * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
17144         (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
17145         * keyboard.h (last_event_timestamp): Likewise.
17146         * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
17147         * menu.h (xmenu_show): Likewise.
17148         * term.c (term_mouse_position): Likewise.
17149         * termhooks.h (struct input_event.timestamp): Likewise.
17150         (struct terminal.mouse_position_hook): Likewise.
17151         * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
17152         * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
17153         * systime.h (Time): New decl.  Pull it in from <X11/X.h> if
17154         HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
17155         what it was before.
17156         * menu.h, termhooks.h: Include "systime.h", for Time.
17158         * keyboard.c (make_lispy_event): Fix problem in integer overflow.
17159         Don't assume that the difference between two unsigned long values
17160         can fit into an integer.  At this point, we know button_down_time
17161         <= event->timestamp, so the difference must be nonnegative, so
17162         there's no need to cast the result if double-click-time is
17163         nonnegative, as it should be; check that it's nonnegative, just in
17164         case.  This bug is triggered when events are more than 2**31 ms
17165         apart (about 25 days).  (Bug#8664)
17167         * xselect.c (last_event_timestamp): Remove duplicate decl.
17168         (x_own_selection): Remove needless cast to unsigned long.
17170         * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
17171         that always fit in int.  Use a sentinel instead of a counter, to
17172         avoid a temp and to allay GCC's concerns about possible int overflow.
17173         * frame.h (struct frame): Use int for menu_bar_items_used
17174         instead of EMACS_INT, since it always fits in int.
17176         * menu.c (grow_menu_items): Check for int overflow.
17178         * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
17180         * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
17181         Before, the code was not consistent.  These values cannot exceed
17182         2**31 - 1 so there's no need to make them unsigned.
17183         (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
17184         (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
17185         (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
17186         as modifiers.
17187         * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
17189         * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
17190         (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
17191         Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
17192         presumably because the widths might not match.
17194         * window.c (size_window): Avoid needless test at loop start.
17196 2011-05-18  Courtney Bane  <emacs-bugs-7626@cbane.org>  (tiny change)
17198         * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
17200 2011-05-12  Drew Adams  <drew.adams@oracle.com>
17202         * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
17204 2011-05-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
17206         * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
17207         `width' to `bar_area_x' and `bar_area_width', respectively.
17208         (x_scroll_run): Take account of fringe background extension.
17210         * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
17211         Rename local vars `left' and `width' to `bar_area_x' and
17212         `bar_area_width', respectively.
17213         (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
17214         background extension.
17216 2011-05-10  Jim Meyering  <meyering@redhat.com>
17218         * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
17220 2011-05-10  Juanma Barranquero  <lekktu@gmail.com>
17222         * image.c (Finit_image_library): Return t for built-in image types,
17223         like pbm and xbm.  (Bug#8640)
17225 2011-05-09  Andreas Schwab  <schwab@linux-m68k.org>
17227         * w32menu.c (set_frame_menubar): Fix submenu allocation.
17229 2011-05-07  Eli Zaretskii  <eliz@gnu.org>
17231         * w32console.c (Fset_screen_color): Doc fix.
17232         (Fget_screen_color): New function.
17233         (syms_of_ntterm): Defsubr it.
17235         * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
17236         unlink the temporary file if Fcall_process didn't create it in the
17237         first place.
17238         (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
17239         child process will be redirected to a file specified with `:file'.
17240         Don't try to re-open tempfile in that case, and set fd[0] to -1 as
17241         cue to call_process_cleanup not to close that handle.
17243 2011-05-07  Ben Key  <bkey76@gmail.com>
17245         * makefile.w32-in: The bootstrap-temacs rule now makes use of
17246         one of two shell specific rules, either bootstrap-temacs-CMD or
17247         bootstrap-temacs-SH.  The bootstrap-temacs-SH rule is identical
17248         to the previous implementation of the bootstrap-temacs rule.
17249         The bootstrap-temacs-CMD rule is similar to the previous
17250         implementation of the bootstrap-temacs rule except that it
17251         makes use of the ESC_CFLAGS variable instead of the CFLAGS
17252         variable.
17254         These changes, along with some changes to nt/configure.bat,
17255         nt/gmake.defs, and nt/nmake.defs, are required to extend my
17256         earlier fix to add support for --cflags and --ldflags options
17257         that include quotes so that it works whether make uses cmd or
17258         sh as the shell.
17260 2011-05-06  Michael Albinus  <michael.albinus@gmx.de>
17262         * dbusbind.c (QCdbus_type_unix_fd): Declare static.
17263         (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
17264         is a constant.
17265         (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
17266         a string.  Handle both cases.
17267         (Fdbus_call_method_asynchronously, Fdbus_register_signal)
17268         (Fdbus_register_method): Use Qinvalid_function.
17270 2011-05-06  Juanma Barranquero  <lekktu@gmail.com>
17272         * makefile.w32-in: Update dependencies.
17273         (LISP_H): Add inttypes.h and stdin.h.
17274         (PROCESS_H): Add unistd.h.
17276 2011-05-06  Eli Zaretskii  <eliz@gnu.org>
17278         * lread.c: Include limits.h (fixes the MS-Windows build broken by
17279         2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
17281 2011-05-06  Paul Eggert  <eggert@cs.ucla.edu>
17283         * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
17285         * term.c (vfatal): Remove stray call to va_end.
17286         It's not needed and the C Standard doesn't allow it here anyway.
17288         Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
17289         * eval.c (verror): doprnt a copy of ap, not the original.  (Bug#8545)
17291         * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
17292         bytes.
17294         * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
17296         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
17298         * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
17300         * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
17302         * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
17304         * charset.h (struct charset.code_space): Now has 15 elements, not 16.
17305         * charset.c (Fdefine_charset_internal): Don't initialize
17306         charset.code_space[15].  The value was garbage, on hosts with
17307         32-bit int (Bug#8600).
17309         * lread.c (read_integer): Be more consistent with string-to-number.
17310         Use string_to_number to do the actual conversion; this avoids
17311         rounding errors and fixes some other screwups.  Without this fix,
17312         for example, #x1fffffffffffffff was misread as -2305843009213693952.
17313         (digit_to_number): Move earlier, for benefit of read_integer.
17314         Return -1 if the digit is out of range for the base, -2 if it is
17315         not a digit in any supported base.  (Bug#8602)
17317         * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
17319         * dispnew.c (scrolling_window): Return 1 if we scrolled,
17320         to match comment at start of function.  This also removes a
17321         GCC warning about overflow in a 32+64-bit port.
17323         * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
17325         * dbusbind.c: Do not use XPNTR on a value that may be an integer.
17326         Reported by Stefan Monnier in
17327         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
17328         (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
17329         Use SYMBOLP-guarded XSYMBOL, not XPNTR.
17331         * lisp.h (EMACS_INTPTR): Remove.  All uses changed to intptr_t.
17332         (EMACS_UINTPTR): Likewise, with uintptr_t.
17334         * lisp.h: Prefer 64-bit EMACS_INT if available.
17335         (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
17336         on 32-bit hosts that have 64-bit int, so that they can access
17337         large files.
17338         However, temporarily disable this change unless the temporary
17339         symbol WIDE_EMACS_INT is defined.
17341         * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
17343         Prefer intptr_t/uintptr_t for integers the same widths as pointers.
17344         This removes an assumption that EMACS_INT and long are the same
17345         width as pointers.  The assumption is true for Emacs porting targets
17346         now, but we want to make other targets possible.
17347         * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
17348         (EMACS_INTPTR, EMACS_UINTPTR): New macros.
17349         In the rest of the code, change types of integers that hold casted
17350         pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
17351         replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
17352         (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
17353         (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
17354         No need to cast type when ORing.
17355         (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
17356         * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
17357         * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
17358         assume EMACS_INT is the same width as char *.
17359         * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
17360         (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
17361         Remove no-longer-needed casts.
17362         (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
17363         (xg_tool_bar_help_callback, xg_make_tool_item):
17364         Use EMACS_INTPTR to hold an integer
17365         that will be cast to void *; this can avoid a GCC warning
17366         if EMACS_INT is not the same width as void *.
17367         * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
17368         * xdisp.c (display_echo_area_1, resize_mini_window_1):
17369         (current_message_1, set_message_1):
17370         Use a local to convert to proper width without a cast.
17371         * xmenu.c (dialog_selection_callback): Likewise.
17373         * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
17374         Also, don't assume VALBITS / RAND_BITS is less than 5,
17375         and don't rely on undefined behavior when shifting a 1 left into
17376         the sign bit.
17377         * lisp.h (get_random): Change signature to match.
17379         * lread.c (hash_string): Use size_t, not int, for hash computation.
17380         Normally we prefer signed values; but hashing is special, because
17381         it's better to use unsigned division on hash table sizes so that
17382         the remainder is nonnegative.  Also, size_t is the natural width
17383         for hashing into memory.  The previous code used 'int', which doesn't
17384         retain enough info to hash well into very large tables.
17385         (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
17387         * dbusbind.c: Don't possibly lose pointer info when converting.
17388         (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
17389         Use XPNTR rather than XHASH, so that the high-order bits of
17390         the pointer aren't lost when converting through void *.
17392         * eval.c (Fautoload): Don't double-shift a pointer.
17394         * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
17396 2011-05-06  Juanma Barranquero  <lekktu@gmail.com>
17398         * gnutls.c (DEF_GNUTLS_FN):
17399         * image.c (DEF_IMGLIB_FN): Make function pointers static.
17401 2011-05-05  Andreas Schwab  <schwab@linux-m68k.org>
17403         * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
17404         marker.  (Bug#8610)
17406 2011-05-05  Eli Zaretskii  <eliz@gnu.org>
17408         * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
17409         New version that can reserve upto 2GB of heap space.
17411 2011-05-05  Chong Yidong  <cyd@stupidchicken.com>
17413         * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
17415 2011-05-05  Teodor Zlatanov  <tzz@lifelogs.com>
17417         * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
17418         `gnutls_certificate_set_x509_key_file'.
17420 2011-05-05  Juanma Barranquero  <lekktu@gmail.com>
17422         * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
17423         Update dependencies.
17425 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
17427         * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
17428         * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
17429         Remove unused parameter `fildes'.
17430         * process.c (read_process_output, send_process): Don't pass it.
17432 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
17434         Fix previous change: the library cache is defined in w32.c.
17435         * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
17436         (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
17438 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
17440         Implement dynamic loading of GnuTLS on Windows.
17442         * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
17443         (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
17444         (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
17445         Declare.
17447         * gnutls.c (Qgnutls_dll): Define.
17448         (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
17449         (gnutls_*): Declare function pointers.
17450         (init_gnutls_functions): New function to initialize function pointers.
17451         (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
17452         (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
17453         (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
17454         Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
17455         (emacs_gnutls_write, emacs_gnutls_read)
17456         (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
17457         (Fgnutls_available_p): New function.
17458         (Fgnutls_boot): Call Fgnutls_available_p.  Use function pointers.
17459         (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
17460         (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
17462         * image.c: Include w32.h.
17463         (Vimage_type_cache): Delete.
17464         (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
17465         (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
17466         (w32_delayed_load): Move to w32.c.
17468         * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
17470         * w32.c (QCloaded_from, Vlibrary_cache): Define.
17471         (w32_delayed_load): Move from image.c.  When loading a library, record
17472         its filename in the :loaded-from property of the library id.
17473         (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
17474         Initialize and staticpro them.
17475         (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
17477         * process.c: Include lisp.h before w32.h, not after.
17478         (wait_reading_process_output): Call emacs_gnutls_record_check_pending
17479         instead of gnutls_record_check_pending.
17481         * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
17483 2011-05-04  Teodor Zlatanov  <tzz@lifelogs.com>
17485         * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
17486         instead of :keyfiles.  Give GnuTLS the keylist and the CRL lists
17487         as passed in.
17489 2011-05-03  Jan Djärv  <jan.h.d@swipnet.se>
17491         * xterm.c (x_set_frame_alpha): Do not set property on anything
17492         else than FRAME_X_OUTER_WINDOW (Bug#8608).
17494 2011-05-02  Juanma Barranquero  <lekktu@gmail.com>
17496         * sysdep.c (get_tty_size) [WINDOWSNT]: Implement.  (Bug#8596)
17498 2011-05-02  Juanma Barranquero  <lekktu@gmail.com>
17500         * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
17501         (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
17502         (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
17503         (gnutls_global_initialized, Qgnutls_bootprop_priority)
17504         (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
17505         (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
17506         (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
17507         (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
17508         (Qgnutls_bootprop_callbacks_verify): Make static.
17510 2011-05-01  Andreas Schwab  <schwab@linux-m68k.org>
17512         * callproc.c: Indentation fixup.
17514         * sysdep.c (wait_for_termination_1): Make static.
17515         (wait_for_termination, interruptible_wait_for_termination):
17516         Move after wait_for_termination_1.
17518 2011-05-01  Lars Magne Ingebrigtsen  <larsi@gnus.org>
17520         * sysdep.c (interruptible_wait_for_termination): New function
17521         which is like wait_for_termination, but allows keyboard
17522         interruptions.
17524         * callproc.c (Fcall_process): Add (:file "file") as an option for
17525         the STDOUT buffer.
17526         (Fcall_process_region): Ditto.
17528 2011-04-30  Eli Zaretskii  <eliz@gnu.org>
17530         * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
17531         rather than `XVECTOR (FOO)->size'.
17533         * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
17534         inttypes.h, as a gnulib replacement is used if it not available in
17535         system headers.
17537 2011-04-21  Eli Zaretskii  <eliz@gnu.org>
17539         Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
17540         * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
17541         of MOST_POSITIVE_FIXNUM.  (Bug#8528)
17543         * coding.c (coding_alloc_by_realloc): Error out if destination
17544         will grow beyond MOST_POSITIVE_FIXNUM.
17545         (decode_coding_emacs_mule): Abort if there isn't enough place in
17546         charbuf for the composition carryover bytes.  Reserve an extra
17547         space for up to 2 characters produced in a loop.
17548         (decode_coding_iso_2022): Abort if there isn't enough place in
17549         charbuf for the composition carryover bytes.
17551 2011-04-21  Eli Zaretskii  <eliz@gnu.org>
17553         * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
17554         aborting when %lld or %lll format is passed.
17555         [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
17556         %llo or %llx format is passed.  (Bug#8545)
17558         * window.c (window_scroll_line_based): Use a marker instead of
17559         simple variables to record original value of point.  (Bug#7952)
17561         * doprnt.c (doprnt): Fix the case where a multibyte sequence
17562         produced by %s or %c overflows available buffer space.  (Bug#8545)
17564 2011-04-28  Paul Eggert  <eggert@cs.ucla.edu>
17566         * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
17567         (SIZE_MAX): Move defn after all includes, as they might #define it.
17569 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
17571         * w32.c (init_environment): Warn about defaulting HOME to C:\.
17573 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
17575         * keyboard.c (Qdelayed_warnings_hook): Define.
17576         (command_loop_1): Run `delayed-warnings-hook'
17577         if Vdelayed_warnings_list is non-nil.
17578         (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
17579         (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
17581 2011-04-28  Eli Zaretskii  <eliz@gnu.org>
17583         * doprnt.c (doprnt): Don't return value smaller than the buffer
17584         size if the message was truncated.  (Bug#8545).
17586 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
17588         * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
17589         (Fx_window_property): #if-0 the whole functions, not just the bodies.
17591 2011-04-27  Paul Eggert  <eggert@cs.ucla.edu>
17593         * doprnt.c (doprnt): Support "ll" length modifier, for long long.
17595 2011-04-27  Juanma Barranquero  <lekktu@gmail.com>
17597         * makefile.w32-in: Update dependencies.
17599 2011-04-27  Eli Zaretskii  <eliz@gnu.org>
17601         Improve `doprnt' and its usage.  (Bug#8545)
17602         * doprnt.c (doprnt): Make sure `format' is never accessed beyond
17603         `format_end'.  Remove support for %l as a conversion specifier.
17604         Don't use xrealloc.  Improve diagnostics when the %l size modifier
17605         is used.  Update the commentary.
17607         * eval.c (verror): Simplify calculation of size_t.
17609         * coding.c (Ffind_operation_coding_system): Fix diagnostic error
17610         messages.
17612 2011-04-27  Yoshiaki Kasahara  <kasahara@nc.kyushu-u.ac.jp>  (tiny change)
17614         * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
17615         change.
17617 2011-04-27  Paul Eggert  <eggert@cs.ucla.edu>
17619         * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
17620         This makes this file independent of the recent pseudovector change.
17622 2011-04-26  Paul Eggert  <eggert@cs.ucla.edu>
17624         * keyboard.c (handle_user_signal): Fix pointer signedness problem.
17626         * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
17627         (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
17628         Remove unused local.
17629         (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
17631         * lisp.h: Fix a problem with aliasing and vector headers.  (Bug#8546)
17632         GCC 4.6.0 optimizes based on type-based alias analysis.
17633         For example, if b is of type struct buffer * and v of type struct
17634         Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
17635         != &v->size, and therefore "v->size = 1; b->size = 2; return
17636         v->size;" must therefore return 1.  This assumption is incorrect
17637         for Emacs, since it type-puns struct Lisp_Vector * with many other
17638         types.  To fix this problem, this patch adds a new type struct
17639         vectorlike_header that documents the constraints on layout of vectors
17640         and pseudovectors, and helps optimizing compilers not get fooled
17641         by Emacs's type punning.  It also adds the macros XSETTYPED_PVECTYPE
17642         XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
17643         * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
17644         the size member.
17645         (XSETPVECTYPE): Rewrite in terms of new macro.
17646         (XSETPVECTYPESIZE): New macro, specifying both type and size.
17647         This is a bit clearer, and further avoids the possibility of
17648         undesirable aliasing.
17649         (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
17650         (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
17651         (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
17652         since Lisp_Subr is a special case (no "next" field).
17653         (ASIZE): Now uses header.size rather than size.
17654         All previous uses of XVECTOR (foo)->size replaced to use this macro,
17655         to avoid the hassle of writing XVECTOR (foo)->header.size.
17656         (struct vectorlike_header): New type.
17657         (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
17658         object, to help avoid aliasing.
17659         (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
17660         (SUBRP): Likewise, since Lisp_Subr is a special case.
17661         * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
17662         (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
17663         (struct Lisp_Hash_Table): Combine first two members into a single
17664         struct vectorlike_header member.  All uses of "size" and "next" members
17665         changed to be "header.size" and "header.next".
17666         * buffer.h (struct buffer): Likewise.
17667         * font.h (struct font_spec, struct font_entity, struct font): Likewise.
17668         * frame.h (struct frame): Likewise.
17669         * process.h (struct Lisp_Process): Likewise.
17670         * termhooks.h (struct terminal): Likewise.
17671         * window.c (struct save_window_data, struct saved_window): Likewise.
17672         * window.h (struct window): Likewise.
17673         * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
17674         Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
17675         * buffer.c (init_buffer_once): Likewise.
17676         * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
17677         special case.
17678         * process.c (Fformat_network_address): Use local var for size,
17679         for brevity.
17681         * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
17683         Make the Lisp reader and string-to-float more consistent (Bug#8525)
17684         * data.c (atof): Remove decl; no longer used or needed.
17685         (digit_to_number): Move to lread.c.
17686         (Fstring_to_number): Use new string_to_number function, to be
17687         consistent with how the Lisp reader treats infinities and NaNs.
17688         Do not assume that floating-point numbers represent EMACS_INT
17689         without losing information; this is not true on most 64-bit hosts.
17690         Avoid double-rounding errors, by insisting on integers when
17691         parsing non-base-10 numbers, as the documentation specifies.
17692         * lisp.h (string_to_number): New decl, replacing ...
17693         (isfloat_string): Remove.
17694         * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
17695         (read1): Do not accept +. and -. as integers; this
17696         appears to have been a coding error.  Similarly, do not accept
17697         strings like +-1e0 as floating point numbers.  Do not report
17698         overflow for integer overflows unless the base is not 10 which
17699         means we have no simple and reliable way to continue.
17700         Break out the floating-point parsing into a new
17701         function string_to_number, so that Fstring_to_number parses
17702         floating point numbers consistently with the Lisp reader.
17703         (digit_to_number): Move here from data.c.  Make it static inline.
17704         (E_CHAR, EXP_INT): Remove, replacing with ...
17705         (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
17706         (string_to_number): New function, replacing isfloat_string.
17707         This function checks for valid syntax and produces the resulting
17708         Lisp float number too.  Rework it so that string-to-number
17709         no longer mishandles examples like "1.0e+".  Use strtoumax,
17710         so that overflow for non-base-10 numbers is reported only when
17711         there's no portable and simple way to convert to floating point.
17713         * textprop.c (set_text_properties_1): Rewrite for clarity,
17714         and to avoid GCC warning about integer overflow.
17716         * intervals.h (struct interval): Use EMACS_INT for members
17717         where EMACS_UINT might cause problems.  See
17718         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
17719         (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
17720         * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
17721         All uses changed.
17722         (offset_intervals): Tell GCC not to worry about length overflow
17723         when negating a negative length.
17725         * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
17726         (overrun_check_free): Likewise.
17728         * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
17729         in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
17730         word size.
17732         * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
17733         (gnutls_make_error): Rename local to avoid shadowing.
17734         (gnutls_emacs_global_deinit): ifdef out; not used.
17735         (Fgnutls_boot): Use const for pointer to readonly storage.
17736         Comment out unused local.  Fix pointer signedness problems.
17738         * lread.c (openp): Don't stuff size_t into an 'int'.
17739         Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
17740         about possible signed overflow.
17742         * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
17743         (GDK_KEY_g): Don't define if already defined.
17744         (xg_prepare_tooltip): Avoid pointer signedness problem.
17745         (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
17747         * process.c (Fnetwork_interface_info): Avoid left-shift undefined
17748         behavior with 1 << 31.  GCC 4.6.0 warns about this on 32-bit hosts.
17750         * xfns.c (Fx_window_property): Simplify a bit,
17751         to make a bit faster and to avoid GCC 4.6.0 warning.
17752         * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
17754         * fns.c (internal_equal): Don't assume size_t fits in int.
17756         * alloc.c (compact_small_strings): Tighten assertion a little.
17758         Replace pEd with more-general pI, and fix some printf arg casts.
17759         * lisp.h (pI): New macro, generalizing old pEd macro to other
17760         conversion specifiers.  For example, use "...%"pI"d..." rather
17761         than "...%"pEd"...".
17762         (pEd): Remove.  All uses replaced with similar uses of pI.
17763         * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
17764         * alloc.c (check_pure_size): Don't overflow by converting size to int.
17765         * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
17766         * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
17767         * dbusbind.c (xd_append_arg): Use pI to avoid cast.
17768         (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
17769         * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
17770         64-bit hosts.
17771         (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
17772         * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
17773         * print.c (safe_debug_print, print_object): Likewise.
17774         (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
17775         to int.
17776         Use pI instead of if-then-else-abort.  Use %p to avoid casts,
17777         avoiding the 0 flag, which is not portable.
17778         * process.c (Fmake_network_process): Use pI to avoid cast.
17779         * region-cache.c (pp_cache): Likewise.
17780         * xdisp.c (decode_mode_spec): Likewise.
17781         * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
17782         behavior on 64-bit hosts with printf arg.
17783         * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
17784         (x_stop_queuing_selection_requests): Likewise.
17785         (x_get_window_property): Don't truncate byte count to an 'int'
17786         when tracing.
17788         * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
17789         here, since it parses constructs like leading '-' and spaces,
17790         which are not wanted; and it overflows with large numbers.
17791         Instead, simply match F[0-9]+, which is what is wanted anyway.
17793         * alloc.c: Remove unportable assumptions about struct layout.
17794         (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
17795         (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
17796         (allocate_vectorlike, make_pure_vector): Use the new macros,
17797         plus offsetof, to remove unportable assumptions about struct layout.
17798         These assumptions hold on all porting targets that I know of, but
17799         they are not guaranteed, they're easy to remove, and removing them
17800         makes further changes easier.
17802         * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
17803         This doesn't fix a bug but makes the code clearer.
17804         (string_overrun_cookie): Now const.  Use initializers that
17805         don't formally overflow signed char, to avoid warnings.
17806         (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
17807         can cause Emacs to crash when string overrun checking is enabled.
17808         (allocate_buffer): Don't assume sizeof (struct buffer) is a
17809         multiple of sizeof (EMACS_INT); it need not be, if
17810         alignof(EMACS_INT) < sizeof (EMACS_INT).
17811         (check_sblock, check_string_bytes, check_string_free_list): Protoize.
17813 2011-04-26  Juanma Barranquero  <lekktu@gmail.com>
17815         * keyboard.c (QCrtl): Rename from Qrtl.  All uses changed.
17817 2011-04-26  Teodor Zlatanov  <tzz@lifelogs.com>
17819         * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
17820         supposed to be handshaking.  (Bug#8556)
17821         Reported by Paul Eggert <eggert@cs.ucla.edu>.
17823 2011-04-26  Daniel Colascione  <dan.colascione@gmail.com>
17825         * lisp.h (Qdebug): List symbol.
17826         * eval.c (Qdebug): Restore global linkage.
17827         * keyboard.c (debug-on-event): New variable.
17828         (handle_user_signal): Break into debugger when debug-on-event
17829         matches the current signal symbol.
17831 2011-04-25  Dan Nicolaescu  <dann@ics.uci.edu>
17833         * alloc.c (check_sblock, check_string_bytes)
17834         (check_string_free_list): Convert to standard C.
17836 2011-04-25  Teodor Zlatanov  <tzz@lifelogs.com>
17838         * w32.c (emacs_gnutls_push): Fix typo.
17840 2011-04-25  Eli Zaretskii  <eliz@gnu.org>
17842         * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
17843         "cast to pointer from integer of different size".
17845         Improve doprnt and its use in verror.  (Bug#8545)
17846         * doprnt.c (doprnt): Document the set of format control sequences
17847         supported by the function.  Use SAFE_ALLOCA instead of always
17848         using `alloca'.
17850         * eval.c (verror): Don't limit the buffer size at size_max-1, that
17851         is one byte too soon.  Don't use xrealloc; instead xfree and
17852         xmalloc anew.
17854 2011-04-24  Teodor Zlatanov  <tzz@lifelogs.com>
17856         * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
17857         callbacks stage.
17859         * gnutls.c: Renamed global_initialized to
17860         gnutls_global_initialized.  Added internals for the
17861         :verify-hostname-error, :verify-error, and :verify-flags
17862         parameters of `gnutls-boot' and documented those parameters in the
17863         docstring.  Start callback support.
17864         (emacs_gnutls_handshake): Add Woe32 support.  Retry handshake
17865         unless a fatal error occurred.  Call gnutls_alert_send_appropriate
17866         on error.  Return error code.
17867         (emacs_gnutls_write): Call emacs_gnutls_handle_error.
17868         (emacs_gnutls_read): Likewise.
17869         (Fgnutls_boot): Return handshake error code.
17870         (emacs_gnutls_handle_error): New function.
17871         (wsaerror_to_errno): Likewise.
17873         * w32.h (emacs_gnutls_pull): Add prototype.
17874         (emacs_gnutls_push): Likewise.
17876         * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
17877         (emacs_gnutls_push): Likewise.
17879 2011-04-24  Claudio Bley  <claudio.bley@gmail.com>  (tiny change)
17881         * process.c (wait_reading_process_output): Check if GnuTLS
17882         buffered some data internally if no FDs are set for TLS
17883         connections.
17885         * makefile.w32-in (OBJ2): Add gnutls.$(O).
17886         (LIBS): Link to USER_LIBS.
17887         ($(BLD)/gnutls.$(0)): New target.
17889 2011-04-24  Eli Zaretskii  <eliz@gnu.org>
17891         * xdisp.c (handle_single_display_spec): Rename the
17892         display_replaced_before_p argument into display_replaced_p, to
17893         make it consistent with the commentary.  Fix typos in the
17894         commentary.
17896         * textprop.c (syms_of_textprop): Remove dead code.
17897         (copy_text_properties): Delete obsolete commentary about an
17898         interface that was deleted long ago.  Fix typos in the description
17899         of arguments.
17901         * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
17902         to changes in oldXMenu/XMenu.h from 2011-04-16.
17903         <menu_help_message, prev_menu_help_message>: Constify.
17904         (IT_menu_make_room): menu->help_text is now `const char **';
17905         adjust.
17907         * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
17908         to changes in oldXMenu/XMenu.h from 2011-04-16.
17909         (struct XMenu): Declare `help_text' `const char **'.
17911         * xfaces.c <Qunspecified>: Make extern again.
17913         * syntax.c: Include sys/types.h before including regex.h, as
17914         required by POSIX.
17916         * doc.c (get_doc_string): Improve the format passed to `error'.
17918         * doprnt.c (doprnt): Improve commentary.
17920         * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
17922         * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
17923         them with etags.
17925         * makefile.w32-in (globals.h): Add a dummy recipe, to make any
17926         changes in globals.h immediately force recompilation.
17927         (TAGS): Depend on $(CURDIR)/m/intel386.h and
17928         $(CURDIR)/s/ms-w32.h.
17929         (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
17931         * character.c (Fchar_direction): Function deleted.
17932         (syms_of_character): Don't defsubr it.
17933         <char-direction-table>: Deleted.
17935 2011-04-23  Eli Zaretskii  <eliz@gnu.org>
17937         Fix doprnt so it could be used again safely in `verror'.  (Bug#8435)
17938         * doprnt.c: Include limits.h.
17939         (SIZE_MAX): New macro.
17940         (doprnt): Return a size_t value.  2nd arg is now size_t.
17941         Many local variables are now size_t instead of int or unsigned.
17942         Improve overflow protection.  Support `l' modifier for integer
17943         conversions.  Support %l conversion.  Don't assume an EMACS_INT
17944         argument for integer conversions and for %c.
17946         * lisp.h (doprnt): Restore prototype.
17948         * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
17949         $(SRC)/character.h.
17951         * Makefile.in (base_obj): Add back doprnt.o.
17953         * deps.mk (doprnt.o): Add back prerequisites.
17954         (callint.o): Depend on character.h.
17956         * eval.c (internal_lisp_condition_case): Include the handler
17957         representation in the error message.
17958         (verror): Call doprnt instead of vsnprintf.  Fix an off-by-one bug
17959         when breaking from the loop.
17961         * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
17963         * callint.c (Fcall_interactively): When displaying error message
17964         about invalid control letter, pass the character's codepoint, not
17965         a pointer to its multibyte form.  Improve display of the character
17966         in octal and display also its hex code.
17968         * character.c (char_string): Use %x to display the (unsigned)
17969         codepoint of an invalid character, to avoid displaying a bogus
17970         negative value.
17972         * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
17973         `error', not SYMBOL_NAME itself.
17975         * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
17976         character arguments to `error'.
17978         * charset.c (check_iso_charset_parameter): Fix incorrect argument
17979         to `error' in error message about FINAL_CHAR argument.  Make sure
17980         FINAL_CHAR is a character, and use %c when it is passed as
17981         argument to `error'.
17983 2011-04-23  Eli Zaretskii  <eliz@gnu.org>
17985         * s/ms-w32.h (localtime): Redirect to sys_localtime.
17987         * w32.c: Include <time.h>.
17988         (sys_localtime): New function.
17990 2011-04-23  Chong Yidong  <cyd@stupidchicken.com>
17992         * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
17994         * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
17996 2011-04-23  Samuel Thibault  <sthibault@debian.org>  (tiny change)
17998         * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
17999         zombies (Bug#8467).
18001 2011-04-19  Eli Zaretskii  <eliz@gnu.org>
18003         * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
18004         gl_state.e_property when gl_state.object is Qt.
18006         * insdel.c (make_gap_larger): Remove limitation of buffer size
18007         to <= INT_MAX.
18009 2011-04-18  Chong Yidong  <cyd@stupidchicken.com>
18011         * xdisp.c (lookup_glyphless_char_display)
18012         (produce_glyphless_glyph): Handle cons cell entry in
18013         glyphless-char-display.
18014         (Vglyphless_char_display): Document it.
18016         * term.c (produce_glyphless_glyph): Handle cons cell entry in
18017         glyphless-char-display.
18019 2011-04-17  Chong Yidong  <cyd@stupidchicken.com>
18021         * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
18023         * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
18025         * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
18026         definition for no-X builds.
18028 2011-04-16  Paul Eggert  <eggert@cs.ucla.edu>
18030         Static checks with GCC 4.6.0 and non-default toolkits.
18032         * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
18034         * process.c (keyboard_bit_set): Define only if SIGIO.
18035         (send_process_trap): Mark it with NO_RETURN if it doesn't return.
18036         (send_process): Repair possible setjmp clobbering.
18038         * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
18040         * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
18042         * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
18044         * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
18045         Define only if needed.
18047         * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
18048         by pacifying GCC about it.  Maybe it's time to retire it?
18049         * xfaces.c (USG, __TIMEVAL__): Likewise.
18051         * dispextern.h (struct redisplay_interface): Rename param
18052         to avoid shadowing.
18053         * termhooks.h (struct terminal): Likewise.
18054         * xterm.c (xembed_send_message): Likewise.
18056         * insdel.c (make_gap_smaller): Define only if
18057         USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
18059         * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
18060         it.
18062         * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
18063         so that we aren't warned about unused symbols.
18065         * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
18067         * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
18069         * xfns.c (x_real_positions): Mark locals as initialized.
18071         * xmenu.c (xmenu_show): Don't use uninitialized vars.
18073         * xterm.c: Fix problems found by static analysis with other toolkits.
18074         (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
18075         (x_dispatch_event): Declare static if USE_GTK, and
18076         define if USE_GTK || USE_X_TOOLKIT.
18077         (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
18078         * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
18079         * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
18080         if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
18082         * xmenu.c (menu_help_callback): Pointer type fixes.
18083         Use const pointers when pointing at readonly data.  Avoid pointer
18084         signedness clashes.
18085         (FALSE): Remove unused macro.
18086         (update_frame_menubar): Remove unused decl.
18088         * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
18090         * menu.c (push_submenu_start, push_submenu_end): Do not define unless
18091         USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
18092         (single_menu_item): Rename local to avoid shadowing.
18094         * keyboard.c (make_lispy_event): Remove unused local var.
18096         * frame.c, frame.h (x_get_resource_string): Bring this back, but
18097         only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
18099         * bitmaps: Change bitmaps from unsigned char back to the X11
18100         compatible char.  Avoid the old compiler warnings about
18101         out-of-range initializers by using, for example, '\xab' rather
18102         than 0xab.
18104         * xgselect.c (xgselect_initialize): Check vs interface
18105         even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
18107         * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
18109         * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
18110         to read-only memory.
18112         * fns.c (vector): Remove; this old hack is no longer needed.
18114         * xsmfns.c (create_client_leader_window): Rename shadowing arg.
18115         Remove unused var.
18116         (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
18118         * xrdb.c (x_load_resources): Omit unused local.
18120         * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
18121         (x_window): Rename locals to avoid shadowing.
18122         (USG): Use the kludged USG macro, to pacify gcc.
18124         * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
18125         (x_term_init): Remove local to avoid shadowing.
18127         * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
18129         * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
18130         USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
18132 2011-04-16  Eli Zaretskii  <eliz@gnu.org>
18134         * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
18136         Fix regex.c, syntax.c and friends for buffers > 2GB.
18137         * syntax.h (struct gl_state_s): Declare character position members
18138         EMACS_INT.
18140         * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
18142         * textprop.c (verify_interval_modification, interval_of):
18143         Declare arguments EMACS_INT.
18145         * intervals.c (adjust_intervals_for_insertion): Declare arguments
18146         EMACS_INT.
18148         * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
18150         * indent.c (Fvertical_motion): Local variable it_start is now
18151         EMACS_INT.
18153         * regex.c (re_match, re_match_2, re_match_2_internal)
18154         (bcmp_translate, regcomp, regexec, print_double_string)
18155         (group_in_compile_stack, re_search, re_search_2, regex_compile)
18156         (re_compile_pattern, re_exec): Declare arguments and local
18157         variables `size_t' and `ssize_t' and return values `regoff_t', as
18158         appropriate.
18159         (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
18160         (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
18161         <compile_stack_type>: `size' and `avail' are now `size_t'.
18163         * regex.h <regoff_t>: Use ssize_t, not int.
18164         (re_search, re_search_2, re_match, re_match_2): Arguments that
18165         specify buffer/string position and length are now ssize_t and
18166         size_t.  Return type is regoff_t.
18168 2011-04-16  Ben Key  <bkey76@gmail.com>
18170         * nsfont.m: Fixed bugs in ns_get_family and
18171         ns_descriptor_to_entity that were caused by using free to
18172         deallocate memory blocks that were allocated by xmalloc (via
18173         xstrdup).  This caused Emacs to crash when compiled with
18174         XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
18175         --enable-checking=xmallocoverrun).  xfree is now used to
18176         deallocate these memory blocks.
18178 2011-04-15  Paul Eggert  <eggert@cs.ucla.edu>
18180         * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
18182         emacs_write: Accept and return EMACS_INT for sizes.
18183         See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
18184         et seq.
18185         * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
18186         Accept and return EMACS_INT.
18187         (emacs_gnutls_write): Return the number of bytes written on
18188         partial writes.
18189         * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
18190         (emacs_read, emacs_write): Remove check for negative size, as the
18191         Emacs source code has been audited now.
18192         * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
18193         (emacs_read, emacs_write): Use it.
18194         * process.c (send_process): Adjust to the new signatures of
18195         emacs_write and emacs_gnutls_write.  Do not attempt to store
18196         a byte offset into an 'int'; it might overflow.
18197         See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
18199         * sound.c: Don't assume sizes fit in 'int'.
18200         (struct sound_device.period_size, alsa_period_size):
18201         Return EMACS_INT, not int.
18202         (struct sound_device.write, vox_write, alsa_write):
18203         Accept EMACS_INT, not int.
18204         (wav_play, au_play): Use EMACS_INT to store sizes and to
18205         record read return values.
18207 2011-04-15  Ben Key  <bkey76@gmail.com>
18209         * keyboard.c (Qundefined): Don't declare static since it is used
18210         in nsfns.m.
18211         * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
18212         static since they are used in nsfont.m.
18214 2011-04-15  Stefan Monnier  <monnier@iro.umontreal.ca>
18216         * process.c (Qprocessp): Don't declare static.
18217         * lisp.h (Qprocessp): Declare again.
18219 2011-04-15  Juanma Barranquero  <lekktu@gmail.com>
18221         * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
18223 2011-04-14  Paul Eggert  <eggert@cs.ucla.edu>
18225         Improve C-level modularity by making more things 'static'.
18227         Don't publish debugger-only interfaces to other modules.
18228         * lisp.h (safe_debug_print, debug_output_compilation_hack):
18229         (verify_bytepos, count_markers): Move decls to the only modules
18230         that need them.
18231         * region-cache.h (pp_cache): Likewise.
18232         * window.h (check_all_windows): Likewise.
18233         * marker.c, print.c, region-cache.c, window.c: Decls moved here.
18235         * sysdep.c (croak): Now static, if
18236         defined TIOCNOTTY || defined USG5 || defined CYGWIN.
18237         * syssignal.h (croak): Declare only if not static.
18239         * alloc.c (refill_memory_reserve): Now static if
18240         !defined REL_ALLOC || defined SYSTEM_MALLOC.
18241         * lisp.h (refill_memory_reserve): Declare only if not static.
18243         * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
18244         Define only if USE_LUCID.
18246         * xrdb.c (x_customization_string, x_rm_string): Now static.
18248         * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
18249         * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
18251         * xdisp.c (draw_row_with_mouse_face): Now static.
18252         * dispextern.h (draw_row_with_mouse_fave): Remove decl.
18254         * window.h (check_all_windows): Mark externally visible.
18256         * window.c (window_deletion_count): Now static.
18258         * undo.c: Make symbols static if they're not exported.
18259         (last_undo_buffer, last_boundary_position, pending_boundary):
18260         Now static.
18262         * textprop.c (interval_insert_behind_hooks): Now static.
18263         (interval_insert_in_front_hooks): Likewise.
18265         * term.c: Make symbols static if they're not exported.
18266         (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
18267         (max_frame_lines, tty_set_terminal_modes):
18268         (tty_reset_terminal_modes, tty_turn_off_highlight):
18269         (get_tty_terminal): Now static.
18270         (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
18271         * termhooks.h (term_mouse_moveto): Do not declare if
18272         HAVE_WINDOW_SYSTEM.
18273         * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
18274         (tty_turn_off_highlight, get_tty_terminal): Remove decls.
18276         * sysdep.c: Make symbols static if they're not exported.
18277         (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
18278         Now static.
18279         (sigprocmask_set, full_mask): Remove; unused.
18280         (wait_debugging): Mark as visible.
18281         * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
18282         * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
18284         * syntax.c (syntax_temp): Define only if !__GNUC__.
18286         * sound.c (current_sound_device, current_sound): Now static.
18288         * search.c (searchbufs, searchbuf_head): Now static.
18290         * scroll.c (scroll_cost): Remove; unused.
18291         * dispextern.h (scroll_cost): Remove decl.
18293         * region-cache.h (pp_cache): Mark as externally visible.
18295         * process.c: Make symbols static if they're not exported.
18296         (process_tick, update_tick, create_process, chan_process):
18297         (Vprocess_alist, proc_buffered_char, datagram_access):
18298         (fd_callback_data, send_process_frame, process_sent_to): Now static.
18299         (deactivate_process): Mark defn as static, as well as decl.
18300         * lisp.h (create_process): Remove decl.
18301         * process.h (chan_process, Vprocess_alist): Remove decls.
18303         * print.c: Make symbols static if they're not exported.
18304         (print_depth, new_backquote_output, being_printed, print_buffer):
18305         (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
18306         (print_interval, print_number_index, initial_stderr_stream):
18307         Now static.
18308         * lisp.h (Fprinc): Remove decl.
18309         (debug_output_compilation_hack): Mark as externally visible.
18311         * sysdep.c (croak): Move decl from here to syssignal.h.
18312         * syssignal.h (croak): Put it here, so the API can be checked when
18313         'croak' is called from dissociate_if_controlling_tty.
18315         * minibuf.c: Make symbols static if they're not exported.
18316         (minibuf_save_list, choose_minibuf_frame): Now static.
18317         * lisp.h (choose_minibuf_frame): Remove decl.
18319         * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
18321         * lread.c: Make symbols static if they're not exported.
18322         (read_objects, initial_obarray, oblookup_last_bucket_number):
18323         Now static.
18324         (make_symbol): Remove; unused.
18325         * lisp.h (initial_obarray, make_symbol): Remove decls.
18327         * keyboard.c: Make symbols static if they're not exported.
18328         (single_kboard, recent_keys_index, total_keys, recent_keys):
18329         (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
18330         (this_single_command_key_start, echoing, last_auto_save):
18331         (read_key_sequence_cmd, dribble, recursive_edit_unwind):
18332         (command_loop, echo_now, keyboard_init_hook, help_char_p):
18333         (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
18334         (Vlispy_mouse_stem, double_click_count):
18335         Now static.
18336         (force_auto_save_soon): Define only if SIGDANGER.
18337         (ignore_mouse_drag_p): Now static if
18338         !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
18339         (print_help): Remove; unused.
18340         (stop_character, last_timer_event): Mark as externally visible.
18341         * keyboard.h (ignore_mouse_drag_p): Declare only if
18342         defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
18343         (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
18344         * lisp.h (echoing): Remove decl.
18345         (force_auto_save_soon): Declare only if SIGDANGER.
18346         * xdisp.c (redisplay_window): Simplify code, to make it more
18347         obvious that ignore_mouse_drag_p is not accessed if !defined
18348         USE_GTK && !defined HAVE_NS.
18350         * intervals.c: Make symbols static if they're not exported.
18351         (merge_properties_sticky, merge_interval_right, delete_interval):
18352         Now static.
18353         * intervals.h (merge_interval_right, delete_interval): Remove decls.
18355         * insdel.c: Make symbols static if they're not exported.
18356         However, leave prepare_to_modify_buffer alone.  It's never
18357         called from outside this function, but that appears to be a bug.
18358         (combine_after_change_list, combine_after_change_buffer):
18359         (adjust_after_replace, signal_before_change): Now static.
18360         (adjust_after_replace_noundo): Remove; unused.
18361         * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
18362         (signal_before_change): Remove decls.
18364         * indent.c (val_compute_motion, val_vmotion): Now static.
18366         * image.c: Make symbols static if they're not exported.
18367         * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
18368         if USE_GTK.
18369         * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
18370         (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
18372         * fringe.c (standard_bitmaps): Now static.
18373         (max_used_fringe_bitmap): Now static, unless HAVE_NS.
18375         * frame.c: Make symbols static if they're not exported.
18376         (x_report_frame_params, make_terminal_frame): Now static.
18377         (get_frame_param): Now static, unless HAVE_NS.
18378         (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
18379         (x_get_resource_string): Remove; not used.
18380         * frame.h (make_terminal_frame, x_report_frame_params):
18381         (x_get_resource_string); Remove decls.
18382         (x_fullscreen_adjust): Declare only if WINDOWSNT.
18383         * lisp.h (get_frame_param): Declare only if HAVE_NS.
18385         * font.c, fontset.c: Make symbols static if they're not exported.
18386         * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
18387         (FACE_SUITABLE_FOR_CHAR_P): Use it.
18388         * font.c (font_close_object): Now static.
18389         * font.h (font_close_object): Remove.
18390         * fontset.c (FONTSET_OBJLIST): Remove.
18391         (free_realized_fontset) #if-0 the body, which does nothing.
18392         (face_suitable_for_char_p): #if-0, as it's never called.
18393         * fontset.h (face_suitable_for_char_p): Remove decl.
18394         * xfaces.c (face_at_string_position):
18395         Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
18396         since 0 is always ASCII.
18398         * fns.c (weak_hash_tables): Now static.
18400         * fileio.c: Make symbols static if they're not exported.
18401         (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
18402         (Vwrite_region_annotation_buffers): Now static.
18404         * eval.c: Make symbols static if they're not exported.
18405         (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
18406         * lisp.h (backtrace_list): Remove decl.
18408         * emacs.c: Make symbols static if they're not exported.
18409         (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
18410         (fatal_error_code, fatal_error_signal_hook, standard_args):
18411         Now static.
18412         (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
18413         (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
18414         (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
18415         * lisp.h (fatal_error_signal_hook): Remove decl.
18416         (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
18418         * editfns.c: Move a (normally-unused) function to its only use.
18419         * editfns.c, lisp.h (get_operating_system_release): Remove.
18420         * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
18421         worth the hassle of breaking this out.
18423         * xterm.c: Make symbols static if they're not exported.
18424         (x_raise_frame, x_lower_frame, x_wm_set_window_state):
18425         (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
18426         (x_destroy_window, x_delete_display):
18427         Now static.
18428         (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
18429         (x_mouse_leave): Remove; unused.
18430         * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
18431         (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
18432         (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
18433         Remove decls.
18434         (x_mouse_leave): Declare only if WINDOWSNT.
18435         (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
18436         (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
18437         USE_X_TOOLKIT.
18439         * ftxfont.c: Make symbols static if they're not exported.
18440         (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
18441         HAVE_FREETYPE.
18442         * font.h (ftxfont_driver): Likewise.
18444         * xfns.c: Make symbols static if they're not exported.
18445         (x_last_font_name, x_display_info_for_name):
18446         (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
18447         (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
18448         (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
18449         (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
18450         (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
18451         (last_show_tip_args): Now static.
18452         (xic_defaut_fontset, xic_create_fontsetname): Define only if
18453         defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
18454         (x_screen_planes): Remove; unused.
18455         * dispextern.h (x_screen_planes): Remove decl.
18457         * dispnew.c: Make symbols static if they're not exported.
18458         * dispextern.h (redraw_garbaged_frames, scrolling):
18459         (increment_row_positions): Remove.
18460         * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
18461         (delayed_size_change, glyph_matrix_count, glyph_pool_count):
18462         Now static.
18463         (redraw_garbaged_frames): Remove; unused.
18465         * xfaces.c: Make symbols static if they're not exported.
18466         * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
18467         Remove decls.
18468         * xterm.h (defined_color): Remove decls.
18469         (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
18470         * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
18471         (menu_face_changed_default, defined_color, free_realized_face):
18472         (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
18473         (ascii_face_of_lisp_face): Remove; unused.
18475         * xdisp.c: Make symbols static if they're not exported.
18476         * dispextern.h (scratch_glyph_row, window_box_edges):
18477         (glyph_to_pixel_coords, set_cursor_from_row):
18478         (get_next_display_element, set_iterator_to_next):
18479         (highlight_trailing_whitespace, frame_to_window_pixel_xy):
18480         (show_mouse_face): Remove decls
18481         * frame.h (message_buf_print): Likewise.
18482         * lisp.h (pop_message, set_message, check_point_in_composition):
18483         Likewise.
18484         * xterm.h (set_vertical_scroll_bar): Likewise.
18485         * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
18486         (message_buf_print, scratch_glyph_row, displayed_buffer):
18487         (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
18488         (get_next_display_element, show_mouse_face, window_box_edges):
18489         (frame_to_window_pixel_xy, check_point_in_composition):
18490         (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
18491         (glyph_to_pixel_coords): Remove; unused.
18493         * dired.c (file_name_completion): Now static.
18495         * dbusbind.c (xd_in_read_queued_messages): Now static.
18497         * lisp.h (circular_list_error, FOREACH): Remove; unused.
18498         * data.c (circular_list_error): Remove.
18500         * commands.h (last_point_position, last_point_position_buffer):
18501         (last_point_position_window): Remove decls.
18502         * keyboard.c: Make these variables static.
18504         * coding.h (coding, code_convert_region, encode_coding_gap):
18505         Remove decls.
18506         * coding.c (Vsjis_coding_system, Vbig5_coding_system):
18507         (iso_code_class, detect_coding, code_convert_region): Now static.
18508         (encode_coding_gap): Remove; unused.
18510         * chartab.c (chartab_chars, chartab_bits): Now static.
18512         * charset.h (charset_iso_8859_1): Remove decl.
18513         * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
18514         Now static.
18516         * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
18517         * ccl.c (Vccl_program_table): Now static.
18518         (check_ccl_update): Remove; unused.
18520         * category.c (SET_CATEGORY_SET, set_category_set): Move here.
18521         * category.h: ... from here.
18522         * category.c (check_category_table, set_category_set): Now static.
18524         * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
18525         * lisp.h: Remove these decls.
18527         * buffer.c (buffer_count): Remove unused var.
18529         * bidi.c (bidi_dump_cached_states): Mark as externally visible,
18530         so that it's not optimized away.
18531         (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
18532         * dispextern.h (bidi_dump_cached_states): Remove, since it's
18533         exported only to the debugger.
18535         * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
18536         * atimer.h (run_all_atimers): Remove; not exported.
18538         font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
18539         * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
18540         was inaccessible from Lisp.
18541         (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
18542         * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
18544         alloc.c: Import and export fewer symbols, and remove unused items.
18545         * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
18546         is defined.
18547         (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
18548         it's not optimized away by whole-program optimization.
18549         (message_enable_multibyte, free_misc): Remove.
18550         (catchlist, handlerlist, mark_backtrace):
18551         Declare only if BYTE_MARK_STACK.
18552         (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
18553         * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
18554         (message_enable_multibyte): Remove decl.
18555         (free_misc, interval_free_list, float_block, float_block_index):
18556         (n_float_blocks, float_free_list, cons_block, cons_block_index):
18557         (cons_free_list, last_marked_index):
18558         Now static.
18559         (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
18560         * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
18561         (mark_backtrace): Define only if BYTE_MARK_STACK.
18562         * xdisp.c (message_enable_multibyte): Now static.
18564         Declare Lisp_Object Q* variables to be 'static' if not exported.
18565         This makes it easier for human readers (and static analyzers)
18566         to see whether these variables are used from other modules.
18567         * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
18568         * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
18569         * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
18570         * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
18571         * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
18572         * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
18573         * xmenu.c, xselect.c:
18574         Declare Q* vars static if they are not used in other modules.
18575         * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
18576         * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
18577         Remove decls of unexported vars.
18578         * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
18580         * lisp.h (DEFINE_FUNC): Make sname 'static'.
18582         Make Emacs functions such as Fatom 'static' by default.
18583         This makes it easier for human readers (and static analyzers)
18584         to see whether these functions can be called from other modules.
18585         DEFUN now defines a static function.  To make the function external
18586         so that it can be used in other C modules, use the new macro DEFUE.
18587         * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
18588         (Finit_image_library):
18589         (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
18590         (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
18591         (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
18592         Remove decls, since these functions are now static.
18593         (Funintern, Fget_internal_run_time): New decls, since these functions
18594         were already external.
18596         * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
18597         * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
18598         * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
18599         * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
18600         * keyboard.c, keymap.c, lread.c:
18601         * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
18602         * syntax.c, term.c, terminal.c, textprop.c, undo.c:
18603         * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
18604         Mark functions with DEFUE instead of DEFUN,
18605         if they are used in other modules.
18606         * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
18607         decls for now-static functions.
18608         * buffer.h (Fdelete_overlay): Remove decl.
18609         * callproc.c (Fgetenv_internal): Mark as internal.
18610         * composite.c (Fremove_list_of_text_properties): Remove decl.
18611         (Fcomposition_get_gstring): New forward static decl.
18612         * composite.h (Fcomposite_get_gstring): Remove decl.
18613         * dired.c (Ffile_attributes): New forward static decl.
18614         * doc.c (Fdocumntation_property): New forward static decl.
18615         * eval.c (Ffetch_bytecode): New forward static decl.
18616         (Funintern): Remove extern decl; now in .h file where it belongs.
18617         * fileio.c (Fmake_symbolic_link): New forward static decl.
18618         * image.c (Finit_image_library): New forward static decl.
18619         * insdel.c (Fcombine_after_change_execute): Make forward decl static.
18620         * intervals.h (Fprevious_property_change):
18621         (Fremove_list_of_text_properties): Remove decls.
18622         * keyboard.c (Fthis_command_keys): Remove decl.
18623         (Fcommand_execute): New forward static decl.
18624         * keymap.c (Flookup_key): New forward static decl.
18625         (Fcopy_keymap): Now static.
18626         * keymap.h (Flookup_key): Remove decl.
18627         * process.c (Fget_process): New forward static decl.
18628         (Fprocess_datagram_address): Mark as internal.
18629         * syntax.c (Fsyntax_table_p): New forward static decl.
18630         (skip_chars): Remove duplicate decl.
18631         * textprop.c (Fprevious_property_change): New forward static decl.
18632         * window.c (Fset_window_fringes, Fset_window_scroll_bars):
18633         Now internal.
18634         (Fset_window_margins, Fset_window_vscroll): New forward static decls.
18635         * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
18637         * editfns.c (Fformat): Remove unreachable code.
18639 2011-04-14  Andreas Schwab  <schwab@linux-m68k.org>
18641         * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
18642         change.  (Bug#8496)
18644 2011-04-13  Eli Zaretskii  <eliz@gnu.org>
18646         * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
18647         when at ZV.  (Bug#8487)
18649 2011-04-12  Andreas Schwab  <schwab@linux-m68k.org>
18651         * charset.c (Fclear_charset_maps): Use xfree instead of free.
18652         (Bug#8437)
18653         * keyboard.c (parse_tool_bar_item): Likewise.
18654         * sound.c (sound_cleanup, alsa_close): Likewise.
18655         * termcap.c (tgetent): Likewise.
18656         * xfns.c (x_default_font_parameter): Likewise.
18657         * xsettings.c (read_and_apply_settings): Likewise.
18659         * alloc.c (overrun_check_malloc, overrun_check_realloc)
18660         (overrun_check_free): Protoize.
18662 2011-04-12  Paul Eggert  <eggert@cs.ucla.edu>
18664         * sysdep.c (emacs_read, emacs_write): Check for negative sizes
18665         since callers should never pass a negative size.
18666         Change the signature to match that of plain 'read' and 'write'; see
18667         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
18668         * lisp.h: Update prototypes of emacs_write and emacs_read.
18670 2011-04-11  Eli Zaretskii  <eliz@gnu.org>
18672         * xdisp.c (redisplay_window): Don't try to determine the character
18673         position of the scroll margin if the window start point w->startp
18674         is outside the buffer's accessible region.  (Bug#8468)
18676 2011-04-10  Eli Zaretskii  <eliz@gnu.org>
18678         Fix write-region and its subroutines for buffers > 2GB.
18679         * fileio.c (a_write, e_write): Modify declaration of arguments and
18680         local variables to support buffers larger than 2GB.
18681         (Fcopy_file): Use EMACS_INT for return value of emacs_read.
18683         * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
18684         argument, local variables, and return value.
18686         * lisp.h: Update prototypes of emacs_write and emacs_read.
18688         * sound.c (vox_write): Use ssize_t for return value of emacs_write.
18690 2011-04-10  Paul Eggert  <eggert@cs.ucla.edu>
18692         * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
18694         Fix more problems found by GCC 4.6.0's static checks.
18696         * xdisp.c (vmessage): Use a better test for character truncation.
18698         * charset.c (load_charset_map): <, not <=, for optimization,
18699         and to avoid potential problems with integer overflow.
18700         * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
18701         * casetab.c (set_identity, shuffle): Likewise.
18702         * editfns.c (Fformat): Likewise.
18703         * syntax.c (skip_chars): Likewise.
18705         * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
18706         This also lets GCC 4.6.0 generate slightly better loop code.
18708         * callint.c (Fcall_interactively): <, not <=, for optimization.
18709         (Fcall_interactively): Count the number of arguments produced,
18710         not the number of arguments given.  This is simpler and lets GCC
18711         4.6.0 generate slightly better code.
18713         * ftfont.c: Distingish more carefully between FcChar8 and char.
18714         The previous code passed unsigned char * to a functions like
18715         strlen and xstrcasecmp that expect char *, which does not
18716         conform to the C standard.
18717         (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
18718         arguments to FcPatternGetString, and explicitly cast FcChar8 * to
18719         char * when the C standard requires it.
18721         * keyboard.c (read_char): Remove unused var.
18723         * eval.c: Port to Windows vsnprintf (Bug#8435).
18724         Include <limits.h>.
18725         (SIZE_MAX): Define if the headers do not.
18726         (verror): Do not give up if vsnprintf returns a negative count.
18727         Instead, grow the buffer.  This ports to Windows vsnprintf, which
18728         does not conform to C99.  Problem reported by Eli Zaretskii.
18729         Also, simplify the allocation scheme, by avoiding the need for
18730         calling realloc, and removing the ALLOCATED variable.
18732         * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
18734         Remove invocations of doprnt, as Emacs now uses vsnprintf.
18735         But keep the doprint source code for now, as we might revamp it
18736         and use it again (Bug#8435).
18737         * lisp.h (doprnt): Remove.
18738         * Makefile.in (base_obj): Remove doprnt.o.
18739         * deps.mk (doprnt.o): Remove.
18741         error: Print 32- and 64-bit integers portably (Bug#8435).
18742         Without this change, on typical 64-bit hosts error ("...%d...", N)
18743         was used to print both 32- and 64-bit integers N, which relied on
18744         undefined behavior.
18745         * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
18746         * lisp.h (error, verror): Mark as printf-like functions.
18747         * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
18748         Report overflow in size calculations when allocating printf buffer.
18749         Do not truncate output string at its first null byte.
18750         * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
18751         Truncate the output at a character boundary, since vsnprintf does not
18752         do that.
18753         * charset.c (check_iso_charset_parameter): Convert internal
18754         character to string before calling 'error', since %c now has the
18755         printf meaning.
18756         * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
18757         overflow when computing char to be passed to 'error'.  Do not
18758         pass Lisp_Object to 'error'; pass the integer instead.
18759         * nsfns.m (Fns_do_applescript): Use int, not long, since it's
18760         formatted with plain %d.
18762         * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
18764         * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
18766         * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
18768         * xterm.c (x_catch_errors): Remove duplicate declaration.
18770         * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
18772         * xdisp.c, lisp.h (message_nolog): Remove; unused.
18774 2011-04-10  Jim Meyering  <meyering@redhat.com>
18776         use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
18777         * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
18778         return ssize_t not "int", and use size_t as the buffer length.
18779         (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
18780         * gnutls.h: Update declarations.
18781         * process.c (read_process_output): Use ssize_t, to match.
18782         (send_process): Likewise.
18784 2011-04-09  Chong Yidong  <cyd@stupidchicken.com>
18786         * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
18788 2011-04-09  Chong Yidong  <cyd@stupidchicken.com>
18790         * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
18791         Use unsigned char, to match FcChar8 type definition.
18793         * xterm.c (handle_one_xevent):
18794         * xmenu.c (create_and_show_popup_menu):
18795         * xselect.c (x_decline_selection_request)
18796         (x_reply_selection_request): Avoid type-punned deref of X events.
18798 2011-04-09  Eli Zaretskii  <eliz@gnu.org>
18800         Fix some uses of `int' instead of EMACS_INT.
18801         * search.c (string_match_1, fast_string_match)
18802         (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
18803         (scan_buffer, find_next_newline_no_quit)
18804         (find_before_next_newline, search_command, Freplace_match)
18805         (Fmatch_data): Make some `int' variables be EMACS_INT.
18807         * xdisp.c (display_count_lines): 3rd argument and return value now
18808         EMACS_INT.  All callers changed.
18809         (pint2hrstr): Last argument is now EMACS_INT.
18811         * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
18812         (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
18813         (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
18814         (decode_coding_utf_16, decode_coding_emacs_mule)
18815         (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
18816         (decode_coding_ccl, decode_coding_charset)
18817         <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
18818         (decode_coding_iso_2022, decode_coding_emacs_mule)
18819         (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
18820         <char_offset, last_offset>: Declare EMACS_INT.
18821         (encode_coding_utf_8, encode_coding_utf_16)
18822         (encode_coding_emacs_mule, encode_invocation_designation)
18823         (encode_designation_at_bol, encode_coding_iso_2022)
18824         (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
18825         (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
18826         Declare EMACS_INT.
18827         (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
18828         (encode_invocation_designation): Last argument P_NCHARS is now
18829         EMACS_INT.
18830         (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
18831         (produce_chars): from_nchars and to_nchars are now EMACS_INT.
18833         * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
18834         All users changed.
18836         * ccl.c (Fccl_execute_on_string): Declare some variables
18837         EMACS_INT.
18839 2011-04-08  Samuel Thibault  <sthibault@debian.org>  (tiny change)
18841         * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
18843 2011-03-19  Christoph Scholtes  <cschol2112@googlemail.com>
18845         * process.c (Fformat_network_address): Doc fix.
18847 2011-04-08  T.V. Raman  <tv.raman.tv@gmail.com>  (tiny change)
18849         * xml.c (parse_region): Avoid creating spurious whitespace nodes.
18851 2011-04-08  Chong Yidong  <cyd@stupidchicken.com>
18853         * keyboard.c (read_char): Call Lisp function help-form-show,
18854         instead of using internal_with_output_to_temp_buffer.
18855         (Qhelp_form_show): New var.
18856         (syms_of_keyboard): Use DEFSYM macro.
18858         * print.c (internal_with_output_to_temp_buffer): Function deleted.
18860         * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
18862 2011-04-06  Chong Yidong  <cyd@stupidchicken.com>
18864         * process.c (Flist_processes): Remove to Lisp.
18865         (list_processes_1): Delete.
18867 2011-04-06  Eli Zaretskii  <eliz@gnu.org>
18869         * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
18871         * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
18873 2011-04-06  Paul Eggert  <eggert@cs.ucla.edu>
18875         Fix more problems found by GCC 4.6.0's static checks.
18877         * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
18879         * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
18881         * lisp.h (message, message_nolog, fatal): Mark as printf-like.
18883         * xdisp.c (vmessage): Mark as a printf-like function.
18885         * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
18887         * sound.c (sound_warning): Don't crash if arg contains a printf format.
18889         * image.c (tiff_error_handler, tiff_warning_handler): Mark as
18890         printf-like functions.
18891         (tiff_load): Add casts to remove these marks before passing them
18892         to system-supplied API.
18894         * eval.c (Fsignal): Remove excess argument to 'fatal'.
18896         * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
18897         This avoids several warnings with gcc -Wstrict-overflow.
18898         (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
18899         directly, rather than having caller test rule sign.  This avoids
18900         some unnecessary tests.
18901         * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
18902         (COMPOSITION_ENCODE_RULE): Arguments now must be valid.  This
18903         affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
18905         * xfont.c (xfont_text_extents): Remove var that was set but not used.
18906         (xfont_open): Avoid unnecessary tests.
18908         * composite.c (composition_gstring_put_cache): Use unsigned integer.
18910         * composite.h, composite.c (composition_gstring_put_cache):
18911         Use EMACS_INT, not int, for length.
18913         * composite.h (COMPOSITION_DECODE_REFS): New macro,
18914         breaking out part of COMPOSITION_DECODE_RULE.
18915         (COMPOSITION_DECODE_RULE): Use it.
18916         * composite.c (get_composition_id): Remove unused local vars,
18917         by using the new macro.
18919         * textprop.c (set_text_properties_1): Change while to do-while,
18920         since the condition is always true at first.
18922         * intervals.c (graft_intervals_into_buffer): Mark var as used.
18923         (interval_deletion_adjustment): Return unsigned value.
18924         All uses changed.
18926         * process.c (list_processes_1, create_pty, read_process_output):
18927         (exec_sentinel): Remove vars that were set but not used.
18928         (create_pty): Remove unnecessary "volatile"s.
18929         (Fnetwork_interface_info): Avoid possibility of int overflow.
18930         (read_process_output): Do adaptive read buffering even if carryover.
18931         (read_process_output): Simplify nbytes computation if buffered.
18933         * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
18935         * syntax.c (scan_words): Remove var that was set but not used.
18936         (update_syntax_table): Use unsigned instead of int.
18938         * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
18939         (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
18940         (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
18942         * print.c (print_error_message): Avoid int overflow.
18944         * font.c (font_list_entities): Redo for clarity,
18945         so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
18947         * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
18948         (font_score): Avoid potential overflow in diff calculation.
18950         * fns.c (substring_both): Remove var that is set but not used.
18951         (sxhash): Redo loop for clarity and to avoid wraparound warning.
18953         * eval.c (funcall_lambda): Rename local to avoid shadowing.
18955         * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
18956         Otherwise, GCC 4.6.0 optimizes the loop check away since the check
18957         can always succeed if overflow has undefined behavior.
18959         * search.c (boyer_moore, wordify): Remove vars set but not used.
18960         (wordify): Omit three unnecessary tests.
18962         * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
18963         All callers changed.  This avoids the need for an unused var.
18965         * casefiddle.c (casify_region): Remove var that is set but not used.
18967         * dired.c (file_name_completion): Remove var that is set but not used.
18969         * fileio.c (Finsert_file_contents): Make EOF condition clearer.
18971         * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
18972         (Finsert_file_contents): Remove unnecessary code checking fd.
18974         * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
18975         Check for integer overflow on size calculations.
18977         * buffer.c (Fprevious_overlay_change): Remove var that is set
18978         but not used.
18980         * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
18981         Remove vars that are set but not used.
18982         (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
18983         (timer_check_2): Mark vars as initialized.
18985         * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
18987         * image.c (lookup_image): Remove var that is set but not used.
18988         (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
18990         * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
18991         that are set but not used.
18993         * xfns.c (make_invisible_cursor): Don't return garbage
18994         if XCreateBitmapFromData fails (Bug#8410).
18996         * xselect.c (x_get_local_selection, x_handle_property_notify):
18997         Remove vars that are set but not used.
18999         * xfns.c (x_create_tip_frame): Remove var that is set but not used.
19000         (make_invisible_cursor): Initialize a possibly-uninitialized variable.
19002         * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
19003         Remove var that is set but not used.
19004         (scroll_bar_windows_size): Now size_t, not int.
19005         (x_send_scroll_bar_event): Use size_t, not int, for sizes.
19006         Check for overflow.
19008         * xfaces.c (realize_named_face): Remove vars that are set but not used.
19009         (map_tty_color) [!defined MSDOS]: Likewise.
19011         * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
19013         * coding.c: Remove vars that are set but not used.
19014         (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
19015         All callers changed.
19016         (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
19017         (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
19018         (decode_coding_charset): Remove vars that are set but not used.
19020         * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
19021         that is set but not used.
19023         * print.c (print_object): Remove var that is set but not used.
19025         Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
19026         The gnulib version avoids calling malloc in the usual case,
19027         and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
19028         * fileio.c (Ffile_symlink_p): Use emacs_readlink.
19029         * filelock.c (current_lock_owner): Likewise.
19030         * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
19031         * sysdep.c: Include allocator.h, careadlinkat.h.
19032         (emacs_no_realloc_allocator): New static constant.
19033         (emacs_readlink): New function.
19034         * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
19035         ../lib/careadlinkat.h.
19037 2011-04-04  Stefan Monnier  <monnier@iro.umontreal.ca>
19039         * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
19040         first non-nil return value).
19042 2011-04-03  Jan Djärv  <jan.h.d@swipnet.se>
19044         * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
19045         if not defined (Bug#8403).
19047 2011-04-02  Juanma Barranquero  <lekktu@gmail.com>
19049         * xdisp.c (display_count_lines): Remove parameter `start',
19050         unused since 1998-01-01T02:27:27Z!rms@gnu.org.  All callers changed.
19051         (get_char_face_and_encoding): Remove parameter `multibyte_p',
19052         unused since 2008-05-14T01:40:23Z!handa@m17n.org.  All callers changed.
19053         (fill_stretch_glyph_string): Remove parameters `row' and `area',
19054         unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
19055         and thereabouts.  All callers changed.
19056         (get_per_char_metric): Remove parameter `f', unused since
19057         2008-05-14T01:40:23Z!handa@m17n.org.  All callers changed.
19059 2011-04-02  Jim Meyering  <meyering@redhat.com>
19061         do not dereference NULL upon failed strdup
19062         * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
19063         (ns_get_family): Likewise.
19065 2011-04-02  Juanma Barranquero  <lekktu@gmail.com>
19067         * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
19069 2011-04-02  Jan Djärv  <jan.h.d@swipnet.se>
19071         * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
19072         later (Bug#8403).
19074 2011-04-01  Stefan Monnier  <monnier@iro.umontreal.ca>
19076         Add lexical binding.
19078         * window.c (Ftemp_output_buffer_show): New fun.
19079         (Fsave_window_excursion):
19080         * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
19082         * lread.c (lisp_file_lexically_bound_p): New function.
19083         (Fload): Bind Qlexical_binding.
19084         (readevalloop): Remove `evalfun' arg.
19085         Bind Qinternal_interpreter_environment.
19086         (Feval_buffer): Bind Qlexical_binding.
19087         (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
19088         Mark as dynamic.
19089         (syms_of_lread): Declare `lexical-binding'.
19091         * lisp.h (struct Lisp_Symbol): New field `declared_special'.
19093         * keyboard.c (eval_dyn): New fun.
19094         (menu_item_eval_property): Use it.
19096         * image.c (parse_image_spec): Use Ffunctionp.
19098         * fns.c (concat, mapcar1): Accept byte-code-functions.
19100         * eval.c (Fsetq): Handle lexical vars.
19101         (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
19102         (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
19103         (FletX, Flet): Obey lexical binding.
19104         (Fcommandp): Handle closures.
19105         (Feval): New `lexical' arg.
19106         (eval_sub): New function extracted from Feval.  Use it almost
19107         everywhere where Feval was used.  Look up vars in lexical env.
19108         Handle closures.
19109         (Ffunctionp): Move from subr.el.
19110         (Ffuncall): Handle closures.
19111         (apply_lambda): Remove `eval_flags'.
19112         (funcall_lambda): Handle closures and new byte-code-functions.
19113         (Fspecial_variable_p): New function.
19114         (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
19115         but without exporting it to Lisp.
19117         * doc.c (Fdocumentation, store_function_docstring):
19118         * data.c (Finteractive_form): Handle closures.
19120         * callint.c (Fcall_interactively): Preserve lexical-binding mode for
19121         interactive spec.
19123         * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
19124         New byte-codes.
19125         (exec_byte_code): New function extracted from Fbyte_code to handle new
19126         calling convention for byte-code-functions.  Add new byte-codes.
19128         * buffer.c (defvar_per_buffer): Set new `declared_special' field.
19130         * alloc.c (Fmake_symbol): Init new `declared_special' field.
19132 2011-03-31  Juanma Barranquero  <lekktu@gmail.com>
19134         * xdisp.c (redisplay_internal): Fix prototype.
19136 2011-03-31  Eli Zaretskii  <eliz@gnu.org>
19138         * xdisp.c (SCROLL_LIMIT): New macro.
19139         (try_scrolling): Use it when setting scroll_limit.
19140         Limit scrolling to 100 screen lines.
19141         (redisplay_window): Even when falling back on "recentering",
19142         position point in the window according to scroll-conservatively,
19143         scroll-margin, and scroll-*-aggressively variables.  (Bug#6671)
19145         (try_scrolling): When point is above the window, allow searching
19146         as far as scroll_max, or one screenful, to compute vertical
19147         distance from PT to the scroll margin position.  This prevents
19148         try_scrolling from unnecessarily failing when
19149         scroll-conservatively is set to a value slightly larger than the
19150         window height.  Clean up the case of PT below the margin at bottom
19151         of window: scroll_max can no longer be INT_MAX.  When aggressive
19152         scrolling is in use, don't let point enter the opposite scroll
19153         margin as result of the scroll.
19154         (syms_of_xdisp) <scroll-conservatively>: Document the
19155         threshold of 100 lines for never-recentering scrolling.
19157 2011-03-31  Juanma Barranquero  <lekktu@gmail.com>
19159         * dispextern.h (move_it_by_lines):
19160         * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
19161         since 2000-12-29T14:24:09Z!gerd@gnu.org.  All callers changed.
19162         (message_log_check_duplicate): Remove parameters `prev_bol' and
19163         `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org.  All callers changed.
19164         (redisplay_internal): Remove parameter `preserve_echo_area',
19165         unused since 1999-07-21T21:43:52Z!gerd@gnu.org.  All callers changed.
19167         * indent.c (Fvertical_motion):
19168         * window.c (window_scroll_pixel_based, Frecenter):
19169         Don't pass `need_y_p' to `move_it_by_lines'.
19171 2011-03-30  Stefan Monnier  <monnier@iro.umontreal.ca>
19173         * eval.c (struct backtrace): Don't cheat with negative numbers, but do
19174         steal a few bits to be more compact.
19175         (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
19176         Remove unneeded casts.
19178         * bytecode.c (Fbyte_code): CAR and CDR can GC.
19180 2011-03-30  Zachary Kanfer  <zkanfer@gmail.com>  (tiny change)
19182         * keyboard.c (Fexecute_extended_command): Do log the "suggest key
19183         binding" message (bug#7967).
19185 2011-03-30  Paul Eggert  <eggert@cs.ucla.edu>
19187         Fix more problems found by GCC 4.6.0's static checks.
19189         * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
19190         Remove unused local var.
19192         * editfns.c (Fmessage_box): Remove unused local var.
19194         * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
19195         (note_mode_line_or_margin_highlight, note_mouse_highlight):
19196         Omit unused local vars.
19197         * window.c (shrink_windows): Omit unused local var.
19198         * menu.c (digest_single_submenu): Omit unused local var.
19199         * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
19200         Omit unused local var.
19202         * keyboard.c (parse_modifiers_uncached, parse_modifiers):
19203         Don't assume string length fits in int.
19204         (keyremap_step, read_key_sequence): Use size_t for sizes.
19205         (read_key_sequence): Don't check last_real_key_start redundantly.
19207         * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
19208         instead of alloca (Bug#8344).
19210         * eval.c (Fbacktrace): Don't assume nargs fits in int.
19211         (Fbacktrace_frame): Don't assume nframes fits in int.
19213         * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
19215         * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
19216         concerns.
19218         * term.c (produce_glyphless_glyph): Remove unnecessary test.
19220         * cm.c (calccost): Turn while-do into do-while, for clarity.
19222         * keyboard.c (syms_of_keyboard): Use the same style as later
19223         in this function when indexing through an array.  This also
19224         works around GCC bug 48267.
19226         * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
19228         * xselect.c (x_check_property_data): Return correct size (Bug#8335).
19230         * chartab.c (sub_char_table_ref_and_range): Redo for slight
19231         efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
19233         * keyboard.c, keyboard.h (num_input_events): Now size_t.
19234         This avoids undefined behavior on integer overflow, and is a bit
19235         more convenient anyway since it is compared to a size_t variable.
19237         Variadic C functions now count arguments with size_t, not int.
19238         This avoids an unnecessary limitation on 64-bit machines, which
19239         caused (substring ...) to crash on large vectors (Bug#8344).
19240         * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
19241         (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
19242         All variadic functions and their callers changed accordingly.
19243         (struct gcpro.nvars): Now size_t, not int.  All uses changed.
19244         * data.c (arith_driver, float_arith_driver): Likewise.
19245         * editfns.c (general_insert_function): Likewise.
19246         * eval.c (struct backtrace.nargs, interactive_p)
19247         (internal_condition_case_n, run_hook_with_args, apply_lambda)
19248         (funcall_lambda, mark_backtrace): Likewise.
19249         * fns.c (concat): Likewise.
19250         * frame.c (x_set_frame_parameters): Likewise.
19251         * fns.c (get_key_arg): Now accepts and returns size_t, and returns
19252         0 if not found, not -1.  All callers changed.
19254         * alloc.c (garbage_collect): Don't assume stack size fits in int.
19255         (stack_copy_size): Now size_t, not int.
19256         (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
19258 2011-03-28  Juanma Barranquero  <lekktu@gmail.com>
19260         * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
19261         unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
19262         All callers changed.
19264         * lisp.h (multibyte_char_to_unibyte):
19265         * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
19266         unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
19267         * character.h (CHAR_TO_BYTE8):
19268         * cmds.c (internal_self_insert):
19269         * editfns.c (general_insert_function):
19270         * keymap.c (push_key_description):
19271         * search.c (Freplace_match):
19272         * xdisp.c (message_dolog, set_message_1): All callers changed.
19274 2011-03-28  Stefan Monnier  <monnier@iro.umontreal.ca>
19276         * keyboard.c (safe_run_hook_funcall): New function.
19277         (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
19278         don't set the hook to nil, but remove the offending function instead.
19279         (Qcommand_hook_internal): Remove, unused.
19280         (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
19281         Vcommand_hook_internal.
19283         * eval.c (enum run_hooks_condition): Remove.
19284         (funcall_nil, funcall_not): New functions.
19285         (run_hook_with_args): Call each function through a `funcall' argument.
19286         Remove `cond' argument, now redundant.
19287         (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
19288         (Frun_hook_with_args_until_failure): Adjust accordingly.
19289         (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
19291 2011-03-28  Juanma Barranquero  <lekktu@gmail.com>
19293         * dispextern.h (string_buffer_position): Remove declaration.
19295         * print.c (strout): Remove parameter `multibyte', unused since
19296         1999-08-21T19:30:21Z!gerd@gnu.org.  All callers changed.
19298         * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
19299         never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
19300         All callers changed.
19302         * w32.c (_wsa_errlist): Use braces for struct initializers.
19304         * xdisp.c (string_buffer_position_lim): Remove parameter `w',
19305         never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
19306         All callers changed.
19307         (string_buffer_position): Likewise.  Also, make static (it's never
19308         used outside xdisp.c).
19309         (cursor_row_p): Remove parameter `w', unused since
19310         2000-10-17T16:08:57Z!gerd@gnu.org.  All callers changed.
19311         (decode_mode_spec): Remove parameter `precision', introduced during
19312         Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
19313         All callers changed.
19315 2011-03-27  Jan Djärv  <jan.h.d@swipnet.se>
19317         * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
19319 2011-03-27  Anders Lindgren  <andlind@gmail.com>
19321         * nsterm.m (ns_menu_bar_is_hidden): New variable.
19322         (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
19323         (ns_update_auto_hide_menu_bar): New functions.
19324         (ns_update_begin): Call ns_update_auto_hide_menu_bar.
19325         (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
19326         ns_constrain_all_frames.
19327         (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
19328         (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
19330 2011-03-27  Jan Djärv  <jan.h.d@swipnet.se>
19332         * nsmenu.m (runDialogAt): Remove argument to timer_check.
19334 2011-03-27  Glenn Morris  <rgm@gnu.org>
19336         * syssignal.h: Replace RETSIGTYPE with void.
19337         * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
19338         * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
19339         Replace SIGTYPE with void everywhere.
19340         * s/usg5-4-common.h (SIGTYPE): Remove definition.
19341         * s/template.h (SIGTYPE): Remove commented out definition.
19343 2011-03-26  Eli Zaretskii  <eliz@gnu.org>
19345         * xdisp.c (redisplay_window): Don't check buffer's clip_changed
19346         flag as a prerequisite for invoking try_scrolling.  (Bug#6671)
19348 2011-03-26  Juanma Barranquero  <lekktu@gmail.com>
19350         * w32.c (read_unc_volume): Use parameter `henum', instead of
19351         global variable `wget_enum_handle'.
19353         * keymap.c (describe_vector): Remove parameters `indices' and
19354         `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
19355         (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
19357         * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
19359         * keyboard.c (timer_check): Remove parameter `do_it_now',
19360         unused since 1996-04-12T06:01:29Z!rms@gnu.org.
19361         (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
19362         unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
19364         * keyboard.c (read_char):
19365         * w32menu.c (w32_menu_display_help):
19366         * xmenu.c (show_help_event, menu_help_callback):
19367         Adjust calls to `show_help_echo'.
19369         * gtkutil.c (xg_maybe_add_timer):
19370         * keyboard.c (readable_events):
19371         * process.c (wait_reading_process_output):
19372         * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
19374         * insdel.c (adjust_markers_gap_motion):
19375         Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
19376         (gap_left, gap_right): Don't call it.
19378 2011-03-25  Chong Yidong  <cyd@stupidchicken.com>
19380         * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
19381         incurred during fontification.
19383 2011-03-25  Juanma Barranquero  <lekktu@gmail.com>
19385         * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
19386         (DEFVAR_PER_BUFFER): Don't pass it.
19388         * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
19389         (scrolling_window): Don't pass it.
19391 2011-03-25  Juanma Barranquero  <lekktu@gmail.com>
19393         * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
19395         * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
19396         and `suffix'.
19397         (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
19398         of variables specific to SELinux and computation of `encoded_absname'.
19400         * image.c (XPutPixel): Remove unused variable `height'.
19402         * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
19404         * unexw32.c (get_section_info): Remove unused variable `section'.
19406         * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
19407         (system_process_attributes): Remove unused variable `sess'.
19408         (sys_read): Remove unused variable `err'.
19410         * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
19411         (w32_wnd_proc): Remove unused variable `isdead'.
19412         (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
19413         (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
19414         (x_create_tip_frame): Remove unused variable `tem'.
19416         * w32inevt.c (w32_console_read_socket):
19417         Remove unused variable `no_events'.
19419         * w32term.c (x_draw_composite_glyph_string_foreground):
19420         Remove unused variable `width'.
19422 2011-03-24  Juanma Barranquero  <lekktu@gmail.com>
19424         * w32term.c (x_set_glyph_string_clipping):
19425         Don't pass uninitialized region to CombineRgn.
19427 2011-03-23  Juanma Barranquero  <lekktu@gmail.com>
19429         * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
19430         (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
19431         (Fx_close_connection): Remove unused variable `i'.
19433         * w32font.c (w32font_draw): Return number of glyphs.
19434         (w32font_open_internal): Remove unused variable `i'.
19435         (w32font_driver): Add missing initializer.
19437         * w32menu.c (utf8to16): Remove unused variable `utf16'.
19438         (fill_in_menu): Remove unused variable `items_added'.
19440         * w32term.c (last_mouse_press_frame): Remove static global variable.
19441         (w32_clip_to_row): Remove unused variable `f'.
19442         (x_delete_terminal): Remove unused variable `i'.
19444         * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
19445         (NOTHING): Remove unused static global variable.
19446         (uniscribe_check_otf): Remove unused variable `table'.
19447         (uniscribe_font_driver): Add missing initializers.
19449 2011-03-23  Julien Danjou  <julien@danjou.info>
19451         * term.c (Fsuspend_tty, Fresume_tty):
19452         * minibuf.c (read_minibuf, run_exit_minibuf_hook):
19453         * window.c (temp_output_buffer_show):
19454         * insdel.c (signal_before_change):
19455         * frame.c (Fhandle_switch_frame):
19456         * fileio.c (Fdo_auto_save):
19457         * emacs.c (Fkill_emacs):
19458         * editfns.c (save_excursion_restore):
19459         * cmds.c (internal_self_insert):
19460         * callint.c (Fcall_interactively):
19461         * buffer.c (Fkill_all_local_variables):
19462         * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
19463         Use Frun_hooks.
19464         (command_loop_1): Use Frun_hooks.  Call safe_run_hooks
19465         unconditionally since it does the check itself.
19467 2011-03-23  Paul Eggert  <eggert@cs.ucla.edu>
19469         Fix more problems found by GCC 4.5.2's static checks.
19471         * coding.c (encode_coding_raw_text): Avoid unnecessary test
19472         the first time through the loop, since we know p0 < p1 then.
19473         This also avoids a gcc -Wstrict-overflow warning.
19475         * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
19476         leading to a memory leak, possible in functions like
19477         load_charset_map_from_file that can allocate an unbounded number
19478         of objects (Bug#8318).
19480         * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
19481         that could (at least in theory) be that large.
19483         * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
19484         This is less likely to overflow, and avoids undefined behavior if
19485         overflow does occur.  All callers changed.  Use strtoul to scan
19486         for the unsigned long integer.
19487         (pint2hrstr): Simplify and tune code slightly.
19488         This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19490         * scroll.c (do_scrolling): Work around GCC bug 48228.
19491         See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
19493         * frame.c (Fmodify_frame_parameters): Simplify loop counter.
19494         This also avoids a warning with gcc -Wstrict-overflow.
19495         (validate_x_resource_name): Simplify count usage.
19496         This also avoids a warning with gcc -Wstrict-overflow.
19498         * fileio.c (Fcopy_file): Report error if fchown or fchmod
19499         fail (Bug#8306).
19501         * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
19503         * process.c (Fmake_network_process): Use socklen_t, not int,
19504         where POSIX says socklen_t is required in portable programs.
19505         This fixes a porting bug on hosts like 64-bit HP-UX, where
19506         socklen_t is wider than int (Bug#8277).
19507         (Fmake_network_process, server_accept_connection):
19508         (wait_reading_process_output, read_process_output):
19509         Likewise.
19511         * process.c: Rename or move locals to avoid shadowing.
19512         (list_processes_1, Fmake_network_process):
19513         (read_process_output_error_handler, exec_sentinel_error_handler):
19514         Rename or move locals.
19515         (Fmake_network_process): Define label "retry_connect" only if needed.
19516         (Fnetwork_interface_info): Fix pointer signedness.
19517         (process_send_signal): Add cast to avoid pointer signedness problem.
19518         (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
19519         (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
19521         Make tparam.h and terminfo.c consistent.
19522         * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
19523         Include tparam.h instead, since it declares them.
19524         * cm.h (PC): Remove extern decl; tparam.h now does this.
19525         * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
19526         * terminfo.c: Include tparam.h, to check interfaces.
19527         (tparm): Make 1st arg a const pointer in decl.  Put it at top level.
19528         (tparam): Adjust signature to match interface in tparam.h;
19529         this removes some undefined behavior.  Check that outstring and len
19530         are zero, which they always are with Emacs.
19531         * tparam.h (PC, BC, UP): New extern decls.
19533         * xftfont.c (xftfont_shape): Now static, and defined only if needed.
19534         (xftfont_open): Rename locals to avoid shadowing.
19536         * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
19537         (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
19538         (OTF_TAG_SYM): Omit macro if not needed.
19539         (ftfont_list): Remove unused local.
19540         (get_adstyle_property, ftfont_pattern_entity):
19541         (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
19542         Rename locals to avoid shadowing.
19544         * xfont.c (xfont_list_family): Mark var as initialized.
19546         * xml.c (make_dom): Now static.
19548         * composite.c (composition_compute_stop_pos): Rename local to
19549         avoid shadowing.
19550         (composition_reseat_it): Remove unused locals.
19551         (find_automatic_composition, composition_adjust_point): Likewise.
19552         (composition_update_it): Mark var as initialized.
19553         (find_automatic_composition): Mark vars as initialized,
19554         with a FIXME (Bug#8290).
19556         character.h: Rename locals to avoid shadowing.
19557         * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
19558         (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
19559         (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
19560         (BUF_DEC_POS): Be more systematic about renaming local temporaries
19561         to avoid shadowing.
19563         * textprop.c (property_change_between_p): Remove; unused.
19565         * intervals.c (interval_start_pos): Now static.
19567         * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
19569         * atimer.c (start_atimer, append_atimer_lists, set_alarm):
19570         Rename locals to avoid shadowing.
19572         * sound.c (wav_play, au_play, Fplay_sound_internal):
19573         Fix pointer signedness.
19574         (alsa_choose_format): Remove unused local var.
19575         (wav_play): Initialize a variable to 0, to prevent undefined
19576         behavior (Bug#8278).
19578         * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
19580         * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
19582         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
19583         clobbering (Bug#8298).
19584         * sysdep.c (sys_subshell): Likewise.
19585         Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
19587         * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
19588         This should get cleaned up, so that child_setup has the
19589         same signature on all platforms.
19591         * callproc.c (call_process_cleanup): Now static.
19592         (relocate_fd): Rename locals to avoid shadowing.
19594 2011-03-22  Chong Yidong  <cyd@stupidchicken.com>
19596         * xterm.c (x_clear_frame): Remove XClearWindow call.  This appears
19597         not to be necessary, and produces flickering.
19599 2011-03-20  Glenn Morris  <rgm@gnu.org>
19601         * config.in: Remove file.
19603 2011-03-20  Juanma Barranquero  <lekktu@gmail.com>
19605         * minibuf.c (Vcompleting_read_function): Don't declare, global variables
19606         are now in src/globals.h.
19607         (syms_of_minibuf): Remove spurious & from previous change.
19609 2011-03-20  Leo Liu  <sdl.web@gmail.com>
19611         * minibuf.c (completing-read-function): New variable.
19612         (completing-read-default): Rename from completing-read.
19613         (completing-read): Call completing-read-function.
19615 2011-03-19  Juanma Barranquero  <lekktu@gmail.com>
19617         * xfaces.c (Fx_load_color_file):
19618         Read color file from absolute filename (bug#8250).
19620 2011-03-19  Juanma Barranquero  <lekktu@gmail.com>
19622         * makefile.w32-in: Update dependencies.
19624 2011-03-17  Eli Zaretskii  <eliz@gnu.org>
19626         * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
19628 2011-03-17  Paul Eggert  <eggert@cs.ucla.edu>
19630         Fix more problems found by GCC 4.5.2's static checks.
19632         * process.c (make_serial_process_unwind, send_process_trap):
19633         (sigchld_handler): Now static.
19635         * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
19636         That way, the code declares only the vars that it needs.
19637         * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
19638         * s/cygwin.h (PTY_ITERATION): Likewise.
19639         * s/darwin.h (PTY_ITERATION): Likewise.
19640         * s/gnu-linux.h (PTY_ITERATION): Likewise.
19642         * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
19643         * process.c (allocate_pty): Don't declare stb unless it's needed.
19645         * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
19646         (CONSTANTLIM): Remove; unused.
19647         (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
19648         Define only if needed.
19650         * unexelf.c (unexec): Name an expression,
19651         to avoid gcc -Wbad-function-cast warning.
19652         Use a different way to cause a compilation error if anyone uses
19653         n rather than nn, a way that does not involve shadowing.
19654         (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
19656         * deps.mk (unexalpha.o): Remove; unused.
19658         New file unexec.h, the (simple) interface for unexec (Bug#8267).
19659         * unexec.h: New file.
19660         * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
19661         (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
19662         Depend on unexec.h.
19663         * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
19664         * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
19665         * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
19666         Change as necessary to match prototype in unexec.h.
19668         * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
19669         shadowing.
19670         (back_comment, skip_chars): Mark vars as initialized.
19672         * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
19673         Rename locals to avoid shadowing.
19675         * lread.c (read1): Rewrite so as not to use empty "else".
19676         (Fload, readevalloop, read1): Rename locals to avoid shadowing.
19678         * print.c (Fredirect_debugging_output): Fix pointer signedess.
19680         * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
19681         warning when compiling print.c.
19683         * font.c (font_unparse_fcname): Abort in an "impossible" situation
19684         instead of using an uninitialized var.
19685         (font_sort_entities): Mark var as initialized.
19687         * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
19689         * font.c (font_unparse_xlfd): Don't mix pointers to variables with
19690         pointers to constants.
19691         (font_parse_fcname): Remove unused vars.
19692         (font_delete_unmatched): Now static.
19693         (font_get_spec): Remove; unused.
19694         (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
19695         (font_update_drivers, Ffont_get_glyphs, font_add_log):
19696         Rename or move locals to avoid shadowing.
19698         * fns.c (require_nesting_list, require_unwind): Now static.
19699         (Ffillarray): Rename locals to avoid shadowing.
19701         * floatfns.c (domain_error2): Define only if needed.
19702         (Ffrexp, Fldexp): Rename locals to avoid shadowing.
19704         * alloc.c (mark_backtrace): Move decl from here ...
19705         * lisp.h: ... to here, so that it can be checked.
19707         * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
19708         (Fdefvar): Rewrite so as not to use empty "else".
19709         (lisp_indirect_variable): Name an expression,
19710         to avoid gcc -Wbad-function-cast warning.
19711         (Fdefvar): Rename locals to avoid shadowing.
19713         * callint.c (quotify_arg, quotify_args): Now static.
19714         (Fcall_interactively): Rename locals to avoid shadowing.
19715         Use const pointer when appropriate.
19717         * lisp.h (get_system_name, get_operating_system_release):
19718         Move decls here, to check interfaces.
19719         * process.c (get_operating_system_release): Move decl to lisp.h.
19720         * xrdb.c (get_system_name): Likewise.
19721         * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
19722         (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
19723         some of which prompt warnings from gcc -Wbad-function-cast.
19724         (Fformat_time_string, Fencode_time, Finsert_char):
19725         (Ftranslate_region_internal, Fformat):
19726         Rename or remove local vars to avoid shadowing.
19727         (Ftranslate_region_internal): Mark var as initialized.
19729         * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
19730         avoid shadowing.
19732         * lisp.h (eassert): Check that the argument compiles, even if
19733         ENABLE_CHECKING is not defined.
19735         * data.c (Findirect_variable): Name an expression, to avoid
19736         gcc -Wbad-function-cast warning.
19737         (default_value, arithcompare, arith_driver, arith_error): Now static.
19738         (store_symval_forwarding): Rename local to avoid shadowing.
19739         (Fmake_variable_buffer_local, Fmake_local_variable):
19740         Mark variables as initialized.
19741         (do_blv_forwarding, do_symval_forwarding): Remove; unused.
19743         * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
19744         (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
19745         Rename locals to avoid shadowing.
19746         (mark_stack): Move local variables into the #ifdef region where
19747         they're used.
19748         (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
19749         ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
19750         needed otherwise.
19751         (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
19752         (GC_STRING_CHARS): Remove; not used.
19753         (Fmemory_limit): Cast sbrk's returned value to char *.
19755         * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
19756         avoids undefined behavior in theory.
19758         * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
19760         Use functions, not macros, for up- and down-casing (Bug#8254).
19761         * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
19762         (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove.  All callers changed
19763         to use the following functions instead of these macros.
19764         (downcase): Adjust to lack of DOWNCASE_TABLE.  Return int, not
19765         EMACS_INT, since callers assume the returned value fits in int.
19766         (upcase1): Likewise, for UPCASE_TABLE.
19767         (uppercasep, lowercasep, upcase): New static inline functions.
19768         * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
19769         the race-condition problem in the old DOWNCASE.
19771         * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
19772         Rename locals to avoid shadowing.
19773         (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
19774         (regex_compile, re_search_2, re_match_2_internal):
19775         Remove unused local vars.
19776         (FREE_VAR): Rewrite so as not to use empty "else",
19777         which gcc can warn about.
19778         (regex_compile, re_match_2_internal): Mark locals as initialized.
19779         (RETALLOC_IF): Define only if needed.
19780         (WORDCHAR_P): Likewise.  This one is never needed, but is used
19781         only in a comment talking about a compiler bug, so put inside
19782         the #if 0 of that comment.
19783         (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
19784         (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
19785         Remove; unused.
19787         * search.c (boyer_moore): Rename locals to avoid shadowing.
19788         * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
19789         (PREV_CHAR_BOUNDARY): Likewise.
19791         * search.c (simple_search): Remove unused var.
19793         * dired.c (compile_pattern): Move decl from here ...
19794         * lisp.h: ... to here, so that it can be checked.
19795         (struct re_registers): New forward decl.
19797         * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
19799         * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
19800         All uses changed.
19801         (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
19802         Rename locals to avoid shadowing.
19803         (Fvertical_motion): Mark locals as initialized.
19805         * casefiddle.c (casify_object, casify_region): Now static.
19806         (casify_region): Mark local as initialized.
19808         * cmds.c (internal_self_insert): Rename local to avoid shadowing.
19810         * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
19811         New macros, so that the caller can use some names other than
19812         gcpro1, gcpro2, etc.
19813         (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
19814         of the new macros.
19815         (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
19816         argument, for consistency with GCPRO2_VAR, etc: it is now the
19817         prefix of the variable, not the variable itself.  All uses
19818         changed.
19819         * dired.c (directory_files_internal, file_name_completion):
19820         Rename locals to avoid shadowing.
19822         Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
19823         An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
19824         dired.c's scmp function, had undefined behavior.
19825         * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
19826         (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
19827         * buffer.h: ... to here, because these macros use current_buffer,
19828         and the new implementation with inline functions needs to have
19829         current_buffer in scope now, rather than later when the macros
19830         are used.
19831         (downcase, upcase1): New static inline functions.
19832         (DOWNCASE, UPCASE1): Reimplement using these functions.
19833         This avoids undefined behavior in expressions like
19834         DOWNCASE (x) == DOWNCASE (y), which previously suffered
19835         from race conditions in accessing the global variables
19836         case_temp1 and case_temp2.
19837         * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
19838         * lisp.h (case_temp1, case_temp2): Remove their decls.
19839         * character.h (ASCII_CHAR_P): Move from here ...
19840         * lisp.h: ... to here, so that the inline functions mentioned
19841         above can use them.
19843         * dired.c (directory_files_internal_unwind): Now static.
19845         * fileio.c (file_name_as_directory, directory_file_name):
19846         (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
19847         Now static.
19848         (file_name_as_directory): Use const pointers when appropriate.
19849         (Fexpand_file_name): Likewise.  In particular, newdir might
19850         point at constant storage, so make it a const pointer.
19851         (Fmake_directory_internal, Fread_file_name): Remove unused vars.
19852         (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
19853         signedness issues.
19854         (Fset_file_times, Finsert_file_contents, auto_save_error):
19855         Rename locals to avoid shadowing.
19857         * minibuf.c (choose_minibuf_frame_1): Now static.
19858         (Ftry_completion, Fall_completions): Rename or remove locals
19859         to avoid shadowing.
19861         * marker.c (bytepos_to_charpos): Remove; unused.
19863         * lisp.h (verify_bytepos, count_markers): New decls,
19864         so that gcc does not warn that these functions aren't declared.
19866         * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
19867         (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
19868         (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
19869         (copy_text): Remove unused local var.
19871         * filelock.c (within_one_second): Now static.
19872         (lock_file_1): Rename local to avoid shadowing.
19874         * buffer.c (fix_overlays_before): Mark locals as initialized.
19875         (fix_start_end_in_overlays): Likewise.  This function should be
19876         simplified by using pointers-to-pointers, but that's a different
19877         matter.
19878         (switch_to_buffer_1): Now static.
19879         (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
19880         (report_overlay_modification): Rename locals to avoid shadowing.
19882         * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
19883         Fix pointer signedness issue.
19884         (sys_subshell): Mark local as volatile if checking for lint,
19885         to suppress a gcc -Wclobbered warning that does not seem to be right.
19886         (MAXPATHLEN): Define only if needed.
19888         * process.c (serial_open, serial_configure): Move decls from here ...
19889         * systty.h: ... to here, so that they can be checked.
19891         * fns.c (get_random, seed_random): Move extern decls from here ...
19892         * lisp.h: ... to here, so that they can be checked.
19894         * sysdep.c (reset_io): Now static.
19895         (wait_for_termination_signal): Remove; unused.
19897         * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
19898         (copy_keymap_item, append_key, push_text_char_description):
19899         Now static.
19900         (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
19901         (DENSE_TABLE_SIZE): Remove; unused.
19902         (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
19903         (describe_map_tree):
19904         Rename locals to avoid shadowing.
19906         * keyboard.c: Declare functions static if they are not used elsewhere.
19907         (echo_char, echo_dash, cmd_error, top_level_2):
19908         (poll_for_input, handle_async_input): Now static.
19909         (read_char, kbd_buffer_get_event, make_lispy_position):
19910         (make_lispy_event, make_lispy_movement, apply_modifiers):
19911         (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
19912         (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
19913         (Fread_key_sequence_vector): Rename locals to avoid shadowing.
19914         (read_key_sequence, read_char): Mark locals as initialized.
19915         (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
19917         * keyboard.h (make_ctrl_char): New decl.
19918         (mark_kboards): Move decl here ...
19919         * alloc.c (mark_kboards): ... from here.
19921         * lisp.h (force_auto_save_soon): New decl.
19923         * emacs.c (init_cmdargs): Rename local to avoid shadowing.
19924         (DEFINE_DUMMY_FUNCTION): New macro.
19925         (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
19926         Use it.
19927         (main): Add casts to avoid warnings
19928         if GCC considers string literals to be constants.
19930         * lisp.h (fatal_error_signal): Add decl, since it's exported.
19932         * dbusbind.c: Pointer signedness fixes.
19933         (xd_signature, xd_append_arg, xd_initialize):
19934         (Fdbus_call_method, Fdbus_call_method_asynchronously):
19935         (Fdbus_method_return_internal, Fdbus_method_error_internal):
19936         (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
19937         (Fdbus_register_signal): Use SSDATA when the context wants char *.
19939         * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
19940         if GCC considers string literals to be constants.
19941         (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
19943 2011-03-16  Stefan Monnier  <monnier@iro.umontreal.ca>
19945         * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
19946         (print_preprocess, print_object): New macro to fix last change.
19948         * print.c (print_preprocess): Don't forget font objects.
19950 2011-03-16  Juanma Barranquero  <lekktu@gmail.com>
19952         * emacs.c (USAGE3): Doc fixes.
19954 2011-03-15  Andreas Schwab  <schwab@linux-m68k.org>
19956         * coding.c (detect_coding_iso_2022): Reorganize code to clarify
19957         structure.
19959 2011-03-14  Juanma Barranquero  <lekktu@gmail.com>
19961         * lisp.h (VWindow_system, Qfile_name_history):
19962         * keyboard.h (lispy_function_keys) [WINDOWSNT]:
19963         * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
19964         (w32_system_caret_x, w32_system_caret_y): Declare extern.
19966         * w32select.c: Don't #include "keyboard.h".
19967         (run_protected): Add extern declaration for waiting_for_input.
19969         * w32.c (Qlocal, noninteractive1, inhibit_window_system):
19970         * w32console.c (detect_input_pending, read_input_pending)
19971         (encode_terminal_code):
19972         * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
19973         (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
19974         (w32_system_caret_y, Qfile_name_history):
19975         * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
19976         * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
19977         * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
19978         (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
19979         * w32proc.c (Qlocal, report_file_error):
19980         * w32term.c (Vwindow_system, updating_frame):
19981         * w32uniscribe.c (initialized, uniscribe_font_driver):
19982         Remove unneeded extern declarations.
19984 2011-03-14  Chong Yidong  <cyd@stupidchicken.com>
19986         * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
19988 2011-03-13  Chong Yidong  <cyd@stupidchicken.com>
19990         * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
19991         (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
19992         These macros can no longer be used for assignment.
19994         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
19995         Assign struct members directly, instead of using BUF_BEGV etc.
19996         (record_buffer_markers, fetch_buffer_markers): New functions for
19997         recording and fetching special buffer markers.
19998         (set_buffer_internal_1, set_buffer_temp): Use them.
20000         * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
20002         * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
20004         * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
20005         (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
20007         * xdisp.c (hscroll_window_tree):
20008         (reconsider_clip_changes): Use PT instead of BUF_PT.
20010 2011-03-13  Eli Zaretskii  <eliz@gnu.org>
20012         * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
20013         $(EMACS_ROOT)/lib/intprops.h.
20015 2011-03-13  Paul Eggert  <eggert@cs.ucla.edu>
20017         Fix more problems found by GCC 4.5.2's static checks.
20019         * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
20020         to unsigned char * to avoid compiler diagnostic.
20021         (xg_free_frame_widgets): Make it clear that a local variable is
20022         needed only if USE_GTK_TOOLTIP.
20023         (gdk_window_get_screen): Make it clear that this macro is needed
20024         only if USE_GTK_TOOLTIP.
20025         (int_gtk_range_get_value): New function, which avoids a diagnostic
20026         from gcc -Wbad-function-cast.
20027         (xg_set_toolkit_scroll_bar_thumb): Use it.
20028         (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
20029         diagnostic from gcc -Wbad-function-cast.
20030         (get_utf8_string, xg_get_file_with_chooser):
20031         Rename locals to avoid shadowing.
20032         (create_dialog): Move locals to avoid shadowing.
20034         * xgselect.c (xg_select): Remove unused var.
20036         * image.c (four_corners_best): Mark locals as initialized.
20037         (gif_load): Initialize transparent_p to zero (Bug#8238).
20038         Mark another local as initialized.
20039         (my_png_error, my_error_exit): Mark with NO_RETURN.
20041         * image.c (clear_image_cache): Now static.
20042         (DIM, HAVE_STDLIB_H_1): Remove unused macros.
20043         (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
20044         (x_edge_detection): Remove unnecessary cast that
20045         gcc -Wbad-function-cast diagnoses.
20046         (gif_load): Fix pointer signedness.
20047         (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
20048         (jpeg_load, gif_load): Rename locals to avoid shadowing.
20050 2011-03-12  Paul Eggert  <eggert@cs.ucla.edu>
20052         Improve quality of tests for time stamp overflow.
20053         For example, without this patch (encode-time 0 0 0 1 1
20054         1152921504606846976) returns the obviously-bogus value (-948597
20055         62170) on my RHEL 5.5 x86-64 host.  With the patch, it correctly
20056         reports time overflow.  See
20057         <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
20058         * deps.mk (editfns.o): Depend on ../lib/intprops.h.
20059         * editfns.c: Include limits.h and intprops.h.
20060         (TIME_T_MIN, TIME_T_MAX): New macros.
20061         (time_overflow): Move earlier, to before first use.
20062         (hi_time, lo_time): New functions, for an accurate test for
20063         out-of-range times.
20064         (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
20065         (Fget_internal_run_time): Don't assume time_t fits in int.
20066         (make_time): Use list2 instead of Fcons twice.
20067         (Fdecode_time): More accurate test for out-of-range times.
20068         (check_tm_member): New function.
20069         (Fencode_time): Use it, to test for out-of-range times.
20070         (lisp_time_argument): Don't rely on undefined left-shift and
20071         right-shift behavior when checking for time stamp overflow.
20073         * editfns.c (time_overflow): New function, refactoring common code.
20074         (Fformat_time_string, Fdecode_time, Fencode_time):
20075         (Fcurrent_time_string): Use it.
20077         Move 'make_time' to be next to its inverse 'lisp_time_argument'.
20078         * dired.c (make_time): Move to ...
20079         * editfns.c (make_time): ... here.
20080         * systime.h: Note the move.
20082 2011-03-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
20084         * fringe.c (update_window_fringes): Remove unused variables.
20086         * unexmacosx.c (copy_data_segment): Also copy __got section.
20087         (Bug#8223)
20089 2011-03-12  Eli Zaretskii  <eliz@gnu.org>
20091         * termcap.c [MSDOS]: Include "msdos.h".
20092         (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
20093         Constify `char *' arguments and their references according to
20094         prototypes in tparam.h.
20096         * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
20098         * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
20099         Adapt all references accordingly.
20101         * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
20103 2011-03-11  Tom Tromey  <tromey@redhat.com>
20105         * buffer.c (syms_of_buffer): Remove obsolete comment.
20107 2011-03-11  Eli Zaretskii  <eliz@gnu.org>
20109         * termhooks.h (encode_terminal_code): Declare prototype.
20111         * msdos.c (encode_terminal_code): Don't declare prototype.
20113         * term.c (encode_terminal_code): Now external again, used by
20114         w32console.c and msdos.c.
20116         * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
20117         Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
20119 2011-03-11  Paul Eggert  <eggert@cs.ucla.edu>
20121         Fix some minor problems found by GCC 4.5.2's static checks.
20123         * fringe.c (update_window_fringes): Mark locals as initialized
20124         (Bug#8227).
20125         (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
20127         * alloc.c (mark_fringe_data): Move decl from here ...
20128         * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
20129         to check its interface.
20130         (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
20132         * fontset.c (free_realized_fontset): Now static.
20133         (Fset_fontset_font): Rename local to avoid shadowing.
20134         (fontset_font): Mark local as initialized.
20135         (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
20137         * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
20139         * xselect.c (x_disown_buffer_selections): Remove; not used.
20140         (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
20141         (x_own_selection, Fx_disown_selection_internal): Rename locals
20142         to avoid shadowing.
20143         (x_handle_dnd_message): Remove local to avoid shadowing.
20145         * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
20146         so that the caller can use some name other than gcpro1.
20147         (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
20148         * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
20149         (Fx_backspace_delete_keys_p):
20150         Use them to avoid shadowing, and rename vars to avoid shadowing.
20151         (x_decode_color, x_set_name, x_window): Now static.
20152         (Fx_create_frame): Add braces to silence GCC warning.
20153         (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
20154         (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
20155         Remove unused locals.
20156         (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
20157         (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
20158         Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
20159         macros.
20161         * xterm.h (x_mouse_leave): New decl.
20163         * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
20164         Remove unused functions.
20165         (x_shift_glyphs_for_insert, XTflash, XTring_bell):
20166         (x_calc_absolute_position): Now static.
20167         (XTread_socket): Don't define label "out" unless it's used.
20168         Don't declare local "event" unless it's used.
20169         (x_iconify_frame, x_free_frame_resources): Don't declare locals
20170         unless they are used.
20171         (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
20172         (x_fatal_error_signal): Remove; not used.
20173         (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
20174         (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
20175         (x_error_catcher, x_connection_closed, x_error_handler):
20176         (x_error_quitter, xembed_send_message, x_iconify_frame):
20177         (my_log_handler): Rename locals to avoid shadowing.
20178         (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
20179         (x_connection_closed): Tell GCC not to suggest NO_RETURN.
20181         * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
20182         Rename or move locals to avoid shadowing.
20183         (tty_defined_color, merge_face_heights): Now static.
20184         (free_realized_faces_for_fontset): Remove; not used.
20185         (Fx_list_fonts): Mark variable that gcc -Wuninitialized
20186         does not deduce is never used uninitialized.
20187         (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
20188         (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
20190         * terminal.c (store_terminal_param): Now static.
20192         * xmenu.c (menu_highlight_callback): Now static.
20193         (set_frame_menubar): Remove unused local.
20194         (xmenu_show): Rename parameter to avoid shadowing.
20195         (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
20196         since they might point to immutable storage.
20197         (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
20198         since it's unused otherwise.
20200         * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
20201         Add a FIXME, since the code still doesn't look right.  (Bug#8215)
20202         (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
20203         avoids a gcc -Wuninitialized diagnostic.
20204         (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
20205         (note_mouse_highlight): Mark variables that gcc -Wuninitialized
20206         does not deduce are never used uninitialized.
20208         * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
20210         * xdisp.c (redisplay_window): Rename local to avoid shadowing.
20211         * window.c (window_loop, size_window):
20212         (run_window_configuration_change_hook, enlarge_window): Likewise.
20214         * window.c (display_buffer): Now static.
20215         (size_window): Mark variables that gcc -Wuninitialized
20216         does not deduce are never used uninitialized.
20217         * window.h (check_all_windows): New decl, to forestall
20218         gcc -Wmissing-prototypes diagnostic.
20219         * dispextern.h (bidi_dump_cached_states): Likewise.
20221         * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
20222         shadowing.
20223         * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
20224         Include <limits.h>.
20225         (Fsort_charsets): Redo min/max calculation to shorten the code a bit
20226         and to avoid gcc -Wuninitialized warning.
20227         (load_charset_map): Mark variables that gcc -Wuninitialized
20228         does not deduce are never used uninitialized.
20229         (load_charset): Abort instead of using uninitialized var (Bug#8229).
20231         * coding.c (coding_set_source, coding_set_destination):
20232         Use "else { /* comment */ }" rather than "else /* comment */;"
20233         for clarity, and to avoid gcc -Wempty-body warning.
20234         (Fdefine_coding_system_internal): Don't redeclare 'i' inside
20235         a block, when the outer 'i' will do.
20236         (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
20237         (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
20238         (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
20239         (decode_coding_raw_text, decode_coding_charset, get_translation_table):
20240         (Fdecode_sjis_char, Fdefine_coding_system_internal):
20241         Rename locals to avoid shadowing.
20242         * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
20243         * coding.c (emacs_mule_char, encode_invocation_designation):
20244         Now static, since they're not used elsewhere.
20245         (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
20246         (decode_coding_object, encode_coding_object, detect_coding_system):
20247         (decode_coding_emacs_mule): Mark variables that gcc
20248         -Wuninitialized does not deduce are never used uninitialized.
20249         (detect_coding_iso_2022): Initialize a local variable that might
20250         be used uninitialized.  Leave a FIXME because it's not clear that
20251         this initialization is needed.  (Bug#8211)
20252         (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
20253         (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
20254         (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
20255         (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
20256         Remove unused macros.
20258         * category.c (hash_get_category_set): Remove unused local var.
20259         (copy_category_table): Now static, since it's not used elsewhere.
20260         * character.c (string_count_byte8): Likewise.
20262         * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
20263         (Fregister_code_conversion_map): Rename locals to avoid shadowing.
20265         * chartab.c (copy_sub_char_table): Now static, since it's not used
20266         elsewhere.
20267         (sub_char_table_ref_and_range, char_table_ref_and_range):
20268         Rename locals to avoid shadowing.
20269         (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
20271         * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
20272         (BIDI_BOB): Remove unused macro.
20274         * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
20275         deduce are never used uninitialized.
20276         * term.c (encode_terminal_code): Likewise.
20278         * term.c (encode_terminal_code): Now static.  Remove unused local.
20280         * tparam.h: New file.
20281         * term.c, tparam.h: Include it.
20282         * deps.mk (term.o, tparam.o): Depend on tparam.h.
20283         * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
20284         Move these decls to tparam.h, and make them agree with what
20285         is actually in tparam.c.  The previous trick of using incompatible
20286         decls in different modules does not conform to the C standard.
20287         All callers of tparam changed to use tparam's actual API.
20288         * tparam.c (tparam1, tparam, tgoto):
20289         Use const pointers where appropriate.
20291         * cm.c (calccost, cmgoto): Use const pointers where appropriate.
20292         * cm.h (struct cm): Likewise.
20293         * dispextern.h (do_line_insertion_deletion_costs): Likewise.
20294         * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
20295         * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
20296         (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
20297         (turn_on_face, init_tty): Likewise.
20298         * termchar.h (struct tty_display_info): Likewise.
20300         * term.c (term_mouse_position): Rename local to avoid shadowing.
20302         * alloc.c (mark_ttys): Move decl from here ...
20303         * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
20305 2011-03-11  Andreas Schwab  <schwab@linux-m68k.org>
20307         * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
20309 2011-03-09  Juanma Barranquero  <lekktu@gmail.com>
20311         * search.c (compile_pattern_1): Remove argument regp, unused since
20312         revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
20313         (compile_pattern): Don't pass it.
20315 2011-03-08  Jan Djärv  <jan.h.d@swipnet.se>
20317         * xterm.h (DEFAULT_GDK_DISPLAY): New define.
20318         (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
20319         for ! HAVE_GTK3.
20320         (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
20322         * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
20324         * gtkutil.c: Include gtkx.h if HAVE_GTK3.  If ! HAVE_GTK3, define
20325         gdk_window_get_screen, gdk_window_get_geometry,
20326         gdk_x11_window_lookup_for_display and GDK_KEY_g.
20327         (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
20328         (xg_get_pixbuf_from_pixmap): New function.
20329         (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
20330         to Pixmap, take frame as parameter, remove GdkColormap parameter.
20331         Call xg_get_pixbuf_from_pixmap instead of
20332         gdk_pixbuf_get_from_drawable.
20333         (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
20334         xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
20335         (xg_check_special_colors): Use GtkStyleContext and its functions
20336         for HAVE_GTK3.
20337         (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
20338         (xg_prepare_tooltip, create_dialog, menubar_map_cb)
20339         (xg_update_frame_menubar, xg_tool_bar_detach_callback)
20340         (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
20341         Call gtk_widget_get_preferred_size.
20342         (xg_frame_resized): gdk_window_get_geometry only takes 5
20343         parameters.
20344         (xg_win_to_widget, xg_event_is_for_menubar):
20345         Call gdk_x11_window_lookup_for_display.
20346         (xg_set_widget_bg): New function.
20347         (delete_cb): New function.
20348         (xg_create_frame_widgets): Connect delete-event to delete_cb.
20349         Call xg_set_widget_bg.  Only set background pixmap for ! HAVE_GTK3
20350         (xg_set_background_color): Call xg_set_widget_bg.
20351         (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
20352         (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
20353         Only call gtk_range_set_update_policy if ! HAVE_GTK3.
20354         (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
20355         if ! HAVE_GTK3.
20356         (update_frame_tool_bar): Call gtk_widget_hide.
20357         (xg_initialize): Use GDK_KEY_g.
20359         * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
20360         if ! HAVE_GTK3
20361         (x_session_initialize): Call gdk_x11_set_sm_client_id.
20363         * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
20364         (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
20365         Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
20367 2011-03-08  Juanma Barranquero  <lekktu@gmail.com>
20369         * w32xfns.c (select_palette): Check success of RealizePalette against
20370         GDI_ERROR, not zero.
20372 See ChangeLog.11 for earlier changes.
20374 ;; Local Variables:
20375 ;; coding: utf-8
20376 ;; End:
20378   Copyright (C) 2011-2012 Free Software Foundation, Inc.
20380   This file is part of GNU Emacs.
20382   GNU Emacs is free software: you can redistribute it and/or modify
20383   it under the terms of the GNU General Public License as published by
20384   the Free Software Foundation, either version 3 of the License, or
20385   (at your option) any later version.
20387   GNU Emacs is distributed in the hope that it will be useful,
20388   but WITHOUT ANY WARRANTY; without even the implied warranty of
20389   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20390   GNU General Public License for more details.
20392   You should have received a copy of the GNU General Public License
20393   along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.