* callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
[emacs.git] / src / ChangeLog
blobef67df9d792b485acb549925b640dabd0df7be6b
1 2012-12-04  Andreas Schwab  <schwab@linux-m68k.org>
3         * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
4         processes.
6 2012-12-04  Dmitry Antipov  <dmantipov@yandex.ru>
8         * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
9         member.  Adjust users.  Convert mouse_face_past_end, mouse_face_defer
10         and mouse_face_hidden members to a bitfields.
11         * frame.h (struct frame): Remove set-but-not-used space_width member.
12         (FRAME_SPACE_WIDTH): Remove.
13         * nsterm.m, w32term.c, xterm.c: Adjust users.
14         * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
15         member.  Adjust users.  Convert term_initted, delete_in_insert_mode,
16         costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
17         members to a bitfields.
19 2012-12-03  Paul Eggert  <eggert@cs.ucla.edu>
21         Don't let call-process be a zombie factory (Bug#12980).
22         Fixing this bug required some cleanup of the signal-handling code.
23         As a side effect, this change also fixes a longstanding rare race
24         condition whereby Emacs could mistakenly kill unrelated processes,
25         and it fixes a bug where a second C-g does not kill a recalcitrant
26         synchronous process in GNU/Linux and similar platforms.
27         The patch should also fix the last vestiges of Bug#9488,
28         a bug which has mostly been fixed on the trunk by other changes.
29         * callproc.c, process.h (synch_process_alive, synch_process_death)
30         (synch_process_termsig, sync_process_retcode):
31         Remove.  All uses removed, to simplify analysis and so that
32         less consing is done inside critical sections.
33         * callproc.c (call_process_exited): Remove.  All uses replaced
34         with !synch_process_pid.
35         * callproc.c (synch_process_pid, synch_process_fd): New static vars.
36         These take the role of what used to be in unwind-protect arg.
37         All uses changed.
38         (block_child_signal, unblock_child_signal):
39         New functions, to avoid races that could kill innocent-victim processes.
40         (call_process_kill, call_process_cleanup, Fcall_process): Use them.
41         (call_process_kill): Record killed processes as deleted, so that
42         zombies do not clutter up the system.  Do this inside a critical
43         section, to avoid a race that would allow the clutter.
44         (call_process_cleanup): Fix code so that the second C-g works again
45         on common platforms such as GNU/Linux.
46         (Fcall_process): Create the child process in a critical section,
47         to fix a race condition.  If creating an asynchronous process,
48         record it as deleted so that zombies do not clutter up the system.
49         Do unwind-protect for WINDOWSNT too, as that's simpler in the
50         light of these changes.  Omit unnecessary call to emacs_close
51         before failure, as the unwind-protect code does that.
52         * callproc.c (call_process_cleanup):
53         * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
54         * process.c (record_deleted_pid): New function, containing
55         code refactored out of Fdelete_process.
56         (Fdelete_process): Use it.
57         (process_status_retrieved): Remove.  All callers changed to use
58         child_status_change.
59         (record_child_status_change): Remove, folding its contents into ...
60         (handle_child_signal): ... this signal handler.  Now, this
61         function is purely a handler for SIGCHLD, and is not called after
62         a synchronous waitpid returns; the synchronous code is moved to
63         wait_for_termination.  There is no need to worry about reaping
64         more than one child now.
65         * sysdep.c (get_child_status, child_status_changed): New functions.
66         (wait_for_termination): Now takes int * status and bool
67         interruptible arguments, too.  Do not record child status change;
68         that's now the caller's responsibility.  All callers changed.
69         Reimplement in terms of get_child_status.
70         (wait_for_termination_1, interruptible_wait_for_termination):
71         Remove.  All callers changed to use wait_for_termination.
72         * syswait.h: Include <stdbool.h>, for bool.
73         (record_child_status_change, interruptible_wait_for_termination):
74         Remove decls.
75         (record_deleted_pid, child_status_changed): New decls.
76         (wait_for_termination): Adjust to API changes noted above.
78         * bytecode.c, lisp.h (Qbytecode): Remove.
79         No longer needed after 2012-11-20 interactive-p changes.
81 2012-12-03  Eli Zaretskii  <eliz@gnu.org>
83         * xdisp.c (redisplay_window): If the cursor is visible, but inside
84         the scroll margin, move point outside the margin.  (Bug#13055)
86 2012-12-03  Jan Djärv  <jan.h.d@swipnet.se>
88         * gtkutil.c (my_log_handler): New function.
89         (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
91 2012-12-03  Dmitry Antipov  <dmantipov@yandex.ru>
93         * lisp.h (modify_region): Rename to...
94         (modify_region_1): ...new prototype.
95         * textprop.c (modify_region): Now static.  Adjust users.
96         * insdel.c (modify_region): Rename to...
97         (modify_region_1): ...new function to work with current buffer.
98         Adjust comment and users.  Use true and false for booleans.
100 2012-12-03  Dmitry Antipov  <dmantipov@yandex.ru>
102         * alloc.c (free_save_value): New function.
103         (safe_alloca_unwind): Use it.
104         * lisp.h (free_save_value): New prototype.
105         * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
106         Add comment.
107         (save_excursion_restore): Adjust to match saved data structure.
108         Use free_save_value to offload some work from GC.  Drop obsolete
109         #if 0 code.
111 2012-12-03  Chong Yidong  <cyd@gnu.org>
113         * fileio.c (Vauto_save_list_file_name): Doc fix.
115 2012-12-03  Fabrice Popineau  <fabrice.popineau@gmail.com>
117         * w32fns.c: Remove prototype of atof.
118         (syspage_mask): Declared DWORD_PTR, for compatibility with 64-bit
119         builds.
120         (file_dialog_callback): Declared UINT_PTR.
122         * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
123         with 64-bit builds.
125         * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
126         (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
127         defined.
129 2012-12-03  Glenn Morris  <rgm@gnu.org>
131         * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
133 2012-12-02  Paul Eggert  <eggert@cs.ucla.edu>
135         Fix xpalloc confusion after memory is exhausted.
136         * alloc.c (xpalloc): Comment fix.
137         * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
138         and signals an error, do not clear charset_table_size, as
139         charset_table is still valid.
140         * doprnt.c (evxprintf): Clear *BUF after freeing it.
142         Use execve to avoid need to munge environ (Bug#13054).
143         * callproc.c (Fcall_process):
144         * process.c (create_process):
145         Don't save and restore environ; no longer needed.
146         * callproc.c (child_setup):
147         Use execve, not execvp, to preserve environ.
149 2012-12-01  Paul Eggert  <eggert@cs.ucla.edu>
151         * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
153 2012-12-01  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
155         * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
156         display for sliced images (Bug#10500).
158         * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
160 2012-11-30  Juanma Barranquero  <lekktu@gmail.com>
162         * doc.c (Fdocumentation): Re-add handling of function-documentation,
163         accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
165 2012-11-29  Dmitry Antipov  <dmantipov@yandex.ru>
167         * xdisp.c (window_outdated): Remove eassert since it hits
168         some suspicious corner cases (see Bug#13007 and Bug#13012).
169         (mode_line_update_needed): New function.
170         (redisplay_internal, redisplay_window): Use it.
171         (ensure_selected_frame): New function.
172         (redisplay_internal, unwind_redisplay): Use it.
173         (redisplay_internal): Move comment about buffer_shared...
174         (buffer_shared_and_changed): ...near to its real use.
176 2012-11-29  Paul Eggert  <eggert@cs.ucla.edu>
178         * callproc.c (Fcall_process): Don't misreport vfork failure.
180 2012-11-28  Paul Eggert  <eggert@cs.ucla.edu>
182         * callproc.c (Fcall_process): Fix vfork portability problems.
183         Do not assume that fd[0], count, filefd, and save_environ survive
184         vfork.  Fix bug whereby wrong errno value could be reported for
185         pipe failure.  Some minor cleanups, too, as follows.  Move buf and
186         bufsize to the context where they're needed.  Change new_argv to
187         be of type char **, as this is more convenient and avoids casts.
188         (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
189         Now local constants, not macros.
191 2012-11-18  Kenichi Handa  <handa@gnu.org>
193         * font.c (font_unparse_xlfd): Fix previous change.  Keep "const"
194         for the variable "f".
196 2012-11-13  Kenichi Handa  <handa@gnu.org>
198         * font.c (font_unparse_xlfd): Exclude special characters from the
199         generating XLFD name.
201 2012-11-27  Paul Eggert  <eggert@cs.ucla.edu>
203         Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
204         * dired.c (stat_uname, stat_gname):
205         * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
207         Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
208         * dired.c (directory_files_internal, file_name_completion):
209         Assume EAGAIN and EINTR are defined.
211         * fileio.c (Fcopy_file): Assume EISDIR is defined.
212         * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
213         * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
214         * lread.c (readbyte_from_file): Assume EINTR is defined.
215         * process.c (wait_reading_process_output, send_process) [subprocesses]:
216         Assume EIO and EAGAIN are defined.
217         * unexcoff.c (write_segment): Assume EFAULT is defined.
219 2012-11-27  Eli Zaretskii  <eliz@gnu.org>
221         * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
222         (Bug#11964)
224         * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
225         highlighting on the frame was cleared.  Prevents assertion
226         violations when repeatedly clicking on the "Top" link of the
227         "bread-crumbs" in Info buffers.
229 2012-11-25  Paul Eggert  <eggert@cs.ucla.edu>
231         * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
233 2012-11-24  Ken Brown  <kbrown@cornell.edu>
235         * keyboard.c (HAVE_MOUSE):
236         * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
237         were always defined.
239 2012-11-24  Eli Zaretskii  <eliz@gnu.org>
241         * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
242         between bpos_covered and bpos_max.  This fixes cursor display when
243         several display strings follow each other.
245         * .gdbinit (pgx): If the glyph's object is a string, display the
246         pointer to string data, rather than the value of the string object
247         itself (which barfs under CHECK_LISP_OBJECT_TYPE).
249         * indent.c (Fvertical_motion): If the starting position is covered
250         by a display string, return to one position before that, to avoid
251         overshooting it inside move_it_to.  (Bug#12930)
253 2012-11-23  Dmitry Antipov  <dmantipov@yandex.ru>
255         * frame.h (struct frame): Remove display_preempted member
256         since all users are dead long ago.
257         * nsterm.h (struct x_output): Use the only dummy member.
258         * w32menu.c (pending_menu_activation): Remove since not
259         really used.
260         (set_frame_menubar): Adjust user.
261         * w32term.h (struct x_output): Drop outdated #if 0 code.
262         (struct w32_output): Use bitfields for explicit_parent,
263         asked_for_visible and menubar_active members.  Drop
264         unused pending_menu_activation member.
265         * xterm.h (struct x_output): Drop outdated #if 0 code.
266         Use bitfields for explicit_parent, asked_for_visible,
267         has_been_visible and net_wm_state_hidden_seen members.
269 2012-11-23  Eli Zaretskii  <eliz@gnu.org>
271         * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
272         of a literal "/".  (Bug#12955)
273         (gl-stamp): Invoke fc.exe directly, not through cmd.
275 2012-11-23  Paul Eggert  <eggert@cs.ucla.edu>
277         Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
278         * dired.c: Assume HAVE_DIRENT_H.
279         (NAMLEN): Remove, replacing with ...
280         (dirent_namelen): New function.  All uses changed.  Use the GNU macro
281         _D_EXACT_NAMELEN if available, as it's faster than strlen.
282         (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
283         (DIRENTRY_NONEMPTY): Remove.  All callers now assume it's nonzero.
284         * makefile.w32-in (DIR_H): Remove.  All uses replaced with
285         $(NT_INC)/dirent.h.
286         ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
287         * ndir.h: Rename to ../nt/inc/dirent.h.
288         * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
289         Do not include <dirent.h>; no longer needed.
290         * w32.c: Include <dirent.h> rather than "ndir.h".
292 2012-11-23  Chong Yidong  <cyd@gnu.org>
294         * xftfont.c (xftfont_open): Remove duplicate assignment.
296 2012-11-22  Dmitry Antipov  <dmantipov@yandex.ru>
298         * alloc.c (Fgarbage_collect): Unblock input after clearing
299         gc_in_progress to avoid note_mouse_highlight glitch with GC.
300         * frame.h (FRAME_MOUSE_UPDATE): New macro.
301         * msdos.c (IT_frame_up_to_date): Use it here...
302         * w32term.c (w32_frame_up_to_date): ...here...
303         * xterm.c (XTframe_up_to_date): ...and here...
304         * nsterm.m (ns_frame_up_to_date): ...but not here.
305         * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
306         Adjust users.
307         * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
308         Do not check whether GC is in progress.
310 2012-11-22  Dmitry Antipov  <dmantipov@yandex.ru>
312         * xdisp.c (window_buffer_changed): New function.
313         (update_menu_bar, update_tool_bar): Use it to
314         simplify large 'if' statements.
315         (redisplay_internal): Generalize commonly used
316         'tail' and 'frame' local variables.
318 2012-11-22  Eli Zaretskii  <eliz@gnu.org>
320         * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
321         with Windows system header.
323 2012-11-21  Paul Eggert  <eggert@cs.ucla.edu>
325         Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
326         * alloc.c: Assume unistd.h exists.
327         * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
328         * sysdep.c (get_current_dir_name): Assume getcwd exists.
329         (getwd) [USG]: Remove; no longer needed.
330         (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
331         * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
332         * w32.h (getcwd): Remove decl.
334 2012-11-21  Stefan Monnier  <monnier@iro.umontreal.ca>
336         * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
337         Make it set selected_window as well.
338         (update_tool_bar): Use it.
340 2012-11-21  Ken Brown  <kbrown@cornell.edu>
342         * emacs.c (main): Set the G_SLICE environment variable for all
343         Cygwin builds, not just GTK builds.  See
344         https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
346 2012-11-21  Eli Zaretskii  <eliz@gnu.org>
348         * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
349         (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
350         Define for the MSVC compiler.
352         * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
354         * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
355         (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
356         dostounix_filename.  Prevents crashes down the road, because
357         dostounix_filename assumes it gets a unibyte string.  Reported by
358         Michel de Ruiter <michel@sentient.nl>, see
359         http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
361 2012-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>
363         Conflate Qnil and Qunbound for `symbol-function'.
364         * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
365         * lread.c (init_obarray): Set `function' fields to Qnil.
366         * eval.c (Fcommandp): Ignore Qunbound.
367         (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
368         * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
369         Test NILP rather than Qunbound.
370         (Ffmakunbound): Set to Qnil.
371         (Fsymbol_function): Never signal an error.
372         (Finteractive_form): Ignore Qunbound.
374 2012-11-20  Paul Eggert  <eggert@cs.ucla.edu>
376         * eval.c (interactive_p): Remove no-longer-used decl.
378 2012-11-20  Dmitry Antipov  <dmantipov@yandex.ru>
380         * xdisp.c (buffer_shared): Adjust comment.
381         (buffer_shared_and_changed): New function.
382         (prepare_menu_bars, redisplay_internal): Use it to
383         decide whether all windows or frames should be updated.
384         (window_outdated): New function.
385         (text_outside_line_unchanged_p, redisplay_window): Use it.
386         (redisplay_internal): Likewise.  Fix indentation.
388 2012-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>
390         * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
391         (syms_of_eval): Remove corresponding defsubr.
392         * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
394 2012-11-19  Daniel Colascione  <dancol@dancol.org>
396         * w32fns.c (Fx_file_dialog):
397         (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
398         cygwin_convert_file_name*.
400         * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
401         Rename cygwin_convert_path* to cygwin_convert_file_name*.
403 2012-11-18  Paul Eggert  <eggert@cs.ucla.edu>
405         * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
407 2012-11-18  Eli Zaretskii  <eliz@gnu.org>
409         * w32select.c: Include w32common.h before w32term.h, so that
410         windows.h gets included before w32term.h uses some of its
411         features, see below.
413         * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
414         New typedefs.
415         (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
416         New prototypes.
417         (EnumSystemLocales) [_MSC_VER]: Define if undefined.  (Bug#12878)
419 2012-11-18  Jan Djärv  <jan.h.d@swipnet.se>
421         * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
422         (ns_select): Return at once if events are held (Bug#12834).
424 2012-11-18  enami tsugutomo  <tsugutomo.enami@jp.sony.com>
426         * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
427         Needed following 2012-10-20 change.  (Bug#12902)
429 2012-11-18  Juanma Barranquero  <lekktu@gmail.com>
431         * w32proc.c (waitpid): Remove unused label get_result.
433 2012-11-17  Juanma Barranquero  <lekktu@gmail.com>
435         * makefile.w32-in (SYSWAIT_H): New macro.
436         ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
437         ($(BLD)/sysdep.$(O)): Update dependencies.
439 2012-11-17  Paul Eggert  <eggert@cs.ucla.edu>
441         Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
442         * callproc.c (relocate_fd): Assume F_DUPFD.
443         * emacs.c, term.c (O_RDWR): Remove.
444         * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
445         O_NDELAY, since O_NONBLOCK is the standard name for this flag.
446         * nsterm.m: Assume <fcntl.h> exists.
447         * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
448         (create_pty, Fmake_network_process, server_accept_connection)
449         (wait_reading_process_output, init_process_emacs):
450         Assume O_NONBLOCK.
451         (wait_reading_process_output): Put in a special case for WINDOWSNT
452         to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
453         It's not clear this is needed, but it's a more-conservative change.
454         (create_process): Assume FD_CLOEXEC.
455         (create_process, create_pty): Assume O_NOCTTY.
456         * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
457         (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
458         Omit if not DOS_NT, since F_GETFL is not defined there.
459         (serial_open): Assume O_NONBLOCK and O_NOCTTY.
460         * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
461         (O_NOCTTY): Remove.
462         (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
463         lack it, since gnulib guarantees this.
464         * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
466 2012-11-17  Eli Zaretskii  <eliz@gnu.org>
468         * w32.c (faccessat): Pretend that directories have the execute bit
469         set.  Emacs expects that, e.g., in files.el:cd-absolute.
471         * w32proc.c (create_child): Don't clip the PID of the child
472         process to fit into an Emacs integer, as this is no longer a
473         restriction.
474         (waitpid): Rename from sys_wait.  Emulate a Posix 'waitpid' by
475         reaping only the process specified by PID argument, if that is
476         positive.  Use PID instead of dead_child to know which process to
477         reap.  Wait for the child to die only if WNOHANG is not in
478         OPTIONS.
479         (sys_select): Don't set dead_child.
481         * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
482         as it is no longer needed.
484         * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
485         no longer needed.
486         (record_child_status_change): Remove the setting of
487         record_at_most_one_child for the !WNOHANG case.
489 2012-11-17  Paul Eggert  <eggert@cs.ucla.edu>
491         Fix problems in ns port found by static checking.
492         * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
493         (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
494         not to process group.
495         (ns_select): Use emacs_write, not write, as that's more robust
496         in the presence of signals.
497         (fd_handler:): Check for read errors.
499 2012-11-16  Glenn Morris  <rgm@gnu.org>
501         * editfns.c (Fmessage): Mention message-log-max.  (Bug#12849)
503 2012-11-16  Stefan Monnier  <monnier@iro.umontreal.ca>
505         * eval.c (Finteractive_p): Revert lexbind-merge mishap.
507 2012-11-16  Eli Zaretskii  <eliz@gnu.org>
509         * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
510         use the same value of thread handle.
511         (start_timer_thread): If the timer thread exited (due to error),
512         clean up by closing the two handles it used.  Duplicate the caller
513         thread's handle here, so it gets duplicated only once, when
514         launching the timer thread.  Set priority of the timer thread, not
515         the caller thread.
516         (getitimer): Don't duplicate the caller thread's handle here.
517         (Bug#12832)
519 2012-11-16  Jan Djärv  <jan.h.d@swipnet.se>
521         * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
522         called (Bug#12834).
524 2012-11-16  Paul Eggert  <eggert@cs.ucla.edu>
526         Remove no-longer-used pty_max_bytes variable.
527         * process.c (pty_max_bytes): Remove; unused.
528         (send_process): Do not set it.
530 2012-11-15  Juanma Barranquero  <lekktu@gmail.com>
532         * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
533         Update dependencies.
535 2012-11-15  Paul Eggert  <eggert@cs.ucla.edu>
537         * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
538         This follows up on the 2012-09-29 patch that removed indirection
539         for the 'function' field.  Reported by Sergey Vinokurov in
540         <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
542 2012-11-14  Eli Zaretskii  <eliz@gnu.org>
544         * w32.c (faccessat): Rename from sys_faccessat.  (No need to use a
545         different name, as the MS runtime does not have such a function,
546         and probably never will.)  All callers changed.  Ignore DIRFD
547         value if PATH is an absolute file name, to match Posix spec
548         better.  If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
549         symlinks.
551 2012-11-14  Dmitry Antipov  <dmantipov@yandex.ru>
553         * xdisp.c (echo_area_display, redisplay_internal):
554         Omit redundant check whether frame_garbaged is set.
556 2012-11-14  Paul Eggert  <eggert@cs.ucla.edu>
558         Use faccessat, not access, when checking file permissions (Bug#12632).
559         This fixes a bug that has been present in Emacs since its creation.
560         It was reported by Chris Torek in 1983 even before GNU Emacs existed,
561         which must set some sort of record.  (Torek's bug report was against
562         a predecessor of GNU Emacs, but GNU Emacs happened to have the
563         same common flaw.)  See Torek's Usenet posting
564         "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
565         Posted: Fri Apr  8 14:18:56 1983.
566         * Makefile.in (LIB_EACCESS): New macro.
567         (LIBES): Use it.
568         * callproc.c (init_callproc):
569         * charset.c (init_charset):
570         * fileio.c (check_existing, check_executable, check_writable)
571         (Ffile_readable_p):
572         * lread.c (openp, load_path_check):
573         * process.c (allocate_pty):
574         * xrdb.c (file_p):
575         Use effective UID when checking permissions, not real UID.
576         * callproc.c (init_callproc):
577         * charset.c (init_charset):
578         * lread.c (load_path_check, init_lread):
579         Test whether directories are accessible, not merely whether they exist.
580         * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
581         * fileio.c (check_existing, check_executable, check_writable)
582         (Ffile_readable_p):
583         Use symbolic names instead of integers for the flags, as they're
584         portable now.
585         (check_writable): New arg AMODE.  All uses changed.
586         Set errno on failure.
587         (Ffile_readable_p): Use faccessat, not stat + open + close.
588         (Ffile_writable_p): No need to call check_existing + check_writable.
589         Just call check_writable and then look at errno.  This saves a syscall.
590         dir should never be nil; replace an unnecessary runtime check
591         with an eassert.  When checking the parent directory of a nonexistent
592         file, check that the directory is searchable as well as writable, as
593         we can't create files in unsearchable directories.
594         (file_directory_p): New function, which uses 'stat' on most platforms
595         but faccessat with D_OK (for efficiency) if WINDOWSNT.
596         (Ffile_directory_p, Fset_file_times): Use it.
597         (file_accessible_directory_p): New function, which uses a single
598         syscall for efficiency.
599         (Ffile_accessible_directory_p): Use it.
600         * xrdb.c (file_p): Use file_directory_p.
601         * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
602         * lread.c (openp): When opening a file, use fstat rather than
603         stat, as that avoids a permissions race.  When not opening a file,
604         use file_directory_p rather than stat.
605         (dir_warning): First arg is now a usage string, not a format.
606         Use errno.  All uses changed.
607         * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
608         that merely introduced a race.
609         * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
610         changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
611         and similarly for the other O_* flags.
612         * w32.c (sys_faccessat): Rename from sys_access and switch to
613         faccessat's API.  All uses changed.
614         * xrdb.c: Do not include <sys/stat.h>; no longer needed.
615         (magic_db): Rename from magic_file_p.
616         (magic_db, search_magic_path): Return an XrmDatabase rather than a
617         char *, so that we don't have to test for file existence
618         separately from opening the file for reading.  This removes a race
619         fixes a permission-checking problem, and simplifies the code.
620         All uses changed.
621         (file_p): Remove; no longer needed.
623 2012-11-13  Dmitry Antipov  <dmantipov@yandex.ru>
625         Omit glyphs initialization at startup.
626         * dispnew.c (glyphs_initialized_initially_p): Remove.
627         (adjust_frame_glyphs_initially): Likewise.  Adjust users.
628         (Fredraw_frame): Move actual code from here...
629         (redraw_frame): ...to here.  Add eassert.  Adjust comment.
630         (Fredraw_display): Use redraw_frame.
631         * xdisp.c (clear_garbaged_frames): Likewise.
633 2012-11-13  Eli Zaretskii  <eliz@gnu.org>
635         * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
636         passed to pint2str and pint2hrstr to be at most the size of the
637         frame's decode_mode_spec_buffer.  This avoids crashes with very
638         large values of FIELD_WIDTH argument to decode_mode_spec.
639         (Bug#12867)
641 2012-11-13  Paul Eggert  <eggert@cs.ucla.edu>
643         Fix a race with verify-visited-file-modtime (Bug#12863).
644         Since at least 1991 Emacs has ignored an mtime difference of no
645         more than one second, but my guess is that this was to work around
646         file system bugs that were fixed long ago.  Since the race is
647         causing problems now, let's remove that code.
648         * fileio.c (Fverify_visited_file_modtime): Do not accept a file
649         whose time stamp is off by no more than a second.  Insist that the
650         file time stamps match exactly.
652 2012-11-12  Dmitry Antipov  <dmantipov@yandex.ru>
654         * frame.h (struct frame): Convert external_tool_bar member to
655         1-bit unsigned bitfield.
656         * termhooks.h (struct terminal): Remove mouse_moved member since
657         all users are long dead.  Adjust comment on mouse_position_hook.
659 2012-11-12  Dmitry Antipov  <dmantipov@yandex.ru>
661         Simplify by using FOR_EACH_FRAME here and there.
662         * frame.c (next_frame, prev_frame, other_visible_frames)
663         (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
664         * w32term.c (x_window_to_scroll_bar): Likewise.
665         * window.c (window_list): Likewise.
666         * xdisp.c (x_consider_frame_title): Likewise.
667         * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
668         * xfns.c (x_window_to_frame, x_any_window_to_frame)
669         (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
670         * xmenu.c (menubar_id_to_frame): Likewise.
671         * xselect.c (frame_for_x_selection): Likewise.
672         * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
673         (x_window_to_menu_bar): Likewise.
674         * w32fns.c (x_window_to_frame): Likewise.  Adjust comment.
676 2012-11-12  Paul Eggert  <eggert@cs.ucla.edu>
678         * data.c (Qdefalias_fset_function): Now static.
680         Another tweak to vectorlike_header change.
681         * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
682         Remove, and replace all uses with ...
683         (next_in_free_list, set_next_in_free_list):
684         New functions, which respect C's aliasing rules better.
686 2012-11-11  Paul Eggert  <eggert@cs.ucla.edu>
688         * window.c (list4i): Rename from 'quad'.  All uses changed.
689         Needed because <sys/types.h> defines 'quad' on Solaris 10.
691 2012-11-11  Juanma Barranquero  <lekktu@gmail.com>
693         * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
694         warning about mixing declarations and code in ISO C90.
696 2012-11-10  Martin Rudalics  <rudalics@gmx.at>
698         * window.c (Fsplit_window_internal): Set combination limit of
699         new parent window to t iff Vwindow_combination_limit is t;
700         fixing a regression introduced with the change from 2012-09-22.
701         (Fset_window_combination_limit): Fix doc-string.
703 2012-11-10  Eli Zaretskii  <eliz@gnu.org>
705         * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
706         amount when the scroll margins are too large.  When scrolling
707         backwards in the buffer, give up if cannot reach point or the
708         scroll margin within a reasonable number of screen lines.
709         Fixes point position in window under scroll-up/down-aggressively when
710         point is positioned many lines beyond the window top/bottom.
711         (Bug#12811)
713         * ralloc.c (relinquish): If real_morecore fails to return memory
714         to the system, don't crash; instead, leave the last heap
715         unchanged and return.  (Bug#12774)
717 2012-11-09  Stefan Monnier  <monnier@iro.umontreal.ca>
719         * lisp.h (AUTOLOADP): New macro.
720         * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
721         * data.c (Ffset): Remove special ad-advice-info handling.
722         (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
723         (Fsubr_arity): CSE.
724         (Finteractive_form): Simplify.
725         (Fquo): Don't insist on having at least 2 arguments.
726         (Qdefalias_fset_function): New var.
728 2012-11-09  Jan Djärv  <jan.h.d@swipnet.se>
730         * image.c (xpm_make_color_table_h): Change to hashtest_equal.
732         * nsfont.m (Qcondensed, Qexpanded): New variables.
733         (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
734         (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
736 2012-11-09  Dmitry Antipov  <dmantipov@yandex.ru>
738         Fix recently introduced crash on MS-Windows (Bug#12839).
739         * w32term.h (struct scroll_bar): Use convenient header.
740         (SCROLL_BAR_VEC_SIZE): Remove.
741         * w32term.c (x_scroll_bar_create): Use VECSIZE.
743 2012-11-09  Dmitry Antipov  <dmantipov@yandex.ru>
745         Tweak last vectorlike_header change.
746         * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
747         vectorlike object on the free list.  This is introduced to avoid
748         some (but not all) pointer casting and aliasing problems, see
749         http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
750         * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
751         objects.
752         (xvectype, xvecsize): Use them to examine Lisp_Object values.
754 2012-11-09  Jan Djärv  <jan.h.d@swipnet.se>
756         * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
757         been removed, so remove them here also.
759 2012-11-09  Stefan Monnier  <monnier@iro.umontreal.ca>
761         * doc.c (Fdocumentation): Handle new property
762         dynamic-docstring-function to replace the old ad-advice-info.
764 2012-11-09  Paul Eggert  <eggert@cs.ucla.edu>
766         * fns.c (Qeql, hashtest_eq): Now static.
768 2012-11-08  Stefan Monnier  <monnier@iro.umontreal.ca>
770         * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
771         * fns.c (hashfn_eq, hashfn_eql, sxhash):
772         * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
773         * buffer.c (compare_overlays): Use XLI rather than XHASH.
775 2012-11-08  Paul Eggert  <eggert@cs.ucla.edu>
777         Use same hash function for hashfn_profiler as for hash_string etc.
778         * fns.c (SXHASH_COMBINE): Remove.  All uses replaced by sxhash_combine.
779         * lisp.h (sxhash_combine): New inline function, with the contents
780         of the old SXHASH_COMBINE.
781         * profiler.c (hashfn_profiler): Use it, instead of having a
782         special hash function containing a comparison that always yields 1.
784 2012-11-08  Stefan Monnier  <monnier@iro.umontreal.ca>
786         * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
787         (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
788         (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
789         Remove unused vars.
791 2012-11-08  Jan Djärv  <jan.h.d@swipnet.se>
793         * image.c (xpm_make_color_table_h): Fix compiler error because
794         make_hash_table changed.
796 2012-11-08  Thomas Kappler <tkappler@gmail.com> (tiny change)
798         * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
800 2012-11-08  Stefan Monnier  <monnier@iro.umontreal.ca>
802         Use ad-hoc comparison function for the profiler's hash-tables.
803         * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
804         (make_log): Use them.
805         (handle_profiler_signal): Don't inhibit quit any longer since we don't
806         call Fequal any more.
807         (Ffunction_equal): New function.
808         (cmpfn_profiler, hashfn_profiler): New functions.
809         (syms_of_profiler): Initialize them.
810         * lisp.h (struct hash_table_test): New struct.
811         (struct Lisp_Hash_Table): Use it.
812         * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
813         * fns.c (make_hash_table): Take a struct to describe the test.
814         (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
815         (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
816         (hash_lookup, hash_remove_from_table): Move assertion checking of
817         hashfn result here.  Check hash-equality before calling cmpfn.
818         (Fmake_hash_table): Adjust call to make_hash_table.
819         (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
820         (syms_of_fns): Initialize them.
821         * emacs.c (main): Move syms_of_fns earlier.
822         * xterm.c (syms_of_xterm):
823         * category.c (hash_get_category_set): Adjust call to make_hash_table.
824         * print.c (print_object): Adjust to new hash-table struct.
825         * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
827 2012-11-08  Eli Zaretskii  <eliz@gnu.org>
829         * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
830         value of w32-scroll-lock-modifier is neither nil nor one of the
831         known key modifiers.  (Bug#12806)
833 2012-11-08  Dmitry Antipov  <dmantipov@yandex.ru>
835         Shrink struct vectorlike_header to the only size field.
836         * lisp.h (enum pvec_type): Avoid explicit enum member values.
837         Adjust comment.
838         (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
839         PVEC_TYPE_MASK to arrange new bitfield in the vector header.
840         (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
841         (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
842         information from the vector header.  Adjust comment.
843         (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
844         (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
845         layout.
846         (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
847         (struct vectorlike_header): Remove next member.  Adjust comment.
848         (struct Lisp_Subr): Add convenient header.  Adjust comment.
849         (allocate_pseudovector): Adjust prototype.
850         * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
851         (sweep_string, lisp_malloc): Remove useless prototypes.
852         (enum mem_type): Adjust comment.
853         (NEXT_IN_FREE_LIST): New macro.
854         (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
855         (Fmake_bool_vector): Likewise.
856         (struct large_vector): New type to represent allocation unit for
857         the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
858         (large_vectors): Change type to struct large_vector.
859         (allocate_vector_from_block): Simplify.
860         (PSEUDOVECTOR_NBYTES): Replace with...
861         (vector_nbytes): ...new function.  Adjust users.
862         (sweep_vectors): Adjust processing of large vectors.
863         (allocate_vectorlike): Likewise.
864         (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
865         Add easserts.  Adjust XSETPVECTYPESIZE usage.
866         (allocate_buffer): Use BUFFER_PVEC_INIT.
867         (live_vector_p): Adjust to match large vector.
868         * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
869         * buffer.h (struct buffer): Add next member.
870         (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
871         New macros.
872         (FOR_EACH_BUFFER): Adjust to match struct buffer change.
873         * fns.c (internal_equal): Adjust to match enum pvec_type change.
874         (copy_hash_table): Adjust to match vector header change.
875         * lread.c (defsubr): Use XSETPVECTYPE.
876         * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
877         (xvectype): Likewise.  Print PVEC_NORMAL_VECTOR for regular vectors.
878         (xvecsize): New command.
880 2012-11-08  Dmitry Antipov  <dmantipov@yandex.ru>
882         * keyboard.c (event_to_kboard): Do not dereference
883         frame_or_window field of SELECTION_REQUEST_EVENT
884         and SELECTION_CLEAR_EVENT events (Bug#12814).
885         * xterm.h (struct selection_input_event): Adjust comment.
887 2012-11-07  Eli Zaretskii  <eliz@gnu.org>
889         * w32fns.c (modifier_set): Don't report modifiers from toggle key,
890         such as Scroll Lock, if the respective keys are treated as
891         function keys, not as modifiers.  This avoids destroying non-ASCII
892         keyboard input when Scroll Lock is toggled ON.  (Bug#12806)
894 2012-11-07  Dmitry Antipov  <dmantipov@yandex.ru>
896         * xfns.c (Fx_wm_set_size_hint): Use check_x_frame.  Adjust docstring.
898 2012-11-06  Paul Eggert  <eggert@cs.ucla.edu>
900         Restore some duplicate definitions (Bug#12814).
901         This undoes part of the 2012-11-03 changes.  Some people build
902         with plain -g rather than with -g3, and they need the duplicate
903         definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
904         * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
905         Define as macros, as well as as enums or as constants.
907 2012-11-06  Jan Djärv  <jan.h.d@swipnet.se>
909         * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
910         to keypad keys (Bug#12816).
912 2012-11-06  Paul Eggert  <eggert@cs.ucla.edu>
914         Minor adjustments of recently-changed frame functions.
915         * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
916         known to be a frame (we're in the FRAMEP branch).
917         * lisp.h (Qframep): Remove decl.  frame.h declares this.
918         * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
919         since they're meant for Lisp fixnum values.
921 2012-11-06  Dmitry Antipov  <dmantipov@yandex.ru>
923         * window.c (Fwindow_combination_limit): Revert to the only
924         required argument and adjust docstring as suggested in
925         http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
926         by Martin Rudalics <rudalics@gmx.at>.
928 2012-11-06  Dmitry Antipov  <dmantipov@yandex.ru>
930         Widely used frame validity and checking functions.
931         * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
932         * frame.c (decode_live_frame, decode_any_frame): New functions.
933         (delete_frame, Fredirect_frame_focus, Fframe_parameters)
934         (Fframe_parameter, Fframe_char_height, Fframe_char_width)
935         (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
936         (Fframe_pointer_visible_p): Use decode_any_frame.
937         (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
938         (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
939         (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
940         (Fframe_focus): Likewise.  Allow zero number of arguments.
941         Adjust docstring.
942         (frame_buffer_list, frame_buffer_predicate): Remove.
943         * lisp.h (frame_buffer_predicate): Remove prototype.
944         * buffer.c (Fother_buffer): Use decode_any_frame.
945         * xdisp.c (Ftool_bar_lines_needed): Likewise.
946         * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
947         * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
948         (Fclose_font, Ffont_info): Use decode_live_frame.
949         * fontset.c (check_fontset_name): Likewise.
950         * terminal.c (Fframe_terminal): Likewise.
951         * w32fns.c (check_x_frame): Likewise.
952         * window.c (Fminibuffer_window, Fwindow_at)
953         (Fcurrent_window_configuration): Likewise.
954         (Frun_window_configuration_change_hook, Fwindow_resize_apply):
955         Likewise.  Allow zero number of arguments.  Adjust docstring.
956         * dispnew.c (Fredraw_frame): Likewise.
957         * xfaces.c (frame_or_selected_frame): Remove.
958         (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
959         (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
960         (Fframe_face_alist): Use decode_live_frame.
961         * xfns.c (check_x_frame): Likewise.
963 2012-11-06  Dmitry Antipov  <dmantipov@yandex.ru>
965         * window.c (quad): New function.
966         (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
967         (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
968         (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
969         (Fwindow_line_height): Use it.
970         (Fwindow_fringes): Use list3.
971         (Fwindow_scroll_bars): Use list4.
972         (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
973         (Fwindow_combination_limit): Allow zero number of arguments.
975 2012-11-05  Eli Zaretskii  <eliz@gnu.org>
977         * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
979         * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
980         (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
981         file descriptor 2 for standard error.  (Bug#12805)
983 2012-11-05  Chong Yidong  <cyd@gnu.org>
985         * process.c (wait_reading_process_output): Revert previous change.
987 2012-11-05  Paul Eggert  <eggert@cs.ucla.edu>
989         Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
990         This removes code that has been obsolete since around 1990.
991         * callproc.c (Fcall_process):
992         * emacs.c (main):
993         * process.c (create_process):
994         * term.c (dissociate_if_controlling_tty):
995         Assume setsid exists.
996         * callproc.c (child_setup): Assume setpgid exists and behaves as
997         per POSIX.1-1988 or later.
998         * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
999         * emacs.c (shut_down_emacs):
1000         * sysdep.c (sys_suspend, init_foreground_group):
1001         Assume getpgrp behaves as per POSIX.1-1998 or later.
1002         * msdos.c (setpgrp): Remove.
1003         (tcgetpgrp, setpgid, setsid): New functions.
1004         * systty.h (EMACS_GETPGRP): Remove.  All callers now use getpgrp.
1005         * term.c (no_controlling_tty): Remove; unused.
1006         * w32proc.c (setpgrp): Remove.
1007         (setsid, tcgetpgrp): New functions.
1009         Simplify by assuming __fpending.
1010         * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
1011         (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
1012         Do not assume that __fpending's result fits in int.
1014 2012-11-04  Paul Eggert  <eggert@cs.ucla.edu>
1016         Remove EMACS_OUTQSIZE+sleep hack.
1017         * dispnew.c (update_frame_1): Remove hack for terminals slower
1018         than 2400 bps, which throttled Emacs by having it sleep.
1019         This code hasn't worked since at least 2007, when the multi-tty stuff
1020         was added, and anyway those old terminals are long dead.
1021         * systty.h (EMACS_OUTQSIZE): Remove; unused.  The macro isn't used even
1022         without the dispnew.c change, as dispnew.c doesn't include systty.h.
1024         Fix data-loss with --version (Bug#9574).
1025         * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
1026         as we can't assume that emacs_strerror is initialized, and strerror
1027         is good enough here.
1028         (main): Invoke atexit earlier, to catch earlier instances of
1029         sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
1031 2012-11-04  Michael Marchionna  <tralfaz@pacbell.net>
1033         * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
1034         (keyDown): Remap keypad keys to X11 virtual key codes.
1036 2012-11-03  Paul Eggert  <eggert@cs.ucla.edu>
1038         Fix data-loss with --batch (Bug#9574).
1039         * emacs.c: Include <close-stream.h>.
1040         (close_output_streams): New function.
1041         (main): Pass it to atexit, so that Emacs closes stdout and stderr
1042         and handles errors appropriately.
1043         (Fkill_emacs): Don't worry about flushing, as close_output_stream
1044         does that now.
1046         Fix a race condition that causes Emacs to mess up glib (Bug#8855).
1047         The symptom is a diagnostic "GLib-WARNING **: In call to
1048         g_spawn_sync(), exit status of a child process was requested but
1049         SIGCHLD action was set to SIG_IGN and ECHILD was received by
1050         waitpid(), so exit status can't be returned."  The diagnostic
1051         is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
1052         The real bug is a race condition between Emacs and glib: Emacs
1053         does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
1054         so that glib can't find it.  Work around the bug by invoking
1055         waitpid only on subprocesses that Emacs itself creates.
1056         * process.c (create_process, record_child_status_change):
1057         Don't use special value -1 in pid field, as the caller now must
1058         know the pid rather than having the callee infer it.
1059         The inference was sometimes incorrect anyway, due to another race.
1060         (create_process): Set new 'alive' member if child is created.
1061         (process_status_retrieved): New function.
1062         (record_child_status_change): Use it.
1063         Accept negative 1st argument, which means to wait for the
1064         processes that Emacs already knows about.  Move special-case code
1065         for DOS_NT (which lacks WNOHANG) here, from caller.  Keep track of
1066         processes that have already been waited for, by testing and
1067         clearing new 'alive' member.
1068         (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
1069         now does this internally.
1070         (handle_child_signal): Let record_child_status_change do all
1071         the work, since we do not want to reap all exited child processes,
1072         only the child processes that Emacs itself created.
1073         * process.h (Lisp_Process): New boolean member 'alive'.
1075         Omit duplicate definitions no longer needed with gcc -g3.
1076         * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
1077         (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
1078         Define only as macros.  There's no longer any need to also define
1079         these symbols as enums or as constants, since we now assume
1080         gcc -g3 when debugging.
1082 2012-11-03  Eli Zaretskii  <eliz@gnu.org>
1084         * lisp.mk: Adjust comments to the fact that term/internal is now
1085         loaded from loadup.el.
1087         * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
1088         (msdos_fatal_signal): New function.
1089         (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
1090         its argument list.
1092         * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
1093         for GCC versions before 4.
1094         (emacs_raise): Define to call msdos_fatal_signal.
1096         * xdisp.c (init_from_display_pos): Fix initialization of the bidi
1097         iterator when starting in the middle of a display or overlay
1098         string.  (Bug#12745)
1100 2012-11-03  Chong Yidong  <cyd@gnu.org>
1102         * process.c (wait_reading_process_output): Clean up the last
1103         change.
1105 2012-11-03  Jim Paris  <jim@jtan.com>  (tiny change)
1107         * process.c (wait_reading_process_output): Avoid a race condition
1108         with SIGIO delivery (Bug#11536).
1110 2012-11-03  Chong Yidong  <cyd@gnu.org>
1112         * buffer.c (cursor_type): Untabify docstring.
1114 2012-11-03  Dmitry Antipov  <dmantipov@yandex.ru>
1116         * frame.h (struct frame): Drop can_have_scroll_bars member
1117         which is meaningless for a long time.  Adjust comments.
1118         (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
1119         * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
1121 2012-11-03  Dmitry Antipov  <dmantipov@yandex.ru>
1123         * window.c (decode_next_window_args): Update window arg after
1124         calling decode_live_window and so fix crash reported at
1125         http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
1126         by Juanma Barranquero <lekktu@gmail.com>.
1127         (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
1128         * font.c (Ffont_at): Likewise.
1130 2012-11-01  Jan Djärv  <jan.h.d@swipnet.se>
1132         * widget.c (resize_cb): New function.
1133         (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
1134         (EmacsFrameResize): Check if all is up to date before changing frame
1135         size.
1137 2012-11-02  Eli Zaretskii  <eliz@gnu.org>
1139         Implement backtrace output for fatal errors on MS-Windows.
1140         * w32fns.c (CaptureStackBackTrace_proc): New typedef.
1141         (BACKTRACE_LIMIT_MAX): New macro.
1142         (w32_backtrace): New function.
1143         (emacs_abort): Use w32_backtrace when the user chooses not to
1144         attach a debugger.  Update the text of the abort dialog.
1146 2012-11-02  Dmitry Antipov  <dmantipov@yandex.ru>
1148         Window-related stuff cleanup here and there.
1149         * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
1150         Use decode_any_window.
1151         * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
1152         * xdisp.c (Fformat_mode_line): Likewise.
1153         * font.c (Ffont_at): Use decode_live_window.
1154         * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
1155         * window.c (decode_next_window_args): Likewise.
1156         (decode_any_window): Remove static.
1157         * window.h (decode_any_window): Add prototype.
1158         * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
1159         * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
1160         respectively.
1162 2012-11-02  Dmitry Antipov  <dmantipov@yandex.ru>
1164         Remove pad from struct input_event.
1165         * termhooks.h (struct input_event): Remove padding field.
1166         Adjust comment.
1167         * keyboard.c (event_to_kboard): Simplify because frame_or_window
1168         member is never cons for a long time.  Adjust comment.
1169         (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
1170         SELECTION_CLEAR_EVENT has no Lisp_Objects to mark.  Add comment.
1171         * xterm.c (handle_one_xevent): Do not initialize frame_or_window
1172         field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
1174 2012-11-01  Eli Zaretskii  <eliz@gnu.org>
1176         * w32proc.c (getpgrp, setpgid): New functions.  (Bug#12776)
1178 2012-10-31  Paul Eggert  <eggert@cs.ucla.edu>
1180         Fix crash when using Emacs as commit editor for git (Bug#12697).
1181         * callproc.c (setpgrp): Remove macro, as we now use setpgid
1182         and it is configured in conf_post.h.
1183         (Fcall_process): Don't invoke both setsid and setpgid; the former
1184         is enough, if it exists.
1185         * callproc.c (Fcall_process, child_setup):
1186         * process.c (create_process): Use setpgid.
1187         * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
1188         for the real thing.
1189         * dispnew.c (init_display): Initialize the foreground group
1190         if we are running a tty display.
1191         * emacs.c (main): Do not worry about setpgrp; init_display does it now.
1192         * lisp.h (init_foreground_group): New decl.
1193         * sysdep.c (inherited_pgroup): New static var.
1194         (init_foreground_group, tcsetpgrp_without_stopping)
1195         (narrow_foreground_group, widen_foreground_group): New functions.
1196         (init_sys_modes): Narrow foreground group.
1197         (reset_sys_modes): Widen foreground group.
1199 2012-10-31  Michael Albinus  <michael.albinus@gmx.de>
1201         * dbusbind.c: Fix cut'n'waste error.  Use HAVE_DBUS_VALIDATE_INTERFACE.
1203 2012-10-31  Martin Rudalics  <rudalics@gmx.at>
1205         * minibuf.c (read_minibuf): Restore current buffer since
1206         choose_minibuf_frame calling Fset_frame_selected_window may
1207         change it (Bug#12766).
1209 2012-10-30  Jan Djärv  <jan.h.d@swipnet.se>
1211         * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
1213 2012-10-30  Kenichi Handa  <handa@gnu.org>
1215         * font.c (Ffont_at): If WINDOW is specified and it is not
1216         displaying the current buffer, signal an error.
1218 2012-10-29  Daniel Colascione  <dancol@dancol.org>
1220         * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
1221         In preparation for fixing bug#12739, move these functions from
1222         here...
1224         * coding.h, coding.c: ... to here, and compile them only when
1225         WINDOWSNT or CYGWIN.  Moving these functions out of cygw32 proper
1226         lets us write cygw32-agnostic code for the HAVE_NTGUI case.
1228 2012-10-28  Eli Zaretskii  <eliz@gnu.org>
1230         * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
1231         (timer_loop, getitimer, setitimer): Use it instead of
1232         CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
1233         'clock'.
1234         (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
1235         literal 10000.
1237 2012-10-28  Jan Djärv  <jan.h.d@swipnet.se>
1239         * nsterm.m (NO_APPDEFINED_DATA): New define.
1240         (last_appdefined_event_data): New variable
1241         (last_appdefined_event): Remove.
1242         (ns_select): Initialize t from last_appdefined_event_data instead
1243         of [last_appdefined_event data1].
1244         (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
1245         remove last_appdefined_event (Bug#12698).
1247 2012-10-28  Stefan Monnier  <monnier@iro.umontreal.ca>
1249         * frame.c (x_set_font): Catch internal error.
1251 2012-10-27  Eli Zaretskii  <eliz@gnu.org>
1253         Avoid overflow in w32 implementation of interval timers.
1254         When possible, for ITIMER_PROF count only times the main thread
1255         actually executes.
1256         * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
1257         'volatile ULONGLONG' types.  All the other data which was
1258         previously clock_t is now ULONGLONG.  'terminate' is 'volatile int'.
1259         (GetThreadTimes_Proc): New typedef.
1260         (w32_get_timer_time): New function, returns a suitable time value
1261         for the timer.
1262         (timer_loop): Enter critical section when accessing ULONGLONG
1263         values of the itimer_data struct, as these accesses are no longer
1264         atomic.  Call 'w32_get_timer_time' instead of 'clock'.
1265         Remove unused variable.
1266         (init_timers): Initialize s_pfn_Get_Thread_Times.
1267         (start_timer_thread): Don't assign itimer->caller_thread here.
1268         (getitimer): Assign itimer->caller_thread here.
1269         (setitimer): Always call getitimer to get the value of ticks_now.
1270         (sys_spawnve): Avoid compiler warning about format mismatch.
1272 2012-10-26  Eli Zaretskii  <eliz@gnu.org>
1274         * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
1275         mouse movement events if the menu bar is active.  This avoids
1276         producing a busy "hour-glass" cursor by Windows if the mouse
1277         pointer is positioned over a tooltip shown for some menu item.
1279 2012-10-25  Paul Eggert  <eggert@cs.ucla.edu>
1281         Don't assume process IDs fit in int.
1282         * emacs.c (shut_down_emacs) [!DOS_NT]:
1283         * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
1284         * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
1285         Use pid_t, not int, to store process IDs, as 'int'
1286         is not wide enough on a few platforms (e.g., AIX and IRIX).
1288 2012-10-23  Kenichi Handa  <handa@gnu.org>
1290         The following change is to make face-font-rescale-alist work
1291         correctly for non-ASCII fonts.
1293         * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
1294         (font_open_for_lface): Handle Vface_font_rescale_alist.
1296 2012-10-23  Chong Yidong  <cyd@gnu.org>
1298         * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
1300 2012-10-21  Jan Djärv  <jan.h.d@swipnet.se>
1302         * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
1303         for screen font.
1304         (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
1306         * xterm.c (x_focus_changed): Check if daemonp when sending focus in
1307         event (Bug#12681).
1309 2012-10-21  Glenn Morris  <rgm@gnu.org>
1311         * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
1313 2012-10-20  Paul Eggert  <eggert@cs.ucla.edu>
1315         Port to OpenBSD 5.1.
1316         * frame.c (Fmouse_position, Fmouse_pixel_position):
1317         * xdisp.c (produce_stretch_glyph):
1318         Declare local vars only when they're needed.
1319         This is clearer and avoids a warning on OpenBSD about unused vars.
1320         * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
1321         This is safer, and avoids OpenBSD warnings about unused vars.
1322         * keyboard.c (record_menu_key): Remove unnecessary decl.
1323         (poll_timer): Define only if POLL_FOR_INPUT is defined.
1324         * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
1325         as our definition clashes with OpenBSD's.
1326         * xfaces.c (load_face_colors, check_lface_attrs)
1327         (get_lface_attributes_no_remap, get_lface_attributes)
1328         (lface_fully_specified_p, x_supports_face_attributes_p)
1329         (tty_supports_face_attributes_p, face_fontset, realize_face)
1330         (realize_x_face, realize_tty_face):
1331         Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
1332         merely Lisp_Object *.  This is more informative and avoids
1333         a warning on OpenBSD about accessing beyond an object's size.
1335 2012-10-20  Chong Yidong  <cyd@gnu.org>
1337         * lread.c (Fload): Doc fix (Bug#12592).
1339 2012-10-19  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
1341         * font.c (Ffont_at): Fix previous change.
1343 2012-10-19  Eli Zaretskii  <eliz@gnu.org>
1345         * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
1346         See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
1347         for the reasons.
1349         * alloc.c (NSTATICS): Decrease to 0x800.
1351 2012-10-19  Stefan Monnier  <monnier@iro.umontreal.ca>
1353         * fns.c (Fnreverse): Include the problem element when signalling an
1354         error (bug#12677).
1356 2012-10-18  Jan Djärv  <jan.h.d@swipnet.se>
1358         * nsterm.m (ns_select): Check writefds before call to
1359         FD_ISSET (Bug#12668).
1361 2012-10-18  Daniel Colascione  <dancol@dancol.org>
1363         * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
1364         (staticpro): If we run out of staticpro slots, die with an
1365         informative error instead of just calling emacs_abort.
1367 2012-10-18  Martin Rudalics  <rudalics@gmx.at>
1369         Fix two flaws reported by Dmitry Antipov.
1370         * window.c (Ftemp_output_buffer_show): Remove.
1371         (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
1372         (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
1374 2012-10-17  Eli Zaretskii  <eliz@gnu.org>
1376         * makefile.w32-in ($(BLD)/w32.$(O)):
1377         ($(BLD)/vm-limit.$(O)):
1378         ($(BLD)/term.$(O)):
1379         ($(BLD)/unexw32.$(O)):
1380         ($(BLD)/fileio.$(O)):
1381         ($(BLD)/dispnew.$(O)): Update dependencies.
1383         * w32term.h (w32_initialize_display_info, initialize_w32_display):
1384         Add prototypes.
1386         * w32proc.c: Include ctype.h.
1388         * w32.h (init_environment, check_windows_init_file)
1389         (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
1390         (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
1391         (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
1392         (sys_link): Add prototypes.
1394         * w32.c: Include w32select.h.
1395         (sys_access, e_malloc, sys_select): Add prototypes.
1396         (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
1398         * vm-limit.c [WINDOWSNT]: Include w32heap.h.
1400         * unexw32.c: Include lisp.h and w32.h.
1402         * term.c [WINDOWSNT]: Include w32term.h.
1404         * process.c [WINDOWSNT]: Add prototype of sys_select.
1406         * fileio.c [WINDOWSNT]: Include w32.h.
1408         * dispnew.c [WINDOWSNT]: Include w32.h.
1410         * cygw32.c (Fcygwin_convert_path_to_windows)
1411         (Fcygwin_convert_path_from_windows): Use EQ to compare 2
1412         Lisp_Object values.  (Bug#12661)
1414         * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
1415         to Lisp_Object.  (Bug#12661)
1417 2012-10-17  Kenichi Handa  <handa@gnu.org>
1419         * xdisp.c (reseat_1): Make the information stored in it->cmp_it
1420         invalidate.
1422 2012-10-17  Dmitry Antipov  <dmantipov@yandex.ru>
1424         * buffer.c (Fkill_buffer): When unchaining the marker,
1425         reset its buffer pointer to NULL (Bug#12652).
1427 2012-10-17  Dmitry Antipov  <dmantipov@yandex.ru>
1429         Do not verify indirection counters of killed buffers (Bug#12579).
1430         * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
1431         * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
1433 2012-10-16  Dmitry Antipov  <dmantipov@yandex.ru>
1435         * alloc.c (Fmake_byte_code): Fix typo in comment.
1436         * print.c (print_interval): Define as static to match prototype.
1437         * indent.c (disptab_matches_widthtab, recompute_width_table):
1438         Convert to eassert.
1440 2012-10-16  Dmitry Antipov  <dmantipov@yandex.ru>
1442         * editfns.c (get_system_name): Remove.
1443         * lisp.h (get_system_name): Remove prototype.
1444         * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
1445         (get_environ_db): Use Vsystem_name.  Avoid call to strlen.
1447 2012-10-15  Daniel Colascione  <dancol@dancol.org>
1449         * dbusbind.c: Add comment explaining reason for previous change.
1451 2012-10-15  Martin Rudalics  <rudalics@gmx.at>
1453         * window.c (Fwindow_end): Rewrite check whether cached position
1454         can be used (Bug#12600).
1455         (resize_frame_windows, grow_mini_window, shrink_mini_window):
1456         Set windows_or_buffers_changed.
1458 2012-10-15  Daniel Colascione  <dancol@dancol.org>
1460         * dbusbind.c: Fix cygw32 build break when compiling with dbus
1461         enabled by undefining the symbol "interface", which the platform
1462         headers define to something incompatible.
1464 2012-10-14  Daniel Colascione  <dancol@dancol.org>
1466         * image.c (init_tiff_functions, init_imagemagick_functions)
1467         (init_svg_functions): Fix cygw32 build break by using these
1468         functions only when WINDOWSNT _and_ HAVE_NTGUI.
1470 2012-10-14  Jan Djärv  <jan.h.d@swipnet.se>
1472         * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
1474 2012-10-13  Jan Djärv  <jan.h.d@swipnet.se>
1476         * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
1478 2012-10-13  HANATAKA, Shinya  <bogytech@gmail.com>  (tiny change)
1480         * coding.c (detect_coding): Set coding->id before calling
1481         this->detector.
1483 2012-10-13  Andreas Schwab  <schwab@linux-m68k.org>
1485         * fileio.c: Formatting fixes.
1487 2012-10-13  Paul Eggert  <eggert@cs.ucla.edu>
1489         Fix some stat-related races.
1490         * fileio.c (Fwrite_region): Avoid race condition if a file is
1491         removed or renamed by some other process immediately after Emacs
1492         writes it but before Emacs stats it.  Do not assume that stat (or
1493         fstat) succeeds.
1494         * image.c (slurp_file): Resolve the file name with fopen + fstat
1495         rather than stat + fopen.
1496         (pbm_read_file) [0]: Remove unused code with stat race.
1497         * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
1498         Remove ineffective code with stat race.
1500 2012-10-12  Stefan Monnier  <monnier@iro.umontreal.ca>
1502         * doc.c (get_doc_string): Don't signal an error if the file is missing.
1504 2012-10-12  Jan Djärv  <jan.h.d@swipnet.se>
1506         * nsterm.m (hold_event_q): New static variable.
1507         (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
1508         ! q_event_ptr.
1509         (hold_event): New function.
1510         (ns_read_socket): If hold_event_q have events, store them and
1511         return (Bug#12384).
1512         (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
1513         is zero (Bug#12384).
1515 2012-10-12  Juanma Barranquero  <lekktu@gmail.com>
1517         * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
1519 2012-10-12  Eli Zaretskii  <eliz@gnu.org>
1521         * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
1523         * fileio.c (check_existing): New function.
1524         (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
1525         instead of calling 'stat', when what's needed is to check whether
1526         a file exists.  This avoids expensive system calls on MS-Windows.
1527         (Bug#12587)
1529         * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
1531         * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
1532         determine whether a file exists and is not a directory.
1534         * lisp.h (check_existing): Add prototype.
1536 2012-10-12  Jan Djärv  <jan.h.d@swipnet.se>
1538         * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
1540 2012-10-12  Glenn Morris  <rgm@gnu.org>
1542         * buffer.c (Fset_buffer): Doc fix.  (Bug#12624)
1544 2012-10-11  Stefan Monnier  <monnier@iro.umontreal.ca>
1546         * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
1548         * eval.c (Fautoload): Remember previous autoload status in load-history.
1550 2012-10-11  Paul Eggert  <eggert@cs.ucla.edu>
1552         lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
1553         * lread.c (load_each_byte, new_backquote_flag, readchar)
1554         (read_filtered_event, lisp_file_lexically_bound_p)
1555         (safe_to_load_version, Fload, complete_filename_p, openp)
1556         (build_load_history, readevalloop, read_escape, read1)
1557         (string_to_number, read_vector, read_list):
1558         * macros.c (Fstart_kbd_macro):
1559         * marker.c (CONSIDER):
1560         * menu.c (parse_single_submenu, digest_single_submenu)
1561         (find_and_return_menu_selection, Fx_popup_menu):
1562         * minibuf.c (read_minibuf_noninteractive, read_minibuf)
1563         (Ftry_completion):
1564         * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
1565         (ns_menu_show):
1566         * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
1567         (xmenu_show, xdialog_show):
1568         Use bool for booleans.
1569         * lread.c (safe_to_load_version): Rename from safe_to_load_p,
1570         as it's not a predicate.  All uses changed.  Omit unnecessary
1571         buffer termination.
1573 2012-10-11  Dmitry Antipov  <dmantipov@yandex.ru>
1575         * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
1576         (save_excursion_restore): Do not restore mark if it was not saved.
1578 2012-10-11  Paul Eggert  <eggert@cs.ucla.edu>
1580         * marker.c (cached_modiff): EMACS_INT, not int.
1582         * w32select.c (waiting_for_input): Declare by including "keyboard.h"
1583         instead of having a wrong decl.
1584         * nsmenu.m (waiting_for_input): Remove wrong decl.
1586 2012-10-10  Paul Eggert  <eggert@cs.ucla.edu>
1588         keyboard.c, keymap.c: Use bool for booleans.
1589         * dispnew.c (sit_for): Distinguish between 3-way display_option
1590         and boolean do_display.
1591         * keyboard.c (single_kboard, this_command_key_count_reset)
1592         (waiting_for_input, echoing, immediate_quit, input_pending)
1593         (interrupt_input, interrupts_deferred, pop_kboard)
1594         (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
1595         (command_loop_1, adjust_point_for_property)
1596         (safe_run_hooks_error, input_polling_used, read_char):
1597         (help_char_p, readable_events, kbd_buffer_events_waiting)
1598         (kbd_buffer_get_event, timer_check_2, make_lispy_event)
1599         (lucid_event_type_list_p, get_input_pending):
1600         (gobble_input, menu_separator_name_p, menu_bar_item)
1601         (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
1602         (read_char_minibuf_menu_prompt, access_keymap_keyremap)
1603         (keyremap_step, test_undefined, read_key_sequence)
1604         (detect_input_pending, detect_input_pending_ignore_squeezables)
1605         (detect_input_pending_run_timers, requeued_events_pending_p)
1606         (quit_throw_to_read_char, Fset_input_interrupt_mode):
1607         * keymap.c (get_keymap, keymap_parent, keymap_memberp)
1608         (access_keymap_1, access_keymap, map_keymap, get_keyelt)
1609         (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
1610         (accessible_keymaps_1, Fkey_description, push_key_description):
1611         (shadow_lookup, struct where_is_internal_data)
1612         (where_is_internal, Fwhere_is_internal, where_is_internal_1)
1613         (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
1614         (describe_map, describe_vector):
1615         * menu.c (single_menu_item):
1616         * nsmenu.m (ns_update_menubar):
1617         * process.c (wait_reading_process_output):
1618         * search.c (scan_buffer, scan_newline):
1619         Use bool for boolean.
1620         * keyboard.c (timers_run, swallow_events)
1621         (detect_input_pending_run_timers):
1622         * process.c (wait_reading_process_output):
1623         Use unsigned for counter where wraparound-on-overflow is desired,
1624         since unsigned is guaranteed to have that behavior and signed is not.
1625         (read_char): Use ptrdiff_t for string length.
1626         (get_input_pending): Remove first argument, since it was always
1627         the same pointer-to-int (now pointer-to-boolean) &input_pending,
1628         and behave as if it had that value.  Return new value of
1629         input_pending.  All callers changed.
1630         * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
1631         immediate_echo.  Use ptrdiff_t for echo_after_prompt, since it's
1632         a string length.
1633         * keymap.c (push_key_description): Omit last arg, which was always 1.
1634         All callers changed.
1636         * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
1638 2012-10-10  Juanma Barranquero  <lekktu@gmail.com>
1640         * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
1641         ($(BLD)/term.$(O)): Update dependencies.
1643 2012-10-10  Dmitry Antipov  <dmantipov@yandex.ru>
1645         * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
1646         * lisp.h (enum pvec_type): Adjust comments and omit explicit
1647         initializer for PVEC_NORMAL_VECTOR.
1649 2012-10-10  Paul Eggert  <eggert@cs.ucla.edu>
1651         Clean out old termopts cruft.
1652         * termopts.h (flow_control, meta_key): Remove unused decls.
1653         * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
1654         Don't include termopts.h.
1656 2012-10-10  Dmitry Antipov  <dmantipov@yandex.ru>
1658         * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
1660 2012-10-10  Paul Eggert  <eggert@cs.ucla.edu>
1662         * commands.h (immediate_quit): Remove duplicate decl.
1664 2012-10-09  Jan Djärv  <jan.h.d@swipnet.se>
1666         * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
1667         caching.
1668         (nsfont_open): Remove setting of Vfonts_in_cache.
1669         (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
1671 2012-10-09  Eli Zaretskii  <eliz@gnu.org>
1673         * w32fns.c (w32_last_error): Change the return value to DWORD, to
1674         match what GetLastError returns.  Explain why the function is
1675         needed.
1677         * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
1678         'is_tooltip_frame', to avoid confusion with its global namesake.
1680 2012-10-08  Daniel Colascione  <dancol@dancol.org>
1682         * xdisp.c (start_hourglass): Call w32_note_current_window when
1683         HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
1684         build that caused Emacs to display the hourglass cursor forever.
1686         * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
1687         which is broken under remote desktop, calculate the number of
1688         colors available for a display based on the display's number of
1689         planes and number of bits per pixel per plane.  (bug#10397).
1691 2012-10-08  Jan Djärv  <jan.h.d@swipnet.se>
1693         * nsfont.m (Vfonts_in_cache): New variable.
1694         (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
1695         are used.  Add cached fonts to Vfonts_in_cache.
1696         (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
1698 2012-10-08  Juanma Barranquero  <lekktu@gmail.com>
1700         * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
1701         in nt/config.nt.
1702         (FONT_H): Define after FRAME_H.
1703         ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
1704         Update dependencies.
1706         * w32term.c: Remove leftover declaration of keyboard_codepage.
1708 2012-10-08  Eli Zaretskii  <eliz@gnu.org>
1710         * makefile.w32-in (FONT_H): Add $(FRAME_H).
1711         (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
1712         ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
1713         (GLOBAL_SOURCES): Add cygw32.c.
1714         ($(BLD)/unexw32.$(O)):
1715         ($(BLD)/w32.$(O)):
1716         ($(BLD)/w32console.$(O)):
1717         ($(BLD)/w32fns.$(O)):
1718         ($(BLD)/w32heap.$(O)):
1719         ($(BLD)/w32menu.$(O)):
1720         ($(BLD)/w32proc.$(O)): Add w32common.h.
1722         * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
1723         'const char *'.
1724         (x_to_w32_color): Don't modify the argument, modify a copy instead.
1726 2012-10-08  Daniel Colascione  <dancol@dancol.org>
1728         * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
1729         (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
1730         accidental message numbering hole.  Change other messages to
1731         match.
1733         * w32select.h (HAVE_W32SELECT): Remove.
1735         * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1736         w32common.h instead of w32heap.h.
1738         * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
1739         (get_allocation_unit, get_processor_type, get_w32_major_version)
1740         (get_w32_minor_version, sysinfo_cache, osinfo_cache)
1741         (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
1742         (OS_NT, os_subtype, cache_system_info): Move declarations to
1743         w32common.
1745         * w32heap.c: Include w32common.h.
1746         (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
1747         (w32_minor_version, w32_build_number, w32_subtype):
1748         Remove duplicate definitions.
1750         * w32fns.c: Include w32common.h; include w32heap.h only in
1751         WINDOWSNT.
1753         (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
1754         Use `report_file_error' instead of `error' in order to better
1755         inform users of what went wrong.  Increase NTGUI_UNICODE file
1756         dialog box file name length to 32k, the maximum allowed by the NT
1757         kernel.
1759         * w32common.h: New file.
1760         (ROUND_UP, ROUND_DOWN, get_page_size)
1761         (get_allocation_unit, get_processor_type, get_w32_major_version)
1762         (get_w32_minor_version, sysinfo_cache, osinfo_cache)
1763         (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
1764         (OS_NT, os_subtype, cache_system_info): Move here.
1766         * unexw32.c, unexcw.c: Include w32common.h.
1768         * emacs.c (main): Use (defined (WINDOWSNT) || defined
1769         HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
1770         to call syms_of_w32select.
1772         * cygw32.h: Remove obsolete EXFUN declarations.
1774         * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
1776         * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
1777         of w32inevt.o from SOME_MACHINE_OBJECTS.
1779 2012-10-08  Daniel Colascione  <dancol@dancol.org>
1781         * image.c: Permanent fix for JPEG compilation issue --- limit
1782         jpeglib `boolean' redefinition to Cygwin builds.
1784 2012-10-08  Eli Zaretskii  <eliz@gnu.org>
1786         * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
1788         * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
1789         Cygwin.
1791 2012-10-08  Daniel Colascione  <dancol@dancol.org>
1793         * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
1794         w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
1795         w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
1796         w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
1797         keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
1798         emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
1799         Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
1800         operating system.  defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
1801         now a supported configuration.
1803         * Makefile.in: consolidate image variables into LIBIMAGE; add
1804         W32_OBJ and W32_LIBS.  Compile new files.
1806         * conf_post.h:
1807         (_DebPrint) declare tracing facility for W32 debugging.  We need
1808         to unify tracing later.
1810         (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
1811         unconditional use of W32 Unicode functions.  Cygwin runs only on
1812         100% Unicode operating systems.
1814         * cygw32.c: New file.  Define Cygwin-specific facilities.
1815         (Fcygwin_convert_path_to_windows)
1816         (Fcygwin_convert_path_from_windows): New user functions for
1817         accessing Cygwin path-munging routines.
1819         * cygw32.h: New file.
1820         (WCSDATA, to_unicode, from_unicode): Define facilities for storing
1821         UTF-16LE strings temporarily inside non-Lisp-visible string
1822         objects.
1824         (w32_strerror): Just what it says on the tin.
1826         * emacs.c: Make the NS fork-then-exec code for daemon-launching
1827         also run for Cygwin; both systems have the same problem with using
1828         GUI facilities in a forked child.  Also call syms_of_cygw32,
1829         syms_of_w32select in correct places.
1831         (DAEMON_MUST_EXEC): new macro defined to signal that a platform
1832         needs fork-then-exec for daemon launching.
1834         * font.h: Include frame.h.
1836         * image.c: Use the image library cache machinery only when we're
1837         compiling for native WINDOWSNT; Cygwin can use shared libraries
1838         like any other Unixlike system.
1840         * keyboard.c: Clarify a comment regarding the input loop.
1842         * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
1843         functions directly instead of trying to detect at runtime that our
1844         host operating system supports them.  We make this change for two
1845         reasons: Cygwin lacks support for the multibyte character
1846         conversion functions used by the legacy menu code, and Cygwin
1847         never needs to rely on non-Unicode APIs.
1849         * unexw32.c (hinst): Declare extern.
1851         * w32.c: Change header order;
1852         (w32_strerror): Move to w32fns.c because we need it for
1853         non-WINDOWSNT builds.
1855         * w32.h: Add #error macro to make sure we don't include w32.h for
1856         Cygwin builds.  Remove w32select declarations.
1858         * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1859         w32fns.c.  w32console.c is WINDOWSNT-only.
1861         * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
1862         NTGUI_UNICODE tweaks.  (See above.) Change _snprintf to the more
1863         POSIXy alternative.
1864         (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
1865         (w32_major_version, w32_minor_version, w32_build_number)
1866         (os_subtype, sound_type): Define here
1867         (w32_defined_color): Make color parameter const for consistency
1868         with other _defined_color functions.
1869         (w32_createwindow): Unconditionally call w32_init_class instead of
1870         doing so only when hprevinst is non-NULL.  Plumbing hprevinst
1871         through the code is complex and unnecessary because class
1872         registration is practically free.
1873         (w32_name_of_message): New EMACSDEBUG-only function.
1874         (Fset_message_beep): Move here
1875         (Fx_open_connection): Require that the display name for Windows be
1876         "w32" for consistency, emacsclient disambiguation, and maybe, one
1877         day, multi-window-system support.
1878         (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
1879         Cygwin files for W32 GUI facilities, since these clearly don't
1880         expect Cygwin names.
1881         (_DebPrint): Define.
1882         (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
1883         (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
1884         (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
1885         (w32_last_error): Remove.
1887         * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
1889         * w32heap.c (syspage_mask): Declare here.
1890         (cache_system_info): Remove.
1892         * w32inevt.c (faked_key): Define globally, not statically.
1893         (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
1894         (w32_console_toggle_lock_key): Move to w32fns.c.
1896         * w32menu.c: Include setjmp.h.  NTGUI_UNICODE changes throughout.
1898         * w32proc.c (_DebPrint): Move to w32fns.c.
1899         * w32select.c: Include string.h, stdio.h for Cygwin.
1900         * w32select.h: New File.
1902         * w32term.c: Include io.h for non-CYGWIN builds; needed for
1903         get_osfhandle.
1904         (w32_message_fd): New variable.  Under Cygwin, holds the file
1905         descriptor the system used to tell us about pending thread
1906         messages.
1908         (w32_init_term): Remove incorrect calls to fcntl and init_sigio
1909         that prevented compilation under non-WINDOWSNT systems.
1911         (w32_initialize): Open /dev/windows and assign it to
1912         w32_message_fd.  Provide w32 feature.
1914         * w32term.h: Include frame.h, atimer.h.  Declare various frame functions.
1915         (WM_EMACS_INPUT_READY): add.
1916         (prepend_msg, w32_message_fd): Declare globally.
1918         * w32xfns.c:
1919         (keyboard_handle): Use only when WINDOWSNT.
1920         (notify_msg_ready): New function.  Posts a message to the main
1921         thread's message queue under CYGWIN, which wakes up the main
1922         thread from select(2) by making the /dev/windows file descriptor
1923         ready.  Under WINDOWSNT, it sets an event the same way the old
1924         code did.
1926         (post, prepend_msg): Actually call notify_msg_ready instead of
1927         setting the input event directly.
1929 2012-10-07  Eli Zaretskii  <eliz@gnu.org>
1931         * ralloc.c (relinquish): If a heap is ready to be relinquished,
1932         but it still has blocs in it, don't return it to the system,
1933         instead of aborting.  (Bug#12402)
1935 2012-10-07  Jan Djärv  <jan.h.d@swipnet.se>
1937         * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
1939         * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
1940         MAC_OS_X_VERSION_10_6.
1941         (syms_of_nsterm): Remove comment about Panther and above for
1942         ns-antialias-text.
1943         * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
1944         (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
1945         (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
1947         * nsselect.m (ns_string_from_pasteboard): Remove check for >=
1948         MAC_OS_X_VERSION_10_4.
1950         * nsmenu.m (fillWithWidgetValue:): Remove code for <
1951         MAC_OS_X_VERSION_10_2.
1953         * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
1955         * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
1956         (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
1958         * nsterm.m (ns_in_resize): Remove (Bug#12479).
1959         (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
1960         (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
1961         Remove ns_in_resize check.
1962         (ns_clear_frame_area): Remove resize handle code.
1964         * nsfns.m (ns_in_resize): Remove.
1965         (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
1966         Remove ns_in_resize check.
1968 2012-10-07  Paul Eggert  <eggert@cs.ucla.edu>
1970         Improve sys_siglist detection.
1971         * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
1972         defined as a macro, as is done in Solaris.
1973         (sys_siglist_entries): New macro.
1974         (save_strsignal): Use it.
1975         * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
1976         GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
1978 2012-10-06  Jan Djärv  <jan.h.d@swipnet.se>
1980         * nsfns.m (Fx_create_frame): Call x_default_parameter with
1981         fullscreen/Fullscreen.
1983         * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
1984         tobar_height is new.
1986         * nsterm.m (x_make_frame_visible): Check for fullscreen.
1987         (ns_fullscreen_hook): Activate old style fullscreen with a timer.
1988         (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
1989         (windowDidResize:): Check for correct window if old style fullscreen.
1990         Capitalize word in comment.  Remove incorrect comment.
1991         (initFrameFromEmacs:): tbar_height renamed tibar_height.
1992         (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
1993         error in drawing background.
1994         (toggleFullScreen:): Remove comment.  Rearrange calls.
1995         Set toolbar values to zero, save old height in tobar_height.
1996         Restore tool bar height when leaving fullscreen.
1997         (canBecomeMainWindow): New function.
1999 2012-10-06  Paul Eggert  <eggert@cs.ucla.edu>
2001         * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
2003 2012-10-05  Eli Zaretskii  <eliz@gnu.org>
2005         * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
2007         * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
2008         that time stamps of directories could also be changed.
2009         Don't request the too broad GENERIC_WRITE, only the more restrictive
2010         FILE_WRITE_ATTRIBUTES access rights.
2012         * fileio.c (Fset_file_times): Special-case ignoring errors for
2013         directories only on MSDOS, not on MS-Windows.
2015 2012-10-05  Ikumi Keita  <ikumi@ikumi.que.jp>  (tiny change)
2017         * minibuf.c (Fcompleting_read): Doc fix.  (Bug#12555)
2019 2012-10-04  Eli Zaretskii  <eliz@gnu.org>
2021         * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
2022         see whether CreateFile failed.
2024 2012-10-04  Paul Eggert  <eggert@cs.ucla.edu>
2026         * profiler.c (handle_profiler_signal): Inhibit pending signals too,
2027         to avoid similar races.
2028         * keyboard.c (pending_signals): Now bool, not int.
2030         Port timers to OpenBSD, plus check for timer failures.
2031         OpenBSD problem reported by Han Boetes.
2032         * profiler.c (setup_cpu_timer): Check for failure of timer_settime
2033         and/or setitimer.
2034         (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
2035         * syssignal.h (HAVE_ITIMERSPEC): New macro.  This is for platforms
2036         like OpenBSD, which has timer_settime but does not declare it.
2037         OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
2038         whether to use itimerspec-related primitives.  All uses of
2039         HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
2041 2012-10-02  Paul Eggert  <eggert@cs.ucla.edu>
2043         * profiler.c (handle_profiler_signal): Fix a malloc race
2044         that caused Emacs to hang on Fedora 17 when profiling Lisp.
2046 2012-10-02  Jan Djärv  <jan.h.d@swipnet.se>
2048         * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
2050 2012-10-02  Eli Zaretskii  <eliz@gnu.org>
2052         * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
2053         consistent with the change in return value of 'safe_strsignal'.
2055 2012-10-02  Paul Eggert  <eggert@cs.ucla.edu>
2057         Prefer plain 'static' to 'static inline' (Bug#12541).
2058         * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
2059         (bidi_set_sor_type, bidi_push_embedding_level)
2060         (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
2061         (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
2062         (bidi_cache_search, bidi_cache_ensure_space)
2063         (bidi_cache_iterator_state, bidi_cache_find)
2064         (bidi_peek_at_next_level, bidi_set_paragraph_end)
2065         (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
2066         (bidi_explicit_dir_char, bidi_resolve_neutral_1):
2067         Now 'static', not 'static inline'.
2069         Count overruns when profiling; change units to ns.
2070         * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
2071         Give extra weight to samples after overruns, to attempt to count
2072         the time more accurately.
2073         (setup_cpu_timer): Change sampling interval units from ms to ns, since
2074         the underlying primitives nominally do ns.
2075         (Fprofiler_cpu_start): Document the change.  Mention that
2076         the sampling intervals are only approximate.
2078 2012-10-02  Stefan Monnier  <monnier@iro.umontreal.ca>
2080         * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
2082         * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
2083         case for the special 0 coding-system.
2085         * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
2086         (Fmake_overlay): Remove redundant tests.
2087         (fix_start_end_in_overlays): Remove redundant recentering.
2089 2012-10-02  Juanma Barranquero  <lekktu@gmail.com>
2091         * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
2092         Update dependencies.
2094 2012-10-01  Paul Eggert  <eggert@cs.ucla.edu>
2096         Fix a malloc race condition involving strsignal.
2097         A signal can arrive in the middle of a malloc, and Emacs's signal
2098         handler can invoke strsignal, which can invoke malloc, which is
2099         not portable.  This race condition bug makes Emacs hang on GNU/Linux.
2100         Fix it by altering the signal handler so that it does not invoke
2101         strsignal.
2102         * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
2103         * process.c (status_message): Use const pointer, in case strsignal
2104         is #defined to safe_strsignal.
2105         * sysdep.c (sys_siglist, init_signals): Always define and
2106         initialize a substitute sys_siglist if the system does not define
2107         one, even if HAVE_STRSIGNAL.
2108         (safe_strsignal): Rename from strsignal.  Always define,
2109         using sys_siglist.  Return a const pointer.
2110         * syssignal.h (safe_strsignal): New decl.
2111         (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
2113 2012-10-01  Eli Zaretskii  <eliz@gnu.org>
2115         * w32proc.c (timer_loop): Fix code that waits for timer
2116         expiration, to avoid high CPU usage.
2118 2012-10-01  Stefan Monnier  <monnier@iro.umontreal.ca>
2120         * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
2121         (sweep_weak_table): Remove redundant prototypes.
2123 2012-10-01  Fabrice Popineau  <fabrice.popineau@gmail.com>
2125         * emacs.c: Move the inclusion of TERM_HEADER after including
2126         windows.h on WINDOWSNT.  This avoids compilation problems with
2127         MSVC.
2129 2012-10-01  Eli Zaretskii  <eliz@gnu.org>
2131         * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
2132         (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
2133         (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
2134         as the previous version used 'void *'.
2136         * ralloc.c (ROUNDUP): Fix last change.
2137         (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
2138         'size_t'.
2140         * w32proc.c <disable_itimers>: New static flag.
2141         (init_timers): Initialize it to zero, after creating the critical
2142         sections used by the timer threads.
2143         (term_timers): Set to 1 before deleting the critical sections.
2144         (getitimer, setitimer): If disable_itimers is non-zero, return an
2145         error indication without doing anything.  Reported by Fabrice
2146         Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
2147         (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
2148         return results.
2149         [!HAVE_SETITIMER]: Behave as the previous version that didn't
2150         support timers.
2152         * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
2153         term_ntproc after all the other bookkeeping, to get timers working
2154         as long as possible.
2156 2012-10-01  Paul Eggert  <eggert@cs.ucla.edu>
2158         * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
2159         Suggested by Juri Linkov in
2160         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
2162         Prefer plain 'static' to 'static inline' (Bug#12541).
2163         With static functions, modern compilers inline pretty well by
2164         themselves; advice from programmers often hurts as much as it helps.
2165         On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
2166         this change shrinks the text size of the Emacs executable by 1.1%
2167         without affecting CPU significantly in my benchmark.
2168         * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
2169         (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
2170         (mark_maybe_object, mark_maybe_pointer, bounded_number):
2171         * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2172         (bset_auto_fill_function, bset_auto_save_file_format)
2173         (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2174         (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2175         (bset_cache_long_line_scans, bset_case_fold_search)
2176         (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2177         (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2178         (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2179         (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2180         (bset_header_line_format, bset_indicate_buffer_boundaries)
2181         (bset_indicate_empty_lines, bset_invisibility_spec)
2182         (bset_left_fringe_width, bset_major_mode, bset_mark)
2183         (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2184         (bset_name, bset_overwrite_mode, bset_pt_marker)
2185         (bset_right_fringe_width, bset_save_length)
2186         (bset_scroll_bar_width, bset_scroll_down_aggressively)
2187         (bset_scroll_up_aggressively, bset_selective_display)
2188         (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2189         (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
2190         (set_buffer_overlays_after):
2191         * category.c (bset_category_table):
2192         * charset.c (read_hex):
2193         * coding.c (produce_composition, produce_charset)
2194         (handle_composition_annotation, handle_charset_annotation)
2195         (char_encodable_p):
2196         * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
2197         (assign_row, set_frame_matrix_frame, make_current)
2198         (add_row_entry):
2199         * eval.c (set_specpdl_symbol, set_specpdl_old_value):
2200         * fns.c (maybe_resize_hash_table):
2201         * frame.c (fset_buffer_predicate, fset_minibuffer_window):
2202         * gmalloc.c (register_heapinfo):
2203         * image.c (lookup_image_type):
2204         * intervals.c (set_interval_object, set_interval_left)
2205         (set_interval_right, copy_interval_parent, rotate_right)
2206         (rotate_left, balance_possible_root_interval):
2207         * keyboard.c (kset_echo_string, kset_kbd_queue)
2208         (kset_keyboard_translate_table, kset_last_prefix_arg)
2209         (kset_last_repeatable_command, kset_local_function_key_map)
2210         (kset_overriding_terminal_local_map, kset_real_last_command)
2211         (kset_system_key_syms, clear_event, set_prop):
2212         * lread.c (digit_to_number):
2213         * marker.c (attach_marker, live_buffer, set_marker_internal):
2214         * nsterm.m (ns_compute_glyph_string_overhangs):
2215         * process.c (pset_buffer, pset_command)
2216         (pset_decode_coding_system, pset_decoding_buf)
2217         (pset_encode_coding_system, pset_encoding_buf, pset_filter)
2218         (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
2219         (pset_status, pset_tty_name, pset_type, pset_write_queue):
2220         * syntax.c (bset_syntax_table, dec_bytepos):
2221         * terminal.c (tset_param_alist):
2222         * textprop.c (interval_has_some_properties)
2223         (interval_has_some_properties_list):
2224         * window.c (wset_combination_limit, wset_dedicated)
2225         (wset_display_table, wset_hchild, wset_left_fringe_width)
2226         (wset_left_margin_cols, wset_new_normal, wset_new_total)
2227         (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2228         (wset_right_fringe_width, wset_right_margin_cols)
2229         (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
2230         (wset_vertical_scroll_bar_type, wset_window_parameters):
2231         * xdisp.c (wset_base_line_number, wset_base_line_pos)
2232         (wset_column_number_displayed, wset_region_showing)
2233         (window_box_edges, run_window_scroll_functions)
2234         (append_glyph_string_lists, prepend_glyph_string_lists)
2235         (append_glyph_string, set_glyph_string_background_width)
2236         (append_glyph, append_composite_glyph)
2237         (take_vertical_position_into_account):
2238         * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
2239         (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
2240         (lface_hash, lface_same_font_attributes_p, lookup_face):
2241         * xml.c (libxml2_loaded_p):
2242         * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
2243         (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
2244         Now 'static', not 'static inline'.
2246         * bidi.c: Tune.
2247         (bidi_copy_it): Do the whole copy with a single memcpy.
2248         (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
2250         Revert the FOLLOW-SYMLINKS change for file-attributes.
2251         Doing it right would require several changes to Tramp, and there's
2252         not enough time to get that tested before the freeze today.
2253         * dired.c (directory_files_internal, Ffile_attributes):
2254         Undo last change.
2256         * frame.c (x_report_frame_params): Port better to wider ints.
2257         Do not assume that EMACS_UINT is the same width as uprintmax_t,
2258         or that pointers can be printed in 15 decimal digits.
2259         Avoid GCC warnings if EMACS_UINT is wider than a pointer.
2261 2012-09-30  Fabrice Popineau  <fabrice.popineau@supelec.fr>
2263         Support x64 build on MS-Windows.
2264         * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
2265         (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
2266         compatibility with x64.
2267         (x_get_focus_frame): Add prototype.
2269         * w32term.c (w32_draw_underwave): Don't use GCC extensions for
2270         defining an XRectangle structure.
2272         * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
2273         arithmetics for compatibility with x64.
2275         * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
2276         compatibility with x64.
2278         * w32heap.h: Adjust prototypes and declarations.
2280         * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
2281         (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
2282         DWORD, long, and unsigned long, for compatibility with x64.
2283         (allocate_heap) [_WIN64]: Reserve 32GB of memory.
2284         (sbrk): Argument is now of type ptrdiff_t.
2286         * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
2287         less than 0x0500.
2288         (w32_msg_pump): Use WPARAM type for 'result'.
2290         * w32.c (init_environment, get_emacs_configuration): Support AMD64
2291         architecture.
2292         (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
2293         compatibility with x64.
2295         * vm-limit.c (lim_data): Now size_t.
2296         (check_memory_limits): Adjust prototypes of real_morecore and
2297         __morecore to receive argument of type ptrdiff_t.  Use size_t for
2298         five_percent and data_size.
2300         * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
2301         variables, for compatibility with x64.
2302         (rva_to_section, offset_to_section, relocate_offset)
2303         (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
2304         (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
2305         (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
2306         for compatibility with x64.
2308         * sysdep.c (STDERR_FILENO): Define if not already defined.
2310         * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
2311         (__morecore): Argument type is now ptrdiff_t.
2312         (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
2313         (relinquish): Use ptrdiff_t type for 'excess'.
2314         (r_alloc_sbrk): Argument type is now ptrdiff_t.
2316         * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
2317         (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
2318         instead of a literal number.
2320         * gmalloc.c [WINDOWSNT]: Include w32heap.h.
2321         (min): Define only if not already defined.
2323         * frame.c (x_report_frame_params): Use EMACS_UINT for the return
2324         value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
2325         hosts.
2327         * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
2328         'bitmaps' is a pointer.
2330         * dispextern.h (x_bitmap_pixmap): Adjust prototype.
2332         * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
2334 2012-09-30  Paul Eggert  <eggert@cs.ucla.edu>
2336         file-attributes has a new optional arg FOLLOW-SYMLINKS.
2337         * dired.c (directory_files_internal, Ffile_attributes):
2338         New arg follow_symlinks.  All uses changed.
2340 2012-09-30  Stefan Monnier  <monnier@iro.umontreal.ca>
2342         * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
2344 2012-09-30  Eli Zaretskii  <eliz@gnu.org>
2346         Support atimers and CPU profiler via profile.c on MS-Windows.
2347         * w32proc.c (sig_mask, crit_sig): New static variables.
2348         (sys_signal): Support SIGALRM and SIGPROF.
2349         (sigemptyset, sigaddset, sigfillset, sigprocmask)
2350         (pthread_sigmask, setpgrp): Move here from w32.c.  sigaddset,
2351         sigfillset, and sigprocmask are no longer no-ops.
2352         (sigismember): New function.
2353         (struct itimer_data): New definition.
2354         (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
2355         (crit_prof): New static variables.
2356         (MAX_SINGLE_SLEEP): New definition.
2357         (timer_loop, stop_timer_thread, term_timers, init_timers)
2358         (start_timer_thread, getitimer, setitimer): New functions.
2359         (alarm): No longer a no-op, calls setitimer.
2361         * w32.c (term_ntproc): Call term_timers.
2362         (init_ntproc): Make sure all signals are unblocked at startup, to
2363         erase any traces of dumping.  Call init_timers.
2365         * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
2366         Windows-specific code to display the hourglass mouse pointer is no
2367         longer used.
2368         (w32_wnd_proc): Remove code that handled the WM_TIMER message due
2369         to hourglass timer expiration.
2370         (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
2371         Remove, no longer used.
2372         (w32_note_current_window, show_hourglass, hide_hourglass):
2373         New functions, in support of hourglass cursor display similar to other
2374         window systems.
2375         (syms_of_w32fns): Don't initialize hourglass_timer.
2377         * xdisp.c (start_hourglass, cancel_hourglass): Now used on
2378         WINDOWSNT as well.
2379         (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
2381         * w32.h (init_timers, term_timers): Add prototypes.
2383 2012-09-30  Kenichi Handa  <handa@gnu.org>
2385         * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
2386         to the buffer relocation which may be caused by ccl_driver.
2388 2012-09-30  Jan Djärv  <jan.h.d@swipnet.se>
2390         * xfns.c (Fx_file_dialog): Update comment.
2392         * w32fns.c (Fx_file_dialog): Update comment.
2394         * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
2395         Initialize panel name field if OSX >= 10.6.
2397         * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
2399         * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
2401         * nsterm.m (NEW_STYLE_FS): New define.
2402         (ns_fullscreen_hook, windowWillEnterFullScreen)
2403         (windowDidEnterFullScreen, windowWillExitFullScreen)
2404         (windowDidExitFullScreen, toggleFullScreen, handleFS)
2405         (setFSValue): New functions.
2406         (EmacsFSWindow): New implementation.
2407         (canBecomeKeyWindow): New function for EmacsFSWindow.
2408         (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
2409         (dealloc): Release nonfs_window if in fullscreen.
2410         (updateFrameSize:): Call windowDidMove to update top/left.
2411         (windowWillResize:toSize:): Check if frame is still maximized.
2412         (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
2413         next_maximized, maximized_width, maximized_height and nonfs_window.
2414         Call setCollectionBehavior if NEW_STYLE_FS.  Initialize bwidth and
2415         tbar_height.
2416         (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
2417         fullscreen.  Set maximized_width/height.  Act on next_maximized.
2419         * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
2420         (EmacsView): Add variables for fullscreen.
2421         (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
2422         (EmacsFSWindow): New interface for fullscreen.
2424 2012-09-30  Juanma Barranquero  <lekktu@gmail.com>
2426         * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2428 2012-09-30  Chong Yidong  <cyd@gnu.org>
2430         * fns.c (Frandom): Doc fix.
2432 2012-09-30  Martin Rudalics  <rudalics@gmx.at>
2434         * window.c (Vwindow_combination_limit): New default value.
2435         (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
2437 2012-09-30  Paul Eggert  <eggert@cs.ucla.edu>
2439         * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
2440         Suggested by Eli Zaretskii in
2441         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
2443 2012-09-30  Eli Zaretskii  <eliz@gnu.org>
2445         * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
2446         HAVE_TIMER_SETTIME is defined.
2448 2012-09-30  Paul Eggert  <eggert@cs.ucla.edu>
2450         Profiler improvements: more-accurate timers, overflow checks.
2451         * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
2452         signal.h, setjmp.h.  Include systime.h instead.
2453         (saturated_add): New function.
2454         (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
2455         (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
2456         (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
2457         New static vars.
2458         (enum profiler_cpu_running): New enum.
2459         (profiler_cpu_running): Now of that enum type, not bool.
2460         All uses changed to store the new value.
2461         (handle_profiler_signal): Rename from sigprof_handler_1,
2462         for consistency with other handlers.  Do not check whether
2463         cpu_log is a hash-table if garbage collecting, since it
2464         doesn't matter in that case.
2465         (deliver_profiler_signal): Rename from sigprof_handler,
2466         for consistency with other handlers.
2467         (setup_cpu_timer): New function, with much of what used to be in
2468         Fprofiler_cpu_start.  Check for out-of-range argument.
2469         Prefer timer_settime if available, and prefer
2470         thread cputime clocks, then process cputime clocks, then
2471         monotonic clocks, to the old realtime clock.  Use make_timeval
2472         to round more-correctly when falling back to setitimer.
2473         (Fprofiler_cpu_start): Use it.
2474         (Fprofiler_cpu_stop): Prefer timer_settime if available.
2475         Don't assume that passing NULL as the 2nd argument of setitimer
2476         is the same as passing a pointer to all-zero storage.
2477         Ignore SIGPROF afterwards.
2478         (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
2479         * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
2480         non-fatal signal handlers.  Ignore SIGPROF on startup.
2481         * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
2482         in profiler.c, since sysdep.c now uses it.
2484         * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
2485         Suggested by Eli Zaretskii in
2486         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
2488 2012-09-29  Juanma Barranquero  <lekktu@gmail.com>
2490         * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2492 2012-09-29  Stefan Monnier  <monnier@iro.umontreal.ca>
2494         * lisp.h (struct backtrace): Remove indirection for `function' field.
2495         * xdisp.c (redisplay_internal):
2496         * profiler.c (record_backtrace, sigprof_handler_1):
2497         * alloc.c (Fgarbage_collect):
2498         * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
2499         (Fbacktrace_frame): Adjust accordingly.
2501 2012-09-28  Glenn Morris  <rgm@gnu.org>
2503         * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
2504         (Frun_hook_with_args_until_failure): Doc fixes.
2506 2012-09-28  Eli Zaretskii  <eliz@gnu.org>
2508         * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
2509         Qautomatic_redisplay and change the symbol name.  All users changed.
2511 2012-09-28  Tomohiro Matsuyama  <tomo@cx4a.org>
2513         * profiler.c (sigprof_handler): Fix race condition.
2515 2012-09-28  Glenn Morris  <rgm@gnu.org>
2517         * lread.c (lisp_file_lexically_bound_p): Handle #! lines.  (Bug#12528)
2519 2012-09-27  Paul Eggert  <eggert@cs.ucla.edu>
2521         Check more robustly for timer_settime.
2522         * Makefile.in (LIB_TIMER_TIME): New macro.
2523         (LIBES): Add it.
2524         * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
2525         Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
2526         call timer_settime.
2528 2012-09-26  Tomohiro Matsuyama  <tomo@cx4a.org>
2530         * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
2532 2012-09-26  Juanma Barranquero  <lekktu@gmail.com>
2534         * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2536 2012-09-26  Paul Eggert  <eggert@cs.ucla.edu>
2538         * character.h (MAYBE_UNIFY_CHAR): Remove.
2539         * charset.c, charset.h (maybe_unify_char): Now static.
2540         * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
2541         Since this stuff is now private to charset.c, there's no need for
2542         a public macro and no need to inline by hand.
2544 2012-09-26  Tomohiro Matsuyama  <tomo@cx4a.org>
2545             Stefan Monnier  <monnier@iro.umontreal.ca>
2546             Juanma Barranquero  <lekktu@gmail.com>
2548         * profiler.c: New file.
2549         * Makefile.in (base_obj): Add profiler.o.
2550         * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
2551         ($(BLD)/profiler.$(O)): New target.
2552         * emacs.c (main): Call syms_of_profiler.
2553         * alloc.c (Qautomatic_gc): New constant.
2554         (MALLOC_PROBE): New macro.
2555         (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
2556         (total_bytes_of_live_objects): New function.
2557         (Fgarbage_collect): Use it.  Record itself in backtrace_list.
2558         Call malloc_probe for the memory profiler.
2559         (syms_of_alloc): Define Qautomatic_gc.
2560         * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
2561         race condition.
2562         (struct backtrace): Move definition...
2563         * lisp.h (struct backtrace): ..here.
2564         (Qautomatic_gc, profiler_memory_running): Declare vars.
2565         (malloc_probe, syms_of_profiler): Declare functions.
2566         * xdisp.c (Qautomatic_redisplay): New constant.
2567         (redisplay_internal): Record itself in backtrace_list.
2568         (syms_of_xdisp): Define Qautomatic_redisplay.
2570 2012-09-25  Eli Zaretskii  <eliz@gnu.org>
2571 2012-09-25  Juanma Barranquero  <lekktu@gmail.com>
2573         * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
2575 2012-09-25  Paul Eggert  <eggert@cs.ucla.edu>
2577         Prefer POSIX timers if available.
2578         They avoid a race if the timer is too close to the current time.
2579         * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
2580         (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
2581         (init_atimer) [SIGEV_SIGNAL]: Initialize them.
2583 2012-09-25  Eli Zaretskii  <eliz@gnu.org>
2585         * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
2586         CHAR_STRING_ADVANCE.
2587         (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
2588         STRING_CHAR_ADVANCE.
2590 2012-09-25  Juanma Barranquero  <lekktu@gmail.com>
2592         Move Vlibrary_cache to emacs.c and reset before dumping.
2594         * lisp.h (reset_image_types): Declare.
2595         [WINDOWSNT] (Vlibrary_cache): Declare.
2597         * image.c (reset_image_types): New function.
2599         * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
2600         (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
2601         (Fdump_emacs): Reset Vlibrary_cache and image_types.
2603         * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
2604         (globals_of_w32) <Vlibrary_cache>: Do not initialize.
2606         * w32.h (Vlibrary_cache): Do not declare.
2608 2012-09-25  Eli Zaretskii  <eliz@gnu.org>
2610         * w32proc.c (sys_signal): Handle all signals defined by the
2611         MS-Windows runtime, not just SIGCHLD.  Actually install the signal
2612         handlers for signals supported by Windows.  Don't override
2613         term_ntproc as the handler for SIGABRT.
2614         (sigaction): Rewrite to call sys_signal instead of duplicating its
2615         code.
2616         (sys_kill): Improve commentary.
2618         * w32.c (term_ntproc): Accept (and ignore) one argument, for
2619         consistency with a signature of a signal handler.  All callers
2620         changed.
2621         (init_ntproc): Accept an argument DUMPING.  If dumping, don't
2622         install term_ntproc as a signal handler for SIGABRT, as that
2623         should be done by the dumped Emacs.
2625         * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
2627         * w32select.c (term_w32select): Protect against repeated
2628         invocation by setting clipboard_owner to NULL after calling
2629         DestroyWindow.
2631         * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
2632         and term_ntproc to their modified signatures.
2634         * character.c (char_string, string_char): Remove calls to
2635         MAYBE_UNIFY_CHAR.  See the discussion starting at
2636         http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
2637         for the details.
2639 2012-09-25  Chong Yidong  <cyd@gnu.org>
2641         * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
2643 2012-09-24  Stefan Monnier  <monnier@iro.umontreal.ca>
2645         * bytecode.c (exec_byte_code): Signal an error instead of aborting,
2646         when encountering an unknown bytecode.
2648 2012-09-24  Paul Eggert  <eggert@cs.ucla.edu>
2650         image.c, indent.c: Use bool for booleans.
2651         * dispextern.h (struct image_type): Members valid_p, load, init
2652         now return bool, not int.  All uses changed.
2653         * image.c: Omit unnecessary static decls.
2654         (x_create_bitmap_mask, x_build_heuristic_mask):
2655         Return void, not int, since callers don't care about the return value.
2656         (x_create_bitmap_mask, define_image_type, valid_image_p)
2657         (struct image_keyword, parse_image_spec, image_spec_value)
2658         (check_image_size, image_background)
2659         (image_background_transparent, x_clear_image_1)
2660         (postprocess_image, lookup_image, x_check_image_size)
2661         (x_create_x_image_and_pixmap, xbm_image_p)
2662         (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
2663         (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
2664         (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
2665         (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
2666         (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
2667         (png_image_p, init_png_functions, png_load_body, png_load)
2668         (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
2669         (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
2670         (init_gif_functions, gif_load, imagemagick_image_p)
2671         (imagemagick_load_image, imagemagick_load, svg_image_p)
2672         (init_svg_functions, svg_load, svg_load_image, gs_image_p)
2673         (gs_load):
2674         * nsimage.m (ns_load_image):
2675         * nsterm.m (ns_defined_color):
2676         * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
2677         * xfns.c (x_defined_color):
2678         * xterm.c (x_alloc_lighter_color_for_widget)
2679         (x_alloc_nearest_color_1, x_alloc_nearest_color)
2680         (x_alloc_lighter_color):
2681         * indent.c (disptab_matches_widthtab, current_column)
2682         (scan_for_column, string_display_width, indented_beyond_p)
2683         (compute_motion, vmotion, Fvertical_motion):
2684         Use bool for booleans.
2686 2012-09-24  Chong Yidong  <cyd@gnu.org>
2688         * chartab.c (Fset_char_table_default): Obsolete function removed.
2690 2012-09-23  Paul Eggert  <eggert@cs.ucla.edu>
2692         Move pid_t related decls out of lisp.h.
2693         * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
2694         (interruptible_wait_for_termination):
2695         Move these decls from lisp.h to syswait.h, since they use pid_t.
2696         Needed on FreeBSD; see Herbert J. Skuhra in
2697         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
2698         * callproc.c: Include syswait.h.
2700         gnutls.c, gtkutil.c: Use bool for boolean.
2701         * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
2702         (emacs_gnutls_handle_error):
2703         * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
2704         (xg_hide_tooltip, xg_create_frame_widgets)
2705         (create_dialog, xg_uses_old_file_dialog)
2706         (xg_get_file_with_chooser, xg_get_file_with_selection)
2707         (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
2708         (xg_item_label_same_p, xg_update_menubar)
2709         (xg_modify_menubar_widgets, xg_event_is_for_menubar)
2710         (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
2711         (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
2712         (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
2713         (update_frame_tool_bar, free_frame_tool_bar):
2714         * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
2715         * nsmenu.m (ns_update_menubar):
2716         * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
2717         * xfns.c (Fx_show_tip) [USE_GTK]:
2718         Use bool for boolean.
2719         * gtkutil.c (xg_update_frame_menubar):
2720         * xmenu.c (update_frame_menubar):
2721         Return void, not int, since caller ignores return value.
2722         * gtkutil.c (xg_change_toolbar_position):
2723         Return void, not 1.
2725 2012-09-23  Juanma Barranquero  <lekktu@gmail.com>
2727         * makefile.w32-in (BLOCKINPUT_H): Remove.
2728         (SYSSIGNAL_H): New macro.
2729         ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
2730         ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
2731         ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
2732         ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
2733         ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
2734         ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
2735         ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
2736         ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
2737         ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
2738         ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
2739         ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
2740         ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
2741         ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
2742         ($(BLD)/w32xfns.$(O)): Update dependencies.
2744 2012-09-23  Eli Zaretskii  <eliz@gnu.org>
2746         * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
2747         fatal_error_backtrace.
2749         * w32proc.c (sys_kill): Undo last change: don't do anything when
2750         invoked to deliver SIGABRT to our own process.  This is now
2751         handled by emacs_raise.
2753 2012-09-23  Juanma Barranquero  <lekktu@gmail.com>
2755         * w32term.c (w32_read_socket): Remove leftover reference to
2756         interrupt_input_pending.
2758 2012-09-23  Paul Eggert  <eggert@cs.ucla.edu>
2760         Do not use SA_NODEFER.
2761         Problem reported by Dani Moncayo in
2762         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
2763         * alloc.c (die):
2764         * sysdep.c (emacs_abort): Do not reset signal handler.
2765         * emacs.c (terminate_due_to_signal): Reset signal handler here.
2766         * sysdep.c (init_signals): Do not use SA_NODEFER.  It wasn't
2767         wanted even on POSIXish hosts, and it doesn't work on Windows.
2769 2012-09-23  Jan Djärv  <jan.h.d@swipnet.se>
2771         * xterm.c (x_term_init): Call fixup_locale before and after calling
2772         gtk_init (Bug#12392).
2774 2012-09-23  Chong Yidong  <cyd@gnu.org>
2776         * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
2777         Vdynamic_library_alist.
2779         * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
2780         (Fgnutls_available_p): Caller changed.
2782         * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
2783         (Flibxml_parse_xml_region): Likewise.
2785         * dispextern.h (struct image_type): Remove arg from init function.
2787         * image.c (Finit_image_library, lookup_image_type)
2788         (define_image_type): Remove now-unneeded second arg.
2789         (init_xpm_functions, init_png_functions, init_jpeg_functions)
2790         (init_tiff_functions, init_gif_functions, init_svg_functions):
2791         Arglist and w32_delayed_load calling convention changed.
2792         (gs_type): Remove init_gs_functions; there is no such function.
2793         (valid_image_p, make_image): Fix caller to lookup_image_type.
2795 2012-09-23  Paul Eggert  <eggert@cs.ucla.edu>
2797         Simplify and avoid signal-handling races (Bug#12471).
2798         * alloc.c (die):
2799         * sysdep.c (emacs_abort) [HAVE_NTGUI]:
2800         Avoid recursive loop if there's a fatal error in the function itself.
2801         * atimer.c (pending_atimers):
2802         * blockinput.h: Don't include "atimer.h"; no longer needed.
2803         (interrupt_input_pending): Remove.  All uses removed.
2804         pending_signals now counts both atimers and ordinary interrupts.
2805         This is less racy than having three separate pending-signal flags.
2806         (block_input, unblock_input, totally_unblock_input, unblock_input_to)
2807         (input_blocked_p):
2808         Rename from their upper-case counterparts BLOCK_INPUT,
2809         UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
2810         INPUT_BLOCKED_P, and turn into functions.  All uses changed.
2811         This makes it easier to access volatile variables more accurately.
2812         (BLOCK_INPUT_RESIGNAL): Remove.  All uses replaced by unblock_input ().
2813         (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
2814         that's more reliable if the code is buggy and sets
2815         interrupt_input_blocked to a negative value.  All uses changed.
2816         * atimer.c (deliver_alarm_signal):
2817         Remove.  No need to deliver this to the parent; any thread can
2818         handle this signal now.  All uses replaced by underlying handler.
2819         * atimer.c (turn_on_atimers):
2820         * dispnew.c (handle_window_change_signal):
2821         * emacs.c (handle_danger_signal):
2822         * keyboard.c (kbd_buffer_get_event):
2823         Don't reestablish signal handler; not needed with sigaction.
2824         * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
2825         (UNBLOCK_INPUT_TO):
2826         Rework to avoid unnecessary accesses to volatile variables.
2827         (UNBLOCK_INPUT_TO): Now a function.
2828         (totally_unblock_input, unblock_input): New decls.
2829         * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
2830         (init_data): Remove.  Necessary stuff now done in init_signal.
2831         * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
2832         * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
2833         (fatal_error_code): Remove; no longer needed.
2834         (terminate_due_to_signal): Rename from fatal_error_backtrace, since
2835         it doesn't always backtrace.  All uses changed.  No need to reset
2836         signal to default, since sigaction and/or die does that for us now.
2837         Use emacs_raise (FOO), not kill (getpid (), FOO).
2838         (main): Check more-accurately whether we're dumping.
2839         Move fatal-error setup to sysdep.c
2840         * floatfns.c: Do not include "syssignal.h"; no longer needed.
2841         * gtkutil.c (xg_get_file_name, xg_get_font):
2842         Remove no-longer-needed signal-mask manipulation.
2843         * keyboard.c, process.c (POLL_FOR_INPUT):
2844         Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
2845         * keyboard.c (read_avail_input): Remove.
2846         All uses replaced by gobble_input.
2847         (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
2848         (kbd_buffer_store_event_hold, gobble_input):
2849         (record_asynch_buffer_change) [USABLE_SIGIO]:
2850         (store_user_signal_events):
2851         No need to mess with signal mask.
2852         (gobble_input): If blocking input and there are terminals, simply
2853         set pending_signals to 1 and return.  All hooks changed to not
2854         worry about whether input is blocked.
2855         (process_pending_signals): Clear pending_signals before processing
2856         them, in case a signal comes in while we're processing.
2857         By convention callers now test pending_signals before calling us.
2858         (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
2859         New functions, to support changes to blockinput.h.
2860         (handle_input_available_signal): Now extern.
2861         (reinvoke_input_signal): Remove.  All uses replaced by
2862         handle_async_input.
2863         (quit_count): Now volatile, since a signal handler uses it.
2864         (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
2865         All callers changed.  Block SIGINT only if not already blocked.
2866         Clear sigmask reliably, even if Fsignal returns, which it can.
2867         Omit unnecessary accesses to volatile var.
2868         (quit_throw_to_read_char): No need to restore sigmask.
2869         * keyboard.c (gobble_input, handle_user_signal):
2870         * process.c (wait_reading_process_output):
2871         Call signal-handling code rather than killing ourselves.
2872         * lisp.h: Include <float.h>, for...
2873         (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
2874         (pending_signals): Now volatile.
2875         (syms_of_data): Now const if IEEE floating point.
2876         (handle_input_available_signal) [USABLE_SIGIO]:
2877         (terminate_due_to_signal, record_child_status_change): New decls.
2878         * process.c (create_process): Avoid disaster if memory is exhausted
2879         while we're processing a vfork, by tightening the critical section
2880         around the vfork.
2881         (send_process_frame, process_sent_to, handle_pipe_signal)
2882         (deliver_pipe_signal): Remove.  No longer needed, as Emacs now
2883         ignores SIGPIPE.
2884         (send_process): No need for setjmp/longjmp any more, since the
2885         SIGPIPE stuff is now gone.  Instead, report an error if errno
2886         is EPIPE.
2887         (record_child_status_change): Now extern.  PID and W are now args.
2888         Return void, not bool.  All callers changed.
2889         * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
2890         Remove.  All uses removed.  This bug should be fixed now in a
2891         different way.
2892         (wait_for_termination_1): Use waitpid rather than sigsuspend,
2893         and record the child status change directly.  This avoids the
2894         need to futz with the signal mask.
2895         (process_fatal_action): Move here from emacs.c.
2896         (emacs_sigaction_flags): New function, containing
2897         much of what used to be in emacs_sigaction_init.
2898         (emacs_sigaction_init): Use it.  Block nonfatal system signals that are
2899         caught by emacs, to make races less likely.
2900         (deliver_process_signal): Rename from handle_on_main_thread.
2901         All uses changed.
2902         (BACKTRACE_LIMIT_MAX): Now at top level.
2903         (thread_backtrace_buffer, threadback_backtrace_pointers):
2904         New static vars.
2905         (deliver_thread_signal, deliver_fatal_thread_signal):
2906         New functions, for more-accurate delivery of thread-specific signals.
2907         (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
2908         (deliver_arith_signal): Handle in this thread, not
2909         in the main thread, since it's triggered by this thread.
2910         (maybe_fatal_sig): New function.
2911         (init_signals): New arg DUMPING so that we can be more accurate
2912         about whether we're dumping.  Caller changed.
2913         Treat thread-specific signals differently from process-general signals.
2914         Block all signals while handling fatal error; that's safer.
2915         xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
2916         on IEEE hosts.
2917         When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
2918         Ignore SIGPIPE unless batch.
2919         (emacs_backtrace): Output backtrace for the appropriate thread,
2920         which is not necessarily the main thread.
2921         * syssignal.h: Include <stdbool.h>.
2922         (emacs_raise): New macro.
2923         * xterm.c (x_connection_signal): Remove; no longer needed
2924         now that we use sigaction.
2925         (x_connection_closed): No need to mess with sigmask now.
2926         (x_initialize): No need to reset SIGPIPE handler here, since
2927         init_signals does this for us now.
2929 2012-09-23  Jan Djärv  <jan.h.d@swipnet.se>
2931         * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
2932         background rect may be larger (Bug#12245).
2934 2012-09-23  Chong Yidong  <cyd@gnu.org>
2936         * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
2938 2012-09-22  Paul Eggert  <eggert@cs.ucla.edu>
2940         * .gdbinit: Just stop at fatal_error_backtrace.
2941         See Stefan Monnier's request in
2942         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
2943         Remove no-longer-used query of system type.
2945 2012-09-22  Chong Yidong  <cyd@gnu.org>
2947         * search.c (Freplace_match): Doc fix (Bug#12325).
2949         * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
2951         * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
2952         (Fline_end_position): Doc fix.
2954         * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
2956 2012-09-22  Chong Yidong  <cyd@gnu.org>
2958         * dispextern.h (struct image_type): Add new slot, storing a type
2959         initialization function.
2961         * image.c (define_image_type): Call the image initializer function
2962         if it is defined.  Arguments and return value changed.
2963         (valid_image_p, make_image): Callers changed.
2964         (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
2965         (gif_type, imagemagick_type, svg_type, gs_type):
2966         Add initialization functions.
2967         (Finit_image_library): Call lookup_image_type.
2968         (CHECK_LIB_AVAILABLE): Macro deleted.
2969         (lookup_image_type): Call define_image_type here, rather than via
2970         Finit_image_library, and without using CHECK_LIB_AVAILABLE.
2971         (syms_of_image): Move define_image_type calls for xbm_type and
2972         pbm_type to lookup_image_type.
2974 2012-09-22  Eli Zaretskii  <eliz@gnu.org>
2976         * keyboard.c (timer_check_2): Move calculation of 'timers' and
2977         'idle_timers' from here ...
2978         (timer_check): ... to here.  Use Fcopy_sequence to copy the timer
2979         lists, to avoid infloops when the timer does something stupid,
2980         like reinvoke itself with the same or smaller time-out.
2981         (Bug#12447)
2983 2012-09-22  Martin Rudalics  <rudalics@gmx.at>
2985         * window.c (Fsplit_window_internal): Handle only Qt value of
2986         Vwindow_combination_limit separately.
2987         (Qtemp_buffer_resize): New symbol.
2988         (Vwindow_combination_limit): New default value.
2989         Rewrite doc-string.
2991 2012-09-22  Eli Zaretskii  <eliz@gnu.org>
2993         * xdisp.c (next_overlay_string): Initialize it->end_charpos for
2994         the new overlay string.  (Bug#10159)
2996 2012-09-22  Paul Eggert  <eggert@cs.ucla.edu>
2998         * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
2999         or that fprintf is async-signal-safe.  POSIX doesn't require
3000         either assumption.
3002 2012-09-22  Chong Yidong  <cyd@gnu.org>
3004         * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
3005         (Bug#8207).
3007 2012-09-22  Kenichi Handa  <handa@gnu.org>
3009         * composite.c (composition_reseat_it): Handle the case that a
3010         grapheme cluster is not covered by a single font (Bug#12352).
3012 2012-09-21  Chong Yidong  <cyd@gnu.org>
3014         * image.c (define_image_type): Avoid adding duplicate types to
3015         image_types (Bug#12463).  Suggested by Jörg Walter.
3017 2012-09-21  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
3019         * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
3020         (print_load_command_name): Add case LC_DATA_IN_CODE.
3021         (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
3023 2012-09-21  Glenn Morris  <rgm@gnu.org>
3025         * eval.c (Frun_hook_with_args_until_success)
3026         (Frun_hook_with_args_until_failure): Doc fixes.  (Bug#12393)
3028 2012-09-21  Andreas Schwab  <schwab@linux-m68k.org>
3030         * fileio.c (Ffile_selinux_context): Only call freecon when
3031         lgetfilecon succeeded.
3032         (Fset_file_selinux_context): Likewise.  (Bug#12444)
3034 2012-09-21  Eli Zaretskii  <eliz@gnu.org>
3036         * xdisp.c (try_window_reusing_current_matrix): Under bidi
3037         reordering, locate the cursor by calling set_cursor_from_row; if
3038         that fails, clear the desired glyph matrix before returning a
3039         failure indication to the caller.  Fixes leaving garbled display
3040         when fast scrolling with a down-key.  (Bug#12403)
3041         (compute_stop_pos_backwards): Fix a typo that caused crashes while
3042         scrolling through multibyte text.
3044 2012-09-20  Stefan Monnier  <monnier@iro.umontreal.ca>
3046         * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
3047         calling mark_vectorlike since that's the one that marks the window.
3048         (mark_discard_killed_buffers): Mark the final cdr.
3049         * window.h (struct window): Move prev/next_buffers to the
3050         non-standard fields.
3051         * window.c (make_window): Initialize prev/next_buffers manually.
3053 2012-09-20  Paul Eggert  <eggert@cs.ucla.edu>
3055         Omit unused arg EXPECTED from socket hooks.
3056         * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
3057         * nsterm.m (ns_term_init):
3058         * termhooks.h (struct terminal.read_socket_hook):
3059         * w32inevt.c (w32_console_read_socket):
3060         * w32term.c (w32_read_socket):
3061         * xterm.c (XTread_socket):
3062         Omit unused arg EXPECTED.  All callers changed.
3063         (store_user_signal_events): Return void, not int, since callers no
3064         longer care about the return value.  All uses changed.
3066 2012-09-20  Juanma Barranquero  <lekktu@gmail.com>
3068         * w32gui.h (XParseGeometry): Do not declare.
3070 2012-09-19  Paul Eggert  <eggert@cs.ucla.edu>
3072         * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
3073         Ignore 'expected'.  See Eli Zaretskii in
3074         <http://bugs.gnu.org/12471#8> (last line).
3076         * frame.c (read_integer): Remove.  All uses replaced by strtol/strtoul.
3077         (XParseGeometry): Now static.  Substitute extremal values for
3078         values that are out of range.
3080 2012-09-19  Jan Djärv  <jan.h.d@swipnet.se>
3082         * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
3084         * nsfns.m (XParseGeometry): Remove.
3085         (Fx_create_frame): Call x_set_offset to correctly interpret
3086         top_pos in geometry.
3088         * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
3089         (Fx_parse_geometry): If there is a space in string, call
3090         Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
3092 2012-09-17  Eli Zaretskii  <eliz@gnu.org>
3094         * search.c (scan_buffer): Use character positions in calls to
3095         region_cache_forward and region_cache_backward, not byte
3096         positions.  (Bug#12196)
3098         * w32term.c (w32_read_socket): Set pending_signals to 1, like
3099         xterm.c does.  Reported by Daniel Colascione <dancol@dancol.org>.
3101         * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
3102         __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
3103         emacs_blocked_malloc, now deleted.
3105 2012-09-17  Paul Eggert  <eggert@cs.ucla.edu>
3107         Remove no-longer-needed Solaris 2.4 vfork bug workaround.
3108         The workaround was for improving performance on Solaris 2.4, but
3109         is getting in the way now.  Emacs will still work if someone is
3110         still running Solaris 2.4 in a museum somewhere; Sun dropped
3111         support for Solaris 2.4 in 2003.
3112         * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
3113         * process.c (create_process) [HAVE_WORKING_VFORK]:
3114         Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
3115         since Emacs no longer uses vfork on that platform.
3117 2012-09-17  Glenn Morris  <rgm@gnu.org>
3119         * emacs.c: Use COPYRIGHT.
3121 2012-09-16  Paul Eggert  <eggert@cs.ucla.edu>
3123         Remove configure's --without-sync-input option (Bug#12450).
3124         When auditing signal-handling in preparation for cleaning it up,
3125         I found that SYNC_INPUT has race conditions and would be a real
3126         pain to fix.  Since it's an undocumented and deprecated
3127         configure-time option, now seems like a good time to remove it.
3128         Also see <http://bugs.gnu.org/11080#16>.
3129         * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
3130         (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
3131         (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
3132         (malloc_hysteresis):
3133         (check_depth) [XMALLOC_OVERRUN_CHECK]:
3134         (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
3135         (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
3136         (dont_register_blocks, bytes_used_when_reconsidered)
3137         (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
3138         (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
3139         [!SYSTEM_MALLOC && !SYNC_INPUT]:
3140         Remove.  All uses removed.
3141         (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
3142         implementation, one that depends on whether the new macro
3143         XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
3144         is defined.
3145         * atimer.c (run_timers, handle_alarm_signal):
3146         * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
3147         (handle_async_input, process_pending_signals)
3148         (handle_input_available_signal, init_keyboard):
3149         * nsterm.m (ns_read_socket):
3150         * process.c (wait_reading_process_output):
3151         * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
3152         * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
3153         (emacs_write):
3154         * xterm.c (XTread_socket):
3155         Assume SYNC_INPUT.
3156         * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
3157         * eval.c (handling_signal): Remove.  All uses removed.
3158         * lisp.h (ELSE_PENDING_SIGNALS): Remove.
3159         All uses replaced with the SYNC_INPUT version.
3160         (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
3161         Remove decls.
3162         * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3163         Now static.
3165         * font.c (Ffont_shape_gstring): Remove unused local.
3167 2012-09-16  Glenn Morris  <rgm@gnu.org>
3169         * Makefile.in (clean): No longer run nextstep's clean.
3171         * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
3172         (ns_frag): Remove.
3173         (ns-app): Move here from ns.mk, and simplify.
3174         (clean): Simplify nextstep entry.
3175         * ns.mk: Remove file.
3177 2012-09-17  Kenichi Handa  <handa@gnu.org>
3179         * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
3180         not covert the last few charactes.
3182 2012-09-16  Kenichi Handa  <handa@gnu.org>
3184         * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
3185         here, but just check the validity of glyphs in the glyph-string.
3187 2012-09-16  Martin Rudalics  <rudalics@gmx.at>
3189         * window.c (Fwindow_parameter, Fset_window_parameter):
3190         Accept any window as argument (Bug#12452).
3192 2012-09-16  Jan Djärv  <jan.h.d@swipnet.se>
3194         * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
3195         to ns_term_init to avoid memory leak.
3197         * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
3198         explicit retain/release.
3199         (ns_term_init): Only allow one display.  Initialize outerpool and
3200         ns_*_types.
3202 2012-09-15  Paul Eggert  <eggert@cs.ucla.edu>
3204         Port _setjmp fix to POSIXish hosts as well as Microsoft.
3205         * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
3206         it's needed on POSIXish hosts that lack _setjmp.  Attempt to solve
3207         the Microsoft problem in a different way, by altering ../nt/config.nt.
3209 2012-09-15  Eli Zaretskii  <eliz@gnu.org>
3211         * w32xfns.c:
3212         * w32uniscribe.c:
3213         * w32term.c:
3214         * w32select.c:
3215         * w32reg.c:
3216         * w32proc.c:
3217         * w32menu.c:
3218         * w32inevt.c:
3219         * w32heap.c:
3220         * w32font.c:
3221         * w32fns.c:
3222         * w32console.c:
3223         * w32.c:
3224         * w16select.c: Remove inclusion of setjmp.h, as it is now included
3225         by lisp.h.  This completes removal of setjmp.h inclusion
3226         erroneously announced in the previous commit.  (Bug#12446)
3228         * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
3229         more accurate.
3231         * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
3232         not defined as a macro.  The latter happens on MS-Windows.
3233         (Bug#12446)
3235 2012-09-15  Paul Eggert  <eggert@cs.ucla.edu>
3237         Port better to POSIX hosts lacking _setjmp (Bug#12446).
3238         * lisp.h: Include <setjmp.h> here, since we use its symbols here.
3239         Some instances of '#include <setjmp.h>' removed, if the
3240         only reason for the instance was because "lisp.h" was included.
3241         (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
3242         Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
3243         and _longjmp with the new symbols.  Emacs already uses _setjmp if
3244         available, so this change affects only POSIXish hosts that have
3245         sigsetjmp but not _setjmp, such as some versions of Solaris and
3246         Unixware.  (Also, POSIX-2008 marks _setjmp as obsolescent.)
3247         * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
3248         (png_load_body) [HAVE_PNG]:
3249         (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
3250         (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
3251         Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
3252         since PNG requires jmp_buf.  This is the only exception to the
3253         general rule that we now use sys_setjmp and sys_longjmp.
3254         This exception is OK since this code does not change the signal
3255         mask or longjmp out of a signal handler.
3257 2012-09-14  Paul Eggert  <eggert@cs.ucla.edu>
3259         * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
3260         Include "syssignal.h", for 'main_thread'.
3262 2012-09-14  Dmitry Antipov  <dmantipov@yandex.ru>
3264         Avoid out-of-range marker position (Bug#12426).
3265         * insdel.c (replace_range, replace_range_2):
3266         Adjust markers before overlays, as suggested by comments.
3267         (insert_1_both, insert_from_buffer_1, adjust_after_replace):
3268         Remove redundant check before calling offset_intervals.
3270 2012-09-14  Martin Rudalics  <rudalics@gmx.at>
3272         * xdisp.c (Fformat_mode_line): Unconditionally save/restore
3273         current buffer (Bug#12387).
3275 2012-09-14  Juanma Barranquero  <lekktu@gmail.com>
3277         * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
3279 2012-09-13  Paul Eggert  <eggert@cs.ucla.edu>
3281         Use a more backwards-compatible timer format (Bug#12430).
3282         * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
3283         vector element, not from the 4th, since PSECS is now at the end.
3284         (Fcurrent_idle_time): Doc fix.
3286 2012-09-13  Dmitry Antipov  <dmantipov@yandex.ru>
3288         Function to mark objects and remove killed buffers at once.
3289         * alloc.c (discard_killed_buffers): Rename to ...
3290         (mark_discard_killed buffers) ... new name.  Add marking
3291         of remaining objects.  Fix comment.  Adjust users.
3292         (mark_object): Do not touch frame buffer lists here.
3293         * frame.c (delete_frame): Reset frame buffer lists here.
3295 2012-09-13  Paul Eggert  <eggert@cs.ucla.edu>
3297         Better workaround for GNOME bug when --enable-gcc-warnings.
3298         * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
3299         Instead, disable -Wunused-local-typedefs.  See Dmitry Antipov in
3300         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
3302         Simplify SIGIO usage (Bug#12408).
3303         The code that dealt with SIGIO was crufty and confusing, e.g., it
3304         played tricks like "#undef SIGIO" but these tricks were not used
3305         consistently.  Simplify mostly by not #undeffing standard symbols,
3306         e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
3307         or not as we please) rather than "defined SIGIO" (standard symbol
3308         that we probably shouldn't #undef).
3309         * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
3310         Modules that need it can include it.
3311         [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
3312         * dispextern.h (ignore_sigio): New decl.
3313         * emacs.c (shut_down_emacs): Invoke unrequest_sigio
3314         unconditionally, since it's now a no-op if !USABLE_SIGIO.
3315         * emacs.c (shut_down_emacs):
3316         * keyboard.c (kbd_buffer_store_event_hold):
3317         Use ignore_sigio rather than invoking 'signal' directly.
3318         * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
3319         for FIONREAD.
3320         (FIONREAD, SIGIO): Do not #undef.
3321         (tty_read_avail_input): Use #error rather than a syntax error.
3322         * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
3323         for I_PIPE, used by SETUP_SLAVE_PTY.
3324         (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
3325         * sysdep.c (croak): Remove; no longer needed.  This bit of
3326         temporary code, with Fred N. Fish's comment that it's temporary,
3327         has been in Emacs since at least 1992!
3328         (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
3329         Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
3330         * syssignal.h (croak): Remove decl.
3331         (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
3332         * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
3333         now that we're termios-only.
3334         (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
3335         * term.c (dissociate_if_controlling_tty): Use #error rather than
3336         a run-time error.
3338         Work around GCC and GNOME bugs when --enable-gcc-warnings.
3339         * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
3340         to work around GNOME bug 683906.
3341         * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
3342         (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
3343         This works around GCC bug 54561.
3345 2012-09-12  Paul Eggert  <eggert@cs.ucla.edu>
3347         More fixes for 'volatile' and setjmp/longjmp.
3348         * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
3349         * image.c (struct png_load_context) [HAVE_PNG]: New type.
3350         (png_load_body) [HAVE_PNG]:
3351         (jpeg_load_body) [HAVE_JPEG]:
3352         New function, with most of the old parent function's body.
3353         (png_load) [HAVE_PNG]:
3354         (jpeg_load) [HAVE_JPEG]:
3355         Invoke the new function, to avoid longjmp munging our locals.
3356         (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
3357         (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
3358         longjmp is passed 2, as the C standard doesn't guarantee this.
3359         Instead, store the failure code into mgr->failure_code.
3361 2012-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
3363         * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
3364         (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
3365         (syms_of_keyboard): Remove support for unread-command-char.
3367 2012-09-12  Eli Zaretskii  <eliz@gnu.org>
3369         * w32proc.c (sys_kill): If PID is our process ID and the signal is
3370         SIGABRT, call emacs_abort.  Avoids silently exiting upon assertion
3371         violation.  (Bug#12426)
3373 2012-09-12  Paul Eggert  <eggert@cs.ucla.edu>
3375         * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
3377 2012-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
3379         * eval.c: Add `inhibit-debugger'.
3380         (Qinhibit_debugger): New symbol.
3381         (call_debugger): Bind it instead of Qdebug_on_error.
3382         (maybe_call_debugger): Test Vinhibit_debugger.
3383         (syms_of_eval): Define inhibit-debugger.
3384         * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
3385         (syms_of_xdisp): Remove inhibit-debug-on-message.
3387 2012-09-11  Paul Eggert  <eggert@cs.ucla.edu>
3389         Avoid _setjmp/_longjmp problems with local nonvolatile variables.
3390         If a nonvolatile local variable is written before a _longjmp to
3391         the frame containing the variable, and is read after the _longjmp,
3392         the value read is indeterminate.  Some local variables of type
3393         'struct handler' and 'struct catchtag' are used in this way, so
3394         mark each of their slots as volatile if the slot can be set before
3395         _longjmp and read afterwards.
3396         * lisp.h (struct handler): var and chosen_clause are now volatile.
3397         (struct catchtag): val, next, and pdlcount are now volatile.
3399         * bidi.c (bidi_push_it, bidi_pop_it):
3400         * fns.c (copy_hash_table):
3401         * image.c (define_image_type):
3402         * keyboard.c (kbd_buffer_store_event_hold):
3403         * process.c (Fprocess_send_eof):
3404         * xfaces.c (x_create_gc) [HAVE_NS]:
3405         * xgselect.c (xg_select):
3406         Prefer assignment to memcpy when either will do.
3408         * alloc.c (discard_killed_buffers): Tune and simplify a bit.
3409         Use pointer-to-a-pointer to simplify and avoid a NILP check each
3410         time an item is removed.  No need to mark this function 'inline';
3411         the compiler knows better than we do.
3413 2012-09-11  Jan Djärv  <jan.h.d@swipnet.se>
3415         * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
3416         (updateFrameSize:): Add delay parameter to updateFrameSize, send it
3417         to change_frame_size (Bug#12388).
3418         (windowDidResize:): Pass YES to updateFrameSize.
3420         * nsterm.h: Add delay parameter to updateFrameSize.
3422 2012-09-11  Dmitry Antipov  <dmantipov@yandex.ru>
3424         Discard killed buffers from deleted window and frame objects.
3425         This reduces an amount of references to killed buffers and
3426         helps GC to reclaim them faster.
3427         * alloc.c (discard_killed_buffers): New function.
3428         (mark_object): Use it for deleted windows and frames.
3429         (mark_object): If symbol's value is set up for a killed buffer
3430         or deleted frame, restore its global binding.
3431         * data.c (swap_in_global_binding): Add GC notice.
3432         (swap_in_symval_forwarding): Use convenient set_blv_where.
3433         * window.c (wset_next_buffers, wset_prev_buffers): Move ...
3434         * window.h: ... to here.
3436 2012-09-11  Dmitry Antipov  <dmantipov@yandex.ru>
3438         Convenient macro to check whether the buffer is live.
3439         * buffer.h (BUFFER_LIVE_P): New macro.
3440         * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
3441         * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
3443 2012-09-11  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
3445         * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
3446         composition cases (Bug#12364).
3448         * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
3449         overhang of succeeding glyphs overlapping box cursor.
3451         * w32term.c (x_draw_glyph_string): Likewise.
3453 2012-09-11  Paul Eggert  <eggert@cs.ucla.edu>
3455         Simplify, document, and port floating-point (Bug#12381).
3456         The porting part of this patch fixes bugs on non-IEEE platforms
3457         with frexp, ldexp, logb.
3458         * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
3459         Now static.
3460         * floatfns.c: Simplify discussion of functions that Emacs doesn't
3461         support, by removing commented-out code and briefly listing the
3462         C89 functions excluded.  The commented-out stuff was confusing
3463         maintenance, e.g., we thought we needed cbrt but it was commented out.
3464         (logb): Remove decl; no longer needed.
3465         (isfinite): New macro, if not already supplied.
3466         (isnan): Don't replace any existing macro.
3467         (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
3468         are present on all C89 platforms.
3469         (Ffrexp): Do not special-case zero, as frexp does the right thing
3470         for that case.
3471         (Flogb): Do not use logb, as it doesn't have the desired meaning
3472         on hosts that use non-base-2 floating point.  Instead, stick with
3473         frexp, which is C89 anyway.  Do not pass an infinity or a NaN to
3474         frexp, to avoid getting an unspecified result.
3476         * xdisp.c (Qinhibit_debug_on_message): Now static.
3478 2012-09-10  Jan Djärv  <jan.h.d@swipnet.se>
3480         * nsterm.m (ns_update_begin): Set clip path to whole view by using
3481         NSBezierPath (Bug#12131).
3483 2012-09-10  Chong Yidong  <cyd@gnu.org>
3485         * fns.c (Fdelq, Fdelete): Doc fix.
3487 2012-09-10  Paul Eggert  <eggert@cs.ucla.edu>
3489         * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
3490         (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
3492 2012-09-09  Stefan Monnier  <monnier@iro.umontreal.ca>
3494         * lisp.h (make_lisp_ptr): New macro to replace XSET.
3495         (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
3496         Use it.
3498 2012-09-09  Eli Zaretskii  <eliz@gnu.org>
3500         * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
3501         left fringe if the window has a left margin.  This avoids leaving
3502         traces of the cursor because its leftmost pixel is not drawn over.
3504         * dispnew.c (update_window_line): When the left margin area of a
3505         screen line is updated, set the redraw_fringe_bitmaps_p flag of
3506         that screen line.  (Bug#12277)
3508 2012-09-09  Paul Eggert  <eggert@cs.ucla.edu>
3510         Assume C89 or later for math functions (Bug#12381).
3511         This simplifies the code, and makes it a bit smaller and faster,
3512         and (most important) makes it easier to clean up signal handling
3513         since we can stop worring about floating-point exceptions in
3514         library code.  That was a problem before C89, but the problem
3515         went away many years ago on all practical Emacs targets.
3516         * data.c, image.c, lread.c, print.c:
3517         Don't include <math.h>; no longer needed.
3518         * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
3519         might be autoconfigured, as that never happens.
3520         * data.c (fmod):
3521         * doprnt.c (DBL_MAX_10_EXP):
3522         * print.c (DBL_DIG):
3523         Remove.  C89 or later always defines these.
3524         * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
3525         (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
3526         (arith_error, domain_error, domain_error2):
3527         Remove all this pre-C89 cruft.  Do not include <errno.h> as that's
3528         no longer needed -- we simply return what C returns.  All uses removed.
3529         (IN_FLOAT, IN_FLOAT2): Remove.  All uses replaced with
3530         the wrapped code.
3531         (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
3532         Remove.  All uses expanded, as these macros are no longer used
3533         more than once and are now more trouble than they're worth.
3534         (Ftan): Use tan, not sin / cos.
3535         (Flogb): Assume C89 frexp.
3536         (fmod_float): Assume C89 fmod.
3537         (matherr) [HAVE_MATHERR]: Remove; no longer needed.
3538         (init_floatfns): Remove.  All uses removed.
3540 2012-09-08  Jan Djärv  <jan.h.d@swipnet.se>
3542         * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
3543         compositeToPoint for OSX < 10.6 (Bug#12390).
3545 2012-09-08  Paul Eggert  <eggert@cs.ucla.edu>
3547         * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
3548         This produces more-accurate results.
3550 2012-09-08  Jan Djärv  <jan.h.d@swipnet.se>
3552         * nsterm.m (updateFrameSize): Call setFrame: on the view when size
3553         changes (Bug#12088).
3555 2012-09-08  Chong Yidong  <cyd@gnu.org>
3557         * syntax.c (Fstring_to_syntax): Doc fix.
3559 2012-09-08  Jan Djärv  <jan.h.d@swipnet.se>
3561         * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
3562         in the internal border.
3563         (x_set_window_size): Remove static variables and their usage.
3564         (ns_redraw_scroll_bars): Fix NSTRACE arg.
3565         (ns_after_update_window_line, ns_draw_fringe_bitmap):
3566         Remove fringe/internal border adjustment (Bug#11052).
3567         (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
3568         (ns_draw_window_cursor): Remove fringe/internal border adjustment.
3569         (ns_fix_rect_ibw): Remove.
3570         (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
3571         (ns_dumpglyphs_box_or_relief): Ditto.
3572         (ns_maybe_dumpglyphs_background): Remove fringe/internal border
3573         adjustment.
3574         (ns_dumpglyphs_image): Ditto.
3575         (ns_dumpglyphs_stretch): Fix coding style.  Remove fringe/internal
3576         border adjustment.
3577         (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
3578         their usage.  Add fringe_extended_p and its use as in other terms.
3579         (ns_judge_scroll_bars): Code style fix.  Call updateFrameSize if
3580         scroll bar was removed.
3581         (updateFrameSize): New function.
3582         (windowDidResize): Move code to updateFrameSize and call it.
3584         * nsterm.h (EmacsView): Add updateFrameSize.
3586 2012-09-07  Chong Yidong  <cyd@gnu.org>
3588         * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
3590         * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
3592 2012-09-07  Paul Eggert  <eggert@cs.ucla.edu>
3594         More signal-handler cleanup (Bug#12327).
3595         * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
3596         Problem introduced when merging patches.  Noted by Eli Zaretskii in
3597         <http://bugs.gnu.org/12327#67>.
3598         * floatfns.c: Comment fix.
3599         * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
3600         SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
3601         and anyway the declaration is harmless even if SIGDANGER is not defined.
3602         * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
3603         defined BROKEN_FIONREAD).  systty.h formerly did this, but other
3604         source files not surprisingly expected syssignal.h to define, or
3605         not define, SIGIO, and it's cleaner to do it that way, for consistency.
3606         Include <sys/ioctl.h>, for FIONREAD.
3607         * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
3608         This eliminates a problem whereby other files mysteriously had
3609         to include "syssignal.h" before including "systty.h" if they
3610         wanted to use "#ifdef SIGIO".
3612 2012-09-07  Eli Zaretskii  <eliz@gnu.org>
3614         * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
3616         * w32.c (sigemptyset): Empty the set.
3617         (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
3619         * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
3621 2012-09-07  Dmitry Antipov  <dmantipov@yandex.ru>
3623         * alloc.c (mark_buffer): Revert unsafe marking optimization.
3624         (mark_object): Likewise for frame objects.
3626 2012-09-07  Paul Eggert  <eggert@cs.ucla.edu>
3628         * syssignal.h (handle_on_main_thread): Always declare,
3629         even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
3630         This ports to platforms without HAVE_PTHREAD.
3632 2012-09-06  Paul Eggert  <eggert@cs.ucla.edu>
3634         Signal-handler cleanup (Bug#12327).
3635         Emacs's signal handlers were written in the old 4.2BSD style with
3636         sigblock and sigmask and so forth, and this led to some
3637         inefficiencies and confusion.  Rewrite these to use
3638         pthread_sigmask etc. without copying signal sets around.  Also,
3639         get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
3640         'signal', and instead use functions that do not attempt to take
3641         over the system name space.  This patch causes Emacs's text
3642         segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
3643         * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
3644         Do not include <signal.h> or "syssignal.h", as these
3645         modules do not use signals.
3646         * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
3647         * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
3648         Do not include <signal.h>, as "syssignal.h" does that for us now.
3649         * atimer.c (sigmask_atimers): New function.
3650         (block_atimers, unblock_atimers): New functions,
3651         replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
3652         All uses replaced.
3653         * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
3654         no longer needed here.
3655         * emacs.c (main): Inspect existing signal handler with sigaction,
3656         so that there's no need to block and unblock SIGHUP.
3657         * sysdep.c (struct save_signal): New member 'action', replacing
3658         old member 'handler'.
3659         (save_signal_handlers, restore_signal_handlers):
3660         Use sigaction instead of 'signal' to save and restore.
3661         (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
3662         New function.  All users of 'signal' modified to use set_sighandler
3663         if they're writeonly, and to use sys_signal if they're read+write.
3664         (emacs_sigaction_init, forwarded_signal): New functions.
3665         (sys_signal): Remove.  All uses replaced by calls to sigaction
3666         and emacs_sigaction_init, or by direct calls to 'signal'.
3667         (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
3668         (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
3669         all uses replaced by pthread_sigmask etc. calls.
3670         * syssignal.h: Include <signal.h>.
3671         (emacs_sigaction_init, forwarded_signal): New decls.
3672         (SIGMASKTYPE): Remove.  All uses replaced by its definiens, sigset_t.
3673         (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
3674         (sigmask, sys_sigmask): Remove; no longer needed.
3675         (sigpause): Remove.  All uses replaced by its definiens, sigsuspend.
3676         (sigblock, sigunblock, sigfree):
3677         (sigsetmask) [!defined sigsetmask]:
3678         Remove.  All uses replaced by pthread_sigmask.
3679         (signal): Remove.  Its remaining uses (with SIG_DFL and SIG_IGN)
3680         no longer need to be replaced, and its typical old uses
3681         are now done via emacs_sigaction_init and sigaction.
3682         (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
3683         (sys_sigdel): Remove; unused.
3684         (NSIG): Remove a FIXME; the code's fine.  Remove an unnecessary ifdef.
3686 2012-09-06  Eli Zaretskii  <eliz@gnu.org>
3688         * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
3689         SIGCHLD handling on systems that don't have WNOHANG.  (Bug#12327)
3691 2012-09-06  Dmitry Antipov  <dmantipov@yandex.ru>
3693         Explicitly mark buffer_defaults and buffer_local_symbols.
3694         * alloc.c (Fgarbage_collect): Mark buffer_defaults and
3695         mark_local_symbols here.
3696         (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
3697         since special buffers aren't marked here any more.
3698         (allocate_buffer): Chain new buffer with all_buffers here...
3699         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
3700         not here.
3701         (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
3702         (syms_of_buffer): Remove staticpro of the above.
3703         (init_buffer_once): Set names for buffer_defaults and
3704         buffer_local_symbols.
3706 2012-09-06  Paul Eggert  <eggert@cs.ucla.edu>
3708         Use bool for booleans in font-related modules.
3709         * font.c (font_intern_prop, font_style_to_value)
3710         (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
3711         (generate_otf_features, font_check_otf_features, font_check_otf)
3712         (font_match_p, font_list_entities, font_at):
3713         * fontset.c (fontset_id_valid_p, reorder_font_vector
3714         (fontset_find_font, Fset_fontset_font)
3715         (face_suitable_for_char_p) [0]:
3716         * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
3717         (ftfont_open, ftfont_text_extents, ftfont_check_otf):
3718         (m17n_flt_initialized, ftfont_shape_by_flt):
3719         * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
3720         * nsfont.m (nsfont_draw):
3721         * w32font.c (w32font_draw):
3722         * w32term.c (x_draw_glyphless_glyph_string_foreground):
3723         Use bool for booleans.
3724         * font.h: Adjust to above API changes.
3725         (struct font, struct font_driver, struct font_driver_list):
3726         Use bool for booleans.
3727         (struct font): Remove useless member encoding_type.
3728         All users removed.
3729         * fontset.c, xftfont.c: Omit unnecessary static decls.
3731 2012-09-06  Dmitry Antipov  <dmantipov@yandex.ru>
3733         * alloc.c (mark_object): Revert window marking code
3734         since it's unsafe for the Fset_window_configuration.
3736 2012-09-05  Paul Eggert  <eggert@cs.ucla.edu>
3738         Fix race conditions with signal handlers and errno (Bug#12327).
3739         Be more systematic about preserving errno whenever a signal
3740         handler returns, even if it's not in the main thread.  Do this by
3741         renaming signal handlers to distinguish between signal delivery
3742         and signal handling.  All uses changed.
3743         * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
3744         * data.c (deliver_arith_signal): Rename from arith_error.
3745         * dispnew.c (deliver_window_change_signal): Rename from
3746         window_change_signal.
3747         * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
3748         (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
3749         * keyboard.c (deliver_input_available_signal): Rename from
3750         input_available_signal.
3751         (deliver_user_signal): Rename from handle_user_signal.
3752         (deliver_interrupt_signal): Rename from interrupt_signal.
3753         * process.c (deliver_pipe_signal): Rename from send_process_trap.
3754         (deliver_child_signal): Rename from sigchld_handler.
3755         * atimer.c (handle_alarm_signal):
3756         * data.c (handle_arith_signal):
3757         * dispnew.c (handle_window_change_signal):
3758         * emacs.c (handle_fatal_signal, handle_danger_signal):
3759         * keyboard.c (handle_input_available_signal):
3760         * keyboard.c (handle_user_signal, handle_interrupt_signal):
3761         * process.c (handle_pipe_signal, handle_child_signal):
3762         New functions, with the actual signal-handling code taken from the
3763         original respective signal handlers, sans the sporadic attempts to
3764         preserve errno, since that's now done by handle_on_main_thread.
3765         * atimer.c (alarm_signal_handler): Remove unnecessary decl.
3766         * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
3767         * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3768         Move to sysdep.c.
3769         (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3770         Move initialization of main_thread to sysdep.c's init_signals.
3771         * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
3772         our usage, and simplifies the mainline code.
3773         (record_child_status_change): New static function, as a helper
3774         for handle_child_signal, and with most of the old child handler's
3775         contents.
3776         (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
3777         (handle_child_signal): Use the above.
3778         * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3779         Moved here from emacs.c.
3780         (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
3781         code moved here from emacs.c's main function.
3782         * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3783         replacing the old SIGNAL_THREAD_CHECK.  All uses changed.
3784         This lets callers save and restore errno properly.
3786 2012-09-05  Dmitry Antipov  <dmantipov@yandex.ru>
3788         Remove redundant or unused things here and there.
3789         * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
3790         * conf_post.h (RE_TRANSLATE): Use char_table_translate.
3791         * editfns.c (Fcompare_buffer_substrings): Likewise.
3792         * frame.h (struct terminal, struct font_driver_list):
3793         Remove redundant declarations.
3794         * window.h (Qleft, Qright): Likewise.
3796 2012-09-05  Dmitry Antipov  <dmantipov@yandex.ru>
3798         Do not mark objects from deleted buffers, windows and frames.
3799         * alloc.c (mark_buffer): Mark just the buffer if it is dead.
3800         (mark_object): Likewise for windows and frames.
3802 2012-09-05  Dmitry Antipov  <dmantipov@yandex.ru>
3804         * alloc.c (valid_lisp_object_p): Treat killed buffers,
3805         buffer_defaults and buffer_local_symbols as valid objects.
3806         Return special value to denote them.
3808 2012-09-05  Paul Eggert  <eggert@cs.ucla.edu>
3810         * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
3811         * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
3812         (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
3813         (file_name_absolute_p, Fsubstitute_in_file_name):
3814         (check_executable, check_writable, Ffile_accessible_directory_p)
3815         (Fset_file_selinux_context, Fdefault_file_modes)
3816         (Finsert_file_contents, choose_write_coding_system)
3817         (Fwrite_region, build_annotations, a_write, e_write)
3818         (Fdo_auto_save):
3819         * filelock.c (boot_time_initialized, get_boot_time)
3820         (get_boot_time_1, lock_file_1, within_one_second):
3821         * floatfns.c (in_float):
3822         * fns.c (concat, internal_equal, Frequire, base64_encode_1)
3823         (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
3824         (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
3825         * lisp.h (struct Lisp_Hash_Table.cmpfn):
3826         * window.c (compare_window_configurations):
3827         Use bool for booleans.
3828         * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
3829         (Fdefault_file_modes): Now mode_t, not int, for modes.
3830         (Fdo_auto_save): Set a boolean to 1 rather than using ++.
3831         (internal_delete_file): Now returns void, not a (boolean) int,
3832         since nobody was looking at the return value.
3833         * lisp.h, window.h: Adjust to above API changes.
3835         * xdisp.c (set_message): Simplify and reindent last change.
3837 2012-09-05  Juanma Barranquero  <lekktu@gmail.com>
3839         * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
3841 2012-09-04  Lars Ingebrigtsen  <larsi@gnus.org>
3843         * eval.c (call_debugger): Make the function non-static so that we
3844         can call it from set_message.
3846         * xdisp.c (set_message): Implement the new variable `debug-on-message'.
3847         (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
3849 2012-09-04  Paul Eggert  <eggert@cs.ucla.edu>
3851         Give more-useful info on a fatal error (Bug#12328).
3852         * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
3853         (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
3854         of doing the work ourselves.
3855         * emacs.c (fatal_error_signal): Let fatal_error_backtrace
3856         do most of the work.
3857         (fatal_error_backtrace): New function, taken from the guts
3858         of the old fatal_error_signal, but with a new option to output
3859         a backtrace.
3860         (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
3861         info about the signal than just its number.
3862         * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
3863         * sysdep.c: Include <execinfo.h>
3864         (emacs_backtrace): New function, taken partly from the previous
3865         code of the 'die' function.
3866         (emacs_abort): Call fatal_error_backtrace rather than abort.
3868 2012-09-04  Stefan Monnier  <monnier@iro.umontreal.ca>
3870         * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
3871         eager (load-time) macro-expansion.
3872         * lisp.mk (lisp): Add macroexp.
3874 2012-09-04  Paul Eggert  <eggert@cs.ucla.edu>
3876         Simplify redefinition of 'abort' (Bug#12316).
3877         Do not try to redefine the 'abort' function.  Instead, redo
3878         the code so that it calls 'emacs_abort' rather than 'abort'.
3879         This removes the need for the NO_ABORT configure-time macro
3880         and makes it easier to change the abort code to do a backtrace.
3881         * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
3882         * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
3883         Remove; sysdep.c's emacs_abort now takes its place.
3884         * lisp.h (emacs_abort): New decl.  All calls from Emacs code to
3885         'abort' changed to use 'emacs_abort'.
3886         * msdos.c (dos_abort) [defined abort]: Remove; not used.
3887         (abort) [!defined abort]: Rename to ...
3888         (emacs_abort): ... new name.
3889         * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
3890         the place of the old 'abort' in emacs.c.
3891         * w32.c, w32fns.c (abort): Do not #undef.
3892         * w32.c (emacs_abort): Rename from w32_abort.
3894 2012-09-04  Eli Zaretskii  <eliz@gnu.org>
3896         * w32uniscribe.c (uniscribe_shape): Reverse the sign of
3897         offsets[j].dv, since the y axis of the screen coordinates points
3898         down, while the y axis of the font definition coordinates points
3899         up.  This fixes display of Arabic diacritics such as KASRA and
3900         KASRATAN.  (Bug#11860)
3902 2012-09-04  Paul Eggert  <eggert@cs.ucla.edu>
3904         Be more systematic about _setjmp vs setjmp.
3905         * alloc.c (test_setjmp, mark_stack):
3906         * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
3907         (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
3908         (png_load, my_error_exit, jpeg_load):
3909         * process.c (send_process_trap, send_process):
3910         Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
3911         The underscored versions are up to 30x faster on some hosts.
3912         Formerly, the code used setjmp+longjmp sometimes and
3913         _setjmp+_longjmp at other times, with no particular reason to
3914         prefer setjmp+longjmp.
3916 2012-09-03  Paul Eggert  <eggert@cs.ucla.edu>
3918         Fix minor problem found by static checking.
3919         * buffer.c (Fdelete_all_overlays): Return nil.
3921 2012-09-03  Martin Rudalics  <rudalics@gmx.at>
3923         * buffer.c (Fdelete_all_overlays): New function.
3925 2012-09-03  Chong Yidong  <cyd@gnu.org>
3927         * gtkutil.c: Add extern decl for Qxft.
3929 2012-09-02  Paul Eggert  <eggert@cs.ucla.edu>
3931         * emacs.c, eval.c: Use bool for boolean.
3932         * emacs.c (initialized, inhibit_window_system, running_asynch_code):
3933         (malloc_using_checking) [DOUG_LEA_MALLOC]:
3934         (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
3935         (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
3936         (main, decode_env_path, Fdaemon_initialized):
3937         * eval.c (call_debugger, Finteractive_p, interactive_p):
3938         (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
3939         (maybe_call_debugger, Fbacktrace):
3940         * process.c (read_process_output, exec_sentinel):
3941         Use bool for booleans.
3942         * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
3943         All callers changed.
3944         * eval.c (interactive_p): Omit always-true boolean argument
3945         EXCLUDE_SUBRS_P.  All callers changed.
3946         * dispextern.h, lisp.h: Reflect above API changes.
3947         * firstfile.c (dummy): Use the address of 'main', whose signature
3948         won't change, instead of the address of 'initialize', whose
3949         signature just changed from int to bool.
3950         * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
3951         * msdos.c (fatal_error_in_progress): ... from here.
3952         * xdisp.c (redisplaying_p): Now a boolean.  Set it to 1 instead
3953         of incrementing it.
3954         (redisplay_internal, unwind_redisplay): Simply clear
3955         REDISPLAYING_P when unwinding, instead of saving its previous,
3956         always-false value and then restoring it.
3958         Clean up some extern decls.
3959         Mostly, this hoists extern decls out of .c files and into .h files.
3960         That way, we're more likely to catch errors if the interfaces change.
3961         * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
3962         declare xg_mark_data.
3963         * dispextern.h (x_frame_parm_handlers):
3964         * font.h (Qxft):
3965         * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
3966         (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
3967         (Qultra_bold, Qoblique, Qitalic):
3968         Move extern decl here from .c file.
3969         * alloc.c (xg_mark_data) [USE_GTK]:
3970         * doc.c (Qclosure):
3971         * eval.c (Qlexical_binding):
3972         * fns.c (time) [!HAVE_UNISTD_H]:
3973         * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
3974         (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
3975         * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
3976         * lread.c (Qinternal_interpreter_environment):
3977         * minibuf.c (Qbuffer):
3978         * process.c (QCfamily, QCfilter):
3979         * widget.c (free_frame_faces):
3980         * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
3981         * xfont.c (x_clear_errors):
3982         * xterm.c (x_frame_parm_handlers):
3983         Remove now-redundant extern decls.
3984         * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
3985         * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
3986         Now static.
3987         * xfaces.c: Remove unnecessary static decls.
3988         * xterm.c (updating_frame): Remove decl of nonexistent object.
3990         * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
3991         when building globals.h, as the objects that are not built on
3992         this host are not needed to compile C files on this host.
3994 2012-09-02  Jan Djärv  <jan.h.d@swipnet.se>
3996         * gtkutil.h: Remove prototype for x_wm_set_size_hint.
3998         * frame.h: Add missing prototype for x_wm_set_size_hint.
4000 2012-09-02  Paul Eggert  <eggert@cs.ucla.edu>
4002         * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
4003         * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
4004         (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
4005         (Fsubstitute_command_keys):
4006         * editfns.c (region_limit, find_field, Fconstrain_to_field)
4007         (save_excursion_save, save_excursion_restore)
4008         (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
4009         (format_time_string, general_insert_function)
4010         (make_buffer_string, make_buffer_string_both)
4011         (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
4012         * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
4013         (copy_text, insert_1, insert_1_both, insert_from_string)
4014         (insert_from_string_before_markers, insert_from_string_1)
4015         (insert_from_buffer, insert_from_buffer_1, replace_range)
4016         (replace_range_2, del_range_1, del_range_byte, del_range_both)
4017         (del_range_2, modify_region):
4018         * intervals.c (intervals_equal, balance_possible_root_interval)
4019         (adjust_intervals_for_insertion, merge_properties_sticky)
4020         (graft_intervals_into_buffer, lookup_char_property)
4021         (adjust_for_invis_intang, set_point_both)
4022         (get_property_and_range, compare_string_intervals)
4023         (set_intervals_multibyte_1, set_intervals_multibyte):
4024         * keyboard.c (decode_timer):
4025         Use bool for boolean.
4026         * intervals.h, lisp.h, systime.h: Reflect above API changes.
4027         * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
4029 2012-09-02  Chong Yidong  <cyd@gnu.org>
4031         * keymap.c (push_key_description): Print M-TAB as C-M-i
4032         (Bug#11758).
4034 2012-09-02  Juanma Barranquero  <lekktu@gmail.com>
4036         * makefile.w32-in (CCL_H, W32FONT_H): New macros.
4037         (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
4038         ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
4039         ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
4040         ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
4041         ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
4042         ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
4044 2012-09-01  Eli Zaretskii  <eliz@gnu.org>
4046         * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
4047         more than one grapheme cluster passed to the shaper: compute the
4048         offset adjustment values separately for each cluster.  (Bug#11860)
4050         * image.c: Restore mistakenly removed inclusion of w32.h.  Without
4051         it, GCC doesn't see prototypes of w32_delayed_load, and complains
4052         about implicit conversions from integer to pointer.
4054 2012-09-01  Daniel Colascione  <dancol@dancol.org>
4056         * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
4057         system used too early.
4059 2012-09-01  Paul Eggert  <eggert@cs.ucla.edu>
4061         Better seed support for (random).
4062         * emacs.c (main): Call init_random.
4063         * fns.c (Frandom): Set the seed from a string argument, if given.
4064         Remove long-obsolete Gentzel cruft.
4065         * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
4066         (init_random): New function.
4068 2012-09-01  Daniel Colascione  <dancol@dancol.org>
4070         * xterm.h: Add header guards.  Declare x_menubar_window_to_frame.
4071         Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
4072         x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
4073         x_wm_set_size_hint, x_query_colors, x_real_positions,
4074         x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
4075         x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
4076         all of which have been moved to common code.
4078         * xfaces.c: Include TERM_HEADER instead of listing all possible
4079         window-system headers.
4081         * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
4082         to match header.
4084         * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
4085         directly accessing frame internals.
4087         * w32font.h: Include font.h.  Define syms_of_w32font and
4088         globals_of_w32font.
4090         * process.c: Include TERM_HEADER instead of listing all possible
4091         window-system headers.
4093         * nsterm.h: Remove declarations now in frame.h.
4094         Define FRAME_X_SCREEN, FRAME_X_VISUAL.
4096         * menu.c: Include TERM_HEADER instead of listing all possible
4097         window-system headers.
4099         * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
4100         window system.
4102         * keyboard.c: Include TERM_HEADER instead of listing all possible
4103         window-system headers.
4105         * image.c: Include TERM_HEADER instead of listing all possible
4106         window-system headers.  Declare Vlibrary_cache when compiling for
4107         Windows.
4109         * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
4110         window system declarations.
4112         * frame.h: Move common functions here: set_frame_menubar,
4113         x_set_window_size, x_sync, x_get_focus_frame,
4114         x_set_mouse_position, x_set_mouse_pixel_position,
4115         x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
4116         x_char_width, x_char_height, x_pixel_width, x_pixel_height,
4117         x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
4118         x_activate_menubar, x_real_positions, x_bitmap_icon,
4119         x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
4120         and x_query_colors.
4122         * frame.c: Include TERM_HEADER instead of listing all possible
4123         window-system headers.
4125         * font.c: Include TERM_HEADER instead of listing all possible
4126         window-system headers.
4128         * emacs.c: Include TERM_HEADER.
4130         * dispnew.c: Include TERM_HEADER instead of listing all possible
4131         window-system headers.
4133         * ccl.h: Include character.h.
4135         * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
4136         the current window system; include in list of objects to link into
4137         Emacs.
4139 2012-08-31  Dmitry Antipov  <dmantipov@yandex.ru>
4141         Remove mark_ttys function and fix tty_display_info initialization.
4142         * lisp.h (mark_ttys): Remove prototype.
4143         * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
4144         to mark_ttys because all possible values of 'top_frame' slot are
4145         the frames which are reachable from Vframe_list.
4146         * term.c (mark_ttys): Remove.
4147         (init_tty): Safely initialize 'top_frame' slot with Qnil.
4149 2012-08-31  Dmitry Antipov  <dmantipov@yandex.ru>
4151         Change struct frame bitfields from unsigned char to unsigned.
4152         * frame.h (struct frame): Change type of 'display_preempted',
4153         'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
4154         'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
4155         'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
4156         bitfields from unsigned char to unsigned.
4158 2012-08-31  Dmitry Antipov  <dmantipov@yandex.ru>
4160         Remove unused member of struct x_output and struct w32_output.
4161         * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
4162         * w32term.h (struct w32_output): Likewise.
4164 2012-08-30  Jan Djärv  <jan.h.d@swipnet.se>
4166         * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
4167         does not become zero (Bug#12234).
4169 2012-08-30  Paul Eggert  <eggert@cs.ucla.edu>
4171         * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
4172         for GCC 4.7.1 x86-64.
4174 2012-08-30  Glenn Morris  <rgm@gnu.org>
4176         * lread.c (init_lread): For out-of-tree builds, only add the
4177         source directory's site-lisp dir to the load-path if it exists,
4178         consistent with in-tree builds.  (Bug#12302)
4180 2012-08-28  Jan Djärv  <jan.h.d@swipnet.se>
4182         * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
4183         button_values to NULL.  Call setStykeMask so dialogs get a close button.
4184         (windowShouldClose:): Set window_closed.
4185         (dealloc): New member, free button_values.
4186         (process_dialog:): Make member function.  Remove window argument,
4187         replace window with self.  Count buttons and allocate and store values
4188         in button_values.
4189         (addButton:value:row:): value is int with the name tag.  Call setTag
4190         with tag.  Remove return self, declare return value as void.
4191         (addString:row:): Remove return self, declare return value as void.
4192         (addSplit): Remove return self, declare return value as void.
4193         (clicked:): Remove return self, declare return value as void.
4194         Set dialog_return to button_values[seltag].  Code formatting change.
4195         (initFromContents:isQuestion:): Adjust call to process_dialog.
4196         Code formatting change.
4197         (timeout_handler:): Set timer_fired to YES.
4198         (runDialogAt:): Set timer_fired to NO.
4199         Handle click on close button as quit.
4201         * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
4202         Add window_closed and button_values.  Add void as return value for
4203         add(Button|String|Split).  addButton takes int instead of Lisp_Object.
4204         Add process_dialog as new member.
4206 2012-08-28  Eli Zaretskii  <eliz@gnu.org>
4208         * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
4209         is not one of the heaps we manage.  (Bug#12242)
4211 2012-08-28  Glenn Morris  <rgm@gnu.org>
4213         * eval.c (Fcalled_interactively_p): Doc fix.  (Bug#11747)
4215 2012-08-28  Martin Rudalics  <rudalics@gmx.at>
4217         * window.c (Fset_window_configuration): Remove handling of
4218         auto-buffer-name window parameter.  Install revision of reverted
4219         fix.
4221 2012-08-28  Dmitry Antipov  <dmantipov@yandex.ru>
4223         Do not allow to set major mode for a dead buffer.
4224         * buffer.c (Fset_buffer_major_mode): Signal an error
4225         if the buffer is dead.
4226         (Fother_buffer, other_buffer_safely): Remove redundant
4227         nested declaration.
4229 2012-08-28  Dmitry Antipov  <dmantipov@yandex.ru>
4231         Always use set_buffer_if_live to restore original buffer at unwind.
4232         * buffer.h (record_unwind_current_buffer): New function.
4233         * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
4234         * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
4235         * undo.c, window.c: Adjust users.
4236         * buffer.c (set_buffer_if_live): Fix comment.
4238 2012-08-28  Dmitry Antipov  <dmantipov@yandex.ru>
4240         Fix usage of set_buffer_internal.
4241         * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
4242         * buffer.c (set_buffer_if_live): Use set_buffer_internal.
4243         * coding.c (decode_coding): Omit redundant test.
4244         * fileio.c (decide_coding_unwind): Likewise.
4245         * fns.c (secure_hash): Likewise.
4246         * insdel.c (modify_region): Likewise.
4247         * keyboard.c (command_loop_1): Likewise.
4248         * print.c (PRINTFINISH): Likewise.
4249         * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
4251 2012-08-27  Paul Eggert  <eggert@cs.ucla.edu>
4253         * dispnew.c: Use bool for boolean.
4254         (frame_garbaged, display_completed, delayed_size_change)
4255         (fonts_changed_p, add_window_display_history)
4256         (add_frame_display_history, verify_row_hash)
4257         (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
4258         (row_equal_p, realloc_glyph_pool)
4259         (allocate_matrices_for_frame_redisplay)
4260         (showing_window_margins_p)
4261         (adjust_frame_glyphs_for_frame_redisplay)
4262         (build_frame_matrix_from_leaf_window, make_current)
4263         (mirrored_line_dance, mirror_line_dance, update_frame)
4264         (update_window_tree, update_single_window)
4265         (check_current_matrix_flags, update_window, update_text_area)
4266         (update_window_line, set_window_update_flags, scrolling_window)
4267         (update_frame_1, scrolling, buffer_posn_from_coords)
4268         (do_pending_window_change, change_frame_size)
4269         (change_frame_size_1, sit_for):
4270         Use bool for boolean.
4271         (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
4272         and remove last int (actually boolean) argument, which was always 0.
4273         All callers changed.
4274         * dispextern.h, frame.h, lisp.h: Reflect above API changes.
4275         * dispextern.h (struct composition_it): Use bool for boolean.
4276         (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
4277         (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
4278         * dired.c (file_name_completion):
4279         Use bool for boolean.  (This was missed in an earlier change.)
4281 2012-08-27  Martin Rudalics  <rudalics@gmx.at>
4283         * window.c (Fset_window_configuration): Revert first part of
4284         last change.
4286 2012-08-27  Jan Djärv  <jan.h.d@swipnet.se>
4288         * nsterm.h (NSPanel): New class variable dialog_return.
4290         * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
4291         Initialize dialog_return.
4292         (windowShouldClose:): Use stop instead of stopModalWithCode.
4293         (clicked:): Ditto, and also set dialog_return (Bug#12258).
4294         (timeout_handler:): Use stop instead of abortModal.  Send a dummy
4295         event.
4296         (runDialogAt:): Make ret Lisp_Object.  Set it from dialog_return when
4297         modal loop returns.
4299 2012-08-27  Paul Eggert  <eggert@cs.ucla.edu>
4301         * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
4302         * composite.c (find_composition, composition_gstring_p)
4303         (composition_reseat_it, find_automatic_composition):
4304         * data.c (let_shadows_buffer_binding_p)
4305         (let_shadows_global_binding_p, set_internal, make_blv)
4306         (Fmake_variable_buffer_local, Fmake_local_variable)
4307         (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
4308         (cons_to_signed, arith_driver):
4309         * dbusbind.c (xd_in_read_queued_messages):
4310         * dired.c (directory_files_internal, file_name_completion):
4311         Use bool for booleans.
4312         * dired.c (file_name_completion):
4313         * process.h (fd_callback):
4314         Omit int (actually boolean) argument.  It wasn't being used.
4315         All uses changed.
4316         * composite.h, lisp.h: Reflect above API changes.
4318         * cmds.c, coding.c: Use bool for booleans.
4319         * cmds.c (move_point, Fself_insert_command):
4320         * coding.h (struct composition status, struct coding_system):
4321         * coding.c (detect_coding_utf_8, encode_coding_utf_8)
4322         (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
4323         (emacs_mule_char, decode_coding_emacs_mule)
4324         (encode_coding_emacs_mule, detect_coding_iso_2022)
4325         (decode_coding_iso_2022, encode_invocation_designation)
4326         (encode_designation_at_bol, encode_coding_iso_2022)
4327         (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
4328         (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
4329         (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
4330         (encode_coding_raw_text, detect_coding_charset)
4331         (decode_coding_charset, encode_coding_charset, detect_eol)
4332         (detect_coding, get_translation_table, produce_chars)
4333         (consume_chars, reused_workbuf_in_use)
4334         (make_conversion_work_buffer, code_conversion_save)
4335         (decode_coding_object, encode_coding_object)
4336         (detect_coding_system, char_encodable_p)
4337         (Funencodable_char_position, code_convert_region)
4338         (code_convert_string, code_convert_string_norecord)
4339         (Fset_coding_system_priority):
4340         * fileio.c (Finsert_file_contents):
4341         Use bool for booleans.
4342         * coding.h, lisp.h: Reflect above API changes.
4343         * coding.c: Remove unnecessary static function decls.
4344         (detect_coding): Use unsigned, not signed, to copy an unsigned field.
4345         (decode_coding, encode_coding, decode_coding_gap): Return 'void',
4346         not a boolean 'int', since callers never look at the return value.
4347         (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
4348         * coding.h (decoding_buffer_size, encoding_buffer_size)
4349         (emacs_mule_string_char): Remove unused extern decls.
4350         (struct iso_2022_spec, struct coding_system):
4351         Use 'unsigned int : 1' for boolean fields, since there's more than one.
4352         (struct emacs_mule_spec): Remove unused field 'full_support'.
4353         All initializations removed.
4354         * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
4356 2012-08-27  Dmitry Antipov  <dmantipov@yandex.ru>
4358         Fix spare memory change (Bug#12286).
4359         * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
4360         (valid_lisp_object_p): Likewise.
4362 2012-08-27  Martin Rudalics  <rudalics@gmx.at>
4364         * window.c (Fset_window_configuration): Record any window's old
4365         buffer if it's replaced (see Bug#8789).  If the new current
4366         buffer doesn't appear in the selected window, go to its old
4367         point (Bug#12208).
4369 2012-08-27  Dmitry Antipov  <dmantipov@yandex.ru>
4371         Special MEM_TYPE_SPARE to denote reserved memory.
4372         * alloc.c (enum mem_type): New memory type.
4373         (refill_memory_reserve): Use new type for spare memory.
4374         This prevents live_cons_p and live_string_p from incorrect
4375         detection of uninitialized objects from spare memory as live.
4377 2012-08-26  Paul Eggert  <eggert@cs.ucla.edu>
4379         Spelling fixes.
4380         * Makefile.in (.PHONY): versioclean -> versionclean.
4382         Remove unused external symbols.
4383         * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
4384         * window.c (Qwindow_valid_p, decode_valid_window):
4385         Now static, not extern.
4386         * data.c (Qinterval): Remove; unused.
4387         (syms_of_data): Do not define 'interval'.
4388         * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
4389         * window.h (decode_valid_window):
4390         Remove decls.
4392         * character.c, charset.c, chartab.c: Use bool for booleans.
4393         * character.c (lisp_string_width, string_count_byte8)
4394         (string_escape_byte8):
4395         * charset.c (charset_map_loaded, load_charset_map, read_hex):
4396         (load_charset_map_from_file, map_charset_chars)
4397         (Fdefine_charset_internal, define_charset_internal)
4398         (Fdeclare_equiv_charset, find_charsets_in_text)
4399         (Ffind_charset_region, char_charset, Fiso_charset):
4400         * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
4401         (sub_char_table_set, sub_char_table_set_range)
4402         (char_table_set_range, optimize_sub_char_table)
4403         (map_sub_char_table):
4404         Use bool for boolean.
4405         * character.c (str_to_unibyte): Omit last boolean argument; it was
4406         always 0.  All callers changed.
4407         * character.h, charset.h: Adjust to match previous changes.
4408         * character.h (char_printable_p): Remove decl of nonexistent function.
4409         * charset.h (struct charset): Members code_linear_p, iso_chars_96,
4410         ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
4411         are all boolean, so make them single-bit bitfields.
4413         * lisp.h (ASET): Remove attempt to detect side effects.
4414         It was meant to be temporary and it often doesn't work,
4415         because when IDX has side effects the behavior of IDX==IDX
4416         is undefined.  See Stefan Monnier in
4417         <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
4419 2012-08-26  Barry OReilly  <gundaetiapo@gmail.com>  (tiny change)
4421         * lisp.h (functionp): New function (extracted from Ffunctionp).
4422         (FUNCTIONP): Use it.
4423         * eval.c (Ffunctionp): Use it.
4425 2012-08-25  Paul Eggert  <eggert@cs.ucla.edu>
4427         * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
4428         as that's faster and simpler than static storage.  Don't bother
4429         with the g_main_context_query overhead if g_main_context_pending
4430         says no events are pending.
4431         (gfds, gfds_size): Remove these static vars.
4432         (xgselect_initialize): Remove; no longer needed.
4433         All uses and decls removed.
4435         * emacs.c (fatal_error_signal_hook): Remove.
4436         All uses removed.  This leftover from old code was always 0.
4438         * casefiddle.c, casetab.c, category.c: Use bool for boolean.
4439         * casefiddle.c (casify_object, casify_region):
4440         * casetab.c (set_case_table):
4441         * category.c, category.h (word_boundary_p):
4442         * category.h (CHAR_HAS_CATEGORY):
4443         Use bool for booleans, instead of int.
4445 2012-08-25  Eli Zaretskii  <eliz@gnu.org>
4447         * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
4449 2012-08-25  Paul Eggert  <eggert@cs.ucla.edu>
4451         On assertion failure, print backtrace if available.
4452         * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
4453         (die) [ENABLE_CHECKING]: Print a backtrace if available.
4454         * Makefile.in (LIB_EXECINFO): New macro.
4455         (LIBES): Use it.
4457         * bytecode.c, callint.c, callproc.c: Use bool for boolean.
4458         * bytecode.c (exec_byte_code):
4459         * callint.c (check_mark, Fcall_interactively):
4460         * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
4461         (getenv_internal, sync_process_alive, call_process_exited):
4462         * lisp.h (USE_SAFE_ALLOCA):
4463         Use bool for booleans, instead of int.
4464         * lisp.h, process.h: Adjust prototypes to match above changes.
4465         * callint.c (Fcall_interactively): Don't assume the mark's
4466         offset fits in 'int'.
4468 2012-08-24  Paul Eggert  <eggert@cs.ucla.edu>
4470         * buffer.c, buffer.h: Use bool for boolean.
4471         * buffer.c (reset_buffer_local_variables)
4472         (buffer_lisp_local_variables, Fset_buffer_modified_p)
4473         (Frestore_buffer_modified_p, Fset_buffer_multibyte):
4474         (overlays_at, overlays_in, mouse_face_overlay_overlaps)
4475         (overlay_touches_p, overlay_strings, Foverlay_put)
4476         (report_overlay_modification, call_overlay_mod_hooks):
4477         (mmap_enlarge, mmap_set_vars):
4478         * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
4479         Use bool for booleans, instead of int.
4480         * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
4481         since the 1-or-0 return value is always ignored anyway.
4482         (mmap_initialized_p):
4483         * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
4484         * buffer.h, lisp.h: Adjust prototypes to match above changes.
4486 2012-08-23  Paul Eggert  <eggert@cs.ucla.edu>
4488         * bidi.c: Use bool for boolean.
4489         This is a bit more readable, and makes the text segment of bidi.o
4490         0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
4491         Presumably it's faster too.
4492         (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
4493         Now bool.
4494         (bidi_cache_find_level_change, bidi_cache_iterator_state)
4495         (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
4496         (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
4497         (bidi_explicit_dir_char, bidi_level_of_next_char)
4498         (bidi_find_other_level_edge, bidi_move_to_visually_next):
4499         Use bool for booleans, instead of int.
4500         * dispextern.h (bidi_init_it, bidi_paragraph_init)
4501         (bidi_unshelve_cache): Adjust decls to match code.
4503 2012-08-23  Martin Rudalics  <rudalics@gmx.at>
4505         * keyboard.c (Fposn_at_x_y): Do not allow internal window as
4506         argument.
4508 2012-08-23  Paul Eggert  <eggert@cs.ucla.edu>
4510         * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
4511         * atimer.h: Include <stdbool.h>.
4513 2012-08-22  Dan Nicolaescu  <dann@gnu.org>
4515         * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
4516         compile time tests instead of run time tests on systems that do
4517         not use them.
4518         (FRAME_MAC_P): Remove leftover from deleted code.
4519         * frame.c (syms_of_frame): Remove leftover from deleted code.
4521 2012-08-22  Jan Djärv  <jan.h.d@swipnet.se>
4523         * nsterm.m (insertText:): Don't clear modifiers if code is space.
4525 2012-08-22  Paul Eggert  <eggert@cs.ucla.edu>
4527         * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
4528         Otherwise, the compiler complains about (A?B:C) where B is void
4529         and C is Lisp_Object.  This fixes an incompatibility with Sun C 5.12.
4530         (fontset_add): Return void, for FONTSET_ADD.
4532 2012-08-21  Paul Eggert  <eggert@cs.ucla.edu>
4534         * alloc.c: Use bool for booleans.
4535         (gc_in_progress, abort_on_gc)
4536         (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
4537         (dont_register_blocks) [GC_MALLOC_CHECK]:
4538         (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
4539         (check_string_bytes, make_specified_string, memory_full)
4540         (live_string_p, live_cons_p, live_symbol_p, live_float_p)
4541         (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
4542         (mark_stack, valid_pointer_p, make_pure_string)
4543         (Fgarbage_collect, survives_gc_p, gc_sweep):
4544         Use bool for booleans, instead of int.
4545         (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
4546         Remove unused local.
4547         * alloc.c (PURE_POINTER_P):
4548         * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
4549         * editfns.c (Fformat):
4550         * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
4551         (Fdo_auto_save):
4552         * fns.c (sweep_weak_table):
4553         * lisp.h (suppress_checking, push_message, survives_gc_p)
4554         (make_pure_string, gc_in_progress, abort_on_gc):
4555         * lread.c (readchar, read1):
4556         * print.c (Fprin1_to_string):
4557         * xdisp.c (push_message):
4558         Use bool for booleans affected directly or indirectly by
4559         alloc.c's changes.
4561         Make recently-introduced setters macros.
4562         * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
4563         (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
4564         (set_fontset_default, set_fontset_fallback): Rename from their
4565         upper-case counterparts, and make them functions rather than macros.
4566         This is more consistent with the other recently-introduced setters.
4567         These don't need to be inline, since they're local.
4569 2012-08-21  Jan Djärv  <jan.h.d@swipnet.se>
4571         * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
4572         the loop (Bug#12247).
4574 2012-08-21  Paul Eggert  <eggert@cs.ucla.edu>
4576         * lisp.h (vcopy): Use memcpy rather than our own loop.
4577         This fixes a performance regression introduced by the recent
4578         addition of vcopy.  This means 'vcopy' will need to be modified
4579         for a copying collector, but that's OK.  Also, tighten the
4580         checking in the assertion.
4582 2012-08-21  Eli Zaretskii  <eliz@gnu.org>
4584         * w32uniscribe.c (uniscribe_shape): Fix producing gstring
4585         components for RTL text (Bug#11860).  Adjust X-OFFSET of each
4586         non-base glyph for the width of the base character, according to
4587         what x_draw_composite_glyph_string_foreground expects.
4588         Generate WADJUST value according to composition_gstring_width's
4589         expectations, to produce correct width of the composed character.
4590         Reverse the sign of the DU offset produced by ScriptPlace.
4592 2012-08-21  Paul Eggert  <eggert@cs.ucla.edu>
4594         * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
4596 2012-08-21  Dmitry Antipov  <dmantipov@yandex.ru>
4598         Avoid direct writes to contents member of struct Lisp_Vector.
4599         * lisp.h (vcopy): New function to copy data into vector.
4600         * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
4601         * fns.c (Ffillarray): Use ASET.
4602         * keyboard.c (timer_check_2): Use AREF and ASET.
4603         (append_tool_bar_item, Frecent_keys): Use vcopy.
4604         * lread.c (read_vector): Use ASET.
4605         * msdos.c (Frecent_doskeys): Use vcopy.
4606         * xface.c (Finternal_copy_lisp_face): Use vcopy.
4607         (Finternal_merge_in_global_face): Use ASET and vcopy.
4608         * xfont.c (xfont_list_pattern): Likewise.
4610 2012-08-21  Martin Rudalics  <rudalics@gmx.at>
4612         * window.c (Fwindow_point): For the selected window always return
4613         the position of its buffer's point.
4614         (Fset_window_point): For the selected window always go in its
4615         buffer to the specified position.
4617 2012-08-21  Dmitry Antipov  <dmantipov@yandex.ru>
4619         Setter macros for fontsets.
4620         * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
4621         (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
4622         (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
4623         Adjust users.
4625 2012-08-20  Glenn Morris  <rgm@gnu.org>
4627         * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
4628         Don't assume that `ln -f' works.
4630 2012-08-20  Eli Zaretskii  <eliz@gnu.org>
4632         * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
4633         and later about non-assignments with no effect.  See discussion at
4634         http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
4635         details.
4637 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
4639         Inline setter functions for Lisp_Objects slots of struct specbinding.
4640         * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
4641         Adjust users.
4643 2012-08-20  Martin Rudalics  <rudalics@gmx.at>
4645         * window.c (select_window): Always make selected window's buffer
4646         current.
4648 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
4650         Use AREF and ASET for docstrings of category tables.
4651         * category.h (CATEGORY_DOCSTRING): Use AREF.
4652         (SET_CATEGORY_DOCSTRING): Use ASET.
4653         * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
4655 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
4657         Inline setter functions for hash table members.
4658         * lisp.h (set_hash_key, set_hash_value, set_hash_next)
4659         (set_hash_hash, set_hash_index): Rename with _slot suffix.
4660         (set_hash_key_and_value, set_hash_index, set_hash_next)
4661         (set_hash_hash): New functions.
4662         * charset.c, fns.c: Adjust users.
4664 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
4666         Inline getter and setter functions for per-buffer values.
4667         * buffer.h (per_buffer_default, set_per_buffer_default)
4668         (per_buffer_value, set_per_buffer_value): New functions.
4669         (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
4670         * buffer.c, data.c: Adjust users.
4672 2012-08-20  Juanma Barranquero  <lekktu@gmail.com>
4674         * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
4676 2012-08-19  Paul Eggert  <eggert@cs.ucla.edu>
4678         Rely on <config.h> + <unistd.h> to declare 'environ',
4679         as gnulib does this if the system doesn't.
4680         * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
4681         Remove declaration.  MS-Windows declares it on stdlib.h which is
4682         included by conf_post.h.
4683         * emacs.c (environ) [DOUG_LEA_MALLOC]:
4684         * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
4685         * vm-limit.c: Include <unistd.h>, for 'environ'.
4687         * unexaix.c, unexcoff.c: Include "mem-limits.h".
4688         (start_of_data): Remove decl; mem-limits.h provides it.
4690         * xdisp.c (handle_invisible_prop): Make it a bit faster
4691         and avoid a gcc -Wmaybe-uninitialized diagnostic.
4693 2012-08-19  Chong Yidong  <cyd@gnu.org>
4695         * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
4696         ends (Bug#3874).
4698 2012-08-19  Andreas Schwab  <schwab@linux-m68k.org>
4700         * .gdbinit: Use call instead of set when calling a function in the
4701         inferior.
4703         * data.c (set_internal): Don't use set_blv_found.
4704         (Fkill_local_variable): Likewise.
4706 2012-08-18  Alp Aker  <alp.tekin.aker@gmail.com>
4708         * nsfont.m (ns_ascii_average_width): Ensure the string
4709         ascii_printable is initialized with a null-terminated character
4710         array.  Otherwise, it can contain undesired extra characters.
4712 2012-08-18  Paul Eggert  <eggert@cs.ucla.edu>
4714         port new setting code to Sun C 5.8 2005/10/13
4715         * chartab.c, lisp.h (char_table_set, char_table_set_range):
4716         Return void, not Lisp_Object.  Otherwise, the compiler
4717         complains about (A?B:C) where B is void and C is Lisp_Object
4718         when compiling CHAR_TABLE_SET, due to the recent change to
4719         the API of sub_char_table_set_contents.
4721 2012-08-18  Chong Yidong  <cyd@gnu.org>
4723         * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
4724         for the string case (Bug#3874).
4726 2012-08-18  Paul Eggert  <eggert@cs.ucla.edu>
4728         * buffer.h (BSET): Remove (Bug#12215).
4729         Replace all uses with calls to new setter functions.
4730         (bset_bidi_paragraph_direction, bset_case_canon_table)
4731         (bset_case_eqv_table, bset_directory, bset_display_count)
4732         (bset_display_time, bset_downcase_table)
4733         (bset_enable_multibyte_characters, bset_filename, bset_keymap)
4734         (bset_last_selected_window, bset_local_var_alist)
4735         (bset_mark_active, bset_point_before_scroll, bset_read_only)
4736         (bset_truncate_lines, bset_undo_list, bset_upcase_table)
4737         (bset_width_table):
4738         * buffer.c (bset_abbrev_mode, bset_abbrev_table)
4739         (bset_auto_fill_function, bset_auto_save_file_format)
4740         (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
4741         (bset_bidi_display_reordering, bset_buffer_file_coding_system)
4742         (bset_cache_long_line_scans, bset_case_fold_search)
4743         (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
4744         (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
4745         (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
4746         (bset_fringe_indicator_alist, bset_fringes_outside_margins)
4747         (bset_header_line_format, bset_indicate_buffer_boundaries)
4748         (bset_indicate_empty_lines, bset_invisibility_spec)
4749         (bset_left_fringe_width, bset_major_mode, bset_mark)
4750         (bset_minor_modes, bset_mode_line_format, bset_mode_name)
4751         (bset_name, bset_overwrite_mode, bset_pt_marker)
4752         (bset_right_fringe_width, bset_save_length)
4753         (bset_scroll_bar_width, bset_scroll_down_aggressively)
4754         (bset_scroll_up_aggressively, bset_selective_display)
4755         (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
4756         (bset_word_wrap, bset_zv_marker):
4757         * category.c (bset_category_table):
4758         * syntax.c (bset_syntax_table):
4759         New setter functions.
4761         * process.h (PSET): Remove (Bug#12215).
4762         Replace all uses with calls to new setter functions.
4763         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4764         (PROCESS_INLINE): New macro.
4765         (pset_childp): New setter function.
4766         (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
4767         * process.c (PROCESS_INLINE):
4768         Define to EXTERN_INLINE, so that the corresponding functions
4769         are compiled into code.
4770         (pset_buffer, pset_command, pset_decode_coding_system)
4771         (pset_decoding_buf, pset_encode_coding_system)
4772         (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
4773         (pset_plist, pset_sentinel, pset_status, pset_tty_name)
4774         (pset_type, pset_write_queue): New setter functions.
4776         * window.h (WSET): Remove (Bug#12215).
4777         Replace all uses with calls to new setter functions.
4778         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4779         (WINDOW_INLINE): New macro.
4780         (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
4781         (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
4782         (wset_total_lines, wset_vertical_scroll_bar)
4783         (wset_window_end_pos, wset_window_end_valid)
4784         (wset_window_end_vpos): New setter functions.
4785         * window.c (WINDOW_INLINE):
4786         Define to EXTERN_INLINE, so that the corresponding functions
4787         are compiled into code.
4788         (wset_combination_limit, wset_dedicated, wset_display_table)
4789         (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
4790         (wset_new_normal, wset_new_total, wset_next_buffers)
4791         (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
4792         (wset_prev_buffers, wset_right_fringe_width)
4793         (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
4794         (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
4795         (wset_window_parameters):
4796         * xdisp.c (wset_base_line_number, wset_base_line_pos)
4797         (wset_column_number_displayed, wset_region_showing):
4798         New setter functions.
4800         * termhooks.h (TSET): Remove (Bug#12215).
4801         Replace all uses with calls to new setter functions.
4802         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4803         (TERMHOOKS_INLINE): New macro.
4804         (tset_charset_list, tset_selection_alist): New setter functions.
4805         * terminal.c (TERMHOOKS_INLINE):
4806         Define to EXTERN_INLINE, so that the corresponding functions
4807         are compiled into code.
4808         (tset_param_alist): New setter function.
4810 2012-08-17  Paul Eggert  <eggert@cs.ucla.edu>
4812         * keyboard.h (KSET): Remove (Bug#12215).
4813         Replace all uses with calls to new setter functions.
4814         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4815         (KEYBOARD_INLINE): New macro.
4816         (kset_default_minibuffer_frame, kset_defining_kbd_macro)
4817         (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
4818         (kset_prefix_arg, kset_system_key_alist, kset_window_system):
4819         New setter functions.
4820         * keyboard.c (KEYBOARD_INLINE):
4821         Define to EXTERN_INLINE, so that the corresponding functions
4822         are compiled into code.
4823         (kset_echo_string, kset_kbd_queue)
4824         (kset_keyboard_translate_table, kset_last_prefix_arg)
4825         (kset_last_repeatable_command, kset_local_function_key_map)
4826         (kset_overriding_terminal_local_map, kset_real_last_command)
4827         (kset_system_key_syms): New setter functions.
4829         * frame.h (FSET): Remove (Bug#12215).
4830         Replace all uses with calls to new setter functions.
4831         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4832         (FRAME_INLINE): New macro.
4833         (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
4834         (fset_current_tool_bar_string, fset_desired_tool_bar_string)
4835         (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
4836         (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
4837         (fset_param_alist, fset_root_window, fset_scroll_bars)
4838         (fset_selected_window, fset_title, fset_tool_bar_items)
4839         (fset_tool_bar_position, fset_tool_bar_window): New functions.
4840         * frame.c (FRAME_INLINE):
4841         Define to EXTERN_INLINE, so that the corresponding functions
4842         are compiled into code.
4843         (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
4845         A few more naming-convention fixes for getters and setters.
4846         * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
4847         and rename from buffer_overlays_set_before.
4848         (set_buffer_overlays_after): Move here from buffer.h, and rename
4849         from buffer_overlays_set_after.
4850         * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
4851         All uses changed.
4852         (set_buffer_intervals): Rename from buffer_set_intervals.
4853         * intervals.c (set_interval_object): Move here from intervals.h,
4854         and rename from interval_set_object.
4855         (set_interval_left): Move here from intervals.h, and rename from
4856         interval_set_left.
4857         (set_interval_right): Move here from intervals.h, and rename from
4858         interval_set_right.
4859         (copy_interval_parent): Move here from intervals.h, and rename from
4860         interval_copy_parent.
4861         * intervals.h (set_interval_parent): Rename from interval_set_parent.
4862         (set_interval_plist): Rename from interval_set_plist.
4863         Return void, not Lisp_Object, since no caller uses the result.
4864         * lisp.h (string_intervals): Rename from string_get_intervals.
4865         (set_string_intervals): Rename from string_set_intervals.
4867         * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
4868         (set_char_table_contents): Rename from char_table_set_contents.
4869         (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
4870         All uses changed.  See the end of
4871         <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
4873         * lisp.h (CSET): Remove (Bug#12215).
4874         (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
4875         (set_char_table_purpose): New functions,
4876         replacing CSET.  All uses changed.  For example, replace
4877         "CSET (XCHAR_TABLE (char_table), parent, parent);" with
4878         "set_char_table_parent (char_table, parent);".
4879         The old version was confusing because it used the same name
4880         'parent' for two different things.
4882 2012-08-17  Dmitry Antipov  <dmantipov@yandex.ru>
4884         Functions to get and set Lisp_Object fields of buffer-local variables.
4885         * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
4886         (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
4887         (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
4888         * data.c, eval.c, frame.c: Adjust users.
4890 2012-08-17  Chong Yidong  <cyd@gnu.org>
4892         * xfaces.c (merge_face_vectors): If the target font specfies a
4893         font spec, make the font's attributes take precedence over
4894         directly-specified attributes.
4895         (merge_face_ref): Recognize :font.
4897 2012-08-17  Dmitry Antipov  <dmantipov@yandex.ru>
4899         Do not use memcpy for copying intervals.
4900         * intervals.c (reproduce_interval): New function.
4901         (reproduce_tree, reproduce_tree_obj): Use it.
4902         (reproduce_tree_obj): Remove prototype.
4904 2012-08-17  Paul Eggert  <eggert@cs.ucla.edu>
4906         * lisp.h (duration_to_sec_usec): Remove unused decl.
4908 2012-08-17  Alp Aker  <alp.tekin.aker@gmail.com>
4910         * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
4911         to an allocated instance of NSString, not to the class itself.
4913 2012-08-17  Juanma Barranquero  <lekktu@gmail.com>
4915         * makefile.w32-in (C_CTYPE_H): New macro.
4916         (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
4917         ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
4918         ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
4920 2012-08-16  Paul Eggert  <eggert@cs.ucla.edu>
4922         Use ASCII tests for character types.
4923         * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
4924         * xfns.c, xterm.c:
4925         Don't include <ctype.h>; was not needed.
4926         * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
4927         * sysdep.c, xfaces.c:
4928         Include <c-ctype.h> instead of <ctype.h>.
4929         * nsterm.m: Include <c-ctype.h>.
4930         * charset.c (read_hex):
4931         * doc.c (Fsnarf_documentation):
4932         * fileio.c (IS_DRIVE) [WINDOWSNT]:
4933         (DRIVE_LETTER) [DOS_NT]:
4934         (Ffile_name_directory, Fexpand_file_name)
4935         (Fsubstitute_in_file_name):
4936         * font.c (font_parse_xlfd, font_parse_fcname):
4937         * frame.c (x_set_font_backend):
4938         * gtkutil.c (xg_get_font):
4939         * image.c (xbm_scan, xpm_scan, pbm_scan_number):
4940         * nsimage.m (hexchar):
4941         * nsterm.m (ns_xlfd_to_fontname):
4942         * sysdep.c (system_process_attributes):
4943         * xfaces.c (hash_string_case_insensitive):
4944         Use C-locale tests instead of locale-specific tests for character
4945         types, since we want the ASCII interpretation here, not the
4946         interpretation suitable for whatever happens to be the current locale.
4948 2012-08-16  Martin Rudalics  <rudalics@gmx.at>
4950         Consistently check windows for validity/liveness
4951         (Bug#11984, Bug#12025, Bug#12026).
4952         * lisp.h (CHECK_VALID_WINDOW): New macro.
4953         * window.c (decode_window): Rename to decode_live_window.
4954         (decode_valid_window, Fwindow_valid_p): New functions.
4955         (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
4956         (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
4957         (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
4958         (Fwindow_prev_sibling, Fwindow_combination_limit)
4959         (Fset_window_combination_limit, Fwindow_use_time)
4960         (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
4961         (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
4962         (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
4963         (Fwindow_hscroll, Fset_window_hscroll)
4964         (Fwindow_redisplay_end_trigger)
4965         (Fset_window_redisplay_end_trigger, Fwindow_edges)
4966         (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
4967         (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
4968         (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
4969         (Fwindow_end, Fset_window_point, Fset_window_start)
4970         (Fpos_visible_in_window_p, Fwindow_line_height)
4971         (Fwindow_dedicated_p, Fset_window_dedicated_p)
4972         (Fwindow_prev_buffers, Fset_window_prev_buffers)
4973         (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
4974         (Fset_window_parameter, Fwindow_display_table)
4975         (Fset_window_display_table, Fdelete_other_windows_internal)
4976         (Fset_window_buffer, Fset_window_new_total)
4977         (Fset_window_new_normal, Fdelete_window_internal)
4978         (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
4979         (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
4980         (Fwindow_scroll_bars): Check whether argument window is a valid or
4981         live window.  Update doc-strings.
4982         (syms_of_window): New symbol Qwindow_valid_p.
4983         * keyboard.c (Fposn_at_x_y): Check whether argument
4984         frame_or_window denotes a valid window.
4986 2012-08-16  Dmitry Antipov  <dmantipov@yandex.ru>
4988         Fix previous char table change.
4989         * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
4990         * chartab.c (optimize_sub_char_table): Likewise.
4992 2012-08-16  Chong Yidong  <cyd@gnu.org>
4994         * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
4996         * xfont.c (xfont_open):
4997         * xftfont.c (xftfont_open): Set the font's max_width field.
4999         * nsfont.m (nsfont_open): Similar to the Xft backend, set
5000         min_width to space_width and average_width to the average over
5001         printable ASCII characters.
5002         (ns_char_width): Code cleanup.
5003         (ns_ascii_average_width): New utility function.
5005         * font.h (struct font): Update comments.
5007 2012-08-16  Dmitry Antipov  <dmantipov@yandex.ru>
5009         Simple interface to set Lisp_Object fields of character tables.
5010         * lisp.h (CSET): New macro.
5011         (char_table_set_extras, char_table_set_contents)
5012         (sub_char_table_set_contents): New function.
5013         * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
5014         * syntax.c: Adjust users.
5016 2012-08-16  Stefan Monnier  <monnier@iro.umontreal.ca>
5018         * eval.c (eval_sub): Bind lexical-binding.
5019         * lread.c (Qlexical_binding): Make non-static.
5021 2012-08-15  Jan Djärv  <jan.h.d@swipnet.se>
5023         * nsmenu.m (popupSession): Remove.
5024         (pop_down_menu): Remove endModalSession.
5025         (timeout_handler:): New method.
5026         (runDialogAt:): Get next timeout.  Start a NSTimer with that timeout.
5027         Call runModalForWindow.  Check timer_fired when it returns.
5028         If not set, cancel timer and break out of loop.
5029         Otherwise loop again, with a new timeout.
5031         * nsterm.m: Include fcntl.h if present.
5032         (fd_entry, t_readfds, inNsSelect): Remove.
5033         (select_writefds, select_valid, select_timeout, selfds)
5034         (select_mutex, apploopnr): Add.
5035         (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
5036         Otherwise call kbd_buffer_store_event.
5037         (ns_send_appdefined): Remove release of fd_entry.
5038         (ns_read_socket): Always send appdefined.  Remove inNsSelect check.
5039         Increment and decrement apploopnr.
5040         (ns_select): If no file descriptors, just do a NSTimer.
5041         Otherwise copy read/write masks and start select thread (fd_handler).
5042         Start main loop and wait for application defined event.
5043         Inform select thread to stop selecting after main loop is exited.
5044         (ns_term_init): Create selfds pipe and set non-blocking.
5045         Initialize select_mutex.  Start the select thread (fd_handler).
5046         (fd_handler:): Loop forever, wait for info from the main thread
5047         to either start or stop selecting.  When select returns, send
5048         and appdefined event.
5049         (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
5050         If not call kbd_buffer_store_event.
5052         * nsterm.h (EmacsApp): fd_handler takes id argument.
5053         (EmacsDialogPanel): Add timer_fired and timeout_handler.
5055         * gtkutil.c (xg_mark_data): Use FRAME_X_P.
5057 2012-08-15  Eli Zaretskii  <eliz@gnu.org>
5059         * region-cache.c (move_cache_gap): Update gap_len using the actual
5060         growth of the boundaries array.  Do not change cache_len.
5061         (Bug#12196)
5063 2012-08-15  Dmitry Antipov  <dmantipov@yandex.ru>
5065         Generalize and cleanup font subsystem checks.
5066         * font.h (FONT_DEBUG, font_assert): Remove.
5067         * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
5068         Change font_assert to eassert.  Use eassert where appropriate.
5070 2012-08-15  Dmitry Antipov  <dmantipov@yandex.ru>
5072         * gtkutil.c (xg_get_font): Use pango_units_to_double.
5074 2012-08-15  Chong Yidong  <cyd@gnu.org>
5076         * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
5077         When using the new font chooser, use gtk_font_chooser_get_font_desc to
5078         extract the font descriptor instead of just the font name.
5079         In that case, return a font spec instead of a string.
5080         (x_last_font_name): Move to this file from xfns.c.
5082         * xfns.c (Fx_select_font): The return value can also be a font
5083         spec.  Move x_last_font_name management to gtkutil.c.
5085         * xfaces.c: Make font weight and style symbols non-static.
5087 2012-08-15  Stefan Monnier  <monnier@iro.umontreal.ca>
5089         * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
5090         (bug#12117).
5092 2012-08-14  Stefan Monnier  <monnier@iro.umontreal.ca>
5094         * alloc.c (Fgarbage_collect): Use plural form consistently.
5096 2012-08-14  Eli Zaretskii  <eliz@gnu.org>
5098         * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
5099         iteration through the command loop.  Fixes a problem whereby mouse
5100         movements are ignored until the first mouse click.
5102 2012-08-14  Paul Eggert  <eggert@cs.ucla.edu>
5104         Use bool, not int, for Lisp booleans.
5105         This is more natural, and on my platform (GCC 4.7.1 x86-64) it
5106         makes Emacs a bit smaller and presumably a bit faster.
5107         * lisp.h: Include <stdbool.h>.
5108         (struct Lisp_Boolfwd, defvar_bool):
5109         * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
5110         * regex.c [!emacs]: Include <stdbool.h>.
5111         (false, true): Remove; <stdbool.h> does this for us now.
5113 2012-08-14  Chong Yidong  <cyd@gnu.org>
5115         * character.c (Fcharacterp): Doc fix (Bug#12076).
5117         * data.c (Findirect_variable): Doc fix (Bug#11040).
5119         * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
5121         * editfns.c (Fformat): Doc fix (Bug#12059).
5122         (Fsave_current_buffer): Doc fix (Bug#11542).
5124 2012-08-14  Barry OReilly  <gundaetiapo@gmail.com>  (tiny change)
5126         * keyboard.c (access_keymap_keyremap): Accept anonymous functions
5127         (bug#12022).
5129 2012-08-14  Martin Rudalics  <rudalics@gmx.at>
5131         * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
5132         (delete_frame, Fmake_frame_invisible, Ficonify_frame):
5133         * minibuf.c (choose_minibuf_frame, read_minibuf):
5134         * w32fns.c (x_create_tip_frame):
5135         * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
5136         Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
5138 2012-08-14  Paul Eggert  <eggert@cs.ucla.edu>
5140         * intervals.c (offset_intervals): Remove obsolete comment.
5142 2012-08-14  Andreas Schwab  <schwab@linux-m68k.org>
5144         * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
5146 2012-08-14  Gergely Risko  <gergely@risko.hu>
5148         * coding.c (decode_coding): Record buffer modification before
5149         disabling undo_list (Bug#11773).
5151 2012-08-14  Dmitry Antipov  <dmantipov@yandex.ru>
5153         Revert and cleanup some recent overlay changes.
5154         * buffer.h (enum overlay_type): Remove.
5155         (buffer_get_overlays, buffer_set_overlays): Likewise.
5156         (buffer_set_overlays_before, buffer_set_overlays_after):
5157         New function.  Adjust users.
5158         (unchain_both): Add eassert.
5160 2012-08-14  Dmitry Antipov  <dmantipov@yandex.ru>
5162         * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
5164 2012-08-14  Paul Eggert  <eggert@cs.ucla.edu>
5166         * gtkutil.c (xg_mark_data): Don't assume C99.
5168 2012-08-13  Jan Djärv  <jan.h.d@swipnet.se>
5170         * gtkutil.c (xg_frame_tb_info): New struct.
5171         (TB_INFO_KEY): New define.
5172         (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
5173         (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
5174         (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
5175         if not present.
5176         (update_frame_tool_bar): Return early if data in xg_frame_tb_info
5177         is up to date.  Otherwise store new data.
5178         (free_frame_tool_bar): Free xg_frame_tb_info if present.
5180 2012-08-13  Dmitry Antipov  <dmantipov@yandex.ru>
5182         Use KSET for write access to Lisp_Object members of struct kboard.
5183         * keyboard.h (KSET): New macro.
5184         * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
5185         * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
5186         * xterm.c: Adjust users.
5188 2012-08-13  Dmitry Antipov  <dmantipov@yandex.ru>
5190         Use BSET for write access to Lisp_Object members of struct buffer.
5191         * buffer.h (BSET): New macro.
5192         * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
5193         * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
5194         * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
5195         * window.c, xdisp.c, xfns.c: Adjust users.
5197 2012-08-11  BT Templeton  <bpt@hcoop.net>  (tiny change)
5199         * lread.c (syms_of_lread): Initialize Vlexical_binding.
5201 2012-08-11  Jan Djärv  <jan.h.d@swipnet.se>
5203         * nsterm.m (not_in_argv): New function.
5204         (application:openFile, application:openTempFile:):
5205         (application:openFileWithoutUI:, application:openFiles:): Open file
5206         if not_in_argv returns non-zero (bug#12171).
5208         * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
5209         (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
5210         Define for Gtk+ versions less than 3.2.
5211         (xg_get_font_name): Use those functions/macros here.
5212         Reported by Frans Oilinki <moilinki@gmail.com>.
5214 2012-08-11  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
5216         * unexmacosx.c (copy_data_segment): Copy initialized data in
5217         statically linked libraries from input file rather than memory.
5219         * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
5220         LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
5221         (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
5223 2012-08-10  Glenn Morris  <rgm@gnu.org>
5225         * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
5226         * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
5228 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
5230         Fix last change to allow compilation with low optimization levels.
5231         * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
5232         Reported by Jan Djärv <jan.h.d@swipnet.se>.
5234 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
5236         Use common inline syntax in intervals.h.
5237         * intervals.h (INTERVALS_INLINE): New macro.
5238         Change all users from LISP_INLINE.
5240 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
5242         Define Qnone once for all platforms.
5243         * frame.c (Qnone): Define here.
5244         (syms_of_frame): DEFSYM it.
5245         * lisp.h (Qnone): New declaration.
5246         * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
5247         * xfns.c: Remove duplication.  Adjust users.
5249 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
5251         Remove unused macros from intervals.h.
5252         * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
5253         * intervals.c: Adjust comment.
5255 2012-08-10  Eli Zaretskii  <eliz@gnu.org>
5257         * w32fns.c <w32_unicode_gui>: New static variable.
5258         (globals_of_w32fns): Initialize it according to os_subtype.
5259         (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
5260         testing os_subtype.
5262 2012-08-10  Joakim Hårsman  <joakim.harsman@gmail.com>  (tiny change)
5263             Eli Zaretskii  <eliz@gnu.org>
5265         Fix bug #10299 with Unicode characters sent by customized
5266         keyboards created by MSKLC.
5267         * w32fns.c (INIT_WINDOW_CLASS): New macro.
5268         (w32_init_class): Use it to initialize the Emacs class with either
5269         ANSI or Unicode API calls.
5270         (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
5271         later.
5272         (w32_wnd_proc): If the character code sent by WM_CHAR or
5273         WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
5274         original message.  Call DefWindowProcW on NT and later.
5276 2012-08-10  Glenn Morris  <rgm@gnu.org>
5278         * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
5280         * lisp.h (DIRECTORY_SEP): Let configure set it.
5282 2012-08-09  Dmitry Antipov  <dmantipov@yandex.ru>
5284         Use TSET for write access to Lisp_Object slots of struct terminal.
5285         * termhooks.h (TSET): New macro.
5286         * coding.c, terminal.c, xselect.c: Adjust users.
5288 2012-08-08  Stefan Monnier  <monnier@iro.umontreal.ca>
5290         * xdisp.c (safe_eval_handler): Remove prototype.  Receive args describing
5291         the failing expression, include them in the error message.
5292         * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
5293         * lisp.h (internal_condition_case_n): Update declaration.
5295 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
5297         Inline functions to examine and change buffer overlays.
5298         * buffer.c (unchain_both): New function.
5299         * buffer.h (buffer_get_overlays, buffer_set_overlays):
5300         (buffer_has_overlays): New function.
5301         (enum overlay_type): New enum.
5302         * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
5303         * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
5305 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
5307         Inline functions to examine and change buffer intervals.
5308         * alloc.c (mark_interval_tree): Remove.
5309         (MARK_INTERVAL_TREE): Simplify.
5310         (UNMARK_BALANCE_INTERVALS): Remove.  Adjust users.
5311         * intervals.c (buffer_balance_intervals): New function.
5312         (graft_intervals_into_buffer): Adjust indentation.
5313         (set_intervals_multibyte): Simplify.
5314         * buffer.h (BUF_INTERVALS): Remove.
5315         (buffer_get_intervals, buffer_set_intervals): New function.
5316         * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
5317         * intervals.c, textprop.c: Adjust users.
5319 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
5321         Inline functions to examine and change string intervals.
5322         * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
5323         (string_get_intervals, string_set_intervals): New function.
5324         * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
5325         * lread.c, print.c, textprop.c: Adjust users.
5327 2012-08-08  Glenn Morris  <rgm@gnu.org>
5329         * lisp.mk (lisp): Remove language/persian.elc.
5331 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
5333         Cleanup intervals.
5334         * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
5335         (NULL_INTERVAL_P): Likewise.  Adjust users.
5336         (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
5337         Adjust comment.  Move under #if 0.
5338         * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
5339         * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
5341 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
5343         Check total length of intervals with eassert.
5344         * intervals.h (CHECK_TOTAL_LENGTH): Remove.
5345         * intervals.c: Change all users to eassert.
5347 2012-08-07  Eli Zaretskii  <eliz@gnu.org>
5349         * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
5350         Rename fields to match removal of FGET and WGET and disuse of
5351         INTERNAL_FIELD in Lisp_Cons.
5353 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
5355         Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
5356         * lisp.h (struct Lisp_Symbol): Change xname to meaningful
5357         name since all xname users are fixed long time ago.  Do not
5358         use INTERNAL_FIELD.
5359         (set_symbol_name, set_symbol_function, set_symbol_plist):
5360         (set_symbol_next, set_overlay_plist): New function.
5361         (struct Lisp_Cons): Do not use INTERNAL_FIELD.
5362         (struct Lisp_Overlay): Likewise.
5363         (CVAR, MVAR, SVAR): Remove.
5364         * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
5365         * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
5366         * xterm.c: Adjust users.
5367         * .gdbinit: Change to use name field of struct Lisp_Symbol
5368         where appropriate.
5370 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
5372         Basic functions to set Lisp_Object and pointer slots of intervals.
5373         * intervals.h (interval_set_parent, interval_set_object):
5374         (interval_set_left, interval_set_right, interval_set_plist):
5375         (interval_copy_parent): New function.
5376         (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
5377         (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
5378         Adjust indentation.
5379         (INTERVAL_SIZE): Remove.  Adjust users.
5380         * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
5382 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
5384         Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
5385         * process.h (PGET): Remove.
5386         (struct Lisp_Process): Do not use INTERNAL_FIELD.
5387         * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
5389 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
5391         Drop WGET and revert read access to Lisp_Objects slots of struct window.
5392         * window.h (WGET): Remove.
5393         (struct window): Do not use INTERNAL_FIELD.
5394         * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5395         * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5396         * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
5397         * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
5398         * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
5399         Adjust users.
5401 2012-08-07  Chong Yidong  <cyd@gnu.org>
5403         * window.c (Fwindow_edges, Fwindow_pixel_edges)
5404         (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
5405         (Fdelete_window_internal): Signal an error if the window is not on
5406         a live frame (Bug#12025).
5408 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
5410         Drop FGET and revert read access to Lisp_Objects slots of struct frame.
5411         * frame.h (FGET): Remove.
5412         (struct frame): Do not use INTERNAL_FIELD.
5413         * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
5414         * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
5415         * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5416         * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
5418 2012-08-06  Juanma Barranquero  <lekktu@gmail.com>
5420         * w32.c: Silence compiler warnings.
5421         (map_w32_filename): Remove unused variable `is_fat'.
5422         (chase_symlinks): Add parentheses around expression.
5424 2012-08-06  Glenn Morris  <rgm@gnu.org>
5426         * sysdep.c: Respect BROKEN_GETWD.
5428         * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
5429         Let configure handle it.
5430         (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
5432 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
5434         Use GCALIGNMENT where appropriate.
5435         * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
5436         (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
5437         (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
5439 2012-08-06  Eli Zaretskii  <eliz@gnu.org>
5441         * w32menu.c (set_frame_menubar, initialize_frame_menubar):
5442         Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5444 2012-08-06  Stefan Monnier  <monnier@iro.umontreal.ca>
5446         * buffer.h (struct buffer): Revert `indirections' to a simple int;
5447         that should be sufficient for everyone.
5449 2012-08-06  Jan Djärv  <jan.h.d@swipnet.se>
5451         * keyboard.c (timer_check_2): Add break so timer_check returns next
5452         timeout.
5454 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
5456         Fix Windows build errors introduced after converting to WGET and WSET.
5457         * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
5458         Reported by Andy Moreton <andrewjmoreton@gmail.com>.
5460 2012-08-06  Jan Djärv  <jan.h.d@swipnet.se>
5462         * nsterm.m (ns_frame_rehighlight): Use FSET.
5464         * nsmenu.m (ns_update_menubar): Use FSET.
5466 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
5468         Separate read and write access to Lisp_Object slots of Lisp_Process.
5469         * process.h (PGET, PSET): New macros similar to AREF and ASET.
5470         * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
5472 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
5474         Separate read and write access to Lisp_Object slots of struct window.
5475         * window.h (WGET, WSET): New macros similar to AREF and ASET.
5476         * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5477         * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5478         * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
5479         * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
5480         * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
5481         Adjust users.
5483 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
5485         Fix Windows build errors introduced after converting to FGET and FSET.
5486         * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
5487         (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
5488         (w32_judge_scroll_bars): Change to use FSET.
5489         Reported by Andy Moreton <andrewjmoreton@gmail.com>.
5491 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
5493         Fix replacement typo.
5494         * window.c (replace_window): Set root_window instead of
5495         selected_window.  This fixes a total window subsystem
5496         malfunction reported by Bastien Guerry <bzg@gnu.org>.
5498 2012-08-06  Glenn Morris  <rgm@gnu.org>
5500         * lisp.mk (lisp): Add language/persian.elc.
5502 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
5504         Separate read and write access to Lisp_Object slots of struct frame.
5505         * frame.h (FGET, FSET): New macros similar to AREF and ASET.
5506         * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
5507         * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
5508         * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5509         * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
5511 2012-08-05  Andreas Schwab  <schwab@linux-m68k.org>
5513         * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
5515 2012-08-05  Dmitry Antipov  <dmantipov@yandex.ru>
5517         Generalize common compile-time constants.
5518         * lisp.h (header_size, bool_header_size, word_size): Now here.
5519         (struct Lisp_Vector): Add comment.
5520         (struct Lisp_Bool_Vector): Move up to define handy constants.
5521         (VECSIZE, PSEUDOVECSIZE): Simplify.
5522         (SAFE_ALLOCA_LISP): Use new constant.  Adjust indentation.
5523         * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
5524         * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
5525         * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
5526         * xfont.c, xmenu.c: Use word_size where appropriate.
5528 2012-08-05  Lawrence Mitchell  <wence@gmx.li>
5530         * search.c (Freplace_match): Treat \? in the replacement text
5531         literally (Bug#8161).
5533 2012-08-05  Chong Yidong  <cyd@gnu.org>
5535         * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
5536         * frame.c (Vdelete_frame_functions):
5537         * emacs.c (Vkill_emacs_hook): Doc fix.
5539 2012-08-04  Eli Zaretskii  <eliz@gnu.org>
5541         * xfns.c (x_set_menu_bar_lines): Fix compilation error in
5542         --with-x-toolkit=no builds.
5543         Reported by Carsten Mattner <carstenmattner@gmail.com>.
5545 2012-08-04  Chong Yidong  <cyd@gnu.org>
5547         * syntax.c (Fmodify_syntax_entry): Doc fix.
5549 2012-08-04  Eli Zaretskii  <eliz@gnu.org>
5551         Fix startup warnings about ../site-lisp on MS-Windows.  (Bug#11959)
5552         * w32.c (init_environment): Change the default values of many
5553         environment variables in dflt_envvars[] to NULL, to avoid pushing
5554         them into environment when they were not already defined.
5555         Remove the code that deletes site-lisp subdirectories from the default
5556         value of EMACSLOADPATH, as it is no longer needed.
5557         (check_windows_init_file): Now external, not static.
5558         Use Vload_path as is, without adding anything, as this function is now
5559         called when Vload_path is already set up.
5561         * w32.h (check_windows_init_file): Add prototype.
5563         * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
5564         directory, ignore the /*/i386/ tail in Vinvocation_directory, for
5565         compatibility with Posix platforms.
5566         (main): Move the call to check_windows_init_file to here from
5567         w32.c.
5568         (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
5569         any, in the DEFALT argument into the root of the Emacs build or
5570         installation tree, as appropriate.
5572         * callproc.c (init_callproc_1): Call decode_env_path instead of
5573         doing its equivalent by hand.
5574         (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
5575         the code that sets Vexec_path run on MS-Windows.
5577         * lread.c (init_lread): Add comments to #ifdef's.
5579         * msdos.c (dos_set_window_size, IT_update_begin)
5580         (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
5581         instead of direct references.
5583 2012-08-04  Paul Eggert  <eggert@cs.ucla.edu>
5585         Export DEFAULT_REHASH_* to GDB.
5586         * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
5587         Now constants, not macros.
5589 2012-08-03  Paul Eggert  <eggert@cs.ucla.edu>
5591         Remove unnecessary casts involving pointers.
5592         These casts are no longer needed now that we assume C89 or later,
5593         since they involve casting to or from void *.
5594         * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
5595         (make_pure_float, make_pure_vector):
5596         * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
5597         * macros.c (Fstart_kbd_macro):
5598         * menu.c (find_and_return_menu_selection):
5599         * minibuf.c (read_minibuf_noninteractive):
5600         * sysdep.c (closedir):
5601         * xdisp.c (x_produce_glyphs):
5602         * xfaces.c (compare_fonts_by_sort_order):
5603         * xfns.c (x_real_positions, select_visual):
5604         * xselect.c (x_stop_queuing_selection_requests)
5605         (x_get_window_property, x_get_window_property_as_lisp_data):
5606         * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
5607         Remove unnecessary pointer casts.
5608         * alloc.c (record_xmalloc): New function.
5609         * lisp.h (record_xmalloc): New decl.
5610         (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
5611         more like a function.  This is because the pointer cast is not
5612         needed.  All uses changed.
5613         * print.c (print_string, print_error_message): Avoid length recalc.
5615         Improve fix for macroexp crash with debugging (Bug#12118).
5616         * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
5617         ARRAY_MARK_FLAG when checking subscripts, because ASET is
5618         not supposed to be invoked from the garbage collector.
5619         See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
5620         (gc_aset): New function, which is like ASET but can be
5621         used in the garbage collector.
5622         (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
5623         (set_hash_index): Use it instead of ASET.
5625 2012-08-03  Eli Zaretskii  <eliz@gnu.org>
5627         Support symlinks on latest versions of MS-Windows.
5628         * w32.c: Include winioctl.h and aclapi.h.
5629         (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
5630         (revert_to_self): Forward declarations of static functions.
5631         <static BOOL g_b_init_get_security_info>:
5632         <g_b_init_create_symbolic_link>: New static flags.
5633         (globals_of_w32): Initialize them to zero.
5634         (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
5635         (map_w32_filename): Improve commentary.  Simplify switch.
5636         (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
5637         headers (most versions of MinGW w32api don't).
5638         (get_security_info, create_symbolic_link)
5639         (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
5640         New functions.
5641         (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
5642         in the argument file name.
5643         (sys_access): Call unc_volume_file_attributes only if
5644         GetFileAttributes fails with network-related error codes.
5645         (sys_rename): Diagnose renaming of a symlink when the user doesn't
5646         have the required privileges.
5647         (get_file_security_desc_by_name): Rename from
5648         get_file_security_desc.
5649         (stat_worker): New function, with most of the guts of 'stat', and
5650         with addition of handling of symlinks and support for 'lstat'.
5651         If possible, get file's attributes and security information by
5652         handle, not by name.  Produce S_IFLNK bit for symlinks, when
5653         called from 'lstat'.
5654         (stat, lstat): New functions, call 'stat_worker'.
5655         (symlink, readlink, careadlinkat): Rewritten to create and resolve
5656         symlinks when the underlying filesystem supports them.
5658 2012-08-02  Paul Eggert  <eggert@cs.ucla.edu>
5660         Fix macroexp crash on Windows with debugging (Bug#12118).
5661         * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
5662         checking subscripts; problem introduced with the recent
5663         "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
5664         (ARRAY_MARK_FLAG): Now a macro as well as a constant,
5665         since it's used in non-static inline functions now.
5667         * xfaces.c (face_at_buffer_position, face_for_overlay_string):
5668         Don't assume buffer size fits in 'int'.  Remove unused local.
5670         Use C99-style 'extern inline' if available.
5671         * buffer.h (BUFFER_INLINE):
5672         * category.h (CATEGORY_INLINE):
5673         * character.h (CHARACTER_INLINE):
5674         * charset.h (CHARSET_INLINE):
5675         * composite.h (COMPOSITE_INLINE):
5676         * dispextern.h (DISPEXTERN_INLINE):
5677         * lisp.h (LISP_INLINE):
5678         * systime.h (SYSTIME_INLINE):
5679         New macro, replacing 'static inline' in this header.
5680         * buffer.h, category.h, character.h, charset.h, composite.h:
5681         * dispextern.h, lisp.h, systime.h:
5682         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5683         * alloc.c (LISP_INLINE):
5684         * buffer.c (BUFFER_INLINE):
5685         * category.c (CATEGORY_INLINE):
5686         * character.c (CHARACTER_INLINE):
5687         * charset.c (CHARSET_INLINE):
5688         * composite.c (COMPOSITE_INLINE):
5689         * dispnew.c (DISPEXTERN_INLINE):
5690         * sysdep.c (SYSTIME_INLINE):
5691         Define to EXTERN_INLINE, so that the corresponding functions
5692         are compiled into code.
5693         * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
5694         (INLINE_HEADER_END): New macros.
5695         * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
5696         since it's used in non-static inline functions now.
5697         (VALMASK) [!USE_LSB_TAG]: Likewise.
5699 2012-08-02  Glenn Morris  <rgm@gnu.org>
5701         * s/: Remove empty directory.
5703         * s/ms-w32.h: Move to ../nt/inc.
5704         * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
5705         Update for new ms-w32.h location.
5707 2012-08-02  Paul Eggert  <eggert@cs.ucla.edu>
5709         Port to Solaris 8.
5710         * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
5712 2012-08-02  Glenn Morris  <rgm@gnu.org>
5714         * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
5715         hard-coding the path separator.
5717 2012-08-01  Paul Eggert  <eggert@cs.ucla.edu>
5719         Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
5720         This how ASET and AREF are supposed to work, and makes
5721         it easier to think about future improvements.  See
5722         <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
5723         * charset.h (set_charset_attr): New function.
5724         All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
5725         * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
5726         (aref_addr): New function.  All uses of &AREF(...) changed.
5727         (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
5728         (set_hash_index): New functions.  All lvalue-style uses of
5729         HASH_KEY etc. changed.
5730         * keyboard.c (set_prop): New function.  All lvalue-style uses
5731         of PROP changed.
5733 2012-08-01  Alp Aker  <alp.tekin.aker@gmail.com>
5735         * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
5736         (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
5737         (EmacsScroller-dealloc): Adjust to use WVAR.  (Bug#12114)
5738         * nsfns.m (ns_set_name_as_filename): Likewise.
5739         * nsmenu.m (ns_update_menubar): Likewise.
5740         * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
5742 2012-08-01  Eli Zaretskii  <eliz@gnu.org>
5744         * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
5745         Adapt to latest changes in field names of the corresponding Lisp
5746         objects.
5748         * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
5750 2012-08-01  Glenn Morris  <rgm@gnu.org>
5752         * s/msdos.h: Remove file.
5753         * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
5754         * Makefile.in (S_FILE): Remove.
5755         (config_h): Remove S_FILE.
5757 2012-08-01  Juanma Barranquero  <lekktu@gmail.com>
5759         * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
5760         Remove; moved to nt/config.nt.
5762 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
5764         Use INTERNAL_FIELD for conses and overlays.
5765         * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
5766         Remove obsolete comment.
5767         (MVAR): New macro.
5768         (struct Lisp_Overlay): Use INTERNAL_FIELD.
5769         * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
5771 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
5773         Use INTERNAL_FIELD for symbols.
5774         * lisp.h (SVAR): New macro.  Adjust users.
5775         * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
5776         * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
5778 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
5780         Use INTERNAL_FIELD for processes.
5781         * process.h (PVAR): New macro.  Adjust style.
5782         (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
5783         * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
5785 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
5787         Use INTERNAL_FIELD for windows.
5788         * window.h (WVAR): New macro.
5789         (struct window): Change Lisp_Object members to INTERNAL_FIELD.
5790         * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5791         * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5792         * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
5793         * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
5794         * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
5796 2012-08-01  Paul Eggert  <eggert@cs.ucla.edu>
5798         * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
5800 2012-08-01  Glenn Morris  <rgm@gnu.org>
5802         * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
5803         Move to configure.ac.
5805 2012-08-01  Juanma Barranquero  <lekktu@gmail.com>
5807         * makefile.w32-in (CONFIG_H): Update dependencies.
5808         (CONF_POST_H): New macro.
5810         * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
5812 2012-07-31  Glenn Morris  <rgm@gnu.org>
5814         * Makefile.in (S_FILE): No longer set by configure.
5816         * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
5817         is available.
5818         (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
5820         * process.h (NULL_DEVICE):
5821         * emacs.c (SEPCHAR):
5822         * editfns.c (USER_FULL_NAME): Let configure set them.
5824         * s/README, s/template.h: Remove files.
5826         * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
5828         * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
5829         Move to configure.ac.
5831 2012-07-31  Eli Zaretskii  <eliz@gnu.org>
5833         * .gdbinit (xframe): Adapt to introduction of FVAR and the
5834         resulting renaming of 'struct frame' members.
5836         * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
5838         * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
5839         after introduction of FVAR.
5841 2012-07-31  Jan Djärv  <jan.h.d@swipnet.se>
5843         * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
5845         * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
5846         instead of compositeToPoint.
5847         (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
5849         * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
5851 2012-07-31  Dmitry Antipov  <dmantipov@yandex.ru>
5853         Generalize INTERNAL_FIELD between buffers, keyboards and frames.
5854         * lisp.h (INTERNAL_FIELD): New macro.
5855         * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
5856         (BVAR): Change to use INTERNAL_FIELD.
5857         * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
5858         (KVAR): Change to use INTERNAL_FIELD.
5859         * frame.h (FVAR): New macro.
5860         (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
5861         * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
5862         * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
5863         * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5864         * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
5866 2012-07-31  Dmitry Antipov  <dmantipov@yandex.ru>
5868         Miscellaneous fixes for non-default X toolkits.
5869         * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
5870         * xterm.c (x_frame_of_widget): Remove redundant prototype.
5871         Move under #ifdef USE_LUCID.
5872         (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
5873         definition and usage to avoid warnings.
5875 2012-07-31  Jan Djärv  <jan.h.d@swipnet.se>
5877         * nsterm.m (openFiles): Fix previous checkin.
5879 2012-07-31  Paul Eggert  <eggert@cs.ucla.edu>
5881         * indent.c (compute_motion): Remove unused local.
5883 2012-07-31  Glenn Morris  <rgm@gnu.org>
5885         * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
5887         * conf_post.h [USG5_4]:
5888         Move remaining contents of s/usg5-4-common.h here.
5889         * s/usg5-4-common.h: Remove file.
5891         * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
5892         * s/irix6-5.h: Remove file.
5894         * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
5895         * s/darwin.h: Remove file.
5897         * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
5898         * s/hpux10-20.h: Remove file, which is now empty.
5900 2012-07-30  Glenn Morris  <rgm@gnu.org>
5902         * conf_post.h: New, split from configure.ac's AH_BOTTOM.
5903         * Makefile.in (config_h): Add conf_post.h.
5904         * makefile.w32-in (CONFIG_H): Add conf_post.h.
5906 2012-07-30  Jan Djärv  <jan.h.d@swipnet.se>
5908         * nsterm.m (ns_do_open_file): New variable.
5909         (ns_term_init): Set ns_do_open_file to YES after run returns.
5910         (openFile, openTempFile, openFileWithoutUI, openFiles):
5911         Open files only if ns_do_open_file.
5913 2012-07-30  Paul Eggert  <eggert@cs.ucla.edu>
5915         * lisp.h (SWITCH_ENUM_CAST): Remove.  All uses removed.
5916         This no-op macro hasn't been needed for many years.
5917         * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
5919         Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
5920         * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
5921         * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
5922         gdb_make_enums_visible.
5923         (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
5924         (DIRECTORY_SEP): Now a constant, not a macro.
5926 2012-07-30  Eli Zaretskii  <eliz@gnu.org>
5928         * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
5929         w32_kbd_patch_key as the 2nd arg.  (Bug#12082)
5931         * w32term.c <w32_keyboard_codepage>: Renamed from
5932         keyboard_codepage and now external.  All users changed.
5934         * w32term.h: Add declaration of w32_keyboard_codepage.
5936         * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
5937         the codepage to translate keys to Unicode.  If this argument is
5938         -1, use the value returned by GetConsoleCP.  All callers changed.
5940 2012-07-30  Paul Eggert  <eggert@cs.ucla.edu>
5942         Update .PHONY listings in makefiles.
5943         * Makefile.in (.PHONY): Add all, mostlyclean, clean,
5944         bootstrap-clean, distclean, maintainer-clean, versioclean,
5945         extraclean, frc.
5947         * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
5948         This is a bit clearer.  Fix some commentary typos.
5950 2012-07-30  Glenn Morris  <rgm@gnu.org>
5952         * s/netbsd.h: Let configure include signal.h if needed.
5953         Remove file, which is now empty.
5955         * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
5956         Let configure set them.
5957         * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
5958         No more need to undefine.
5960 2012-07-30  Andreas Schwab  <schwab@linux-m68k.org>
5962         * keymap.c (Fkey_description): Don't remove 0x80 bit from
5963         non-single-byte char when adding meta modifier.  (Bug#12090)
5965 2012-07-30  Dmitry Antipov  <dmantipov@yandex.ru>
5967         Convert safe_call to use variable number of arguments.
5968         * xdisp.c (safe_call): Convert to use varargs.  Adjust users.
5969         (safe_call2): Fix comment.
5970         * lisp.h (safe_call): Adjust prototype.
5971         * coding.c (encode_coding_object): Change to use safe_call2.
5972         * xfaces.c (merge_face_heights): Change to use safe_call1.
5974 2012-07-30  Glenn Morris  <rgm@gnu.org>
5976         * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
5977         does that unconditionally.  Remove file, which is now empty.
5979         * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
5980         Remove empty files.
5982 2012-07-30  Paul Eggert  <eggert@cs.ucla.edu>
5984         Export to GDB most of lisp.h's remaining object-like macros.
5985         * lisp.h (min, max): Move earlier, because they're used earlier now.
5986         (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
5987         (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
5988         (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
5989         (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
5990         (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
5991         (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
5992         (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
5993         (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
5994         Now constants, for GDB.  They need not be macros.
5995         (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
5996         Now constants, for GDB, as well as macros, for static initializers.
5997         (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
5998         Move to after the definition of struct Lisp_Char_Table,
5999         since the former now needs that type defined.
6000         (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
6001         (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
6002         (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
6003         New enums, for gdb_make_enums_visible.
6004         (GLYPH_MODE_LINE_FACE): Remove; unused.
6005         * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
6006         (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
6007         CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
6008         enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
6009         enum maxargs, enum MAX_ALLOCA.
6010         (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
6011         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
6012         no longer needed, now that they are done in lisp.h.
6014 2012-07-30  Dmitry Antipov  <dmantipov@yandex.ru>
6016         Cleanup string bytes checking.
6017         * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove.  Convert
6018         all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
6019         (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
6020         (check_sblock, compact_small_strings): Simplify.
6022 2012-07-29  Paul Eggert  <eggert@cs.ucla.edu>
6024         * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
6025         These macros are confusing and no longer need to be defined, as
6026         the enum values now suffice.  All uses replaced with definiens.
6027         (Lisp_Int1, Lisp_String): Define directly; this is clearer.
6029 2012-07-29  Juanma Barranquero  <lekktu@gmail.com>
6031         * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
6032         ($(BLD)/w32console.$(O)): Update dependencies.
6034 2012-07-29  Dmitry Antipov  <dmantipov@yandex.ru>
6036         Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
6037         * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
6038         time.  Adjust users.
6039         (CHECK_CONS_LIST): Remove.  Convert all users to check_cons_list.
6041 2012-07-29  Jan Djärv  <jan.h.d@swipnet.se>
6043         * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
6044         setting sitelisp (Bug#12010).
6046 2012-07-29  Eli Zaretskii  <eliz@gnu.org>
6048         * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
6050         * w32heap.c (cache_system_info):
6051         * w32.c (sys_rename):
6052         * w32proc.c (find_child_console, sys_kill): All users changed.
6054 2012-07-29  Paul Eggert  <eggert@cs.ucla.edu>
6056         * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
6058 2012-07-29  Eli Zaretskii  <eliz@gnu.org>
6060         * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
6062 2012-07-29  Dmitry Antipov  <dmantipov@yandex.ru>
6064         Cleanup statistics calculation in Fgarbage_collect.
6065         * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
6066         Fix zombies percentage calculation.  Simplify elapsed time calculation.
6068 2012-07-29  Dmitry Antipov  <dmantipov@yandex.ru>
6070         Generalize marker debugging code under MARKER_DEBUG and use eassert.
6071         * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
6072         (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
6073         (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
6074         (replace_range, replace_range_2, del_range_2): Change to eassert.
6075         * marker.c (byte_char_debug_check): Adjust style.
6077 2012-07-29  Paul Eggert  <eggert@cs.ucla.edu>
6079         Don't use the abbreviation "win" to refer to Windows (Bug#10421).
6080         * regex.c (MAX_BUF_SIZE): Remove some incorrect and
6081         long-ago-commented-out code that talks about "WIN32".
6082         * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
6083         All uses changed.
6085 2012-07-28  Paul Eggert  <eggert@cs.ucla.edu>
6087         Use Gnulib stdalign module (Bug#9772, Bug#9960).
6088         * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
6089         Simplify by using alignof.
6090         (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
6091         * lisp.h: Include <stdalign.h>.
6092         (GCALIGNMENT): New macro and constant.
6093         (DECL_ALIGN): Remove.  All uses replaced by alignas (GCALIGNMENT).
6094         (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
6095         (stdalign): New macro, if not already defined.
6097 2012-07-28  Eli Zaretskii  <eliz@gnu.org>
6099         Fix non-ASCII input in non-GUI frames on MS-Windows.  (Bug#12055)
6100         * w32inevt.c: Include w32inevt.h.
6101         (w32_read_console_input): New inline function, calls either
6102         ReadConsoleInputA or ReadConsoleInputW, depending on the value of
6103         w32_console_unicode_input.
6104         (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
6105         (w32_kbd_patch_key, key_event): Use the codepage returned by
6106         GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
6107         (key_event): use uChar.UnicodeChar only if
6108         w32_console_unicode_input is non-zero.
6110         * w32console.c: Include w32heap.h.
6111         <w32_console_unicode_input>: New global variable.
6112         (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
6113         family of Windows, zero otherwise.
6115         * w32inevt.h: Declare w32_console_unicode_input.
6117         * xdisp.c (init_iterator): Don't reference tip_frame in a build
6118         --without-x.  (Bug#11742)
6120 2012-07-27  Paul Eggert  <eggert@cs.ucla.edu>
6122         Adjust GDB to reflect pvec_type changes (Bug#12036).
6123         * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
6124         2012-07-04 changes to pseudovector representation.
6125         Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
6127 2012-07-27  Michael Albinus  <michael.albinus@gmx.de>
6129         * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
6130         bus address.
6131         (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
6133 2012-07-27  Eli Zaretskii  <eliz@gnu.org>
6135         * alloc.c (listn): Fix the order the arguments are consed onto the
6136         list.
6138         * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
6139         enumeration constants, as PURE and HEAP are too general, and clash
6140         with other headers and sources, such as gmalloc.c and the
6141         MS-Windows system headers.  All users changed.
6143 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
6145         Revert last save_excursion_save and save_excursion_restore changes.
6146         * alloc.c, editfns.c, marker.c, lisp.h: Revert.
6147         Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
6149 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
6151         Fix recently-introduced typos in Windows port.
6152         Reported by Martin Rudalics <rudalics@gmx.at>.
6153         * w32.c (init_environment): Replace comma with semicolon.
6154         * w32fns.c (syms_of_w32fns): Add missing parenthesis.
6156 2012-07-27  Paul Eggert  <eggert@cs.ucla.edu>
6158         Improve GDB symbol export (Bug#12036).
6159         * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
6160         arms of an 'if', not using conditional expressions; otherwise GDB
6161         complains about the types in the unevaluated arm when the argument
6162         is an integer literal.
6163         (xgetint): Simplify expression.
6164         * alloc.c (gdb_make_enums_visible): New constant.  This ports to
6165         GCC 3.4.2 the export of symbols to GDB.  Problem reported by Eli
6166         Zaretskii in <http://bugs.gnu.org/12036#13>.
6167         * lisp.h (PUBLISH_TO_GDB): Remove.  All uses removed.  No longer
6168         needed now that we have gdb_make_enums_visible.
6169         (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
6170         (enum enum_USE_LSB_TAG):
6171         New enum types, packaging up enums that need to be exported to GDB.
6173 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
6175         Utility function to make a list from specified amount of objects.
6176         * lisp.h (enum constype): New datatype.
6177         (listn): New prototype.
6178         * alloc.c (listn): New function.
6179         (Fmemory_use_count, syms_of_alloc): Use it.
6180         * buffer.c (syms_of_buffer): Likewise.
6181         * callint.c (syms_of_callint): Likewise.
6182         * charset.c (define_charset_internal): Likewise.
6183         * coding.c (syms_of_coding): Likewise.
6184         * keymap.c (syms_of_keymap): Likewise.
6185         * search.c (syms_of_search): Likewise.
6186         * syntax.c (syms_of_syntax): Likewise.
6187         * w32.c (init_environment): Likewise.
6188         * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
6189         * xdisp.c (syms_of_xdisp): Likewise.
6190         * xfns.c (syms_of_xfns): Likewise.
6192 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
6194         Fast save_excursion_save and save_excursion_restore.
6195         * lisp.h (struct Lisp_Excursion): New data type.
6196         (PVEC_EXCURSION): New pseudovector type.
6197         (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
6198         to deal with it.  Adjust comments.
6199         (init_marker, attach_marker): New prototype.
6200         (unchain_marker): Adjust prototype.
6201         * marker.c (attach_marker): Change to global.
6202         (init_marker): New function.
6203         * alloc.c (Fmake_marker, build_marker): Use it.
6204         (build_marker): More easserts.
6205         (mark_object): Handle struct Lisp_Excursion.
6206         * editfns.c (save_excursion_save, save_excursion_restore):
6207         Reimplement to use struct Lisp_Excursion.  Add comments.
6209 2012-07-26  Paul Eggert  <eggert@cs.ucla.edu>
6211         Fix export of symbols to GDB (Bug#12036).
6212         * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
6213         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
6214         emacs.c, as this is a more-suitable home.  Had this been done earlier
6215         the fix for 12036 would have avoided some of the problems noted in
6216         <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
6217         would have been more obvious.
6218         * emacs.c: Do not include <verify.h>; no longer needed.
6219         (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
6220         (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
6221         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
6222         Remove; now done in lisp.h.
6223         * lisp.h (PUBLISH_TO_GDB): New macro.
6224         (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
6225         (DATA_SEG_BITS): Use it.
6226         (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
6227         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
6228         * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
6229         not be usable in #if.  This simplifies things.
6231 2012-07-26  Juanma Barranquero  <lekktu@gmail.com>
6233         * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
6235 2012-07-26  Paul Eggert  <eggert@cs.ucla.edu>
6237         Simplify export of symbols to GDB (Bug#12036).
6238         * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
6239         $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
6240         (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
6241         Adjust to changes in lisp.h and emacs.c, by using
6242         CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
6243         of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
6244         INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
6245         gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
6246         instead of gdb_valbits.
6247         (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
6248         PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
6249         instead of gdb_array_mark_flag.
6250         (xboolvector): Get size from $->size, not $->header.size.
6251         Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
6252         (xreload, hook-run, hookpost-run): Remove.
6253         * emacs.c: Include <verify.h>.
6254         (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
6255         (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
6256         Remove.
6257         (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
6258         (gdb_USE_LSB_TAG): New enum constants.
6259         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
6260         Also define these as enum constants, so they're visible to GDB.
6261         (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
6262         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
6263         as constants, so they're visible to GDB.
6264         * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
6265         (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
6266         Now enum constants, not macros, so they're visible to GDB.
6267         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
6268         more convenient now.  All uses changed.
6269         (VALMASK) [USE_LSB_TAG]: Also define in this case.
6270         * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
6272 2012-07-26  Dmitry Antipov  <dmantipov@yandex.ru>
6274         Explicitly free restriction data that are not needed anymore.
6275         * editfns.c (save_restriction_restore): Free restriction data.
6277 2012-07-26  Stefan Monnier  <monnier@iro.umontreal.ca>
6279         * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
6280         add argument, tune behavior, and adjust all callers.
6282 2012-07-25  Paul Eggert  <eggert@cs.ucla.edu>
6284         Use typedef for EMACS_INT, EMACS_UINT.
6285         * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
6286         than macros.  This simplifies debugging in the usual case, since
6287         it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
6288         and it allows expressions involving EMACS_INT casts.
6289         * .gdbinit (xreload): Simplify by using EMACS_INT cast.
6291 2012-07-25  Jan Djärv  <jan.h.d@swipnet.se>
6293         * nsterm.m (ns_read_socket): Return early if there is a modal
6294         window (Bug#12043).
6296 2012-07-25  Martin Rudalics  <rudalics@gmx.at>
6298         * frame.c (Fredirect_frame_focus): In doc-string don't mention
6299         that FOCUS-FRAME can be omitted.
6301 2012-07-25  Dmitry Antipov  <dmantipov@yandex.ru>
6303         Adjust buffer text indirection counters at the end of Fkill_buffer.
6304         * buffer.c (Fkill_buffer): Adjust indirection counters when the
6305         buffer is definitely dead.  This should really fix an issue reported
6306         by Christoph Scholtes again.  (Bug#12007).
6307         (init_buffer_once): Initialize indirection counters of
6308         buffer_defaults and buffer_local_symbols (for sanity and safety).
6310 2012-07-24  Eli Zaretskii  <eliz@gnu.org>
6312         * xdisp.c (init_iterator): Don't compute dimensions of truncation
6313         and continuation glyphs on tooltip frames, leave them at zero.
6314         Avoids continued lines in tooltips.  (Bug#11832)
6316 2012-07-24  Dmitry Antipov  <dmantipov@yandex.ru>
6318         Simplify copy_overlay.
6319         * buffer.c (copy_overlay): Simplify.  Use build_marker.
6320         * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
6322 2012-07-23  Eli Zaretskii  <eliz@gnu.org>
6324         * print.c (print_object): Don't crash when a frame's name is nil
6325         or invalid.  (Bug#12025)
6327         * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
6328         it signals an error when a tooltip frame is being created.
6330 2012-07-23  Dmitry Antipov  <dmantipov@yandex.ru>
6332         Cleanup miscellaneous objects allocation and initialization.
6333         * alloc.c (allocate_misc): Change to static.  Add argument to
6334         specify the subtype.  Adjust comment and users.
6335         (build_overlay): New function.
6336         * buffer.c (copy_overlays, Fmake_overlay): Use it.
6337         * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
6338         (allocate_misc): Remove prototype.
6339         (build_overlay): Add prototype.
6341 2012-07-23  Dmitry Antipov  <dmantipov@yandex.ru>
6343         Swap buffer text indirection counters in Fbuffer_swap_text.
6344         * buffer.c (Fbuffer_swap_text): Swap indirections too.
6345         This avoids crash reported by Christoph Scholtes at
6346         http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
6348 2012-07-22  Jan Djärv  <jan.h.d@swipnet.se>
6350         * nsmenu.m (Popdown_data): New struct.
6351         (pop_down_menu): p->pointer is Popdown_data.  Release the pool and
6352         free Popdown_data.
6353         (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
6354         (initWithContentRect): Make imgView and contentView non-static
6355         and autorelease them.  Also autorelease img and matrix (Bug#12005).
6356         (dealloc): Remove (Bug#12005).
6358 2012-07-22  Dmitry Antipov  <dmantipov@yandex.ru>
6360         Adjust consing_since_gc when objects are explicitly freed.
6361         * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
6362         (Fgarbage_collect): Use it.  Change minimum to 1/10 of default.
6363         (free_cons, free_misc): Subtract object size from consing_since_gc.
6365 2012-07-22  Dmitry Antipov  <dmantipov@yandex.ru>
6367         Simplify and cleanup markers positioning code.
6368         * marker.c (attach_marker): More useful eassert.
6369         (live_buffer, set_marker_internal): New function.
6370         (Fset_marker, set_marker_restricted): Use set_marker_internal.
6371         (set_marker_both, set_marker_restricted_both): Use live_buffer.
6373 2012-07-22  Paul Eggert  <eggert@cs.ucla.edu>
6375         * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
6376         as it's limited by the amount of memory, not by INT_MAX.
6378 2012-07-21  Eli Zaretskii  <eliz@gnu.org>
6380         * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
6381         in special-event-map.  See the discussion at
6382         http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
6383         for the reasons.
6385         * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
6386         info.dwItemData.  Fixes crashes on 64-bit Windows.
6387         Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
6389 2012-07-21  Jan Djärv  <jan.h.d@swipnet.se>
6391         * nsterm.m (accessibilityAttributeValue): New function.  (Bug#11134).
6392         (conversationIdentifier): Return value is NSInteger.
6393         * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
6395 2012-07-21  Chong Yidong  <cyd@gnu.org>
6397         * window.c (decode_any_window): Signal an error if the window is
6398         on a dead frame (Bug#11984).
6400 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
6402         Add indirection counting to speed up Fkill_buffer.
6403         * buffer.h (struct buffer): New member.
6404         * buffer.c (Fget_buffer_create): Set indirection counter to 0.
6405         (Fmake_indirect_buffer): Set indirection counter to -1, increment
6406         base buffer indirection counter.
6407         (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
6408         (Fkill_buffer): Adjust indirection counters as needed, don't walk
6409         through buffer list if indirection counter is 0.
6411 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
6413         Extend the value returned by Fgarbage_collect with heap statistics.
6414         * alloc.c (Qheap): New symbol.
6415         (syms_of_alloc): DEFSYM it.
6416         (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
6417         (Fmemory_free): Remove.
6418         (syms_of_alloc): Don't defsubr it.
6419         * buffer.c (Fcompact_buffer): Remove.
6420         (syms_of_buffer): Don't defsubr it.
6422 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
6424         Make maybe_gc inline.
6425         Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
6426         * lisp.h (consing_since_gc, gc_relative_threshold)
6427         (memory_full_cons_threshold): Revert declaration.
6428         (maybe_gc): Remove prototype, define as inline.
6429         * alloc.c: Remove old commented-out code.
6430         (consing_since_gc, gc_relative_threshold)
6431         (memory_full_cons_threshold): Revert to global.
6432         (maybe_gc): Remove.
6434 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
6436         Simple wrapper for make_unibyte_string, adjust font_open_by_name.
6437         * lisp.h (build_unibyte_string): New function.
6438         * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
6439         * sysdep.c, w32fns.c, xfns.c: Use it.
6440         * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
6441         of type Lisp_Object to avoid redundant calls to make_unibyte_string.
6442         Adjust users accordingly.
6443         * font.h (font_open_by_name): Adjust prototype.
6445 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
6447         Cleanup calls to Fgarbage_collect.
6448         * lisp.h (maybe_gc): New prototype.
6449         (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
6450         Remove declarations.
6451         * alloc.c (maybe_gc): New function.
6452         (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
6453         Make them static.
6454         * bytecode.c (MAYBE_GC): Use maybe_gc.
6455         * eval.c (eval_sub, Ffuncall): Likewise.
6456         * keyboard.c (read_char): Likewise.  Adjust call to maybe_gc
6457         to avoid dependency from auto-save feature.
6459 2012-07-19  Paul Eggert  <eggert@cs.ucla.edu>
6461         * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
6462         (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
6463         'for_each_per_buffer_object_at'.
6464         All uses changed.  It's better to use upper-case for macros that
6465         cannot be implemented as functions, to give the reader a clue
6466         that they're special.
6468 2012-07-19  Stefan Monnier  <monnier@iro.umontreal.ca>
6470         * alloc.c (Fgarbage_collect): Tweak docstring.
6472 2012-07-19  Dmitry Antipov  <dmantipov@yandex.ru>
6474         Tweak the value returned from Fgarbage_collect again.
6475         * alloc.c (Fgarbage_collect): New return value, as confirmed in
6476         http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
6477         Adjust documentation.
6478         (total_vector_bytes): Rename to total_vector_slots, adjust
6479         accounting.
6480         (total_free_vector_bytes): Rename to total_free_vector_slots,
6481         adjust accounting.
6482         (Qstring_bytes, Qvector_slots): New symbols.
6483         (syms_of_alloc): DEFSYM them.
6485 2012-07-19  Dmitry Antipov  <dmantipov@yandex.ru>
6487         Buffer compaction primitive which may be used from Lisp.
6488         * buffer.c (compact_buffer, Fcompact_buffer): New function.
6489         (syms_of_buffer): Register Fcompact_buffer.
6490         * alloc.c (Fgarbage_collect): Use compact_buffer.
6491         * buffer.h (compact_buffer): New prototype.
6492         (struct buffer_text): New member.
6494 2012-07-19  Dmitry Antipov  <dmantipov@yandex.ru>
6496         New macro to iterate over all buffers, miscellaneous cleanups.
6497         * lisp.h (all_buffers): Remove declaration.
6498         * buffer.h (all_buffers): Add declaration, with comment.
6499         (for_each_buffer): New macro.
6500         * alloc.c (Fgarbage_collect, mark_object): Use it.
6501         * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
6502         (init_buffer): Likewise.
6503         * data.c (Fset_default): Likewise.
6504         * coding.c (code_conversion_restore): Remove redundant check
6505         for dead buffer.
6506         * buffer.c (Fkill_buffer): Likewise.  Remove obsolete comment.
6508 2012-07-18  Andreas Schwab  <schwab@linux-m68k.org>
6510         Fix bug that created negative-length intervals.
6511         * intervals.c (merge_interval_right, merge_interval_left):
6512         Do not zero out this interval if it is absorbed by its children,
6513         as this interval's total length doesn't change in that case.  See
6514         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
6516 2012-07-18  Paul Eggert  <eggert@cs.ucla.edu>
6518         * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
6519         when invoking (make-bool-vector N t) and N is a positive
6520         multiple of 8 -- the last 8 bits were mistakenly cleared.
6522         Remove some struct layout assumptions in bool vectors.
6523         * alloc.c (bool_header_size): New constant.
6524         (header_size, word_size): Move earlier, as they're now used earlier.
6525         Use 'word_size' in a few more places, where it's appropriate.
6526         (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
6527         padding before the data member of a bool vector.
6528         (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
6529         than doing the check by hand with an abort ().
6531 2012-07-18  Stefan Monnier  <monnier@iro.umontreal.ca>
6533         * eval.c (Fdefvar): Don't check constants since we only set the var if
6534         it's not yet defined anyway (bug#11904).
6536         * lisp.h (last_undo_boundary): Declare new var.
6537         * keyboard.c (command_loop_1): Set it.
6538         * cmds.c (Fself_insert_command): Use it to only remove boundaries that
6539         were auto-added by the command loop (bug#11774).
6541 2012-07-18  Andreas Schwab  <schwab@linux-m68k.org>
6543         * w32font.c (Qsymbol): Remove local definition.
6544         (syms_of_w32font): Don't DEFSYM it.
6546 2012-07-18  Dmitry Antipov  <dmantipov@yandex.ru>
6548         Fix sweep_vectors to handle large bool vectors correctly.
6549         * alloc.c (sweep_vectors): Account total_vector_bytes for
6550         bool vectors larger than VBLOCK_BYTES_MAX.
6552 2012-07-18  Chong Yidong  <cyd@gnu.org>
6554         * frame.c (x_set_frame_parameters): Revert bogus change introduced
6555         in 2012-05-25 commit by Paul Eggert (Bug#11738).
6557 2012-07-18  Dmitry Antipov  <dmantipov@yandex.ru>
6559         Return more descriptive data from Fgarbage_collect.
6560         Suggested by Stefan Monnier in
6561         http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
6562         * alloc.c (bounded_number): New function.
6563         (total_buffers, total_vectors): New variable.
6564         (total_string_size): Rename to total_string_bytes, adjust users.
6565         (total_vector_size): Rename to total_vector_bytes, adjust users.
6566         (sweep_vectors): Account total_vectors and total_vector_bytes.
6567         (Fgarbage_collect): New return value.  Adjust documentation.
6568         (gc_sweep): Account total_buffers.
6569         (Fmemory_free, Fmemory_use_counts): Use bounded_number.
6570         (VECTOR_SIZE): Remove.
6571         * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
6572         (Qinterval, Qmisc): New symbols.
6573         (syms_of_data): Initialize them.
6574         * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
6575         (Qcons, Qbuffer): New declarations.
6577 2012-07-17  Paul Eggert  <eggert@cs.ucla.edu>
6579         * alloc.c (Fmemory_free): Account for memory-free's own storage.
6580         Round up, not down.  Improve doc.
6582 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
6584         Restore old code in allocate_string_data to avoid Faset breakage.
6585         Reported by Julien Danjou <julien@danjou.info> in
6586         http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
6587         * alloc.c (allocate_string_data): Restore old code with minor
6588         adjustments, fix comment to explain this subtle issue.
6590 2012-07-17  Eli Zaretskii  <eliz@gnu.org>
6592         Remove FILE_SYSTEM_CASE.
6593         * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
6595         * fileio.c (FILE_SYSTEM_CASE): Don't define.
6596         (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
6597         Fixes problems on MS-DOS with Vtemp_file_name_pattern when
6598         call-process-region passes it through expand-file-name.
6600         * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
6602 2012-07-17  Andreas Schwab  <schwab@linux-m68k.org>
6604         Fix crash when creating indirect buffer (Bug#11917)
6605         * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
6606         Don't handle unbound variables specially if non-zero.
6607         (Fbuffer_local_variables): Pass zero.
6608         (clone_per_buffer_values): Pass non-zero.
6610 2012-07-17  Andreas Schwab  <schwab@linux-m68k.org>
6612         * gnutls.c (emacs_gnutls_handshake): Revert last change.  Add QUIT
6613         to make the loop interruptible.
6615 2012-07-17  Andreas Schwab  <schwab@linux-m68k.org>
6617         * gnutls.c (emacs_gnutls_handshake): Only retry if
6618         GNUTLS_E_INTERRUPTED.
6620 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
6622         Cleanup and convert miscellaneous checks to eassert.
6623         * alloc.c (mark_interval): Fix comment, partially rephrase
6624         old comment from intervals.h (see below).
6625         * intervals.c (find_interval, adjust_intervals_for_insertion)
6626         (delete_interval, adjust_intervals_for_deletion)
6627         (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
6628         Convert to eassert.
6629         (adjust_intervals_for_insertion, make_new_interval):
6630         Remove obsolete and unused code.
6631         * intervals.h (struct interval): Remove obsolete comment.
6632         * textprotp.c (erase_properties): Remove unused code.
6633         (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
6634         (Fremove_list_of_text_properties): Convert to eassert.
6636 2012-07-17  Chong Yidong  <cyd@gnu.org>
6638         * editfns.c (Finsert_char): Doc fix.
6640 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
6642         Fix previous change to make Fmemory_free always accurate.
6643         * alloc.c (make_interval): Update total_free_intervals.
6644         (make_float): Likewise for total_free_floats.
6645         (free_cons, Fcons): Likewise for total_free_conses.
6646         (SETUP_ON_FREE_LIST, allocate_vector_from_block):
6647         Likewise for total_free_vector_bytes.
6648         (Fmake_symbol): Likewise for total_free_symbols.
6649         (bytes_free): Remove.
6651 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
6653         Simple free memory accounting feature.
6654         * alloc.c (bytes_free, total_free_vector_bytes): New variable.
6655         (sweep_vectors): Accumulate size of free vectors.
6656         (Fgarbage_collect): Setup bytes_free.
6657         (Fmemory_free): New function.
6658         (syms_of_alloc): Register it.
6660 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
6662         Cleanup overlays checking.
6663         * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
6664         * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
6665         eassert and OVERLAYP.
6666         (sort_overlays): Change to use OVERLAYP.
6668 2012-07-16  René Kyllingstad  <Rene@Kyllingstad.com>  (tiny change)
6670         * editfns.c (Finsert_char): Make it interactive, and make the
6671         second arg optional.  Copy interactive spec and docstring from
6672         ucs-insert.
6674 2012-07-17  Paul Eggert  <eggert@cs.ucla.edu>
6676         * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
6677         Unlike the other wrapped functions, fabs has an unspecified
6678         effect on errno.
6680 2012-07-16  Jan Djärv  <jan.h.d@swipnet.se>
6682         * nsterm.m (keyDown): Interpret flags without left/right bits
6683         as the left key (Bug#11670).
6685 2012-07-16  Dmitry Antipov  <dmantipov@yandex.ru>
6687         Remove empty and useless init functions.
6688         * lisp.h (init_character_once, init_fns, init_image)
6689         (init_filelock, init_sound): Remove prototype.
6690         * character.c (init_character_once): Remove.
6691         * filelock.c (init_filelock): Likewise.
6692         * fns.c (init_fns): Likewise.
6693         * image.c (init_image): Likewise.
6694         * sound.c (init_sound): Likewise.
6695         * emacs.c (main): Adjust accordingly.
6697 2012-07-16  Dmitry Antipov  <dmantipov@yandex.ru>
6699         * gtkutil.h: Tiny cleanups.
6700         (use_old_gtk_file_dialog): Remove useless declaration.
6701         (xg_uses_old_file_dialog): Add suggested const attribute.
6703 2012-07-15  Eli Zaretskii  <eliz@gnu.org>
6705         * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
6706         (bidi_paragraph_init): Use it to limit search forward for a strong
6707         directional character in abnormally large paragraphs full of
6708         neutral or weak characters.  (Bug#11943)
6710 2012-07-15  Stefano Facchini  <stefano.facchini@gmail.com>  (tiny change)
6712         * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
6713         the toolbar (Bug#9451).
6714         (xg_make_tool_item): Give the widget event box a transparent
6715         background.
6717 2012-07-15  Dmitry Antipov  <dmantipov@yandex.ru>
6719         Cleanup basic allocation variables and functions.
6720         * alloc.c (ignore_warnings, init_intervals, init_float)
6721         (init_cons, init_symbol, init_marker): Remove.
6722         (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
6723         (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
6724         (cons_block_index): Initialize to CONS_BLOCK_SIZE.
6725         (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
6726         (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
6727         (staticidx, init_alloc_once, init_strings, free_ablock):
6728         Remove redundant initialization.
6729         * fns.c (init_weak_hash_tables): Remove.
6730         * lisp.h (init_weak_hash_tables): Remove prototype.
6732 2012-07-15  Dmitry Antipov  <dmantipov@yandex.ru>
6734         Use zero_vector where appropriate.
6735         * alloc.c (zero_vector): Define as Lisp_Object.  Adjust users
6736         accordingly.
6737         * lisp.h (zero_vector): New declaration.
6738         * font.c (null_vector): Remove.
6739         (syms_of_font): Remove initialization and staticpro.
6740         (font_list_entities, font_find_for_lface): Change to use zero_vector.
6741         * keymap.c (Faccessible_keymaps): Likewise.
6743 2012-07-15  Leo Liu  <sdl.web@gmail.com>
6745         * fringe.c: Fix typo in comments.
6747 2012-07-14  Leo Liu  <sdl.web@gmail.com>
6749         * fringe.c: Add a new bitmap exclamation-mark.
6751 2012-07-14  Eli Zaretskii  <eliz@gnu.org>
6753         * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
6755         * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
6756         (HAVE_MENUS): Don't define, defined by editing config.in with
6757         msdos/sed2v2.inp.
6758         (GMALLOC_INHIBIT_VALLOC): Don't define.
6759         (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
6761 2012-07-14  Juanma Barranquero  <lekktu@gmail.com>
6763         * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
6765 2012-07-14  Glenn Morris  <rgm@gnu.org>
6767         * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
6768         * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
6769         Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
6771 2012-07-13  Glenn Morris  <rgm@gnu.org>
6773         * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
6775         * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
6776         * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
6778 2012-07-13  Jan Djärv  <jan.h.d@swipnet.se>
6780         * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
6781         (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
6782         (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
6783         (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
6784         where appropriate.
6785         (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
6786         as boolean expression.
6787         (x_set_window_size): Remove unused variable toolbar.
6788         (ns_get_color_default, ns_mod_to_lisp): Remove.
6789         (ns_mouse_position): Remove unused variables xchar and ychar.
6790         (ns_compute_glyph_string_overhangs): Remove unused variable face.
6791         (ns_set_vertical_scroll_bar): Remove unused variable count.
6792         (ns_delete_terminal): Remove unused variable i.
6793         (ns_term_init): Remove unused variables r, g and b.
6794         (mouseDown): Remove unused variable window.
6795         (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
6796         (initFrameFromEmacs): Remove unused variable vbextra.
6797         (mouseEntered): Remove unused variables p and dpyinfo.
6798         (mouseExited): Remove unused variables p and r.
6799         (ns_define_frame_cursor, ns_clear_frame_area)
6800         (ns_draw_window_cursor, ns_initialize_display_info): Make static.
6801         (menuDown): Assign [sender tag] to variable and cast the variable.
6803         * nsterm.h (menuDown): Add id as type to argument sender.
6804         (ns_display_info_for_name): Add Lisp_Object argument.
6805         (ns_term_init): Add Lisp_Object argument.
6806         (ns_map_event_to_object): Add void argument.
6807         (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
6808         prototype with arguments and only declare if __OBJC__.
6809         (nxatoms_of_nsselect): Add void argument.
6810         (ns_lisp_to_cursor_type): Add Lisp_Object argument.
6811         (ns_alloc_autorelease_pool): Add void argument.
6812         (ns_release_autorelease_pool): Add void* argument.
6813         (ns_get_defaults_value): Add const char* argument.
6815         * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
6816         (initFromContents): Use SSDATA where appropriate.
6817         (ns_update_menubar): Add braces to ambigous if-else.
6818         (initWithTitle): Put () around assignment in if statement.
6819         (ns_menu_show): Remove unused variables window and keymap.
6820         (update_frame_tool_bar): Remove unused variable selected_p.
6821         (initWithContentRect): Remove unused variable this_cmd_name.
6823         * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
6824         appropriate.
6825         (setXBMColor): Remove unused variable len.
6826         (setPixmapData): Put () around assignment in loop statement.
6828         * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
6829         (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
6830         where appropriate.
6831         (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
6832         around assignment in loop statement.
6833         (nsfont_open): Remove unused variable i.
6834         (nsfont_open): Remove unused variable len.
6835         (nsfont_draw): Remove unused variable cs.
6837         * nsfns.m (x_set_icon_name, ns_set_name_internal)
6838         (ns_set_name_as_filename, ns_implicitly_set_icon_type)
6839         (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
6840         (Fns_get_resource, Fns_set_resource, Fx_open_connection)
6841         (Fns_font_name, Fns_perform_service)
6842         (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
6843         (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
6844         (ns_set_name): Remove unused variable view.
6845         (x_set_menu_bar_lines): Remove unused variable olines.
6846         (x_set_tool_bar_lines): Remove unused variable root_window.
6847         (Fns_list_colors): Put () around assignment in while statement.
6848         (Fns_perform_service): Remove unused variable len.
6849         (Fns_display_usable_bounds): Remove unused variable top.
6850         (syms_of_nsfns): Remove unused variable i.
6852         * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
6853         memcpy (Bug#11907).
6855 2012-07-13  Kalle Kankare  <kalle.kankare@iki.fi>  (tiny change)
6857         * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
6858         and free it with DestroyExceptionInfo (Bug#11558).
6860 2012-07-13  Juanma Barranquero  <lekktu@gmail.com>
6862         * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
6863         (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
6864         Set here, not in nt/config.nt.
6866 2012-07-13  Eli Zaretskii  <eliz@gnu.org>
6868         * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
6869         cursor overflow into the last glyph on display line when the right
6870         fringe is off.  (Bug#11832)
6872 2012-07-13  Paul Eggert  <eggert@cs.ucla.edu>
6874         * xdisp.c (produce_special_glyphs): Now static.
6875         * dispextern.h (produce_special_glyphs): Remove decl.
6877 2012-07-13  Glenn Morris  <rgm@gnu.org>
6879         * s/bsd-common.h, s/cygwin.h: Remove empty files.
6880         * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
6882         * s/usg5-4-common.h (USG, USG5):
6883         * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
6884         * s/sol2-6.h (SOLARIS2):
6885         * s/irix6-5.h (IRIX6_5):
6886         * s/hpux10-20.h (USG, USG5, HPUX):
6887         * s/gnu-linux.h (USG, GNU_LINUX):
6888         * s/freebsd.h (BSD_SYSTEM):
6889         * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
6890         * s/cygwin.h (CYGWIN):
6891         * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
6892         * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
6894 2012-07-13  BT Templeton  <bpt@hcoop.net>  (tiny change)
6896         * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
6898 2012-07-13  Glenn Morris  <rgm@gnu.org>
6900         * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
6902         * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
6904         * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
6905         * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
6907 2012-07-12  Glenn Morris  <rgm@gnu.org>
6909         * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
6911         * process.c (init_process_emacs): Rename from init_process.
6912         The old name is also the name of a Mach system call.
6913         * lisp.h, emacs.c: Update for this name change.
6914         * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
6915         longer needed.
6917 2012-07-12  Eli Zaretskii  <eliz@gnu.org>
6919         * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
6920         memmove call that removes glyphs covered by the left truncation
6921         glyph.  Improve commentary.
6922         (display_line): Fix display of continuation glyphs on GUI frames
6923         when the right fringe is turned off and variable-size fonts are
6924         used in the window.  Move the code that appends a stretch glyph to
6925         produce_special_glyphs, so that it could be used for truncation
6926         and continuation glyphs alike.
6927         (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
6928         glyph of a suitably computed width, to align the special glyphs at
6929         the window margin.  Code moved from display_line.  (Bug#11832)
6931 2012-07-12  Glenn Morris  <rgm@gnu.org>
6933         * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
6935         * s/gnu-linux.h, s/hpux10-20.h:
6936         Do not unconditionally define HAVE_XRMSETDATABASE.
6938         * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
6940 2012-07-12  Paul Eggert  <eggert@cs.ucla.edu>
6942         Fix typos that broke OS X build.
6943         Reported by Randal L. Schwartz in
6944         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
6945         * nsterm.m (ns_timeout): Add missing local decl.
6946         (ns_get_color): snprintf -> sprintf, to fix typo.
6948 2012-07-12  Glenn Morris  <rgm@gnu.org>
6950         * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
6951         * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
6952         * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
6953         Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
6955         * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
6956         Move PTY_OPEN to configure.
6958         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6959         * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
6960         * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
6962 2012-07-12  Dmitry Antipov  <dmantipov@yandex.ru>
6964         Use empty_unibyte_string where applicable.
6965         * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
6966         * lread.c (read1): Likewise.
6967         * xsettings.c (syms_of_xsettings): Likewise.
6969 2012-07-12  Glenn Morris  <rgm@gnu.org>
6971         * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
6972         * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
6973         * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
6974         * s/hpux10-20.h (RUN_TIME_REMAP):
6975         * s/bsd-common.h (TABDLY): Move to configure.
6977         * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
6979         * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
6981         * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
6982         (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
6984         * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
6986         * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
6987         * s/template.h: Move NARROWPROTO to configure.
6989 2012-07-11  Glenn Morris  <rgm@gnu.org>
6991         * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
6992         unused since 2011-01-17 change to systty.h.
6994         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
6995         * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
6996         Move HAVE_PTYS and HAVE_SOCKETS to configure.
6998 2012-07-11  Paul Eggert  <eggert@cs.ucla.edu>
7000         * s/sol2-6.h (HAVE_LIBKSTAT): Remove.  (Bug#11914)
7002 2012-07-11  Glenn Morris  <rgm@gnu.org>
7004         * s/darwin.h, s/gnu-linux.h, s/template.h:
7005         Move INTERRUPT_INPUT to configure.
7007 2012-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
7009         Minor adjustments to interning code.
7010         * lisp.h (intern, intern_c_string): Redefine as static inline
7011         wrappers for intern_1 and intern_c_string_1, respectively.
7012         (intern_1, intern_c_string_1): Rename prototypes.
7013         * lread.c (intern_1, intern_c_string_1, oblookup):
7014         Simplify Vobarray checking.
7015         * font.c (font_intern_prop): Likewise.  Adjust comment.
7016         * w32font.c (intern_font_name): Likewise.
7018 2012-07-11  Andreas Schwab  <schwab@linux-m68k.org>
7020         * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
7022         * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
7023         of Fcar/Fcdr if possible.
7024         * font.c (check_otf_features): Likewise.
7025         * fontset.c (Fnew_fontset): Likewise.
7026         * gnutls.c (Fgnutls_boot): Likewise.
7027         * minibuf.c (read_minibuf): Likewise.
7028         * msdos.c (IT_set_frame_parameters): Likewise.
7029         * xmenu.c (Fx_popup_dialog): Likewise.
7030         * w32menu.c (Fx_popup_dialog): Likewise.
7032 2012-07-11  Glenn Morris  <rgm@gnu.org>
7034         * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
7035         since nothing has defined it on these platforms.
7037         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
7038         * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
7040         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7041         * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
7042         Move CLASH_DETECTION to configure.
7044         * s/gnu.h: Remove file, which is now empty.
7046         * s/gnu.h, s/gnu-linux.h:
7047         Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
7049 2012-07-11  John Wiegley  <johnw@newartisans.com>
7051         * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
7052         function attribute, so we only use it if it exists in the
7053         compiler.
7055 2012-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
7057         Avoid call to strlen in fast_c_string_match_ignore_case.
7058         * search.c (fast_c_string_match_ignore_case): Change to use
7059         length argument.  Adjust users accordingly.
7060         * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
7062 2012-07-11  Paul Eggert  <eggert@cs.ucla.edu>
7064         Assume mkdir, rmdir.
7065         * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
7066         * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
7068         Assume rename.
7069         * sysdep.c (rename) [!HAVE_RENAME]: Remove.
7071         Assume perror.
7072         * s/hpux10-20.h (HAVE_PERROR): Remove.
7073         * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
7074         Remove dummy definition, as this problem was obsolete long ago.
7076         Assume strerror.
7077         * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
7079 2012-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
7081         Avoid calls to strlen in font processing functions.
7082         * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
7083         (font_open_by_name): Change to use length argument.
7084         Adjust users accordingly.
7085         * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
7086         Adjust prototypes.
7087         * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
7088         Change to return ptrdiff_t.
7089         (xfont_list_pattern, xfont_match): Use length returned by
7090         xfont_decode_coding_xlfd.
7091         * xfns.c (x_default_font_parameter): Omit useless xstrdup.
7093 2012-07-11  Glenn Morris  <rgm@gnu.org>
7095         * s/darwin.h, s/freebsd.h, s/netbsd.h:
7096         Move DONT_REOPEN_PTY to configure.
7098         * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
7099         * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
7101 2012-07-10  Paul Eggert  <eggert@cs.ucla.edu>
7103         Remove "#define unix" that is no longer needed (Bug#11905).
7104         * s/aix4-2.h (unix): Remove; no longer needed.
7106         EMACS_TIME simplification (Bug#11875).
7107         This replaces macros (which typically do not work in GDB)
7108         with functions, typedefs and enums, making the code easier to debug.
7109         The functional style also makes code easier to read and maintain.
7110         * systime.h: Include <sys/time.h> on all hosts, not just if
7111         WINDOWSNT, since 'struct timeval' is needed in general.
7112         (EMACS_TIME): Now a typedef, not a macro.
7113         (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
7114         not macros.
7115         (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
7116         (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
7117         (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
7118         (EMACS_TIME_LE): Now functions, not macros.
7119         (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
7120         (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
7121         which are not functions.  All uses rewritten to use:
7122         (make_emacs_time): New function.
7123         (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
7124         (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
7125         not functions.  All uses rewritten to use the following, respectively:
7126         (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
7127         (add_emacs_time, sub_emacs_time): New functions.
7128         * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
7129         * fileio.c (Fcopy_file):
7130         * xterm.c (XTflash): Get the current time closer to when it's used.
7131         * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
7133         * bytecode.c (targets): Suppress -Woverride-init warnings.
7135         Simplify by avoiding confusing use of strncpy etc.
7136         * doc.c (Fsnarf_documentation):
7137         * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
7138         * frame.c (Fmake_terminal_frame):
7139         * gtkutil.c (get_utf8_string):
7140         * lread.c (openp):
7141         * nsmenu.m (ns_update_menubar):
7142         * regex.c (regerror):
7143         Prefer memcpy to strncpy and strncat when either will do.
7144         * fileio.c (Fsubstitute_in_file_name):
7145         * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
7146         (menu_separator_name_p):
7147         * nsmenu.m (ns_update_menubar):
7148         Prefer memcmp to strncmp when either will do.
7149         * nsterm.m: Include <ftoastr.h>.
7150         (ns_get_color):
7151         * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
7152         Prefer snprintf to strncpy.
7153         * nsterm.m (ns_term_init):
7154         * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
7155         * nsterm.m (ns_term_init):
7156         Avoid the need for strncpy, by using build_string or
7157         make_unibyte_string directly.  Use dtoastr, not snprintf.
7158         * process.c (Fmake_network_process): Diagnose service names that
7159         are too long, rather than silently truncating them or creating
7160         non-null-terminated names.
7161         (Fnetwork_interface_info): Likewise, for interface names.
7162         * sysdep.c (system_process_attributes) [GNU_LINUX]:
7163         Prefer sprintf to strncat.
7164         * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
7165         Prefer vsnprintf to vsprintf + strncpy.
7167 2012-07-10  Glenn Morris  <rgm@gnu.org>
7169         * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
7170         Clarify fallback case.
7172 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
7174         Use XCAR and XCDR instead of Fcar and Fcdr where possible.
7175         * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
7176         * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
7177         * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7178         where argument type is known to be a Lisp_Cons.
7180 2012-07-10  Tom Tromey  <tromey@redhat.com>
7182         * bytecode.c (BYTE_CODE_THREADED): New macro.
7183         (BYTE_CODES): New macro.  Replaces all old byte-code defines.
7184         (enum byte_code_op): New type.
7185         (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
7186         (exec_byte_code): Use them.  Use token threading when applicable.
7188 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
7190         Optimize pure C strings initialization.
7191         * lisp.h (make_pure_string): Fix prototype.
7192         (build_pure_c_string): New function, defined as static inline.  This
7193         provides a better opportunity to optimize away calls to strlen when
7194         the function is called with compile-time constant argument.
7195         * alloc.c (make_pure_c_string): Fix comment.  Change to add nchars
7196         argument, adjust users accordingly.  Use build_pure_c_string where
7197         appropriate.
7198         * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
7199         * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
7200         * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
7202 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
7204         Avoid calls to strlen in miscellaneous functions.
7205         * buffer.c (init_buffer): Use precalculated len, adjust if needed.
7206         * font.c (Ffont_xlfd_name): Likewise.  Change to call make_string.
7207         * lread.c (openp): Likewise.
7209 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
7211         Avoid calls to strlen in path processing functions.
7212         * fileio.c (file_name_as_directory): Add comment.  Change to add
7213         srclen argument and return the length of result.  Adjust users
7214         accordingly.
7215         (directory_file_name): Fix comment.  Change to add srclen argument,
7216         swap 1st and 2nd arguments to obey the common convention.
7217         Adjust users accordingly.
7218         * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
7220 2012-07-10  Glenn Morris  <rgm@gnu.org>
7222         * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
7223         Move PENDING_OUTPUT_COUNT definition to configure.
7225         * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
7226         * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
7227         * s/gnu.h (DATA_START): Move definitions to configure.
7229         * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
7230         We include usg5-4-common.h, which defines them both.
7232         * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
7233         O_RDONLY already includes it).
7235         Stop ns builds setting the EMACSLOADPATH environment variable.
7236         * nsterm.m (ns_load_path): Rename from ns_init_paths.
7237         Now it does not set EMACSLOADPATH, just returns the load-path string.
7238         * nsterm.h: Update accordingly.
7239         * lread.c [HAVE_NS]: Include nsterm.h.
7240         (init_lread) [HAVE_NS]: Use ns_load_path.
7241         * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
7243 2012-07-09  Glenn Morris  <rgm@gnu.org>
7245         * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
7246         since the included bsd-common.h does so.
7248         Stop ns builds setting the EMACSPATH environment variable.
7249         * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
7250         (ns_init_paths): Do not set EMACSPATH.
7251         * nsterm.h (ns_exec_path): Add it.
7252         * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
7253         Use ns_exec_path.
7255         * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
7257 2012-07-09  Paul Eggert  <eggert@cs.ucla.edu>
7259         * process.c (wait_reading_process_output): 'waitchannels' was unset
7260         when read_kbd || !NILP (wait_for_cell); fix this.
7262         Add GCC-style 'const' attribute to functions that can use it.
7263         * character.h (char_resolve_modifier_mask):
7264         * keyboard.h (make_ctrl_char):
7265         * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
7266         (init_character_once, next_almost_prime, init_fns, init_image)
7267         (flush_pending_output, init_sound):
7268         * mem-limits.h (start_of_data):
7269         * menu.h (finish_menu_items):
7270         Add ATTRIBUTE_CONST.
7271         * emacs.c (DEFINE_DUMMY_FUNCTION):
7272         Declare the dummy function with ATTRIBUTE_CONST.
7273         * lisp.h (Fbyteorder, Fmax_char, Fidentity):
7274         Add decls with ATTRIBUTE_CONST.
7276         Minor improvements to make_formatted_string.
7277         * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
7278         where int is good enough, as vsprintf returns an int.
7279         * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
7281 2012-07-09  Dmitry Antipov  <dmantipov@yandex.ru>
7283         Use make_formatted_string to avoid double length calculation.
7284         * lisp.h (make_formatted_string): New prototype.
7285         * alloc.c (make_formatted_string): New function.
7286         * buffer.c (Fgenerate_new_buffer_name): Use it.
7287         * dbusbind.c (syms_of_dbusbind): Likewise.
7288         * editfns.c (Fcurrent_time_zone): Likewise.
7289         * filelock.c (get_boot_time): Likewise.
7290         * frame.c (make_terminal_frame, set_term_frame_name)
7291         (x_report_frame_params): Likewise.
7292         * image.c (gs_load): Likewise.
7293         * minibuf.c (get_minibuffer): Likewise.
7294         * msdos.c (dos_set_window_size): Likewise.
7295         * process.c (make_process): Likewise.
7296         * xdisp.c (ensure_echo_area_buffers): Likewise.
7297         * xsettings.c (apply_xft_settings): Likewise.
7299 2012-07-09  Glenn Morris  <rgm@gnu.org>
7301         Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
7302         * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
7303         (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
7304         * nsterm.h (ns_etc_directory): Add it.
7305         * callproc.c [HAVE_NS]: Include nsterm.h.
7306         (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
7308 2012-07-09  Dmitry Antipov  <dmantipov@yandex.ru>
7310         Move marker debugging code under MARKER_DEBUG.
7311         * marker.c (MARKER_DEBUG): Move marker debugging code under
7312         #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
7313         for bootstrap with --enable-checking (~3x slowdown reported
7314         by Juanma Barranquero <lekktu@gmail.com>).
7315         (verify_bytepos): Move under #ifdef MARKER_DEBUG.
7317 2012-07-08  Paul Eggert  <eggert@cs.ucla.edu>
7319         * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
7320         See <http://bugs.gnu.org/11825#29>.
7322 2012-07-08  Eli Zaretskii  <eliz@gnu.org>
7324         * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
7325         has no font, use the frame's font.  (Bug#11813)
7326         (display_line): Add commentary about displaying truncation glyphs
7327         on GUI frames.
7328         (produce_special_glyphs): Move here from term.c.
7330         * term.c (produce_special_glyphs): Move to xdisp.c.
7332         * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
7333         section.
7335 2012-07-07  Andreas Schwab  <schwab@linux-m68k.org>
7337         * xdisp.c (display_line): Avoid warning about implicit declaration
7338         of FRAME_FONT.
7340         * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
7342         * lisp.h: Remove empty conditional.
7344 2012-07-07  Paul Eggert  <eggert@cs.ucla.edu>
7346         * lread.c (load_path_check): Now static.
7348         Fix some minor --with-ns problems found by static checking.
7349         * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
7350         (x_set_font) [!HAVE_X_WINDOWS]:
7351         * image.c (xpm_load_image) [HAVE_NS]:
7352         (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
7353         (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
7354         Remove unused local.
7355         (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
7356         (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
7357         * image.c (x_create_bitmap_from_file) [HAVE_NS]:
7358         (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
7359         * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
7360         * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
7361         Fix pointer signedness problem.
7362         * xfaces.c (FRAME_X_FONT_TABLE):
7363         * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
7365 2012-07-07  Glenn Morris  <rgm@gnu.org>
7367         * lread.c (load_path_check): New function, split from init_lread.
7368         (init_lread): Reorganize.  Motivation:
7369         If EMACSLOADPATH is set, check/warn about that rather than the
7370         defaults, which we are not going to use.  Hence we can remove
7371         the turn_off_warning and WINDOWSNT || HAVE_NS tests.
7372         Don't warn if site-lisp directories are missing.
7373         If not installed, start from a blank load-path, since
7374         PATH_LOADSEARCH refers to the eventual installation directories.
7376 2012-07-07  Eli Zaretskii  <eliz@gnu.org>
7378         Support truncation and continuation glyphs on GUI frames, when
7379         fringes are disabled.  (Bug#11832)
7380         * xdisp.c (init_iterator): Get dimensions of truncation and
7381         continuation glyphs even if on GUI frames.
7382         Adjust it->last_visible_x on GUI frames when the left or right fringes,
7383         or both, are absent.
7384         (start_display, move_it_in_display_line_to): Handle the case of a
7385         GUI frame without a fringe to display continuation or truncation
7386         glyphs.
7387         (insert_left_trunc_glyphs): Support GUI frames: make sure
7388         truncation glyphs overwrite enough glyphs from the current line to
7389         have sufficient space in pixels.
7390         (display_line): Support truncation and continuation glyphs on GUI
7391         frames.  If some spare pixels are left on the line after inserting
7392         the truncation glyphs, fill that space with a stretch glyph of a
7393         suitably computed width.
7395         * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
7396         produce_glyphs, to support GUI sessions.
7398 2012-07-07  Paul Eggert  <eggert@cs.ucla.edu>
7400         * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
7402         * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
7404         Do not require float-time's arg to fit in time_t (Bug#11825).
7405         This works better on hosts where time_t is unsigned, and where
7406         float-time is applied to the (negative) difference between two times.
7407         * editfns.c (decode_time_components): Last arg is now double *,
7408         not int *, and means to store all the result as a double, without
7409         worrying about whether the seconds part fits in time_t.
7410         All callers changed.
7411         (lisp_time_argument): Remove last int * arg, as it's no longer needed.
7412         All callers changed.
7413         (Ffloat_time): Do not fail merely because the specified time falls
7414         outside of time_t range.
7416 2012-07-07  Glenn Morris  <rgm@gnu.org>
7418         * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
7419         * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
7420         * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
7422 2012-07-07  Juanma Barranquero  <lekktu@gmail.com>
7424         * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
7425         Update dependencies.
7427         * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
7429 2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>
7431         Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
7432         * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
7433         * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
7434         * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
7435         * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
7436         * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
7438         * xfont.c (compare_font_names): Redo to omit the need for casts.
7440 2012-07-06  Andreas Schwab  <schwab@linux-m68k.org>
7442         * xfns.c (Fx_change_window_property): Doc fix.
7443         * w32fns.c (Fx_change_window_property): Doc fix.
7445         * w32fns.c (Fx_window_property): Accept the same arguments as the
7446         X Windows version.  Doc fix.
7447         * xfns.c (Fx_window_property): Doc fix.  (Bug#11870)
7449 2012-07-06  Juanma Barranquero  <lekktu@gmail.com>
7450             Eli Zaretskii  <eliz@gnu.org>
7452         * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
7453         Windows-specific code from nt/config.nt moved here.
7454         Obsolete settings removed.
7456 2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>
7458         * process.c: Avoid unnecessary calls to gettime.
7459         (wait_reading_process_output): Don't get the time of day
7460         when gobbling data immediately and not waiting, as there's no need
7461         for it in that case.  This removes a FIXME.
7463 2012-07-06  Jan Djärv  <jan.h.d@swipnet.se>
7465         * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
7466         is defined (Bug#11768).
7468 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
7470         Fix marker debugging code.
7471         * marker.c (byte_char_debug_check): Do not perform the check
7472         if buffer is not multibyte.
7473         (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
7474         Call byte_char_debug_check with correct arguments.
7476 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
7478         Compile marker debugging code only if ENABLE_CHECKING is defined.
7479         * marker.c (byte_char_debug_check, count_markers):
7480         Use only if ENABLE_CHECKING is defined.
7481         (byte_debug_flag): Remove.
7482         (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
7483         Always call byte_char_debug_check if ENABLE_CHECKING is defined.
7485 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
7487         Avoid code repetition in marker-related functions.
7488         * marker.c (attach_marker): New function.
7489         (Fset_marker, set_marker_restricted, set_marker_both)
7490         (set_marker_restricted_both): Use it.
7491         (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
7492         Consistently rename charno to charpos.
7493         (marker_position): Add eassert.
7494         (marker_byte_position): Convert to eassert.
7496 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
7498         Simplify list operations in unchain_overlay and unchain_marker.
7499         * buffer.c (unchain_overlay): Simplify.  Add comment.
7500         * marker.c (unchain_marker): Simplify.  Fix comments.
7502 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
7504         Introduce fast path for the widely used marker operation.
7505         * alloc.c (build_marker): New function.
7506         * lisp.h (build_marker): New prototype.
7507         * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
7508         * composite.c (autocmp_chars): Likewise.
7509         * editfns.c (buildmark): Remove.
7510         (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
7511         (save_restriction_save): Use build_marker.
7512         * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
7513         * window.c (save_window_save): Likewise.
7515 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
7517         Do not use Fdelete_overlay in delete_all_overlays
7518         to avoid redundant calls to unchain_overlay.
7519         * buffer.c (drop_overlay): New function.
7520         (delete_all_overlays, Fdelete_overlay): Use it.
7521         * minibuf.c (get_minibuffer): Fix comment.
7523 2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>
7525         Port to OpenBSD 5.1 amd64.
7526         * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
7527         This is needed for OpenBSD, and should be harmless on all BSD systems.
7528         Also, include <sys/sysctl.h>, as it should be available on all
7529         BSD_SYSTEM hosts given that we're already calling sysctl in that case.
7530         (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
7531         use p_pid member, not kp_proc.pid.
7533 2012-07-06  Glenn Morris  <rgm@gnu.org>
7535         * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
7537 2012-07-05  Paul Eggert  <eggert@cs.ucla.edu>
7539         More xmalloc and related cleanup.
7540         * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
7541         * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
7542         * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
7543         * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
7544         * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
7545         * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
7546         * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
7547         * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
7548         * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
7549         * xterm.c:
7550         Omit needless casts involving void * pointers and allocation.
7551         Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
7552         as the former is more robust if P's type is changed.
7553         Prefer xzalloc to xmalloc + memset 0.
7554         Simplify malloc-or-realloc to realloc.
7555         Don't worry about xmalloc returning a null pointer.
7556         Prefer xstrdup to xmalloc + strcpy.
7557         * editfns.c (Fmessage_box): Grow message_text by at least 80 when
7558         growing it.
7559         * keyboard.c (apply_modifiers_uncached): Prefer local array to
7560         alloca of a constant.
7562 2012-07-05  Eli Zaretskii  <eliz@gnu.org>
7564         * xdisp.c (display_line): Fix horizontal pixel coordinates when
7565         hscroll is larger than the line width.  Fixes long and futile
7566         looping inside extend_face_to_end_of_line (on a TTY) producing
7567         glyphs that are not needed and thrown away.
7569 2012-07-05  Dmitry Antipov  <dmantipov@yandex.ru>
7571         * marker.c (set_marker_restricted_both): Simplify by using
7572         clip_to_bounds.
7574 2012-07-05  Paul Eggert  <eggert@cs.ucla.edu>
7576         * editfns.c (region_limit): Simplify by using clip_to_bounds.
7578 2012-07-05  Jan Djärv  <jan.h.d@swipnet.se>
7580         * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
7581         not defined (Bug#11768).
7582         (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
7583         (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
7584         (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
7585         followed by gtk_box_set_homogeneous (Bug#11768).
7586         (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
7587         (update_theme_scrollbar_width, xg_create_scroll_bar):
7588         Use gtk_scrollbar_new (Bug#11768).
7589         (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
7590         (is_box_type): New function (Bug#11768).
7591         (xg_tool_item_stale_p): Call is_box_type.
7592         (xg_initialize): Get settings by calling gtk_settings_get_for_screen
7593         with default display (Bug#11768).
7595 2012-07-05  Eli Zaretskii  <eliz@gnu.org>
7597         * xdisp.c (window_hscroll_limited): New function.
7598         (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
7599         coordinates when window's hscroll is set to insanely large
7600         values.  (Bug#11857)
7602 2012-07-05  Juanma Barranquero  <lekktu@gmail.com>
7604         * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
7605         ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
7607 2012-07-05  Dmitry Antipov  <dmantipov@yandex.ru>
7609         Cleanup xmalloc.
7610         * lisp.h (xzalloc): New prototype.  Omit needless casts.
7611         * alloc.c (xzalloc): New function.  Omit needless casts.
7612         * charset.c: Omit needless casts.  Convert all calls to
7613         xmalloc with following memset to xzalloc.
7614         * dispnew.c: Likewise.
7615         * fringe.c: Likewise.
7616         * image.c: Likewise.
7617         * sound.c: Likewise.
7618         * term.c: Likewise.
7619         * w32fns.c: Likewise.
7620         * w32font.c: Likewise.
7621         * w32term.c: Likewise.
7622         * xfaces.c: Likewise.
7623         * xfns.c: Likewise.
7624         * xterm.c: Likewise.
7625         * atimer.c: Omit needless casts.
7626         * buffer.c: Likewise.
7627         * callproc.c: Likewise.
7628         * ccl.c: Likewise.
7629         * coding.c: Likewise.
7630         * composite.c: Likewise.
7631         * doc.c: Likewise.
7632         * doprnt.c: Likewise.
7633         * editfns.c: Likewise.
7634         * emacs.c: Likewise.
7635         * eval.c: Likewise.
7636         * filelock.c: Likewise.
7637         * fns.c: Likewise.
7638         * gtkutil.c: Likewise.
7639         * keyboard.c: Likewise.
7640         * lisp.h: Likewise.
7641         * lread.c: Likewise.
7642         * minibuf.c: Likewise.
7643         * msdos.c: Likewise.
7644         * print.c: Likewise.
7645         * process.c: Likewise.
7646         * region-cache.c: Likewise.
7647         * search.c: Likewise.
7648         * sysdep.c: Likewise.
7649         * termcap.c: Likewise.
7650         * terminal.c: Likewise.
7651         * tparam.c: Likewise.
7652         * w16select.c: Likewise.
7653         * w32.c: Likewise.
7654         * w32reg.c: Likewise.
7655         * w32select.c: Likewise.
7656         * w32uniscribe.c: Likewise.
7657         * widget.c: Likewise.
7658         * xdisp.c: Likewise.
7659         * xmenu.c: Likewise.
7660         * xrdb.c: Likewise.
7661         * xselect.c: Likewise.
7663 2012-07-05  Paul Eggert  <eggert@cs.ucla.edu>
7665         * fileio.c (time_error_value): Check the right error number.
7666         Problem reported by Troels Nielsen in
7667         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
7669 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
7671         * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
7672         This should be fixed in a better way; see Eli Zaretskii in
7673         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
7674         (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
7676         * fileio.c (time_error_value): Rename from special_mtime.
7677         The old name's problems were noted by Eli Zaretskii in
7678         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
7680         * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
7681         This variable's comment says Emacs needs at least one GDB-visible
7682         symbol of type enum pvec_type, to work around GDB problems.
7683         The symbol's value doesn't matter.
7685         * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
7686         that causes compilation to fail on pre-C99 compilers.
7688 2012-07-04  Juanma Barranquero  <lekktu@gmail.com>
7690         * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
7691         (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
7693 2012-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
7695         * buffer.c (init_buffer_once): Fix initialization of
7696         headers for buffer_defaults and buffer_local_symbols.
7697         Reported by Juanma Barranquero <lekktu@gmail.com>.
7699 2012-07-04  Stefan Monnier  <monnier@iro.umontreal.ca>
7701         Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
7702         * lisp.h (enum pvec_type): Use fewer bits.
7703         (PSEUDOVECTOR_SIZE_BITS): New constant.
7704         (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
7705         (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
7706         change in pvec_type.
7707         (PSEUDOVECTOR_TYPEP): New macro.
7708         (TYPED_PSEUDOVECTORP): Use it.
7709         * fns.c (internal_equal): Adapt code to extract pvectype.
7710         * emacs.c (gdb_pvec_type): Update type.
7711         * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
7712         (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
7713         (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
7714         (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
7715         (sweep_vectors): Use it.  Use local var `total_bytes' instead of
7716         abusing vector->header.next.nbytes.
7717         (live_vector_p): Use PVEC_TYPE.
7718         (mark_object): Adapt code to extract pvectype.  Use switch.
7720 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
7722         * doprnt.c (doprnt): Don't assume string length fits in 'int'.
7723         Tighten new eassert a bit.
7725 2012-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
7727         Fix compilation with --enable-gcc-warnings and -O1
7728         optimization level.
7729         * doprnt.c (doprnt): Change type of tem to int, initialize
7730         to avoid compiler warning.  Add eassert.
7731         * search.c (simple_search): Initialize match_byte to avoid
7732         compiler warning.  Add eassert.
7734 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
7736         Avoid weird behavior with large horizontal scrolls.
7737         Without this change, for example, large hscroll values would
7738         mess up Emacs's display on Fedora 15 x86, presumably due to
7739         overflows in int calculations in the display code.
7740         Also, if buffers had long lines, Emacs would freeze.
7741         * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
7742         (set_window_hscroll): New function, containing the old guts of
7743         Fset_window_hscroll.  Return the clipped value.
7744         (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
7745         This avoids the need to check against PTRDIFF_MAX.
7747         * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
7749 2012-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
7751         * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
7753 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
7755         * regex.c: Suppress GCC warning on RHEL 6.  (Bug#11207)
7756         Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
7757         since GCC 4.4.6 issues a bogus warning for them.
7759         Fix bugs in file timestamp newness comparisons.
7760         * fileio.c (Ffile_newer_than_file_p):
7761         * lread.c (Fload): Use full timestamp resolution of files,
7762         not just the 1-second resolution, so that files that are only
7763         slightly newer still count as newer.
7764         * fileio.c (Ffile_newer_than_file_p): Don't assume file
7765         timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
7767 2012-07-03  Paul Eggert  <eggert@cs.ucla.edu>
7769         * fileio.c: Improve handling of file time marker.  (Bug#11852)
7770         (special_mtime): New function.
7771         (Finsert_file_contents, Fverify_visited_file_modtime):
7772         Use it to set special mtime values consistently.
7774 2012-07-03  Andreas Schwab  <schwab@linux-m68k.org>
7776         * fileio.c (Finsert_file_contents): Properly handle st_mtime
7777         marker for non-existing file.  (Bug#11852)
7779 2012-07-03  Glenn Morris  <rgm@gnu.org>
7781         * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
7782         and did not make it into globals.h).
7784 2012-07-03  Tom Tromey  <tromey@redhat.com>
7786         * window.c (Fset_window_margins, Fset_window_fringes)
7787         (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
7788         * textprop.c (Fprevious_property_change): No longer static.
7789         * syntax.c (Fsyntax_table_p): No longer static.
7790         * process.c (Fget_process, Fprocess_datagram_address): No longer
7791         static.
7792         * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
7793         * keyboard.c (Fcommand_execute): No longer static.
7794         Remove EXFUN.
7795         * insdel.c (Fcombine_after_change_execute): No longer static.
7796         * image.c (Finit_image_library): No longer static.
7797         * fileio.c (Fmake_symbolic_link): No longer static.
7798         * eval.c (Ffetch_bytecode): No longer static.
7799         * editfns.c (Fuser_full_name): No longer static.
7800         * doc.c (Fdocumentation_property, Fsnarf_documentation):
7801         No longer static.
7802         * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
7803         static.
7804         * dired.c (Ffile_attributes): No longer static.
7805         * composite.c (Fcomposition_get_gstring): No longer static.
7806         * callproc.c (Fgetenv_internal): No longer static.
7808         * ccl.h: Remove EXFUNs.
7809         * buffer.h: Remove EXFUNs.
7810         * dispextern.h: Remove EXFUNs.
7811         * intervals.h: Remove EXFUNs.
7812         * fontset.h: Remove EXFUN.
7813         * font.h: Remove EXFUNs.
7814         * dosfns.c (system_process_attributes): Remove EXFUN.
7815         * keymap.h: Remove EXFUNs.
7816         * lisp.h: Remove EXFUNs.
7817         * w32term.h: Remove EXFUNs.
7818         * window.h: Remove EXFUNs.
7819         * xsettings.h: Remove EXFUN.
7820         * xterm.h: Remove EXFUN.
7822 2012-07-03  Glenn Morris  <rgm@gnu.org>
7824         * lisp.h (Frandom): Make it visible to C.
7825         * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
7826         buffer for invisible buffers.  (Bug#1229)
7828 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
7830         Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
7831         values which aren't power of 2.
7832         * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
7833         Verify its value and the value of VECTOR_BLOCK_SIZE.  Adjust users
7834         accordingly.
7836 2012-07-03  Stefan Monnier  <monnier@iro.umontreal.ca>
7838         * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
7840         * alloc.c (mark_object): Revert part of last patch to use `switch'.
7842 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
7844         * alloc.c (allocate_vector_block): Remove redundant
7845         calls to mallopt if DOUG_LEA_MALLOC is defined.
7846         (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
7847         avoid calls to mallopt if zero_vector is returned.
7849 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
7851         * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
7852         is enabled, avoid dereferencing NULL current_sblock if
7853         running undumped.
7855 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
7857         Cleanup basic buffer management.
7858         * buffer.h (struct buffer): Change layout to use generic vector
7859         marking code.  Fix some comments.  Change type of 'clip_changed'
7860         to bitfield.  Remove unused #ifndef old.
7861         (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
7862         (GET_OVERLAYS_AT): Fix indentation.
7863         (for_each_per_buffer_object_at): New macro.
7864         * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
7865         (Fbuffer_local_variables): Use it.
7866         (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
7867         * alloc.c (allocate_buffer): Adjust to match new layout of
7868         struct buffer.  Fix comment.
7869         (mark_overlay): New function.
7870         (mark_buffer): Use it.  Use mark_vectorlike to mark normal
7871         Lisp area of struct buffer.
7872         (mark_object): Use it.  Adjust marking of misc objects
7873         and related comments.
7875 2012-07-02  Paul Eggert  <eggert@cs.ucla.edu>
7877         * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
7878         wrapper that is not needed because the wrapped code is a no-op (zero
7879         machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
7880         This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
7882 2012-07-02  Dmitry Antipov  <dmantipov@yandex.ru>
7884         * alloc.c (mark_buffer): Simplify.  Remove prototype.
7885         (mark_object): Add comment.  Reorganize marking of vector-like
7886         objects.  Use CHECK_LIVE for all vector-like objects except buffers
7887         and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
7888         Avoid redundant calls to mark_vectorlike for bool vectors.
7890 2012-06-30  Glenn Morris  <rgm@gnu.org>
7892         * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
7894         * epaths.in (PATH_SITELOADSEARCH): New.
7895         * lread.c (init_lread): Use PATH_SITELOADSEARCH.
7896         This is rather than relying on --enable-locallisppath elements
7897         having "site-lisp" in their names.  (Bug#10208#25, 11658)
7899 2012-06-30  Eli Zaretskii  <eliz@gnu.org>
7901         * w32proc.c (sys_select): Accept and ignore one more argument.
7903         * w32.c (emacs_gnutls_pull): Call select with one more argument.
7905         * sysselect.h [DOS_NT]: Don't include sys/select.h.
7906         (pselect) [!MS_DOS]: Redirect to sys_select.
7908         * sysdep.c: Don't include dos.h and dosfns.h.
7910         * process.c (sys_select):
7911         * msdos.c (sys_select): Accept one more argument and ignore it.
7913         * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
7914         adapt data types and code to that.
7916         * dosfns.c:
7917         * msdos.c (gettime, settime): Define away the prototypes in dos.h,
7918         which clashes with the gnulib function of the same name.
7920 2012-06-30  Andreas Schwab  <schwab@linux-m68k.org>
7922         * font.c (font_style_to_value, font_style_symbolic)
7923         (font_prop_validate_style): Add type checks for values in
7924         font_style_table.
7926         * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
7927         argument.
7928         * character.c, charset.c, menu.c, process.c, window.c: Adjust all
7929         uses.
7931 2012-06-29  Eli Zaretskii  <eliz@gnu.org>
7933         * xdisp.c (try_window_id): Undo last change.
7935         * w32.c (getwd): Adjust commentary about startup_dir.
7936         (init_environment): Always call sys_access, even in non-MSVC
7937         builds.  Don't chdir to the directory of the Emacs executable.
7938         This undoes code from 1997 which was justified by the need to
7939         "avoid conflicts when removing and renaming directories".  But its
7940         downside was that every relative file name was being interpreted
7941         relative to the directory of the Emacs executable, which can never
7942         be TRT.  In particular, it broke sys_access when called with
7943         relative file names.
7944         (sys_access): Map GetLastError to errno.
7946 2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
7948         * window.h (struct window): Change type of 'fringes_outside_margins'
7949         to bitfield.  Fix comment.  Adjust users accordingly.
7950         (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
7951         Adjust comment.
7952         * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
7953         to ptrdiff_t.
7955 2012-06-29  Andreas Schwab  <schwab@linux-m68k.org>
7957         * gnutls.c (emacs_gnutls_handshake):
7958         Add QUIT to make the loop interruptible.
7960 2012-06-29  Glenn Morris  <rgm@gnu.org>
7962         * charset.c (init_charset): Make lack of etc/charsets fatal.
7964 2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
7966         * editfns.c (region_limit): Fix type mismatch.
7968 2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
7970         * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
7971         undefined.  Convert from xassert to eassert.
7972         * nsmenu.m: Convert from xassert to eassert.
7973         * nsterm.m: Likewise.
7975 2012-06-28  Stefan Monnier  <monnier@iro.umontreal.ca>
7977         * editfns.c (region_limit): Clip to narrowing (bug#11770).
7979 2012-06-28  Paul Eggert  <eggert@cs.ucla.edu>
7981         Avoid integer overflow on scroll-left and scroll-right.
7982         * window.c (HSCROLL_MAX): New macro.
7983         (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
7984         overflow when requested scroll falls outside ptrdiff_t range.
7986 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
7988         * window.h (struct window): Change type of 'hscroll',
7989         'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
7990         'last_modified' and 'last_overlay_modified' to EMACS_INT.
7991         Adjust users accordingly.
7992         * xdisp.c (try_cursor_movement): Replace type check with eassert.
7993         * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
7994         from EMACS_INT to ptrdiff_t.
7995         (make_window): Omit redundant initialization.
7997 2012-06-28  Juanma Barranquero  <lekktu@gmail.com>
7999         * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
8001 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
8003         * window.h (struct window): Change type of 'use_time' and
8004         'sequence_number' from Lisp_Object to int.
8005         * frame.c (make_frame): Adjust users accordingly.
8006         * print.c (print_object): Likewise.
8007         * window.c (select_window, Fwindow_use_time, make_parent_window)
8008         (make_window): Likewise.
8010 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
8012         * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
8013         enabled with --enable-checking=[all,glyphs] configure option.
8014         Fix GLYPH_DEBUG usage assuming that it may be undefined,
8015         adjust comments accordingly.
8016         * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
8017         undefined, adjust comments accordingly.
8018         * image.c: Likewise.
8019         * scroll.c: Likewise.
8020         * w32fns.c: Likewise.
8021         * w32term.c: Likewise.
8022         * xdisp.c: Likewise.
8023         * xfaces.c: Likewise.
8024         * xfns.c: Likewise.
8025         * xterm.c: Likewise.
8027 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
8029         Generalize run-time debugging checks.
8030         * dispextern.h (XASSERTS): Remove.
8031         * fontset.c (xassert): Remove.
8032         Convert from xassert to eassert.
8033         * alloc.c: Convert from xassert to eassert.
8034         * bidi.c: Likewise.
8035         * dispnew.c: Likewise.
8036         * fns.c: Likewise.
8037         * fringe.c: Likewise.
8038         * ftfont.c: Likewise.
8039         * gtkutil.c: Likewise.
8040         * image.c: Likewise.
8041         * keyboard.c: Likewise.
8042         * menu.c: Likewise.
8043         * process.c: Likewise.
8044         * scroll.c: Likewise.
8045         * sound.c: Likewise.
8046         * term.c: Likewise.
8047         * w32console.c: Likewise.
8048         * w32fns.c: Likewise.
8049         * w32term.c: Likewise.
8050         * window.c: Likewise.
8051         * xdisp.c: Likewise.
8052         * xfaces.c: Likewise.
8053         * xfns.c: Likewise.
8054         * xselect.c: Likewise.
8055         * xterm.c: Likewise.
8057 2012-06-27  Stefan Monnier  <monnier@iro.umontreal.ca>
8059         * fns.c (maybe_resize_hash_table): Output message when growing the
8060         purify-hashtable.
8062 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
8064         * alloc.c (allocate_string_data): Remove dead code.
8065         * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
8066         avoid GCC warning about unused macro.
8068 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
8070         * alloc.c (allocate_string): Omit intervals initialization.
8071         * alloc.c (make_uninit_multibyte_string): Initialize intervals
8072         as in make_pure_string and make_pure_c_string.
8074 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
8076         * alloc.c (allocate_string): Fix last change.
8078 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
8080         * alloc.c (allocate_string): Remove two redundant calls
8081         to memset, add explicit initialization where appropriate.
8083 2012-06-27  Glenn Morris  <rgm@gnu.org>
8085         * lisp.mk (lisp): Remove paths.elc.
8087 2012-06-27  Chong Yidong  <cyd@gnu.org>
8089         * doc.c (Fsubstitute_command_keys): Fix punctuation.
8091 2012-06-26  John Wiegley  <johnw@newartisans.com>
8093         * unexmacosx.c (copy_data_segment): Add two section names used
8094         on Mac OS X Lion: __mod_init_func and __mod_term_func.
8096         * alloc.c (mark_memory): Do not check with -faddress-sanitizer
8097         when building with Clang.
8099 2012-06-26  Stefan Monnier  <monnier@iro.umontreal.ca>
8101         * eval.c (Fapply): Allow calling it with a single argument.
8103 2012-06-26  Eli Zaretskii  <eliz@gnu.org>
8105         * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
8106         _stricmp and _strnicmp.
8107         (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
8109 2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
8111         * alloc.c (allocate_window): Zero out non-Lisp part of newly
8112         allocated window.
8113         (allocate_process): Likewise for new process.
8114         (allocate_terminal): Change to use offsetof.
8115         (allocate_frame): Likewise.
8116         * frame.c (make_frame): Omit redundant initialization.
8117         * window.c (make_parent_window): Use memset.
8118         (make_window): Omit redundant initialization.
8119         * process.c (make_process): Omit redundant initialization.
8120         * terminal.c (create_terminal): Likewise.
8122 2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
8124         * term.c (delete_tty): Remove redundant call to memset.
8126 2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
8128         * alloc.c: Remove build_string.
8129         * lisp.h: Define build_string as static inline.  This provides
8130         a better opportunity to optimize away calls to strlen when the
8131         function is called with compile-time constant argument.
8132         * image.c (imagemagick_error): Convert to build_string.
8133         * w32proc.c (sys_spawnve): Likewise.
8134         * xterm.c (x_term_init): Likewise.
8136 2012-06-26  Paul Eggert  <eggert@cs.ucla.edu>
8138         Use sprintf return value instead of invoking strlen on result.
8139         In the old days this wasn't portable, since some sprintf
8140         implementations returned char *.  But they died out years ago and
8141         Emacs already assumes sprintf returns int.
8142         Similarly for float_to_string.
8143         This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
8144         * ccl.c (ccl_driver):
8145         * character.c (string_escape_byte8):
8146         * data.c (Fnumber_to_string):
8147         * doprnt.c (doprnt):
8148         * print.c (print_object):
8149         * xdisp.c (message_dolog):
8150         * xfns.c (syms_of_xfns):
8151         Use sprintf or float_to_string result to avoid need to call strlen.
8152         * data.c (Fnumber_to_string):
8153         Use make_unibyte_string, since the string must be ASCII.
8154         * lisp.h, print.c (float_to_string): Now returns int length.
8155         * term.c (produce_glyphless_glyph):
8156         Use sprintf result rather than recomputing it.
8158         Clean out last vestiges of the old HAVE_CONFIG_H stuff.
8159         * Makefile.in (ALL_CFLAGS):
8160         * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
8161         * gmalloc.c, regex.c: Include <config.h> unconditionally.
8163 2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
8165         * dispextern.h (xstrcasecmp): Define to library function
8166         strcasecmp if available.
8167         * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
8169 2012-06-25  Andreas Schwab  <schwab@linux-m68k.org>
8171         * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
8172         Avoid comma operator.
8173         * menu.c (push_submenu_start, push_submenu_end)
8174         (push_left_right_boundary, push_menu_pane): Likewise.
8175         * msdos.c (dos_rawgetc): Likewise.
8177 2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
8179         * xfns.c (xic_create_fontsetname): Remove redundant calls
8180         to memset.
8182 2012-06-25  Paul Eggert  <eggert@cs.ucla.edu>
8184         * gtkutil.c (get_utf8_string): Remove redundant assignment.
8185         sprintf already null-terminates its output.
8187         * xfns.c (x_window): Remove redundant cast.
8189 2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
8191         * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
8192         `const char *' to `char *' to avoid compiler warning.
8194 2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
8196         * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
8197         instead of truncating it to 63 (admittedly a generous limit).
8199         * process.c: Fix spelling and caps in comments.
8201 2012-06-24  Dan Nicolaescu  <dann@ics.uci.edu>
8203         * emacs.c (setpgrp): Remove definition, unused.
8204         * sysdep.c (setpgrp): Remove definition, not used in this file.
8206 2012-06-24  Juanma Barranquero  <lekktu@gmail.com>
8208         * makefile.w32-in: Update dependencies.
8210 2012-06-24  Eli Zaretskii  <eliz@gnu.org>
8212         * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
8213         (SYSTIME_H): Add nt/inc/sys/time.h.
8215         * systime.h [WINDOWSNT]: Include sys/time.h.
8217         * s/ms-w32.h (struct timespec): Definition moved from
8218         nt/inc/sys/time.h.  Suggested by Paul Eggert <eggert@cs.ucla.edu>.
8220 2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
8222         Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
8223         * buffer.h (buffer_slot_type_mismatch):
8224         * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
8225         * eval.c (unwind_to_catch):
8226         * image.c (my_png_error, my_error_exit):
8227         * keyboard.c (quit_throw_to_read_char, user_error)
8228         (Fexit_recursive_edit, Fabort_recursive_edit):
8229         * lisp.h (die, args_out_of_range, args_out_of_range_3)
8230         (wrong_type_argument, buffer_overflow, __executable_start)
8231         (memory_full, buffer_memory_full, string_overflow, Fthrow)
8232         (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
8233         (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
8234         (fatal):
8235         (child_setup) [!DOS_NT]:
8236         * lread.c (end_of_file_error, invalid_syntax):
8237         * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
8238         * puresize.h (pure_write_error):
8239         * search.c (matcher_overflow):
8240         * sound.c (sound_perror, alsa_sound_perror):
8241         * sysdep.c, syssignal.h (croak):
8242         * term.c (maybe_fatal, vfatal):
8243         * textprop.c (text_read_only):
8244         * undo.c (user_error):
8245         * unexmacosx.c (unexec_error):
8246         * xterm.c (x_ins_del_lines, x_delete_glyphs):
8247         Use _Noreturn rather than NO_RETURN.
8248         No need for separate decl merely because of _Noreturn.
8249         * sound.c (sound_warning, parse_sound):
8250         Remove unnecessary forward decls.
8252 2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
8254         Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
8255         * lisp.h (WAIT_READING_MAX): New macro.
8256         * dispnew.c (Fsleep_for, sit_for):
8257         * keyboard.c (kbd_buffer_get_event):
8258         * process.c (Faccept_process_output):
8259         Use it to avoid bogus compiler warnings with obsolescent GCC versions.
8260         This improves on the previous patch, which introduced a bug
8261         when time_t is unsigned and as wide as intmax_t.
8262         See <http://bugs.gnu.org/9000#51>.
8264 2012-06-23  Eli Zaretskii  <eliz@gnu.org>
8266         * dispnew.c (sit_for, Fsleep_for):
8267         * keyboard.c (kbd_buffer_get_event):
8268         * process.c (Faccept_process_output): Avoid compiler warnings when
8269         comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
8271 2012-06-23  Juanma Barranquero  <lekktu@gmail.com>
8273         * makefile.w32-in: Update dependencies.
8275         * w32.c (ltime): Add return type and declare static.
8276         (w32_get_internal_run_time): Remove usused variable `time_100ns'.
8278 2012-06-23  Paul Eggert  <eggert@cs.ucla.edu>
8280         * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
8281         Privately reported by Herbert J. Skuhra.
8282         (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
8283         All uses changed.
8284         (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
8285         not make_lisp_timeval, when the argument is of type EMACS_TIME.
8287 2012-06-23  Eli Zaretskii  <eliz@gnu.org>
8289         * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
8290         last argument of make_unibyte_string.
8292         * keyboard.c (kbd_buffer_get_event): Include the codepage and the
8293         language ID in the event parameters.
8295         * w32term.c (w32_read_socket): Put the new keyboard codepage into
8296         event.code, not the obscure "character set ID".
8298 2012-06-23  Chong Yidong  <cyd@gnu.org>
8300         * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
8302 2012-06-23  Eli Zaretskii  <eliz@gnu.org>
8304         Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
8305         * w32.c (fdutimens): New function.
8307         * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
8309         * s/ms-w32.h (pselect): Redirect to sys_select.
8311         * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
8313         * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
8314         in the logic of incrementing and decrementing the value of
8315         use_relocatable_buffers.
8317 2012-06-23  Paul Eggert  <eggert@cs.ucla.edu>
8319         * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
8320         Privately reported by Herbert J. Skuhra.
8321         [__FreeBSD__]: Remove "*/" typo after "#include".
8322         (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
8323         (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
8324         (TIMEVAL, system_process_attributes) [__FreeBSD__]:
8325         Don't assume EMACS_TIME and struct timeval are the same type.
8327 2012-06-22  Paul Eggert  <eggert@cs.ucla.edu>
8329         Support higher-resolution time stamps (Bug#9000).
8330         The time stamps are only nanosecond-resolution at the C level,
8331         since that's the best that any real-world system supports now.
8332         But they are picosecond-resolution at the Lisp level, as that's
8333         easy, and leaves room for future OS improvements.
8335         * Makefile.in (LIB_CLOCK_GETTIME): New macro.
8336         (LIBES): Use it.
8338         * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
8339         Don't get current time unless it's needed.
8341         * atimer.c: Include <sys/time.h> unconditionally, since gnulib
8342         now provides it if it's absent.
8343         (start_atimer): Port to higher-res time stamps.
8344         Check for time stamp overflow.  Don't get current time more
8345         often than is needed.
8347         * buffer.h (struct buffer): Buffer modtime now has high resolution.
8348         Include systime.h, not time.h.
8349         (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
8351         * dired.c: Include stat-time.h.
8352         (Ffile-attributes): File times now have higher resolution.
8354         * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
8355         (struct image): Timestamp now has higher resolution.
8357         * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
8358         has at least microseconds now.  All uses removed.
8359         (update_frame, update_single_window, update_window, update_frame_1)
8360         (Fsleep_for, sit_for): Port to higher-resolution time stamps.
8361         (duration_to_sec_usec): Remove; no longer needed.
8363         * editfns.c (time_overflow): Now extern.
8364         (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
8365         (float-time, Fformat_time_string, Fcurrent_time_string)
8366         (Fcurrent_time_zone): Accept and generate higher-resolution
8367         time stamps.
8368         (make_time_tail, make_lisp_time, dissassemble_lisp_time)
8369         (decode_time_components, lisp_seconds_argument): New functions.
8370         (make_time): Now static.
8371         (lisp_time_argument): Now returns EMACS_TIME.  New arg ppsec.
8372         Report an error if the time is invalid, rather than having the caller
8373         do that.
8375         * fileio.c: Include <stat-time.h>
8376         (Fcopy_file): Copy higher-resolution time stamps.
8377         Prefer to set the time stamp via a file descriptor if that works.
8378         (Fset_file_times, Finsert_file_contents, Fwrite_region)
8379         (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
8380         (Fvisited_file_modtime, Fset_visited_file_modtime):
8381         Support higher-resolution time stamps.
8383         * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
8385         * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
8387         * image.c (prepare_image_for_display, clear_image_cache)
8388         (lookup_image): Port to higer-resolution time stamps.
8390         * keyboard.c (start_polling, bind_polling_period):
8391         Check for time stamp overflow.
8392         (read_char, kbd_buffer_get_event, timer_start_idle)
8393         (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
8394         (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
8395         Port to higher-resolution time stamps.  Do not assume time_t is signed.
8396         (decode_timer): New function.  Timers are now vectors of length 9,
8397         not 8, to accommodate the picosecond component.
8398         (timer_check_2): Use it.
8400         * nsterm.m (select_timeout, timeval_subtract): Remove.
8401         (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
8402         as they're a bit more accurate and handle overflow better.
8403         (ns_select): Change prototype to be compatible with pselect.
8404         (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
8405         * nsterm.h (ns_select): Adjust prototype.
8407         * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
8408         us-resolution time stamps.
8409         (sys_select): Use the new EMACS_TIME_SIGN macro instead.
8411         * lread.c (read_filtered_event): Port to ns-resolution time stamps.
8413         * lisp.h (time_overflow): New decl.
8414         (wait_reading_process_output): First arg is now intmax_t, not int,
8415         to accommodate larger waits.
8417         * process.h (struct Lisp_Process.read_output_delay):
8418         Now counts nanoseconds, not microseconds.
8419         * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
8420         EMACS_HAS_USECS.
8421         (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
8422         (wait_reading_process_output):
8423         Port to ns-resolution time stamps.
8424         (Faccept_process_output, wait_reading_process_output):
8425         Check for time stamp overflow.  Do not assume time_t is signed.
8426         (select_wrapper): Remove; we now use pselect.
8427         (Fprocess_attributes): Now generates ns-resolution time stamps.
8429         * sysdep.c: Include utimens.h.  Don't include utime.h
8430         or worry about struct utimbuf; gnulib does that for us now.
8431         (gettimeofday): Remove; gnulib provides a substitute.
8432         (make_timeval): New function.
8433         (set_file_times): Now sets ns-resolution time stamps.
8434         New arg FD; all uses changed.
8435         (time_from_jiffies, ltime_from_jiffies, get_up_time)
8436         (system_process_attributes):
8437         Now returns ns-resolution time stamp.  All uses changed.
8438         Check for time stamp overflow.
8440         * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
8441         provides a substitute now.
8443         * systime.h: Include timespec.h rather than sys/time.h and time.h,
8444         since it guarantees struct timespec.
8445         (EMACS_TIME): Now struct timespec, so that we can support
8446         ns-resolution time stamps.
8447         (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
8448         (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
8449         (EMACS_USECS): Remove.
8450         (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
8451         so multiply the arg by 1000 before storing it.
8452         (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
8453         New macros.
8454         (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
8455         Port to ns-resolution time stamps.
8456         (EMACS_TIME_NEG_P): Remove; replaced by....
8457         (EMACS_TIME_SIGN): New macro.
8458         (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
8459         (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
8460         (set_file_times, make_time, lisp_time_argument): Adjust signature.
8461         (make_timeval, make_lisp_time, decode_time_components): New decls.
8462         (EMACS_TIME_CMP): Remove; no longer used.  Plus, it was buggy, in
8463         that it mishandled time_t overflow.  You can't compare by subtracting!
8464         (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
8465         (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
8467         * term.c: Include <sys/time.h>.
8468         (timeval_to_Time): New function, for proper overflow wraparound.
8469         (term_mouse_position, term_mouse_click): Use it.
8471         * undo.c (record_first_change): Support higher-resolution time stamps
8472         in the undo buffer.
8473         (Fprimitive_undo): Use them when restoring time stamps.
8475         * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
8476         (w32_get_internal_run_time):
8477         Port to higher-resolution Emacs time stamps.
8478         (ltime): Now accepts single 64-bit integer, as that's more convenient
8479         for callers.
8481         * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
8483         * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
8484         for compatibility with pselect.  Support ns-resolution time stamps.
8486         * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
8488         * xselect.c (wait_for_property_change, x_get_foreign_selection):
8489         Check for time stamp overflow, and support ns-resolution time stamps.
8491         * xterm.c: Don't include sys/time.h; gnulib does that for us now.
8492         Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
8493         (timeval_subtract): Remove; no longer needed.
8494         (XTflash, XTring_bell, x_wait_for_event):
8495         Port to ns-resolution time stamps.  Don't assume time_t is signed.
8497 2012-06-22  Chong Yidong  <cyd@gnu.org>
8499         * xdisp.c (x_consider_frame_title): Revert last change.
8501 2012-06-22  Eli Zaretskii  <eliz@gnu.org>
8503         * alloc.c (NSTATICS): Enlarge to 0x650.  Otherwise, Emacs compiled
8504         with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
8505         aborts in staticpro during startup.  (Without -DBYTE_CODE_METER,
8506         staticidx goes up to 1597 out of 1600 = 0x640.)
8508 2012-06-20  Paul Eggert  <eggert@cs.ucla.edu>
8510         * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
8511         Otherwise, the umask might be mistakenly 0 while handling input signals.
8513 2012-06-19  Stefan Monnier  <monnier@iro.umontreal.ca>
8515         * minibuf.c (Fread_string): Bind minibuffer-completion-table.
8517 2012-06-19  Dmitry Antipov  <dmantipov@yandex.ru>
8519         * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
8520         * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
8521         * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
8522         access to `contents' member of Lisp_Vector objects with AREF and ASET
8523         where appropriate.
8525 2012-06-19  Chong Yidong  <cyd@gnu.org>
8527         * frame.c (delete_frame): When selecting a frame on a different
8528         text terminal, do not alter the terminal's top-frame.
8530         * xdisp.c (format_mode_line_unwind_data): Record the target
8531         frame's selected window and its terminal's top-frame.
8532         (unwind_format_mode_line): Restore them.
8533         (x_consider_frame_title, display_mode_line, Fformat_mode_line):
8534         Callers changed.
8535         (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
8536         since tty frames can be explicitly named.
8537         (prepare_menu_bars): Likewise.
8539         * term.c (Ftty_top_frame): New function.
8541 2012-06-18  Paul Eggert  <eggert@cs.ucla.edu>
8543         Port byte-code-meter to modern targets.
8544         * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
8545         !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG.  Problem with
8546         CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
8547         <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
8548         (METER_1, METER_2): Simplify.
8550 2012-06-18  Stefan Monnier  <monnier@iro.umontreal.ca>
8552         * data.c (Fdefalias): Return `symbol' (bug#11686).
8554 2012-06-18  Martin Rudalics  <rudalics@gmx.at>
8556         * buffer.c (Fkill_buffer): Don't throw an error when the buffer
8557         gets killed during executing of this function (Bug#11665).
8558         Try to always return Qt when the buffer has been actually killed.
8559         (Vkill_buffer_query_functions): In doc-string say that functions
8560         run by this hook should not change the current buffer.
8562 2012-06-18  Paul Eggert  <eggert@cs.ucla.edu>
8564         Fix recently-introduced process.c problems found by static checking.
8565         * process.c (write_queue_push, write_queue_pop, send_process):
8566         Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
8567         (write_queue_pop): Fix pointer signedness problem.
8568         (send_process): Remove unused local.
8570 2012-06-17  Chong Yidong  <cyd@gnu.org>
8572         * xdisp.c (redisplay_internal): No need to redisplay terminal
8573         frames that are not on top.
8575 2012-06-17  Troels Nielsen  <bn.troels@gmail.com>
8577         * process.c (make_process): Initialize write_queue.
8578         (write_queue_push, write_queue_pop): New functions.
8579         (send_process): Use them to maintain correct ordering of process
8580         writes (Bug#10815).
8582 2012-06-17  Paul Eggert  <eggert@cs.ucla.edu>
8584         * lisp.h (eassert): Assume C89 or later.
8585         This removes the need for CHECK.
8586         (CHECK): Remove.  Its comments about always evaluating its
8587         argument were confusing, as 'eassert' typically does not evaluate
8588         its argument.
8590         * coding.c (produce_chars): Use ptrdiff_t, not int.
8592         * xterm.c (x_draw_underwave): Check for integer overflow.
8593         This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
8595 2012-06-17  Jan Djärv  <jan.h.d@swipnet.se>
8597         * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
8598         referenced (Bug#11583).
8600 2012-06-16  Aurelien Aptel  <aurelien.aptel@gmail.com>
8602         Implement wave-style variant of underlining.
8603         * dispextern.h (face_underline_type): New enum.
8604         (face): Add field for underline type.
8605         * nsterm.m (ns_draw_underwave): New function.
8606         (ns_draw_text_decoration): Use it.
8607         * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
8608         New functions.
8609         (x_draw_glyph_string): Use them.
8610         * xfaces.c (Qline, Qwave): New Lisp objects.
8611         (check_lface_attrs, merge_face_ref)
8612         (Finternal_set_lisp_face_attribute, realize_x_face):
8613         Handle wave-style underline face attributes.
8614         * xterm.c (x_draw_underwave): New function.
8615         (x_draw_glyph_string): Use it.
8617 2012-06-16  Juanma Barranquero  <lekktu@gmail.com>
8619         * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
8620         ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
8621         ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
8622         ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
8623         ($(BLD)/w32select.$(O)): Update dependencies.
8625 2012-06-16  Andreas Schwab  <schwab@linux-m68k.org>
8627         * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
8628         (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
8629         * character.c (_fetch_multibyte_char_p): Remove.
8630         * alloc.c: Include "character.h" before "buffer.h".
8631         * bidi.c: Likewise.
8632         * buffer.c: Likewise.
8633         * bytecode.c: Likewise.
8634         * callint.c: Likewise.
8635         * callproc.c: Likewise.
8636         * casefiddle.c: Likewise.
8637         * casetab.c: Likewise.
8638         * category.c: Likewise.
8639         * cmds.c: Likewise.
8640         * coding.c: Likewise.
8641         * composite.c: Likewise.
8642         * dired.c: Likewise.
8643         * dispnew.c: Likewise.
8644         * doc.c: Likewise.
8645         * dosfns.c: Likewise.
8646         * editfns.c: Likewise.
8647         * emacs.c: Likewise.
8648         * fileio.c: Likewise.
8649         * filelock.c: Likewise.
8650         * font.c: Likewise.
8651         * fontset.c: Likewise.
8652         * fringe.c: Likewise.
8653         * indent.c: Likewise.
8654         * insdel.c: Likewise.
8655         * intervals.c: Likewise.
8656         * keyboard.c: Likewise.
8657         * keymap.c: Likewise.
8658         * lread.c: Likewise.
8659         * macros.c: Likewise.
8660         * marker.c: Likewise.
8661         * minibuf.c: Likewise.
8662         * nsfns.m: Likewise.
8663         * nsmenu.m: Likewise.
8664         * print.c: Likewise.
8665         * process.c: Likewise.
8666         * regex.c: Likewise.
8667         * region-cache.c: Likewise.
8668         * search.c: Likewise.
8669         * syntax.c: Likewise.
8670         * term.c: Likewise.
8671         * textprop.c: Likewise.
8672         * undo.c: Likewise.
8673         * unexsol.c: Likewise.
8674         * w16select.c: Likewise.
8675         * w32fns.c: Likewise.
8676         * w32menu.c: Likewise.
8677         * window.c: Likewise.
8678         * xdisp.c: Likewise.
8679         * xfns.c: Likewise.
8680         * xmenu.c: Likewise.
8681         * xml.c: Likewise.
8682         * xselect.c: Likewise.
8684 2012-06-16  Eli Zaretskii  <eliz@gnu.org>
8686         * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
8687         If all the glyphs of the glyph row came from strings, and we have no
8688         cursor positioning clues, put the cursor on the first glyph of the
8689         row.
8690         (handle_face_prop): Use chunk-relative overlay string index when
8691         indexing into it->string_overlays array.  (Bug#11653)
8692         (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
8693         the rightmost.  (Bug#11720)
8695 2012-06-16  Andreas Schwab  <schwab@linux-m68k.org>
8697         * category.h (CHAR_HAS_CATEGORY): Define as inline.
8698         (CATEGORY_MEMBER): Enforce 1/0 value.
8699         * category.c (_temp_category_set): Remove.
8701 2012-06-16  Eli Zaretskii  <eliz@gnu.org>
8703         * window.c (Fdelete_other_windows_internal)
8704         (Fdelete_window_internal): Don't access frame's mouse highlight
8705         info of the initial frame.  (Bug#11677)
8707 2012-06-14  Paul Eggert  <eggert@cs.ucla.edu>
8709         * .gdbinit (xgetint): Fix recently-introduced paren typo.
8710         Assume USE_2_TAGS_FOR_INTS.
8711         (xreload): Adjust $tagmask width to match recent lisp.h change.
8713         Simplify lisp.h in minor ways that should not affect code.
8714         * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
8715         (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
8716         (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
8717         Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
8718         (INTTYPEBITS): New macro, for clarity.
8719         (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
8720         (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
8721         Simplify now that USE_LSB_TAG is always defined.
8722         (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
8723         (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
8725 2012-06-13  Juanma Barranquero  <lekktu@gmail.com>
8727         * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
8729 2012-06-13  Glenn Morris  <rgm@gnu.org>
8731         * s/bsd-common.h (BSD4_3):
8732         * s/usg5-4-common.h (USG5_4): No longer define; unused.
8734 2012-06-13  Andreas Schwab  <schwab@linux-m68k.org>
8736         * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
8737         instead of union.
8738         (XLI, XIL): Define.
8739         (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
8740         Use them.
8741         * emacs.c (gdb_use_struct): Rename from gdb_use_union.
8742         * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
8743         * alloc.c (widen_to_Lisp_Object): Remove.
8744         (mark_memory): Use XIL instead of widen_to_Lisp_Object.
8745         * frame.c (delete_frame): Remove outdated comment.
8746         * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
8747         USE_LISP_UNION_TYPE.
8748         (Fw32_unregister_hot_key): Likewise.
8749         (Fw32_toggle_lock_key): Likewise.
8750         * w32menu.c (add_menu_item): Likewise.
8751         (w32_menu_display_help): Use XIL instead of checking
8752         USE_LISP_UNION_TYPE.
8753         * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
8754         (init_heap): Likewise.
8755         * w32term.c (w32_read_socket): Update comment.
8757 2012-06-13  Glenn Morris  <rgm@gnu.org>
8759         * s/usg5-4-common.h, src/s/unixware.h:
8760         Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
8762         * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
8764 2012-06-13  Paul Eggert  <eggert@cs.ucla.edu>
8766         USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
8767         * alloc.c (make_number) [!defined make_number]:
8768         Remove, as lisp.h always defines this now.
8769         (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
8770         (roundup_size): Verify that it is a power of 2.
8771         * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
8772         * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
8773         * lisp.h (USE_LSB_TAG): Allow the builder to compile with
8774         -DUSE_LSB_TAG=0, to override the automatically-selected default.
8775         USE_LSB_TAG now is always defined to be either 0 or 1.
8776         All uses changed.
8777         (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
8778         code works fine either way, and efficiency is not a concern here,
8779         as the union type is for debugging, not for production.
8780         (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
8781         Use an inline function on all platforms when using the union type,
8782         since this is simpler and 'static inline' can be used portably
8783         within Emacs now.
8784         (LISP_INITIALLY_ZERO): New macro.
8785         (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
8786         (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
8788 2012-06-12  Glenn Morris  <rgm@gnu.org>
8790         * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
8792         * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
8794         * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
8795         Move BROKEN_SIGIO to configure.
8797         * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
8798         Move NO_TERMIO to configure.
8800 2012-06-12  Chong Yidong  <cyd@gnu.org>
8802         * image.c (imagemagick_load_image): Use MagickFlattenImage if
8803         MagickMergeImageLayers is undefined.  Use pixel pusher loop if
8804         MagickExportImagePixels is undefined.
8806 2012-06-12  Paul Eggert  <eggert@cs.ucla.edu>
8808         * image.c (imagemagick_load_image): Remove unused label.
8810 2012-06-11  Glenn Morris  <rgm@gnu.org>
8812         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
8813         * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
8814         * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
8815         * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
8817 2012-06-11  Stefan Monnier  <monnier@iro.umontreal.ca>
8819         * alloc.c (make_byte_code): New function.
8820         (Fmake_byte_code): Use it.  Don't purify here.
8821         * lread.c (read1): Use it as well to avoid extra allocation.
8823 2012-06-11  Chong Yidong  <cyd@gnu.org>
8825         * image.c (imagemagick_load_image): Implement transparency.
8827 2012-06-10  Andreas Schwab  <schwab@linux-m68k.org>
8829         * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
8830         account for preceding backslashes.  (Bug#11663)
8832 2012-06-09  Chong Yidong  <cyd@gnu.org>
8834         * term.c: Support italics in capable terminals (Bug#9652).
8835         (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
8836         (turn_on_face): Output using TS_enter_italic_mode if available.
8837         Don't handle unused blinking and alt-charset cases.
8838         (turn_off_face): Handle italic case; discard unused tty_blinking_p
8839         and tty_alt_charset_p cases.
8840         (tty_capable_p, init_tty): Support italics.
8842         * termchar.h (struct tty_display_info): Add field for italics.
8843         Remove unused blink field.
8845         * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
8846         Handle slant.
8848         * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
8849         (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
8850         tty_alt_charset_p.  Add tty_italic_p.
8852 2012-06-09  Michael Albinus  <michael.albinus@gmx.de>
8854         * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
8855         dbus_type_is_basic if available.
8856         (xd_extract_signed, xd_extract_unsigned): Rename from
8857         extract_signed and extract_unsigned, respectively.  Adapt callers.
8859 2012-06-09  Chong Yidong  <cyd@gnu.org>
8861         * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
8863         * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
8864         case (Bug#9752).
8866 2012-06-08  Paul Eggert  <eggert@cs.ucla.edu>
8868         * xdisp.c (vmessage): Treat frame message as multibyte.
8869         Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
8870         would generate the diagnostic "Making \302\247 buffer-local while
8871         let-bound!".
8873 2012-06-08  Eli Zaretskii  <eliz@gnu.org>
8875         * dispnew.c (showing_window_margins_p): Undo last change, which
8876         was done due to an inadvertent commit.
8877         (adjust_frame_glyphs_for_frame_redisplay): Do call
8878         showing_window_margins_p.
8880 2012-06-08  Stefan Monnier  <monnier@iro.umontreal.ca>
8882         * eval.c (Fmake_var_non_special): New primitive.
8883         (syms_of_eval): Defsubr it.
8884         * lread.c (syms_of_lread): Mark `values' as lexically scoped.
8886 2012-06-08  Juanma Barranquero  <lekktu@gmail.com>
8888         * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
8889         function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
8891 2012-06-08  Eli Zaretskii  <eliz@gnu.org>
8893         * alloc.c (allocate_vectorlike): Fix last change.
8895 2012-06-08  Dmitry Antipov  <dmantipov@yandex.ru>
8897         Block-based vector allocation of small vectors.
8898         * lisp.h (struct vectorlike_header): New field `nbytes',
8899         adjust comment accordingly.
8900         * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
8901         to denote vector blocks.  Adjust users (live_vector_p,
8902         mark_maybe_pointer, valid_lisp_object_p) accordingly.
8903         (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
8904         (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
8905         (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
8906         (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
8907         (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
8908         (roundup_size): New constant.
8909         (struct vector_block): New data type.
8910         (vector_blocks, vector_free_lists, zero_vector): New variables.
8911         (all_vectors): Rename to `large_vectors'.
8912         (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
8913         (sweep_vectors): New functions.
8914         (allocate_vectorlike): Return `zero_vector' as the only vector of
8915         0 items.  Allocate new vector from block if vector size is less than
8916         or equal to VBLOCK_BYTES_MAX.
8917         (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
8918         (init_alloc_once): Add call to init_vectors.
8920 2012-06-08  Stefan Monnier  <monnier@iro.umontreal.ca>
8922         * eval.c (Fmacroexpand): Stop if the macro returns the same form.
8924 2012-06-07  Paul Eggert  <eggert@cs.ucla.edu>
8926         * doprnt.c (doprnt): Truncate multibyte char correctly.
8927         Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
8928         would mishandle a string argument "Xc" if X was a multibyte
8929         character of length 2: it would truncate after X's first byte
8930         rather than including all of X.
8932 2012-06-06  Chong Yidong  <cyd@gnu.org>
8934         * buffer.c (word_wrap): Doc fix.
8936 2012-06-04  Paul Eggert  <eggert@cs.ucla.edu>
8938         * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
8940 2012-06-03  Glenn Morris  <rgm@gnu.org>
8942         * xdisp.c (tool-bar-style): Doc fix.
8944 2012-06-03  Ulrich Müller  <ulm@gentoo.org>
8946         * Makefile.in (PAXCTL): Define.
8947         (temacs$(EXEEXT)): Disable memory randomization for the temacs
8948         binary via PaX flags if the paxctl utility is available.
8949         (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
8950         Restore PaX flags to their default.  (Bug#11398)
8952 2012-06-03  Chong Yidong  <cyd@gnu.org>
8954         * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
8955         buffer (Bug#11226).
8957 2012-06-03  Chong Yidong  <cyd@gnu.org>
8959         * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
8960         (note_mode_line_or_margin_highlight): If there is no help echo,
8961         use mode-line-default-help-echo.  Handle the case where the mouse
8962         position is past the end of the mode line string.
8964         * buffer.c (buffer_local_value_1): New function, split from
8965         Fbuffer_local_value; can return Qunbound.
8966         (Fbuffer_local_value): Use it.
8967         (Vmode_line_format): Docstring tweaks.
8969 2012-06-02  Paul Eggert  <eggert@cs.ucla.edu>
8971         * sysdep.c (system_process_attributes): Improve comment.
8973 2012-06-02  Stefan Monnier  <monnier@iro.umontreal.ca>
8975         * keyboard.c: Export real-this-command to Elisp.
8976         (syms_of_keyboard): Rename real_this_command to Vreal_this_command
8977         and DEFVAR it.  Update all users.
8979 2012-06-02  Paul Eggert  <eggert@cs.ucla.edu>
8981         * minibuf.c (Fassoc_string): Remove duplicate declaration.
8983         * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
8984         Convert pctcpu and pctmem to Lisp float properly.
8985         Let the compiler fold better, as 100.0/0x8000 is exact.
8987 2012-06-02  Andreas Schwab  <schwab@linux-m68k.org>
8989         * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
8990         cons_block.
8992 2012-06-01  Paul Eggert  <eggert@cs.ucla.edu>
8994         * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
8996 2012-06-01  Dmitry Antipov  <dmantipov@yandex.ru>
8998         For a 'struct window', replace some Lisp_Object fields to
8999         bitfields where appropriate, remove unused fields.
9000         * window.h (struct window): Remove unused 'last_mark_x' and
9001         'last_mark_y' fields.  Rename 'mini_p' field to 'mini',
9002         change its type from Lisp_Object to bitfield.
9003         Change type of 'force_start', 'optional_new_start',
9004         'last_had_star', 'update_mode_line' and 'start_at_line_beg'
9005         fields from Lisp_Object to bitfield.  Adjust users accordingly.
9007 2012-05-31  Paul Eggert  <eggert@cs.ucla.edu>
9009         Pacify gcc -Wdouble-precision when using Xaw.
9010         * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
9011         [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
9012         Use 'float' consistently, rather than 'float' in most places
9013         and 'double' in a couple of places.
9015 2012-05-31  Eli Zaretskii  <eliz@gnu.org>
9017         * xdisp.c (handle_stop): Detect whether we have overlay strings
9018         loaded by testing it->current.overlay_string_index to be
9019         non-negative, instead of checking whether n_overlay_strings is
9020         positive.  (Bug#11587)
9022 2012-05-31  Chong Yidong  <cyd@gnu.org>
9024         * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
9026         * doc.c (Fsubstitute_command_keys): Doc fix.
9028 2012-05-31  Eli Zaretskii  <eliz@gnu.org>
9030         * search.c (search_buffer): Remove calls to
9031         r_alloc_inhibit_buffer_relocation, as it is now called by
9032         maybe_unify_char, which was the cause of relocation of buffer text
9033         in bug#11519.
9035 2012-05-31  Eli Zaretskii  <eliz@gnu.org>
9037         * charset.c (maybe_unify_char): Inhibit relocation of buffer text
9038         for the duration of call to load_charset, to avoid problems with
9039         callers of maybe_unify_char that access buffer text through C
9040         pointers.
9042         * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
9043         decrement the inhibition flag, instead of just setting or
9044         resetting it.
9046 2012-05-31  Paul Eggert  <eggert@cs.ucla.edu>
9048         Remove obsolete '#define static' cruft.
9049         * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
9050         This #undef was "temporary" in 2000; it is no longer needed
9051         now that '#define static' has gone away.
9052         * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
9053         (gray_bitmap_bits): Remove; no longer needed.
9054         All uses replaced with definiens.
9055         * xterm.c: Include "bitmaps/gray.xbm".
9057 2012-05-30  Paul Eggert  <eggert@cs.ucla.edu>
9059         Clean up __executable_start, monstartup when --enable-profiling.
9060         The following changes affect the code only when profiling.
9061         * dispnew.c (__executable_start): Rename from safe_bcopy.
9062         Define only on platforms that need it.
9063         * emacs.c: Include <sys/gmon.h> when profiling.
9064         (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
9065         (__executable_start): Remove decl, since lisp.h does it now.
9066         (safe_bcopy): Remove decl; no longer has that name.
9067         (main): Coalesce #if into single bit of code, for simplicity.
9068         Cast pointers to uintptr_t, since standard libraries want integers
9069         and not pointers.
9070         * lisp.h (__executable_start): New decl.
9072 2012-05-31  Glenn Morris  <rgm@gnu.org>
9074         * image.c (Fimagemagick_types): Doc fix.
9076 2012-05-30  Jim Meyering  <meyering@redhat.com>
9078         * callproc.c (Fcall_process_region): Include directory component
9079         in mkstemp error message (Bug#11586).
9081 2012-05-30  Paul Eggert  <eggert@cs.ucla.edu>
9083         * alloc.c, lisp.h (make_pure_vector): Now static.
9085 2012-05-30  Stefan Monnier  <monnier@iro.umontreal.ca>
9087         * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
9088         Move to byte-run.el.
9089         (Fautoload): Do the hash-doc more carefully.
9090         * data.c (Fdefalias): Purify definition, except for keymaps.
9091         (Qdefun): Move from eval.c.
9092         * lisp.h (Qdefun): Remove.
9093         * lread.c (read1): Tiny simplification.
9095 2012-05-29  Troels Nielsen  <bn.troels@gmail.com>
9097         Do not create empty overlays with the evaporate property (Bug#9642).
9098         * buffer.c (Fmove_overlay): Reinstate the earlier fix for
9099         Bug#9642, but explicitly check that the buffer the overlay would
9100         be moved to is live and rearrange lines to make sure that errors
9101         will not put the overlay in an inconsistent state.
9102         (Fdelete_overlay): Cosmetics.
9104 2012-05-28  Eli Zaretskii  <eliz@gnu.org>
9106         * w32term.c (my_bring_window_to_top): New function.
9107         (x_raise_frame): Use handle returned by DeferWindowPos, which
9108         could be different from the original one.
9109         Call my_bring_window_to_top instead of my_set_foreground_window.
9110         (Bug#11513)
9112         * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
9113         by calling BringWindowToTop.
9115         * w32term.h (WM_EMACS_BRINGTOTOP): New message.
9116         (WM_EMACS_END): Increase by one.
9118 2012-05-28  Paul Eggert  <eggert@cs.ucla.edu>
9120         * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
9121         This avoids undefined behavior that might cause the eassert
9122         to not catch an out-of-range value.
9124 2012-05-28  Juanma Barranquero  <lekktu@gmail.com>
9126         * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
9127         Update dependencies.
9129 2012-05-27  Eli Zaretskii  <eliz@gnu.org>
9131         * bidi.c (bidi_mirror_char): Fix last change.
9133 2012-05-27  Andreas Schwab  <schwab@linux-m68k.org>
9135         * unexmacosx.c (copy_data_segment): Truncate after 16 characters
9136         when referring to sectname field in printf format.
9138 2012-05-27  Paul Eggert  <eggert@cs.ucla.edu>
9140         * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
9141         Only r_alloc_inhibit_buffer_relocation needed to be added;
9142         the others were already declared.
9144         * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
9145         before checking whether it's out of range.  Put the check inside
9146         eassert.  See
9147         <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
9149 2012-05-27  Ken Brown  <kbrown@cornell.edu>
9151         * callproc.c (Fcall_process): Restore a line that was accidentally
9152         commented out in the 2011-02-13 change (bug#11547).
9154 2012-05-27  Eli Zaretskii  <eliz@gnu.org>
9156         * lisp.h [REL_ALLOC]: Add prototypes for external functions
9157         defined on ralloc.c.
9159         * buffer.c [REL_ALLOC]: Remove prototypes of
9160         r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
9161         they are now on lisp.h.
9163         * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
9165         * search.c (search_buffer): Use it to inhibit relocation of buffer
9166         text while re_search_2 is doing its job, because re_search_2 is
9167         passed C pointers to buffer text.  (Bug#11519)
9169         * msdos.c (internal_terminal_init) <Vwindow_system_version>:
9170         Update value to 24.
9172         * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
9173         state after an additional call to move_it_in_display_line_to, keep
9174         the values of it->max_ascent and it->max_descent found for the
9175         entire line.
9176         (pos_visible_p): Revert the comparison against bottom_y to what it
9177         was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
9178         (Bug#11464)
9180 2012-05-26  Paul Eggert  <eggert@cs.ucla.edu>
9182         Fix coding-related core dumps with gcc -ftrapv.
9183         The code was computing A - B, where A and B are pointers, and B is
9184         random garbage.  This can lead to core dumps on platforms that
9185         have special pointer registers, and it also leads to core dumps on
9186         x86-64 when compiled with gcc -ftrapv.  The fix is to compute
9187         A - B only when B is initialized properly.
9188         * coding.c (coding_set_source, coding_set_destination): Return void.
9189         (coding_change_source, coding_change_destinations): New functions,
9190         with the old behaviors of coding_set_source and coding_set_destination.
9191         All callers that need an offset changed to use these new functions.
9193 2012-05-26  Glenn Morris  <rgm@gnu.org>
9195         * nsterm.m (ns_init_paths): Don't mess with INFOPATH.  (Bug#2791)
9197 2012-05-26  Eli Zaretskii  <eliz@gnu.org>
9199         Extend mouse support on W32 text-mode console.
9200         * xdisp.c (draw_row_with_mouse_face):
9201         Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
9203         * w32console.c: Include window.h.
9204         (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
9205         New functions.
9206         (initialize_w32_display): Initialize mouse-highlight data.
9208         * w32inevt.c: Include termchar.h and window.h.
9209         (do_mouse_event): Support mouse-autoselect-window.  When the mouse
9210         moves, call note_mouse_highlight.  If help_echo changed, call
9211         gen_help_event to produce help-echo message in the echo area.
9212         Call clear_mouse_face if mouse_face_hidden is set in the mouse
9213         highlight info.
9215 2012-05-26  Paul Eggert  <eggert@cs.ucla.edu>
9217         * lread.c (read1): Simplify slightly to avoid an overflow warning
9218         with GCC 4.7.0 on x86-64.
9220 2012-05-26  Eli Zaretskii  <eliz@gnu.org>
9222         * bidi.c (bidi_mirror_char): Revert last change: an int is
9223         definitely wide enough here.
9225 2012-05-25  Paul Eggert  <eggert@cs.ucla.edu>
9227         Fix integer width and related bugs (Bug#9874).
9228         * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
9229         (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
9230         (string_bytes, check_sblock, allocate_string_data):
9231         (compact_small_strings, Fmake_bool_vector, make_string)
9232         (make_unibyte_string, make_multibyte_string)
9233         (make_string_from_bytes, make_specified_string)
9234         (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
9235         (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
9236         (mark_vectorlike):
9237         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9238         (allocate_pseudovector):
9239         Use int, not EMACS_INT, where int is wide enough.
9240         (inhibit_garbage_collection, Fgarbage_collect):
9241         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9242         * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
9243         int might not be wide enough.
9244         (bidi_cache_search, bidi_cache_find, bidi_init_it)
9245         (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
9246         (bidi_at_paragraph_end, bidi_find_paragraph_start)
9247         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
9248         (bidi_level_of_next_char, bidi_move_to_visually_next):
9249         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9250         * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
9251         (Fkill_buffer, Fset_buffer_major_mode)
9252         (advance_to_char_boundary, Fbuffer_swap_text)
9253         (Fset_buffer_multibyte, overlays_at, overlays_in)
9254         (overlay_touches_p, struct sortvec, record_overlay_string)
9255         (overlay_strings, recenter_overlay_lists)
9256         (adjust_overlays_for_insert, adjust_overlays_for_delete)
9257         (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
9258         (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
9259         (Foverlay_recenter, last_overlay_modification_hooks_used)
9260         (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
9261         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9262         (validate_region): Omit unnecessary test for b <= e,
9263         since that's guaranteed by the previous test.
9264         (adjust_overlays_for_delete): Avoid pos + length overflow.
9265         (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
9266         (report_overlay_modification):
9267         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9268         (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
9269         Omit pointer cast, which isn't needed anyway, and doesn't work
9270         after the EMACS_INT -> ptrdiff_t change.
9271         (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
9272         * buffer.h: Adjust decls to match defn changes elsewhere.
9273         (struct buffer_text, struct buffer):
9274         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9275         Use EMACS_INT, not int, where int might not be wide enough.
9276         * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
9277         not int, to avoid needless 32-bit limit on 64-bit hosts.
9278         (exec_byte_code): Use tighter memory-full test, one that checks
9279         for alloca overflow.  Don't compute the address of the object just
9280         before an array, as that's not portable.  Use EMACS_INT, not
9281         ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
9282         * callint.c (Fcall_interactively):
9283         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9284         * callproc.c (call_process_kill, Fcall_process):
9285         Don't assume pid_t fits into an Emacs fixnum.
9286         (call_process_cleanup, Fcall_process, child_setup):
9287         Don't assume pid_t fits into int.
9288         (call_process_cleanup, Fcall_process, delete_temp_file)
9289         (Fcall_process_region):
9290         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9291         (Fcall_process): Simplify handling of volatile integers.
9292         Use int, not EMACS_INT, where int will do.
9293         * casefiddle.c (casify_object, casify_region, operate_on_word)
9294         (Fupcase_word, Fdowncase_word, Fcapitalize_word):
9295         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9296         (casify_object): Avoid integer overflow when overallocating buffer.
9297         * casetab.c (set_identity, shuffle): Prefer int to unsigned when
9298         either works.  Use lint_assume to convince GCC 4.6.1 that it's OK.
9299         * category.c (Fchar_category_set): Don't assume fixnum fits in int.
9300         * category.h (CATEGORYP): Don't assume arg is nonnegative.
9301         * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
9302         integers are now checked earlier.  All uses replaced with XINT.
9303         (ccl_driver):
9304         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9305         For CCL_MapSingle, check that content and value are in int range.
9306         (ccl_driver, Fregister_code_conversion_map):
9307         Check that Vcode_version_map_vector is a vector.
9308         (resolve_symbol_ccl_program): Check that vector header is in range.
9309         Always copy the vector, so that we can check its contents reliably
9310         now rather than having to recheck each instruction as it's being
9311         executed.  Check that vector words fit in 'int'.
9312         (ccl_get_compiled_code, Fregister_ccl_program)
9313         (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
9314         program indexes, to avoid needless 32-bit limit on 64-bit hosts.
9315         (Fccl_execute, Fccl_execute_on_string): Check that initial reg
9316         contents are in range.
9317         (Fccl_execute_on_string): Check that status is in range.
9318         * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
9319         * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
9320         Accept and return EMACS_INT, not int, because callers can pass values
9321         out of 'int' range.
9322         (c_string_width, strwidth, lisp_string_width, chars_in_text)
9323         (multibyte_chars_in_text, parse_str_as_multibyte)
9324         (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
9325         (str_as_unibyte, str_to_unibyte, string_count_byte8)
9326         (string_escape_byte8, Fget_byte):
9327         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9328         (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
9329         avoid mishandling large integers.
9330         * character.h: Adjust decls to match defn changes elsewhere.
9331         * charset.c (load_charset_map_from_file, find_charsets_in_text)
9332         (Ffind_charset_region):
9333         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9334         (load_charset_map_from_file): Redo idx calculation to avoid overflow.
9335         (load_charset_map_from_vector, Fdefine_charset_internal):
9336         Don't assume fixnum fits in int.
9337         (load_charset_map_from_vector, Fmap_charset_chars):
9338         Remove now-unnecessary CHECK_NATNUMs.
9339         (Fdefine_charset_internal): Check ranges here, more carefully.
9340         Don't rely on undefined behavior with signed left shift overflow.
9341         Don't assume unsigned int fits into fixnum, or that fixnum fits
9342         into unsigned int.  Don't require max_code to be a valid fixnum;
9343         that's not true for gb10830 4-byte on a 32-bit host.  Allow
9344         invalid_code to be a cons, for the same reason.  Require code_offset
9345         to be a character.  Avoid int overflow if max_char is close
9346         to INT_MAX.
9347         (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
9348         this is intended anyway and avoids some undefined behavior.
9349         (load_charset_map): Pass unsigned, not int, as 2nd arg of
9350         INDEX_TO_CODE_POINT, as that's what it expects.
9351         (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
9352         * charset.h (DECODE_CHAR): Return int, not unsigned;
9353         this is what was intended anyway, and it avoids undefined behavior.
9354         (CHARSET_OFFSET): Remove unused macro, instead of fixing its
9355         integer-overflow issues.
9356         (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
9357         Formerly, it returned EMACS_INT on 64-bit hosts in the common case
9358         where the argument is EMACS_INT, and this behavior is not intended.
9359         * chartab.c (Fmake_char_table, Fset_char_table_range)
9360         (uniprop_get_decoder, uniprop_get_encoder):
9361         Don't assume fixnum fits in int.
9362         * cmds.c (move_point): New function, that does the gist of
9363         Fforward_char and Fbackward_char, but does so while checking
9364         for integer overflow more accurately.
9365         (Fforward_char, Fbackward_char): Use it.
9366         (Fforward_line, Fend_of_line, internal_self_insert)
9367         (internal_self_insert):
9368         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9369         Fix a FIXME, by checking for integer overflow when calculating
9370         target_clm and actual_clm.
9371         * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
9372         (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
9373         (ASSURE_DESTINATION, coding_alloc_by_realloc)
9374         (coding_alloc_by_making_gap, alloc_destination)
9375         (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
9376         (encode_coding_utf_16, detect_coding_emacs_mule)
9377         (decode_coding_emacs_mule, encode_coding_emacs_mule)
9378         (detect_coding_iso_2022, decode_coding_iso_2022)
9379         (encode_invocation_designation, encode_designation_at_bol)
9380         (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
9381         (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
9382         (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
9383         (encode_coding_ccl, encode_coding_raw_text)
9384         (detect_coding_charset, decode_coding_charset)
9385         (encode_coding_charset, detect_eol, decode_eol, produce_chars)
9386         (produce_composition, produce_charset, produce_annotation)
9387         (decode_coding, handle_composition_annotation)
9388         (handle_charset_annotation, consume_chars, decode_coding_gap)
9389         (decode_coding_object, encode_coding_object, detect_coding_system)
9390         (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
9391         (code_convert_region, code_convert_string)
9392         (Fdefine_coding_system_internal)
9393         (coding_set_source, coding_set_destination):
9394         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9395         (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
9396         (Fdefine_coding_system_internal):
9397         Don't assume fixnums fit in int.
9398         (decode_coding_gap, decode_coding_object, encode_coding_object)
9399         (Fread_coding_system, Fdetect_coding_region)
9400         (Funencodable_char_position, Fcheck_coding_systems_region)
9401         (get_translation, handle_composition_annotation, consume_chars):
9402         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9403         (consume_chars): Rewrite to not calculate an address outside buffer.
9404         (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
9405         Don't access memory outside of the args array.
9406         (Fdefine_coding_system_internal): Check for charset-id overflow.
9407         (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
9408         result of ENCODE_CHAR.
9409         * coding.h: Adjust decls to match defn changes elsewhere.
9410         (struct coding_system):
9411         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9412         * composite.c (get_composition_id, find_composition)
9413         (run_composition_function, update_compositions)
9414         (compose_text, composition_gstring_put_cache)
9415         (composition_gstring_p, composition_gstring_width)
9416         (fill_gstring_header, fill_gstring_body, autocmp_chars)
9417         (composition_compute_stop_pos, composition_reseat_it)
9418         (composition_update_it, struct position_record)
9419         (find_automatic_composition, composition_adjust_point)
9420         (Fcomposition_get_gstring, Ffind_composition_internal):
9421         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9422         (update_compositions):
9423         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9424         * composite.h: Adjust decls to match defn changes elsewhere.
9425         (struct composition):
9426         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9427         * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
9428         Do not attempt to compute the address of the object just before a
9429         buffer; this is not portable.
9430         (Faref, Faset):
9431         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9432         (Faset): Use int, not EMACS_INT, where int is wide enough.
9433         (Fstring_to_number): Don't assume fixnums fit in int.
9434         (Frem): Don't assume arg is nonnegative.
9435         * dbusbind.c (xd_append_arg): Check for integers out of range.
9436         (Fdbus_call_method): Don't overflow the timeout int.
9437         (extract_signed, extract_unsigned): New functions.
9438         (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
9439         (xd_get_connection_references): Return ptrdiff_t, not int.
9440         All uses changed.
9441         (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
9442         (xd_read_message_1):
9443         Use int, not unsigned, where the dbus API uses int.
9444         (Fdbus_message_internal): Don't overflow mtype.
9445         (syms_of_dbusbind): Allocate right-sized buffer for integers.
9446         * dired.c (directory_files_internal, file_name_completion, scmp)
9447         (file_name_completion_stat):
9448         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9449         (file_name_completion): Don't overflow matchcount.
9450         (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
9451         * dispextern.h: Adjust decls to match defn changes elsewhere.
9452         (struct text_pos, struct glyph, struct bidi_saved_info)
9453         (struct bidi_string_data, struct bidi_it, struct composition_it)
9454         (struct it):
9455         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9456         (struct display_pos, struct composition_it, struct it):
9457         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9458         * dispnew.c (increment_matrix_positions)
9459         (increment_row_positions, mode_line_string)
9460         (marginal_area_string):
9461         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9462         (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
9463         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9464         (duration_to_sec_usec): New function, to check for overflow better.
9465         (Fsleep_for, sit_for): Use it.
9466         * doc.c (get_doc_string, store_function_docstring):
9467         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9468         (get_doc_string, Fsnarf_documentation):
9469         Use int, not EMACS_INT, where int is wide enough.
9470         (get_doc_string):
9471         Use SAFE_ALLOCA, not alloca.
9472         Check for overflow when converting EMACS_INT to off_t.
9473         * doprnt.c (doprnt):
9474         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9475         * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
9476         Don't assume uid_t fits into fixnum.
9477         (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
9478         (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
9479         (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
9480         (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
9481         (general_insert_function)
9482         (Finsert_char, make_buffer_string, make_buffer_string_both)
9483         (update_buffer_properties, Fbuffer_substring)
9484         (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
9485         (Fsubst_char_in_region, check_translation)
9486         (Ftranslate_region_internal, save_restriction_restore, Fformat)
9487         (transpose_markers, Ftranspose_regions):
9488         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9489         (clip_to_bounds): Move to lisp.h as an inline function).
9490         (Fconstrain_to_field): Don't assume integers are nonnegative.
9491         (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
9492         (Fsubst_char_in_region, Fsave_restriction):
9493         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9494         (Femacs_pid): Don't assume pid_t fits into fixnum.
9495         (lo_time): Use int, not EMACS_INT, when int suffices.
9496         (lisp_time_argument): Check for usec out of range.
9497         (Fencode_time): Don't assume fixnum fits in int.
9498         (Fuser_login_name, Fuser_full_name): Signal an error
9499         if a uid argument is out of range, rather than relying on
9500         undefined behavior.
9501         (Fformat_time_string): Remove now-unnecessary check.
9502         lisp_time_argument checks for out-of-range usec now.
9503         Use ptrdiff_t, not size_t, where ptrdiff_t will do.
9504         * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
9505         (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
9506         (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
9507         (init_cmdargs, Fdump_emacs):
9508         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9509         (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
9510         the bottom (typically) 32 bits of the fixnum.
9511         * eval.c (specpdl_size, call_debugger):
9512         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9513         (when_entered_debugger, Fbacktrace_debug):
9514         Don't assume fixnum can fit in int.
9515         (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
9516         the object just before a buffer; this is not portable.
9517         (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
9518         (grow_specpdl, unbind_to):
9519         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9520         (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
9521         (grow_specpdl): Simplify allocation by using xpalloc.
9522         (Fprog1, Fprog2): Don't assume list length fits in int.  Simplify.
9523         * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
9524         (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
9525         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9526         (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
9527         (a_write, e_write):
9528         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9529         (Fcopy_file, non_regular_nbytes, read_non_regular)
9530         (Finsert_file_contents):
9531         Use int, not EMACS_INT, where int is wide enough.
9532         (READ_BUF_SIZE): Verify that it fits in int.
9533         (Finsert_file_contents): Check that counts are in proper range,
9534         rather than assuming fixnums fit into ptrdiff_t etc.
9535         Don't assume fixnums fit into int.
9536         * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
9537         * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
9538         (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
9539         (string_char_to_byte, string_byte_to_char)
9540         (string_make_multibyte, string_to_multibyte)
9541         (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
9542         (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
9543         (substring_both, Fdelete, internal_equal, Ffillarray)
9544         (Fclear_string, mapcar1)
9545         (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
9546         (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
9547         (larger_vector, make_hash_table, maybe_resize_hash_table)
9548         (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
9549         (Fmaphash, secure_hash):
9550         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9551         (concat): Check for string index and length overflow.
9552         (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
9553         (Frequire):
9554         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9555         (larger_vector): New API (vec, incr_min, size_max) replaces old
9556         one (vec, new_size, init).  This catches size overflow.
9557         INIT was removed because it was always Qnil.
9558         All callers changed.
9559         (INDEX_SIZE_BOUND): New macro, which calculates more precisely
9560         the upper bound on a hash table index size.
9561         (make_hash_table, maybe_resize_hash_table): Use it.
9562         (secure_hash): Computer start_byte and end_byte only after
9563         they're known to be in ptrdiff_t range.
9564         * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
9565         (Ffont_get_glyphs, Ffont_at):
9566         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9567         (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
9568         (Flist_fonts, Fopen_font):
9569         Don't assume fixnum can fit in int.
9570         (check_gstring): Don't assume index can fit in int.
9571         (font_match_p): Check that fixnum is a character, not a nonnegative
9572         fixnum, since the later code needs to stuff it into an int.
9573         (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
9574         (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
9575         conversion overflow issues.
9576         (Fopen_font): Check for integer out of  range.
9577         (Ffont_get_glyphs): Don't assume index can fit in int.
9578         * font.h: Adjust decls to match defn changes elsewhere.
9579         * fontset.c (reorder_font_vector): Redo score calculation to avoid
9580         integer overflow.
9581         (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
9582         printmax_t, where ptrdiff_t is wide enough.
9583         (Finternal_char_font):
9584         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9585         * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
9586         (Fset_frame_height, Fset_frame_width, Fset_frame_size)
9587         (Fset_frame_position, x_set_frame_parameters)
9588         (x_set_line_spacing, x_set_border_width)
9589         (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
9590         Check that fixnums are in proper range for system types.
9591         (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
9592         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9593         (Fmodify_frame_parameters): Don't assume fixnum fits in int.
9594         Use SAFE_ALLOCA_LISP, not alloca.
9595         * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
9596         intptr_t is wide enough.
9597         * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
9598         (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
9599         (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
9600         Check for fixnum out of range.
9601         * ftfont.c (ftfont_list): Don't assume index fits in int.
9602         Check that fixnums are in proper range for system types.
9603         (ftfont_shape_by_flt):
9604         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9605         * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
9606         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9607         (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
9608         Check that fixnums are in proper range for system types.
9609         * gnutls.h: Adjust decls to match defn changes elsewhere.
9610         * gtkutil.c (xg_dialog_run):
9611         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9612         (update_frame_tool_bar):
9613         Check that fixnums are in proper range for system types.
9614         * image.c (parse_image_spec): Redo count calculation to avoid overflow.
9615         (lookup_image): Check that fixnums are in range for system types.
9616         * indent.c (last_known_column, last_known_column_point):
9617         (current_column_bol_cache):
9618         (skip_invisible, current_column, check_display_width):
9619         (check_display_width, scan_for_column, current_column_1)
9620         (Findent_to, Fcurrent_indentation, position_indentation)
9621         (indented_beyond_p, Fmove_to_column, compute_motion):
9622         (Fcompute_motion, Fvertical_motion):
9623         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9624         (last_known_column_modified): Use EMACS_INT, not int.
9625         (check_display_width):
9626         (Fcompute_motion):
9627         Check that fixnums and floats are in proper range for system types.
9628         (compute_motion): Don't assume index or fixnum fits in int.
9629         (compute_motion, Fcompute_motion):
9630         Use int, not EMACS_INT, when it is wide enough.
9631         (vmotion): Omit local var start_hpos that is always 0; that way
9632         we don't need to worry about overflow in expressions involving it.
9633         * indent.h: Adjust decls to match defn changes elsewhere.
9634         (struct position):
9635         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9636         Use int, not EMACS_INT, where int is wide enough.
9637         Remove unused members ovstring_chars_done and tab_offset;
9638         all uses removed.
9639         * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
9640         (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
9641         (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
9642         (make_gap, copy_text, insert, insert_and_inherit)
9643         (insert_before_markers, insert_before_markers_and_inherit)
9644         (insert_1, count_combining_before, count_combining_after)
9645         (insert_1_both, insert_from_string)
9646         (insert_from_string_before_markers, insert_from_string_1)
9647         (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
9648         (adjust_after_replace, adjust_after_insert, replace_range)
9649         (replace_range_2, del_range, del_range_1, del_range_byte)
9650         (del_range_both, del_range_2, modify_region)
9651         (prepare_to_modify_buffer, signal_before_change)
9652         (signal_after_change, Fcombine_after_change_execute):
9653         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9654         * intervals.c (traverse_intervals, rotate_right, rotate_left)
9655         (balance_an_interval, split_interval_right, split_interval_left)
9656         (find_interval, next_interval, update_interval)
9657         (adjust_intervals_for_insertion, delete_node, delete_interval)
9658         (interval_deletion_adjustment, adjust_intervals_for_deletion)
9659         (static_offset_intervals, offset_intervals)
9660         (merge_interval_right, merge_interval_left, make_new_interval)
9661         (graft_intervals_into_buffer, temp_set_point_both)
9662         (temp_set_point, set_point, adjust_for_invis_intang)
9663         (set_point_both, move_if_not_intangible, get_property_and_range)
9664         (get_local_map, copy_intervals, copy_intervals_to_string)
9665         (compare_string_intervals, set_intervals_multibyte_1):
9666         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9667         * intervals.h: Adjust decls to match defn changes elsewhere.
9668         (struct interval):
9669         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9670         * keyboard.c (this_command_key_count, this_single_command_key_start)
9671         (before_command_key_count, before_command_echo_length, echo_now)
9672         (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
9673         (command_loop_1, safe_run_hooks, read_char, timer_check_2)
9674         (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
9675         (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
9676         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9677         (last_non_minibuf_size, last_point_position, echo_truncate)
9678         (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
9679         (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
9680         (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
9681         (stuff_buffered_input):
9682         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9683         (last_auto_save, command_loop_1, read_char):
9684         Use EMACS_INT, not int, to avoid integer overflow.
9685         (record_char): Avoid overflow in total_keys computation.
9686         (parse_modifiers_uncached): Redo index calculation to avoid overflow.
9687         * keyboard.h: Adjust decls to match defn changes elsewhere.
9688         * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
9689         (Fkey_description, Fdescribe_vector, Flookup_key):
9690         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9691         (click_position): New function, to check that positions are in range.
9692         (Fcurrent_active_maps):
9693         (describe_command):
9694         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9695         (Faccessible_keymaps, Fkey_description):
9696         (preferred_sequence_p):
9697         Don't assume fixnum can fit into int.
9698         (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
9699         Check for integer overflow in size calculations.
9700         (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
9701         avoid mishandling large integers.
9702         * lisp.h: Adjust decls to match defn changes elsewhere.
9703         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
9704         (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
9705         (struct Lisp_Marker):
9706         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9707         (clip_to_bounds): Now an inline function, moved here from editfns.c.
9708         (GLYPH_CODE_P): Check for overflow in system types, subsuming the
9709         need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
9710         All callers changed.
9711         (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
9712         Assume the arg has valid form, since it always does.
9713         (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
9714         unsigned integer system type.
9715         (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
9716         (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
9717         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9718         (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
9719         (duration_to_sec_usec): New decl.
9720         * lread.c (read_from_string_index, read_from_string_index_byte)
9721         (read_from_string_limit, readchar, unreadchar, openp)
9722         (read_internal_start, read1, oblookup):
9723         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9724         (Fload, readevalloop, Feval_buffer, Feval_region):
9725         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9726         (openp): Check for out-of-range argument to 'access'.
9727         (read1): Use int, not EMACS_INT, where int is wide enough.
9728         Don't assume fixnum fits into int.
9729         Fix off-by-one error that can read outside a buffer.
9730         (read_filtered_event): Use duration_to_sec_usec
9731         to do proper overflow checking on durations.
9732         * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
9733         in size calculation.
9734         (Fexecute_kbd_macro):
9735         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9736         * marker.c (cached_charpos, cached_bytepos, CONSIDER)
9737         (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
9738         (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
9739         (set_marker_both, set_marker_restricted_both, marker_position)
9740         (marker_byte_position, Fbuffer_has_markers_at):
9741         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9742         (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
9743         * menu.c (ensure_menu_items): Rename from grow_menu_items.
9744         It now merely ensures that the menu is large enough, without
9745         necessarily growing it, as this avoids some integer overflow issues.
9746         All callers changed.
9747         (keymap_panes, parse_single_submenu, Fx_popup_menu):
9748         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9749         (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
9750         Use SAFE_ALLOCA_LISP, not alloca.
9751         (find_and_return_menu_selection): Avoid unnecessary casts of pointers
9752         to EMACS_INT.  Check that fixnums are in proper range for system types.
9753         * minibuf.c (minibuf_prompt_width, string_to_object)
9754         (Fminibuffer_contents, Fminibuffer_contents_no_properties)
9755         (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
9756         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9757         (get_minibuffer, read_minibuf_unwind):
9758         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9759         (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
9760         this simplifies overflow checking.  All callers changed.
9761         (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
9762         (Ftest_completion):
9763         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9764         * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
9765         (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
9766         Check that fixnums are in proper range for system types.
9767         (Fx_create_frame, Fx_show_tip):
9768         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9769         * nsfont.m (ns_findfonts, nsfont_list_family):
9770         Don't assume fixnum fits in long.
9771         * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
9772         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9773         (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
9774         wide enough.
9775         * nsselect.m (ns_get_local_selection, clean_local_selection_data):
9776         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9777         * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
9778         (PRINTDECLARE, PRINTPREPARE):
9779         (strout, print_string):
9780         (print, print_preprocess, print_check_string_charset_prop)
9781         (print_object):
9782         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9783         (PRINTDECLARE):
9784         (temp_output_buffer_setup, Fprin1_to_string, print_object):
9785         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9786         (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
9787         (printchar, strout): Use xpalloc to catch size calculation overflow.
9788         (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
9789         (print_error_message): Use SAFE_ALLOCA, not alloca.
9790         (print_object): Use int, not EMACS_INT, where int is wide enough.
9791         (print_depth, new_backquote_output, print_number_index):
9792         Use ptrdiff_t, not int, where int might not be wide enough.
9793         * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
9794         (Fset_process_window_size, Fformat_network_address)
9795         (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
9796         (sigchld_handler):
9797         Check that fixnums are in proper range for system types.
9798         (Fsignal_process): Simplify by avoiding a goto.
9799         Check for process-ids out of pid_t range rather than relying on
9800         undefined behavior.
9801         (process_tick, update_tick): Use EMACS_INT, not int.
9802         (Fformat_network_address, read_process_output, send_process)
9803         (Fprocess_send_region, status_notify):
9804         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9805         (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
9806         (wait_reading_process_output, read_process_output, exec_sentinel):
9807         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9808         (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
9809         (Faccept_process_output): Use duration_to_sec_usec to do proper
9810         overflow checking on durations.
9811         (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
9812         Don't assume pid_t fits in int.
9813         * process.h (struct Lisp_Process): Members tick and update_tick
9814         are now of type EMACS_INT, not int.
9815         * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
9816         configured --with-wide-int.
9817         * scroll.c (calculate_scrolling, calculate_direct_scrolling)
9818         (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
9819         * search.c (looking_at_1, string_match_1):
9820         (fast_string_match, fast_c_string_match_ignore_case)
9821         (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
9822         (scan_newline, find_before_next_newline, search_command)
9823         (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
9824         (set_search_regs, wordify):
9825         (Freplace_match):
9826         (Fmatch_data):
9827         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9828         (string_match_1, search_buffer, set_search_regs):
9829         (Fmatch_data):
9830         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9831         (wordify): Check for overflow in size calculation.
9832         (Freplace_match): Avoid potential buffer overflow in search_regs.start.
9833         (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
9834         Check that fixnums are in proper range for system types.
9835         * sound.c (struct sound_device)
9836         (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
9837         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9838         (Fplay_sound_internal):
9839         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9840         * syntax.c (struct lisp_parse_state, find_start_modiff)
9841         (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
9842         (Fparse_partial_sexp):
9843         Don't assume fixnums can fit in int.
9844         (struct lisp_parse_state, find_start_pos, find_start_value)
9845         (find_start_value_byte, find_start_begv)
9846         (update_syntax_table, char_quoted, dec_bytepos)
9847         (find_defun_start, prev_char_comend_first, back_comment):
9848         (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
9849         (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
9850         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9851         (Finternal_describe_syntax_value): Check that match_lisp is a
9852         character, not an integer, since the code stuffs it into int.
9853         (scan_words, scan_sexps_forward):
9854         Check that fixnums are in proper range for system types.
9855         (Fforward_word):
9856         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9857         (scan_sexps_forward):
9858         Use CHARACTERP, not INTEGERP, since the value must fit into int.
9859         (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
9860         * syntax.h: Adjust decls to match defn changes elsewhere.
9861         (struct gl_state_s):
9862         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9863         (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
9864         MOST_POSITIVE_FIXNUM.
9865         * sysdep.c (wait_for_termination_1, wait_for_termination)
9866         (interruptible_wait_for_termination, mkdir):
9867         Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
9868         (emacs_read, emacs_write):
9869         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9870         (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
9871         and double all fit in int.
9872         * term.c (set_tty_color_mode):
9873         Check that fixnums are in proper range for system types.
9874         * termhooks.h (struct input_event):
9875         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9876         * textprop.c (validate_interval_range, interval_of)
9877         (Fadd_text_properties, set_text_properties_1)
9878         (Fremove_text_properties, Fremove_list_of_text_properties)
9879         (Ftext_property_any, Ftext_property_not_all)
9880         (copy_text_properties, text_property_list, extend_property_ranges)
9881         (verify_interval_modification):
9882         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9883         (Fnext_single_char_property_change)
9884         (Fprevious_single_char_property_change):
9885         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9886         (copy_text_properties):
9887         Check for integer overflow in index calculation.
9888         * undo.c (last_boundary_position, record_point, record_insert)
9889         (record_delete, record_marker_adjustment, record_change)
9890         (record_property_change):
9891         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9892         (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
9893         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9894         * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
9895         (Fx_hide_tip, Fx_file_dialog):
9896         * w32menu.c (set_frame_menubar):
9897         Use ptrdiff_t, not int, for consistency with rest of code.
9898         * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
9899         (select_window, Fdelete_other_windows_internal)
9900         (window_scroll_pixel_based, window_scroll_line_based)
9901         (Frecenter, Fset_window_configuration):
9902         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9903         (Fset_window_hscroll, run_window_configuration_change_hook)
9904         (set_window_buffer, temp_output_buffer_show, scroll_command)
9905         (Fscroll_other_window, Frecenter):
9906         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9907         (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
9908         Don't assume fixnum fits in int.
9909         (Fset_window_scroll_bars):
9910         Check that fixnums are in proper range for system types.
9911         * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
9912         (string_pos, c_string_pos, number_of_chars, init_iterator)
9913         (in_ellipses_for_invisible_text_p, init_from_display_pos)
9914         (compute_stop_pos, next_overlay_change, compute_display_string_pos)
9915         (compute_display_string_end, handle_face_prop)
9916         (face_before_or_after_it_pos, handle_invisible_prop)
9917         (handle_display_prop, handle_display_spec, handle_single_display_spec)
9918         (display_prop_intangible_p, string_buffer_position_lim)
9919         (string_buffer_position, handle_composition_prop, load_overlay_strings)
9920         (get_overlay_strings_1, get_overlay_strings)
9921         (iterate_out_of_display_property, forward_to_next_line_start)
9922         (back_to_previous_visible_line_start, reseat, reseat_to_string)
9923         (get_next_display_element, set_iterator_to_next)
9924         (get_visually_first_element, compute_stop_pos_backwards)
9925         (handle_stop_backwards, next_element_from_buffer)
9926         (move_it_in_display_line_to, move_it_in_display_line)
9927         (move_it_to, move_it_vertically_backward, move_it_by_lines)
9928         (add_to_log, message_dolog, message_log_check_duplicate)
9929         (message2, message2_nolog, message3, message3_nolog
9930         (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
9931         (current_message_1, truncate_echo_area, truncate_message_1)
9932         (set_message, set_message_1, store_mode_line_noprop)
9933         (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
9934         (text_outside_line_unchanged_p, check_point_in_composition)
9935         (reconsider_clip_changes)
9936         (redisplay_internal, set_cursor_from_row, try_scrolling)
9937         (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
9938         (redisplay_window, find_last_unchanged_at_beg_row)
9939         (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
9940         (trailing_whitespace_p, find_row_edges, display_line)
9941         (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
9942         (display_mode_element, store_mode_line_string)
9943         (pint2str, pint2hrstr, decode_mode_spec)
9944         (display_count_lines, display_string, draw_glyphs)
9945         (x_produce_glyphs, x_insert_glyphs)
9946         (rows_from_pos_range, mouse_face_from_buffer_pos)
9947         (fast_find_string_pos, mouse_face_from_string_pos)
9948         (note_mode_line_or_margin_highlight, note_mouse_highlight):
9949         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9950         (safe_call, init_from_display_pos, handle_fontified_prop)
9951         (handle_single_display_spec, load_overlay_strings)
9952         (with_echo_area_buffer, setup_echo_area_for_printing)
9953         (display_echo_area, echo_area_display)
9954         (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
9955         (update_tool_bar, hscroll_window_tree, redisplay_internal)
9956         (redisplay_window, dump_glyph_row, display_mode_line)
9957         (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
9958         (handle_display_spec, display_prop_string_p):
9959         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9960         (handle_single_display_spec, build_desired_tool_bar_string)
9961         (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
9962         (get_specified_cursor_type):
9963         Check that fixnums are in proper range for system types.
9964         (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
9965         (Flookup_image_map):
9966         Don't assume fixnums fit in int.
9967         (compare_overlay_entries):
9968         Avoid mishandling comparisons due to subtraction overflow.
9969         (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
9970         (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
9971         (handle_tool_bar_click):
9972         Use int, not unsigned, since we prefer signed and the signedness
9973         doesn't matter here.
9974         (get_next_display_element, next_element_from_display_vector):
9975         Use int, not EMACS_INT, when int is wide enough.
9976         (start_hourglass): Use duration_to_sec_usec to do proper
9977         overflow checking on durations.
9978         * xfaces.c (Fbitmap_spec_p):
9979         Check that fixnums are in proper range for system types.
9980         (compare_fonts_by_sort_order):
9981         Avoid mishandling comparisons due to subtraction overflow.
9982         (Fx_family_fonts, realize_basic_faces):
9983         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9984         (Fx_family_fonts):
9985         Don't assume fixnum fits in int.
9986         Use SAFE_ALLOCA_LISP, not alloca.
9987         (merge_face_heights): Remove unnecessary cast to EMACS_INT.
9988         (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
9989         (face_at_buffer_position, face_for_overlay_string)
9990         (face_at_string_position):
9991         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9992         (merge_faces): Use int, not EMACS_INT, where int is wide enough.
9993         * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
9994         (Fx_show_tip):
9995         Check that fixnums are in proper range for system types.
9996         (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
9997         (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
9998         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9999         (Fx_change_window_property): Don't assume fixnums fit in int.
10000         * xfont.c (xfont_chars_supported):
10001         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10002         * xmenu.c (Fx_popup_dialog, set_frame_menubar)
10003         (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
10004         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10005         * xml.c (parse_region):
10006         * xrdb.c (magic_file_p):
10007         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10008         * xselect.c (TRACE1): Don't assume pid_t promotes to int.
10009         (x_get_local_selection, x_reply_selection_request)
10010         (x_handle_selection_request, wait_for_property_change):
10011         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10012         (selection_data_to_lisp_data): Use short, not EMACS_INT, where
10013         short is wide enough.
10014         (x_send_client_event): Don't assume fixnum fits in int.
10015         * xterm.c (x_x_to_emacs_modifiers):
10016         Don't assume EMACS_INT overflows nicely into int.
10017         (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
10018         may come from Lisp.
10019         (handle_one_xevent): NATNUMP can eval its arg twice.
10020         (x_connection_closed):
10021         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10022         * xterm.h: Adjust decls to match defn changes elsewhere.
10023         (struct scroll_bar): Use struct vectorlike_header
10024         rather than rolling our own approximation.
10025         (SCROLL_BAR_VEC_SIZE): Remove; not used.
10027 2012-05-25  Glenn Morris  <rgm@gnu.org>
10029         * lisp.mk (lisp): Update for more files being compiled now.
10031 2012-05-25  Stefan Monnier  <monnier@iro.umontreal.ca>
10033         * lread.c: Remove `read_pure' which makes no difference.
10034         (read_pure): Remove var.
10035         (unreadpure): Remove function.
10036         (readevalloop): Don't call read_list with -1 flag.
10037         (read1, read_vector): Don't test read_pure any more.
10038         (read_list): Simplify.
10040         * fileio.c, character.h: Minor style tweaks.
10042 2012-05-24  Dmitry Antipov  <dmantipov@yandex.ru>
10044         * window.h (clip_changed): Remove useless declaration.
10046 2012-05-22  Juanma Barranquero  <lekktu@gmail.com>
10048         * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
10049         (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
10051 2012-05-22  Paul Eggert  <eggert@cs.ucla.edu>
10053         Remove src/m/*.
10054         This directory predates autoconf and is no longer needed nowadays.
10055         Move its few remaining bits of functionality to where they're needed.
10056         * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
10057         * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
10058         * m/template.h: Remove.
10059         * Makefile.in (M_FILE): Remove.  All uses removed.
10060         * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
10061         * lisp.h (USE_LSB_TAG):
10062         * mem-limits.h (EXCEEDS_LISP_PTR):
10063         Use VAL_MAX, not VALBITS, in #if.
10064         * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
10065         (EMACS_UINT): Define unconditionally now.
10066         (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
10067         (BITS_PER_EMACS_INT): New constants, replacing
10068         what used to be in config.h, but not useful in #if.
10069         (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
10070         define them any more.
10071         (VAL_MAX): New macro.
10072         (VALMASK): Use it.
10073         * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
10074         BITS_PER_EMACS_INT, in #if.
10075         * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
10076         (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
10077         * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
10078         * s/ms-w32.h (DATA_START):
10079         Move here from removed file m/intel386.h.
10080         * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
10081         * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
10083 2012-05-21  Paul Eggert  <eggert@cs.ucla.edu>
10085         Assume C89 or later.
10086         * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
10087         * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
10088         (xrealloc):
10089         * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
10090         * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
10091         * textprop.c, tparam.c (NULL): Remove.
10092         * ralloc.c, vm-limit.c (POINTER): Assume void * works.
10093         * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
10094         * regex.h (_RE_ARGS): Remove.  All uses rewritten to use prototypes.
10095         * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
10096         * xterm.c (input_signal_count): Assume volatile works.
10098 2012-05-21  Ken Brown  <kbrown@cornell.edu>
10100         * xgselect.c (xg_select): Fix first argument in call to 'select'
10101         (bug#11508).
10103 2012-05-20  Ken Brown  <kbrown@cornell.edu>
10105         * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
10106         [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
10108 2012-05-19  Ken Brown  <kbrown@cornell.edu>
10110         * xfns.c (x_in_use): Remove `static' qualifier.
10111         * xterm.h (x_in_use): Declare.
10112         * xgselect.c: Include xterm.h.
10113         (xg_select): Test `x_in_use' instead of `inhibit_window_system'
10114         and `display_arg' (bug#9754).
10116 2012-05-19  Paul Eggert  <eggert@cs.ucla.edu>
10118         * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
10120         * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
10121         * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
10123 2012-05-18  Eli Zaretskii  <eliz@gnu.org>
10125         Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
10127         * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
10128         (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
10130         * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
10131         reference to image_cache->refcount.
10132         (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
10134 2012-05-17  Juri Linkov  <juri@jurta.org>
10136         * search.c (Fword_search_regexp, Fword_search_backward)
10137         (Fword_search_forward, Fword_search_backward_lax)
10138         (Fword_search_forward_lax): Move functions to isearch.el
10139         (bug#10145, bug#11381).
10141 2012-05-16  Paul Eggert  <eggert@cs.ucla.edu>
10143         * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
10145 2012-05-15  Stefan Monnier  <monnier@iro.umontreal.ca>
10147         * lread.c (init_obarray): Declare Qt and Qnil as special.
10149 2012-05-14  Glenn Morris  <rgm@gnu.org>
10151         * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
10152         Put "libexec" before "bin", for the sake of init_callproc_1.
10154 2012-05-14  Paul Eggert  <eggert@cs.ucla.edu>
10156         * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
10158         * unexaix.c: Port to more-recent AIX compilers.
10159         (report_error, report_error_1, make_hdr, copy_sym)
10160         (mark_x, adjust_lnnoptrs, unrelocate_symbols):
10161         Make arguments const char *, not char *, to avoid violations of C
10162         standard and to fix some AIX warnings reported by Gilles Pion.
10164 2012-05-14  Eli Zaretskii  <eliz@gnu.org>
10166         * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
10167         already have overlays loaded.
10168         (handle_single_display_spec): Before returning without displaying
10169         fringe bitmap, synchronize the bidi iterator with the main display
10170         iterator, by calling iterate_out_of_display_property.
10171         (iterate_out_of_display_property): Detect buffer iteration by
10172         testing that it->string is a Lisp string.
10173         (get_next_display_element): When the current object is exhausted,
10174         and there's something on it->stack, call set_iterator_to_next to
10175         proceed with what's on the stack, instead of returning zero.
10176         (set_iterator_to_next): If called at the end of a Lisp string,
10177         proceed to consider_string_end without incrementing string
10178         position.  Don't increment display vector index past the end of
10179         the display vector.  (Bug#11417)
10180         (pos_visible_p): Don't report a position visible when move_it_to
10181         stopped at the last line of window, which happens to be scanned
10182         backwards by the bidi iteration.  (Bug#11464)
10184 2012-05-14  Eli Zaretskii  <eliz@gnu.org>
10186         * xdisp.c (handle_single_display_spec): Return 1 for left-margin
10187         and right-margin display specs even if the spec is invalid or we
10188         are on a TTY, and thus unable to display on the fringes.
10189         That's because the text with the property will not be displayed anyway,
10190         so we need to signal to the caller that this is a "replacing"
10191         display spec.  This fixes display when the spec is invalid or we
10192         are on a TTY.
10194 2012-05-14  Paul Eggert  <eggert@cs.ucla.edu>
10196         * unexaix.c (make_hdr): Fix typo in prototype.
10197         This bug broke the build on AIX.  Problem reported by Gilles Pion.
10199 2012-05-14  Michael Albinus  <michael.albinus@gmx.de>
10201         * keyboard.c (kbd_buffer_get_event): Read special events also in
10202         batch mode.  (Bug#11415)
10204 2012-05-12  Glenn Morris  <rgm@gnu.org>
10206         * ns.mk: Update for ns_appbindir no longer having trailing "/".
10208 2012-05-12  Eli Zaretskii  <eliz@gnu.org>
10210         * lisp.mk (lisp): Add newcomment.elc.
10212 2012-05-12  Glenn Morris  <rgm@gnu.org>
10214         * Makefile.in (MKDIR_P): New, set by configure.
10215         * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
10217 2012-05-11  Paul Eggert  <eggert@cs.ucla.edu>
10219         Remove unused function hourglass_started.
10220         * dispextern.h (hourglass_started):
10221         * w32fns.c (hourglass_started):
10222         * xdisp.c (hourglass_started): Remove.
10224 2012-05-10  Juanma Barranquero  <lekktu@gmail.com>
10226         * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
10227         Update dependencies.
10229 2012-05-10  Paul Eggert  <eggert@cs.ucla.edu>
10231         * xgselect.c (xg_select): Put maxfds+1 into a var.
10232         This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
10234         * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
10236 2012-05-10  Dave Abrahams  <dave@boostpro.com>
10238         * filelock.c (syms_of_filelock): New boolean create-lockfiles.
10239         (lock_file): If create_lockfiles is 0, do nothing.  (Bug#11227)
10241 2012-05-09  Michael Albinus  <michael.albinus@gmx.de>
10243         * dbusbind.c (xd_registered_buses): New internal Lisp object.
10244         Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
10245         (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
10246         Initialize xd_registered_buses.
10248 2012-05-09  Paul Eggert  <eggert@cs.ucla.edu>
10250         Untag more efficiently if USE_LSB_TAG.
10251         This is based on a proposal by YAMAMOTO Mitsuharu in
10252         <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
10253         For an admittedly artificial (nth 8000 longlist) benchmark on
10254         Fedora 15 x86-64, this yields a 25% CPU speedup.  Also, it shrinks
10255         Emacs's overall text size by 1%.
10256         * lisp.h (XUNTAG): New macro.
10257         (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
10258         (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
10259         (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
10260         * eval.c (Fautoload):
10261         * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
10262         * frame.h (XFRAME): Use XUNTAG.
10264         Port recent dbusbind.c changes to 32-bit --with-wide-int.
10265         * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
10266         Remove unportable assumptions about print widths of types like
10267         dbus_uint32_t.
10268         (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
10269         intptr_t when converting between pointer and integer, to avoid GCC
10270         warnings about wrong width.
10272 2012-05-09  Eli Zaretskii  <eliz@gnu.org>
10274         * w32proc.c (new_child): Force Windows to reserve only 64KB of
10275         stack for each reader_thread, instead of defaulting to 8MB
10276         determined by the linker.  This avoids failures in creating
10277         subprocesses on Windows 7, see the discussion in this thread:
10278         http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
10280 2012-05-07  Jérémy Compostella  <jeremy.compostella@gmail.com>
10282         Fix up display of the *Minibuf-0* buffer in the mini window.
10283         * keyboard.c (read_char): Don't clear the echo area if there's no
10284         message to clear.
10285         * xdisp.c (redisplay_internal): Redisplay the mini window (with the
10286         contents of *Minibuf-0*) if there's no message displayed in its stead.
10288 2012-05-07  Michael Albinus  <michael.albinus@gmx.de>
10290         * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
10291         batch mode.
10293 2012-05-06  Chong Yidong  <cyd@gnu.org>
10295         * lisp.mk (lisp): Update.
10297 2012-05-05  Jim Meyering  <meyering@redhat.com>
10299         * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
10301 2012-05-04  Stefan Monnier  <monnier@iro.umontreal.ca>
10303         * data.c (PUT_ERROR): New macro.
10304         (syms_of_data): Use it.  Add new error type `user-error'.
10305         * undo.c (user_error): New function.
10306         (Fprimitive_undo): Use it.
10307         * print.c (print_error_message): Adjust print style for `user-error'.
10308         * keyboard.c (user_error): New function.
10309         (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
10311 2012-05-03  Paul Eggert  <eggert@cs.ucla.edu>
10313         Do not limit current-time-string to years 1000..9999.
10314         * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
10315         (Fcurrent_time_string): Support any year that is supported by the
10316         underlying localtime representation.  Don't use asctime, as it
10317         has undefined behavior for years outside the range -999..9999.
10319 2012-05-02  Paul Eggert  <eggert@cs.ucla.edu>
10321         Fix race conditions involving setenv, gmtime, localtime, asctime.
10322         Without this fix, interrupts could mess up code that uses these
10323         nonreentrant functions, since setting TZ invalidates existing
10324         tm_zone or tzname values, and since most of these functions return
10325         pointers to static storage.
10326         * editfns.c (format_time_string, Fdecode_time, Fencode_time)
10327         (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
10328         Grow the critical sections to include not just invoking
10329         localtime/gmtime, but also accessing these functions' results
10330         including their tm_zone values if any, and any related TZ setting.
10331         (format_time_string): Last arg is now struct tm *, not struct tm **,
10332         so that the struct tm is saved in the critical section.
10333         All callers changed.  Simplify allocation of initial buffer, partly
10334         motivated by the fact that memory allocation needs to be outside
10335         the critical section.
10337 2012-05-02  Dmitry Antipov  <dmantipov@yandex.ru>
10339         * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
10340         with RESET_INTERVAL.
10342         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
10343         Remove duplicated buffer name initialization.
10345 2012-05-02  Jim Meyering  <jim@meyering.net>
10347         * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
10349         * xfns.c (x_window): Use xstrdup (Bug#11375).
10351 2012-05-02  Eli Zaretskii  <eliz@gnu.org>
10353         * xdisp.c (pos_visible_p): If already at a newline from the
10354         display string before the 'while' loop, don't walk back the glyphs
10355         from it3.glyph_row.  Solves assertion violation when the display
10356         string begins with a newline (egg.el).  (Bug#11367)
10358 2012-05-01  Stefan Monnier  <monnier@iro.umontreal.ca>
10360         * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
10361         Move to simple.el.
10363 2012-05-01  Glenn Morris  <rgm@gnu.org>
10365         * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
10366         s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
10367         and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
10368         All were removed before 23.1.
10370         * dispnew.c: Remove HAVE_LIBNCURSES test;
10371         it is always true on relevant platforms.
10373         * Makefile.in (LD_SWITCH_X_SITE_RPATH):
10374         Rename from LD_SWITCH_X_SITE_AUX_RPATH.
10376         * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
10378 2012-04-30  Andreas Schwab  <schwab@linux-m68k.org>
10380         * .gdbinit (xpr): Remove checks for no longer existing misc types.
10381         (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
10382         Remove.
10384 2012-04-28  Paul Eggert  <eggert@cs.ucla.edu>
10386         Do not avoid creating empty evaporating overlays (Bug#9642).
10387         * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
10388         That is, do not delete an evaporating overlay if it becomes
10389         empty after its bounds are adjusted to fit within its buffer.
10390         This fix caused other problems, and I'm reverting it until we get
10391         to the bottom of them.
10393 2012-04-27  Chong Yidong  <cyd@gnu.org>
10395         * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
10397 2012-04-27  Eli Zaretskii  <eliz@gnu.org>
10399         * xdisp.c (pos_visible_p): If the window start position is beyond
10400         ZV, start the display from buffer beginning.  Prevents assertion
10401         violation in init_iterator when the minibuffer window is scrolled
10402         via the scroll bar.
10404         * window.c (window_scroll_pixel_based): Likewise.
10406 2012-04-27  Chong Yidong  <cyd@gnu.org>
10408         * keymap.c (where_is_internal): Doc fix (Bug#10872).
10410 2012-04-27  Glenn Morris  <rgm@gnu.org>
10412         * fileio.c (Fcopy_file, Fset_file_selinux_context):
10413         Ignore ENOTSUP failures from setfilecon functions.  (Bug#11245)
10415 2012-04-27  Eli Zaretskii  <eliz@gnu.org>
10417         * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
10418         Don't overrun array limits of glyph row's used[] array.  (Bug#11288)
10420 2012-04-26  Eli Zaretskii  <eliz@gnu.org>
10422         * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
10423         display element, check also the underlying string or buffer
10424         character.  (Bug#11341)
10426         * w32menu.c: Include w32heap.h.
10427         (add_menu_item): If the call to AppendMenuW (via
10428         unicode_append_menu) fails, disable Unicode menus only if we are
10429         running on Windows 9X/Me.
10431 2012-04-24  Andreas Schwab  <schwab@linux-m68k.org>
10433         * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
10434         (xgetint): Add missing shift for LSB tags.
10436 2012-04-24  Martin Rudalics  <rudalics@gmx.at>
10438         * keyboard.c (read_char): Don't wipe echo area for select window
10439         events: These might get delayed via `mouse-autoselect-window'
10440         (Bug#11304).
10442 2012-04-24  Juanma Barranquero  <lekktu@gmail.com>
10444         * gnutls.c (init_gnutls_functions): Protect against (unlikely)
10445         manipulation of :loaded-from data.
10447 2012-04-23  Juanma Barranquero  <lekktu@gmail.com>
10449         * gnutls.c (init_gnutls_functions): The value of :loaded-from is
10450         now a cons (bug#11311).
10452 2012-04-23  Paul Eggert  <eggert@cs.ucla.edu>
10454         Do not create empty overlays with the evaporate property (Bug#9642).
10455         * buffer.c (Fmove_overlay): Delete an evaporating overlay
10456         if it becomes empty after its bounds are adjusted to fit within
10457         its buffer.  Without this fix, in a nonempty buffer (let ((o
10458         (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
10459         yields an empty overlay that has the evaporate property, which is
10460         not supposed to happen.
10462         Fix minor GTK3 problems found by static checking.
10463         * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
10464         (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
10465         (struct _EmacsFixedClass, emacs_fixed_get_type):
10466         Move decls here from emacsgtkfixed.h, since they needn't be public.
10467         (emacs_fixed_get_type): Now static.
10468         (emacs_fixed_class_init): Omit unused local.
10469         (emacs_fixed_child_type): Remove; unused.
10470         * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
10471         (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
10472         (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
10473         (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
10474         (EMACS_FIXED_GET_CLASS): Remove; unused.
10475         * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
10477         * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
10478         Problem reported by Juanma Barranquero for Windows -Wunused-function.
10480 2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
10482         Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
10483         * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
10484         (__malloc_size_t, __malloc_ptrdiff_t):
10485         Remove.  All uses removed, replaced by the definiens if needed,
10486         since we can assume C89 or better now.
10487         Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
10488         (protect_malloc_state, align, get_contiguous_space)
10489         (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
10490         (malloc_atfork_handler_child, malloc_enable_thread)
10491         (malloc_initialize_1, __malloc_initialize, morecore_nolock)
10492         (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
10493         (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
10494         (special_realloc, _realloc_internal_nolock, _realloc_internal)
10495         (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
10496         (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
10497         Define using prototypes, not old style.
10498         (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
10499         Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
10500         (align): Don't assume that signed integer overflow wraps around.
10501         Omit unused local var.
10502         (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
10503         (_free_internal_nolock, memalign, mallochook, reallochook):
10504         Omit no-longer-needed casts.
10505         (valloc): Use getpagesize, not __getpagesize.
10506         (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
10507         (struct hdr): The 'magic' member is now size_t, not unsigned long.
10509         * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
10511 2012-04-22  Michael Albinus  <michael.albinus@gmx.de>
10513         Move functions from C to Lisp.  Make non-blocking method calls
10514         the default.  Implement further D-Bus standard interfaces.
10516         * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
10517         (QCdbus_request_name_allow_replacement)
10518         (QCdbus_request_name_replace_existing)
10519         (QCdbus_request_name_do_not_queue)
10520         (QCdbus_request_name_reply_primary_owner)
10521         (QCdbus_request_name_reply_in_queue)
10522         (QCdbus_request_name_reply_exists)
10523         (QCdbus_request_name_reply_already_owner): Move to dbus.el.
10524         (QCdbus_registered_serial, QCdbus_registered_method)
10525         (QCdbus_registered_signal): New Lisp objects.
10526         (XD_DEBUG_MESSAGE): Use sizeof.
10527         (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
10528         (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
10529         (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
10530         (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
10531         (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
10532         (xd_signature, xd_append_arg): Allow float for integer types.
10533         (xd_get_connection_references): New function.
10534         (xd_get_connection_address): Rename from xd_initialize.
10535         Return cached address.
10536         (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
10537         (xd_close_bus): Rename from Fdbus_close_bus.  Not needed on Lisp
10538         level.
10539         (Fdbus_init_bus): New optional arg PRIVATE.  Cache address.
10540         Return number of refcounts.
10541         (Fdbus_get_unique_name): Make stronger parameter check.
10542         (Fdbus_message_internal): New defun.
10543         (Fdbus_call_method, Fdbus_call_method_asynchronously)
10544         (Fdbus_method_return_internal, Fdbus_method_error_internal)
10545         (Fdbus_send_signal, Fdbus_register_service)
10546         (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
10547         (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
10548         (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
10549         (Vdbus_compiled_version, Vdbus_runtime_version)
10550         (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
10551         (Vdbus_message_type_method_return, Vdbus_message_type_error)
10552         (Vdbus_message_type_signal): New defvars.
10553         (Vdbus_registered_buses, Vdbus_registered_objects_table):
10554         Adapt docstring.
10556 2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
10558         Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
10559         * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
10560         Do not assume ptrdiff_t is the same width as 'int'.
10562         * alloc.c: Handle unusual debugging option combinations.
10563         (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
10564         since the two debugging options are incompatible.
10565         (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
10566         is defined.
10567         (mem_init, mem_insert, mem_insert_fixup):
10568         Define if GC_MARK_STACK || GC_MALLOC_CHECK.
10569         (NEED_MEM_INSERT): Remove; no longer needed.
10571 2012-04-22  Leo Liu  <sdl.web@gmail.com>
10573         * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
10575 2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
10577         * sysdep.c [__FreeBSD__]: Minor cleanups.
10578         (list_system_processes, system_process_attributes) [__FreeBSD__]:
10579         Use Emacs indenting style more consistently.  Avoid some casts.
10580         Use 'double' consistently rather than mixing 'float' and 'double'.
10582 2012-04-21  Eduard Wiebe  <usenet@pusto.de>
10584         * sysdep.c (list_system_processes, system_process_attributes):
10585         Add implementation for FreeBSD (Bug#5243).
10587 2012-04-21  Andreas Schwab  <schwab@linux-m68k.org>
10589         * lisp.mk (lisp): Update.
10591 2012-04-20  Paul Eggert  <eggert@cs.ucla.edu>
10593         * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
10594         It is never used otherwise.
10596 2012-04-20  Stefan Monnier  <monnier@iro.umontreal.ca>
10598         * print.c (print_preprocess): Only check print_depth if print-circle
10599         is nil.
10600         (print_object): Check for cycles even when print-circle is nil and
10601         print-gensym is t, but only check print_depth if print-circle is nil.
10603 2012-04-20  Chong Yidong  <cyd@gnu.org>
10605         * process.c (wait_reading_process_output): If EIO occurs on a pty,
10606         set the status to "failed" and ensure that sentinel is run.
10608 2012-04-20  Glenn Morris  <rgm@gnu.org>
10610         * process.c (Fset_process_inherit_coding_system_flag)
10611         (Fset_process_query_on_exit_flag): Doc fix (mention return value).
10612         (Fmake_network_process, Fmake_serial_process): Doc fix.
10614 2012-04-20  Eli Zaretskii  <eliz@gnu.org>
10616         * xdisp.c (string_buffer_position_lim): Limit starting position to
10617         BEGV.
10618         (set_cursor_from_row): If called for a mode-line or header-line
10619         row, return zero immediately.
10620         (try_cursor_movement): If inside continuation line, don't back up
10621         farther than the first row after the header line, if any.
10622         Don't consider the header-line row as "partially visible", even if
10623         MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero.  (Bug#11261)
10625 2012-04-20  Atsuo Ohki  <ohki@gssm.otsuka.tsukuba.ac.jp>  (tiny change)
10627         * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
10628         (bug#11238).
10630 2012-04-20  Teodor Zlatanov  <tzz@lifelogs.com>
10631 2012-04-18  Paul Eggert  <eggert@cs.ucla.edu>
10633         configure: new option --enable-gcc-warnings (Bug#11207)
10634         * Makefile.in (C_WARNINGS_SWITCH): Remove.
10635         (WARN_CFLAGS, WERROR_CFLAGS): New macros.
10636         (ALL_CFLAGS): Use new macros rather than old.
10637         * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
10638         * regex.c: Ignore -Wstrict-overflow.  If !emacs, also ignore
10639         -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
10640         -Wunused-result, -Wunused-variable.  This should go away once
10641         the Emacs and Gnulib regex code is merged.
10642         (xmalloc, xrealloc): Now static.
10644 2012-04-17  Paul Eggert  <eggert@cs.ucla.edu>
10646         * dired.c (Fsystem_groups): Remove unused local.
10648 2012-04-17  Glenn Morris  <rgm@gnu.org>
10650         * dired.c (Fsystem_users): Doc fix.
10652 2012-04-17  Dmitry Antipov  <dmantipov@yandex.ru>
10654         * dired.c (Fsystem_users, Fsystem_groups): New functions.  (Bug#7900)
10655         (syms_of_dired): Add them.
10657 2012-04-16  Paul Eggert  <eggert@cs.ucla.edu>
10659         Fix minor alloc.c problems found by static checking.
10660         * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
10661         New extern decls, to avoid calling undeclared functions.
10662         (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
10663         && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
10664         GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
10665         (NEED_MEM_INSERT): New macro.
10666         (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
10667         Remove one incorrect comment and fix another.
10669         Fix minor ralloc.c problems found by static checking.
10670         See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
10671         * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
10672         (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
10673         (r_alloc_sbrk): Now static.
10675         Improve ralloc.c interface checking.
10676         See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
10677         * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
10678         (r_alloc_free) [REL_ALLOC]: Move decls from here ...
10679         * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
10680         [REL_ALLOC]: ... to here, to check interface.
10681         * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
10682         Remove decls.  This fixes an "It stinks!".
10684         * alloc.c (which_symbols): Fix alignment issue / type clash.
10686 2012-04-15  Andreas Schwab  <schwab@linux-m68k.org>
10688         * lisp.h (struct Lisp_Symbol): Remove explicit padding.
10689         (struct Lisp_Misc_Any): Likewise.
10690         (struct Lisp_Free): Likewise.
10691         * alloc.c (union aligned_Lisp_Symbol): Define.
10692         (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
10693         aligned_Lisp_Symbol instead of struct Lisp_Symbol.
10694         (union aligned_Lisp_Misc): Define.
10695         (MARKER_BLOCK_SIZE, struct marker_block): Use union
10696         aligned_Lisp_Misc instead of union Lisp_Misc.
10697         (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
10699 2012-04-14  Paul Eggert  <eggert@cs.ucla.edu>
10701         Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
10702         * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
10703         * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
10704         * s/netbsd.h, s/sol2-6.h:
10705         Remove definition of GC_MARK_STACK, since the default now works.
10706         * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
10707         Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
10708         no longer the default.
10709         * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
10711 2012-04-14  Atsuo Ohki  <ohki@gssm.otsuka.tsukuba.ac.jp>  (tiny change)
10713         * lread.c (lisp_file_lexically_bound_p):
10714         Fix hang at ";-*-\n" (bug#11238).
10716 2012-04-14  Eli Zaretskii  <eliz@gnu.org>
10718         * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
10719         "unchanged" if its end.pos is beyond ZV.  (Bug#11199)
10721 2012-04-14  Jan Djärv  <jan.h.d@swipnet.se>
10723         * nsterm.m (constrainFrameRect): Always constrain when there is only
10724         one screen (Bug#10962).
10726 2012-04-13  Ken Brown  <kbrown@cornell.edu>
10728         * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
10730 2012-04-13  Reuben Thomas  <rrt@sc3d.org>
10732         * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
10734 2012-04-11  Daniel Colascione  <dancol@dancol.org>
10736         * s/cygwin.h: The vfork the #define in cygwin.h was protecting
10737         against is gone.  It's better to use vfork now so that when Cygwin
10738         gains a new, working vfork, we use it automatically (bug#10398).
10740 2012-04-11  Stefan Monnier  <monnier@iro.umontreal.ca>
10742         * window.c (save_window_save): Obey window-point-insertion-type.
10744 2012-04-11  Glenn Morris  <rgm@gnu.org>
10746         * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
10748 2012-04-11  Stefan Monnier  <monnier@iro.umontreal.ca>
10750         * alloc.c (lisp_align_malloc): Remove unneeded prototype.
10752 2012-04-10  Jason S. Cornez  <jcornez@ravenpack.com>  (tiny change)
10754         * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
10755         (force_quit_count): New var.
10756         (handle_interrupt): Use it.
10758 2012-04-10  Juanma Barranquero  <lekktu@gmail.com>
10760         * w32.c (w32_delayed_load): Record the full path of the library
10761         being loaded (bug#10424).
10763 2012-04-09  Glenn Morris  <rgm@gnu.org>
10765         * doc.c (Fsnarf_documentation): Check variables, functions are bound,
10766         not just in the obarray, before snarfing them.  (Bug#11036)
10768         * Makefile.in ($(leimdir)/leim-list.el):
10769         Pass EMACS rather than BUILT_EMACS.
10771 2012-04-09  Teodor Zlatanov  <tzz@lifelogs.com>
10773         * process.c (make_process):
10774         * process.h: Add integer `gnutls_handshakes_tried' member to
10775         process struct.
10777         * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
10778         Add convenience `GNUTLS_LOG2i' macro.
10780         * gnutls.c (gnutls_log_function2i): Convenience log function.
10781         (emacs_gnutls_read): Use new log functions,
10782         `gnutls_handshakes_tried' process member, and
10783         `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
10784         attempts per process (connection).
10786 2012-04-09  Chong Yidong  <cyd@gnu.org>
10788         * eval.c (Fuser_variable_p, user_variable_p_eh)
10789         (lisp_indirect_variable): Functions deleted.
10790         (Fdefvar): Caller changed.
10792         * callint.c (Finteractive, Fcall_interactively):
10793         * minibuf.c (Fread_variable): Callers changed.
10795 2012-04-09  Eli Zaretskii  <eliz@gnu.org>
10797         * xdisp.c (set_cursor_from_row): If the display string appears in
10798         the buffer at position that is closer to point than the position
10799         after the display string, display the cursor on the first glyph of
10800         the display string.  Fixes cursor display when a 'display' text
10801         property immediately follows invisible text.  (Bug#11094)
10803 2012-04-09  Paul Eggert  <eggert@cs.ucla.edu>
10805         composite.c: use 'double' consistently
10806         * composite.c (get_composition_id): Use 'double' consistently
10807         instead of converting 'float' to 'double' and vice versa; this is
10808         easier to understand and avoids a GCC warning.
10810 2012-04-09  Glenn Morris  <rgm@gnu.org>
10812         * Makefile.in: Generate leim-list with bootstrap-emacs, in
10813         preparation for dumping it with emacs.  (Bug#4789)
10814         (leimdir): New variable.
10815         ($(leimdir)/leim-list.el): New rule.
10816         (emacs$(EXEEXT)): Depend on leim-list.el.
10818         * buffer.c (Qucs_set_table_for_input): Remove.  (Bug#9821)
10819         (Fget_buffer_create): Don't call Qucs_set_table_for_input.
10820         (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
10822 2012-04-08  Andreas Schwab  <schwab@linux-m68k.org>
10824         * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
10825         proper alignment.
10827 2012-04-07  Juanma Barranquero  <lekktu@gmail.com>
10829         * xml.c (init_libxml2_functions) [WINDOWSNT]:
10830         Remove unused local variable.
10832 2012-04-07  Paul Eggert  <eggert@cs.ucla.edu>
10834         Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
10835         * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
10836         (mark_memory): Mark Lisp_Objects only if pointers might hide in
10837         objects, as mark_maybe_pointer will catch them otherwise.
10838         (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
10839         * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
10841 2012-04-07  Paul Eggert  <eggert@cs.ucla.edu>
10843         Fix typo that broke non-Windows builds.
10844         * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
10846 2012-04-07  Eli Zaretskii  <eliz@gnu.org>
10848         Support building on MS-Windows with libxml2.
10850         * makefile.w32-in (OBJ2): Add xml.$(O).
10851         (GLOBAL_SOURCES): Add xml.c.
10852         ($(BLD)/xml.$(O)): New dependency list.
10854         * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
10855         (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
10856         (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
10857         [!WINDOWSNT]: New macros.
10858         (init_libxml2_functions, libxml2_loaded_p): New functions.
10859         (parse_region): Call fn_xmlCheckVersion instead of using the macro
10860         LIBXML_TEST_VERSION.  Call libxml2 functions via the fn_* macros.
10861         (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
10862         Calls xmlCleanupParser only if libxml2 was loaded (or statically
10863         linked in).
10864         (Flibxml_parse_html_region, Flibxml_parse_xml_region):
10865         Call init_libxml2_functions before calling libxml2 functions.
10866         (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
10868         * emacs.c: Don't include libxml/parser.h.
10869         (shut_down_emacs): Call xml_cleanup_parser, instead of calling
10870         xmlCleanupParser directly.
10872         * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
10874 2012-04-07  Eli Zaretskii  <eliz@gnu.org>
10876         * indent.c (Fvertical_motion): If there is a display string at
10877         point, use it.vpos to compute how many lines to backtrack after
10878         move_it_to point.  (Bug#11133)
10880 2012-04-06  Eli Zaretskii  <eliz@gnu.org>
10882         * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
10883         * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
10884         about subtle differences between FETCH_CHAR* and STRING_CHAR*
10885         macros related to unification of CJK characters.  For the details,
10886         see the discussion following the message here:
10887         http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
10889 2012-04-04  Chong Yidong  <cyd@gnu.org>
10891         * keyboard.c (Vdelayed_warnings_list): Doc fix.
10893 2012-04-01  Eli Zaretskii  <eliz@gnu.org>
10895         * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
10896         instead of alloca.  (Bug#11138)
10898 2012-04-01  Andreas Schwab  <schwab@linux-m68k.org>
10900         * w32menu.c (is_simple_dialog): Properly check lisp types.
10901         (Bug#11141)
10903 2012-03-31  Eli Zaretskii  <eliz@gnu.org>
10905         * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
10906         position we get to after a call to move_it_to fails the
10907         IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
10908         only if we wind up in a string from display property.  (Bug#11063)
10910         * window.c (Fdelete_other_windows_internal): Invalidate the row
10911         and column information about mouse highlight, so that redisplay
10912         restores it after reallocating the glyph matrices.  (Bug#7464)
10914         * xdisp.c (set_cursor_from_row): If `cursor' property on a display
10915         string comes from a `display' text property, use the buffer
10916         position of that property as if we actually saw that position in
10917         the row's glyphs.
10918         (move_it_by_lines): Remove the assertion that
10919         "it->current_x == 0 && it->hpos == 0" which can be legitimately
10920         violated when there's a before-string at the beginning of a line.
10921         (Bug#11063)
10923 2012-03-30  Eli Zaretskii  <eliz@gnu.org>
10925         * xdisp.c (append_space_for_newline): If the default face was
10926         remapped, use the remapped face for the appended newline.
10927         (extend_face_to_end_of_line): Use the remapped default face for
10928         extending the face to the end of the line.
10929         (display_line): Call extend_face_to_end_of_line when the default
10930         face was remapped.  (Bug#11068)
10932 2012-03-29  Eli Zaretskii  <eliz@gnu.org>
10934         * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
10936 2012-03-28  Stefan Monnier  <monnier@iro.umontreal.ca>
10938         * keyboard.c (safe_run_hooks_error): Don't unquote strings.
10940 2012-03-27  Glenn Morris  <rgm@gnu.org>
10942         * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
10943         Doc fixes.
10945 2012-03-26  Kenichi Handa  <handa@m17n.org>
10947         * dispextern.h (struct glyph): Fix previous change.  Change the
10948         bit length of glyphless.ch to 25 (Bug#11082).
10950 2012-03-26  Chong Yidong  <cyd@gnu.org>
10952         * keyboard.c (Vselection_inhibit_update_commands): New variable.
10953         (command_loop_1): Use it; inhibit selection update for
10954         handle-select-window too (Bug#8996).
10956 2012-03-25  Fabrice Popineau  <fabrice.popineau@supelec.fr>
10958         * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
10960 2012-03-25  Kenichi Handa  <handa@m17n.org>
10962         * dispextern.h (struct glyph): Change the bit length of
10963         glyphless.ch to 22 to make the member glyphless fit in 32 bits.
10965 2012-03-24  Eli Zaretskii  <eliz@gnu.org>
10967         * s/ms-w32.h (tzname): Include time.h before redirecting to
10968         _tzname.  Fixes the MSVC build.  (Bug#9960)
10970 2012-03-24  Andreas Schwab  <schwab@linux-m68k.org>
10972         * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
10973         characters.
10975         * xterm.c (XTread_socket): Only modify handling_signal if
10976         !SYNC_INPUT.  (Bug#11080)
10978 2012-03-23  Eli Zaretskii  <eliz@gnu.org>
10980         * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
10981         FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES.  Prevents crashes
10982         when fetching a multibyte character consumes more bytes than
10983         CHAR_BYTES returns, due to unification of CJK characters in
10984         string_char.  (Bug#11073)
10986 2012-03-23  Troels Nielsen  <bn.troels@gmail.com>  (tiny change)
10988         * process.c (wait_reading_process_output): Handle pty disconnect
10989         by refraining from sending oneself a SIGCHLD (bug#10933).
10991 2012-03-22  Chong Yidong  <cyd@gnu.org>
10993         * dispextern.h (struct it): New member string_from_prefix_prop_p.
10995         * xdisp.c (push_prefix_prop): Rename from push_display_prop.
10996         Mark string as coming from a prefix property.
10997         (handle_face_prop): Use default face for prefix strings (Bug#4281).
10998         (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
11000 2012-03-21  Chong Yidong  <cyd@gnu.org>
11002         * xfaces.c (Vface_remapping_alist): Doc fix.
11004 2012-03-20  Eli Zaretskii  <eliz@gnu.org>
11006         * w32proc.c (Fw32_set_console_codepage)
11007         (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
11008         Doc fixes.
11010 2012-03-20  Chong Yidong  <cyd@gnu.org>
11012         * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
11013         to reflect default non-nil value of redisplay-dont-pause.
11015 2012-03-19  Kenichi Handa  <handa@m17n.org>
11017         * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
11018         it fit in a valid range (Bug#11003).
11020 2012-03-18  Eli Zaretskii  <eliz@gnu.org>
11022         * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
11023         that is not from display property, accept the row as a "cursor
11024         row" if one of the string's character has a non-nil `cursor'
11025         property.  Fixes cursor positioning when there are newlines in
11026         overlay strings, e.g. in icomplete.el.  (Bug#11035)
11028 2012-03-12  Paul Eggert  <eggert@cs.ucla.edu>
11030         * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
11032 2012-03-12  Chong Yidong  <cyd@gnu.org>
11034         * eval.c (inhibit_lisp_code): Rename from
11035         inhibit_window_configuration_change_hook; move from window.c.
11037         * xfns.c (unwind_create_frame_1, Fx_create_frame):
11038         * window.c (run_window_configuration_change_hook)
11039         (syms_of_window): Callers changed.
11041 2012-03-11  Chong Yidong  <cyd@gnu.org>
11043         * keymap.c (Fkey_description): Doc fix (Bug#9700).
11045         * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
11047 2012-03-10  Chong Yidong  <cyd@gnu.org>
11049         * frame.c (other_visible_frames): Don't assume the selected frame
11050         is visible (Bug#10955).
11052 2012-03-09  Stefan Monnier  <monnier@iro.umontreal.ca>
11054         * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
11056 2012-03-08  Jan Djärv  <jan.h.d@swipnet.se>
11058         * gtkutil.c (x_wm_set_size_hint): Use one row in call to
11059         FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
11060         zero (Bug#10954).
11062 2012-03-03  Glenn Morris  <rgm@gnu.org>
11064         * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
11066 2012-03-02  Eli Zaretskii  <eliz@gnu.org>
11068         * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
11069         position past the first glyph_row that ends at ZV.  (Bug#10902)
11070         (redisplay_window, next_element_from_string): Fix typos in
11071         comments.
11072         (redisplay_window): Pass to move_it_vertically the margin in
11073         pixels, not in screen lines.
11075 2012-03-02  Glenn Morris  <rgm@gnu.org>
11077         * buffer.c (buffer-list-update-hook): Doc fix.
11079 2012-02-29  Eli Zaretskii  <eliz@gnu.org>
11081         * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
11082         push_it before setting up the iterator for the first overlay
11083         string, even if we have an empty string loaded.
11084         (next_overlay_string): If there's an empty string on the iterator
11085         stack, pop the stack.  (Bug#10903)
11087 2012-02-25  Paul Eggert  <eggert@cs.ucla.edu>
11089         Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
11090         Suggested by Stefan Monnier in
11091         <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
11092         * alloc.c (widen_to_Lisp_Object): New static function.
11093         (mark_memory): Also mark Lisp_Objects by fetching pointer words
11094         and widening them to Lisp_Objects.  This would work even if
11095         USE_LSB_TAG is defined and wide integers are used, which might
11096         happen in a future version of Emacs.
11098 2012-02-25  Chong Yidong  <cyd@gnu.org>
11100         * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
11101         Doc fix.
11103         * xselect.c (Fx_selection_exists_p): Doc fix.
11104         (x_clipboard_manager_save_all): Print an informative message
11105         before saving to clipboard manager.
11107 2012-02-24  Chong Yidong  <cyd@gnu.org>
11109         * keyboard.c (process_special_events): Handle all X selection
11110         requests in kbd_buffer, not just the next one (Bug#8869).
11112 2012-02-23  Chong Yidong  <cyd@gnu.org>
11114         * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
11115         call when setting menu-bar-lines and tool-bar-lines parameters.
11116         (unwind_create_frame_1): New helper function.
11118         * window.c (inhibit_window_configuration_change_hook): New var.
11119         (run_window_configuration_change_hook): Obey it.
11120         (syms_of_window): Initialize it.
11122 2012-02-22  Chong Yidong  <cyd@gnu.org>
11124         * xterm.c (x_draw_image_relief): Add missing type check for
11125         Vtool_bar_button_margin (Bug#10743).
11127 2012-02-21  Chong Yidong  <cyd@gnu.org>
11129         * fileio.c (Vfile_name_handler_alist): Doc fix.
11131         * buffer.c (Fget_file_buffer): Protect against invalid file
11132         handler return value.
11134 2012-02-20  Paul Eggert  <eggert@cs.ucla.edu>
11136         * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
11137         when computing $valmask.
11139         Fix crash due to non-contiguous EMACS_INT (Bug#10780).
11140         * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
11141         (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
11142         It's useless in that case, and it can cause problems on hosts
11143         that allocate halves of EMACS_INT values separately.
11144         Reported by Dan Horák.  Diagnosed by Andreas Schwab in
11145         <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
11146         * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
11147         UINTPTR_MAX >> VALBITS == 0.  This is required by the above change;
11148         it avoids undefined behavior on hosts where shifting right by more
11149         than the word width has undefined behavior.
11151 2012-02-19  Chong Yidong  <cyd@gnu.org>
11153         * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
11154         (Funhandled_file_name_directory, Ffile_name_as_directory)
11155         (Fdirectory_file_name, Fexpand_file_name)
11156         (Fsubstitute_in_file_name): Protect against invalid file handler
11157         return values (Bug#10845).
11159 2012-02-18  Eli Zaretskii  <eliz@gnu.org>
11161         * .gdbinit (pitx): Fix incorrect references to fields of the
11162         iterator stack.
11164 2012-02-17  Chong Yidong  <cyd@gnu.org>
11166         * syntax.c (Fscan_lists): Doc fix (Bug#10833).
11168 2012-02-15  Paul Eggert  <eggert@cs.ucla.edu>
11170         * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
11171         <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
11173 2012-02-15  Chong Yidong  <cyd@gnu.org>
11175         * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
11176         marked as special.  Also, starting docstrings with * is obsolete.
11178 2012-02-13  Andreas Schwab  <schwab@linux-m68k.org>
11180         * gnutls.c (emacs_gnutls_write): Fix last change.
11182 2012-02-13  Lars Ingebrigtsen  <larsi@gnus.org>
11184         * gnutls.c (emacs_gnutls_write): Set errno appropriately for
11185         send_process.
11187 2012-02-13  Stefan Monnier  <monnier@iro.umontreal.ca>
11189         * keymap.c (Fsingle_key_description): Handle char ranges.
11191 2012-02-12  Chong Yidong  <cyd@gnu.org>
11193         * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
11194         as that creates a dangerous corner case.
11196         * window.c (Fdelete_window_internal): Invalidate the mouse
11197         highlight (Bug#9904).
11199 2012-02-12  Glenn Morris  <rgm@gnu.org>
11201         * xselect.c (Fx_own_selection_internal)
11202         (Fx_get_selection_internal, Fx_disown_selection_internal)
11203         (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
11204         * nsselect.m (Fx_own_selection_internal)
11205         (Fx_disown_selection_internal, Fx_selection_exists_p)
11206         (Fx_selection_owner_p, Fx_get_selection_internal):
11207         Sync docs and argument specs with the xselect.c versions.
11209 2012-02-11  Lars Ingebrigtsen  <larsi@gnus.org>
11211         * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
11213 2012-02-11  Eli Zaretskii  <eliz@gnu.org>
11215         * w32select.c (Fx_selection_exists_p): Sync doc string and
11216         argument list with xselect.c.  (Bug#10783)
11218         * w16select.c (Fx_selection_exists_p): Sync doc string and
11219         argument list with xselect.c.  (Bug#10783)
11221 2012-02-10  Glenn Morris  <rgm@gnu.org>
11223         * fns.c (Fsecure_hash): Doc fix.
11225 2012-02-09  Kenichi Handa  <handa@m17n.org>
11227         * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
11229 2012-02-07  Chong Yidong  <cyd@gnu.org>
11231         * buffer.c (Fbuffer_local_variables)
11232         (buffer_lisp_local_variables): Handle unbound vars correctly;
11233         don't let Qunbound leak into Lisp.
11235 2012-02-07  Glenn Morris  <rgm@gnu.org>
11237         * image.c (Fimagemagick_types): Doc fix.
11239         * image.c (imagemagick-render-type): Change it from a lisp object
11240         to an integer.  Move the doc here from the lisp manual.
11241         Treat all values not equal to 0 the same.
11243 2012-02-06  Chong Yidong  <cyd@gnu.org>
11245         * doc.c (store_function_docstring): Avoid applying docstring of
11246         alias to base function (Bug#2603).
11248 2012-02-04  Andreas Schwab  <schwab@linux-m68k.org>
11250         * .gdbinit (pp1, pv1): Remove redundant defines.
11251         (pr): Use pp.
11253 2012-02-04  Chong Yidong  <cyd@gnu.org>
11255         * nsterm.m: Declare a global (Bug#10694).
11257 2012-02-04  Eli Zaretskii  <eliz@gnu.org>
11259         * w32.c (get_emacs_configuration_options):
11260         Include --enable-checking, if specified, in the return value.
11262 2012-02-04  Martin Rudalics  <rudalics@gmx.at>
11264         * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
11265         after rounding frame sizes.  (Bug#9723)
11267 2012-02-04  Eli Zaretskii  <eliz@gnu.org>
11269         * keyboard.c (adjust_point_for_property): Don't position point
11270         before BEGV.  (Bug#10696)
11272 2012-02-03  Paul Eggert  <eggert@cs.ucla.edu>
11274         Handle overflow when computing char display width (Bug#9496).
11275         * character.c (char_width): Return EMACS_INT, not int.
11276         (char_width, c_string_width): Check for overflow when
11277         computing the width; this is possible now that individual
11278         characters can have unbounded width.  Problem introduced
11279         by merge from Emacs 23 on 2012-01-19.
11281 2012-02-02  Michael Albinus  <michael.albinus@gmx.de>
11283         * dbusbind.c (Fdbus_register_method): Mention the return value
11284         :ignore in the docstring.
11286 2012-02-02  Glenn Morris  <rgm@gnu.org>
11288         * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
11290         * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11291         Unconditionally set to t.  (Bug#10673)
11292         * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11293         * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
11294         * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
11296 2012-02-02  Kenichi Handa  <handa@m17n.org>
11298         (x_produce_glyphs): Cancel previous change.  If cmp->glyph_len is
11299         0, do not call append_composite_glyph.
11301 2012-02-02  Kenichi Handa  <handa@m17n.org>
11303         * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
11304         NULL (Bug#6988).
11305         (x_produce_glyphs): If the component of a composition is a null
11306         string, set it->pixel_width to 1 to avoid zero-width glyph.
11308 2012-02-01  Eli Zaretskii  <eliz@gnu.org>
11310         * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
11311         first 2 arguments are identical.  This makes inserting large
11312         output from a subprocess an order of magnitude faster on
11313         MS-Windows, where all sbrk'ed memory is always contiguous.
11315 2012-01-31  Glenn Morris  <rgm@gnu.org>
11317         * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11318         * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
11319         * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
11321 2012-01-29  Glenn Morris  <rgm@gnu.org>
11323         * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
11325 2012-01-28  Samuel Thibault  <sthibault@debian.org>  (tiny change)
11327         * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
11329 2012-01-28  Chong Yidong  <cyd@gnu.org>
11331         * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
11333 2012-01-26  Chong Yidong  <cyd@gnu.org>
11335         * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
11337         * search.c (Fsearch_forward, Fsearch_backward): Document negative
11338         repeat counts (Bug#10507).
11340 2012-01-26  Glenn Morris  <rgm@gnu.org>
11342         * lread.c (syms_of_lread): Doc fix.
11344 2012-01-25  HIROSHI OOTA  <nil@mad.dog.cx>  (tiny change)
11346         * coding.c (encode_designation_at_bol): Change return value to
11347         EMACS_INT.
11349 2012-01-25  Chong Yidong  <cyd@gnu.org>
11351         * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
11353 2012-01-21  Chong Yidong  <cyd@gnu.org>
11355         * floatfns.c (Fcopysign): Make the second argument non-optional,
11356         since nil is not allowed anyway.
11358 2012-01-21  Andreas Schwab  <schwab@linux-m68k.org>
11360         * process.c (read_process_output): Use p instead of XPROCESS (proc).
11361         (send_process): Likewise.
11363 2012-01-19  Martin Rudalics  <rudalics@gmx.at>
11365         * window.c (save_window_save, Fcurrent_window_configuration)
11366         (Vwindow_persistent_parameters): Do not use Qstate.
11367         Rewrite doc-strings.
11369 2012-01-19  Kenichi Handa  <handa@m17n.org>
11371         * character.c (char_width): New function.
11372         (Fchar_width, c_string_width, lisp_string_width):
11373         Use char_width (Bug#9496).
11375 2012-01-16  Martin Rudalics  <rudalics@gmx.at>
11377         * window.c (Vwindow_persistent_parameters): New variable.
11378         (Fset_window_configuration, save_window_save): Handle persistent
11379         window parameters.
11381 2012-01-14  Eli Zaretskii  <eliz@gnu.org>
11383         * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
11384         thrashing the stack of the thread.  (Bug#9087)
11386 2012-01-12  Paul Eggert  <eggert@cs.ucla.edu>
11388         * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
11390 2012-01-11  Eli Zaretskii  <eliz@gnu.org>
11392         * xdisp.c (rows_from_pos_range): Handle the case where the
11393         highlight ends on a newline.  (Bug#10464)
11394         (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
11395         he end column for display of highlight that ends on a newline
11396         before a R2L line.
11398 2012-01-11  Glenn Morris  <rgm@gnu.org>
11400         * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
11401         from load-path also when installation-directory is nil.  (Bug#10208)
11403 2012-01-10  Glenn Morris  <rgm@gnu.org>
11405         * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
11407         * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
11408         Update template values to be closer to their typical values these days.
11410 2012-01-09  Eli Zaretskii  <eliz@gnu.org>
11412         * xdisp.c (rows_from_pos_range): Accept additional argument
11413         DISP_STRING, and accept any glyph in a row whose object is that
11414         string as eligible for mouse highlight.  Fixes mouse highlight of
11415         display strings from overlays.  (Bug#10464)
11417 2012-01-07  Paul Eggert  <eggert@cs.ucla.edu>
11419         emacs: fix an auto-save permissions race condition (Bug#10400)
11420         * fileio.c (auto_saving_dir_umask): New static var.
11421         (Fmake_directory_internal): Use it.
11422         (do_auto_save_make_dir): Set it, instead of invoking chmod after
11423         creating the directory.  The old code temporarily assigns
11424         too-generous permissions to the directory.
11425         (do_auto_save_eh): Clear it.
11426         (Fdo_auto_save): Catch all errors, not just file errors, so
11427         that the var is always cleared.
11429 2012-01-07  Eli Zaretskii  <eliz@gnu.org>
11431         * search.c (scan_buffer): Pass character positions to
11432         know_region_cache, not byte positions.  (Bug#6540)
11434 2012-01-07  LynX  <_LynX@bk.ru>  (tiny change)
11436         * w32.c (sys_rename): Report EXDEV when rename of a directory
11437         fails because the target is on another logical disk.  (Bug#10284)
11439 2012-01-07  David Benjamin  <davidben@mit.edu>  (tiny change)
11441         * xterm.c (x_embed_request_focus): New function.
11443         * xterm.h: Add prototype.
11445         * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
11447 2012-01-05  Glenn Morris  <rgm@gnu.org>
11449         * emacs.c (emacs_copyright): Update short copyright year to 2012.
11451 2012-01-01  Eli Zaretskii  <eliz@gnu.org>
11453         * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
11454         Load gnutls_transport_set_lowat only if GnuTLS version is below
11455         2.11.1.
11456         (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
11457         GnuTLS versions below 2.11.1.
11459 2011-12-31  Antoine Levitt  <antoine.levitt@gmail.com>
11461         * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
11462         to the doc string advising against its use for altering the way
11463         windows are scrolled.
11465 2011-12-28  Kenichi Handa  <handa@m17n.org>
11467         * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
11468         coding-system ASCII compatible only when it does not produce BOM
11469         on encoding (Bug#10383).
11471 2011-12-26  Jan Djärv  <jan.h.d@swipnet.se>
11473         * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
11474         can scroll.
11475         (create_and_show_popup_menu): Always use menu_position_func for
11476         Gtk3 (Bug#10361).
11478 2011-12-24  Andreas Schwab  <schwab@linux-m68k.org>
11480         * callint.c (Fcall_interactively): Don't truncate prompt string.
11482 2011-12-23  Eli Zaretskii  <eliz@gnu.org>
11484         * xdisp.c (handle_invisible_prop): Handle correctly an invisible
11485         property that ends at ZV, so that the bidi iteration could be
11486         resumed from there (after widening).  (Bug#10360)
11488 2011-12-22  Jan Djärv  <jan.h.d@swipnet.se>
11490         * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
11492 2011-12-21  Jan Djärv  <jan.h.d@swipnet.se>
11494         * nsterm.m (x_free_frame_resources):
11495         Release f->output_data.ns->miniimage.
11496         (ns_index_color): Fix indentation.  Do not retain
11497         color_table->colors[i].
11499         * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
11500         before returning.
11502         * nsfns.m (x_set_background_color): Assign return value from
11503         ns_index_color to face-background instead of NSColor*.
11504         (ns_implicitly_set_icon_type): Fix indentation.
11505         Change assignment in for loop to comparison.
11507         * emacs.c (ns_pool): New variable.
11508         (main): Assign ns_pool.
11509         (Fkill_emacs): Call ns_release_autorelease_pool.
11511         * nsfont.m (ns_spec_to_descriptor): Fix indentation,
11512         autorelease fdesc, release fdAttrs and tdict.
11513         (ns_get_covering_families): Release charset.
11514         (ns_findfonts): Release NSFontDescriptor created with new.
11515         (ns_uni_to_glyphs): Fix indentation.
11516         (setString): Release attrStr before assigning new value.
11518 2011-12-18  Jan Djärv  <jan.h.d@swipnet.se>
11520         * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
11521         and NS_IMPL_COCOA.
11522         (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
11523         (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
11525 2011-12-18  David Reitter  <reitter@cmu.edu>
11527         * nsterm.m (ns_term_init): Subscribe for notifications
11528         NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
11529         to method trackingNotification in EmacsMenu.
11531         * nsmenu.m (trackingMenu): New variable.
11532         (trackingNotification): New method (from Aquamacs).
11533         (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
11534         from Aquamacs (Bug#7030).
11536 2011-12-18  Jan Djärv  <jan.h.d@swipnet.se>
11538         * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
11539         (symbol_to_nsstring): Fix indentation.
11540         (ns_symbol_to_pb): New function.
11541         (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
11542         (Fns_rotate_cut_buffers_internal): Remove.
11543         (Fns_store_selection_internal): Rename from
11544         Fns_store_cut_buffer_internal.
11545         (ns_get_foreign_selection, Fx_own_selection_internal)
11546         (Fx_disown_selection_internal, Fx_selection_exists_p)
11547         (Fns_get_selection_internal, Fns_store_selection_internal):
11548         Use ns_symbol_to_pb and check if return value is nil.
11549         (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT.  Remove defsubr
11550         Sns_rotate_cut_buffers_internal.  Sns_get_cut_buffer_internal
11551         renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
11552         renamed to Sns_store_selection_internal.
11553         (ns_handle_selection_request): Move code to Fx_own_selection_internal
11554         and remove this function.
11555         (ns_handle_selection_clear): Remove, never used.
11556         (Fx_own_selection_internal): Move code from ns_handle_selection_request
11557         here.
11559 2011-12-17  Ken Brown  <kbrown@cornell.edu>
11561         * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
11562         GID is unknown (Bug#10257).
11564 2011-12-17  Paul Eggert  <eggert@cs.ucla.edu>
11566         * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
11567         (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
11568         which caused a build failure on GNU/Linux IA-64.  This problem was
11569         introduced by my 2011-10-07 patch.
11571 2011-12-15  Juri Linkov  <juri@jurta.org>
11573         * image.c (imagemagick_error): New function.  (Bug#10112)
11574         (imagemagick_load_image): Comment out `MagickSetResolution' call.
11575         Use `imagemagick_error' where ImageMagick functions return
11576         `MagickFalse'.
11577         (Fimagemagick_types): Add `Fnreverse' to return the list in the
11578         proper order.
11580 2011-12-15  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
11582         * xftfont.c (xftfont_draw): Use the font metrics of s->font to
11583         fill background (Bug#8992).
11585 2011-12-13  Martin Rudalics  <rudalics@gmx.at>
11587         * window.c (Vwindow_combination_resize)
11588         (Vwindow_combination_limit): Use t instead of non-nil in
11589         doc-strings.
11590         (Vrecenter_redisplay): Add first sentence of doc-string on
11591         separate line.
11592         (Frecenter): Fix doc-string typo.
11594 2011-12-11  Kenichi Handa  <handa@m17n.org>
11596         * coding.c (Funencodable_char_position): Pay attention to the
11597         buffer text relocation (Bug#9389).
11599 2011-12-10  Jan Djärv  <jan.h.d@swipnet.se>
11601         * xterm.c (x_term_init): Move call to gdk_window_add_filter before
11602         gtk_init (Bug#10100).
11604 2011-12-10  Eli Zaretskii  <eliz@gnu.org>
11606         * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
11607         IT->string is nil.  (Bug#10263)
11609 2011-12-10  Jan Djärv  <jan.h.d@swipnet.se>
11611         * nsterm.h (x_free_frame_resources): Declare.
11613         * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
11614         (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
11616         * nsterm.h (ns_get_defaults_value): Declare.
11618         * nsterm.m (ns_default): Call ns_get_defaults_value.
11620 2011-12-09  Eli Zaretskii  <eliz@gnu.org>
11622         * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
11623         (Bug#10170)
11625 2011-12-09  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
11627         * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
11628         that where the value of an _OBJC_* symbol points to is in the .bss
11629         section (Bug#10240).
11631 2011-12-08  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
11633         * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
11634         after the loop to call ccl_driver at least once (Bug#8619).
11636 2011-12-08  Kenichi Handa  <handa@m17n.org>
11638         * ftfont.c (get_adstyle_property): Fix previous change
11639         (Bug#10233).
11641 2011-12-07  Juanma Barranquero  <lekktu@gmail.com>
11643         * w32.c (init_environment): If no_site_lisp, remove site-lisp
11644         dirs from the default value of EMACSLOADPATH (bug#10208).
11646 2011-12-07  Glenn Morris  <rgm@gnu.org>
11648         * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
11649         installation and source directories as well.  (Bug#10208)
11651 2011-12-06  Chong Yidong  <cyd@gnu.org>
11653         * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
11655 2011-12-06  Glenn Morris  <rgm@gnu.org>
11657         * process.c (start_process_unwind): Treat any pid <= 0, except -2,
11658         as an error, not just -1.  (Bug#10217)
11660 2011-12-05  Chong Yidong  <cyd@gnu.org>
11662         * keyboard.c (process_special_events): New function.
11663         (swallow_events, Finput_pending_p): Use it (Bug#10195).
11665 2011-12-05  Paul Eggert  <eggert@cs.ucla.edu>
11667         * coding.c (encode_designation_at_bol): Don't use uninitialized
11668         local variable (Bug#9318).
11670 2011-12-05  Kenichi Handa  <handa@m17n.org>
11672         * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
11673         return Qnil (Bug#8046, Bug#10193).
11675 2011-12-05  Kenichi Handa  <handa@m17n.org>
11677         * coding.c (encode_designation_at_bol): New args charbuf_end and
11678         dst.  Return the number of produced bytes.  Callers changed.
11679         (coding_set_source): Return how many bytes coding->source was
11680         relocated.
11681         (coding_set_destination): Return how many bytes
11682         coding->destination was relocated.
11683         (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
11684         (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
11686 2011-12-05  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
11688         * coding.c (CODING_CHAR_CHARSET_P): New macro.
11689         (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
11690         macro (Bug#9318).
11692 2011-12-05  Andreas Schwab  <schwab@linux-m68k.org>
11694         The following changes are to fix Bug#9318.
11696         * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
11697         (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
11698         (encode_coding_iso_2022, encode_coding_sjis)
11699         (encode_coding_big5, encode_coding_charset): Use the above macros.
11701 2011-12-05  Juanma Barranquero  <lekktu@gmail.com>
11703         * lisp.h (process_quit_flag): Fix external declaration.
11705 2011-12-04  Stefan Monnier  <monnier@iro.umontreal.ca>
11707         Don't macro-inline non-performance-critical code.
11708         * eval.c (process_quit_flag): New function.
11709         * lisp.h (QUIT): Use it.
11711 2011-12-04  Jan Djärv  <jan.h.d@swipnet.se>
11713         * nsfns.m (get_geometry_from_preferences): New function.
11714         (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
11716 2011-12-04  Andreas Schwab  <schwab@linux-m68k.org>
11718         * emacs.c (Qkill_emacs): Define.
11719         (syms_of_emacs): Initialize it.
11720         * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
11721         Qquit_flag to `kill-emacs' instead.
11722         (quit_throw_to_read_char): Add parameter `from_signal'.
11723         All callers changed.  Call Fkill_emacs if requested and safe.
11724         * lisp.h (QUIT): Call Fkill_emacs if requested.
11726 2011-12-03  Jan Djärv  <jan.h.d@swipnet.se>
11728         * widget.c (update_wm_hints): Return if wmshell is null.
11729         (widget_update_wm_size_hints): New function.
11731         * widget.h (widget_update_wm_size_hints): Declare.
11733         * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
11734         widget_update_wm_size_hints (Bug#10104).
11736 2011-12-03  Eli Zaretskii  <eliz@gnu.org>
11738         * xdisp.c (handle_invisible_prop): If the invisible text ends just
11739         before a newline, prepare the bidi iterator for consuming the
11740         newline, and keep the current paragraph direction.  (Bug#10183)
11741         (redisplay_window): Don't let `margin' become negative.  (Bug#10192)
11743 2011-12-02  Juri Linkov  <juri@jurta.org>
11745         * search.c (Fword_search_regexp): New Lisp function created from
11746         `wordify'.  Change type of arg `lax' from `int' to `Lisp_Object'.
11747         (Fword_search_backward, Fword_search_forward)
11748         (Fword_search_backward_lax, Fword_search_forward_lax):
11749         Use `Fword_search_regexp' instead of `wordify'.  Doc fix.
11750         (syms_of_search): Define `Sword_search_regexp'.  (Bug#10145)
11752 2011-12-01  Stefan Monnier  <monnier@iro.umontreal.ca>
11754         * fileio.c (Finsert_file_contents): Move after-change-function call
11755         to before the "handled:" label, since all "goto handled" appear in
11756         cases where the *-change-functions have already been properly called
11757         (bug#10117).
11759 2011-12-01  Andreas Schwab  <schwab@linux-m68k.org>
11761         * keyboard.c (interrupt_signal): Don't call kill-emacs when
11762         waiting for input.  (Bug#10169)
11764 2011-11-30  Eli Zaretskii  <eliz@gnu.org>
11766         * dispnew.c (adjust_glyph_matrix): Remove the assertion that
11767         verifies glyph row's hash code--we have just reallocated the
11768         glyphs, so their contents can be complete garbage.  (Bug#10164)
11770 2011-11-30  Juanma Barranquero  <lekktu@gmail.com>
11772         * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
11774 2011-11-30  Eli Zaretskii  <eliz@gnu.org>
11776         * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
11777         attributes are tested _before_ calling verify_row_hash, to protect
11778         against GCC re-ordering of the tests.  (Bug#10164)
11780 2011-11-29  Jan Djärv  <jan.h.d@swipnet.se>
11782         * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
11784         * xterm.c (handle_one_xevent): Only set async_visible and friends
11785         if net_wm_state_hidden_seen is non-zero (Bug#10002)
11786         (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
11787         _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
11789 2011-11-28  Paul Eggert  <eggert@cs.ucla.edu>
11791         Remove GCPRO-related macros that exist only to avoid shadowing locals.
11792         * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
11793         (GCPRO6_VAR, UNGCPRO_VAR): Remove.  See
11794         <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
11795         All uses changed to use GCPRO1 etc.
11796         (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
11797         Revert to old implementation (i.e., before 2011-03-11).
11799 2011-11-28  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
11801         * dispnew.c (scrolling_window): Truncate overlaps in copy destination
11802         of scroll runs so as to avoid assigning disabled bogus rows and
11803         unnecessary graphics copy operations.
11805 2011-11-27  Eli Zaretskii  <eliz@gnu.org>
11807         * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
11808         (snprintf) [_MSC_VER]: Redirect to _snprintf.
11809         (strtoll) [_MSC_VER]: Redirect to _strtoi64.
11810         (malloc, free, realloc, calloc): Redirect to e_* only when
11811         compiling Emacs.
11813         * lisp.h (GCTYPEBITS): Move before first use.
11814         (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
11815         (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
11816         this macro definition.
11818         * s/ms-w32.h (tzname): Redirect to _tzname for all values of
11819         _MSC_VER.
11821 2011-11-27  Jan Djärv  <jan.h.d@swipnet.se>
11823         * gtkutil.c (xg_create_frame_widgets):
11824         Call gtk_window_set_has_resize_grip (FALSE) if that function is
11825         present with Gtk+ 2.0.
11827 2011-11-26  Paul Eggert  <eggert@cs.ucla.edu>
11829         * fileio.c (Finsert_file_contents): Undo previous change; see
11830         <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
11832 2011-11-26  Paul Eggert  <eggert@cs.ucla.edu>
11834         Rename locals to avoid shadowing.
11835         * fileio.c (Finsert_file_contents):
11836         Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
11837         * process.c (wait_reading_process_output):
11838         Rename inner 'proc' to 'p' to avoid shadowing.
11839         Indent for consistency with usual Emacs style.
11841 2011-11-25  Eli Zaretskii  <eliz@gnu.org>
11843         * xdisp.c (redisplay_window): If cursor row is not fully visible
11844         after recentering, and scroll-conservatively is set to a large
11845         number, scroll window by a few more lines to make the cursor fully
11846         visible and out of scroll-margin.  (Bug#10105)
11847         (start_display): Don't move to the next line if the display should
11848         start at a newline that is part of a display vector or an overlay
11849         string.  (Bug#10119)
11851 2011-11-24  Juri Linkov  <juri@jurta.org>
11853         * image.c (imagemagick_load_image): Move `MagickSetResolution' down
11854         after the `MagickPingImage' call.  (Bug#10112)
11856 2011-11-23  Chong Yidong  <cyd@gnu.org>
11858         * window.c (Fcoordinates_in_window_p): Accept only live windows.
11860 2011-11-23  Martin Rudalics  <rudalics@gmx.at>
11862         * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
11863         making another buffer current.  (Bug#10114)
11865 2011-11-23  Glenn Morris  <rgm@gnu.org>
11867         * font.c (font_find_for_lface) [HAVE_NS]: Ignore case.  (Bug#2526)
11869 2011-11-23  Chong Yidong  <cyd@gnu.org>
11871         * xdisp.c (compute_stop_pos): Check validity of end_charpos before
11872         using it (Bug#5984).
11874 2011-11-22  Eli Zaretskii  <eliz@gnu.org>
11876         * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
11877         and header-lines, as they don't have one computed for them.
11878         (Bug#10098)
11880         * .gdbinit (prow): Make displayed values more self-explaining.
11881         Add row's hash code.
11883 2011-11-21  Lars Magne Ingebrigtsen  <larsi@gnus.org>
11885         * process.c (wait_reading_process_output): Fix asynchrounous
11886         GnuTLS socket handling on some versions of the GnuTLS library.
11887         (wait_reading_process_output): Add comment and URL.
11889 2011-11-21  Jan Djärv  <jan.h.d@swipnet.se>
11891         * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
11893 2011-11-21  Chong Yidong  <cyd@gnu.org>
11895         * window.c (Fnext_window, Fprevious_window): Doc fix.
11897 2011-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>
11899         * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
11901 2011-11-20  Juanma Barranquero  <lekktu@gmail.com>
11903         * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
11905 2011-11-20  Martin Rudalics  <rudalics@gmx.at>
11907         * window.c (Fset_window_combination_limit): Rename argument
11908         STATUS to LIMIT.
11909         (Vwindow_combination_limit): Remove "status" from doc-string.
11911 2011-11-20  Andreas Schwab  <schwab@linux-m68k.org>
11913         * m/ibms390.h: Remove.
11914         * m/ibms390x.h: Don't include "ibms390.h".
11916 2011-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>
11918         * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
11919         Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
11921 2011-11-20  Juanma Barranquero  <lekktu@gmail.com>
11923         * casetab.c (Fset_case_table):
11924         * charset.c (Fcharset_after): Fix typos.
11926 2011-11-20  Paul Eggert  <eggert@cs.ucla.edu>
11928         Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
11929         Otherwise, valgrind does not work on some platforms.
11930         Problem reported by Andreas Schwab in
11931         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
11932         * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
11933         is set, removing the need for VIRT_ADDRESS_VARIES.
11934         (PURE_P): Use a more-efficient implementation that needs just one
11935         comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
11936         number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
11937         to 4 (xorl, subq, cmpq, setbe).
11938         * alloc.c (pure): Always extern now, since that's the
11939         VIRT_ADDR_VARIES behavior.
11940         (PURE_POINTER_P): Use a single comparison, not two, for
11941         consistency with the new puresize.h.
11942         * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
11943         * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
11944         Remove VIRT_ADDR_VARIES no longer needed.
11946 2011-11-19  Eli Zaretskii  <eliz@gnu.org>
11948         * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
11949         (erase_phys_cursor, update_window_cursor, show_mouse_face)
11950         (cursor_in_mouse_face_p): If the cursor position is out of bounds,
11951         behave as if the cursor position were at the window margin.
11953         * window.c (get_phys_cursor_glyph): If the window is hscrolled,
11954         and the cursor position is out of bounds, behave as if the cursor
11955         position were at the window margin.  (Bug#10075)
11957 2011-11-18  Chong Yidong  <cyd@gnu.org>
11959         * window.c (Fwindow_combination_limit): Make first argument
11960         non-optional, since it is meaningless for live windows like the
11961         selected window.
11963 2011-11-18  Dmitry Antipov  <dmantipov@yandex.ru>
11965         * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
11967 2011-11-18  Stefan Monnier  <monnier@iro.umontreal.ca>
11969         * intervals.c: Fix grafting over the whole buffer (bug#10071).
11970         (graft_intervals_into_buffer): Simplify.
11972 2011-11-18  Eli Zaretskii  <eliz@gnu.org>
11974         * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
11975         hash values of the two rows.
11976         (copy_row_except_pointers): Preserve the used[] arrays and the
11977         hash values of the two rows.  (Bug#10035)
11978         (add_row_entry): Add xassert to verify that ROW's hash code is valid.
11980         * xdisp.c (row_hash): New function, body extracted from
11981         compute_line_metrics.
11982         (compute_line_metrics): Call row_hash, instead of computing the
11983         hash code inline.
11985         * dispnew.c (verify_row_hash): Call row_hash for computing the
11986         hash code of a row, instead of duplicating code from xdisp.c.
11988         * dispextern.h (row_hash): Add prototype.
11990 2011-11-18  Tassilo Horn  <tassilo@member.fsf.org>
11992         * frame.c (delete_frame): Don't delete the terminal when the last
11993         X frame is closed if emacs is built with GTK toolkit.
11995 2011-11-17  Juanma Barranquero  <lekktu@gmail.com>
11997         * window.c (syms_of_window) <window-combination-resize>: Fix typo.
11999 2011-11-17  Martin Rudalics  <rudalics@gmx.at>
12001         * window.c (Vwindow_splits): Rename to
12002         Vwindow_combination_resize.  Suggested by Juri Linkov.
12003         (Fsplit_window_internal): Use Vwindow_combination_resize instead
12004         of Vwindow_splits.
12006 2011-11-16  Juanma Barranquero  <lekktu@gmail.com>
12008         * nsfns.m (Fns_font_name):
12009         * window.c (syms_of_window) <window-combination-limit>: Fix typos.
12011 2011-11-16  Martin Rudalics  <rudalics@gmx.at>
12013         * window.h (window): Rename slot "nest" to "combination_limit".
12014         * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
12015         (Fset_window_nest): Rename to Fset_window_combination_limit.
12016         (Vwindow_nest): Rename to Vwindow_combination_limit.
12017         (recombine_windows, make_parent_window, make_window)
12018         (Fsplit_window_internal, saved_window)
12019         (Fset_window_configuration, save_window_save): Rename all
12020         occurrences of window_nest to window_combination_limit.
12022 2011-11-15  Juanma Barranquero  <lekktu@gmail.com>
12024         * image.c (imagemagick_load_image): Fix typo.
12026 2011-11-14  Eli Zaretskii  <eliz@gnu.org>
12028         * xdisp.c (display_line): Move the call to
12029         highlight_trailing_whitespace before the call to
12030         compute_line_metrics, since the latter needs to see the final
12031         faces of all the glyphs to compute ROW's hash value.
12032         Fixes assertion violations in row_equal_p.  (Bug#10035)
12034 2011-11-14  Juanma Barranquero  <lekktu@gmail.com>
12036         * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
12037         just return (bug#10044).
12039 2011-11-12  Eli Zaretskii  <eliz@gnu.org>
12041         * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
12042         with user-defined heap size.  Bump the default size of the temacs
12043         heap to 27MB, to avoid memory warning when running temacs.
12044         ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
12046         * dispnew.c (scrolling_window): Fix incorrect indices in accessing
12047         current_matrix and desired_matrix.  (Bug#9990)
12048         (verify_row_hash) [XASSERTS]: New function.
12049         (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
12050         that the hash value of glyph rows is correct.
12052 2011-11-12  Martin Rudalics  <rudalics@gmx.at>
12054         * window.h (window): Remove splits slot.
12055         * window.c (Fwindow_splits, Fset_window_splits): Remove.
12056         (Fdelete_other_windows_internal, make_parent_window)
12057         (make_window, Fsplit_window_internal, Fdelete_window_internal)
12058         (Fset_window_configuration, save_window_save): Don't deal with
12059         split status of windows.
12060         (saved_window): Remove splits slot.
12061         (Vwindow_splits): Rewrite doc-string.
12063 2011-11-11  Jan Djärv  <jan.h.d@swipnet.se>
12065         * xfns.c (unwind_create_frame):
12066         * nsfns.m (unwind_create_frame):
12067         * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
12068         Vframe_list (Bug#9999).
12070 2011-11-11  Dmitry Antipov  <dmantipov@yandex.ru>
12072         * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
12074 2011-11-11  Kenichi Handa  <handa@m17n.org>
12076         * callproc.c (Fcall_process): Set the member dst_multibyte of
12077         process_coding.
12079 2011-11-11  Johan Bockgård  <bojohan@gnu.org>
12081         * xdisp.c (fill_composite_glyph_string): Always set s->face, to
12082         avoid a crash (bug#9496).
12084 2011-11-09  Chong Yidong  <cyd@gnu.org>
12086         * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
12087         (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
12089 2011-11-08  Paul Eggert  <eggert@cs.ucla.edu>
12091         * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
12093 2011-11-08  Paul Eggert  <eggert@cs.ucla.edu>
12095         Avoid some portability problems by eschewing 'extern inline' functions.
12096         The trivial performance wins aren't worth the portability hassles; see
12097         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
12098         et seq.
12099         * dispextern.h (window_box, window_box_height, window_text_bottom_y)
12100         (window_box_width, window_box_left, window_box_left_offset)
12101         (window_box_right, window_box_right_offset): Undo previous change,
12102         by removing the "extern"s.
12103         * intervals.c (adjust_intervals_for_insertion)
12104         (adjust_intervals_for_deletion): Undo previous change,
12105         making these static again.
12106         (offset_intervals, temp_set_point_both, temp_set_point)
12107         (copy_intervals_to_string): No longer inline.
12108         * xdisp.c (window_text_bottom_y, window_box_width)
12109         (window_box_height, window_box_left_offset)
12110         (window_box_right_offset, window_box_left, window_box_right)
12111         (window_box): No longer inline.
12113 2011-11-08  Chong Yidong  <cyd@gnu.org>
12115         * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
12116         (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
12117         Signal an error if not a live window.
12118         (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
12119         (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
12121 2011-11-07  Juanma Barranquero  <lekktu@gmail.com>
12123         * lisp.h (syms_of_abbrev): Remove declaration.
12124         Reported by CHENG Gao <chenggao@royau.me>.
12126 2011-11-07  Eli Zaretskii  <eliz@gnu.org>
12128         * w32.c (check_windows_init_file): Don't look for term/w32-win.el
12129         if Vpurify_flag is non-nil.  Fixes a crash when running w32 build
12130         of temacs in GUI mode.
12132 2011-11-07  Martin Rudalics  <rudalics@gmx.at>
12134         * window.h: Declare delete_all_child_windows instead of
12135         delete_all_subwindows.
12136         * window.c (Fwindow_nest, Fset_window_nest)
12137         (Fset_window_new_total, Fset_window_new_normal)
12138         (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
12139         (delete_all_subwindows): Rename to delete_all_child_windows.
12140         (Fdelete_other_windows_internal, Fset_window_configuration):
12141         Call delete_all_child_windows instead of delete_all_subwindows.
12142         * frame.c (delete_frame): Call delete_all_child_windows instead
12143         of delete_all_subwindows.
12145 2011-11-07  Paul Eggert  <eggert@cs.ucla.edu>
12147         * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
12148         This is also needed for porting to any host where GC_MARK_STACK is
12149         not GC_MAKE_GCPROS_NOOPS.
12150         (which_symbols): Use it.
12152 2011-11-07  Kenichi Handa  <handa@m17n.org>
12154         * coding.c (coding_set_destination): Check coding->src_pos only
12155         when coding->src_object is a buffer (bug#9910).
12157         * process.c (send_process): Set the member src_multibyte of coding
12158         to 0 (bug#9911) when sending a unibyte text.
12160         * callproc.c (Fcall_process): Set the member src_multibyte of
12161         process_coding to 0 (bug#9912).
12163 2011-11-06  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
12165         * xmenu.c (cleanup_widget_value_tree): New function.
12166         (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
12167         calling free_menubar_widget_value_tree directly (Bug#9830).
12169 2011-11-06  Paul Eggert  <eggert@cs.ucla.edu>
12171         Fix some portability problems with 'inline'.
12172         * dispextern.h (window_box, window_box_height, window_text_bottom_y)
12173         (window_box_width, window_box_left, window_box_left_offset)
12174         (window_box_right, window_box_right_offset): Declare extern.
12175         Otherwise, these inline functions do not conform to C99 and
12176         are miscompiled by Microsoft compilers.  Reported by Eli Zaretskii in
12177         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
12178         * intervals.c (adjust_intervals_for_insertion)
12179         (adjust_intervals_for_deletion): Now extern, because otherwise the
12180         extern inline functions 'offset_intervals' couldn't refer to it.
12181         (static_offset_intervals): Remove.
12182         (offset_intervals): Rewrite using the old contents of
12183         static_offset_intervals.  The old version didn't conform to C99
12184         because an extern inline function contained a reference to an
12185         identifier with static linkage.
12187 2011-11-06  Andreas Schwab  <schwab@linux-m68k.org>
12189         * keyboard.c (interrupt_signal): Don't call kill-emacs while in
12190         GC.
12192 2011-11-06  Eli Zaretskii  <eliz@gnu.org>
12194         * xdisp.c (init_iterator, reseat_to_string): Don't set the
12195         iterator's bidi_p flag if Vpurify_flag is non-nil.  (Bug#9963)
12196         (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
12197         return Qleft_to_right.
12199 2011-11-06  Chong Yidong  <cyd@gnu.org>
12201         * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
12202         (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
12203         (Fset_window_splits, Fwindow_nest, Fset_window_nest)
12204         (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
12205         (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
12206         (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
12207         (Fwindow_vscroll): Doc fix.
12208         (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
12209         argument, since it makes no sense to pass a live window and for
12210         consistency with window-child.
12212 2011-11-05  Christoph Scholtes  <cschol2112@googlemail.com>
12214         * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
12215         support MSVC.
12217 2011-11-05  Jason Rumney  <jasonr@gnu.org>
12219         * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
12220         (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
12221         fonts (Bug#6029).
12222         (add_font_entity_to_list): Fix logic errors in mixed boolean and
12223         bitwise arithmetic preventing use of unicode-sip and non-truetype
12224         opentype fonts.
12226 2011-11-05  Eli Zaretskii  <eliz@gnu.org>
12228         * s/ms-w32.h (fstat, stat, utime): Move redirections to
12229         "emacs"-only part.
12231         * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
12232         initialization code to keep similarity to xfns.c after changes
12233         from 2011-11-05.
12235 2011-11-05  Jan Djärv  <jan.h.d@swipnet.se>
12237         * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
12238         (unwind_create_frame): New function (Bug#9943).
12239         (Fx_create_frame): Restructure code to be more similar to the one in
12240         xfns.c.  Call record_unwind_protect with unwind_create_frame (Bug#9943).
12241         Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
12242         Move terminal->reference_count++ just before making the frame official
12243         (Bug#9943).
12245         * nsterm.m (x_free_frame_resources): New function.
12246         (x_destroy_window): Move code to x_free_frame_resources.
12248         * xfns.c (unwind_create_frame): Fix comment.
12249         (Fx_create_frame, x_create_tip_frame):
12250         Move terminal->reference_count++ just before making the frame
12251         official.  Move initialization of image_cache_refcount and
12252         dpyinfo_refcount before calling init_frame_faces (Bug#9943).
12254 2011-11-05  Eli Zaretskii  <eliz@gnu.org>
12256         Support MSVC build with newer versions of Visual Studio.
12257         * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
12258         Nmake barfs on that.  Use $(OBJ*_c) variables instead, defined on
12259         nt/gmake.defs.
12261         * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
12262         which are not supported by MSVC.
12263         (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
12264         (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
12265         bitfields.
12266         (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
12267         types in bitfields.
12268         (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
12270         * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
12272 2011-11-05  Fabrice Popineau  <fabrice.popineau@supelec.fr>  (tiny change)
12274         Support MSVC build with newer versions of Visual Studio.
12275         * w32.c: Don't include w32api.h for MSVC.
12276         (init_environment) [_MSC_VER]: Call sys_access, not _access.
12278         * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
12279         [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
12280         (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
12281         (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
12282         e_* cousins.
12283         (alloca) [_MSC_VER]: Define to _alloca.
12285         * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
12287         * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
12289 2011-11-04  Eli Zaretskii  <eliz@gnu.org>
12291         * xdisp.c (note_mouse_highlight): If either of
12292         previous/next-single-property-change returns nil, treat that as
12293         the beginning or the end of the buffer.  (Bug#9955)
12295 2011-11-04  Jan Djärv  <jan.h.d@swipnet.se>
12297         * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
12298         label is not null (Bug#9951).
12299         (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
12300         may be NULL.
12302 2011-11-04  Eli Zaretskii  <eliz@gnu.org>
12304         * window.c (Fwindow_body_size): Mention in the doc string that the
12305         return value is in frame's canonical units.  (Bug#9949)
12307 2011-11-03  Eli Zaretskii  <eliz@gnu.org>
12309         * xdisp.c (note_mouse_highlight): Initialize `area'.  (Bug#9947)
12311         * w32fns.c (unwind_create_frame): If needed, free the glyph
12312         matrices of the partially constructed frame.  (Bug#9943)
12313         * xfns.c (unwind_create_frame): Likewise.
12315 2011-11-01  Eli Zaretskii  <eliz@gnu.org>
12317         * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
12318         Don't stop backward scan on the continuation glyph, even though
12319         its CHARPOS is positive.
12320         (mouse_face_from_buffer_pos, note_mouse_highlight):
12321         Rename cover_string to disp_string.
12323 2011-11-01  Martin Rudalics  <rudalics@gmx.at>
12325         * window.c (temp_output_buffer_show): Don't use
12326         Vtemp_buffer_show_specifiers.
12327         (Vtemp_buffer_show_specifiers): Remove unused variable.
12329 2011-10-30  Eli Zaretskii  <eliz@gnu.org>
12331         * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
12332         past the beginning of the current glyph matrix.
12334 2011-10-30  Adam Sjøgren  <asjo@koldfront.dk>  (tiny change)
12336         * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
12337         (x_error_handler): Ignore BadMatch for X_SetInputFocus for
12338         HAVE_GTK3 (Bug#9869).
12340         * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
12341         type to GDK_NOTHING so valgrind does not complain (Bug#9901).
12343         * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
12345         * xterm.c: Declare x_handle_net_wm_state to return int.
12346         (handle_one_xevent): Check if we are iconified but don't have
12347         _NET_WM_STATE_HIDDEN.  If do, treat as deiconify (Bug#9893).
12348         (get_current_wm_state): Return non-zero if not hidden,
12349         check for _NET_WM_STATE_HIDDEN (Bug#9893).
12350         (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
12351         (x_handle_net_wm_state): Return what get_current_wm_state returns.
12352         (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
12354 2011-10-29  Paul Eggert  <eggert@cs.ucla.edu>
12356         * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
12357         so that this new function doesn't get optimized away by a
12358         whole-program optimizer.  Make the 2nd arg EMACS_INT, not int.
12360 2011-10-29  Andreas Schwab  <schwab@linux-m68k.org>
12362         * frame.h (MOUSE_HL_INFO): Remove excess parens.
12364 2011-10-29  Eli Zaretskii  <eliz@gnu.org>
12366         Fix the `xbytecode' command.
12367         * .gdbinit (xprintbytestr): New command.
12368         (xwhichsymbols): Rename from `which'; all callers changed.
12369         (xbytecode): Print the byte-code string as well.
12371 2011-10-29  Kim Storm  <storm@cua.dk>
12373         * alloc.c (which_symbols): New function.
12375 2011-10-29  Andreas Schwab  <schwab@linux-m68k.org>
12377         * minibuf.c (read_minibuf_noninteractive): Allow reading empty
12378         line.  (Bug#9903)
12380 2011-10-29  Glenn Morris  <rgm@gnu.org>
12382         * process.c (wait_reading_process_output): Revert 2009-08-30 change.
12383         Not clear what it was for, and it causes various bugs.  (Bug#9839)
12385 2011-10-28  Eli Zaretskii  <eliz@gnu.org>
12387         * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
12388         possible random value that matches one of those tested as
12389         condition to clear the mouse face.
12391 2011-10-28  Chong Yidong  <cyd@gnu.org>
12393         * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
12395 2011-10-28  Dan Nicolaescu  <dann@ics.uci.edu>
12397         * window.c (make_window): Initialize phys_cursor_on_p.
12399 2011-10-28  Stefan Monnier  <monnier@iro.umontreal.ca>
12401         * lisp.h (struct Lisp_Symbol): Update comments.
12403 2011-10-28  Juanma Barranquero  <lekktu@gmail.com>
12405         * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
12407 2011-10-28  Eli Zaretskii  <eliz@gnu.org>
12409         Fix Emacs on Windows 9X (bug#8562).  Thanks to oslsachem
12410         <oslsachem@gmail.com> for helping to debug this.
12412         * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
12413         (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
12414         (g_b_init_get_glyph_outline_w): New static variables.
12415         (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
12416         (GetGlyphOutlineW_Proc): New typedefs.
12417         (w32_load_unicows_or_gdi32, get_outline_metrics_w)
12418         (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
12419         New functions.
12420         (w32font_open_internal, compute_metrics):
12421         Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
12422         instead of calling the "wide" APIs directly.
12424         * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
12426         * w32.h (syms_of_w32font): Add prototype.
12428 2011-10-27  Juanma Barranquero  <lekktu@gmail.com>
12430         * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
12431         (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
12432         (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
12433         (Fmove_to_window_line): Doc fix.
12435 2011-10-27  Chong Yidong  <cyd@gnu.org>
12437         * process.c (make_process): Set gnutls_state to NULL.
12439         * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
12440         non-NULL, regardless of GNUTLS_INITSTAGE.
12441         (Fgnutls_boot): Cleanups.  Call emacs_gnutls_deinit if we signal
12442         an error.  Set process slots as soon as we allocate them.
12444         * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
12446 2011-10-27  Chong Yidong  <cyd@gnu.org>
12448         * gnutls.c (emacs_gnutls_deinit): New function.
12449         Deallocate credentials structures as well as calling gnutls_deinit.
12450         (Fgnutls_deinit, Fgnutls_boot): Use it.
12452         * process.c (make_process): Initialize GnuTLS credentials to NULL.
12453         (deactivate_process): Call emacs_gnutls_deinit.
12455 2011-10-27  Juanma Barranquero  <lekktu@gmail.com>
12457         * image.c (x_create_x_image_and_pixmap):
12458         * w32.c (sys_rename, w32_delayed_load):
12459         * w32font.c (fill_in_logfont):
12460         * w32reg.c (x_get_string_resource): Silence compiler warnings.
12462 2011-10-26  Juanma Barranquero  <lekktu@gmail.com>
12464         * w32fns.c (w32_default_color_map): New function,
12465         extracted from Fw32_default_color_map.
12466         (Fw32_default_color_map, Fx_open_connection): Use it.  (Bug#9785)
12468 2011-10-25  Paul Eggert  <eggert@cs.ucla.edu>
12470         * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
12472 2011-10-25  Stefan Monnier  <monnier@iro.umontreal.ca>
12474         * keyboard.c (test_undefined): New function (bug#9751).
12475         (read_key_sequence): Use it to detect when a key is bound to `undefined'.
12477 2011-10-25  Enami Tsugutomo  <tsugutomo.enami@jp.sony.com>
12479         * sysdep.c (init_sys_modes): Fix the check for the controlling
12480         terminal (Bug#6649).
12482 2011-10-20  Eli Zaretskii  <eliz@gnu.org>
12484         * dispextern.h (struct bidi_it): New member next_en_type.
12486         * bidi.c (bidi_line_init): Initialize the next_en_type member.
12487         (bidi_resolve_explicit_1): When next_en_pos is valid for the
12488         current character, check also for next_en_type being WEAK_EN.
12489         (bidi_resolve_weak): Don't enter the expensive loop if the current
12490         position is before next_en_pos.  Record the bidi type of the first
12491         non-ET, non-BN character we find, in addition to its position.
12492         (bidi_level_of_next_char): Invalidate next_en_type when
12493         next_en_pos is over-stepped.
12495 2011-10-20  Paul Eggert  <eggert@cs.ucla.edu>
12497         Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
12498         * editfns.c: Rewrite current-time-zone so that it invokes
12499         the equivalent of (format-time-string "%Z") to get the time zone name.
12500         This fixes a bug when the time zone name contains characters that
12501         need converting from the system time locale to Emacs internal format.
12502         This fixes a shortcoming that I introduced in my 1999-10-19 patch:
12503         that patch fixed format-time-string to do the conversion, but
12504         I forgot to fix current-time-zone.
12505         (format_time_string): New function, containing most of
12506         what Fformat_time_string used to contain.
12507         (Fformat_time_string): Rewrite in terms of format_time_string.
12508         This doesn't change this function's behavior.
12509         (current-time-zone): Rewrite to use format_time_string.
12510         This fixes the bug reported by Michael Schierl in
12511         <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
12512         Jason Rumney's 2007-06-07 change worked around this bug, but
12513         didn't fix it.
12514         * systime.h (tzname, timezone): Remove no-longer-used declarations.
12516 2011-10-19  Eli Zaretskii  <eliz@gnu.org>
12518         * xdisp.c (start_display): If the character at POS is displayed
12519         via a display vector, reset IT->current.dpvec_index to zero.
12520         (try_window_reusing_current_matrix): If a line ends in a display
12521         vector or the next line starts in a display vector, continue
12522         redrawing the window even though the character position of
12523         start_row was reached.
12524         (Bug#9771, part 2)
12526 2011-10-18  Chong Yidong  <cyd@gnu.org>
12528         * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
12529         with nobreak-char-display too.
12531 2011-10-18  Eli Zaretskii  <eliz@gnu.org>
12533         Fix part 3 of bug#9771.
12534         * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
12535         (bidi_resolve_neutral): Don't enter the expensive loop looking for
12536         non-neutral characters if the current character is a paragraph
12537         separator (a.k.a. Newline).  This avoids running the same
12538         expensive loop twice, once when we consume the preceding newline
12539         and the other time when the line actually needs to be displayed.
12540         Avoid the loop when we see neutrals on the base embedding level
12541         following a character whose directionality is the same as the
12542         paragraph's.  This avoids running the expensive loop when a line
12543         ends in a long sequence of neutrals, like control characters.
12544         Add assertion against STRONG_AL type.  Slightly rearrange code
12545         that determines the type of a neutral given the first non-neutral
12546         that follows it.
12547         (bidi_level_of_next_char): Set next_en_pos to zero when
12548         invalidating its info.
12550 2011-10-17  Eli Zaretskii  <eliz@gnu.org>
12552         * xdisp.c (push_display_prop): Determine whether to record string
12553         or buffer position by IT->string, not by IT->method.  Allow
12554         GET_FROM_DISPLAY_VECTOR as IT->method on entry.  (Bug#9771, part 4)
12555         (move_it_vertically_backward): Don't look for character position
12556         immediately after the newline when in a continuation line.
12557         (Bug#9771, part 1)
12559 2011-10-15  Martin Rudalics  <rudalics@gmx.at>
12561         * window.c (coordinates_in_window): Rewrite and delabelize
12562         vertical border check.  (Bug#5357) (Bug#9618)
12564 2011-10-14  Stefan Monnier  <monnier@iro.umontreal.ca>
12566         * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
12567         errors in XSetWindowBorder (bug#9310).
12569 2011-10-13  Dmitry Antipov  <dmantipov@yandex.ru>
12571         * editfns.c (Fset_time_zone_rule): Replace free with xfree to
12572         avoid crash when xmalloc overrun checking is enabled.
12574 2011-10-13  Eli Zaretskii  <eliz@gnu.org>
12576         * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
12577         itb.paragraph_dir to NEUTRAL_DIR.  Fixes an occasional incorrect
12578         cursor motion with <left> and <right> arrow keys.
12580         * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
12581         some callers set that themselves.
12583 2011-10-12  Eli Zaretskii  <eliz@gnu.org>
12585         * xdisp.c (find_row_edges): Handle the case where ROW comes from a
12586         display string and the previous row comes from the same string and
12587         is empty.  (Bug#9739)  (Bug#9738)
12589 2011-10-12  Stefan Monnier  <monnier@iro.umontreal.ca>
12591         * doc.c (get_doc_string): Encode file name (bug#9735).
12593 2011-10-12  Eli Zaretskii  <eliz@gnu.org>
12595         * bidi.c (bidi_level_of_next_char):
12596         * xdisp.c (get_visually_first_element): Remove old incorrect
12597         comments regarding the Unicode Line Separator character.
12599         * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
12601 2011-10-12  Dmitry Antipov  <dmantipov@yandex.ru>
12603         * alloc.c (Fgc_status): Do not access beyond zombies array
12604         boundary if nzombies > MAX_ZOMBIES.
12605         * alloc.c (dump_zombies): Add missing format specifier.
12607 2011-10-12  Paul Eggert  <eggert@cs.ucla.edu>
12609         * xdisp.c (set_cursor_from_row): Simplify conditionals,
12610         to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
12612         * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
12613         Some packages use them to denote characters with modifiers.
12615 2011-10-11  Andreas Schwab  <schwab@linux-m68k.org>
12617         * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
12618         (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
12619         matching a pp-number.  Rename parameter var to var1.
12621 2011-10-11  Stefan Monnier  <monnier@iro.umontreal.ca>
12623         * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
12625 2011-10-08  Glenn Morris  <rgm@gnu.org>
12627         * callint.c (Fcall_interactively): Give a more explicit error for the
12628         'c' case with a non-character input.  (Bug#8479)
12630 2011-10-08  Eli Zaretskii  <eliz@gnu.org>
12632         * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
12633         lines.
12634         (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
12635         lines that are hscrolled on the left.
12637         * dispnew.c (buffer_posn_from_coords): Account for a possible
12638         presence of header-line.  (Bug#4426)
12640 2011-10-07  Stefan Monnier  <monnier@iro.umontreal.ca>
12642         * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
12643         Don't advertise functionality which we discourage or doesn't work.
12645 2011-10-07  Paul Eggert  <eggert@cs.ucla.edu>
12647         * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
12648         or sizeof.  __alignof__ gives the wrong answer on Fedora x86-64
12649         with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
12650         this makes Emacs dump core during garbage collection on rare
12651         occasions.  sizeof is obviously inferior to offsetof here, so
12652         stick with offsetof.
12653         (GC_POINTER_ALIGNMENT): New macro.
12654         (mark_memory): Omit 3rd (offset) arg; caller changed.
12655         Don't assume EMACS_INT alignment is the same as pointer alignment.
12657 2011-10-03  Stefan Monnier  <monnier@iro.umontreal.ca>
12659         * keyboard.c (read_key_sequence_remapped): New var.
12660         (read_key_sequence): Compute remapping in the right buffer.
12661         (command_loop_1): Use read_key_sequence's remapping directly.
12663 2011-10-02  Stefan Monnier  <monnier@iro.umontreal.ca>
12665         * dired.c (file_name_completion): Don't expand file name.
12666         (Ffile_name_completion, Ffile_name_all_completions): Expand file name
12667         before checking file name handler.
12669         * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
12670         they've been requested explicitly (bug#9591).
12672 2011-10-01  Andreas Schwab  <schwab@linux-m68k.org>
12674         * keymap.c (Fsingle_key_description): Use make_specified_string
12675         instead of build_string to build string from push_key_description.
12676         (Bug#5193)
12678 2011-09-30  Paul Eggert  <eggert@cs.ucla.edu>
12680         * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
12681         This fixes a Y2038 bug on 64-bit hosts.
12682         * buffer.c (reset_buffer):
12683         * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
12684         (Fclear_buffer_auto_save_failure):
12685         Use 0, not -1, to represent an unset failure time, since time_t
12686         might not be signed.
12688         Remove dependency on glibc malloc internals.
12689         * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12690         Move back here from lisp.h, but with their new implementations.
12691         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
12692         (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
12693         * charset.c (charset_table_init): New static var.
12694         (syms_of_charset): Use it instead of xmalloc.  This removes a
12695         dependency on glibc malloc internals.  See Eli Zaretskii's comment in
12696         <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
12697         * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12698         Move back to alloc.c.
12699         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
12700         (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
12702 2011-09-30  Jan Djärv  <jan.h.d@swipnet.se>
12704         * nsterm.m (windowDidResize): Call x_set_window_size only when
12705         ns_in_resize is true.  Otherwise set pixelwidth/height and
12706         call change_frame_size (Bug#9628).
12708 2011-09-30  Paul Eggert  <eggert@cs.ucla.edu>
12710         Port --enable-checking=all to Fedora 14 x86-64.
12711         * charset.c (syms_of_charset): Also account for glibc malloc's
12712         internal overhead when calculating the initial malloc maximum.
12714         Port --enable-checking=all to Fedora 14 x86.
12715         * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12716         Move to lisp.h.
12717         (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
12718         (overrun_check_realloc, overrun_check_free):
12719         Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
12720         That way, xmalloc returns a properly-aligned pointer even if
12721         XMALLOC_OVERRUN_CHECK is defined.  The old debugging code happened
12722         to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
12723         * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
12724         into account when calculating the initial malloc maximum.
12725         * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12726         Move here from alloc.c, so that charset.c can use it too.
12727         Properly align; the old code wasn't right for common 32-bit hosts
12728         when configured with --enable-checking=all.
12729         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
12730         (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
12732 2011-09-29  Eli Zaretskii  <eliz@gnu.org>
12734         * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
12735         use EDOM.
12737 2011-09-28  Eli Zaretskii  <eliz@gnu.org>
12739         * xdisp.c (compute_display_string_end): If there's no display
12740         string at CHARPOS, return -1.
12742         * bidi.c (bidi_fetch_char): When compute_display_string_end
12743         returns a negative value, treat the character as a normal
12744         character not covered by a display string.  (Bug#9624)
12746 2011-09-28  Juanma Barranquero  <lekktu@gmail.com>
12748         * lread.c (Fread_from_string): Fix typo in docstring.
12750 2011-09-27  Eli Zaretskii  <eliz@gnu.org>
12752         * xdisp.c (handle_invisible_prop): If invisible text ends on a
12753         newline, reseat the iterator instead of bidi-iterating there one
12754         character at a time.  (Bug#9610)
12755         (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
12756         TO_CHARPOS if the bidi iterator is at base embedding level.
12758 2011-09-27  Andreas Schwab  <schwab@linux-m68k.org>
12760         * lread.c (readevalloop): Use correct code for NBSP.
12761         (read1): Likewise.  (Bug#9608)
12763 2011-09-25  Michael Albinus  <michael.albinus@gmx.de>
12765         * dbusbind.c (Fdbus_register_signal): When service is not
12766         registered, use nil in Vdbus_registered_objects_table.  (Bug#9581)
12768 2011-09-25  Glenn Morris  <rgm@gnu.org>
12770         * buffer.c (truncate-lines): Doc fix.
12772 2011-09-24  Chong Yidong  <cyd@stupidchicken.com>
12774         * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
12775         (Fset_window_next_buffers): Doc fix.
12777 2011-09-24  Glenn Morris  <rgm@gnu.org>
12779         * minibuf.c (read_minibuf): Disable line truncation.  (Bug#5715)
12781 2011-09-24  Paul Eggert  <eggert@cs.ucla.edu>
12783         Fix minor problems found by static checking.
12784         * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
12785         * indent.c (Fvertical_motion): Fix == vs = typo.
12787 2011-09-24  Eli Zaretskii  <eliz@gnu.org>
12789         * dispnew.c (syms_of_display) <redisplay-dont-pause>:
12790         Default value is now t.  Doc fix.
12792         * indent.c (Fvertical_motion): Compute and apply the overshoot
12793         logic when moving up, not only when moving down.  Fix the
12794         confusing name and values of the it_overshoot_expected variable;
12795         logic changes accordingly.  (Bug#9254) (Bug#9549)
12797         * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
12798         CHARPOS is covered by a display string which includes newlines.
12799         (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
12800         is covered by a display string with embedded newlines.
12802 2011-09-24  Michael Albinus  <michael.albinus@gmx.de>
12804         * dbusbind.c (Fdbus_register_signal): Add match rule to
12805         Vdbus_registered_objects_table.  (Bug#9581)
12806         (Fdbus_register_method, Vdbus_registered_objects_table):
12807         Fix docstring.
12809 2011-09-24  Jim Meyering  <meyering@redhat.com>
12811         do not ignore write error for any output size
12812         The previous change was incomplete.
12813         While it makes emacs --batch detect the vast majority of stdout
12814         write failures, errors were still ignored whenever the output size is
12815         k * (BUFSIZ+1) - 4.  E.g., on a system with BUFSIZ of 4096,
12816           $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
12817               && echo FAIL: ignored write error
12818           FAIL: ignored write error
12819           $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
12820               && echo FAIL: ignored write error
12821           FAIL: ignored write error
12822         * emacs.c (Fkill_emacs): Also test ferror.  (Bug#9574)
12824 2011-09-23  Andreas Schwab  <schwab@linux-m68k.org>
12826         * emacs.c (Fkill_emacs): In noninteractive mode exit
12827         non-successfully if a write error occurred on stdout.  (Bug#9574)
12829 2011-09-21  Eli Zaretskii  <eliz@gnu.org>
12831         * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
12832         the xassert test.
12834         * dispextern.h (struct it): Update the comment documenting what
12835         can it->OBJECT be.
12837 2011-09-20  Eli Zaretskii  <eliz@gnu.org>
12839         * xdisp.c (set_cursor_from_row): If the row ends in a newline from
12840         a display string, extend search for cursor position to end of row.
12841         (find_row_edges): If the row ends in a newline from a display
12842         string, increment its MATRIX_ROW_END_CHARPOS by one.  (Bug#9549)
12843         Handle the case of a display string with multiple newlines.
12844         (Fcurrent_bidi_paragraph_direction): Fix search for previous
12845         non-empty line.  Fixes confusing cursor motion with arrow keys at
12846         the beginning of a line that starts with whitespace.
12848 2011-09-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12850         * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
12851         (bug#9493).
12853 2011-09-18  Chong Yidong  <cyd@stupidchicken.com>
12855         * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
12856         boolean (Bug#9154).
12858 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
12860         * xdisp.c (display_line): Record maximum and minimum buffer
12861         positions even if no glyphs were produced (e.g., by a zero-width
12862         stretch).  Fixes bug#9530 on a TTY.  Under word-wrap, don't record
12863         buffer positions that will be removed from the glyph row because
12864         they don't fit.
12865         (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
12866         column is beyond frame width: don't subtract 1 "pixel" when
12867         computing width of the stretch.
12868         (reseat_at_next_visible_line_start): Undo the change made on
12869         2011-09-17 that saved paragraph information and restored it after
12870         the call to `reseat'.  (Bug#9545)
12872 2011-09-18  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
12874         * xdisp.c (expose_window): Save original value of phys_cursor_on_p
12875         and turn window cursor on if cleared (Bug#9415).
12877 2011-09-18  Andreas Schwab  <schwab@linux-m68k.org>
12879         * search.c (boyer_moore): Take unibyte characters from pattern
12880         literally.  (Bug#9458)
12882 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
12884         * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
12886 2011-09-18  Paul Eggert  <eggert@cs.ucla.edu>
12888         Fix minor problem found by static checking.
12889         * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
12890         initialized, to pacify gcc -Wuninitialized.
12892         * fileio.c: Report proper errno when syscall falls.
12893         (Finsert_file_contents): Save and restore errno,
12894         so that report_file_error outputs the correct diagnostic.
12895         (Fwrite_region) [CLASH_DETECTION]: Likewise.
12897 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
12899         * .gdbinit (pgx): Fix references to fields of `struct glyph'.
12901 2011-09-17  Eli Zaretskii  <eliz@gnu.org>
12903         * xdisp.c (produce_stretch_glyph): Another fix for changes made on
12904         2011-08-30T17:32:44Z!eliz@gnu.org.  (Bug#9530)
12906 2011-09-17  Eli Zaretskii  <eliz@gnu.org>
12908         * xdisp.c (reseat_at_next_visible_line_start): Keep information
12909         about the current paragraph and restore it after the call to reseat.
12911         * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
12912         (bidi_find_paragraph_start): Search back for paragraph beginning
12913         at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
12914         (bidi_move_to_visually_next): Only trigger paragraph-related
12915         computations when the last character is a newline or at EOB, not
12916         just any NEUTRAL_B.  (Bug#9470)
12918         * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
12919         truncated lines if point is covered by a display string.  (Bug#9524)
12921 2011-09-16  Paul Eggert  <eggert@cs.ucla.edu>
12923         * xselect.c: Relax test for outgoing X longs (Bug#9498).
12924         (cons_to_x_long): New function.
12925         (lisp_data_to_selection_data): Use it.  Correct the test for
12926         short-versus-long data; it was negated.  Break out of vector
12927         loop, for efficiency, when a long datum is discovered.
12929 2011-09-16  Stefan Monnier  <monnier@iro.umontreal.ca>
12931         * eval.c (Fquote): Document its non-consing behavior (bug#9482).
12933 2011-09-16  Eli Zaretskii  <eliz@gnu.org>
12935         * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
12936         GCC PR/17406) by declaring this function with external scope.
12938 2011-09-15  Paul Eggert  <eggert@cs.ucla.edu>
12940         * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
12941         Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
12943 2011-09-15  Andreas Schwab  <schwab@linux-m68k.org>
12945         * editfns.c (Fformat): Correctly handle text properties on "%%".
12947 2011-09-15  Eli Zaretskii  <eliz@gnu.org>
12949         * xterm.c (x_draw_composite_glyph_string_foreground):
12950         * w32term.c (x_draw_composite_glyph_string_foreground):
12951         * term.c (encode_terminal_code):
12952         * composite.c (composition_update_it, get_composition_id):
12953         * xdisp.c (get_next_display_element)
12954         (fill_composite_glyph_string): Add comments about special meaning
12955         of TAB characters in a composition.
12957 2011-09-15  Paul Eggert  <eggert@cs.ucla.edu>
12959         * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
12960         This occurs when processing a multibyte format.
12961         Problem reported by Wolfgang Jenker.
12963 2011-09-15  Johan Bockgård  <bojohan@gnu.org>
12965         * xdisp.c (try_cursor_movement): Only check for exact match if
12966         cursor hpos found by set_cursor_from_row is valid.  (Bug#9495)
12968 2011-09-14  Paul Eggert  <eggert@cs.ucla.edu>
12970         Remove unused external symbols.
12971         * dispextern.h (calc_pixel_width_or_height): Remove decl.
12972         * xdisp.c (calc_pixel_width_or_height): Now static.
12973         * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
12974         * indent.c (check_display_width):
12975         * w32term.c: Fix comment to match code.
12976         * xterm.c, xterm.h (x_catching_errors): Remove.
12978 2011-09-14  Paul Eggert  <eggert@cs.ucla.edu>
12980         * xselect.c: Use signed conversions more consistently (Bug#9498).
12981         (selection_data_to_lisp_data): Assume incoming selection data are
12982         signed integers, not unsigned.  This is to be consistent with
12983         outgoing selection data, which was modified to use signed integers
12984         in as part of the fix to Bug#9196 in response to Jan D.'s comment
12985         in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
12986         expects long, not unsigned long.
12988 2011-09-14  Eli Zaretskii  <eliz@gnu.org>
12990         * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
12991         computation of loop end.  Reported by Johan Bockgård
12992         <bojohan@gnu.org>.
12994 2011-09-13  Chong Yidong  <cyd@stupidchicken.com>
12996         * frame.c (Fother_visible_frames_p): Function deleted.
12998 2011-09-12  Eli Zaretskii  <eliz@gnu.org>
13000         * indent.c (compute_motion): Process display vector front to back
13001         rather than the other way around.  (Bug#2496)
13003 2011-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
13005         * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
13007 2011-09-11  Chong Yidong  <cyd@stupidchicken.com>
13009         * minibuf.c (Fread_from_minibuffer): Doc fix.
13011 2011-09-11  Eli Zaretskii  <eliz@gnu.org>
13013         * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
13014         2011-08-30T17:32:44Z!eliz@gnu.org.  (Bug#9475)
13016 2011-09-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
13018         * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
13019         value for non-existent files.
13021 2011-09-11  Eli Zaretskii  <eliz@gnu.org>
13023         * fileio.c (Finsert_file_contents): If the file cannot be opened,
13024         set its "size" to -1.  This will set the modtime_size field of
13025         the corresponding buffer to -1, which is what
13026         verify-visited-file-modtime expects for files that do not exist.
13027         (Bug#9139)
13029 2011-09-11  Paul Eggert  <eggert@cs.ucla.edu>
13031         * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
13032         here ...
13033         * lisp.h: ... from here.  push_key_description is no longer
13034         defined in keyboard.c, so its declaration should not be in
13035         lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
13036         logically belongs with push_key_description.
13038 2011-09-10  Paul Eggert  <eggert@cs.ucla.edu>
13040         * buffer.h: Include <sys/types.h> instead of <time.h>.
13041         Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
13042         Problem reported by Herbert J. Skuhra.
13044 2011-09-10  Lars Magne Ingebrigtsen  <larsi@gnus.org>
13046         * xml.c (parse_region): Make the parsing work for
13047         non-comment-starting XML files again (bug#9144).
13049 2011-09-10  Andreas Schwab  <schwab@linux-m68k.org>
13051         * image.c (gif_load): Fix calculation of bottom and right corner.
13052         (Bug#9468)
13054 2011-09-10  Eli Zaretskii  <eliz@gnu.org>
13056         * xdisp.c (MAX_DISP_SCAN): Decrease to 250.  Prevents sluggish
13057         redisplay in small windows.
13059 2011-09-09  Eli Zaretskii  <eliz@gnu.org>
13061         * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
13063 2011-09-08  Martin Rudalics  <rudalics@gmx.at>
13065         * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
13066         Operate on live windows only.
13068 2011-09-08  Juanma Barranquero  <lekktu@gmail.com>
13070         * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
13072 2011-09-07  Eli Zaretskii  <eliz@gnu.org>
13074         * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
13075         only under bidi iteration.
13077 2011-09-07  Jan Djärv  <jan.h.d@swipnet.se>
13079         * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
13081 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
13083         isnan: Fix porting problem to Solaris 10 with bundled gcc.
13084         Without this fix, the command to link temacs failed due to an
13085         undefined symbol __builtin_isnan.  This is because
13086         /usr/include/iso/math_c99.h #defines isnan(x) to
13087         __builtin_isnan(x), but the bundled gcc, which identifies itself
13088         as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
13089         a __builtin_isnan.
13090         * floatfns.c (isnan): #undef, and then #define to a clone of
13091         what's in data.c.
13092         (Fisnan): Always define, since it's always available now.
13093         (syms_of_floatfns): Always define isnan at the Lisp level.
13095 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
13097         * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
13099 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
13101         * fileio.c: Fix bugs with large file offsets (Bug#9428).
13102         The previous code assumed that file offsets (off_t values) fit in
13103         EMACS_INT variables, which is not true on typical 32-bit hosts.
13104         The code messed up by falsely reporting buffer overflow in cases
13105         such as (insert-file-contents "big" nil 1 2) into an empty buffer
13106         when "big" contains more than 2**29 bytes, even though this
13107         inserts just one byte and does not overflow the buffer.
13108         (Finsert_file_contents): Store file offsets as off_t
13109         values, not as EMACS_INT values.  Check for overflow when
13110         converting between EMACS_INT and off_t.  When checking for
13111         buffer overflow or for overlap, take the offsets into account.
13112         Don't use EMACS_INT for small values where int suffices.
13113         When checking for overlap, fix a typo: ZV was used where
13114         ZV_BYTE was intended.
13115         (Fwrite_region): Don't assume off_t fits into 'long'.
13116         * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
13118 2011-09-05  Michael Albinus  <michael.albinus@gmx.de>
13120         * dbusbind.c (xd_signature_cat): Rename from signature_cat.
13122 2011-09-04  Paul Eggert  <eggert@cs.ucla.edu>
13124         sprintf-related integer and memory overflow issues (Bug#9412).
13126         * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
13127         (esprintf, exprintf, evxprintf): New functions.
13128         * keyboard.c (command_loop_level): Now EMACS_INT, not int.
13129         (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
13130         (modify_event_symbol): Do not assume that the length of
13131         name_alist_or_stem is safe to alloca and fits in int.
13132         (Fexecute_extended_command): Likewise for function name and binding.
13133         (Frecursion_depth): Wrap around reliably on integer overflow.
13134         * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
13135         since some callers pass EMACS_INT values.
13136         (Fsingle_key_description): Don't crash if symbol name contains more
13137         than MAX_ALLOCA bytes.
13138         * minibuf.c (minibuf_level): Now EMACS_INT, not int.
13139         (get_minibuffer): Arg is now EMACS_INT, not int.
13140         * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
13141         (esprintf, exprintf, evxprintf): New decls.
13142         * window.h (command_loop_level, minibuf_level): Reflect API changes.
13144         * dbusbind.c (signature_cat): New function.
13145         (xd_signature, Fdbus_register_signal):
13146         Do not overrun buffer; instead, report string overflow.
13148         * dispnew.c (add_window_display_history): Don't overrun buffer.
13149         Truncate instead; this is OK since it's just a log.
13151         * editfns.c (Fcurrent_time_zone): Don't overrun buffer
13152         even if the time zone offset is outlandishly large.
13153         Don't mishandle offset == INT_MIN.
13155         * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
13156         when creating daemon; the previous buffer-overflow check was incorrect.
13158         * eval.c (verror): Simplify by rewriting in terms of evxprintf,
13159         which has the guts of the old verror function.
13161         * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
13162         use SAFE_ALLOCA instead.  Use esprintf to avoid int-overflow issues.
13164         * font.c: Include <float.h>, for DBL_MAX_10_EXP.
13165         (font_unparse_xlfd): Don't blindly alloca long strings.
13166         Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
13167         fits in int, when using sprintf.  Use single snprintf to count
13168         length of string rather than counting it via multiple sprintfs;
13169         that's simpler and more reliable.
13170         (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
13171         (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
13172         sprintf, in case result does not fit in int.
13174         * fontset.c (num_auto_fontsets): Now printmax_t, not int.
13175         (fontset_from_font): Print it.
13177         * frame.c (tty_frame_count): Now printmax_t, not int.
13178         (make_terminal_frame, set_term_frame_name): Print it.
13179         (x_report_frame_params): In X, window IDs are unsigned long,
13180         not signed long, so print them as unsigned.
13181         (validate_x_resource_name): Check for implausibly long names,
13182         and don't assume name length fits in 'int'.
13183         (x_get_resource_string): Don't blindly alloca invocation name;
13184         use SAFE_ALLOCA.  Use esprintf, not sprintf, in case result does
13185         not fit in int.
13187         * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
13188         (xg_check_special_colors, xg_set_geometry):
13189         Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
13191         * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
13192         Use esprintf, not sprintf, in case result does not fit in int.
13194         * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
13195         (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
13196         it as a large positive number.
13197         (Fexecute_kbd_macro): Don't assume repeat count fits in int.
13198         * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
13200         * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
13201         in case result does not fit in int.
13203         * print.c (float_to_string): Detect width overflow more reliably.
13204         (print_object): Make sprintf buffer a bit bigger, to avoid potential
13205         buffer overrun.  Don't assume list length fits in 'int'.  Treat
13206         print length of 0 as 0, not as infinity; to be consistent with other
13207         uses of print length in this function.  Don't overflow print length
13208         index.  Don't assume hash table size fits in 'long', or that
13209         vectorlike size fits in 'unsigned long'.
13211         * process.c (make_process): Use printmax_t, not int, to format
13212         process-name gensyms.
13214         * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
13216         * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
13217         to avoid potential buffer overrun.
13219         * xfaces.c (x_update_menu_appearance): Don't overrun buffer
13220         if X resource line is longer than 512 bytes.
13222         * xfns.c (x_window): Make sprintf buffer a bit bigger
13223         to avoid potential buffer overrun.
13225         * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
13227         * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
13229 2011-09-04  Paul Eggert  <eggert@cs.ucla.edu>
13231         Integer overflow fixes for scrolling, etc.
13232         Without these, Emacs silently mishandles large integers sometimes.
13233         For example, "C-u 4294967297 M-x recenter" was treated as if
13234         it were "C-u 1 M-x recenter" on a typical 64-bit host.
13236         * xdisp.c (try_window_id): Check Emacs fixnum range before
13237         converting to 'int'.
13239         * window.c (window_scroll_line_based, Frecenter):
13240         Check that an Emacs fixnum is in range before assigning it to 'int'.
13241         (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
13242         values converted from Emacs fixnums.
13243         (Frecenter): Don't wrap around a line count if it is out of 'int'
13244         range; instead, treat it as an extreme value.
13245         (Fset_window_configuration, compare_window_configurations):
13246         Use ptrdiff_t, not int, for index that might exceed 2 GiB.
13248         * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
13249         that can exceed INT_MAX.  Check that EMACS_INT value is in range
13250         before assigning it to the (possibly-narrower) index.
13251         (match_limit): Don't assume that a fixnum can fit in 'int'.
13253         * print.c (print_object): Use ptrdiff_t, not int, for index that can
13254         exceed INT_MAX.
13256         * indent.c (position_indentation): Now takes ptrdiff_t, not int.
13257         (Fvertical_motion): Don't wrap around LINES values that don't fit
13258         in 'int'.  Instead, treat them as extreme values.  This is good
13259         enough for windows, which can't have more than INT_MAX lines anyway.
13261 2011-09-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
13263         * Require libxml/parser.h to avoid compilation warning.
13265         * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
13267         * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
13268         since this reportedly can destroy thread storage.
13270 2011-08-30  Chong Yidong  <cyd@stupidchicken.com>
13272         * syntax.c (find_defun_start): Update all cache variables if
13273         exiting early (Bug#9401).
13275 2011-08-30  Eli Zaretskii  <eliz@gnu.org>
13277         * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
13279         * xdisp.c (produce_stretch_glyph): No longer static, compiled also
13280         when HAVE_WINDOW_SYSTEM is not defined.  Support both GUI and TTY
13281         frames.  Call tty_append_glyph in the TTY case.  (Bug#9402)
13283         * term.c (tty_append_glyph): New function.
13284         (produce_stretch_glyph): Static function and its prototype deleted.
13286         * dispextern.h (produce_stretch_glyph, tty_append_glyph):
13287         Add prototypes.
13289 2011-08-29  Paul Eggert  <eggert@cs.ucla.edu>
13291         * image.c (parse_image_spec): Check for nonnegative, not for positive,
13292         when checking :margin (Bug#9390).
13293         (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
13294         Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
13295         so that the name doesn't mislead.  All uses changed.
13297 2011-08-28  Johan Bockgård  <bojohan@gnu.org>
13299         * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
13300         set_tty_hooks.
13302 2011-08-27  Eli Zaretskii  <eliz@gnu.org>
13304         * xdisp.c (move_it_to): Don't bail out early when reaching
13305         position beyond to_charpos, if we are scanning backwards.
13306         (move_it_vertically_backward): When DY == 0, make sure we get to
13307         the first character in the line after the newline.
13309 2011-08-27  Paul Eggert  <eggert@cs.ucla.edu>
13311         * ccl.c: Improve and simplify overflow checking (Bug#9196).
13312         (ccl_driver): Do not generate an out-of-range pointer.
13313         (Fccl_execute_on_string): Remove unnecessary check for
13314         integer overflow, noted by Stefan Monnier in
13315         <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
13316         Remove a FIXME that didn't need fixing.
13317         Simplify the newly-introduced buffer reallocation code.
13319 2011-08-27  Juanma Barranquero  <lekktu@gmail.com>
13321         * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
13323 2011-08-26  Paul Eggert  <eggert@cs.ucla.edu>
13325         Integer and memory overflow issues (Bug#9196).
13327         * doc.c (get_doc_string): Rework so that
13328         get_doc_string_buffer_size is the actual buffer size, rather than
13329         being 1 less than the actual buffer size; this makes xpalloc more
13330         convenient.
13332         * image.c (x_allocate_bitmap_record, cache_image):
13333         * xselect.c (Fx_register_dnd_atom):
13334         Simplify previous changes by using xpalloc.
13336         * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
13337         since either will do and ptrdiff_t is convenient with xpalloc.
13339         * charset.c (charset_table_size)
13340         (struct charset_sort_data.priority): Now ptrdiff_t.
13341         (charset_compare): Don't overflow if priorities differ greatly.
13342         (Fsort_charsets): Don't assume list length fits in int.
13343         Check for size-calculation overflow when allocating sort data.
13344         (syms_of_charset): Allocate an initial charset table that is
13345         just under 64 KiB, to avoid problems with glibc malloc and mmap.
13347         * cmds.c (internal_self_insert): Check for size-calculation overflow.
13349         * composite.h (struct composition.glyph_len): Now int, not unsigned.
13350         The actual value is always <= INT_MAX, and leaving it unsigned made
13351         overflow checking harder.
13353         * dispextern.h (struct glyph_matrix.rows_allocated)
13354         (struct face_cache.size): Now ptrdiff_t, for convenience in use
13355         with xpalloc.  The values are still always <= INT_MAX.
13357         * indent.c (compute_motion): Adjust to region_cache_forward sig change.
13359         * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
13360         (SAFE_NALLOCA): New macro.
13362         * region-cache.c (struct boundary.pos, find_cache_boundary)
13363         (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
13364         (set_cache_region, invalidate_region_cache)
13365         (revalidate_region_cache, know_region_cache, region_cache_forward)
13366         (region_cache_backward, pp_cache):
13367         Use ptrdiff_t, not EMACS_INT, since either will do.  This is needed
13368         so that ptrdiff_t * can be passed to xpalloc.
13369         (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
13370         beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
13371         (pp_cache): Don't assume cache_len fits in int.
13372         * region-cache.h: Adjust extern decls to match.
13374         * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
13375         EMACS_INT, since either will do, for xpalloc.
13377         * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
13378         (xnmalloc, xnrealloc, xpalloc): New functions.
13380         * bidi.c (bidi_shelve_header_size): New constant.
13381         (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
13382         (bidi_cache_ensure_space): Avoid integer overflow when allocating.
13384         * bidi.c (bidi_cache_shrink):
13385         * buffer.c (overlays_at, overlays_in, record_overlay_string)
13386         (overlay_strings):
13387         Don't update size of array until after memory allocation succeeds,
13388         because xmalloc/xrealloc may not return.
13389         (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
13390         now that we have proper integer overflow checking.
13391         (record_overlay_string, overlay_strings): Catch overflows when
13392         calculating size of overlay_str_buf.
13394         * callproc.c (Fcall_process): Check for size overflow when
13395         calculating size of args2.
13396         (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
13397         Normally we prefer signed values, but sticking with ptrdiff_t would
13398         require adding more-complicated checks.
13400         * ccl.c (Fccl_execute_on_string): Check for memory overflow.
13401         Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
13402         Redo buffer-overflow calculations to avoid integer overflow.
13403         Add a FIXME comment where memory seems to be over-allocated.
13405         * character.c (Fstring): Check for size-calculation overflow.
13407         * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
13408         unnecessary integer overflow.  Check for size overflow.
13409         (encode_coding_object): Don't update size until xmalloc succeeds.
13411         * composite.c (get_composition_id): Check for overflow in glyph
13412         length calculations.
13414         Integer and memory overflow fixes for display code.
13415         * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
13416         * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
13417         (scrolling_window): Check for overflow in size calculations.
13418         (line_draw_cost, realloc_glyph_pool, add_row_entry):
13419         Don't assume glyph table len fits in int.
13420         (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
13421         (row_table_size): Now ptrdiff_t, not int.
13422         (scrolling_window): Avoid overflow in size calculations.
13423         Don't update size until allocation succeeds.
13424         * fns.c (concat): Check for overflow in size calculations.
13425         (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
13426         * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
13427         (NEXT_ALMOST_PRIME_LIMIT): New constant.
13429         * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
13430         (get_doc_string): Check for size calculation overflow.
13431         Don't update size until allocation succeeds.
13432         (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
13433         EMACS_INT, where ptrdiff_t will do.
13434         (Fsubstitute_command_keys): Check for string overflow.
13436         * editfns.c (set_time_zone_rule): Don't assume environment length
13437         fits in int.
13438         (message_length): Now ptrdiff_t, not int.
13439         (Fmessage_box): Don't update size until allocation succeeds.
13440         Don't assume message length fits in int.
13441         (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
13443         * emacs.c (main): Do not reallocate argv, since there is a null at
13444         the end that can be overwritten, and this way there's no need to
13445         worry about size-calculation overflow.
13446         (sort_args): Check for size-calculation overflow.
13448         * eval.c (init_eval_once, grow_specpdl): Don't update size until
13449         alloc succeeds.
13450         (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
13452         * frame.c (set_menu_bar_lines, x_set_frame_parameters)
13453         (x_set_scroll_bar_width, x_figure_window_size):
13454         Check for integer overflow.
13455         (x_set_alpha): Do not assume XINT fits in int.
13457         * frame.h (struct frame): Use int, not EMACS_INT, where int works.
13458         This is for the members text_lines, text_cols, total_lines, total_cols,
13459         where the system imposes an 'int' limit.
13461         * fringe.c (Fdefine_fringe_bitmap):
13462         Don't update size until alloc works.
13464         * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
13465         (ftfont_shape_by_flt): Check for integer overflow in size calculations.
13467         * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
13468         Check for size-calculation overflow.
13469         (get_utf8_string): Use ptrdiff_t, not size_t, where either will
13470         do, as we prefer signed integers.
13471         (id_to_widget.max_size, id_to_widget.used)
13472         (xg_store_widget_in_map, xg_remove_widget_from_map)
13473         (xg_get_widget_from_map, xg_get_scroll_id_for_window)
13474         (xg_remove_scroll_bar, xg_update_scrollbar_pos):
13475         Use and return ptrdiff_t, not int.
13476         (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
13477         * gtkutil.h: Change prototypes to match the above.
13479         * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
13480         are duplicate now that they've been promoted to lisp.h.
13481         (x_allocate_bitmap_record, x_alloc_image_color)
13482         (make_image_cache, cache_image, xpm_load):
13483         Don't update size until alloc is done.
13484         (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
13485         (x_detect_edges):
13486         Check for size calculation overflow.
13487         (ct_colors_allocated_max): New constant.
13488         (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
13489         overflow.
13491         * keyboard.c (read_char, menu_bar_items, tool_bar_items)
13492         (read_char_x_menu_prompt, read_char_minibuf_menu_width)
13493         (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
13494         Use ptrdiff_t, not int, to count maps.
13495         (read_char_minibuf_menu_prompt): Check for overflow in size
13496         calculations.  Don't update size until allocation succeeds.
13497         Redo calculations to avoid overflow.
13498         * keyboard.h: Change prototypes to match the above.
13500         * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
13501         to count maps.
13502         (current_minor_maps): Check for size calculation overflow.
13503         * keymap.h: Change prototypes to match the above.
13505         * lread.c (read1, init_obarray): Don't update size until alloc done.
13507         * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
13508         (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
13510         * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
13511         Now ptrdiff_t, not int.
13512         * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
13513         (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
13515         * process.c (Fnetwork_interface_list): Check for overflow
13516         in size calculation.
13518         * region-cache.c (move_cache_gap): Check for size calculation overflow.
13520         * scroll.c (do_line_insertion_deletion_costs): Check for size calc
13521         overflow.  Don't bother calling xmalloc when xrealloc will do.
13523         * search.c (Freplace_match): Check for size calculation overflow.
13524         (Fset_match_data): Don't assume list lengths fit in 'int'.
13526         * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
13527         for command line length.  Do not attempt to address one before the
13528         beginning of an array, as that's not portable.
13530         * term.c (max_frame_lines): Remove; unused.
13531         (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
13532         not int.
13533         (encode_terminal_code, calculate_costs): Check for size
13534         calculation overflow.
13535         (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
13536         table lengths and related sizes.  Don't update size until alloc
13537         done.  Redo calculations to avoid overflow.
13538         (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
13540         * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
13541         subtracting pointers.
13542         (gobble_line): Check for overflow more carefully.  Don't update size
13543         until alloc done.
13545         * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
13546         Don't update size until alloc done.
13547         Redo size calculations to avoid overflow.
13548         Check for size calculation overflow.
13549         (main) [DEBUG]: Fix typo in invoking tparam1.
13551         * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
13552         Use ptrdiff_t, not int, for sizes.
13553         (store_mode_line_noprop_char): Don't update size until alloc done.
13555         * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
13556         Use ptrdiff_t, not int, for sizes.
13557         (Finternal_make_lisp_face, cache_face):
13558         Check for size calculation overflow.
13559         (cache_face): Treat size calculation overflows as if they were
13560         memory exhaustion (the usual treatment), rather than aborting.
13562         * xfns.c (x_encode_text, x_set_name_internal)
13563         (Fx_change_window_property): Use ptrdiff_t, not int, to count
13564         sizes, since they can exceed INT_MAX in size.  Check for size
13565         calculation overflow.
13567         * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
13568         (xg_select): Check for size calculation overflow.
13569         Don't update size until alloc done.
13571         * xrdb.c (get_environ_db): Don't assume path length fits in int,
13572         as sprintf is limited to int lengths.
13574         * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
13575         (X_LONG_MIN): New macros.
13576         Use them to make the following changes clearer.
13577         (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
13578         This change doesn't affect the value now, but it may help remind
13579         future maintainers not to raise the value too much later.
13580         (SELECTION_QUANTUM): Remove, replacing with ...
13581         (selection_quantum): ... new function, which avoids overflow.
13582         All uses changed.
13583         (struct selection_data.size): Now ptrdiff_t, not int, to avoid
13584         assumption that selection length fits in 'int'.
13585         (x_reply_selection_request, x_handle_selection_request)
13586         (x_get_window_property, receive_incremental_selection)
13587         (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
13588         (lisp_data_to_selection_data, clean_local_selection_data):
13589         Use ptrdiff_t, not int, to record length of selection.
13590         (x_reply_selection_request, x_get_window_property)
13591         (receive_incremental_selection, x_property_data_to_lisp):
13592         Redo calculations to avoid overflow.
13593         (x_reply_selection_request): When sending hint, ceiling it at
13594         X_LONG_MAX rather than relying on wraparound overflow to send
13595         something.
13596         (x_get_window_property, receive_incremental_selection)
13597         (lisp_data_to_selection_data, x_property_data_to_lisp):
13598         Check for size-calculation overflow.
13599         (x_get_window_property, receive_incremental_selection)
13600         (lisp_data_to_selection_data, Fx_register_dnd_atom):
13601         Don't store size until memory allocation succeeds.
13602         (x_get_window_property): Plug memory leak on memory exhaustion.
13603         Don't double-block input; malloc is safe here.  Don't assume 2**34
13604         - 4 fits in unsigned long.  Add an xassert to check
13605         XGetWindowProperty overflow.  Be more careful about overflow
13606         calculations, and distinguish size from memory overflow better.
13607         (receive_incremental_selection): When tracing, don't assume
13608         unsigned int is less than INT_MAX.
13609         (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
13610         harmful) conversions of unsigned short to int.
13611         (lisp_data_to_selection_data): Don't assume that integers
13612         in the range -65535 through -1 fit in an X unsigned short.
13613         Don't assume that ULONG_MAX == X_ULONG_MAX.  Don't store into
13614         result parameters unless successful.  Rely on cons_to_unsigned
13615         to report problems with elements; the old code wasn't right anyway.
13616         (x_check_property_data): Check for int overflow; we cannot use
13617         a wider type due to X limits.
13618         (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
13620         * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
13622         * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
13623         (x_term_init): Check for size calculation overflow.
13624         (x_color_cells): Don't store size until memory allocation succeeds.
13625         (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
13626         Don't assume alloca size is less than MAX_ALLOCA.
13627         (x_term_init): Don't assume length fits in int (sprintf is limited
13628         to int size).
13630         Use ptrdiff_t for composition IDs.
13631         * character.c (lisp_string_width):
13632         * composite.c (composition_table_size, n_compositions)
13633         (get_composition_id, composition_gstring_from_id):
13634         * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
13635         * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
13636         * window.c (Frecenter):
13637         Use ptrdiff_t, not int, for composition IDs.
13638         * composite.c (get_composition_id): Check for integer overflow.
13639         * composite.h: Adjust prototypes to match the above changes.
13641         Use ptrdiff_t for hash table indexes.
13642         * category.c (hash_get_category_set):
13643         * ccl.c (ccl_driver):
13644         * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
13645         * coding.c (coding_system_charset_list, detect_coding_system):
13646         * coding.h (struct coding_system.id):
13647         * composite.c (get_composition_id, gstring_lookup_cache):
13648         * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
13649         * image.c (xpm_get_color_table_h):
13650         * lisp.h (hash_lookup, hash_put):
13651         * minibuf.c (Ftest_completion):
13652         Use ptrdiff_t for hash table indexes, not int (which is too
13653         narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
13654         32-bit --with-wide-int hosts).
13656         * charset.c (Fdefine_charset_internal): Check for integer overflow.
13657         Add a FIXME comment about memory leaks.
13658         (syms_of_charset): Don't assume xmalloc returns.
13660         Don't assume that stated character widths fit in int.
13661         * character.c (Fchar_width, c_string_width, lisp_string_width):
13662         * character.h (CHAR_WIDTH):
13663         * indent.c (MULTIBYTE_BYTES_WIDTH):
13664         Use sanitize_char_width to avoid undefined and/or bad behavior
13665         with outlandish widths.
13666         * character.h (sanitize_tab_width): Rename from sanitize_width,
13667         now that we have two such functions.  All uses changed.
13668         (sanitize_char_width): New inline function.
13670         Don't assume that tab-width fits in int.
13671         * character.h (sanitize_width): New inline function.
13672         (SANE_TAB_WIDTH): New macro.
13673         (ASCII_CHAR_WIDTH): Use it.
13674         * indent.c (sane_tab_width): Remove.  All uses replaced by
13675         SANE_TAB_WIDTH (current_buffer).
13676         * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
13678         * fileio.c: Integer overflow issues with file modes.
13679         (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
13681         * charset.c (read_hex): New arg OVERFLOW.  All uses changed.
13682         Remove unreachable code.
13683         (read_hex, load_charset_map_from_file): Check for integer overflow.
13685         * xterm.c: Don't go over XClientMessageEvent limit.
13686         (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
13687         (x_send_scroll_bar_event): Likewise.  Check that the size does not
13688         exceed limits imposed by XClientMessageEvent, as well as the usual
13689         ptrdiff_t and size_t limits.
13691         * keyboard.c: Overflow, signedness and related fixes.
13692         (make_lispy_movement): Use same integer type in forward decl
13693         that is used in the definition.
13694         (read_key_sequence, keyremap_step):
13695         Change bufsize argument back to int, undoing my 2011-03-30 change.
13696         We prefer signed types, and int is wide enough here.
13697         (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
13698         than TYPE_MAXIMUM (EMACS_INT) / 2.  Don't let the label size grow
13699         larger than STRING_BYTES_BOUND.  Use ptrdiff_t for Emacs string
13700         length, not size_t.  Use ptrdiff_t for index, not int.
13701         (keyremap_step, read_key_sequence): Redo bufsize check to avoid
13702         possibility of integer overflow.
13704         Overflow, signedness and related fixes for images.
13706         * dispextern.h (struct it.stack[0].u.image.image_id)
13707         (struct_it.image_id, struct image.id, struct image_cache.size)
13708         (struct image_cache.used, struct image_cache.ref_count):
13709         * gtkutil.c (update_frame_tool_bar):
13710         * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
13711         (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
13712         (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
13713         * nsmenu.m (update_frame_tool_bar):
13714         * xdisp.c (calc_pixel_width_or_height):
13715         * xfns.c (image_cache_refcount):
13716         Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
13717         on typical 64-bit hosts.
13719         * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
13720         (x_bitmap_pixmap, x_create_x_image_and_pixmap):
13721         Omit unnecessary casts to int.
13722         (parse_image_spec): Check that integers fall into 'int' range
13723         when the callers expect that.
13724         (image_ascent): Redo ascent calculation to avoid int overflow.
13725         (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
13726         (lookup_image): Remove unnecessary tests.
13727         (xbm_image_p): Locals are now of int, not EMACS_INT,
13728         since parse_image_check makes sure they fit into int.
13729         (png_load, gif_load, svg_load_image):
13730         Prefer int to unsigned where either will do.
13731         (tiff_handler): New function, combining the cores of the
13732         old tiff_error_handler and tiff_warning_handler.
13733         This function is rewritten to use vsnprintf and thereby avoid
13734         stack buffer overflows.  It uses only the features of vsnprintf
13735         that are common to both POSIX and native Microsoft.
13736         (tiff_error_handler, tiff_warning_handler): Use it.
13737         (tiff_load, gif_load, imagemagick_load_image):
13738         Don't assume :index value fits in 'int'.
13739         (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
13740         (imagemagick_load_image): Check that crop parameters fit into
13741         the integer types that MagickCropImage accepts.  Don't assume
13742         Vimagemagick_render_type has a nonnegative value.  Don't assume
13743         size_t fits in 'long'.
13744         (gs_load): Use printmax_t to print the widest integers possible.
13745         Check for integer overflow when computing image height and width.
13747 2011-08-26  Eli Zaretskii  <eliz@gnu.org>
13749         * xdisp.c (redisplay_window): Don't force window start if point
13750         will be invisible in the resulting window.  (Bug#9324)
13752 2011-08-25  Eli Zaretskii  <eliz@gnu.org>
13754         * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
13755         the display spec is of the form `(space ...)'.
13756         (handle_display_spec): Return the value returned by
13757         handle_single_display_spec, not just 1 or zero.
13758         (handle_single_display_spec): If the display spec is of the form
13759         `(space ...)', and specifies display in the text area, return 2
13760         rather than 1.
13761         (try_cursor_movement): Check for the need to scroll more
13762         accurately, and prefer exact match for point under bidi.
13763         Don't advance `row' beyond the last row of the window.
13765         * dispextern.h (struct bidi_it): Rename the disp_prop_p member
13766         into disp_prop; all users changed.
13768         * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
13769         DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
13770         for the text covered by the display property.
13772 2011-08-25  Chong Yidong  <cyd@stupidchicken.com>
13774         * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
13775         Change return value to nil.
13776         (Frecord_buffer): Delete unused function.
13778 2011-08-24  Eli Zaretskii  <eliz@gnu.org>
13780         * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
13781         buffers, return left-to-right.
13782         (set_cursor_from_row): Consider candidate row a win if its glyph
13783         represents a newline and point is on that newline.  Fixes cursor
13784         positioning on the newline at EOL of R2L text within L2R
13785         paragraph, and vice versa.
13786         (try_cursor_movement): Check continued rows, in addition to
13787         continuation rows.  Fixes unwarranted scroll when point enters a
13788         continued line of R2L text within an L2R paragraph, or vice versa.
13789         (cursor_row_p): Consider the case of point being equal to
13790         MATRIX_ROW_END_CHARPOS.  Prevents cursor being stuck when moving
13791         from the end of a short line to the beginning of a continued line
13792         of R2L text within L2R paragraph.
13793         (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
13794         composed characters.
13796         * bidi.c (bidi_check_type): Use xassert.
13797         (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
13798         members.
13800 2011-08-23  Eli Zaretskii  <eliz@gnu.org>
13802         * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
13803         a character.
13805 2011-08-23  Chong Yidong  <cyd@stupidchicken.com>
13807         * nsfont.m (ns_otf_to_script): Fix typo.
13809 2011-08-22  Kenichi Handa  <handa@m17n.org>
13811         * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
13812         extra slot even if the purpose is char-code-property-table.
13814 2011-08-23  Eli Zaretskii  <eliz@gnu.org>
13816         * xdisp.c (redisplay_window): When computing centering_position,
13817         account for the height of the header line.  (Bug#8874)
13819         * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
13820         instead of CHAR_TO_BYTE.  Fixes a crash when a completion
13821         candidate is selected by the mouse, and that candidate has a
13822         composed character under the mouse.
13824         * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1.  Fixes pixel
13825         coordinates reported by pos-visible-in-window-p for a composed
13826         character in column zero.
13828 2011-08-23  Stefan Monnier  <monnier@iro.umontreal.ca>
13830         * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
13832 2011-08-22  Eli Zaretskii  <eliz@gnu.org>
13834         * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
13835         consider it a hit if to_charpos is anywhere in the range of the
13836         composed buffer positions.
13838 2011-08-22  Chong Yidong  <cyd@stupidchicken.com>
13840         * image.c (gif_load): Don't assume that each subimage has the same
13841         dimensions as the base image.  Handle disposal method that is
13842         "undefined" by the gif spec (Bug#9335).
13844 2011-08-20  Chong Yidong  <cyd@stupidchicken.com>
13846         * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
13847         (Fcondition_case): Document `debug' symbol in error handler.
13849 2011-08-19  Eli Zaretskii  <eliz@gnu.org>
13851         * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
13852         face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
13853         from an Org mode buffer to a Speedbar frame.
13855         * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
13856         a composition, take its buffer position from IT->cmp_it.charpos.
13857         Fixes cursor positioning at the beginning of a line that begins
13858         with a composed character.
13860 2011-08-18  Eli Zaretskii  <eliz@gnu.org>
13862         * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
13863         character bidirectional type, use STRONG_L instead.  Fixes crashes
13864         in a buffer produced by `describe-categories'.
13866         * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
13867         members before the level stack, so they would be saved and
13868         restored when copying iterator state.  Fixes incorrect reordering
13869         around TABs covered by display properties.
13871 2011-08-18  Andreas Schwab  <schwab@linux-m68k.org>
13873         * process.c (Fnetwork_interface_list): Correctly determine buffer size.
13875 2011-08-17  Chong Yidong  <cyd@stupidchicken.com>
13877         * eval.c (internal_condition_case, internal_condition_case_1)
13878         (internal_condition_case_2, internal_condition_case_n):
13879         Remove unnecessary aborts (Bug#9081).
13881 2011-08-17  Eli Zaretskii  <eliz@gnu.org>
13883         * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
13884         has no `load' handler, try opening the file locally.  (Bug#9311)
13886 2011-08-16  Ken Brown  <kbrown@cornell.edu>
13888         * gmalloc.c: Expand comment.
13890 2011-08-16  Eli Zaretskii  <eliz@gnu.org>
13892         * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
13893         if it fails the cursor_row_p test.  Fixes cursor positioning at ZV.
13895 2011-08-16  Ken Brown  <kbrown@cornell.edu>
13897         Fix memory allocation problems in Cygwin build (Bug#9273).
13899         * unexcw.c ( __malloc_initialized): Declare external variable.
13900         (fixup_executable): Force the dumped emacs to reinitialize malloc.
13902         * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
13903         New variables.
13904         (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
13905         dumped emacs.
13906         (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
13907         in the static heap.
13908         [CYGWIN] (special_realloc): New function.
13909         (_realloc_internal_nolock) [CYGWIN]: Use the new function on
13910         requests to realloc storage in the static heap.
13912 2011-08-15  Paul Eggert  <eggert@cs.ucla.edu>
13914         * bidi.c (bidi_initialize): Remove unused local.
13916 2011-08-15  Eli Zaretskii  <eliz@gnu.org>
13918         * bidimirror.h:
13919         * biditype.h: Remove file.
13920         * makefile.w32-in ($(BLD)/bidi.$(O)):
13921         * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
13923         * dispextern.h: Fix a typo in the comment to bidi_type_t.
13925         * chartab.c: Improve commentary for the uniprop_table API.
13927         * bidi.c (bidi_paragraph_init): Support zero value of
13928         bidi_ignore_explicit_marks_for_paragraph_level.
13929         (bidi_initialize): Use uniprop_table instead of including
13930         biditype.h and bidimirror.h.
13932         * xdisp.c (move_it_in_display_line_to): Don't reset pixel
13933         coordinates of the iterator when restoring from ppos_it.
13934         (Bug#9296)
13936 2011-08-14  Kenichi Handa  <handa@m17n.org>
13938         * process.c (create_process): Call setup_process_coding_systems
13939         after the pid of the process is set to -1 (Bug#8162).
13941 2011-08-14  Eli Zaretskii  <eliz@gnu.org>
13943         * xdisp.c (move_it_in_display_line_to): Don't invoke
13944         IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
13945         ppos_it.  Fixes vertical cursor motion when line beginning is
13946         covered by an image.  (Bug#9296)
13948 2011-08-14  Jan Djärv  <jan.h.d@swipnet.se>
13950         * nsterm.h (ns_run_ascript): Declare.
13951         (NSAPP_DATA2_RUNASSCRIPT): Define.
13953         * nsfns.m (as_script, as_result, as_status): New static variables.
13954         (ns_run_ascript): New function.
13955         (Fns_do_applescript): Set variables as_*.  Make an NSApplicationDefined
13956         event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
13957         the event loop.  Get status from as_status (Bug#7276).
13959         * nsterm.m (sendEvent): If event is NSApplicationDefined and
13960         data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
13961         the event loop (Bug#7276).
13963 2011-08-14  Andreas Schwab  <schwab@linux-m68k.org>
13965         * gnutls.c (QCgnutls_bootprop_priority)
13966         (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
13967         (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
13968         (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
13969         (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
13970         (QCgnutls_bootprop_verify_hostname_error)
13971         (QCgnutls_bootprop_callbacks_verify): Rename from
13972         Qgnutls_bootprop_..., all uses changed.
13974         * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
13975         uses changed.
13977 2011-08-14  Paul Eggert  <eggert@cs.ucla.edu>
13979         * xfaces.c (Qframe_set_background_mode): Now static.
13980         * dispextern.h (Qframe_set_background_mode): Remove decl.
13982         * process.c (Fnetwork_interface_info): Declare local only if needed.
13984 2011-08-13  Jan Djärv  <jan.h.d@swipnet.se>
13986         * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
13987         (Fnetwork_interface_list): Allocate in increments of bytes instead
13988         of sizeof (struct ifreq).  Iterate over ifconf.ifc_req by counting
13989         bytes (Bug#8477).  Count bytes correctly when ifr_addr is a struct
13990         sockaddr.
13991         (struct ifflag_def): notrailers is smart on OSX.
13992         (Fnetwork_interface_info): Handle case when ifr_flags is negative.
13993         Get hardware address with getifaddrs if available.
13995 2011-08-12  Eli Zaretskii  <eliz@gnu.org>
13997         * xdisp.c (iterate_out_of_display_property): xassert that
13998         IT->position is set to within IT->object's boundaries.  Break from
13999         the loop as soon as EOB is reached; avoids infloops in redisplay
14000         when IT->position is set up wrongly due to some bug.
14001         Set IT->current to match the bidi iterator unconditionally.
14002         (push_display_prop): Allow GET_FROM_STRING as IT->method on
14003         entry.  Force push_it to save on the stack the current
14004         buffer/string position, to be restored by pop_it.  Fix flags in
14005         the iterator structure wrt the object coming from a display
14006         property, as `line-prefix' and `wrap-prefix' are not ``replacing''
14007         properties.  (Bug#9284)
14009 2011-08-09  Andreas Schwab  <schwab@linux-m68k.org>
14011         * fontset.c (fontset_get_font_group): Add proper type checks.
14012         (Bug#9172)
14014 2011-08-09  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
14016         * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
14017         and LC_VERSION_MIN_MACOSX.
14018         (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
14019         (dump_it) [LC_FUNCTION_STARTS]: Use it.
14021 2011-08-08  Eli Zaretskii  <eliz@gnu.org>
14023         * xdisp.c (forward_to_next_line_start): Allow to use the
14024         no-display-properties-and-no-overlays under bidi display.
14025         Set disp_pos in the bidi iterator to avoid searches for display
14026         properties and overlays.
14028 2011-08-08  Chong Yidong  <cyd@stupidchicken.com>
14030         * editfns.c (Fset_time_zone_rule): Document relationship with the
14031         setenv function.
14033         * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
14034         the font entity extracted from the cache (Bug#8109).
14036 2011-08-07  Chong Yidong  <cyd@stupidchicken.com>
14038         * composite.c (autocmp_chars): Don't reset point.  That is done by
14039         restore_point_unwind (Bug#5984).
14041 2011-08-07  Juri Linkov  <juri@jurta.org>
14043         * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
14044         to show the arg `TIME' instead of `TIMEVAL'.
14046 2011-08-06  Eli Zaretskii  <eliz@gnu.org>
14048         * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
14049         display property strides EOL and includes a newline, as in
14050         longlines-mode.  (Bug#9254)
14051         (move_it_in_display_line_to): Fix vertical-motion in a buffer with
14052         word-wrap under bidirectional display.  (Bug#9224)
14054         * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
14055         is non-zero, even if the data buffer is NULL.  Fixes a crash in
14056         vertical-motion with longlines-mode.  (Bug#9254)
14058 2011-08-05  Eli Zaretskii  <eliz@gnu.org>
14060         * bidi.c <bidi_cache_total_alloc>: Now static.
14061         (bidi_initialize): Initialize bidi_cache_total_alloc.
14063         * xdisp.c (display_line): Release buffer allocated for shelved bidi
14064         cache.  (Bug#9221)
14066         * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
14067         amount allocated this far in `bidi_cache_total_alloc'.
14068         (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
14069         non-zero, only free the data buffer without restoring the cache
14070         contents.  All callers changed.
14072         * dispextern.h (bidi_unshelve_cache): Update prototype.
14074         * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
14075         (move_it_in_display_line, move_it_to)
14076         (move_it_vertically_backward, move_it_by_lines): Replace the call
14077         to xfree to an equivalent call to bidi_unshelve_cache.
14078         (move_it_in_display_line_to): Fix logic of returning
14079         MOVE_POS_MATCH_OR_ZV in the bidi case.  (Bug#9224)
14081 2011-08-05  Eli Zaretskii  <eliz@gnu.org>
14083         * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
14084         came from a string character with a `cursor' property.  (Bug#9229)
14086 2011-08-04  Jan Djärv  <jan.h.d@swipnet.se>
14088         * Makefile.in (LIB_PTHREAD): New variable.
14089         (LIBES): Add LIB_PTHREAD (Bug#9216).
14091         * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
14092         Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
14094 2011-08-04  Andreas Schwab  <schwab@linux-m68k.org>
14096         * regex.c (re_iswctype): Remove some redundant boolean conversions.
14098 2011-08-04  Jan Djärv  <jan.h.d@swipnet.se>
14100         * xterm.c (x_find_topmost_parent): New function.
14101         (x_set_frame_alpha): Find topmost parent window with
14102         x_find_topmost_parent and set the property there also (bug#9181).
14103         (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
14105 2011-08-04  Paul Eggert  <eggert@cs.ucla.edu>
14107         * callproc.c (Fcall_process): Avoid vfork clobbering
14108         the local vars buffer, coding_systems, current_dir.
14110 2011-08-03  Stefan Monnier  <monnier@iro.umontreal.ca>
14112         * keymap.c (Fmake_composed_keymap): Move to subr.el.
14114 2011-08-03  Paul Eggert  <eggert@cs.ucla.edu>
14116         * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
14117         so that it is not optimized away.
14119         * xdisp.c (compute_display_string_pos): Remove unused local.
14121 2011-08-02  Eli Zaretskii  <eliz@gnu.org>
14123         Fix slow cursor motion and scrolling in large buffers with
14124         selective display, like Org Mode buffers.  (Bug#9218)
14126         * dispextern.h (struct bidi_it): New member disp_prop_p.
14128         * xdisp.c: Remove one-slot cache of display string positions.
14129         (compute_display_string_pos): Accept an additional argument
14130         DISP_PROP_P; callers changed.  Scan at most 5K characters forward
14131         for a display string or property.  If found, set DISP_PROP_P
14132         non-zero.
14134         * bidi.c (bidi_fetch_char): Accept an additional argument
14135         DISP_PROP_P, and pass it to compute_display_string_pos.
14136         Only handle text covered by a display string if DISP_PROP_P is returned
14137         non-zero.  All callers of bidi_fetch_char changed.
14139 2011-08-02  Stefan Monnier  <monnier@iro.umontreal.ca>
14141         * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
14143 2010-12-03  Don March  <don@ohspite.net>
14145         * keymap.c (Fdefine_key): Fix non-prefix key error message when
14146         last character M-[char] is translated to ESC [char] (bug#7541).
14148 2011-08-02  Kenichi Handa  <handa@m17n.org>
14150         * lisp.h (uniprop_table): Extern it.
14152         * chartab.c (uniprop_table): Make it non-static.
14154 2011-08-01  Eli Zaretskii  <eliz@gnu.org>
14156         * xdisp.c (forward_to_next_line_start): Accept additional argument
14157         BIDI_IT_PREV, and store into it the state of the bidi iterator had
14158         on the newline.
14159         (reseat_at_next_visible_line_start): Use the bidi iterator state
14160         returned by forward_to_next_line_start to restore the state of
14161         it->bidi_it after backing up to previous newline.  (Bug#9212)
14163 2011-07-30  Andreas Schwab  <schwab@linux-m68k.org>
14165         * regex.c (re_comp): Protoize.
14166         (re_exec): Fix return type.
14167         (regexec): Fix type of `ret'.  (Bug#9203)
14169 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
14171         * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
14172         This is needed if max-image-size is a floating-point number.
14174 2011-07-28  Andreas Schwab  <schwab@linux-m68k.org>
14176         * print.c (print_object): Print empty symbol as ##.
14178         * lread.c (read1): Read ## as empty symbol.
14180 2011-07-28  Alp Aker  <alp.tekin.aker@gmail.com>
14182         * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
14183         setting frame foreground color (Bug#9175).
14184         (x_set_background_color): Likewise.
14186         * nsmenu.m (-setText): Size tooltip dimensions precisely to
14187         contents (Bug#9176).
14188         (EmacsTooltip -init): Remove bezels and add shadows to
14189         tooltip windows.
14191         * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
14192         or scroll bar (Bug#8470).
14194         * nsfont.m (nsfont_open): Remove assignment to voffset and
14195         unnecessary vars hshink, expand, hd, full_height, min_height.
14196         (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
14198         * nsterm.h (nsfont_info): Remove voffset field.
14200 2011-07-28  Alp Aker  <alp.tekin.aker@gmail.com>
14202         Implement strike-through and overline on NextStep (Bug#8863).
14204         * nsfont.m (nsfont_open): Use underline position provided by font,
14205         instead of hard-coded value of 2.
14206         (nsfont_draw): Call ns_draw_text_decoration instead.
14208         * nsterm.h: Add declaration for ns_draw_text_decoration.
14210         * nsterm.m (ns_draw_text_decoration): New function for drawing
14211         underline, overline, and strike-through.
14212         (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
14213         ns_draw_text_decoration.  Change treatment of cursor drawing to
14214         accommodate underlining, etc.
14216 2011-07-28  Eli Zaretskii  <eliz@gnu.org>
14218         * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
14219         default.
14221 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
14223         * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
14224         Without this fix, if a signal arrives just after memory fills up,
14225         'malloc' might be invoked reentrantly.
14227         * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
14228         In other words, assume that every image size is allowed, on non-X
14229         hosts.  This assumption is probably wrong, but it lets Emacs compile.
14231 2011-07-28  Andreas Schwab  <schwab@linux-m68k.org>
14233         * regex.c (re_iswctype): Convert return values to boolean.
14235 2011-07-28  Eli Zaretskii  <eliz@fencepost.gnu.org>
14237         * xdisp.c (compute_display_string_pos): Don't use cached display
14238         string position if the buffer had its restriction changed.
14239         (Bug#9184)
14241 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
14243         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14245 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
14247         Integer signedness and overflow and related fixes.  (Bug#9079)
14249         * bidi.c: Integer size and overflow fixes.
14250         (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
14251         (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
14252         (bidi_cache_find_level_change, bidi_cache_ensure_space)
14253         (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
14254         (bidi_find_other_level_edge):
14255         Use ptrdiff_t instead of EMACS_INT where either will do.
14256         This works better on 32-bit hosts configured --with-wide-int.
14257         (bidi_cache_ensure_space): Check for size-calculation overflow.
14258         Use % rather than repeated addition, for better worst-case speed.
14259         Don't set bidi_cache_size until after xrealloc returns, because it
14260         might not return.
14261         (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
14262         (bidi_cache_ensure_space): Also check that the bidi cache size
14263         does not exceed that of the largest Lisp string or buffer.  See Eli
14264         Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
14266         * alloc.c (__malloc_size_t): Remove.
14267         All uses replaced by size_t.  See Andreas Schwab's note
14268         <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
14270         * image.c: Improve checking for integer overflow.
14271         (check_image_size): Assume that f is nonnull, since
14272         it is always nonnull in practice.  This is one less thing to
14273         worry about when checking for integer overflow later.
14274         (x_check_image_size): New function, which checks for integer
14275         overflow issues inside X.
14276         (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
14277         This removes the need for a memory_full check.
14278         (xbm_image_p): Rewrite to avoid integer multiplication overflow.
14279         (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
14280         (xbm_read_bitmap_data): Change locals back to 'int', since
14281         their values must fit in 'int'.
14282         (xpm_load_image, png_load, tiff_load):
14283         Invoke x_create_x_image_and_pixmap earlier,
14284         to avoid much needless work if the image is too large.
14285         (tiff_load): Treat overly large images as if
14286         x_create_x_image_and_pixmap failed, not as malloc failures.
14287         (gs_load): Use x_check_image_size.
14289         * gtkutil.c: Omit integer casts.
14290         (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
14291         (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
14293         * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
14295         * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
14296         Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
14297         would wrongly return t on a 64-bit host.
14299         * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
14300         The plain *_OVERFLOW macros run afoul of GCC bug 49705
14301         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
14302         and therefore cause GCC to emit a bogus diagnostic in some cases.
14304         * image.c: Integer signedness and overflow and related fixes.
14305         This is not an exhaustive set of fixes, but it's time to
14306         record what I've got.
14307         (lookup_pixel_color, check_image_size): Remove redundant decls.
14308         (check_image_size): Don't assume that arbitrary EMACS_INT values
14309         fit in 'int', or that arbitrary 'double' values fit in 'int'.
14310         (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
14311         (tiff_load, imagemagick_load_image):
14312         Check for overflow in size calculations.
14313         (x_create_x_image_and_pixmap): Remove unnecessary test for
14314         xmalloc returning NULL; that can't happen.
14315         (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
14316         (xpm_color_bucket): Use better integer hashing function.
14317         (xpm_cache_color): Don't possibly over-allocate memory.
14318         (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
14319         (gif_memory_source):
14320         Use ptrdiff_t, not int or size_t, to record sizes.
14321         (png_load): Don't assume values greater than 2**31 fit in 'int'.
14322         (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
14323         either works, as we prefer signed integers.
14324         (tiff_read_from_memory, tiff_write_from_memory):
14325         Return tsize_t, not size_t, since that's what the TIFF API wants.
14326         (tiff_read_from_memory): Don't fail simply because the read would
14327         go past EOF; instead, return a short read.
14328         (tiff_load): Omit no-longer-needed casts.
14329         (Fimagemagick_types): Don't assume size fits into 'int'.
14331         Improve hashing quality when configured --with-wide-int.
14332         * fns.c (hash_string): New function, taken from sxhash_string.
14333         Do not discard information about ASCII character case; this
14334         discarding is no longer needed.
14335         (sxhash-string): Use it.  Change sig to match it.  Caller changed.
14336         * lisp.h: Declare it.
14337         * lread.c (hash_string): Remove, since we now use fns.c's version.
14338         The fns.c version returns a wider integer if --with-wide-int is
14339         specified, so this should help the quality of the hashing a bit.
14341         * emacs.c: Integer overflow minor fix.
14342         (heap_bss_diff): Now uprintmax_t, not unsigned long.  All used changed.
14343         Define only if GNU_LINUX.
14344         (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
14346         * dispnew.c: Integer signedness and overflow fixes.
14347         Remove unnecessary forward decls, that were a maintenance hassle.
14348         (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
14349         All uses changed.
14350         (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
14351         (scrolling_window): Use ptrdiff_t, not int, for byte count.
14352         (prepare_desired_row, line_draw_cost):
14353         Use int, not unsigned, where either works.
14354         (save_current_matrix, restore_current_matrix):
14355         Use ptrdiff_t, not size_t, where either works.
14356         (init_display): Check for overflow more accurately, and without
14357         relying on undefined behavior.
14359         * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
14360         Remove, replacing with the new symbols in lisp.h.  All uses changed.
14361         * fileio.c (make_temp_name):
14362         * filelock.c (lock_file_1, lock_file):
14363         * xdisp.c (message_dolog):
14364         Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
14365         Use pMd etc. instead.
14366         * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
14367         replacing the pWIDE etc. symbols removed from editfns.c.
14369         * keyboard.h (num_input_events): Now uintmax_t.
14370         This is (very slightly) less likely to mess up due to wraparound.
14371         All uses changed.
14373         * buffer.c: Integer signedness fixes.
14374         (alloc_buffer_text, enlarge_buffer_text):
14375         Use ptrdiff_t rather than size_t when either will do, as we prefer
14376         signed integers.
14378         * alloc.c: Integer signedness and overflow fixes.
14379         Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
14380         (__malloc_size_t): Default to size_t, not to int.
14381         (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
14382         (Fgarbage_collect, mark_object_loop_halt, mark_object):
14383         Prefer ptrdiff_t to size_t when either would do, as we prefer
14384         signed integers.
14385         (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
14386         (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
14387         Now const.  Initialize with values that are in range even if char
14388         is signed.
14389         (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
14390         (xmalloc_put_size, xmalloc_get_size): New functions.  All uses changed.
14391         These functions do the right thing with sizes > 2**32.
14392         (check_depth): Now ptrdiff_t, not int.
14393         (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
14394         Adjust to new way of storing sizes.  Check for size overflow bugs
14395         in rest of code.
14396         (STRING_BYTES_MAX): Adjust to new overheads.  The old code was
14397         slightly wrong anyway, as it missed one instance of
14398         XMALLOC_OVERRUN_CHECK_OVERHEAD.
14399         (refill_memory_reserve): Omit needless cast to size_t.
14400         (mark_object_loop_halt): Mark as externally visible.
14402         * xselect.c: Integer signedness and overflow fixes.
14403         (Fx_register_dnd_atom, x_handle_dnd_message):
14404         Use ptrdiff_t, not size_t, since we prefer signed.
14405         (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
14406         * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
14407         x_dnd_atoms_size and x_dnd_atoms_length.
14409         * doprnt.c: Prefer signed to unsigned when either works.
14410         * eval.c (verror):
14411         * doprnt.c (doprnt):
14412         * lisp.h (doprnt):
14413         * xdisp.c (vmessage):
14414         Use ptrdiff_t, not size_t, when using or implementing doprnt,
14415         since the sizes cannot exceed ptrdiff_t bounds anyway, and we
14416         prefer signed arithmetic to avoid comparison confusion.
14417         * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
14418         but is a bit tricky.
14420         Assume freestanding C89 headers, string.h, stdlib.h.
14421         * data.c, doprnt.c, floatfns.c, print.c:
14422         Include float.h unconditionally.
14423         * gmalloc.c: Assume C89-at-least behavior for preprocessor,
14424         limits.h, stddef.h, string.h.  Use memset instead of 'flood'.
14425         * regex.c: Likewise for stddef.h, string.h.
14426         (ISASCII): Remove; can assume it returns 1 now.  All uses removed.
14427         * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
14428         * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
14429         (STDC_HEADERS): Remove obsolete defines.
14430         * sysdep.c: Include limits.h unconditionally.
14432         Assume support for memcmp, memcpy, memmove, memset.
14433         * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
14434         * regex.c (memcmp, memcpy):
14435         Remove; we assume C89 now.
14437         * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
14438         (__malloc_safe_bcopy): Remove; no longer needed.
14440         * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
14441         Use EMACS_INT, not EMACS_UINT, for sizes.  The code works equally
14442         well either way, and we prefer signed to unsigned.
14444 2011-07-27  Lars Magne Ingebrigtsen  <larsi@gnus.org>
14446         * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
14447         closes the connection while we're reading (bug#9182).
14449 2011-07-25  Jan Djärv  <jan.h.d@swipnet.se>
14451         * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
14452         are specified (Bug#9168).
14454 2011-07-25  Paul Eggert  <eggert@cs.ucla.edu>
14456         * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
14457         Found by GCC static checking and --with-wide-int on a 32-bit host.
14459 2011-07-25  Eli Zaretskii  <eliz@gnu.org>
14461         * xdisp.c (compute_display_string_pos): Fix logic of caching
14462         previous display string position.  Initialize cached_prev_pos to
14463         -1.  Fixes slow-down at the beginning of a buffer.
14465 2011-07-24  Eli Zaretskii  <eliz@gnu.org>
14467         * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
14468         for attrs[LFACE_FONTSET_INDEX].
14470 2011-07-23  Paul Eggert  <eggert@cs.ucla.edu>
14472         * xml.c (parse_region): Remove unused local
14473         that was recently introduced.
14475 2011-07-23  Eli Zaretskii  <eliz@gnu.org>
14477         * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
14478         2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
14480         * xdisp.c (move_it_in_display_line_to): Record the best matching
14481         position for TO_CHARPOS while scanning the line, and restore it on
14482         exit if none of the characters scanned was an exact match.
14483         Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
14484         when exact match is impossible due to invisible text, and the
14485         lines are truncated.
14487 2011-07-23  Jan Djärv  <jan.h.d@swipnet.se>
14489         * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
14490         for OSX >= 10.7.
14492 2011-07-22  Eli Zaretskii  <eliz@gnu.org>
14494         Fix a significant slow-down of cursor motion with C-n, C-p,
14495         C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
14496         auto-repeat under bidi redisplay in fontified buffers.
14497         * xdisp.c (compute_stop_pos_backwards): New function.
14498         (next_element_from_buffer): Call compute_stop_pos_backwards to
14499         find a suitable prev_stop when we find ourselves before
14500         base_level_stop.
14501         (reseat): Don't look for prev_stop, as that could mean a very long
14502         run.
14503         <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
14504         <cached_disp_overlay_modiff>: Cache for last found display string
14505         position.
14506         (compute_display_string_pos): Return the cached position if asked
14507         about the same buffer in the same area of character positions, and
14508         the buffer wasn't changed since the time the display string
14509         position was cached.
14511 2011-07-22  Eli Zaretskii  <eliz@gnu.org>
14513         * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
14514         is an integer, which is important for empty lines.  (Bug#9149)
14516 2011-07-22  Chong Yidong  <cyd@stupidchicken.com>
14518         * frame.c (Fmodify_frame_parameters): In tty case, update the
14519         default face if necessary (Bug#4238).
14521 2011-07-21  Chong Yidong  <cyd@stupidchicken.com>
14523         * editfns.c (Fstring_to_char): No need to explain what a character
14524         is in the docstring (Bug#6576).
14526 2011-07-20  Lars Magne Ingebrigtsen  <larsi@gnus.org>
14528         * xml.c (parse_region): Make sure we always return a tree.
14530 2011-07-20  HAMANO Kiyoto  <khiker.mail@gmail.com>
14532         * xml.c (parse_region): If a document contains only comments,
14533         return that, too.
14535 2011-07-20  Lars Magne Ingebrigtsen  <larsi@gnus.org>
14537         * xml.c (make_dom): Return comments, too.
14539 2011-07-19  Paul Eggert  <eggert@cs.ucla.edu>
14541         Port to OpenBSD.
14542         See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
14543         and the surrounding thread.
14544         * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
14545         rather than fgets, and retry after EINTR.  Otherwise, 'emacs
14546         --batch -f byte-compile-file' fails on OpenBSD if an inactivity
14547         timer goes off.
14548         * s/openbsd.h (BROKEN_SIGIO): Define.
14549         * unexelf.c (unexec) [__OpenBSD__]:
14550         Don't update the .mdebug section of the Alpha COFF symbol table.
14552 2011-07-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
14554         * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
14555         (bug#8460).
14557 2011-07-18  Paul Eggert  <eggert@cs.ucla.edu>
14559         * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
14560         This fixes some race conditions on the permissions of any newly
14561         created file.
14563         * alloc.c (valid_pointer_p): Use pipe, not open.
14564         This fixes some permissions issues when debugging.
14566         * fileio.c (Fcopy_file): Adjust mode if fchown fails.  (Bug#9002)
14567         If fchown fails to set both uid and gid, try to set just gid,
14568         as that is sometimes allowed.  Adjust the file's mode to eliminate
14569         setuid or setgid bits that are inappropriate if fchown fails.
14571 2011-07-18  Stefan Monnier  <monnier@iro.umontreal.ca>
14573         * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
14574         to compare Lisp_Objects.
14575         * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
14576         global_gnutls_log_level, don't mistake it for a Lisp_Object.
14577         (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
14579 2011-07-17  Andreas Schwab  <schwab@linux-m68k.org>
14581         * lread.c (read_integer): Unread even EOF character.
14582         (read1): Likewise.  Properly record start position of symbol.
14584         * lread.c (read1): Read `#:' as empty uninterned symbol if no
14585         symbol character follows.
14587 2011-07-17  Paul Eggert  <eggert@cs.ucla.edu>
14589         * fileio.c (Fcopy_file): Pacify gcc re fchown.  (Bug#9002)
14590         This works around a problem with the previous change to Fcopy_file.
14591         Recent glibc declares fchown with __attribute__((warn_unused_result)),
14592         and without this change, GCC might complain about discarding
14593         fchown's return value.
14595 2011-07-16  Juanma Barranquero  <lekktu@gmail.com>
14597         * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
14599 2011-07-16  Paul Eggert  <eggert@cs.ucla.edu>
14601         * fileio.c (Fcopy_file): Don't diagnose fchown failures.  (Bug#9002)
14603 2011-07-16  Lars Magne Ingebrigtsen  <larsi@gnus.org>
14605         * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
14606         it's used from the C level.
14608         * process.c: Use the same condition for POLL_FOR_INPUT in both
14609         keyboard.c and process.c (bug#1858).
14611 2011-07-09  Lawrence Mitchell  <wence@gmx.li>
14613         * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
14614         (Fgnutls_boot): Use it.
14616 2011-07-15  Andreas Schwab  <schwab@linux-m68k.org>
14618         * doc.c (Fsubstitute_command_keys): Revert last change.
14620 2011-07-15  Lars Magne Ingebrigtsen  <larsi@gnus.org>
14622         * doc.c (Fsubstitute_command_keys): Clarify that \= really only
14623         quotes the next character, and doesn't affect other longer
14624         sequences (bug#8935).
14626         * lread.c (syms_of_lread): Clarify that is isn't only
14627         `eval-buffer' and `eval-defun' that's affected by
14628         `lexical-binding' (bug#8460).
14630 2011-07-15  Eli Zaretskii  <eliz@gnu.org>
14632         * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
14633         bidi redisplay when a line includes both an image and is truncated.
14635 2011-07-14  Paul Eggert  <eggert@cs.ucla.edu>
14637         Fix minor problems found by static checking.
14638         * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
14639         (elsz): Now a signed constant, not a size_t var.  We prefer signed
14640         types to unsigned, to avoid integer comparison confusion.  Without
14641         this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
14642         "cannot optimize loop, the loop counter may overflow", a symptom
14643         of the confusion.
14644         * indent.c (Fvertical_motion): Mark locals as initialized.
14645         * xdisp.c (reseat_to_string): Fix pointer signedness issue.
14647 2011-07-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
14649         * search.c (Fre_search_backward): Mention `case-fold-search' in
14650         all the re_search_* functions (bug#8138).
14652         * keyboard.c (Fopen_dribble_file): Document when the file is
14653         closed (bug#8056).
14655 2011-07-14  Eli Zaretskii  <eliz@gnu.org>
14657         * bidi.c (bidi_dump_cached_states): Fix format of displaying
14658         bidi_cache_idx.
14660         Support bidi reordering of display and overlay strings.
14661         * xdisp.c (compute_display_string_pos)
14662         (compute_display_string_end): Accept additional argument STRING.
14663         (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
14664         (reseat_to_string): Initialize bidi_it->string.s and
14665         bidi_it->string.schars.
14666         (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
14667         NULL (avoids a crash in bidi_paragraph_init).
14668         Initialize itb.string.lstring.
14669         (init_iterator): Call bidi_init_it only of a valid
14670         buffer position was specified.  Initialize paragraph_embedding to
14671         L2R.
14672         (reseat_to_string): Initialize the bidi iterator.
14673         (display_string): If we need to ignore text properties of
14674         LISP_STRING, set IT->stop_charpos to IT->end_charpos.  (The
14675         original value of -1 will not work with bidi.)
14676         (compute_display_string_pos): First arg is now struct
14677         `text_pos *'; all callers changed.  Support display properties on
14678         Lisp strings.
14679         (compute_display_string_end): Support display properties on Lisp
14680         strings.
14681         (init_iterator, reseat_1, reseat_to_string): Initialize the
14682         string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
14683         when iterating on a string not from display properties).
14684         (compute_display_string_pos, compute_display_string_end):
14685         Fix calculation of the object to scan.  Fixes an error when using
14686         arrow keys.
14687         (next_element_from_buffer): Don't abort when IT_CHARPOS is before
14688         base_level_stop; instead, set base_level_stop to BEGV.
14689         Fixes crashes in vertical-motion.
14690         (next_element_from_buffer): Improve commentary for when
14691         the iterator is before prev_stop.
14692         (init_iterator): Initialize bidi_p from the default value of
14693         bidi-display-reordering, not from buffer-local value.  Use the
14694         buffer-local value only if initializing for buffer iteration.
14695         (handle_invisible_prop): Support invisible properties on strings
14696         that are being bidi-reordered.
14697         (set_iterator_to_next): Support bidi reordering of C strings and
14698         Lisp strings.
14699         (next_element_from_string): Support bidi reordering of Lisp
14700         strings.
14701         (handle_stop_backwards): Support Lisp strings as well.
14702         (display_string): Support display of R2L glyph rows.
14703         Use IT_STRING_CHARPOS when displaying from a Lisp string.
14704         (init_iterator): Don't initialize it->bidi_p for strings
14705         here.
14706         (reseat_to_string): Initialize it->bidi_p for strings here.
14707         (next_element_from_string, next_element_from_c_string)
14708         (next_element_from_buffer): Add xassert's for correspondence
14709         between IT's object being iterated and it->bidi_it.string
14710         structure.
14711         (face_before_or_after_it_pos): Support bidi iteration.
14712         (next_element_from_c_string): Handle the case of the first string
14713         character that is not the first one in the visual order.
14714         (get_visually_first_element): New function, refactored from common
14715         parts of next_element_from_buffer, next_element_from_string, and
14716         next_element_from_c_string.
14717         (tool_bar_lines_needed, redisplay_tool_bar)
14718         (display_menu_bar): Force left-to-right direction.  Add a FIXME
14719         comment for making that be controlled by a user option.
14720         (push_it, pop_it): Save and restore the state of the
14721         bidi iterator.  Save and restore the bidi_p flag.
14722         (pop_it): Iterate out of display property for string iteration as
14723         well.
14724         (iterate_out_of_display_property): Support iteration over strings.
14725         (handle_single_display_spec): Set up it->bidi_it for iteration
14726         over a display string, and call bidi_init_it.
14727         (handle_single_display_spec, next_overlay_string)
14728         (get_overlay_strings_1, push_display_prop): Set up the bidi
14729         iterator for displaying display or overlay strings.
14730         (forward_to_next_line_start): Don't use the shortcut if
14731         bidi-iterating.
14732         (back_to_previous_visible_line_start): If handle_display_prop
14733         pushed the iterator stack, restore the internal state of the bidi
14734         iterator by calling bidi_pop_it same number of times.
14735         (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
14736         and we are bidi-iterating, don't decrement the iterator position;
14737         instead, set the first_elt flag in the bidi iterator, to produce
14738         the same effect.
14739         (reseat_1): Remove redundant setting of string_from_display_prop_p.
14740         (push_display_prop): xassert that we are iterating a buffer.
14741         (push_it, pop_it): Save and restore paragraph_embedding member.
14742         (handle_single_display_spec, next_overlay_string)
14743         (get_overlay_strings_1, reseat_1, reseat_to_string)
14744         (push_display_prop): Set up the `unibyte' member of bidi_it.string
14745         correctly.  Don't assume unibyte strings are not bidi-reordered.
14746         (compute_display_string_pos)
14747         (compute_display_string_end): Fix handling the case of C string.
14748         (push_it, pop_it): Save and restore from_disp_prop_p.
14749         (handle_single_display_spec, push_display_prop): Set the
14750         from_disp_prop_p flag.
14751         (get_overlay_strings_1): Reset the from_disp_prop_p flag.
14752         (pop_it): Call iterate_out_of_display_property only if we are
14753         popping after iteration over a string that came from a display
14754         property.  Fix a typo in popping stretch info.  Add an assertion
14755         for verifying that the iterator position is in sync with the bidi
14756         iterator.
14757         (handle_single_display_spec, get_overlay_strings_1)
14758         (push_display_prop): Fix initialization of paragraph direction for
14759         string when that of the parent object is not yet determined.
14760         (reseat_1): Call bidi_init_it to resync the bidi
14761         iterator with IT's position.  (Bug#7616)
14762         (find_row_edges): If ROW->start.pos gives position
14763         smaller than min_pos, use it as ROW->minpos.  (Bug#7616)
14764         (handle_stop, back_to_previous_visible_line_start, reseat_1):
14765         Reset the from_disp_prop_p flag.
14766         (SAVE_IT, RESTORE_IT): New macros.
14767         (pos_visible_p, face_before_or_after_it_pos)
14768         (back_to_previous_visible_line_start)
14769         (move_it_in_display_line_to, move_it_in_display_line)
14770         (move_it_to, move_it_vertically_backward, move_it_by_lines)
14771         (try_scrolling, redisplay_window, display_line): Use them when
14772         saving a temporary copy of the iterator and restoring it back.
14773         (back_to_previous_visible_line_start, reseat_1)
14774         (init_iterator): Empty the bidi cache "stack".
14775         (move_it_in_display_line_to): If iterator ended up at
14776         EOL, but we never saw any buffer positions smaller than
14777         to_charpos, return MOVE_POS_MATCH_OR_ZV.  Fixes vertical cursor
14778         motion in bidi-reordered lines.
14779         (move_it_in_display_line_to): Record prev_method and prev_pos
14780         immediately before the call to set_iterator_to_next.  Fixes cursor
14781         motion in bidi-reordered lines with stretch glyphs and strings
14782         displayed in margins.  (Bug#8133) (Bug#8867)
14783         Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
14784         TO_CHARPOS.
14785         (pos_visible_p): Support positions in bidi-reordered lines.
14786         Save and restore bidi cache.
14788         * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
14789         (bidi_paragraph_info): Delete unused struct.
14790         (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
14791         (bidi_cache_start): New variable.
14792         (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
14793         to zero.
14794         (bidi_cache_fetch_state, bidi_cache_search)
14795         (bidi_cache_find_level_change, bidi_cache_iterator_state)
14796         (bidi_cache_find, bidi_peek_at_next_level)
14797         (bidi_level_of_next_char, bidi_find_other_level_edge)
14798         (bidi_move_to_visually_next): Compare cache index with
14799         bidi_cache_start rather than with zero.
14800         (bidi_fetch_char): Accept new argument STRING; all callers
14801         changed.  Support iteration over a string.  Support strings with
14802         display properties.  Support unibyte strings.  Fix the type of
14803         `len' according to what STRING_CHAR_AND_LENGTH expects.
14804         (bidi_paragraph_init, bidi_resolve_explicit_1)
14805         (bidi_resolve_explicit, bidi_resolve_weak)
14806         (bidi_level_of_next_char, bidi_move_to_visually_next):
14807         Support iteration over a string.
14808         (bidi_set_sor_type, bidi_resolve_explicit_1)
14809         (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
14810         can now be zero (for strings); special values 0 and -1 were
14811         changed to -1 and -2, respectively.
14812         (bidi_char_at_pos): New function.
14813         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
14814         Call it instead of FETCH_MULTIBYTE_CHAR.
14815         (bidi_move_to_visually_next): Abort if charpos or bytepos were not
14816         initialized to valid values.
14817         (bidi_init_it): Don't initialize charpos and bytepos with invalid
14818         values.
14819         (bidi_level_of_next_char): Allow the sentinel "position" to pass
14820         the test for valid cached positions.  Fix the logic for looking up
14821         the sentinel state in the cache.  GCPRO the Lisp string we are
14822         iterating.
14823         (bidi_push_it, bidi_pop_it): New functions.
14824         (bidi_initialize): Initialize the bidi cache start stack pointer.
14825         (bidi_cache_ensure_space): New function, refactored from part of
14826         bidi_cache_iterator_state.  Don't assume the required size is just
14827         one BIDI_CACHE_CHUNK away.
14828         (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
14829         (bidi_count_bytes, bidi_char_at_pos): New functions.
14830         (bidi_cache_search): Don't assume bidi_cache_last_idx is
14831         always valid if bidi_cache_idx is valid.
14832         (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
14833         is valid if it's going to be used.
14834         (bidi_shelve_cache, bidi_unshelve_cache): New functions.
14835         (bidi_cache_fetch_state, bidi_cache_search)
14836         (bidi_cache_find_level_change, bidi_cache_ensure_space)
14837         (bidi_cache_iterator_state, bidi_cache_find)
14838         (bidi_find_other_level_edge, bidi_cache_start_stack):
14839         All variables related to cache indices are now EMACS_INT.
14841         * dispextern.h (struct bidi_string_data): New structure.
14842         (struct bidi_it): New member `string'.  Make flag members be 1-bit
14843         fields, and put them last in the struct.
14844         (compute_display_string_pos, compute_display_string_end):
14845         Update prototypes.
14846         (bidi_push_it, bidi_pop_it): Add prototypes.
14847         (struct iterator_stack_entry): New members bidi_p,
14848         paragraph_embedding, and from_disp_prop_p.
14849         (struct it): Member bidi_p is now a bit field 1 bit wide.
14850         (bidi_shelve_cache, bidi_unshelve_cache):
14851         Declare prototypes.
14853         * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
14854         (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
14855         and vector-like objects.
14857         * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
14858         cache around display iteration.
14860         * window.c (Fwindow_end, window_scroll_pixel_based)
14861         (displayed_window_lines, Frecenter): Save and restore the bidi
14862         cache around display iteration.
14864 2011-07-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
14866         * editfns.c (Fdelete_region): Clarify the use of the named
14867         parameters (bug#6788).
14869 2011-07-14  Martin Rudalics  <rudalics@gmx.at>
14871         * indent.c (Fvertical_motion): Set and restore w->pointm when
14872         saving and restoring the window's buffer (Bug#9006).
14874 2011-07-13  Lars Magne Ingebrigtsen  <larsi@gnus.org>
14876         * editfns.c (Fstring_to_char): Clarify just what is returned
14877         (bug#6576).  Text by Eli Zaretskii.
14879 2011-07-13  Juanma Barranquero  <lekktu@gmail.com>
14881         * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
14883 2011-07-13  Eli Zaretskii  <eliz@gnu.org>
14885         * buffer.c (mmap_find): Fix a typo.
14887 2011-07-13  Johan Bockgård  <bojohan@gnu.org>
14889         Fix execution of x selection hooks.
14890         * xselect.c (Qx_lost_selection_functions)
14891         (Qx_sent_selection_functions): New vars.
14892         (syms_of_xselect): DEFSYM them.
14893         (x_handle_selection_request): Pass Qx_sent_selection_functions
14894         rather than Vx_sent_selection_functions to Frun_hook_with_args.
14895         (x_handle_selection_clear,x_clear_frame_selections):
14896         Pass Qx_lost_selection_functions rather than
14897         Vx_lost_selection_functions to Frun_hook_with_args.
14899 2011-07-13  Paul Eggert  <eggert@cs.ucla.edu>
14901         * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
14902         The old code sometimes used this field without initializing it.
14904         * alloc.c (gc_sweep): Don't read past end of array.
14905         In theory, the old code could also have corrupted Emacs internals,
14906         though it'd be very unlikely.
14908 2011-07-12  Andreas Schwab  <schwab@linux-m68k.org>
14910         * character.c (Fcharacterp): Don't advertise optional ignored
14911         argument.  (Bug#4026)
14913 2011-07-12  Lars Magne Ingebrigtsen  <larsi@gnus.org>
14915         * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
14916         key" (bug#4257).
14918         * window.c (Fset_window_start): Doc fix (bug#4199).
14919         (Fset_window_hscroll): Ditto.
14921 2011-07-12  Paul Eggert  <eggert@cs.ucla.edu>
14923         Fix minor new problems caught by GCC 4.6.1.
14924         * term.c (init_tty): Remove unused local.
14925         * xsettings.c (store_monospaced_changed): Define this function only
14926         if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
14927         not used otherwise.
14929 2011-07-12  Chong Yidong  <cyd@stupidchicken.com>
14931         * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
14933 2011-07-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
14935         * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
14936         are the mini-buffer and the echo area (bug#3320).
14938         * term.c (init_tty): Remove support for supdup, c10 and perq
14939         terminals, which are no longer supported (bug#1482).
14941 2011-07-10  Johan Bockgård  <bojohan@gnu.org>
14943         * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
14945 2011-07-10  Jan Djärv  <jan.h.d@swipnet.se>
14947         * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
14948         for non-popups (Bug#3642).
14950 2011-07-10  Andreas Schwab  <schwab@linux-m68k.org>
14952         * alloc.c (reset_malloc_hooks): Protoize.
14953         * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
14954         (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
14955         * cm.c (losecursor): Likewise.
14956         * data.c (fmod): Likewise.
14957         * dispnew.c (swap_glyphs_in_rows): Likewise.
14958         * emacs.c (memory_warning_signal): Likewise.
14959         * floatfns.c (float_error): Likewise.
14960         * font.c (check_gstring, check_otf_features, otf_tag_symbol)
14961         (otf_open, font_otf_capability, generate_otf_features)
14962         (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
14963         Likewise.
14964         * image.c (pbm_read_file): Likewise.
14965         * indent.c (string_display_width): Likewise.
14966         * intervals.c (check_for_interval, search_for_interval)
14967         (inc_interval_count, count_intervals, root_interval)
14968         (adjust_intervals_for_insertion, make_new_interval): Likewise.
14969         * lread.c (defalias): Likewise.
14970         * ralloc.c (r_alloc_check): Likewise.
14971         * regex.c (set_image_of_range_1, set_image_of_range)
14972         (regex_grow_registers): Likewise.
14973         * sysdep.c (strerror): Likewise.
14974         * termcap.c (valid_filename_p, tprint, main): Likewise.
14975         * tparam.c (main): Likewise.
14976         * unexhp9k800.c (run_time_remap, save_data_space)
14977         (update_file_ptrs, read_header, write_header, calculate_checksum)
14978         (copy_file, copy_rest, display_header): Likewise.
14979         * widget.c (mark_shell_size_user_specified, create_frame_gcs):
14980         Likewise.
14981         * xdisp.c (check_it): Likewise.
14982         * xfaces.c (register_color, unregister_color, unregister_colors):
14983         Likewise.
14984         * xfns.c (print_fontset_result): Likewise.
14985         * xrdb.c (member, fatal, main): Likewise.
14987 2011-07-10  Paul Eggert  <eggert@cs.ucla.edu>
14989         Fix minor problems found by static checking (Bug#9031).
14990         * chartab.c (char_table_set_range, map_sub_char_table):
14991         Remove unused locals.
14992         (uniprop_table): Now static.
14993         * composite.c (_work_char): Remove unused static var.
14995 2011-07-09  Juanma Barranquero  <lekktu@gmail.com>
14997         * chartab.c (uniprop_table_uncompress): Remove unused local variable.
14999 2011-07-09  Jan Djärv  <jan.h.d@swipnet.se>
15001         * gtkutil.c (qttip_cb): Remove code without function.
15003 2011-07-09  Eli Zaretskii  <eliz@gnu.org>
15005         * w32.c (pthread_sigmask): New stub.
15007 2011-07-08  Paul Eggert  <eggert@cs.ucla.edu>
15009         Use pthread_sigmask, not sigprocmask (Bug#9010).
15010         sigprocmask is portable only for single-threaded applications, and
15011         Emacs can be multi-threaded when it uses GTK.
15012         * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
15013         (LIBES): Use it.
15014         * callproc.c (Fcall_process):
15015         * process.c (create_process):
15016         * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
15017         Use pthread_sigmask, not sigprocmask.
15019 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
15021         * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
15022         (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
15023         wrong (Bug#8591).
15025 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
15027         * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
15028         Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
15029         (xg_hide_tooltip): Fix comment.
15031         * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
15032         in registerServicesMenuSendTypes.
15033         (validRequestorForSendType): Don't check ns_return_types.
15035         * nsfns.m (Fx_open_connection): Put NSStringPboardType into
15036         ns_return_type.
15038 2011-07-08  Jason Rumney  <jasonr@gnu.org>
15040         * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
15041         SH_SHOW for hidden windows (Bug#5482).
15043         * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
15044         frame struct members of non-existent frames (Bug#6284).
15046 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
15048         * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
15049         variable firstTime not needed on OSX >= 10.6.
15050         (setPosition): setFloatValue:knobProportion: is deprecated on OSX
15051         >= 10.5.  Use setKnobProportion, setDoubleValue.
15053         * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
15054         (MAC_OS_X_VERSION_10_5): Define if not defined.
15055         (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
15056         (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
15057         (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
15059         * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
15060         cString and lossyCString on OSX >= 10.4.
15062         * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
15063         sizeToFit on OSX >= 10.2.
15065         * nsimage.m (allocInitFromFile): Don't use deprecated method
15066         bestRepresentationForDevice on OSX >= 10.6.
15068         * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
15069         to avoid warning.
15071         * emacs.c: Declare unexec_init_emacs_zone.
15073         * nsgui.h: Fix compiler warning about gnulib redefining verify.
15075         * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
15077         * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
15078         on svcsMenu (Bug#8842).
15080         * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
15081         ns_return_types.
15082         (Fns_list_services): Just return Qnil on 10.6, code not working there.
15084         * nsterm.m (QUTF8_STRING): Declare.
15085         (initFrameFromEmacs): Call registerServicesMenuSendTypes.
15086         (validRequestorForSendType): Return type is (id).
15087         Change indexOfObjectIdenticalTo to indexOfObject.
15088         Check if we have local selection before returning self (Bug#8842).
15089         (writeSelectionToPasteboard): Put local selection into paste board
15090         if we have a local selection (Bug#8842).
15091         (syms_of_nsterm): DEFSYM QUTF8_STRING.
15093         * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
15094         (ns_get_local_selection): Declare.
15096 2011-07-07  Lars Magne Ingebrigtsen  <larsi@gnus.org>
15098         * keymap.c (describe_map_tree): Don't insert a double newline at
15099         the end of the buffer (bug#1169) and return whether we inserted
15100         something.
15102         * callint.c (Fcall_interactively): Change "reading args" to
15103         "providing args" to try to clarify what it does (bug#1010).
15105 2011-07-07  Kenichi Handa  <handa@m17n.org>
15107         * composite.c (composition_compute_stop_pos): Ignore a static
15108         composition starting before CHARPOS (Bug#8915).
15110         * xdisp.c (handle_composition_prop): Likewise.
15112 2011-07-07  Eli Zaretskii  <eliz@gnu.org>
15114         * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
15115         (Bug#9015)
15117 2011-07-07  Kenichi Handa  <handa@m17n.org>
15119         * character.h (unicode_category_t): New enum type.
15121         * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
15122         (Qchar_code_property_table): New variable.
15123         (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
15124         (UNIPROP_COMPRESSED_FORM_P): New macros.
15125         (char_table_ascii): Uncompress the compressed values.
15126         (sub_char_table_ref): New arg is_uniprop.  Callers changed.
15127         Uncompress the compressed values.
15128         (sub_char_table_ref_and_range): Likewise.
15129         (char_table_ref_and_range): Uncompress the compressed values.
15130         (sub_char_table_set): New arg is_uniprop.  Callers changed.
15131         Uncompress the compressed values.
15132         (sub_char_table_set_range): Args changed.  Callers changed.
15133         (char_table_set_range): Adjuted for the above change.
15134         (map_sub_char_table): Delete args default_val and parent.  Add arg
15135         top.  Give decoded values to a Lisp function.
15136         (map_char_table): Adjust for the above change.  Give decoded
15137         values to a Lisp function.  Gcpro more variables.
15138         (uniprop_table_uncompress)
15139         (uniprop_decode_value_run_length): New functions.
15140         (uniprop_decoder, uniprop_decoder_count): New variables.
15141         (uniprop_get_decoder, uniprop_encode_value_character)
15142         (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
15143         New functions.
15144         (uniprop_encoder, uniprop_encoder_count): New variables.
15145         (uniprop_get_encoder, uniprop_table)
15146         (Funicode_property_table_internal, Fget_unicode_property_internal)
15147         (Fput_unicode_property_internal): New functions.
15148         (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
15149         Sunicode_property_table_internal, Sget_unicode_property_internal,
15150         and Sput_unicode_property_internal.  Defvar_lisp
15151         char-code-property-alist.
15153         * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
15154         Vunicode_category_table.
15156         * font.c (font_range): Adjust for the change of
15157         Vunicode_category_table.
15159 2011-07-07  Dan Nicolaescu  <dann@ics.uci.edu>
15161         * m/iris4d.h: Remove file, move contents ...
15162         * s/irix6-5.h: ... here.
15164 2011-07-06  Paul Eggert  <eggert@cs.ucla.edu>
15166         Remove unportable assumption about struct layout (Bug#8884).
15167         * alloc.c (mark_buffer):
15168         * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
15169         (clone_per_buffer_values): Don't assume that
15170         sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
15171         This isn't true in general, and it's particularly not true
15172         if Emacs is configured with --with-wide-int.
15173         * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
15174         New macros, used in the buffer.c change.
15176 2011-07-05  Jan Djärv  <jan.h.d@swipnet.se>
15178         * xsettings.c: Use both GConf and GSettings if both are available.
15179         (store_config_changed_event): Add comment.
15180         (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
15181         (store_tool_bar_style_changed): New functions.
15182         (store_monospaced_changed): Add comment.  Call dpyinfo_valid.
15183         (struct xsettings): Move font inside HAVE_XFT.
15184         (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
15185         (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
15186         Move inside HAVE_XFT.
15187         (something_changed_gsettingsCB): Rename from something_changedCB.
15188         Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
15189         also.
15190         (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
15191         (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT.  Move inside HAVE_XFT.
15192         (something_changed_gconfCB): Rename from something_changedCB.
15193         Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
15194         (parse_settings): Move check for font inside HAVE_XFT.
15195         (read_settings, apply_xft_settings): Add comment.
15196         (read_and_apply_settings): Add comment.  Call map_tool_bar_style and
15197         store_tool_bar_style_changed.  Move check for font inside HAVE_XFT and
15198         call store_font_name_changed.
15199         (xft_settings_event): Add comment.
15200         (init_gsettings): Add comment.  Get values for GSETTINGS_TOOL_BAR_STYLE
15201         and GSETTINGS_FONT_NAME.  Move check for fonts within HAVE_XFT.
15202         (init_gconf): Add comment.  Get values for GCONF_TOOL_BAR_STYLE
15203         and GCONF_FONT_NAME.  Move check for fonts within HAVE_XFT.
15204         (xsettings_initialize): Call init_gsettings last.
15205         (xsettings_get_system_font, xsettings_get_system_normal_font):
15206         Add comment.
15208 2011-07-05  Paul Eggert  <eggert@cs.ucla.edu>
15210         Random fixes.  E.g., (random) never returned negative values.
15211         * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
15212         subseconds part to the entropy, as that's a bit more random.
15213         Prefer signed to unsigned, since the signedness doesn't matter and
15214         in general we prefer signed.  When given a limit, use a
15215         denominator equal to INTMASK + 1, not to VALMASK + 1, because the
15216         latter isn't right if USE_2_TAGS_FOR_INTS.
15217         * sysdep.c (get_random): Return a value in the range 0..INTMASK,
15218         not 0..VALMASK.  Don't discard "excess" bits that random () returns.
15220 2011-07-04  Stefan Monnier  <monnier@iro.umontreal.ca>
15222         * textprop.c (text_property_stickiness):
15223         Obey Vtext_property_default_nonsticky.
15224         (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
15225         * w32fns.c (syms_of_w32fns):
15226         * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
15228 2011-07-04  Paul Eggert  <eggert@cs.ucla.edu>
15230         * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
15231         This is more efficient than Ffile_directory_p and avoids a minor race.
15233 2011-07-04  Lars Magne Ingebrigtsen  <larsi@gnus.org>
15235         * buffer.c (Foverlay_put): Say what the return value is
15236         (bug#7835).
15238         * fileio.c (barf_or_query_if_file_exists): Check first if the file
15239         is a directory before asking whether to use the file name
15240         (bug#7564).
15241         (barf_or_query_if_file_exists): Make the "File is a directory"
15242         error be more correct.
15244         * fns.c (Frequire): Remove the mention of the .gz files, since
15245         that's installation-specific, but keep the mention of
15246         `get-load-suffixes'.
15248 2011-07-04  Paul Eggert  <eggert@cs.ucla.edu>
15250         * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
15251         Report string overflow if the output is too long.
15253 2011-07-04  Juanma Barranquero  <lekktu@gmail.com>
15255         * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
15256         (syms_of_gnutls): Remove duplicate DEFSYM for
15257         Qgnutls_bootprop_verify_hostname_error, an error for
15258         Qgnutls_bootprop_verify_error (which is no longer used).
15260         * eval.c (find_handler_clause): Remove parameters `sig' and `data',
15261         unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca.  All callers changed.
15262         Also (re)move comments that are misplaced or no longer relevant.
15264 2011-07-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
15266         * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
15268 2011-07-03  Chong Yidong  <cyd@stupidchicken.com>
15270         * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
15271         and background color parameters if they have been changed.
15273 2011-07-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
15275         * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
15277 2011-07-03  Paul Eggert  <eggert@cs.ucla.edu>
15279         * xsettings.c (SYSTEM_FONT): Define only when used.
15280         No need to define when HAVE_GSETTINGS || !HAVE_XFT.
15282         * keymap.c (access_keymap_1): Now static.
15284 2011-07-02  Chong Yidong  <cyd@stupidchicken.com>
15286         * keyboard.c (command_loop_1): If a down-mouse event is unbound,
15287         leave any prefix arg for the up event (Bug#1586).
15289 2011-07-02  Lars Magne Ingebrigtsen  <larsi@gnus.org>
15291         * lread.c (syms_of_lread): Mention single symbols defined by
15292         `defvar' or `defconst' (bug#7154).
15294         * fns.c (Frequire): Mention .el.gz files (bug#7314).
15295         (Frequire): Mention get-load-suffixes.
15297 2011-07-02  Martin Rudalics  <rudalics@gmx.at>
15299         * window.h (window): Remove clone_number slot.
15300         * window.c (Fwindow_clone_number, Fset_window_clone_number):
15301         Remove.
15302         (make_parent_window, make_window, saved_window)
15303         (Fset_window_configuration, save_window_save): Don't deal with
15304         clone numbers.
15305         * buffer.c (Qclone_number): Remove declaration.
15306         (sort_overlays, overlay_strings): Don't deal with clone numbers.
15308 2011-07-02  Stefan Monnier  <monnier@iro.umontreal.ca>
15310         Add multiple inheritance to keymaps.
15311         * keymap.c (Fmake_composed_keymap): New function.
15312         (Fset_keymap_parent): Simplify.
15313         (fix_submap_inheritance): Remove.
15314         (access_keymap_1): New function extracted from access_keymap to handle
15315         embedded parents and handle lists of maps.
15316         (access_keymap): Use it.
15317         (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
15318         (Fcopy_keymap): Handle embedded parents.
15319         (Fcommand_remapping, define_as_prefix): Simplify.
15320         (Fkey_binding): Simplify.
15321         (syms_of_keymap): Move minibuffer-local-completion-map,
15322         minibuffer-local-filename-completion-map,
15323         minibuffer-local-must-match-map, and
15324         minibuffer-local-filename-must-match-map to Elisp.
15325         (syms_of_keymap): Defsubr make-composed-keymap.
15326         * keyboard.c (menu_bar_items): Use map_keymap_canonical.
15327         (parse_menu_item): Trivial simplification.
15329 2011-07-01  Glenn Morris  <rgm@gnu.org>
15331         * Makefile.in (SETTINGS_LIBS): Fix typo.
15333 2011-07-01  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
15335         * coding.c (Fencode_coding_string): Record the last coding system
15336         used, as the function doc string says (bug#8738).
15338 2011-07-01  Jan Djärv  <jan.h.d@swipnet.se>
15340         * xsettings.c (store_monospaced_changed): Take new font as arg and
15341         check for change against current_mono_font.
15342         (EMACS_TYPE_SETTINGS): Remove this and related defines.
15343         (emacs_settings_constructor, emacs_settings_get_property)
15344         (emacs_settings_set_property, emacs_settings_class_init)
15345         (emacs_settings_init, gsettings_obj): Remove.
15346         (something_changedCB): New function for HAVE_GSETTINGS.
15347         (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
15348         with value as argument.
15349         (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
15350         g_settings_new (Bug#8967).  Do not create gsettings_obj.
15351         Remove calls to g_settings_bind.  Connect something_changedCB to
15352         "changed".
15354         * xgselect.c: Add defined (HAVE_GSETTINGS).
15355         (xgselect_initialize): Ditto.
15357         * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
15358         (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
15359         xg_select.
15361 2011-07-01  Paul Eggert  <eggert@cs.ucla.edu>
15363         * eval.c (struct backtrace): Simplify and port the data structure.
15364         Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
15365         signed bit field, as this assumption is not portable and it makes
15366         Emacs crash when compiled with Sun C 5.8 on sparc.  Do not use
15367         "char debug_on_exit : 1" as this is not portable either; instead,
15368         use the portable "unsigned int debug_on_exit : 1".  Remove unused
15369         member evalargs.  Remove obsolete comments about cc bombing out.
15371 2011-06-30  Jan Djärv  <jan.h.d@swipnet.se>
15373         * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
15374         Let HAVE_GSETTINGS override HAVE_GCONF.
15375         (store_monospaced_changed): New function.
15376         (EMACS_SETTINGS): A new type derived from GObject to handle
15377         GSettings notifications.
15378         (emacs_settings_constructor, emacs_settings_get_property)
15379         (emacs_settings_set_property, emacs_settings_class_init):
15380         New functions.
15381         (gsettings_client, gsettings_obj): New variables.
15382         (GSETTINGS_SCHEMA): New define.
15383         (something_changedCB): Call store_monospaced_changed.
15384         (init_gsettings): New function.
15385         (xsettings_initialize): Call init_gsettings.
15386         (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
15387         to NULL.
15389         * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
15390         GCONF_CFLAGS/LIBS.
15392 2011-06-29  Martin Rudalics  <rudalics@gmx.at>
15394         * window.c (resize_root_window, grow_mini_window)
15395         (shrink_mini_window): Rename Qresize_root_window to
15396         Qwindow_resize_root_window and Qresize_root_window_vertically to
15397         Qwindow_resize_root_window_vertically.
15399 2011-06-28  Paul Eggert  <eggert@cs.ucla.edu>
15401         * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
15403 2011-06-27  Juanma Barranquero  <lekktu@gmail.com>
15405         * makefile.w32-in: Redesign dependencies so they reflect more
15406         clearly which files are directly included by each source file,
15407         and not through other includes.
15409 2011-06-27  Martin Rudalics  <rudalics@gmx.at>
15411         * buffer.c (Qclone_number): Declare static and DEFSYM it.
15412         (sort_overlays, overlay_strings): When an overlay's clone number
15413         matches the window's clone number process the overlay even if
15414         the overlay's window property doesn't match the current window.
15416         * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
15417         (Fwindow_hchild): Rename to Fwindow_left_child.
15418         (Fwindow_next): Rename to Fwindow_next_sibling.
15419         (Fwindow_prev): Rename to Fwindow_prev_sibling.
15420         (resize_window_check): Rename to window_resize_check.
15421         (resize_window_apply): Rename to window_resize_apply.
15422         (Fresize_window_apply): Rename to Fwindow_resize_apply.
15423         (Fdelete_other_windows_internal, resize_frame_windows)
15424         (Fsplit_window_internal, Fdelete_window_internal)
15425         (grow_mini_window, shrink_mini_window)
15426         (Fresize_mini_window_internal): Fix callers accordingly.
15428 2011-06-26  Jan Djärv  <jan.h.d@swipnet.se>
15430         * emacsgtkfixed.h: State that this is only used with Gtk+3.
15431         (emacs_fixed_set_min_size): Remove.
15432         (emacs_fixed_new): Take frame as argument.
15434         * emacsgtkfixed.c: State that this is only used with Gtk+3.
15435         (_EmacsFixedPrivate): Remove minwidth/height.
15436         Add struct frame *f.
15437         (emacs_fixed_init): Initialize priv->f.
15438         (get_parent_class, emacs_fixed_set_min_size): Remove.
15439         (emacs_fixed_new): Set priv->f to argument.
15440         (emacs_fixed_get_preferred_width)
15441         (emacs_fixed_get_preferred_height): Use min_width/height from
15442         frames size_hint to set minimum and natural (Bug#8919).
15443         (XSetWMSizeHints, XSetWMNormalHints): Override these functions
15444         and use min_width/height from frames size_hint to set
15445         min_width/height (Bug#8919).
15447         * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
15448         (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
15449         Fix indentation.
15451 2011-06-26  Eli Zaretskii  <eliz@gnu.org>
15453         * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
15454         bidi_at_paragraph_end, since fast_looking_at doesn't like to be
15455         called at ZV.
15457 2011-06-26  Chong Yidong  <cyd@stupidchicken.com>
15459         * process.c (wait_reading_process_output): Bypass select if
15460         waiting for a cell while ignoring keyboard input, and input is
15461         pending.  Suggested by Jan Djärv (Bug#8869).
15463 2011-06-25  Paul Eggert  <eggert@cs.ucla.edu>
15465         Use gnulib's dup2 module instead of rolling our own.
15466         * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
15468 2011-06-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
15470         * dispnew.c (scrolling_window): Before scrolling, turn off a
15471         mouse-highlight in the window being scrolled.
15473 2011-06-24  Juanma Barranquero  <lekktu@gmail.com>
15475         Move DEFSYM to lisp.h and use everywhere.
15477         * character.h (DEFSYM): Move declaration...
15478         * lisp.h (DEFSYM): ...here.
15480         * gnutls.c:
15481         * minibuf.c:
15482         * w32menu.c:
15483         * w32proc.c:
15484         * w32select.c: Don't include character.h.
15486         * alloc.c (syms_of_alloc):
15487         * buffer.c (syms_of_buffer):
15488         * bytecode.c (syms_of_bytecode):
15489         * callint.c (syms_of_callint):
15490         * casefiddle.c (syms_of_casefiddle):
15491         * casetab.c (init_casetab_once):
15492         * category.c (init_category_once, syms_of_category):
15493         * ccl.c (syms_of_ccl):
15494         * cmds.c (syms_of_cmds):
15495         * composite.c (syms_of_composite):
15496         * dbusbind.c (syms_of_dbusbind):
15497         * dired.c (syms_of_dired):
15498         * dispnew.c (syms_of_display):
15499         * doc.c (syms_of_doc):
15500         * editfns.c (syms_of_editfns):
15501         * emacs.c (syms_of_emacs):
15502         * eval.c (syms_of_eval):
15503         * fileio.c (syms_of_fileio):
15504         * fns.c (syms_of_fns):
15505         * frame.c (syms_of_frame):
15506         * fringe.c (syms_of_fringe):
15507         * insdel.c (syms_of_insdel):
15508         * keymap.c (syms_of_keymap):
15509         * lread.c (init_obarray, syms_of_lread):
15510         * macros.c (syms_of_macros):
15511         * msdos.c (syms_of_msdos):
15512         * print.c (syms_of_print):
15513         * process.c (syms_of_process):
15514         * search.c (syms_of_search):
15515         * sound.c (syms_of_sound):
15516         * syntax.c (init_syntax_once, syms_of_syntax):
15517         * terminal.c (syms_of_terminal):
15518         * textprop.c (syms_of_textprop):
15519         * undo.c (syms_of_undo):
15520         * w32.c (globals_of_w32):
15521         * window.c (syms_of_window):
15522         * xdisp.c (syms_of_xdisp):
15523         * xfaces.c (syms_of_xfaces):
15524         * xfns.c (syms_of_xfns):
15525         * xmenu.c (syms_of_xmenu):
15526         * xsettings.c (syms_of_xsettings):
15527         * xterm.c (syms_of_xterm): Use DEFSYM.
15529 2011-06-24  Teodor Zlatanov  <tzz@lifelogs.com>
15531         * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
15533 2011-06-23  Paul Eggert  <eggert@cs.ucla.edu>
15535         Integer and buffer overflow fixes (Bug#8873).
15537         * print.c (printchar, strout): Check for string overflow.
15538         (PRINTPREPARE, printchar, strout):
15539         Don't set size unless allocation succeeds.
15541         * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
15542         for sizes.  Check for string overflow more accurately.
15543         Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
15545         * macros.c: Integer and buffer overflow fixes.
15546         * keyboard.h (struct keyboard.kbd_macro_bufsize):
15547         * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
15548         Use ptrdiff_t, not int, for sizes.
15549         Don't increment bufsize until after realloc succeeds.
15550         Check for size-calculation overflow.
15551         (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
15553         * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
15555         * lread.c: Integer overflow fixes.
15556         (read_integer): Radix is now EMACS_INT, not int,
15557         to improve quality of diagnostics for out-of-range radices.
15558         Calculate buffer size correctly for out-of-range radices.
15559         (read1): Check for integer overflow in radices, and in
15560         read-circle numbers.
15561         (read_escape): Avoid int overflow.
15562         (Fload, openp, read_buffer_size, read1)
15563         (substitute_object_recurse, read_vector, read_list, map_obarray):
15564         Use ptrdiff_t, not int, for sizes.
15565         (read1): Use EMACS_INT, not int, for sizes.
15566         Check for size overflow.
15568         * image.c (cache_image): Check for size arithmetic overflow.
15570         * lread.c: Integer overflow issues.
15571         (saved_doc_string_size, saved_doc_string_length)
15572         (prev_saved_doc_string_size, prev_saved_doc_string_length):
15573         Now ptrdiff_t, not int.
15574         (read1): Don't assume doc string length fits in int.  Check for
15575         out-of-range doc string lengths.
15576         (read_list): Don't assume file position fits in int.
15577         (read_escape): Check for hex character overflow.
15579 2011-06-22  Leo Liu  <sdl.web@gmail.com>
15581         * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
15582         Move to minibuffer.el.
15584 2011-06-22  Paul Eggert  <eggert@cs.ucla.edu>
15586         Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
15587         The following patches are for when GLYPH_DEBUG && !XASSERT.
15588         * dispextern.h (trace_redisplay_p, dump_glyph_string):
15589         * dispnew.c (flush_stdout):
15590         * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
15591         Mark as externally visible.
15592         * dispnew.c (check_window_matrix_pointers): Now static.
15593         * dispnew.c (window_to_frame_vpos):
15594         * xfns.c (unwind_create_frame):
15595         * xterm.c (x_check_font): Remove unused local.
15596         * scroll.c (CHECK_BOUNDS):
15597         * xfaces.c (cache_fache): Rename local to avoid shadowing.
15598         * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
15599         * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
15600         (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
15601         (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
15602         Now static.
15603         (debug_method_add): Use va_list and vsprintf rather than relying
15604         on undefined behavior with wrong number of arguments.
15605         (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
15606         Don't assume ptrdiff_t and EMACS_INT are the same width as int.
15607         In this code, it's OK to assume C99 behavior for ptrdiff_t formats
15608         since we're not interested in debugging glyphs with old libraries.
15609         * xfaces.c (cache_face): Move debugging code earlier; this pacifies
15610         GCC 4.6.0's static checking.
15612 2011-06-22  Paul Eggert  <eggert@cs.ucla.edu>
15614         Integer overflow and signedness fixes (Bug#8873).
15615         A few related buffer overrun fixes, too.
15617         * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
15619         * dispextern.h (struct face.stipple):
15620         * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
15621         (x_bitmap_mask, x_allocate_bitmap_record)
15622         (x_create_bitmap_from_data, x_create_bitmap_from_file)
15623         (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
15624         (x_create_bitmap_from_xpm_data):
15625         * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
15626         * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
15627         (.bitmaps_last):
15628         * xfaces.c (load_pixmap):
15629         * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
15630         * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
15631         (.bitmaps_last, struct x_output.icon_bitmap):
15632         Use ptrdiff_t, not int, for bitmap indexes.
15633         (x_allocate_bitmap_record): Check for size overflow.
15634         * dispextern.h, lisp.h: Adjust to API changes elsewhere.
15636         Use ptrdiff_t, not int, for overlay counts.
15637         * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
15638         * editfns.c (overlays_around, get_pos_property):
15639         * textprop.c (get_char_property_and_overlay):
15640         * xdisp.c (next_overlay_change, note_mouse_highlight):
15641         * xfaces.c (face_at_buffer_position):
15642         * buffer.c (OVERLAY_COUNT_MAX): New macro.
15643         (overlays_at, overlays_in, sort_overlays, Foverlays_at)
15644         (Fnext_overlay_change, Fprevious_overlay_change)
15645         (mouse_face_overlay_overlaps, Foverlays_in):
15646         Use ptrdiff_t, not int, for sizes.
15647         (overlays_at, overlays_in): Check for size-calculation overflow.
15649         * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
15651         * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
15652         (x_session_initialize): Do not assume string length fits in int.
15654         * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
15655         This is unlikely, but can occur if DPI is outlandish.
15657         * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
15658         * xselect.c (Fx_get_atom_name): Avoid need for strlen.
15660         * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
15661         * xrdb.c (magic_file_p, search_magic_path):
15662         Omit last arg SUFFIX; it was always 0.  All callers changed.
15663         (magic_file_p): Use ptrdiff_t, not int.  Check for size overflow.
15665         * xfont.c (xfont_match): Avoid need for strlen.
15667         * xfns.c: Don't assume strlen fits in int.
15668         (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
15670         * xdisp.c (message_log_check_duplicate): Return intmax_t,
15671         not unsigned long, as we prefer signed integers.  All callers changed.
15672         Detect integer overflow in repeat count.
15673         (message_dolog): Don't assume print length fits in 39 bytes.
15674         (display_mode_element): Don't assume strlen fits in int.
15676         * termcap.c: Don't assume sizes fit in int and never overflow.
15677         (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
15678         (gobble_line): Check for size-calculation overflow.
15680         * minibuf.c (Fread_buffer):
15681         * lread.c (intern, intern_c_string):
15682         * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
15683         Don't assume string length fits in int.
15685         * keyboard.c (parse_tool_bar_item):
15686         * gtkutil.c (style_changed_cb): Avoid need for strlen.
15688         * font.c: Don't assume string length fits in int.
15689         (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
15690         Use ptrdiff_t, not int.
15691         (font_intern_prop): Don't assume string length fits in int.
15692         Don't assume integer property fits in fixnum.
15693         * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
15695         * filelock.c: Fix some buffer overrun and integer overflow issues.
15696         (get_boot_time): Don't assume gzip command string fits in 100 bytes.
15697         Reformulate so as not to need the command string.
15698         Invoke gzip -cd rather than gunzip, as it's more portable.
15699         (lock_info_type, lock_file_1, lock_file):
15700         Don't assume pid_t and time_t fit in unsigned long.
15701         (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
15702         (current_lock_owner): Prefer signed type for sizes.
15703         Use memcpy, not strncpy, where memcpy is what is really wanted.
15704         Don't assume (via atoi) that time_t and pid_t fit in int.
15705         Check for time_t and/or pid_t out of range, e.g., via a network share.
15706         Don't alloca where an auto var works fine.
15708         * fileio.c: Fix some integer overflow issues.
15709         (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
15710         Don't assume string length fits in int.
15711         (directory_file_name): Don't assume string length fits in long.
15712         (make_temp_name): Don't assume pid fits in int, or that its print
15713         length is less than 20.
15715         * data.c (Fsubr_name): Rewrite to avoid a strlen call.
15717         * coding.c (make_subsidiaries): Don't assume string length fits in int.
15719         * callproc.c (child_setup): Rewrite to avoid two strlen calls.
15721         * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
15722         We prefer signed integers, even for size calculations.
15724         * emacs.c: Don't assume string length fits in 'int'.
15725         (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
15726         (main): Don't invoke strlen when not needed.
15728         * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
15729         (XD_DEBUG_MESSAGE): Don't waste a byte.
15731         * callproc.c (getenv_internal_1, getenv_internal)
15732         (Fgetenv_internal):
15733         * buffer.c (init_buffer): Don't assume string length fits in 'int'.
15735         * lread.c (invalid_syntax): Omit length argument.
15736         All uses changed.  This doesn't fix a bug, but it simplifies the
15737         code away from its former Hollerith-constant appearance, and it's
15738         one less 'int' to worry about when looking at integer-overflow issues.
15739         (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
15741         * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
15742         This didn't break anything, but it didn't help either.
15743         It's confusing to put a bogus integer in a place where the actual
15744         value does not matter.
15745         (LIST_END_P): Remove unused macro and its bogus comment.
15746         (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
15748         * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
15749         This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
15750         implementation.
15751         (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
15752         We prefer signed types, and the value cannot exceed the EMACS_INT
15753         range anyway (because otherwise the length would not be representable).
15754         (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
15755         not EMACS_UINT and EMACS_INT, when converting pointer to integer.
15756         This avoids a GCC warning when WIDE_EMACS_INT.
15758         * indent.c (sane_tab_width): New function.
15759         (current_column, scan_for_column, Findent_to, position_indentation)
15760         (compute_motion): Use it.  This is just for clarity.
15761         (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
15763         * image.c (xbm_image_p): Don't assume stated width, height fit in int.
15765         * lisp.h (lint_assume): New macro.
15766         * composite.c (composition_gstring_put_cache):
15767         * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
15769         * editfns.c, insdel.c:
15770         Omit unnecessary forward decls, to simplify future changes.
15772         * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
15774         * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
15776         * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
15777         Use much-faster test for byte-length change.
15778         Don't assume string byte-length fits in 'int'.
15779         Check that character arg fits in 'int'.
15780         (mapcar1): Declare byte as byte, for clarity.
15782         * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
15784         * fns.c (concat): Catch string overflow earlier.
15785         Do not rely on integer wraparound.
15787         * dispextern.h (struct it.overlay_strings_charpos)
15788         (struct it.selective): Now EMACS_INT, not int.
15789         * xdisp.c (forward_to_next_line_start)
15790         (back_to_previous_visible_line_start)
15791         (reseat_at_next_visible_line_start, next_element_from_buffer):
15792         Don't arbitrarily truncate the value of 'selective' to int.
15794         * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
15796         * composite.c: Don't truncate sizes to 'int'.
15797         (composition_gstring_p, composition_reseat_it)
15798         (composition_adjust_point): Use EMACS_INT, not int.
15799         (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
15800         not EMACS_UINT, for indexes.
15802         * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
15804         * buffer.c: Include <verify.h>.
15805         (struct sortvec.priority, struct sortstr.priority):
15806         Now EMACS_INT, not int.
15807         (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
15808         (struct sortstr.size, record_overlay_string)
15809         (struct sortstrlist.size, struct sortlist.used):
15810         Don't truncate size to int.
15811         (record_overlay_string): Check for size-calculation overflow.
15812         (init_buffer_once): Check at compile-time, not run-time.
15814 2011-06-22  Jim Meyering  <meyering@redhat.com>
15816         Don't leak an XBM-image-sized buffer
15817         * image.c (xbm_load): Free the image buffer after using it.
15819 2011-06-21  Paul Eggert  <eggert@cs.ucla.edu>
15821         Port to Sun C.
15822         * composite.c (find_automatic_composition): Omit needless 'return 0;'
15823         that Sun C diagnosed.
15824         * fns.c (secure_hash): Fix pointer signedness issue.
15825         * intervals.c (static_offset_intervals): New function.
15826         (offset_intervals): Use it.
15828 2011-06-21  Leo Liu  <sdl.web@gmail.com>
15830         * deps.mk (fns.o):
15831         * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
15832         sha512.h.
15834         * fns.c (secure_hash): Rename from crypto_hash_function and change
15835         the first arg to accept symbols.
15836         (Fsecure_hash): New primitive.
15837         (syms_of_fns): New symbols.
15839 2011-06-20  Deniz Dogan  <deniz@dogan.se>
15841         * process.c (Fset_process_buffer): Clarify return value in
15842         docstring.
15844 2011-06-18  Chong Yidong  <cyd@stupidchicken.com>
15846         * dispnew.c (add_window_display_history): Use BVAR.
15848         * xdisp.c (debug_method_add): Use BVAR.
15849         (check_window_end, dump_glyph_matrix, dump_glyph)
15850         (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
15852         * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
15853         Likewise.
15855         * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
15856         check till after the cache is created in init_frame_faces.
15858 2011-06-17  Stefan Monnier  <monnier@iro.umontreal.ca>
15860         * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
15862 2011-06-16  Paul Eggert  <eggert@cs.ucla.edu>
15864         * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
15865         Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
15866         hosts with pre-C99 libraries, because pD is wrongly defined to "t".
15868         Improve buffer-overflow checking (Bug#8873).
15869         * fileio.c (Finsert_file_contents):
15870         * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
15871         Remove the old (too-loose) buffer overflow checks.
15872         They weren't needed, since make_gap checks for buffer overflow.
15873         * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
15874         The old code merely checked for Emacs fixnum overflow, and relied
15875         on undefined (wraparound) behavior.  The new code avoids undefined
15876         behavior, and also checks for ptrdiff_t and/or size_t overflow.
15878         * editfns.c (Finsert_char): Don't dump core with very negative counts.
15879         Tune.  Don't use wider integers than needed.  Don't use alloca.
15880         Use a bigger 'string' buffer.  Rewrite to avoid 'n > 0' test.
15882         * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
15884         * insdel.c, lisp.h (buffer_overflow): New function.
15885         (insert_from_buffer_1, replace_range, replace_range_2):
15886         * insdel.c (make_gap_larger):
15887         * editfns.c (Finsert_char):
15888         * fileio.c (Finsert_file_contents): Use it, to normalize wording.
15890         * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
15892 2011-06-15  Paul Eggert  <eggert@cs.ucla.edu>
15894         Integer overflow and signedness fixes (Bug#8873, Bug#8828).
15896         * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
15897         (GET_CCL_RANGE, IN_INT_RANGE): Use it.
15899         * fileio.c: Don't assume EMACS_INT fits in off_t.
15900         (emacs_lseek): New static function.
15901         (Finsert_file_contents, Fwrite_region): Use it.
15902         Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
15904         * fns.c (Fload_average): Don't assume 100 * load average fits in int.
15906         * fns.c: Don't overflow int when computing a list length.
15907         * fns.c (QUIT_COUNT_HEURISTIC): New constant.
15908         (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
15909         truncation on 64-bit hosts.  Check for QUIT every
15910         QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
15911         faster and is responsive enough.
15912         (Flength): Report an error instead of overflowing an integer.
15913         (Fsafe_length): Return a float if the value is not representable
15914         as a fixnum.  This shouldn't happen except in contrived situations.
15915         (Fnthcdr, Fsort): Don't assume list length fits in int.
15916         (Fcopy_sequence): Don't assume vector length fits in int.
15918         * alloc.c: Check that resized vectors' lengths fit in fixnums.
15919         (header_size, word_size): New constants.
15920         (allocate_vectorlike): Don't check size overflow here.
15921         (allocate_vector): Check it here instead, since this is the only
15922         caller of allocate_vectorlike that could cause overflow.
15923         Check that the new vector's length is representable as a fixnum.
15925         * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
15926         The previous code was bogus.  For example, next_almost_prime (32)
15927         returned 39, which is undesirable as it is a multiple of 3; and
15928         next_almost_prime (24) returned 25, which is a multiple of 5 so
15929         why was the code bothering to check for multiples of 7?
15931         * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
15933         * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
15935         Variadic C functions now count arguments with ptrdiff_t.
15936         This partly undoes my 2011-03-30 change, which replaced int with size_t.
15937         Back then I didn't know that the Emacs coding style prefers signed int.
15938         Also, in the meantime I found a few more instances where arguments
15939         were being counted with int, which may truncate counts on 64-bit
15940         machines, or EMACS_INT, which may be unnecessarily wide.
15941         * lisp.h (struct Lisp_Subr.function.aMANY)
15942         (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
15943         Arg counts are now ptrdiff_t, not size_t.
15944         All variadic functions and their callers changed accordingly.
15945         (struct gcpro.nvars): Now size_t, not size_t.  All uses changed.
15946         * bytecode.c (exec_byte_code): Check maxdepth for overflow,
15947         to avoid potential buffer overrun.  Don't assume arg counts fit in 'int'.
15948         * callint.c (Fcall_interactively): Check arg count for overflow,
15949         to avoid potential buffer overrun.  Use signed char, not 'int',
15950         for 'varies' array, so that we needn't bother to check its size
15951         calculation for overflow.
15952         * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
15953         * eval.c (apply_lambda):
15954         * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
15955         (struct textprop_rec.argnum): Now ptrdiff_t, not int.  All uses changed.
15956         (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
15958         * callint.c (Fcall_interactively): Don't use index var as event count.
15960         * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
15961         * mem-limits.h (SIZE): Remove; no longer used.
15963         * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
15965         Remove unnecessary casts.
15966         * xterm.c (x_term_init):
15967         * xfns.c (x_set_border_pixel):
15968         * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
15969         These aren't needed now that we assume ANSI C.
15971         * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
15972         It's more likely to cause problems (due to unsigned overflow)
15973         than to cure them.
15975         * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
15977         * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
15979         * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
15981         * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
15983         * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
15985         * lread.c (Fload): Don't compare a possibly-garbage time_t value.
15987         GLYPH_CODE_FACE returns EMACS_INT, not int.
15988         * dispextern.h (merge_faces):
15989         * xfaces.c (merge_faces):
15990         * xdisp.c (get_next_display_element, next_element_from_display_vector):
15991         Don't assume EMACS_INT fits in int.
15993         * character.h (CHAR_VALID_P): Remove unused parameter.
15994         * fontset.c, lisp.h, xdisp.c: All uses changed.
15996         * editfns.c (Ftranslate_region_internal): Omit redundant test.
15998         * fns.c (concat): Minor tuning based on overflow analysis.
15999         This doesn't fix any bugs.  Use int to hold character, instead
16000         of constantly refetching from Emacs object.  Use XFASTINT, not
16001         XINT, for value known to be a character.  Don't bother comparing
16002         a single byte to 0400, as it's always less.
16004         * floatfns.c (Fexpt):
16005         * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
16007         * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
16008         for characters.
16010         * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
16012         * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
16013         Without this fix, on a 64-bit host (aset S 0 4294967386) would
16014         incorrectly succeed when S was a string, because 4294967386 was
16015         truncated before it was used.
16017         * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
16018         Otherwise, an out-of-range integer could cause undefined behavior
16019         on a 64-bit host.
16021         * composite.c: Use int, not EMACS_INT, for characters.
16022         (fill_gstring_body, composition_compute_stop_pos): Use int, not
16023         EMACS_INT, for values that are known to be in character range.
16024         This doesn't fix any bugs but is the usual style inside Emacs and
16025         may generate better code on 32-bit machines.
16027         Make sure a 64-bit char is never passed to ENCODE_CHAR.
16028         This is for reasons similar to the recent CHAR_STRING fix.
16029         * charset.c (Fencode_char): Check that character arg is actually
16030         a character.  Pass an int to ENCODE_CHAR.
16031         * charset.h (ENCODE_CHAR): Verify that the character argument is no
16032         wider than 'int', as a compile-time check to prevent future regressions
16033         in this area.
16035         * character.c (char_string): Remove unnecessary casts.
16037         Make sure a 64-bit char is never passed to CHAR_STRING.
16038         Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
16039         by silently ignoring the top 32 bits, allowing some values
16040         that were far too large to be valid characters.
16041         * character.h: Include <verify.h>.
16042         (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
16043         arguments are no wider than unsigned, as a compile-time check
16044         to prevent future regressions in this area.
16045         * data.c (Faset):
16046         * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
16047         (Fsubst_char_in_region):
16048         * fns.c (concat):
16049         * xdisp.c (decode_mode_spec_coding):
16050         Adjust to CHAR_STRING's new requirement.
16051         * editfns.c (Finsert_char, Fsubst_char_in_region):
16052         * fns.c (concat): Check that character args are actually
16053         characters.  Without this test, these functions did the wrong
16054         thing with wildly out-of-range values on 64-bit hosts.
16056         Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
16057         These casts should not be needed on 32-bit hosts, either.
16058         * keyboard.c (read_char):
16059         * lread.c (Fload): Remove casts to unsigned.
16061         * lisp.h (UNSIGNED_CMP): New macro.
16062         This fixes comparison bugs on 64-bit hosts.
16063         (ASCII_CHAR_P): Use it.
16064         * casefiddle.c (casify_object):
16065         * character.h (ASCII_BYTE_P, CHAR_VALID_P)
16066         (SINGLE_BYTE_CHAR_P, CHAR_STRING):
16067         * composite.h (COMPOSITION_ENCODE_RULE_VALID):
16068         * dispextern.h (FACE_FROM_ID):
16069         * keyboard.c (read_char): Use UNSIGNED_CMP.
16071         * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
16072         not to EMACS_INT, to avoid GCC warning.
16074         * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
16076         * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
16077         The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
16078         isn't needed on 32-bit machines.
16080         * buffer.c (Fgenerate_new_buffer_name):
16081         Use EMACS_INT for count, not int.
16082         (advance_to_char_boundary): Return EMACS_INT, not int.
16084         * data.c (Qcompiled_function): Now static.
16086         * window.c (window_body_lines): Now static.
16088         * image.c (gif_load): Rename local to avoid shadowing.
16090         * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
16091         (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
16092         * alloc.c (make_save_value): Integer argument is now of type
16093         ptrdiff_t, not int.
16094         (mark_object): Use ptrdiff_t, not int.
16095         * lisp.h (pD): New macro.
16096         * print.c (print_object): Use it.
16098         * alloc.c: Use EMACS_INT, not int, to count objects.
16099         (total_conses, total_markers, total_symbols, total_vector_size)
16100         (total_free_conses, total_free_markers, total_free_symbols)
16101         (total_free_floats, total_floats, total_free_intervals)
16102         (total_intervals, total_strings, total_free_strings):
16103         Now EMACS_INT, not int.  All uses changed.
16104         (Fgarbage_collect): Compute overall total using a double, so that
16105         integer overflow is less likely to be a problem.  Check for overflow
16106         when converting back to an integer.
16107         (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
16108         (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
16109         These were 'int' variables that could overflow on 64-bit hosts;
16110         they were never used, so remove them instead of repairing them.
16111         (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
16112         (inhibit_garbage_collection): Set gc_cons_threshold to max value.
16113         Previously, this ceilinged at INT_MAX, but that doesn't work on
16114         64-bit machines.
16115         (allocate_pseudovector): Don't use EMACS_INT when int would do.
16117         * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
16118         (allocate_vectorlike): Check for ptrdiff_t overflow.
16119         (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
16120         when a (possibly-narrower) signed value would do just as well.
16121         We prefer using signed arithmetic, to avoid comparison confusion.
16123         * alloc.c: Catch some string size overflows that we were missing.
16124         (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
16125         for convenience in STRING_BYTES_MAX.
16126         (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
16127         The definition here is exact; the one in lisp.h was approximate.
16128         (allocate_string_data): Check for string overflow.  This catches
16129         some instances we weren't catching before.  Also, it catches
16130         size_t overflow on (unusual) hosts where SIZE_MAX <= min
16131         (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
16132         and ptrdiff_t and EMACS_INT are both 64 bits.
16134         * character.c, coding.c, doprnt.c, editfns.c, eval.c:
16135         All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
16136         * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
16138         * character.c (string_escape_byte8): Fix nbytes/nchars typo.
16140         * alloc.c (Fmake_string): Check for out-of-range init.
16142 2011-06-15  Stefan Monnier  <monnier@iro.umontreal.ca>
16144         * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
16146 2011-06-14  Jan Djärv  <jan.h.d@swipnet.se>
16148         * xfns.c (x_set_scroll_bar_default_width): Remove argument to
16149         xg_get_default_scrollbar_width.
16151         * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
16152         (int_gtk_range_get_value): Move to the scroll bar part of the file.
16153         (style_changed_cb): Call update_theme_scrollbar_width and call
16154         x_set_scroll_bar_default_width and xg_frame_set_char_size for
16155         all frames (Bug#8505).
16156         (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
16157         Call gtk_window_set_resizable if HAVE_GTK3.
16158         (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
16159         and height if HAVE_GTK3 (Bug#8505).
16160         (scroll_bar_width_for_theme): New variable.
16161         (update_theme_scrollbar_width): New function.
16162         (xg_get_default_scrollbar_width): Move code to
16163         update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
16164         (xg_initialize): Call update_theme_scrollbar_width.
16166         * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
16168         * emacsgtkfixed.c, emacsgtkfixed.h: New files.
16170 2011-06-12  Martin Rudalics  <rudalics@gmx.at>
16172         * frame.c (make_frame): Call other_buffer_safely instead of
16173         other_buffer.
16175         * window.c (temp_output_buffer_show): Call display_buffer with
16176         second argument Vtemp_buffer_show_specifiers and reset latter
16177         immediately after the call.
16178         (Vtemp_buffer_show_specifiers): New variable.
16179         (auto_window_vscroll_p, next_screen_context_lines)
16180         (Vscroll_preserve_screen_position): Remove leading asterisks from
16181         doc-strings.
16183 2011-06-12  Paul Eggert  <eggert@cs.ucla.edu>
16185         Fix minor problems found by GCC 4.6.0 static checking.
16186         * buffer.c (Qclone_number): Remove for now, as it's unused.
16187         (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
16188         (record_buffer): Remove unused local.
16189         * frame.c (other_visible_frames, frame_buffer_list): Now static.
16190         (set_frame_buffer_list): Remove; unused.
16191         * frame.h (other_visible_frames): Remove decl.
16192         * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
16193         * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
16194         (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
16195         if HAVE_GPM.
16196         * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
16197         * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
16198         Define only if HAVE_GPM.
16199         * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
16200         (update_hints_inhibit): Remove; never set.  All uses removed.
16201         * widgetprv.h (emacsFrameClassRec): Remove decl.
16202         * window.c (delete_deletable_window): Now returns void, since it
16203         wasn't returning anything.
16204         (compare_window_configurations): Remove unused locals.
16205         * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
16206         * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
16207         (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
16208         the same widths as pointers.  This follows up on the 2011-05-06 patch.
16209         * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
16210         * xterm.h: Likewise.
16211         (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
16213 2011-06-12  Juanma Barranquero  <lekktu@gmail.com>
16215         * makefile.w32-in: Update dependencies.
16216         (LISP_H): Add lib/intprops.h.
16218 2011-06-11  Chong Yidong  <cyd@stupidchicken.com>
16220         * image.c (gif_load): Add animation frame delay to the metadata.
16221         (syms_of_image): Use DEFSYM.  New symbol `delay'.
16223 2011-06-11  Martin Rudalics  <rudalics@gmx.at>
16225         * window.c (delete_deletable_window): Re-add.
16226         (Fset_window_configuration): Rewrite to handle dead buffers and
16227         consequently deletable windows.
16228         (window_tree, Fwindow_tree): Remove.  Supply functionality in
16229         window.el.
16230         (compare_window_configurations): Simplify code.
16232 2011-06-11  Andreas Schwab  <schwab@linux-m68k.org>
16234         * image.c (imagemagick_load_image): Fix type mismatch.
16235         (Fimagemagick_types): Likewise.
16237         * window.h (replace_buffer_in_windows): Declare.
16239 2011-06-11  Martin Rudalics  <rudalics@gmx.at>
16241         * buffer.c: New Lisp objects Qbuffer_list_update_hook and
16242         Qclone_number.  Remove external declaration of Qdelete_window.
16243         (Fbuffer_list): Rewrite doc-string.  Minor restructuring of
16244         code.
16245         (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
16246         Run Qbuffer_list_update_hook if allowed.
16247         (Fother_buffer): Rewrite doc-string.  Major rewrite for new
16248         buffer list implementation.
16249         (other_buffer_safely): New function.
16250         (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
16251         calls to replace_buffer_in_windows and
16252         replace_buffer_in_windows_safely.  Run Qbuffer_list_update_hook
16253         if allowed.
16254         (record_buffer): Inhibit quitting and rewrite using quittable
16255         functions.  Run Qbuffer_list_update_hook if allowed.
16256         (Frecord_buffer, Funrecord_buffer): New functions.
16257         (switch_to_buffer_1, Fswitch_to_buffer): Remove.
16258         Move switch-to-buffer to window.el.
16259         (bury-buffer): Move to window.el.
16260         (Vbuffer_list_update_hook): New variable.
16262         * lisp.h (other_buffer_safely): Add prototype in buffer.c
16263         section.
16265         * window.h (resize_frame_windows): Move up in code.
16266         (Fwindow_frame): Remove EXFUN.
16267         (replace_buffer_in_all_windows): Remove prototype.
16268         (replace_buffer_in_windows_safely): Add prototype.
16270         * window.c: Declare Qdelete_window static again.  Move down
16271         declaration of select_count.
16272         (Fnext_window, Fprevious_window): Rewrite doc-strings.
16273         (Fother_window): Move to window.el.
16274         (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
16275         cases.  Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
16276         (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
16277         window.el.
16278         (replace_buffer_in_windows): Implement by calling
16279         Qreplace_buffer_in_windows.
16280         (replace_buffer_in_all_windows): Remove with some functionality
16281         moved into replace_buffer_in_windows_safely.
16282         (replace_buffer_in_windows_safely): New function.
16283         (select_window_norecord, select_frame_norecord): Move in front
16284         of run_window_configuration_change_hook.  Remove now obsolete
16285         declarations.
16286         (Fset_window_buffer): Rewrite doc-string.
16287         Call Qrecord_window_buffer.
16288         (keys_of_window): Move binding for other-window to window.el.
16290 2011-06-11  Chong Yidong  <cyd@stupidchicken.com>
16292         * dispextern.h (struct image): Replace data member, whose int_val
16293         and ptr_val fields were not used by anything, with a single
16294         lisp_val object.
16296         * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
16297         (gif_clear_image, gif_load, imagemagick_load_image)
16298         (gs_clear_image, gs_load): Callers changed.
16300 2011-06-10  Paul Eggert  <eggert@cs.ucla.edu>
16302         * buffer.h: Include <time.h>, for time_t.
16303         Needed to build on FreeBSD 8.2.  Problem reported by Herbert J. Skuhra.
16305         Fix minor problems found by static checking.
16307         * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
16309         Make identifiers static if they are not used in other modules.
16310         * data.c (Qcompiled_function, Qframe, Qvector):
16311         * image.c (QimageMagick, Qsvg):
16312         * minibuf.c (Qmetadata):
16313         * window.c (resize_window_check, resize_root_window): Now static.
16314         * window.h (resize_window_check, resize_root_window): Remove decls.
16316         * window.c (window_deletion_count, delete_deletable_window):
16317         Remove; unused.
16318         (window_body_lines): Now static.
16319         (Fdelete_other_windows_internal): Mark vars as initialized.
16320         Make sure 'resize_failed' is initialized.
16321         (run_window_configuration_change_hook): Rename local to avoid shadowing.
16322         (resize_window_apply): Remove unused local.
16323         * window.h (delete_deletable_window): Remove decl.
16325         * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
16326         (imagemagick_load_image): Fix pointer signedness problem by changing
16327         last arg from unsigned char * to char *.  All uses changed.
16328         Also, fix a local for similar reasons.
16329         Remove unused locals.  Remove locals to avoid shadowing.
16330         (fn_rsvg_handle_free): Remove; unused.
16331         (svg_load, svg_load_image): Fix pointer signedness problem.
16332         (imagemagick_load_image): Don't use garbage pointer image_wand.
16334         * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
16336 2011-06-10  Chong Yidong  <cyd@stupidchicken.com>
16338         * image.c (gif_load): Fix omitted cast error introduced by
16339         2011-06-06 change.
16341 2011-06-10  Martin Rudalics  <rudalics@gmx.at>
16343         * window.h (resize_proportionally, orig_total_lines)
16344         (orig_top_line): Remove from window structure.
16345         (set_window_height, set_window_width, change_window_heights)
16346         (Fdelete_window): Remove prototypes.
16347         (resize_frame_windows): Remove duplicate declaration.
16349 2011-06-10  Eli Zaretskii  <eliz@gnu.org>
16351         * window.h (resize_frame_windows, resize_window_check)
16352         (delete_deletable_window, resize_root_window)
16353         (resize_frame_windows): Declare prototypes.
16355         * window.c (resize_window_apply): Make definition be "static" to
16356         match the prototype.
16358 2011-06-10  Martin Rudalics  <rudalics@gmx.at>
16360         * window.c: Remove declarations of Qwindow_size_fixed,
16361         window_min_size_1, window_min_size_2, window_min_size,
16362         size_window, window_fixed_size_p, enlarge_window, delete_window.
16363         Remove static from declaration of Qdelete_window, it's
16364         temporarily needed by Fbury_buffer.
16365         (replace_window): Don't assign orig_top_line and
16366         orig_total_lines.
16367         (Fdelete_window, delete_window): Remove.  Window deletion is
16368         handled by window.el.
16369         (window_loop): Remove DELETE_OTHER_WINDOWS case.
16370         Replace Fdelete_window calls with calls to Qdelete_window.
16371         (Fdelete_other_windows): Remove.  Deleting other windows is
16372         handled by window.el.
16373         (window_fixed_size_p): Remove.  Fixed-sizeness of windows is
16374         handled in window.el.
16375         (window_min_size_2, window_min_size_1, window_min_size): Remove.
16376         Window minimum sizes are handled in window.el.
16377         (shrink_windows, size_window, set_window_height)
16378         (set_window_width, change_window_heights, window_height)
16379         (window_width, CURBEG, CURSIZE, enlarge_window)
16380         (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
16381         (Fenlarge_window, Fshrink_window): Remove.  Window resizing is
16382         handled in window.el.
16383         (make_dummy_parent): Rename to make_parent_window and give it a
16384         second argument horflag.
16385         (make_window): Don't set resize_proportionally any more.
16386         (Fsplit_window): Remove.  Windows are split in window.el.
16387         (save_restore_action, save_restore_orig_size)
16388         (shrink_window_lowest_first, save_restore_orig_size): Remove.
16389         Resize mini windows in window.el.
16390         (grow_mini_window, shrink_mini_window): Implement by calling
16391         Qresize_root_window_vertically, resize_window_check and
16392         resize_window_apply.
16393         (saved_window, Fset_window_configuration, save_window_save):
16394         Do not handle orig_top_line, orig_total_lines, and
16395         resize_proportionally.
16396         (window_min_height, window_min_width): Move to window.el.
16397         (keys_of_window): Move bindings for delete-other-windows,
16398         split-window, delete-window and enlarge-window to window.el.
16400         * buffer.c: Temporarily extern Qdelete_window.
16401         (Fbury_buffer): Temporarily call Qdelete_window instead of
16402         Fdelete_window (Fbury_buffer will move to window.el soon).
16404         * frame.c (set_menu_bar_lines_1): Remove code handling
16405         orig_top_line and orig_total_lines.
16407         * dispnew.c (adjust_frame_glyphs_initially): Don't use
16408         set_window_height but set heights directly.
16409         (change_frame_size_1): Use resize_frame_windows.
16411         * xdisp.c (init_xdisp): Don't use set_window_height but set
16412         heights directly.
16414         * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
16415         Use resize_frame_windows instead of change_window_heights and run
16416         run_window_configuration_change_hook.
16418         * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
16419         instead of change_window_heights and run
16420         run_window_configuration_change_hook.
16422 2011-06-09  Martin Rudalics  <rudalics@gmx.at>
16424         * window.c (replace_window): Rename second argument REPLACEMENT to
16425         NEW.  New third argument SETFLAG.  Rewrite.
16426         (delete_window, make_dummy_parent): Call replace_window with
16427         third argument 1.
16428         (window_list_1): Move down in code.
16429         (run_window_configuration_change_hook): Move set_buffer part
16430         before select_frame_norecord part in order to unwind correctly.
16431         Rename count1 to count.
16432         (recombine_windows, delete_deletable_window, resize_root_window)
16433         (Fdelete_other_windows_internal)
16434         (Frun_window_configuration_change_hook, make_parent_window)
16435         (resize_window_check, resize_window_apply, Fresize_window_apply)
16436         (resize_frame_windows, Fsplit_window_internal)
16437         (Fdelete_window_internal, Fresize_mini_window_internal):
16438         New functions.
16439         (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
16441 2011-06-08  Martin Rudalics  <rudalics@gmx.at>
16443         * window.h (window): Add some new members to window structure -
16444         normal_lines, normal_cols, new_total, new_normal, clone_number,
16445         splits, nest, prev_buffers, next_buffers.
16446         (WINDOW_TOTAL_SIZE): Move here from window.c.
16447         (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
16449         * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
16450         Remove.
16451         (make_dummy_parent): Set new members of windows structure.
16452         (make_window): Move down in code.  Handle new members of window
16453         structure.
16454         (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
16455         (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
16456         (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
16457         (Fset_window_prev_buffers, Fwindow_next_buffers)
16458         (Fset_window_next_buffers, Fset_window_clone_number):
16459         New functions.
16460         (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
16461         (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
16462         Doc-string fixes.
16463         (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
16464         Argument WINDOW can be now internal window too.
16465         (Fwindow_use_time): Move up in code.
16466         (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
16467         Rewrite doc-string.
16468         (Fset_window_configuration, saved_window)
16469         (Fcurrent_window_configuration, save_window_save): Handle new
16470         members of window structure.
16471         (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
16472         (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
16473         (syms_of_window): New Lisp objects Qrecord_window_buffer,
16474         Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
16475         Qget_mru_window, Qresize_root_window,
16476         Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
16477         Qauto_buffer_name; staticpro them.
16479 2011-06-07  Martin Rudalics  <rudalics@gmx.at>
16481         * window.c (Fwindow_total_size, Fwindow_left_column)
16482         (Fwindow_top_line, window_body_lines, Fwindow_body_size)
16483         (Fwindow_list_1): New functions.
16484         (window_box_text_cols): Replace with window_body_cols.
16485         (Fwindow_width, Fscroll_left, Fscroll_right):
16486         Use window_body_cols instead of window_box_text_cols.
16487         (delete_window, Fset_window_configuration):
16488         Call delete_all_subwindows with window as argument.
16489         (delete_all_subwindows): Take a window as argument and not a
16490         structure.  Rewrite.
16491         (window_loop): Remove handling of GET_LRU_WINDOW and
16492         GET_LARGEST_WINDOW.
16493         (Fget_lru_window, Fget_largest_window): Move to window.el.
16495         * window.h: Extern window_body_cols instead of
16496         window_box_text_cols.  delete_all_subwindows now takes a
16497         Lisp_Object as argument.
16499         * indent.c (compute_motion, Fcompute_motion):
16500         Use window_body_cols instead of window_box_text_cols.
16502         * frame.c (delete_frame): Call delete_all_subwindows with root
16503         window as argument.
16505 2011-06-07  Daniel Colascione  <dan.colascione@gmail.com>
16507         * fns.c (Fputhash): Document return value.
16509 2011-06-06  Chong Yidong  <cyd@stupidchicken.com>
16511         * image.c (gif_load): Implement gif89a spec "no disposal" method.
16513 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
16515         Cons<->int and similar integer overflow fixes (Bug#8794).
16517         Check for overflow when converting integer to cons and back.
16518         * charset.c (Fdefine_charset_internal, Fdecode_char):
16519         Use cons_to_unsigned to catch overflow.
16520         (Fencode_char): Use INTEGER_TO_CONS.
16521         * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
16522         (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
16523         * data.c (long_to_cons, cons_to_long): Remove.
16524         (cons_to_unsigned, cons_to_signed): New functions.
16525         These signal an error for invalid or out-of-range values.
16526         * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
16527         * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
16528         * font.c (Ffont_variation_glyphs):
16529         * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
16530         * lisp.h: Include <intprops.h>.
16531         (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
16532         (cons_to_signed, cons_to_unsigned): New decls.
16533         (long_to_cons, cons_to_long): Remove decls.
16534         * undo.c (record_first_change): Use INTEGER_TO_CONS.
16535         (Fprimitive_undo): Use CONS_TO_INTEGER.
16536         * xfns.c (Fx_window_property): Likewise.
16537         * xselect.c: Include <limits.h>.
16538         (x_own_selection, selection_data_to_lisp_data):
16539         Use INTEGER_TO_CONS.
16540         (x_handle_selection_request, x_handle_selection_clear)
16541         (x_get_foreign_selection, Fx_disown_selection_internal)
16542         (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
16543         (lisp_data_to_selection_data): Use cons_to_unsigned.
16544         (x_fill_property_data): Use cons_to_signed.
16545         Report values out of range.
16547         Check for buffer and string overflow more precisely.
16548         * buffer.h (BUF_BYTES_MAX): New macro.
16549         * lisp.h (STRING_BYTES_MAX): New macro.
16550         * alloc.c (Fmake_string):
16551         * character.c (string_escape_byte8):
16552         * coding.c (coding_alloc_by_realloc):
16553         * doprnt.c (doprnt):
16554         * editfns.c (Fformat):
16555         * eval.c (verror):
16556         Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
16557         since they may not be the same number.
16558         * editfns.c (Finsert_char):
16559         * fileio.c (Finsert_file_contents):
16560         Likewise for BUF_BYTES_MAX.
16562         * image.c: Use ptrdiff_t, not int, for sizes.
16563         (slurp_file): Switch from int to ptrdiff_t.
16564         All uses changed.
16565         (slurp_file): Check that file size fits in both size_t (for
16566         malloc) and ptrdiff_t (for sanity and safety).
16568         * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
16569         if b->modtime has its maximal value.
16571         * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
16573         Don't assume time_t can fit into int.
16574         * buffer.h (struct buffer.modtime): Now time_t, not int.
16575         * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
16576         * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
16578         Minor fixes for signed vs unsigned integers.
16579         * character.h (MAYBE_UNIFY_CHAR):
16580         * charset.c (maybe_unify_char):
16581         * keyboard.c (read_char, reorder_modifiers):
16582         XINT -> XFASTINT, since the integer must be nonnegative.
16583         * ftfont.c (ftfont_spec_pattern):
16584         * keymap.c (access_keymap, silly_event_symbol_error):
16585         XUINT -> XFASTINT, since the integer must be nonnegative.
16586         (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
16587         since it makes no difference and we prefer signed.
16588         * keyboard.c (record_char): Use XUINT when all the neighbors do.
16589         (access_keymap): NATNUMP -> INTEGERP, since the integer must be
16590         nonnegative.
16592 2011-06-06  Stefan Monnier  <monnier@iro.umontreal.ca>
16594         * window.h (Fwindow_frame): Declare.
16596 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
16598         * alloc.c: Simplify handling of large-request failures (Bug#8800).
16599         (SPARE_MEMORY): Always define.
16600         (LARGE_REQUEST): Remove.
16601         (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
16603 2011-06-06  Martin Rudalics  <rudalics@gmx.at>
16605         * lisp.h: Move EXFUNS for Fframe_root_window,
16606         Fframe_first_window and Fset_frame_selected_window to window.h.
16608         * window.h: Move EXFUNS for Fframe_root_window,
16609         Fframe_first_window and Fset_frame_selected_window here from
16610         lisp.h.
16612         * frame.c (Fwindow_frame, Fframe_first_window)
16613         (Fframe_root_window, Fframe_selected_window)
16614         (Fset_frame_selected_window): Move to window.c.
16615         (Factive_minibuffer_window): Move to minibuf.c.
16616         (Fother_visible_frames_p): New function.
16618         * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
16620         * window.c (decode_window, decode_any_window): Move up in code.
16621         (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
16622         (inhibit_frame_unsplittable): Remove unused variable.
16623         (Fwindow_buffer): Move up and rewrite doc-string.
16624         (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
16625         (Fwindow_prev): New functions.
16626         (Fwindow_frame): Move here from frame.c.  Accept any window as
16627         argument.
16628         (Fframe_root_window, Fframe_first_window)
16629         (Fframe_selected_window): Move here from frame.c.  Accept frame
16630         or arbitrary window as argument.  Update doc-strings.
16631         (Fminibuffer_window): Move up in code.
16632         (Fwindow_minibuffer_p): Move up in code and simplify.
16633         (Fset_frame_selected_window): Move here from frame.c.
16634         Marginal rewrite.
16635         (Fselected_window, select_window, Fselect_window): Move up in
16636         code.  Minor doc-string fixes.
16638 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
16640         * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
16641         Do not assume that spare memory exists; that assumption is valid
16642         only if SYSTEM_MALLOC.
16643         (LARGE_REQUEST): New macro, so that the issue of large requests
16644         is separated from the issue of spare memory.
16646 2011-06-05  Andreas Schwab  <schwab@linux-m68k.org>
16648         * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
16649         format.  (Bug#8806)
16651         * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
16653         * xfns.c (x_set_scroll_bar_default_width): Move declarations
16654         before statements.
16656 2011-06-05  Jan Djärv  <jan.h.d@swipnet.se>
16658         * gtkutil.c (xg_get_default_scrollbar_width): New function.
16660         * gtkutil.h: Declare xg_get_default_scrollbar_width.
16662         * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
16663         min width by calling x_set_scroll_bar_default_width (Bug#8505).
16665 2011-06-05  Juanma Barranquero  <lekktu@gmail.com>
16667         * xdisp.c (single_display_spec_intangible_p): Remove declaration.
16669 2011-06-04  Chong Yidong  <cyd@stupidchicken.com>
16671         * xselect.c (x_clipboard_manager_save): Remove redundant arg.
16672         (x_clipboard_manager_save): Add return value.
16673         (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
16674         New error handlers.
16675         (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
16676         Obey Vx_select_enable_clipboard_manager.  Catch errors in
16677         x_clipboard_manager_save (Bug#8779).
16678         (Vx_select_enable_clipboard_manager): New variable.
16679         (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
16681 2011-06-04  Dan Nicolaescu  <dann@ics.uci.edu>
16683         * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
16685 2011-06-04  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
16687         * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
16688         in the current matrix if keep_current_p is non-zero.
16690 2011-06-04  Eli Zaretskii  <eliz@gnu.org>
16692         * bidi.c (bidi_level_of_next_char): Fix last change.
16694 2011-06-03  Eli Zaretskii  <eliz@gnu.org>
16696         Support bidi reordering of text covered by display properties.
16698         * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
16699         (bidi_fetch_char, bidi_fetch_char_advance): New functions.
16700         (bidi_cache_search, bidi_cache_iterator_state)
16701         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
16702         (bidi_level_of_next_char, bidi_move_to_visually_next):
16703         Support character positions inside a run of characters covered by a
16704         display string.
16705         (bidi_paragraph_init, bidi_resolve_explicit_1)
16706         (bidi_level_of_next_char): Call bidi_fetch_char and
16707         bidi_fetch_char_advance instead of FETCH_CHAR and
16708         FETCH_CHAR_ADVANCE.
16709         (bidi_init_it): Initialize new members.
16710         (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
16711         definitions.
16712         (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
16713         instead of using explicit *_CHAR codes.
16714         (bidi_resolve_explicit, bidi_resolve_weak):
16715         Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
16716         bidirectional text is supported only in multibyte buffers.
16717         (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
16718         it to initialize the frame_window_p member of struct bidi_it.
16719         (bidi_cache_iterator_state, bidi_resolve_explicit_1)
16720         (bidi_resolve_explicit, bidi_resolve_weak)
16721         (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
16722         bidi_it->nchars is non-positive.
16723         (bidi_level_of_next_char): Don't try to lookup the cache for the
16724         next/previous character if nothing is cached there yet, or if we
16725         were just reseat()'ed to a new position.
16727         * xdisp.c (set_cursor_from_row): Set start and stop points
16728         according to the row's direction when priming the loop that looks
16729         for the glyph on which to display cursor.
16730         (single_display_spec_intangible_p): Function deleted.
16731         (display_prop_intangible_p): Reimplement to call
16732         handle_display_spec instead of single_display_spec_intangible_p.
16733         Accept 3 additional arguments needed by handle_display_spec.
16734         This fixes incorrect cursor motion across display property with complex
16735         values: lists, `(when COND...)' forms, etc.
16736         (single_display_spec_string_p): Support property values that are
16737         lists with the argument STRING its top-level element.
16738         (display_prop_string_p): Fix the condition for processing a
16739         property that is a list to be consistent with handle_display_spec.
16740         (handle_display_spec): New function, refactored from the
16741         last portion of handle_display_prop.
16742         (compute_display_string_pos): Accept additional argument
16743         FRAME_WINDOW_P.  Call handle_display_spec to determine whether the
16744         value of a `display' property is a "replacing spec".
16745         (handle_single_display_spec): Accept 2 additional arguments BUFPOS
16746         and FRAME_WINDOW_P.  If IT is NULL, don't set up the iterator from
16747         the display property, but just return a value indicating whether
16748         the display property will replace the characters it covers.
16749         (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
16750         frame_window_p members of struct bidi_it.
16751         (compute_display_string_pos, compute_display_string_end):
16752         New functions.
16753         (push_it): Accept second argument POSITION, where pop_it should
16754         jump to continue iteration.
16755         (reseat_1): Initialize bidi_it.disp_pos.
16757         * keyboard.c (adjust_point_for_property): Adjust the call to
16758         display_prop_intangible_p to its new signature.
16760         * dispextern.h (struct bidi_it): New member frame_window_p.
16761         (bidi_init_it): Update prototypes.
16762         (display_prop_intangible_p): Update prototype.
16763         (compute_display_string_pos, compute_display_string_end):
16764         Declare prototypes.
16765         (struct bidi_it): New members nchars and disp_pos.  ch_len is now
16766         EMACS_INT.
16768 2011-06-02  Paul Eggert  <eggert@cs.ucla.edu>
16770         Malloc failure behavior now depends on size of allocation.
16771         * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
16772         * lisp.h: Change signatures accordingly.
16773         * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
16774         All callers changed.  (Bug#8762)
16776         * gnutls.c: Use Emacs's memory allocators.
16777         Without this change, the gnutls library would invoke malloc etc.
16778         directly, which causes problems on non-SYNC_INPUT hosts, and which
16779         runs afoul of improving memory_full behavior.  (Bug#8761)
16780         (fn_gnutls_global_set_mem_functions): New macro or function pointer.
16781         (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
16782         xfree instead of the default malloc, realloc, free.
16783         (Fgnutls_boot): No need to check for memory allocation failure,
16784         since xmalloc does that for us.
16786         Remove arbitrary limit of 2**31 entries in hash tables.  (Bug#8771)
16787         * category.c (hash_get_category_set):
16788         * ccl.c (ccl_driver):
16789         * charset.c (Fdefine_charset_internal):
16790         * charset.h (struct charset.hash_index):
16791         * composite.c (get_composition_id, gstring_lookup_cache)
16792         (composition_gstring_put_cache):
16793         * composite.h (struct composition.hash_index):
16794         * dispextern.h (struct image.hash):
16795         * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
16796         (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
16797         (hashfn_equal, hashfn_user_defined, make_hash_table)
16798         (maybe_resize_hash_table, hash_lookup, hash_put)
16799         (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
16800         (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
16801         (Fsxhash, Fgethash, Fputhash, Fmaphash):
16802         * image.c (make_image, search_image_cache, lookup_image)
16803         (xpm_put_color_table_h):
16804         * lisp.h (struct Lisp_Hash_Table):
16805         * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
16806         * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
16807         for hashes and hash indexes, instead of 'unsigned' and 'int'.
16808         * alloc.c (allocate_vectorlike):
16809         Check for overflow in vector size calculations.
16810         * ccl.c (ccl_driver):
16811         Check for overflow when converting EMACS_INT to int.
16812         * fns.c, image.c: Remove unnecessary static decls that would otherwise
16813         need to be updated by these changes.
16814         * fns.c (make_hash_table, maybe_resize_hash_table):
16815         Check for integer overflow with large hash tables.
16816         (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
16817         Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
16818         (SXHASH_REDUCE): New macro.
16819         (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
16820         Use it instead of discarding useful hash info with large hash values.
16821         (sxhash_float): New function.
16822         (sxhash): Use it.  No more need for "& INTMASK" due to above changes.
16823         * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
16824         (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
16825         Rewrite to use FIXNUM_BITS, as this simplifies things.
16826         (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
16827         Adjust signatures to match updated version of code.
16828         (consing_since_gc): Now EMACS_INT, since a single hash table can
16829         use more than INT_MAX bytes.
16831 2011-06-01  Dan Nicolaescu  <dann@ics.uci.edu>
16833         Make it possible to build with GCC-4.6+ -O2 -flto.
16835         * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
16837 2011-06-01  Stefan Monnier  <monnier@iro.umontreal.ca>
16839         * minibuf.c (get_minibuffer, read_minibuf_unwind):
16840         Call minibuffer-inactive-mode.
16842 2011-05-31  Juanma Barranquero  <lekktu@gmail.com>
16844         * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
16845         Update dependencies.
16847 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
16849         * data.c (init_data): Remove code for UTS, this system is not
16850         supported anymore.
16852 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
16854         Don't force ./temacs to start in terminal mode.
16856         * frame.c (make_initial_frame): Initialize faces in all cases, not
16857         only when CANNOT_DUMP is defined.
16858         * dispnew.c (init_display): Remove CANNOT_DUMP condition.
16860 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
16862         * dispnew.c (add_window_display_history): Use const for the string
16863         pointer.  Remove declaration, not needed.
16865 2011-05-31  Paul Eggert  <eggert@cs.ucla.edu>
16867         Use 'inline', not 'INLINE'.
16868         <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
16869         * alloc.c, fontset.c (INLINE): Remove.
16870         * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
16871         * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
16872         * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
16873         * gmalloc.c (register_heapinfo): Use inline unconditionally.
16874         * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
16876 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
16878         Make it possible to run ./temacs.
16880         * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
16881         syms_of_callproc does the same thing.  Remove test for
16882         "initialized", do it in the caller.
16883         * emacs.c (main): Avoid calling set_initial_environment when dumping.
16885 2011-05-31  Stefan Monnier  <monnier@iro.umontreal.ca>
16887         * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
16888         (read_minibuf): Use get_minibuffer.
16889         (syms_of_minibuf): Use DEFSYM.
16890         (Qmetadata): New var.
16891         * data.c (Qbuffer): Don't make it static.
16892         (syms_of_data): Use DEFSYM.
16894 2011-05-31  Paul Eggert  <eggert@cs.ucla.edu>
16896         * ccl.c (CCL_CODE_RANGE): Allow negative numbers.  (Bug#8751)
16897         (CCL_CODE_MIN): New macro.
16899 2011-05-30  Paul Eggert  <eggert@cs.ucla.edu>
16901         * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
16903         * eval.c (Qdebug): Now static.
16904         * lisp.h (Qdebug): Remove decl.  This reverts a part of the
16905         2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
16906         2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
16908 2011-05-29  Chong Yidong  <cyd@stupidchicken.com>
16910         * image.c: Various fixes to ImageMagick code comments.
16911         (Fimagemagick_types): Doc fix.
16913 2011-05-29  Paul Eggert  <eggert@cs.ucla.edu>
16915         Minor fixes prompted by GCC 4.6.0 warnings.
16917         * xselect.c (converted_selections, conversion_fail_tag): Now static.
16919         * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
16920         (x_clipboard_manager_save_all): Move extern decl to ...
16921         * xterm.h: ... here, so that it can be checked for consistency.
16923 2011-05-29  Chong Yidong  <cyd@stupidchicken.com>
16925         * xselect.c (x_clipboard_manager_save_frame)
16926         (x_clipboard_manager_save_all): New functions.
16927         (Fx_clipboard_manager_save): Lisp function deleted.
16929         * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
16930         * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
16932         * xterm.h: Update prototype.
16934 2011-05-28  William Xu  <william.xwl@gmail.com>
16936         * nsterm.m (ns_term_shutdown): Synchronize user defaults before
16937         exiting (Bug#8239).
16939 2011-05-28  Jim Meyering  <meyering@redhat.com>
16941         Avoid a sign-extension bug in crypto_hash_function.
16942         * fns.c (to_uchar): Define.
16943         (crypto_hash_function): Use it to convert some newly-signed
16944         variables to unsigned, to avoid sign-extension bugs.  For example,
16945         without this change, (md5 "truc") would evaluate to
16946         45723a2aff78ff4fff7fff1114760e62 rather than the expected
16947         45723a2af3788c4ff17f8d1114760e62.  Reported by Antoine Levitt in
16948         https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
16950 2011-05-27  Paul Eggert  <eggert@cs.ucla.edu>
16952         Integer overflow fixes.
16954         * dbusbind.c: Serial number integer overflow fixes.
16955         (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
16956         (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
16957         to hold a serial number that is too large for a fixnum.
16958         (Fdbus_method_return_internal, Fdbus_method_error_internal):
16959         Check for serial numbers out of range.  Decode any serial number
16960         that was so large that it became a float.  (Bug#8722)
16962         * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
16963         (Fdbus_call_method, Fdbus_call_method_asynchronously):
16964         Use XFASTINT rather than XUINT when numbers are nonnegative.
16965         (xd_append_arg, Fdbus_method_return_internal):
16966         (Fdbus_method_error_internal): Likewise.  Also, for unsigned
16967         arguments, check that Lisp number is nonnegative, rather than
16968         silently wrapping negative numbers around.  (Bug#8722)
16969         (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
16970         (Bug#8722)
16972         * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
16974         * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
16976         ccl: Add integer overflow checks.
16977         * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
16978         (IN_INT_RANGE): New macros.
16979         (ccl_driver): Use them to check for integer overflow when
16980         decoding a CCL program.  Many of the new checks are whether XINT (x)
16981         fits in int; it doesn't always, on 64-bit hosts.  The new version
16982         doesn't catch all possible integer overflows, but it's an
16983         improvement.  (Bug#8719)
16985         * alloc.c (make_event_array): Use XINT, not XUINT.
16986         There's no need for unsigned here.
16988         * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
16989         This follows up to the 2011-05-06 change that substituted uintptr_t
16990         for EMACS_INT.  This case wasn't caught back then.
16992         Rework Fformat to avoid integer overflow issues.
16993         * editfns.c: Include <float.h> unconditionally, as it's everywhere
16994         now (part of C89).  Include <verify.h>.
16995         (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
16996         (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
16997         (Fformat): Avoid the prepass trying to compute sizes; it was only
16998         approximate and thus did not catch overflow reliably.  Instead, walk
16999         through the format just once, formatting and computing sizes as we go,
17000         checking for integer overflow at every step, and allocating a larger
17001         buffer as needed.  Keep track separately whether the format is
17002         multibyte.  Keep only the most-recently calculated precision, rather
17003         than them all.  Record whether each argument has been converted to
17004         string.  Use EMACS_INT, not int, for byte and char and arg counts.
17005         Support field widths and precisions larger than INT_MAX.  Avoid
17006         sprintf's undefined behavior with conversion specifications such as %#d
17007         and %.0c.  Fix bug with strchr succeeding on '\0' when looking for
17008         flags.  Fix bug with (format "%c" 256.0).  Avoid integer overflow when
17009         formatting out-of-range floating point numbers with int
17010         formats.  (Bug#8668)
17012         * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
17014         * data.c: Avoid integer truncation in expressions involving floats.
17015         * data.c: Include <intprops.h>.
17016         (arith_driver): When there's an integer overflow in an expression
17017         involving floating point, convert the integers to floating point
17018         so that the resulting value does not suffer from catastrophic
17019         integer truncation.  For example, on a 64-bit host (* 4
17020         most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
17021         Do not rely on undefined behavior after integer overflow.
17023         merge count_size_as_multibyte, parse_str_to_multibyte
17024         * character.c, character.h (count_size_as_multibyte):
17025         Rename from parse_str_to_multibyte; all uses changed.
17026         Check for integer overflow.
17027         * insdel.c, lisp.h (count_size_as_multibyte): Remove,
17028         since it's now a duplicate of the other.  This is more of
17029         a character than a buffer op, so better that it's in character.c.
17030         * fns.c, print.c: Adjust to above changes.
17032 2011-05-27  Stefan Monnier  <monnier@iro.umontreal.ca>
17034         * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
17036 2011-05-27  Paul Eggert  <eggert@cs.ucla.edu>
17038         * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
17039         (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
17040         (x_clipboard_manager_save): Now static.
17041         (Fx_clipboard_manager_save): Rename local to avoid shadowing.
17043         * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
17044         (crypto_hash_function): Now static.
17045         Fix pointer signedness problems.  Avoid unnecessary initializations.
17047 2011-05-27  Chong Yidong  <cyd@stupidchicken.com>
17049         * termhooks.h (Vselection_alist): Make it terminal-local.
17051         * terminal.c (create_terminal): Initialize it.
17053         * xselect.c: Support for clipboard managers.
17054         (Vselection_alist): Move to termhooks.h as terminal-local var.
17055         (LOCAL_SELECTION): New macro.
17056         (x_atom_to_symbol): Handle x_display_info_for_display fail case.
17057         (symbol_to_x_atom): Remove gratuitous arg.
17058         (x_handle_selection_request, lisp_data_to_selection_data)
17059         (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
17060         (x_own_selection, x_get_local_selection, x_convert_selection):
17061         New arg, specifying work frame.  Use terminal-local Vselection_alist.
17062         (some_frame_on_display): Delete unused function.
17063         (Fx_own_selection_internal, Fx_get_selection_internal)
17064         (Fx_disown_selection_internal, Fx_selection_owner_p)
17065         (Fx_selection_exists_p): New optional frame arg.
17066         (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
17067         (x_handle_selection_clear): Don't treat other terminals with the
17068         same keyboard specially.  Use the terminal-local Vselection_alist.
17069         (x_clear_frame_selections): Use Frun_hook_with_args.
17071         * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
17073         * xterm.h: Add support for those atoms.
17075 2011-05-26  Chong Yidong  <cyd@stupidchicken.com>
17077         * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
17078         (converted_selections, conversion_fail_tag): New global variables.
17079         (x_selection_request_lisp_error): Free the above.
17080         (x_get_local_selection): Remove unnecessary code.
17081         (x_reply_selection_request): Args changed; handle arbitrary array
17082         of converted selections stored in converted_selections.
17083         Separate the XChangeProperty and SelectionNotify steps.
17084         (x_handle_selection_request): Rewrite to handle MULTIPLE target.
17085         (x_convert_selection): New function.
17086         (x_handle_selection_event): Simplify.
17087         (x_get_foreign_selection): Don't ignore incoming requests while
17088         waiting for an answer; this will fail when we implement
17089         SAVE_TARGETS, and seems unnecessary anyway.
17090         (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
17091         (Vx_sent_selection_functions): Doc fix.
17093 2011-05-26  Leo Liu  <sdl.web@gmail.com>
17095         * editfns.c (Ftranspose_regions): Allow empty regions.  (Bug#8699)
17097 2011-05-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
17099         * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
17101         * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
17102         for fringe update if it has periodic bitmap.
17103         (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
17104         and fringe_bitmap_periodic_p.
17106         * fringe.c (get_fringe_bitmap_data): New function.
17107         (draw_fringe_bitmap_1, update_window_fringes): Use it.
17108         (update_window_fringes): Record periodicity of fringe bitmap in glyph
17109         row.  Mark glyph row for fringe update if periodicity changed.
17111         * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
17112         for fringe update unless it has periodic bitmap.
17114 2011-05-25  Kenichi Handa  <handa@m17n.org>
17116         * xdisp.c (get_next_display_element): Set correct it->face_id for
17117         a static composition.
17119 2011-05-24  Leo Liu  <sdl.web@gmail.com>
17121         * deps.mk (fns.o):
17122         * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
17124         * fns.c (crypto_hash_function, Fsha1): New function.
17125         (Fmd5): Use crypto_hash_function.
17126         (syms_of_fns): Add Ssha1.
17128 2011-05-22  Paul Eggert  <eggert@cs.ucla.edu>
17130         * gnutls.c: Remove unused macros.
17131         (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
17132         (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
17133         Remove macros that are defined and never used.
17134         Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
17136 2011-05-22  Chong Yidong  <cyd@stupidchicken.com>
17138         * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
17139         (Fx_get_selection_internal): Minor cleanup.
17140         (Fx_own_selection_internal): Rename arguments for consistency with
17141         select.el.
17143 2011-05-22  Paul Eggert  <eggert@cs.ucla.edu>
17145         * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
17147 2011-05-22  Chong Yidong  <cyd@stupidchicken.com>
17149         * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
17151 2011-05-21  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
17153         * dispnew.c (scrolling_window): Don't exclude the case that the
17154         last enabled row in the desired matrix touches the bottom boundary.
17156 2011-05-21  Glenn Morris  <rgm@gnu.org>
17158         * Makefile.in ($(etc)/DOC): Make second command line even shorter.
17159         (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
17160         and add some more files.
17162 2011-05-20  Eli Zaretskii  <eliz@gnu.org>
17164         * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
17165         report_file_error introduced by the change from 2011-05-07.
17167 2011-05-20  Paul Eggert  <eggert@cs.ucla.edu>
17169         * systime.h (Time): Define only if emacs is defined.
17170         This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
17171         where the include path doesn't have X11/X.h by default.  See
17172         <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
17174 2011-05-20  Kenichi Handa  <handa@m17n.org>
17176         * composite.c (find_automatic_composition): Fix previous change.
17178 2011-05-20  Glenn Morris  <rgm@gnu.org>
17180         * lisp.mk: New file, split from Makefile.in.
17181         * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
17182         (shortlisp): Remove.
17183         ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
17185 2011-05-19  Glenn Morris  <rgm@gnu.org>
17187         * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
17188         (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
17189         (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
17190         (lisp): Set the order to that of loadup.el.
17191         (shortlisp): Make it a copy of $lisp.
17192         (SOME_MACHINE_LISP): Remove.
17193         ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
17194         Use just $shortlisp, not $SOME_MACHINE_LISP too.
17196 2011-05-18  Kenichi Handa  <handa@m17n.org>
17198         * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
17199         (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
17200         (find_automatic_composition): Mostly rewrite for efficiency.
17202 2011-05-18  Juanma Barranquero  <lekktu@gmail.com>
17204         * makefile.w32-in: Update dependencies.
17206 2011-05-18  Christoph Scholtes  <cschol2112@googlemail.com>
17208         * menu.c: Include limits.h (fixes the MS-Windows build broken by
17209         2011-06-18T18:49:19Z!cyd@stupidchicken.com).
17211 2011-05-18  Paul Eggert  <eggert@cs.ucla.edu>
17213         Fix some integer overflow issues, such as string length overflow.
17215         * insdel.c (count_size_as_multibyte): Check for string overflow.
17217         * character.c (lisp_string_width): Check for string overflow.
17218         Use EMACS_INT, not int, for string indexes and lengths; in
17219         particular, 2nd arg is now EMACS_INT, not int.  Do not crash if
17220         the resulting string length overflows an EMACS_INT; instead,
17221         report a string overflow if no precision given.  When checking for
17222         precision exhaustion, use a check that cannot possibly have
17223         integer overflow.  (Bug#8675)
17224         * character.h (lisp_string_width): Adjust to new signature.
17226         * alloc.c (string_overflow): New function.
17227         (Fmake_string): Use it.  This doesn't change behavior, but saves
17228         a few bytes and will simplify future changes.
17229         * character.c (string_escape_byte8): Likewise.
17230         * lisp.h (string_overflow): New decl.
17232         Fixups, following up to the user-interface timestamp change.
17233         * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
17234         for UI timestamps, instead of unsigned long.
17235         * msdos.c (mouse_get_pos): Likewise.
17236         * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
17237         * w32gui.h (Time): Define by including "systime.h" rather than by
17238         declaring it ourselves.  (Bug#8664)
17240         * dispextern.h (struct image): Don't assume time_t <= unsigned long.
17241         * image.c (clear_image_cache): Likewise.
17243         * term.c (term_mouse_position): Don't assume time_t wraparound.
17245         Be more systematic about user-interface timestamps.
17246         Before, the code sometimes used 'Time', sometimes 'unsigned long',
17247         and sometimes 'EMACS_UINT', to represent these timestamps.
17248         This change causes it to use 'Time' uniformly, as that's what X uses.
17249         This makes the code easier to follow, and makes it easier to catch
17250         integer overflow bugs such as Bug#8664.
17251         * frame.c (Fmouse_position, Fmouse_pixel_position):
17252         Use Time, not unsigned long, for user-interface timestamps.
17253         * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
17254         (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
17255         * keyboard.h (last_event_timestamp): Likewise.
17256         * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
17257         * menu.h (xmenu_show): Likewise.
17258         * term.c (term_mouse_position): Likewise.
17259         * termhooks.h (struct input_event.timestamp): Likewise.
17260         (struct terminal.mouse_position_hook): Likewise.
17261         * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
17262         * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
17263         * systime.h (Time): New decl.  Pull it in from <X11/X.h> if
17264         HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
17265         what it was before.
17266         * menu.h, termhooks.h: Include "systime.h", for Time.
17268         * keyboard.c (make_lispy_event): Fix problem in integer overflow.
17269         Don't assume that the difference between two unsigned long values
17270         can fit into an integer.  At this point, we know button_down_time
17271         <= event->timestamp, so the difference must be nonnegative, so
17272         there's no need to cast the result if double-click-time is
17273         nonnegative, as it should be; check that it's nonnegative, just in
17274         case.  This bug is triggered when events are more than 2**31 ms
17275         apart (about 25 days).  (Bug#8664)
17277         * xselect.c (last_event_timestamp): Remove duplicate decl.
17278         (x_own_selection): Remove needless cast to unsigned long.
17280         * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
17281         that always fit in int.  Use a sentinel instead of a counter, to
17282         avoid a temp and to allay GCC's concerns about possible int overflow.
17283         * frame.h (struct frame): Use int for menu_bar_items_used
17284         instead of EMACS_INT, since it always fits in int.
17286         * menu.c (grow_menu_items): Check for int overflow.
17288         * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
17290         * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
17291         Before, the code was not consistent.  These values cannot exceed
17292         2**31 - 1 so there's no need to make them unsigned.
17293         (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
17294         (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
17295         (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
17296         as modifiers.
17297         * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
17299         * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
17300         (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
17301         Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
17302         presumably because the widths might not match.
17304         * window.c (size_window): Avoid needless test at loop start.
17306 2011-05-18  Courtney Bane  <emacs-bugs-7626@cbane.org>  (tiny change)
17308         * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
17310 2011-05-12  Drew Adams  <drew.adams@oracle.com>
17312         * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
17314 2011-05-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
17316         * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
17317         `width' to `bar_area_x' and `bar_area_width', respectively.
17318         (x_scroll_run): Take account of fringe background extension.
17320         * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
17321         Rename local vars `left' and `width' to `bar_area_x' and
17322         `bar_area_width', respectively.
17323         (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
17324         background extension.
17326 2011-05-10  Jim Meyering  <meyering@redhat.com>
17328         * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
17330 2011-05-10  Juanma Barranquero  <lekktu@gmail.com>
17332         * image.c (Finit_image_library): Return t for built-in image types,
17333         like pbm and xbm.  (Bug#8640)
17335 2011-05-09  Andreas Schwab  <schwab@linux-m68k.org>
17337         * w32menu.c (set_frame_menubar): Fix submenu allocation.
17339 2011-05-07  Eli Zaretskii  <eliz@gnu.org>
17341         * w32console.c (Fset_screen_color): Doc fix.
17342         (Fget_screen_color): New function.
17343         (syms_of_ntterm): Defsubr it.
17345         * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
17346         unlink the temporary file if Fcall_process didn't create it in the
17347         first place.
17348         (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
17349         child process will be redirected to a file specified with `:file'.
17350         Don't try to re-open tempfile in that case, and set fd[0] to -1 as
17351         cue to call_process_cleanup not to close that handle.
17353 2011-05-07  Ben Key  <bkey76@gmail.com>
17355         * makefile.w32-in: The bootstrap-temacs rule now makes use of
17356         one of two shell specific rules, either bootstrap-temacs-CMD or
17357         bootstrap-temacs-SH.  The bootstrap-temacs-SH rule is identical
17358         to the previous implementation of the bootstrap-temacs rule.
17359         The bootstrap-temacs-CMD rule is similar to the previous
17360         implementation of the bootstrap-temacs rule except that it
17361         makes use of the ESC_CFLAGS variable instead of the CFLAGS
17362         variable.
17364         These changes, along with some changes to nt/configure.bat,
17365         nt/gmake.defs, and nt/nmake.defs, are required to extend my
17366         earlier fix to add support for --cflags and --ldflags options
17367         that include quotes so that it works whether make uses cmd or
17368         sh as the shell.
17370 2011-05-06  Michael Albinus  <michael.albinus@gmx.de>
17372         * dbusbind.c (QCdbus_type_unix_fd): Declare static.
17373         (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
17374         is a constant.
17375         (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
17376         a string.  Handle both cases.
17377         (Fdbus_call_method_asynchronously, Fdbus_register_signal)
17378         (Fdbus_register_method): Use Qinvalid_function.
17380 2011-05-06  Juanma Barranquero  <lekktu@gmail.com>
17382         * makefile.w32-in: Update dependencies.
17383         (LISP_H): Add inttypes.h and stdin.h.
17384         (PROCESS_H): Add unistd.h.
17386 2011-05-06  Eli Zaretskii  <eliz@gnu.org>
17388         * lread.c: Include limits.h (fixes the MS-Windows build broken by
17389         2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
17391 2011-05-06  Paul Eggert  <eggert@cs.ucla.edu>
17393         * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
17395         * term.c (vfatal): Remove stray call to va_end.
17396         It's not needed and the C Standard doesn't allow it here anyway.
17398         Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
17399         * eval.c (verror): doprnt a copy of ap, not the original.  (Bug#8545)
17401         * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
17402         bytes.
17404         * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
17406         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
17408         * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
17410         * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
17412         * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
17414         * charset.h (struct charset.code_space): Now has 15 elements, not 16.
17415         * charset.c (Fdefine_charset_internal): Don't initialize
17416         charset.code_space[15].  The value was garbage, on hosts with
17417         32-bit int (Bug#8600).
17419         * lread.c (read_integer): Be more consistent with string-to-number.
17420         Use string_to_number to do the actual conversion; this avoids
17421         rounding errors and fixes some other screwups.  Without this fix,
17422         for example, #x1fffffffffffffff was misread as -2305843009213693952.
17423         (digit_to_number): Move earlier, for benefit of read_integer.
17424         Return -1 if the digit is out of range for the base, -2 if it is
17425         not a digit in any supported base.  (Bug#8602)
17427         * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
17429         * dispnew.c (scrolling_window): Return 1 if we scrolled,
17430         to match comment at start of function.  This also removes a
17431         GCC warning about overflow in a 32+64-bit port.
17433         * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
17435         * dbusbind.c: Do not use XPNTR on a value that may be an integer.
17436         Reported by Stefan Monnier in
17437         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
17438         (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
17439         Use SYMBOLP-guarded XSYMBOL, not XPNTR.
17441         * lisp.h (EMACS_INTPTR): Remove.  All uses changed to intptr_t.
17442         (EMACS_UINTPTR): Likewise, with uintptr_t.
17444         * lisp.h: Prefer 64-bit EMACS_INT if available.
17445         (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
17446         on 32-bit hosts that have 64-bit int, so that they can access
17447         large files.
17448         However, temporarily disable this change unless the temporary
17449         symbol WIDE_EMACS_INT is defined.
17451         * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
17453         Prefer intptr_t/uintptr_t for integers the same widths as pointers.
17454         This removes an assumption that EMACS_INT and long are the same
17455         width as pointers.  The assumption is true for Emacs porting targets
17456         now, but we want to make other targets possible.
17457         * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
17458         (EMACS_INTPTR, EMACS_UINTPTR): New macros.
17459         In the rest of the code, change types of integers that hold casted
17460         pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
17461         replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
17462         (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
17463         (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
17464         No need to cast type when ORing.
17465         (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
17466         * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
17467         * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
17468         assume EMACS_INT is the same width as char *.
17469         * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
17470         (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
17471         Remove no-longer-needed casts.
17472         (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
17473         (xg_tool_bar_help_callback, xg_make_tool_item):
17474         Use EMACS_INTPTR to hold an integer
17475         that will be cast to void *; this can avoid a GCC warning
17476         if EMACS_INT is not the same width as void *.
17477         * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
17478         * xdisp.c (display_echo_area_1, resize_mini_window_1):
17479         (current_message_1, set_message_1):
17480         Use a local to convert to proper width without a cast.
17481         * xmenu.c (dialog_selection_callback): Likewise.
17483         * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
17484         Also, don't assume VALBITS / RAND_BITS is less than 5,
17485         and don't rely on undefined behavior when shifting a 1 left into
17486         the sign bit.
17487         * lisp.h (get_random): Change signature to match.
17489         * lread.c (hash_string): Use size_t, not int, for hash computation.
17490         Normally we prefer signed values; but hashing is special, because
17491         it's better to use unsigned division on hash table sizes so that
17492         the remainder is nonnegative.  Also, size_t is the natural width
17493         for hashing into memory.  The previous code used 'int', which doesn't
17494         retain enough info to hash well into very large tables.
17495         (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
17497         * dbusbind.c: Don't possibly lose pointer info when converting.
17498         (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
17499         Use XPNTR rather than XHASH, so that the high-order bits of
17500         the pointer aren't lost when converting through void *.
17502         * eval.c (Fautoload): Don't double-shift a pointer.
17504         * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
17506 2011-05-06  Juanma Barranquero  <lekktu@gmail.com>
17508         * gnutls.c (DEF_GNUTLS_FN):
17509         * image.c (DEF_IMGLIB_FN): Make function pointers static.
17511 2011-05-05  Andreas Schwab  <schwab@linux-m68k.org>
17513         * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
17514         marker.  (Bug#8610)
17516 2011-05-05  Eli Zaretskii  <eliz@gnu.org>
17518         * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
17519         New version that can reserve upto 2GB of heap space.
17521 2011-05-05  Chong Yidong  <cyd@stupidchicken.com>
17523         * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
17525 2011-05-05  Teodor Zlatanov  <tzz@lifelogs.com>
17527         * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
17528         `gnutls_certificate_set_x509_key_file'.
17530 2011-05-05  Juanma Barranquero  <lekktu@gmail.com>
17532         * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
17533         Update dependencies.
17535 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
17537         * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
17538         * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
17539         Remove unused parameter `fildes'.
17540         * process.c (read_process_output, send_process): Don't pass it.
17542 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
17544         Fix previous change: the library cache is defined in w32.c.
17545         * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
17546         (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
17548 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
17550         Implement dynamic loading of GnuTLS on Windows.
17552         * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
17553         (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
17554         (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
17555         Declare.
17557         * gnutls.c (Qgnutls_dll): Define.
17558         (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
17559         (gnutls_*): Declare function pointers.
17560         (init_gnutls_functions): New function to initialize function pointers.
17561         (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
17562         (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
17563         (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
17564         Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
17565         (emacs_gnutls_write, emacs_gnutls_read)
17566         (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
17567         (Fgnutls_available_p): New function.
17568         (Fgnutls_boot): Call Fgnutls_available_p.  Use function pointers.
17569         (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
17570         (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
17572         * image.c: Include w32.h.
17573         (Vimage_type_cache): Delete.
17574         (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
17575         (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
17576         (w32_delayed_load): Move to w32.c.
17578         * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
17580         * w32.c (QCloaded_from, Vlibrary_cache): Define.
17581         (w32_delayed_load): Move from image.c.  When loading a library, record
17582         its filename in the :loaded-from property of the library id.
17583         (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
17584         Initialize and staticpro them.
17585         (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
17587         * process.c: Include lisp.h before w32.h, not after.
17588         (wait_reading_process_output): Call emacs_gnutls_record_check_pending
17589         instead of gnutls_record_check_pending.
17591         * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
17593 2011-05-04  Teodor Zlatanov  <tzz@lifelogs.com>
17595         * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
17596         instead of :keyfiles.  Give GnuTLS the keylist and the CRL lists
17597         as passed in.
17599 2011-05-03  Jan Djärv  <jan.h.d@swipnet.se>
17601         * xterm.c (x_set_frame_alpha): Do not set property on anything
17602         else than FRAME_X_OUTER_WINDOW (Bug#8608).
17604 2011-05-02  Juanma Barranquero  <lekktu@gmail.com>
17606         * sysdep.c (get_tty_size) [WINDOWSNT]: Implement.  (Bug#8596)
17608 2011-05-02  Juanma Barranquero  <lekktu@gmail.com>
17610         * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
17611         (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
17612         (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
17613         (gnutls_global_initialized, Qgnutls_bootprop_priority)
17614         (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
17615         (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
17616         (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
17617         (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
17618         (Qgnutls_bootprop_callbacks_verify): Make static.
17620 2011-05-01  Andreas Schwab  <schwab@linux-m68k.org>
17622         * callproc.c: Indentation fixup.
17624         * sysdep.c (wait_for_termination_1): Make static.
17625         (wait_for_termination, interruptible_wait_for_termination):
17626         Move after wait_for_termination_1.
17628 2011-05-01  Lars Magne Ingebrigtsen  <larsi@gnus.org>
17630         * sysdep.c (interruptible_wait_for_termination): New function
17631         which is like wait_for_termination, but allows keyboard
17632         interruptions.
17634         * callproc.c (Fcall_process): Add (:file "file") as an option for
17635         the STDOUT buffer.
17636         (Fcall_process_region): Ditto.
17638 2011-04-30  Eli Zaretskii  <eliz@gnu.org>
17640         * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
17641         rather than `XVECTOR (FOO)->size'.
17643         * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
17644         inttypes.h, as a gnulib replacement is used if it not available in
17645         system headers.
17647 2011-04-21  Eli Zaretskii  <eliz@gnu.org>
17649         Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
17650         * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
17651         of MOST_POSITIVE_FIXNUM.  (Bug#8528)
17653         * coding.c (coding_alloc_by_realloc): Error out if destination
17654         will grow beyond MOST_POSITIVE_FIXNUM.
17655         (decode_coding_emacs_mule): Abort if there isn't enough place in
17656         charbuf for the composition carryover bytes.  Reserve an extra
17657         space for up to 2 characters produced in a loop.
17658         (decode_coding_iso_2022): Abort if there isn't enough place in
17659         charbuf for the composition carryover bytes.
17661 2011-04-21  Eli Zaretskii  <eliz@gnu.org>
17663         * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
17664         aborting when %lld or %lll format is passed.
17665         [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
17666         %llo or %llx format is passed.  (Bug#8545)
17668         * window.c (window_scroll_line_based): Use a marker instead of
17669         simple variables to record original value of point.  (Bug#7952)
17671         * doprnt.c (doprnt): Fix the case where a multibyte sequence
17672         produced by %s or %c overflows available buffer space.  (Bug#8545)
17674 2011-04-28  Paul Eggert  <eggert@cs.ucla.edu>
17676         * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
17677         (SIZE_MAX): Move defn after all includes, as they might #define it.
17679 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
17681         * w32.c (init_environment): Warn about defaulting HOME to C:\.
17683 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
17685         * keyboard.c (Qdelayed_warnings_hook): Define.
17686         (command_loop_1): Run `delayed-warnings-hook'
17687         if Vdelayed_warnings_list is non-nil.
17688         (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
17689         (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
17691 2011-04-28  Eli Zaretskii  <eliz@gnu.org>
17693         * doprnt.c (doprnt): Don't return value smaller than the buffer
17694         size if the message was truncated.  (Bug#8545).
17696 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
17698         * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
17699         (Fx_window_property): #if-0 the whole functions, not just the bodies.
17701 2011-04-27  Paul Eggert  <eggert@cs.ucla.edu>
17703         * doprnt.c (doprnt): Support "ll" length modifier, for long long.
17705 2011-04-27  Juanma Barranquero  <lekktu@gmail.com>
17707         * makefile.w32-in: Update dependencies.
17709 2011-04-27  Eli Zaretskii  <eliz@gnu.org>
17711         Improve `doprnt' and its usage.  (Bug#8545)
17712         * doprnt.c (doprnt): Make sure `format' is never accessed beyond
17713         `format_end'.  Remove support for %l as a conversion specifier.
17714         Don't use xrealloc.  Improve diagnostics when the %l size modifier
17715         is used.  Update the commentary.
17717         * eval.c (verror): Simplify calculation of size_t.
17719         * coding.c (Ffind_operation_coding_system): Fix diagnostic error
17720         messages.
17722 2011-04-27  Yoshiaki Kasahara  <kasahara@nc.kyushu-u.ac.jp>  (tiny change)
17724         * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
17725         change.
17727 2011-04-27  Paul Eggert  <eggert@cs.ucla.edu>
17729         * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
17730         This makes this file independent of the recent pseudovector change.
17732 2011-04-26  Paul Eggert  <eggert@cs.ucla.edu>
17734         * keyboard.c (handle_user_signal): Fix pointer signedness problem.
17736         * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
17737         (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
17738         Remove unused local.
17739         (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
17741         * lisp.h: Fix a problem with aliasing and vector headers.  (Bug#8546)
17742         GCC 4.6.0 optimizes based on type-based alias analysis.
17743         For example, if b is of type struct buffer * and v of type struct
17744         Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
17745         != &v->size, and therefore "v->size = 1; b->size = 2; return
17746         v->size;" must therefore return 1.  This assumption is incorrect
17747         for Emacs, since it type-puns struct Lisp_Vector * with many other
17748         types.  To fix this problem, this patch adds a new type struct
17749         vectorlike_header that documents the constraints on layout of vectors
17750         and pseudovectors, and helps optimizing compilers not get fooled
17751         by Emacs's type punning.  It also adds the macros XSETTYPED_PVECTYPE
17752         XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
17753         * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
17754         the size member.
17755         (XSETPVECTYPE): Rewrite in terms of new macro.
17756         (XSETPVECTYPESIZE): New macro, specifying both type and size.
17757         This is a bit clearer, and further avoids the possibility of
17758         undesirable aliasing.
17759         (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
17760         (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
17761         (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
17762         since Lisp_Subr is a special case (no "next" field).
17763         (ASIZE): Now uses header.size rather than size.
17764         All previous uses of XVECTOR (foo)->size replaced to use this macro,
17765         to avoid the hassle of writing XVECTOR (foo)->header.size.
17766         (struct vectorlike_header): New type.
17767         (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
17768         object, to help avoid aliasing.
17769         (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
17770         (SUBRP): Likewise, since Lisp_Subr is a special case.
17771         * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
17772         (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
17773         (struct Lisp_Hash_Table): Combine first two members into a single
17774         struct vectorlike_header member.  All uses of "size" and "next" members
17775         changed to be "header.size" and "header.next".
17776         * buffer.h (struct buffer): Likewise.
17777         * font.h (struct font_spec, struct font_entity, struct font): Likewise.
17778         * frame.h (struct frame): Likewise.
17779         * process.h (struct Lisp_Process): Likewise.
17780         * termhooks.h (struct terminal): Likewise.
17781         * window.c (struct save_window_data, struct saved_window): Likewise.
17782         * window.h (struct window): Likewise.
17783         * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
17784         Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
17785         * buffer.c (init_buffer_once): Likewise.
17786         * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
17787         special case.
17788         * process.c (Fformat_network_address): Use local var for size,
17789         for brevity.
17791         * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
17793         Make the Lisp reader and string-to-float more consistent (Bug#8525)
17794         * data.c (atof): Remove decl; no longer used or needed.
17795         (digit_to_number): Move to lread.c.
17796         (Fstring_to_number): Use new string_to_number function, to be
17797         consistent with how the Lisp reader treats infinities and NaNs.
17798         Do not assume that floating-point numbers represent EMACS_INT
17799         without losing information; this is not true on most 64-bit hosts.
17800         Avoid double-rounding errors, by insisting on integers when
17801         parsing non-base-10 numbers, as the documentation specifies.
17802         * lisp.h (string_to_number): New decl, replacing ...
17803         (isfloat_string): Remove.
17804         * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
17805         (read1): Do not accept +. and -. as integers; this
17806         appears to have been a coding error.  Similarly, do not accept
17807         strings like +-1e0 as floating point numbers.  Do not report
17808         overflow for integer overflows unless the base is not 10 which
17809         means we have no simple and reliable way to continue.
17810         Break out the floating-point parsing into a new
17811         function string_to_number, so that Fstring_to_number parses
17812         floating point numbers consistently with the Lisp reader.
17813         (digit_to_number): Move here from data.c.  Make it static inline.
17814         (E_CHAR, EXP_INT): Remove, replacing with ...
17815         (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
17816         (string_to_number): New function, replacing isfloat_string.
17817         This function checks for valid syntax and produces the resulting
17818         Lisp float number too.  Rework it so that string-to-number
17819         no longer mishandles examples like "1.0e+".  Use strtoumax,
17820         so that overflow for non-base-10 numbers is reported only when
17821         there's no portable and simple way to convert to floating point.
17823         * textprop.c (set_text_properties_1): Rewrite for clarity,
17824         and to avoid GCC warning about integer overflow.
17826         * intervals.h (struct interval): Use EMACS_INT for members
17827         where EMACS_UINT might cause problems.  See
17828         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
17829         (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
17830         * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
17831         All uses changed.
17832         (offset_intervals): Tell GCC not to worry about length overflow
17833         when negating a negative length.
17835         * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
17836         (overrun_check_free): Likewise.
17838         * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
17839         in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
17840         word size.
17842         * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
17843         (gnutls_make_error): Rename local to avoid shadowing.
17844         (gnutls_emacs_global_deinit): ifdef out; not used.
17845         (Fgnutls_boot): Use const for pointer to readonly storage.
17846         Comment out unused local.  Fix pointer signedness problems.
17848         * lread.c (openp): Don't stuff size_t into an 'int'.
17849         Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
17850         about possible signed overflow.
17852         * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
17853         (GDK_KEY_g): Don't define if already defined.
17854         (xg_prepare_tooltip): Avoid pointer signedness problem.
17855         (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
17857         * process.c (Fnetwork_interface_info): Avoid left-shift undefined
17858         behavior with 1 << 31.  GCC 4.6.0 warns about this on 32-bit hosts.
17860         * xfns.c (Fx_window_property): Simplify a bit,
17861         to make a bit faster and to avoid GCC 4.6.0 warning.
17862         * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
17864         * fns.c (internal_equal): Don't assume size_t fits in int.
17866         * alloc.c (compact_small_strings): Tighten assertion a little.
17868         Replace pEd with more-general pI, and fix some printf arg casts.
17869         * lisp.h (pI): New macro, generalizing old pEd macro to other
17870         conversion specifiers.  For example, use "...%"pI"d..." rather
17871         than "...%"pEd"...".
17872         (pEd): Remove.  All uses replaced with similar uses of pI.
17873         * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
17874         * alloc.c (check_pure_size): Don't overflow by converting size to int.
17875         * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
17876         * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
17877         * dbusbind.c (xd_append_arg): Use pI to avoid cast.
17878         (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
17879         * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
17880         64-bit hosts.
17881         (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
17882         * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
17883         * print.c (safe_debug_print, print_object): Likewise.
17884         (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
17885         to int.
17886         Use pI instead of if-then-else-abort.  Use %p to avoid casts,
17887         avoiding the 0 flag, which is not portable.
17888         * process.c (Fmake_network_process): Use pI to avoid cast.
17889         * region-cache.c (pp_cache): Likewise.
17890         * xdisp.c (decode_mode_spec): Likewise.
17891         * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
17892         behavior on 64-bit hosts with printf arg.
17893         * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
17894         (x_stop_queuing_selection_requests): Likewise.
17895         (x_get_window_property): Don't truncate byte count to an 'int'
17896         when tracing.
17898         * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
17899         here, since it parses constructs like leading '-' and spaces,
17900         which are not wanted; and it overflows with large numbers.
17901         Instead, simply match F[0-9]+, which is what is wanted anyway.
17903         * alloc.c: Remove unportable assumptions about struct layout.
17904         (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
17905         (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
17906         (allocate_vectorlike, make_pure_vector): Use the new macros,
17907         plus offsetof, to remove unportable assumptions about struct layout.
17908         These assumptions hold on all porting targets that I know of, but
17909         they are not guaranteed, they're easy to remove, and removing them
17910         makes further changes easier.
17912         * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
17913         This doesn't fix a bug but makes the code clearer.
17914         (string_overrun_cookie): Now const.  Use initializers that
17915         don't formally overflow signed char, to avoid warnings.
17916         (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
17917         can cause Emacs to crash when string overrun checking is enabled.
17918         (allocate_buffer): Don't assume sizeof (struct buffer) is a
17919         multiple of sizeof (EMACS_INT); it need not be, if
17920         alignof(EMACS_INT) < sizeof (EMACS_INT).
17921         (check_sblock, check_string_bytes, check_string_free_list): Protoize.
17923 2011-04-26  Juanma Barranquero  <lekktu@gmail.com>
17925         * keyboard.c (QCrtl): Rename from Qrtl.  All uses changed.
17927 2011-04-26  Teodor Zlatanov  <tzz@lifelogs.com>
17929         * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
17930         supposed to be handshaking.  (Bug#8556)
17931         Reported by Paul Eggert <eggert@cs.ucla.edu>.
17933 2011-04-26  Daniel Colascione  <dan.colascione@gmail.com>
17935         * lisp.h (Qdebug): List symbol.
17936         * eval.c (Qdebug): Restore global linkage.
17937         * keyboard.c (debug-on-event): New variable.
17938         (handle_user_signal): Break into debugger when debug-on-event
17939         matches the current signal symbol.
17941 2011-04-25  Dan Nicolaescu  <dann@ics.uci.edu>
17943         * alloc.c (check_sblock, check_string_bytes)
17944         (check_string_free_list): Convert to standard C.
17946 2011-04-25  Teodor Zlatanov  <tzz@lifelogs.com>
17948         * w32.c (emacs_gnutls_push): Fix typo.
17950 2011-04-25  Eli Zaretskii  <eliz@gnu.org>
17952         * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
17953         "cast to pointer from integer of different size".
17955         Improve doprnt and its use in verror.  (Bug#8545)
17956         * doprnt.c (doprnt): Document the set of format control sequences
17957         supported by the function.  Use SAFE_ALLOCA instead of always
17958         using `alloca'.
17960         * eval.c (verror): Don't limit the buffer size at size_max-1, that
17961         is one byte too soon.  Don't use xrealloc; instead xfree and
17962         xmalloc anew.
17964 2011-04-24  Teodor Zlatanov  <tzz@lifelogs.com>
17966         * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
17967         callbacks stage.
17969         * gnutls.c: Renamed global_initialized to
17970         gnutls_global_initialized.  Added internals for the
17971         :verify-hostname-error, :verify-error, and :verify-flags
17972         parameters of `gnutls-boot' and documented those parameters in the
17973         docstring.  Start callback support.
17974         (emacs_gnutls_handshake): Add Woe32 support.  Retry handshake
17975         unless a fatal error occurred.  Call gnutls_alert_send_appropriate
17976         on error.  Return error code.
17977         (emacs_gnutls_write): Call emacs_gnutls_handle_error.
17978         (emacs_gnutls_read): Likewise.
17979         (Fgnutls_boot): Return handshake error code.
17980         (emacs_gnutls_handle_error): New function.
17981         (wsaerror_to_errno): Likewise.
17983         * w32.h (emacs_gnutls_pull): Add prototype.
17984         (emacs_gnutls_push): Likewise.
17986         * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
17987         (emacs_gnutls_push): Likewise.
17989 2011-04-24  Claudio Bley  <claudio.bley@gmail.com>  (tiny change)
17991         * process.c (wait_reading_process_output): Check if GnuTLS
17992         buffered some data internally if no FDs are set for TLS
17993         connections.
17995         * makefile.w32-in (OBJ2): Add gnutls.$(O).
17996         (LIBS): Link to USER_LIBS.
17997         ($(BLD)/gnutls.$(0)): New target.
17999 2011-04-24  Eli Zaretskii  <eliz@gnu.org>
18001         * xdisp.c (handle_single_display_spec): Rename the
18002         display_replaced_before_p argument into display_replaced_p, to
18003         make it consistent with the commentary.  Fix typos in the
18004         commentary.
18006         * textprop.c (syms_of_textprop): Remove dead code.
18007         (copy_text_properties): Delete obsolete commentary about an
18008         interface that was deleted long ago.  Fix typos in the description
18009         of arguments.
18011         * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
18012         to changes in oldXMenu/XMenu.h from 2011-04-16.
18013         <menu_help_message, prev_menu_help_message>: Constify.
18014         (IT_menu_make_room): menu->help_text is now `const char **';
18015         adjust.
18017         * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
18018         to changes in oldXMenu/XMenu.h from 2011-04-16.
18019         (struct XMenu): Declare `help_text' `const char **'.
18021         * xfaces.c <Qunspecified>: Make extern again.
18023         * syntax.c: Include sys/types.h before including regex.h, as
18024         required by POSIX.
18026         * doc.c (get_doc_string): Improve the format passed to `error'.
18028         * doprnt.c (doprnt): Improve commentary.
18030         * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
18032         * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
18033         them with etags.
18035         * makefile.w32-in (globals.h): Add a dummy recipe, to make any
18036         changes in globals.h immediately force recompilation.
18037         (TAGS): Depend on $(CURDIR)/m/intel386.h and
18038         $(CURDIR)/s/ms-w32.h.
18039         (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
18041         * character.c (Fchar_direction): Function deleted.
18042         (syms_of_character): Don't defsubr it.
18043         <char-direction-table>: Deleted.
18045 2011-04-23  Eli Zaretskii  <eliz@gnu.org>
18047         Fix doprnt so it could be used again safely in `verror'.  (Bug#8435)
18048         * doprnt.c: Include limits.h.
18049         (SIZE_MAX): New macro.
18050         (doprnt): Return a size_t value.  2nd arg is now size_t.
18051         Many local variables are now size_t instead of int or unsigned.
18052         Improve overflow protection.  Support `l' modifier for integer
18053         conversions.  Support %l conversion.  Don't assume an EMACS_INT
18054         argument for integer conversions and for %c.
18056         * lisp.h (doprnt): Restore prototype.
18058         * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
18059         $(SRC)/character.h.
18061         * Makefile.in (base_obj): Add back doprnt.o.
18063         * deps.mk (doprnt.o): Add back prerequisites.
18064         (callint.o): Depend on character.h.
18066         * eval.c (internal_lisp_condition_case): Include the handler
18067         representation in the error message.
18068         (verror): Call doprnt instead of vsnprintf.  Fix an off-by-one bug
18069         when breaking from the loop.
18071         * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
18073         * callint.c (Fcall_interactively): When displaying error message
18074         about invalid control letter, pass the character's codepoint, not
18075         a pointer to its multibyte form.  Improve display of the character
18076         in octal and display also its hex code.
18078         * character.c (char_string): Use %x to display the (unsigned)
18079         codepoint of an invalid character, to avoid displaying a bogus
18080         negative value.
18082         * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
18083         `error', not SYMBOL_NAME itself.
18085         * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
18086         character arguments to `error'.
18088         * charset.c (check_iso_charset_parameter): Fix incorrect argument
18089         to `error' in error message about FINAL_CHAR argument.  Make sure
18090         FINAL_CHAR is a character, and use %c when it is passed as
18091         argument to `error'.
18093 2011-04-23  Eli Zaretskii  <eliz@gnu.org>
18095         * s/ms-w32.h (localtime): Redirect to sys_localtime.
18097         * w32.c: Include <time.h>.
18098         (sys_localtime): New function.
18100 2011-04-23  Chong Yidong  <cyd@stupidchicken.com>
18102         * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
18104         * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
18106 2011-04-23  Samuel Thibault  <sthibault@debian.org>  (tiny change)
18108         * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
18109         zombies (Bug#8467).
18111 2011-04-19  Eli Zaretskii  <eliz@gnu.org>
18113         * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
18114         gl_state.e_property when gl_state.object is Qt.
18116         * insdel.c (make_gap_larger): Remove limitation of buffer size
18117         to <= INT_MAX.
18119 2011-04-18  Chong Yidong  <cyd@stupidchicken.com>
18121         * xdisp.c (lookup_glyphless_char_display)
18122         (produce_glyphless_glyph): Handle cons cell entry in
18123         glyphless-char-display.
18124         (Vglyphless_char_display): Document it.
18126         * term.c (produce_glyphless_glyph): Handle cons cell entry in
18127         glyphless-char-display.
18129 2011-04-17  Chong Yidong  <cyd@stupidchicken.com>
18131         * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
18133         * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
18135         * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
18136         definition for no-X builds.
18138 2011-04-16  Paul Eggert  <eggert@cs.ucla.edu>
18140         Static checks with GCC 4.6.0 and non-default toolkits.
18142         * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
18144         * process.c (keyboard_bit_set): Define only if SIGIO.
18145         (send_process_trap): Mark it with NO_RETURN if it doesn't return.
18146         (send_process): Repair possible setjmp clobbering.
18148         * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
18150         * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
18152         * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
18154         * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
18155         Define only if needed.
18157         * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
18158         by pacifying GCC about it.  Maybe it's time to retire it?
18159         * xfaces.c (USG, __TIMEVAL__): Likewise.
18161         * dispextern.h (struct redisplay_interface): Rename param
18162         to avoid shadowing.
18163         * termhooks.h (struct terminal): Likewise.
18164         * xterm.c (xembed_send_message): Likewise.
18166         * insdel.c (make_gap_smaller): Define only if
18167         USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
18169         * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
18170         it.
18172         * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
18173         so that we aren't warned about unused symbols.
18175         * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
18177         * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
18179         * xfns.c (x_real_positions): Mark locals as initialized.
18181         * xmenu.c (xmenu_show): Don't use uninitialized vars.
18183         * xterm.c: Fix problems found by static analysis with other toolkits.
18184         (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
18185         (x_dispatch_event): Declare static if USE_GTK, and
18186         define if USE_GTK || USE_X_TOOLKIT.
18187         (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
18188         * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
18189         * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
18190         if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
18192         * xmenu.c (menu_help_callback): Pointer type fixes.
18193         Use const pointers when pointing at readonly data.  Avoid pointer
18194         signedness clashes.
18195         (FALSE): Remove unused macro.
18196         (update_frame_menubar): Remove unused decl.
18198         * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
18200         * menu.c (push_submenu_start, push_submenu_end): Do not define unless
18201         USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
18202         (single_menu_item): Rename local to avoid shadowing.
18204         * keyboard.c (make_lispy_event): Remove unused local var.
18206         * frame.c, frame.h (x_get_resource_string): Bring this back, but
18207         only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
18209         * bitmaps: Change bitmaps from unsigned char back to the X11
18210         compatible char.  Avoid the old compiler warnings about
18211         out-of-range initializers by using, for example, '\xab' rather
18212         than 0xab.
18214         * xgselect.c (xgselect_initialize): Check vs interface
18215         even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
18217         * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
18219         * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
18220         to read-only memory.
18222         * fns.c (vector): Remove; this old hack is no longer needed.
18224         * xsmfns.c (create_client_leader_window): Rename shadowing arg.
18225         Remove unused var.
18226         (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
18228         * xrdb.c (x_load_resources): Omit unused local.
18230         * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
18231         (x_window): Rename locals to avoid shadowing.
18232         (USG): Use the kludged USG macro, to pacify gcc.
18234         * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
18235         (x_term_init): Remove local to avoid shadowing.
18237         * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
18239         * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
18240         USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
18242 2011-04-16  Eli Zaretskii  <eliz@gnu.org>
18244         * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
18246         Fix regex.c, syntax.c and friends for buffers > 2GB.
18247         * syntax.h (struct gl_state_s): Declare character position members
18248         EMACS_INT.
18250         * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
18252         * textprop.c (verify_interval_modification, interval_of):
18253         Declare arguments EMACS_INT.
18255         * intervals.c (adjust_intervals_for_insertion): Declare arguments
18256         EMACS_INT.
18258         * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
18260         * indent.c (Fvertical_motion): Local variable it_start is now
18261         EMACS_INT.
18263         * regex.c (re_match, re_match_2, re_match_2_internal)
18264         (bcmp_translate, regcomp, regexec, print_double_string)
18265         (group_in_compile_stack, re_search, re_search_2, regex_compile)
18266         (re_compile_pattern, re_exec): Declare arguments and local
18267         variables `size_t' and `ssize_t' and return values `regoff_t', as
18268         appropriate.
18269         (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
18270         (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
18271         <compile_stack_type>: `size' and `avail' are now `size_t'.
18273         * regex.h <regoff_t>: Use ssize_t, not int.
18274         (re_search, re_search_2, re_match, re_match_2): Arguments that
18275         specify buffer/string position and length are now ssize_t and
18276         size_t.  Return type is regoff_t.
18278 2011-04-16  Ben Key  <bkey76@gmail.com>
18280         * nsfont.m: Fixed bugs in ns_get_family and
18281         ns_descriptor_to_entity that were caused by using free to
18282         deallocate memory blocks that were allocated by xmalloc (via
18283         xstrdup).  This caused Emacs to crash when compiled with
18284         XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
18285         --enable-checking=xmallocoverrun).  xfree is now used to
18286         deallocate these memory blocks.
18288 2011-04-15  Paul Eggert  <eggert@cs.ucla.edu>
18290         * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
18292         emacs_write: Accept and return EMACS_INT for sizes.
18293         See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
18294         et seq.
18295         * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
18296         Accept and return EMACS_INT.
18297         (emacs_gnutls_write): Return the number of bytes written on
18298         partial writes.
18299         * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
18300         (emacs_read, emacs_write): Remove check for negative size, as the
18301         Emacs source code has been audited now.
18302         * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
18303         (emacs_read, emacs_write): Use it.
18304         * process.c (send_process): Adjust to the new signatures of
18305         emacs_write and emacs_gnutls_write.  Do not attempt to store
18306         a byte offset into an 'int'; it might overflow.
18307         See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
18309         * sound.c: Don't assume sizes fit in 'int'.
18310         (struct sound_device.period_size, alsa_period_size):
18311         Return EMACS_INT, not int.
18312         (struct sound_device.write, vox_write, alsa_write):
18313         Accept EMACS_INT, not int.
18314         (wav_play, au_play): Use EMACS_INT to store sizes and to
18315         record read return values.
18317 2011-04-15  Ben Key  <bkey76@gmail.com>
18319         * keyboard.c (Qundefined): Don't declare static since it is used
18320         in nsfns.m.
18321         * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
18322         static since they are used in nsfont.m.
18324 2011-04-15  Stefan Monnier  <monnier@iro.umontreal.ca>
18326         * process.c (Qprocessp): Don't declare static.
18327         * lisp.h (Qprocessp): Declare again.
18329 2011-04-15  Juanma Barranquero  <lekktu@gmail.com>
18331         * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
18333 2011-04-14  Paul Eggert  <eggert@cs.ucla.edu>
18335         Improve C-level modularity by making more things 'static'.
18337         Don't publish debugger-only interfaces to other modules.
18338         * lisp.h (safe_debug_print, debug_output_compilation_hack):
18339         (verify_bytepos, count_markers): Move decls to the only modules
18340         that need them.
18341         * region-cache.h (pp_cache): Likewise.
18342         * window.h (check_all_windows): Likewise.
18343         * marker.c, print.c, region-cache.c, window.c: Decls moved here.
18345         * sysdep.c (croak): Now static, if
18346         defined TIOCNOTTY || defined USG5 || defined CYGWIN.
18347         * syssignal.h (croak): Declare only if not static.
18349         * alloc.c (refill_memory_reserve): Now static if
18350         !defined REL_ALLOC || defined SYSTEM_MALLOC.
18351         * lisp.h (refill_memory_reserve): Declare only if not static.
18353         * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
18354         Define only if USE_LUCID.
18356         * xrdb.c (x_customization_string, x_rm_string): Now static.
18358         * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
18359         * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
18361         * xdisp.c (draw_row_with_mouse_face): Now static.
18362         * dispextern.h (draw_row_with_mouse_fave): Remove decl.
18364         * window.h (check_all_windows): Mark externally visible.
18366         * window.c (window_deletion_count): Now static.
18368         * undo.c: Make symbols static if they're not exported.
18369         (last_undo_buffer, last_boundary_position, pending_boundary):
18370         Now static.
18372         * textprop.c (interval_insert_behind_hooks): Now static.
18373         (interval_insert_in_front_hooks): Likewise.
18375         * term.c: Make symbols static if they're not exported.
18376         (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
18377         (max_frame_lines, tty_set_terminal_modes):
18378         (tty_reset_terminal_modes, tty_turn_off_highlight):
18379         (get_tty_terminal): Now static.
18380         (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
18381         * termhooks.h (term_mouse_moveto): Do not declare if
18382         HAVE_WINDOW_SYSTEM.
18383         * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
18384         (tty_turn_off_highlight, get_tty_terminal): Remove decls.
18386         * sysdep.c: Make symbols static if they're not exported.
18387         (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
18388         Now static.
18389         (sigprocmask_set, full_mask): Remove; unused.
18390         (wait_debugging): Mark as visible.
18391         * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
18392         * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
18394         * syntax.c (syntax_temp): Define only if !__GNUC__.
18396         * sound.c (current_sound_device, current_sound): Now static.
18398         * search.c (searchbufs, searchbuf_head): Now static.
18400         * scroll.c (scroll_cost): Remove; unused.
18401         * dispextern.h (scroll_cost): Remove decl.
18403         * region-cache.h (pp_cache): Mark as externally visible.
18405         * process.c: Make symbols static if they're not exported.
18406         (process_tick, update_tick, create_process, chan_process):
18407         (Vprocess_alist, proc_buffered_char, datagram_access):
18408         (fd_callback_data, send_process_frame, process_sent_to): Now static.
18409         (deactivate_process): Mark defn as static, as well as decl.
18410         * lisp.h (create_process): Remove decl.
18411         * process.h (chan_process, Vprocess_alist): Remove decls.
18413         * print.c: Make symbols static if they're not exported.
18414         (print_depth, new_backquote_output, being_printed, print_buffer):
18415         (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
18416         (print_interval, print_number_index, initial_stderr_stream):
18417         Now static.
18418         * lisp.h (Fprinc): Remove decl.
18419         (debug_output_compilation_hack): Mark as externally visible.
18421         * sysdep.c (croak): Move decl from here to syssignal.h.
18422         * syssignal.h (croak): Put it here, so the API can be checked when
18423         'croak' is called from dissociate_if_controlling_tty.
18425         * minibuf.c: Make symbols static if they're not exported.
18426         (minibuf_save_list, choose_minibuf_frame): Now static.
18427         * lisp.h (choose_minibuf_frame): Remove decl.
18429         * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
18431         * lread.c: Make symbols static if they're not exported.
18432         (read_objects, initial_obarray, oblookup_last_bucket_number):
18433         Now static.
18434         (make_symbol): Remove; unused.
18435         * lisp.h (initial_obarray, make_symbol): Remove decls.
18437         * keyboard.c: Make symbols static if they're not exported.
18438         (single_kboard, recent_keys_index, total_keys, recent_keys):
18439         (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
18440         (this_single_command_key_start, echoing, last_auto_save):
18441         (read_key_sequence_cmd, dribble, recursive_edit_unwind):
18442         (command_loop, echo_now, keyboard_init_hook, help_char_p):
18443         (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
18444         (Vlispy_mouse_stem, double_click_count):
18445         Now static.
18446         (force_auto_save_soon): Define only if SIGDANGER.
18447         (ignore_mouse_drag_p): Now static if
18448         !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
18449         (print_help): Remove; unused.
18450         (stop_character, last_timer_event): Mark as externally visible.
18451         * keyboard.h (ignore_mouse_drag_p): Declare only if
18452         defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
18453         (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
18454         * lisp.h (echoing): Remove decl.
18455         (force_auto_save_soon): Declare only if SIGDANGER.
18456         * xdisp.c (redisplay_window): Simplify code, to make it more
18457         obvious that ignore_mouse_drag_p is not accessed if !defined
18458         USE_GTK && !defined HAVE_NS.
18460         * intervals.c: Make symbols static if they're not exported.
18461         (merge_properties_sticky, merge_interval_right, delete_interval):
18462         Now static.
18463         * intervals.h (merge_interval_right, delete_interval): Remove decls.
18465         * insdel.c: Make symbols static if they're not exported.
18466         However, leave prepare_to_modify_buffer alone.  It's never
18467         called from outside this function, but that appears to be a bug.
18468         (combine_after_change_list, combine_after_change_buffer):
18469         (adjust_after_replace, signal_before_change): Now static.
18470         (adjust_after_replace_noundo): Remove; unused.
18471         * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
18472         (signal_before_change): Remove decls.
18474         * indent.c (val_compute_motion, val_vmotion): Now static.
18476         * image.c: Make symbols static if they're not exported.
18477         * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
18478         if USE_GTK.
18479         * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
18480         (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
18482         * fringe.c (standard_bitmaps): Now static.
18483         (max_used_fringe_bitmap): Now static, unless HAVE_NS.
18485         * frame.c: Make symbols static if they're not exported.
18486         (x_report_frame_params, make_terminal_frame): Now static.
18487         (get_frame_param): Now static, unless HAVE_NS.
18488         (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
18489         (x_get_resource_string): Remove; not used.
18490         * frame.h (make_terminal_frame, x_report_frame_params):
18491         (x_get_resource_string); Remove decls.
18492         (x_fullscreen_adjust): Declare only if WINDOWSNT.
18493         * lisp.h (get_frame_param): Declare only if HAVE_NS.
18495         * font.c, fontset.c: Make symbols static if they're not exported.
18496         * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
18497         (FACE_SUITABLE_FOR_CHAR_P): Use it.
18498         * font.c (font_close_object): Now static.
18499         * font.h (font_close_object): Remove.
18500         * fontset.c (FONTSET_OBJLIST): Remove.
18501         (free_realized_fontset) #if-0 the body, which does nothing.
18502         (face_suitable_for_char_p): #if-0, as it's never called.
18503         * fontset.h (face_suitable_for_char_p): Remove decl.
18504         * xfaces.c (face_at_string_position):
18505         Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
18506         since 0 is always ASCII.
18508         * fns.c (weak_hash_tables): Now static.
18510         * fileio.c: Make symbols static if they're not exported.
18511         (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
18512         (Vwrite_region_annotation_buffers): Now static.
18514         * eval.c: Make symbols static if they're not exported.
18515         (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
18516         * lisp.h (backtrace_list): Remove decl.
18518         * emacs.c: Make symbols static if they're not exported.
18519         (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
18520         (fatal_error_code, fatal_error_signal_hook, standard_args):
18521         Now static.
18522         (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
18523         (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
18524         (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
18525         * lisp.h (fatal_error_signal_hook): Remove decl.
18526         (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
18528         * editfns.c: Move a (normally-unused) function to its only use.
18529         * editfns.c, lisp.h (get_operating_system_release): Remove.
18530         * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
18531         worth the hassle of breaking this out.
18533         * xterm.c: Make symbols static if they're not exported.
18534         (x_raise_frame, x_lower_frame, x_wm_set_window_state):
18535         (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
18536         (x_destroy_window, x_delete_display):
18537         Now static.
18538         (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
18539         (x_mouse_leave): Remove; unused.
18540         * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
18541         (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
18542         (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
18543         Remove decls.
18544         (x_mouse_leave): Declare only if WINDOWSNT.
18545         (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
18546         (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
18547         USE_X_TOOLKIT.
18549         * ftxfont.c: Make symbols static if they're not exported.
18550         (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
18551         HAVE_FREETYPE.
18552         * font.h (ftxfont_driver): Likewise.
18554         * xfns.c: Make symbols static if they're not exported.
18555         (x_last_font_name, x_display_info_for_name):
18556         (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
18557         (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
18558         (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
18559         (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
18560         (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
18561         (last_show_tip_args): Now static.
18562         (xic_defaut_fontset, xic_create_fontsetname): Define only if
18563         defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
18564         (x_screen_planes): Remove; unused.
18565         * dispextern.h (x_screen_planes): Remove decl.
18567         * dispnew.c: Make symbols static if they're not exported.
18568         * dispextern.h (redraw_garbaged_frames, scrolling):
18569         (increment_row_positions): Remove.
18570         * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
18571         (delayed_size_change, glyph_matrix_count, glyph_pool_count):
18572         Now static.
18573         (redraw_garbaged_frames): Remove; unused.
18575         * xfaces.c: Make symbols static if they're not exported.
18576         * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
18577         Remove decls.
18578         * xterm.h (defined_color): Remove decls.
18579         (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
18580         * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
18581         (menu_face_changed_default, defined_color, free_realized_face):
18582         (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
18583         (ascii_face_of_lisp_face): Remove; unused.
18585         * xdisp.c: Make symbols static if they're not exported.
18586         * dispextern.h (scratch_glyph_row, window_box_edges):
18587         (glyph_to_pixel_coords, set_cursor_from_row):
18588         (get_next_display_element, set_iterator_to_next):
18589         (highlight_trailing_whitespace, frame_to_window_pixel_xy):
18590         (show_mouse_face): Remove decls
18591         * frame.h (message_buf_print): Likewise.
18592         * lisp.h (pop_message, set_message, check_point_in_composition):
18593         Likewise.
18594         * xterm.h (set_vertical_scroll_bar): Likewise.
18595         * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
18596         (message_buf_print, scratch_glyph_row, displayed_buffer):
18597         (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
18598         (get_next_display_element, show_mouse_face, window_box_edges):
18599         (frame_to_window_pixel_xy, check_point_in_composition):
18600         (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
18601         (glyph_to_pixel_coords): Remove; unused.
18603         * dired.c (file_name_completion): Now static.
18605         * dbusbind.c (xd_in_read_queued_messages): Now static.
18607         * lisp.h (circular_list_error, FOREACH): Remove; unused.
18608         * data.c (circular_list_error): Remove.
18610         * commands.h (last_point_position, last_point_position_buffer):
18611         (last_point_position_window): Remove decls.
18612         * keyboard.c: Make these variables static.
18614         * coding.h (coding, code_convert_region, encode_coding_gap):
18615         Remove decls.
18616         * coding.c (Vsjis_coding_system, Vbig5_coding_system):
18617         (iso_code_class, detect_coding, code_convert_region): Now static.
18618         (encode_coding_gap): Remove; unused.
18620         * chartab.c (chartab_chars, chartab_bits): Now static.
18622         * charset.h (charset_iso_8859_1): Remove decl.
18623         * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
18624         Now static.
18626         * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
18627         * ccl.c (Vccl_program_table): Now static.
18628         (check_ccl_update): Remove; unused.
18630         * category.c (SET_CATEGORY_SET, set_category_set): Move here.
18631         * category.h: ... from here.
18632         * category.c (check_category_table, set_category_set): Now static.
18634         * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
18635         * lisp.h: Remove these decls.
18637         * buffer.c (buffer_count): Remove unused var.
18639         * bidi.c (bidi_dump_cached_states): Mark as externally visible,
18640         so that it's not optimized away.
18641         (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
18642         * dispextern.h (bidi_dump_cached_states): Remove, since it's
18643         exported only to the debugger.
18645         * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
18646         * atimer.h (run_all_atimers): Remove; not exported.
18648         font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
18649         * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
18650         was inaccessible from Lisp.
18651         (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
18652         * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
18654         alloc.c: Import and export fewer symbols, and remove unused items.
18655         * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
18656         is defined.
18657         (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
18658         it's not optimized away by whole-program optimization.
18659         (message_enable_multibyte, free_misc): Remove.
18660         (catchlist, handlerlist, mark_backtrace):
18661         Declare only if BYTE_MARK_STACK.
18662         (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
18663         * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
18664         (message_enable_multibyte): Remove decl.
18665         (free_misc, interval_free_list, float_block, float_block_index):
18666         (n_float_blocks, float_free_list, cons_block, cons_block_index):
18667         (cons_free_list, last_marked_index):
18668         Now static.
18669         (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
18670         * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
18671         (mark_backtrace): Define only if BYTE_MARK_STACK.
18672         * xdisp.c (message_enable_multibyte): Now static.
18674         Declare Lisp_Object Q* variables to be 'static' if not exported.
18675         This makes it easier for human readers (and static analyzers)
18676         to see whether these variables are used from other modules.
18677         * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
18678         * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
18679         * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
18680         * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
18681         * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
18682         * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
18683         * xmenu.c, xselect.c:
18684         Declare Q* vars static if they are not used in other modules.
18685         * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
18686         * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
18687         Remove decls of unexported vars.
18688         * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
18690         * lisp.h (DEFINE_FUNC): Make sname 'static'.
18692         Make Emacs functions such as Fatom 'static' by default.
18693         This makes it easier for human readers (and static analyzers)
18694         to see whether these functions can be called from other modules.
18695         DEFUN now defines a static function.  To make the function external
18696         so that it can be used in other C modules, use the new macro DEFUE.
18697         * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
18698         (Finit_image_library):
18699         (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
18700         (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
18701         (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
18702         Remove decls, since these functions are now static.
18703         (Funintern, Fget_internal_run_time): New decls, since these functions
18704         were already external.
18706         * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
18707         * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
18708         * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
18709         * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
18710         * keyboard.c, keymap.c, lread.c:
18711         * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
18712         * syntax.c, term.c, terminal.c, textprop.c, undo.c:
18713         * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
18714         Mark functions with DEFUE instead of DEFUN,
18715         if they are used in other modules.
18716         * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
18717         decls for now-static functions.
18718         * buffer.h (Fdelete_overlay): Remove decl.
18719         * callproc.c (Fgetenv_internal): Mark as internal.
18720         * composite.c (Fremove_list_of_text_properties): Remove decl.
18721         (Fcomposition_get_gstring): New forward static decl.
18722         * composite.h (Fcomposite_get_gstring): Remove decl.
18723         * dired.c (Ffile_attributes): New forward static decl.
18724         * doc.c (Fdocumntation_property): New forward static decl.
18725         * eval.c (Ffetch_bytecode): New forward static decl.
18726         (Funintern): Remove extern decl; now in .h file where it belongs.
18727         * fileio.c (Fmake_symbolic_link): New forward static decl.
18728         * image.c (Finit_image_library): New forward static decl.
18729         * insdel.c (Fcombine_after_change_execute): Make forward decl static.
18730         * intervals.h (Fprevious_property_change):
18731         (Fremove_list_of_text_properties): Remove decls.
18732         * keyboard.c (Fthis_command_keys): Remove decl.
18733         (Fcommand_execute): New forward static decl.
18734         * keymap.c (Flookup_key): New forward static decl.
18735         (Fcopy_keymap): Now static.
18736         * keymap.h (Flookup_key): Remove decl.
18737         * process.c (Fget_process): New forward static decl.
18738         (Fprocess_datagram_address): Mark as internal.
18739         * syntax.c (Fsyntax_table_p): New forward static decl.
18740         (skip_chars): Remove duplicate decl.
18741         * textprop.c (Fprevious_property_change): New forward static decl.
18742         * window.c (Fset_window_fringes, Fset_window_scroll_bars):
18743         Now internal.
18744         (Fset_window_margins, Fset_window_vscroll): New forward static decls.
18745         * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
18747         * editfns.c (Fformat): Remove unreachable code.
18749 2011-04-14  Andreas Schwab  <schwab@linux-m68k.org>
18751         * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
18752         change.  (Bug#8496)
18754 2011-04-13  Eli Zaretskii  <eliz@gnu.org>
18756         * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
18757         when at ZV.  (Bug#8487)
18759 2011-04-12  Andreas Schwab  <schwab@linux-m68k.org>
18761         * charset.c (Fclear_charset_maps): Use xfree instead of free.
18762         (Bug#8437)
18763         * keyboard.c (parse_tool_bar_item): Likewise.
18764         * sound.c (sound_cleanup, alsa_close): Likewise.
18765         * termcap.c (tgetent): Likewise.
18766         * xfns.c (x_default_font_parameter): Likewise.
18767         * xsettings.c (read_and_apply_settings): Likewise.
18769         * alloc.c (overrun_check_malloc, overrun_check_realloc)
18770         (overrun_check_free): Protoize.
18772 2011-04-12  Paul Eggert  <eggert@cs.ucla.edu>
18774         * sysdep.c (emacs_read, emacs_write): Check for negative sizes
18775         since callers should never pass a negative size.
18776         Change the signature to match that of plain 'read' and 'write'; see
18777         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
18778         * lisp.h: Update prototypes of emacs_write and emacs_read.
18780 2011-04-11  Eli Zaretskii  <eliz@gnu.org>
18782         * xdisp.c (redisplay_window): Don't try to determine the character
18783         position of the scroll margin if the window start point w->startp
18784         is outside the buffer's accessible region.  (Bug#8468)
18786 2011-04-10  Eli Zaretskii  <eliz@gnu.org>
18788         Fix write-region and its subroutines for buffers > 2GB.
18789         * fileio.c (a_write, e_write): Modify declaration of arguments and
18790         local variables to support buffers larger than 2GB.
18791         (Fcopy_file): Use EMACS_INT for return value of emacs_read.
18793         * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
18794         argument, local variables, and return value.
18796         * lisp.h: Update prototypes of emacs_write and emacs_read.
18798         * sound.c (vox_write): Use ssize_t for return value of emacs_write.
18800 2011-04-10  Paul Eggert  <eggert@cs.ucla.edu>
18802         * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
18804         Fix more problems found by GCC 4.6.0's static checks.
18806         * xdisp.c (vmessage): Use a better test for character truncation.
18808         * charset.c (load_charset_map): <, not <=, for optimization,
18809         and to avoid potential problems with integer overflow.
18810         * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
18811         * casetab.c (set_identity, shuffle): Likewise.
18812         * editfns.c (Fformat): Likewise.
18813         * syntax.c (skip_chars): Likewise.
18815         * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
18816         This also lets GCC 4.6.0 generate slightly better loop code.
18818         * callint.c (Fcall_interactively): <, not <=, for optimization.
18819         (Fcall_interactively): Count the number of arguments produced,
18820         not the number of arguments given.  This is simpler and lets GCC
18821         4.6.0 generate slightly better code.
18823         * ftfont.c: Distingish more carefully between FcChar8 and char.
18824         The previous code passed unsigned char * to a functions like
18825         strlen and xstrcasecmp that expect char *, which does not
18826         conform to the C standard.
18827         (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
18828         arguments to FcPatternGetString, and explicitly cast FcChar8 * to
18829         char * when the C standard requires it.
18831         * keyboard.c (read_char): Remove unused var.
18833         * eval.c: Port to Windows vsnprintf (Bug#8435).
18834         Include <limits.h>.
18835         (SIZE_MAX): Define if the headers do not.
18836         (verror): Do not give up if vsnprintf returns a negative count.
18837         Instead, grow the buffer.  This ports to Windows vsnprintf, which
18838         does not conform to C99.  Problem reported by Eli Zaretskii.
18839         Also, simplify the allocation scheme, by avoiding the need for
18840         calling realloc, and removing the ALLOCATED variable.
18842         * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
18844         Remove invocations of doprnt, as Emacs now uses vsnprintf.
18845         But keep the doprint source code for now, as we might revamp it
18846         and use it again (Bug#8435).
18847         * lisp.h (doprnt): Remove.
18848         * Makefile.in (base_obj): Remove doprnt.o.
18849         * deps.mk (doprnt.o): Remove.
18851         error: Print 32- and 64-bit integers portably (Bug#8435).
18852         Without this change, on typical 64-bit hosts error ("...%d...", N)
18853         was used to print both 32- and 64-bit integers N, which relied on
18854         undefined behavior.
18855         * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
18856         * lisp.h (error, verror): Mark as printf-like functions.
18857         * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
18858         Report overflow in size calculations when allocating printf buffer.
18859         Do not truncate output string at its first null byte.
18860         * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
18861         Truncate the output at a character boundary, since vsnprintf does not
18862         do that.
18863         * charset.c (check_iso_charset_parameter): Convert internal
18864         character to string before calling 'error', since %c now has the
18865         printf meaning.
18866         * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
18867         overflow when computing char to be passed to 'error'.  Do not
18868         pass Lisp_Object to 'error'; pass the integer instead.
18869         * nsfns.m (Fns_do_applescript): Use int, not long, since it's
18870         formatted with plain %d.
18872         * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
18874         * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
18876         * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
18878         * xterm.c (x_catch_errors): Remove duplicate declaration.
18880         * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
18882         * xdisp.c, lisp.h (message_nolog): Remove; unused.
18884 2011-04-10  Jim Meyering  <meyering@redhat.com>
18886         use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
18887         * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
18888         return ssize_t not "int", and use size_t as the buffer length.
18889         (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
18890         * gnutls.h: Update declarations.
18891         * process.c (read_process_output): Use ssize_t, to match.
18892         (send_process): Likewise.
18894 2011-04-09  Chong Yidong  <cyd@stupidchicken.com>
18896         * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
18898 2011-04-09  Chong Yidong  <cyd@stupidchicken.com>
18900         * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
18901         Use unsigned char, to match FcChar8 type definition.
18903         * xterm.c (handle_one_xevent):
18904         * xmenu.c (create_and_show_popup_menu):
18905         * xselect.c (x_decline_selection_request)
18906         (x_reply_selection_request): Avoid type-punned deref of X events.
18908 2011-04-09  Eli Zaretskii  <eliz@gnu.org>
18910         Fix some uses of `int' instead of EMACS_INT.
18911         * search.c (string_match_1, fast_string_match)
18912         (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
18913         (scan_buffer, find_next_newline_no_quit)
18914         (find_before_next_newline, search_command, Freplace_match)
18915         (Fmatch_data): Make some `int' variables be EMACS_INT.
18917         * xdisp.c (display_count_lines): 3rd argument and return value now
18918         EMACS_INT.  All callers changed.
18919         (pint2hrstr): Last argument is now EMACS_INT.
18921         * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
18922         (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
18923         (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
18924         (decode_coding_utf_16, decode_coding_emacs_mule)
18925         (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
18926         (decode_coding_ccl, decode_coding_charset)
18927         <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
18928         (decode_coding_iso_2022, decode_coding_emacs_mule)
18929         (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
18930         <char_offset, last_offset>: Declare EMACS_INT.
18931         (encode_coding_utf_8, encode_coding_utf_16)
18932         (encode_coding_emacs_mule, encode_invocation_designation)
18933         (encode_designation_at_bol, encode_coding_iso_2022)
18934         (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
18935         (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
18936         Declare EMACS_INT.
18937         (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
18938         (encode_invocation_designation): Last argument P_NCHARS is now
18939         EMACS_INT.
18940         (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
18941         (produce_chars): from_nchars and to_nchars are now EMACS_INT.
18943         * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
18944         All users changed.
18946         * ccl.c (Fccl_execute_on_string): Declare some variables
18947         EMACS_INT.
18949 2011-04-08  Samuel Thibault  <sthibault@debian.org>  (tiny change)
18951         * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
18953 2011-03-19  Christoph Scholtes  <cschol2112@googlemail.com>
18955         * process.c (Fformat_network_address): Doc fix.
18957 2011-04-08  T.V. Raman  <tv.raman.tv@gmail.com>  (tiny change)
18959         * xml.c (parse_region): Avoid creating spurious whitespace nodes.
18961 2011-04-08  Chong Yidong  <cyd@stupidchicken.com>
18963         * keyboard.c (read_char): Call Lisp function help-form-show,
18964         instead of using internal_with_output_to_temp_buffer.
18965         (Qhelp_form_show): New var.
18966         (syms_of_keyboard): Use DEFSYM macro.
18968         * print.c (internal_with_output_to_temp_buffer): Function deleted.
18970         * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
18972 2011-04-06  Chong Yidong  <cyd@stupidchicken.com>
18974         * process.c (Flist_processes): Remove to Lisp.
18975         (list_processes_1): Delete.
18977 2011-04-06  Eli Zaretskii  <eliz@gnu.org>
18979         * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
18981         * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
18983 2011-04-06  Paul Eggert  <eggert@cs.ucla.edu>
18985         Fix more problems found by GCC 4.6.0's static checks.
18987         * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
18989         * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
18991         * lisp.h (message, message_nolog, fatal): Mark as printf-like.
18993         * xdisp.c (vmessage): Mark as a printf-like function.
18995         * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
18997         * sound.c (sound_warning): Don't crash if arg contains a printf format.
18999         * image.c (tiff_error_handler, tiff_warning_handler): Mark as
19000         printf-like functions.
19001         (tiff_load): Add casts to remove these marks before passing them
19002         to system-supplied API.
19004         * eval.c (Fsignal): Remove excess argument to 'fatal'.
19006         * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
19007         This avoids several warnings with gcc -Wstrict-overflow.
19008         (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
19009         directly, rather than having caller test rule sign.  This avoids
19010         some unnecessary tests.
19011         * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
19012         (COMPOSITION_ENCODE_RULE): Arguments now must be valid.  This
19013         affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
19015         * xfont.c (xfont_text_extents): Remove var that was set but not used.
19016         (xfont_open): Avoid unnecessary tests.
19018         * composite.c (composition_gstring_put_cache): Use unsigned integer.
19020         * composite.h, composite.c (composition_gstring_put_cache):
19021         Use EMACS_INT, not int, for length.
19023         * composite.h (COMPOSITION_DECODE_REFS): New macro,
19024         breaking out part of COMPOSITION_DECODE_RULE.
19025         (COMPOSITION_DECODE_RULE): Use it.
19026         * composite.c (get_composition_id): Remove unused local vars,
19027         by using the new macro.
19029         * textprop.c (set_text_properties_1): Change while to do-while,
19030         since the condition is always true at first.
19032         * intervals.c (graft_intervals_into_buffer): Mark var as used.
19033         (interval_deletion_adjustment): Return unsigned value.
19034         All uses changed.
19036         * process.c (list_processes_1, create_pty, read_process_output):
19037         (exec_sentinel): Remove vars that were set but not used.
19038         (create_pty): Remove unnecessary "volatile"s.
19039         (Fnetwork_interface_info): Avoid possibility of int overflow.
19040         (read_process_output): Do adaptive read buffering even if carryover.
19041         (read_process_output): Simplify nbytes computation if buffered.
19043         * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
19045         * syntax.c (scan_words): Remove var that was set but not used.
19046         (update_syntax_table): Use unsigned instead of int.
19048         * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
19049         (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
19050         (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
19052         * print.c (print_error_message): Avoid int overflow.
19054         * font.c (font_list_entities): Redo for clarity,
19055         so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
19057         * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
19058         (font_score): Avoid potential overflow in diff calculation.
19060         * fns.c (substring_both): Remove var that is set but not used.
19061         (sxhash): Redo loop for clarity and to avoid wraparound warning.
19063         * eval.c (funcall_lambda): Rename local to avoid shadowing.
19065         * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
19066         Otherwise, GCC 4.6.0 optimizes the loop check away since the check
19067         can always succeed if overflow has undefined behavior.
19069         * search.c (boyer_moore, wordify): Remove vars set but not used.
19070         (wordify): Omit three unnecessary tests.
19072         * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
19073         All callers changed.  This avoids the need for an unused var.
19075         * casefiddle.c (casify_region): Remove var that is set but not used.
19077         * dired.c (file_name_completion): Remove var that is set but not used.
19079         * fileio.c (Finsert_file_contents): Make EOF condition clearer.
19081         * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
19082         (Finsert_file_contents): Remove unnecessary code checking fd.
19084         * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
19085         Check for integer overflow on size calculations.
19087         * buffer.c (Fprevious_overlay_change): Remove var that is set
19088         but not used.
19090         * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
19091         Remove vars that are set but not used.
19092         (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
19093         (timer_check_2): Mark vars as initialized.
19095         * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
19097         * image.c (lookup_image): Remove var that is set but not used.
19098         (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
19100         * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
19101         that are set but not used.
19103         * xfns.c (make_invisible_cursor): Don't return garbage
19104         if XCreateBitmapFromData fails (Bug#8410).
19106         * xselect.c (x_get_local_selection, x_handle_property_notify):
19107         Remove vars that are set but not used.
19109         * xfns.c (x_create_tip_frame): Remove var that is set but not used.
19110         (make_invisible_cursor): Initialize a possibly-uninitialized variable.
19112         * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
19113         Remove var that is set but not used.
19114         (scroll_bar_windows_size): Now size_t, not int.
19115         (x_send_scroll_bar_event): Use size_t, not int, for sizes.
19116         Check for overflow.
19118         * xfaces.c (realize_named_face): Remove vars that are set but not used.
19119         (map_tty_color) [!defined MSDOS]: Likewise.
19121         * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
19123         * coding.c: Remove vars that are set but not used.
19124         (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
19125         All callers changed.
19126         (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
19127         (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
19128         (decode_coding_charset): Remove vars that are set but not used.
19130         * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
19131         that is set but not used.
19133         * print.c (print_object): Remove var that is set but not used.
19135         Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
19136         The gnulib version avoids calling malloc in the usual case,
19137         and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
19138         * fileio.c (Ffile_symlink_p): Use emacs_readlink.
19139         * filelock.c (current_lock_owner): Likewise.
19140         * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
19141         * sysdep.c: Include allocator.h, careadlinkat.h.
19142         (emacs_no_realloc_allocator): New static constant.
19143         (emacs_readlink): New function.
19144         * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
19145         ../lib/careadlinkat.h.
19147 2011-04-04  Stefan Monnier  <monnier@iro.umontreal.ca>
19149         * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
19150         first non-nil return value).
19152 2011-04-03  Jan Djärv  <jan.h.d@swipnet.se>
19154         * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
19155         if not defined (Bug#8403).
19157 2011-04-02  Juanma Barranquero  <lekktu@gmail.com>
19159         * xdisp.c (display_count_lines): Remove parameter `start',
19160         unused since 1998-01-01T02:27:27Z!rms@gnu.org.  All callers changed.
19161         (get_char_face_and_encoding): Remove parameter `multibyte_p',
19162         unused since 2008-05-14T01:40:23Z!handa@m17n.org.  All callers changed.
19163         (fill_stretch_glyph_string): Remove parameters `row' and `area',
19164         unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
19165         and thereabouts.  All callers changed.
19166         (get_per_char_metric): Remove parameter `f', unused since
19167         2008-05-14T01:40:23Z!handa@m17n.org.  All callers changed.
19169 2011-04-02  Jim Meyering  <meyering@redhat.com>
19171         do not dereference NULL upon failed strdup
19172         * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
19173         (ns_get_family): Likewise.
19175 2011-04-02  Juanma Barranquero  <lekktu@gmail.com>
19177         * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
19179 2011-04-02  Jan Djärv  <jan.h.d@swipnet.se>
19181         * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
19182         later (Bug#8403).
19184 2011-04-01  Stefan Monnier  <monnier@iro.umontreal.ca>
19186         Add lexical binding.
19188         * window.c (Ftemp_output_buffer_show): New fun.
19189         (Fsave_window_excursion):
19190         * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
19192         * lread.c (lisp_file_lexically_bound_p): New function.
19193         (Fload): Bind Qlexical_binding.
19194         (readevalloop): Remove `evalfun' arg.
19195         Bind Qinternal_interpreter_environment.
19196         (Feval_buffer): Bind Qlexical_binding.
19197         (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
19198         Mark as dynamic.
19199         (syms_of_lread): Declare `lexical-binding'.
19201         * lisp.h (struct Lisp_Symbol): New field `declared_special'.
19203         * keyboard.c (eval_dyn): New fun.
19204         (menu_item_eval_property): Use it.
19206         * image.c (parse_image_spec): Use Ffunctionp.
19208         * fns.c (concat, mapcar1): Accept byte-code-functions.
19210         * eval.c (Fsetq): Handle lexical vars.
19211         (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
19212         (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
19213         (FletX, Flet): Obey lexical binding.
19214         (Fcommandp): Handle closures.
19215         (Feval): New `lexical' arg.
19216         (eval_sub): New function extracted from Feval.  Use it almost
19217         everywhere where Feval was used.  Look up vars in lexical env.
19218         Handle closures.
19219         (Ffunctionp): Move from subr.el.
19220         (Ffuncall): Handle closures.
19221         (apply_lambda): Remove `eval_flags'.
19222         (funcall_lambda): Handle closures and new byte-code-functions.
19223         (Fspecial_variable_p): New function.
19224         (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
19225         but without exporting it to Lisp.
19227         * doc.c (Fdocumentation, store_function_docstring):
19228         * data.c (Finteractive_form): Handle closures.
19230         * callint.c (Fcall_interactively): Preserve lexical-binding mode for
19231         interactive spec.
19233         * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
19234         New byte-codes.
19235         (exec_byte_code): New function extracted from Fbyte_code to handle new
19236         calling convention for byte-code-functions.  Add new byte-codes.
19238         * buffer.c (defvar_per_buffer): Set new `declared_special' field.
19240         * alloc.c (Fmake_symbol): Init new `declared_special' field.
19242 2011-03-31  Juanma Barranquero  <lekktu@gmail.com>
19244         * xdisp.c (redisplay_internal): Fix prototype.
19246 2011-03-31  Eli Zaretskii  <eliz@gnu.org>
19248         * xdisp.c (SCROLL_LIMIT): New macro.
19249         (try_scrolling): Use it when setting scroll_limit.
19250         Limit scrolling to 100 screen lines.
19251         (redisplay_window): Even when falling back on "recentering",
19252         position point in the window according to scroll-conservatively,
19253         scroll-margin, and scroll-*-aggressively variables.  (Bug#6671)
19255         (try_scrolling): When point is above the window, allow searching
19256         as far as scroll_max, or one screenful, to compute vertical
19257         distance from PT to the scroll margin position.  This prevents
19258         try_scrolling from unnecessarily failing when
19259         scroll-conservatively is set to a value slightly larger than the
19260         window height.  Clean up the case of PT below the margin at bottom
19261         of window: scroll_max can no longer be INT_MAX.  When aggressive
19262         scrolling is in use, don't let point enter the opposite scroll
19263         margin as result of the scroll.
19264         (syms_of_xdisp) <scroll-conservatively>: Document the
19265         threshold of 100 lines for never-recentering scrolling.
19267 2011-03-31  Juanma Barranquero  <lekktu@gmail.com>
19269         * dispextern.h (move_it_by_lines):
19270         * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
19271         since 2000-12-29T14:24:09Z!gerd@gnu.org.  All callers changed.
19272         (message_log_check_duplicate): Remove parameters `prev_bol' and
19273         `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org.  All callers changed.
19274         (redisplay_internal): Remove parameter `preserve_echo_area',
19275         unused since 1999-07-21T21:43:52Z!gerd@gnu.org.  All callers changed.
19277         * indent.c (Fvertical_motion):
19278         * window.c (window_scroll_pixel_based, Frecenter):
19279         Don't pass `need_y_p' to `move_it_by_lines'.
19281 2011-03-30  Stefan Monnier  <monnier@iro.umontreal.ca>
19283         * eval.c (struct backtrace): Don't cheat with negative numbers, but do
19284         steal a few bits to be more compact.
19285         (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
19286         Remove unneeded casts.
19288         * bytecode.c (Fbyte_code): CAR and CDR can GC.
19290 2011-03-30  Zachary Kanfer  <zkanfer@gmail.com>  (tiny change)
19292         * keyboard.c (Fexecute_extended_command): Do log the "suggest key
19293         binding" message (bug#7967).
19295 2011-03-30  Paul Eggert  <eggert@cs.ucla.edu>
19297         Fix more problems found by GCC 4.6.0's static checks.
19299         * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
19300         Remove unused local var.
19302         * editfns.c (Fmessage_box): Remove unused local var.
19304         * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
19305         (note_mode_line_or_margin_highlight, note_mouse_highlight):
19306         Omit unused local vars.
19307         * window.c (shrink_windows): Omit unused local var.
19308         * menu.c (digest_single_submenu): Omit unused local var.
19309         * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
19310         Omit unused local var.
19312         * keyboard.c (parse_modifiers_uncached, parse_modifiers):
19313         Don't assume string length fits in int.
19314         (keyremap_step, read_key_sequence): Use size_t for sizes.
19315         (read_key_sequence): Don't check last_real_key_start redundantly.
19317         * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
19318         instead of alloca (Bug#8344).
19320         * eval.c (Fbacktrace): Don't assume nargs fits in int.
19321         (Fbacktrace_frame): Don't assume nframes fits in int.
19323         * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
19325         * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
19326         concerns.
19328         * term.c (produce_glyphless_glyph): Remove unnecessary test.
19330         * cm.c (calccost): Turn while-do into do-while, for clarity.
19332         * keyboard.c (syms_of_keyboard): Use the same style as later
19333         in this function when indexing through an array.  This also
19334         works around GCC bug 48267.
19336         * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
19338         * xselect.c (x_check_property_data): Return correct size (Bug#8335).
19340         * chartab.c (sub_char_table_ref_and_range): Redo for slight
19341         efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
19343         * keyboard.c, keyboard.h (num_input_events): Now size_t.
19344         This avoids undefined behavior on integer overflow, and is a bit
19345         more convenient anyway since it is compared to a size_t variable.
19347         Variadic C functions now count arguments with size_t, not int.
19348         This avoids an unnecessary limitation on 64-bit machines, which
19349         caused (substring ...) to crash on large vectors (Bug#8344).
19350         * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
19351         (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
19352         All variadic functions and their callers changed accordingly.
19353         (struct gcpro.nvars): Now size_t, not int.  All uses changed.
19354         * data.c (arith_driver, float_arith_driver): Likewise.
19355         * editfns.c (general_insert_function): Likewise.
19356         * eval.c (struct backtrace.nargs, interactive_p)
19357         (internal_condition_case_n, run_hook_with_args, apply_lambda)
19358         (funcall_lambda, mark_backtrace): Likewise.
19359         * fns.c (concat): Likewise.
19360         * frame.c (x_set_frame_parameters): Likewise.
19361         * fns.c (get_key_arg): Now accepts and returns size_t, and returns
19362         0 if not found, not -1.  All callers changed.
19364         * alloc.c (garbage_collect): Don't assume stack size fits in int.
19365         (stack_copy_size): Now size_t, not int.
19366         (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
19368 2011-03-28  Juanma Barranquero  <lekktu@gmail.com>
19370         * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
19371         unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
19372         All callers changed.
19374         * lisp.h (multibyte_char_to_unibyte):
19375         * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
19376         unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
19377         * character.h (CHAR_TO_BYTE8):
19378         * cmds.c (internal_self_insert):
19379         * editfns.c (general_insert_function):
19380         * keymap.c (push_key_description):
19381         * search.c (Freplace_match):
19382         * xdisp.c (message_dolog, set_message_1): All callers changed.
19384 2011-03-28  Stefan Monnier  <monnier@iro.umontreal.ca>
19386         * keyboard.c (safe_run_hook_funcall): New function.
19387         (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
19388         don't set the hook to nil, but remove the offending function instead.
19389         (Qcommand_hook_internal): Remove, unused.
19390         (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
19391         Vcommand_hook_internal.
19393         * eval.c (enum run_hooks_condition): Remove.
19394         (funcall_nil, funcall_not): New functions.
19395         (run_hook_with_args): Call each function through a `funcall' argument.
19396         Remove `cond' argument, now redundant.
19397         (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
19398         (Frun_hook_with_args_until_failure): Adjust accordingly.
19399         (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
19401 2011-03-28  Juanma Barranquero  <lekktu@gmail.com>
19403         * dispextern.h (string_buffer_position): Remove declaration.
19405         * print.c (strout): Remove parameter `multibyte', unused since
19406         1999-08-21T19:30:21Z!gerd@gnu.org.  All callers changed.
19408         * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
19409         never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
19410         All callers changed.
19412         * w32.c (_wsa_errlist): Use braces for struct initializers.
19414         * xdisp.c (string_buffer_position_lim): Remove parameter `w',
19415         never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
19416         All callers changed.
19417         (string_buffer_position): Likewise.  Also, make static (it's never
19418         used outside xdisp.c).
19419         (cursor_row_p): Remove parameter `w', unused since
19420         2000-10-17T16:08:57Z!gerd@gnu.org.  All callers changed.
19421         (decode_mode_spec): Remove parameter `precision', introduced during
19422         Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
19423         All callers changed.
19425 2011-03-27  Jan Djärv  <jan.h.d@swipnet.se>
19427         * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
19429 2011-03-27  Anders Lindgren  <andlind@gmail.com>
19431         * nsterm.m (ns_menu_bar_is_hidden): New variable.
19432         (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
19433         (ns_update_auto_hide_menu_bar): New functions.
19434         (ns_update_begin): Call ns_update_auto_hide_menu_bar.
19435         (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
19436         ns_constrain_all_frames.
19437         (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
19438         (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
19440 2011-03-27  Jan Djärv  <jan.h.d@swipnet.se>
19442         * nsmenu.m (runDialogAt): Remove argument to timer_check.
19444 2011-03-27  Glenn Morris  <rgm@gnu.org>
19446         * syssignal.h: Replace RETSIGTYPE with void.
19447         * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
19448         * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
19449         Replace SIGTYPE with void everywhere.
19450         * s/usg5-4-common.h (SIGTYPE): Remove definition.
19451         * s/template.h (SIGTYPE): Remove commented out definition.
19453 2011-03-26  Eli Zaretskii  <eliz@gnu.org>
19455         * xdisp.c (redisplay_window): Don't check buffer's clip_changed
19456         flag as a prerequisite for invoking try_scrolling.  (Bug#6671)
19458 2011-03-26  Juanma Barranquero  <lekktu@gmail.com>
19460         * w32.c (read_unc_volume): Use parameter `henum', instead of
19461         global variable `wget_enum_handle'.
19463         * keymap.c (describe_vector): Remove parameters `indices' and
19464         `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
19465         (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
19467         * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
19469         * keyboard.c (timer_check): Remove parameter `do_it_now',
19470         unused since 1996-04-12T06:01:29Z!rms@gnu.org.
19471         (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
19472         unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
19474         * keyboard.c (read_char):
19475         * w32menu.c (w32_menu_display_help):
19476         * xmenu.c (show_help_event, menu_help_callback):
19477         Adjust calls to `show_help_echo'.
19479         * gtkutil.c (xg_maybe_add_timer):
19480         * keyboard.c (readable_events):
19481         * process.c (wait_reading_process_output):
19482         * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
19484         * insdel.c (adjust_markers_gap_motion):
19485         Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
19486         (gap_left, gap_right): Don't call it.
19488 2011-03-25  Chong Yidong  <cyd@stupidchicken.com>
19490         * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
19491         incurred during fontification.
19493 2011-03-25  Juanma Barranquero  <lekktu@gmail.com>
19495         * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
19496         (DEFVAR_PER_BUFFER): Don't pass it.
19498         * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
19499         (scrolling_window): Don't pass it.
19501 2011-03-25  Juanma Barranquero  <lekktu@gmail.com>
19503         * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
19505         * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
19506         and `suffix'.
19507         (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
19508         of variables specific to SELinux and computation of `encoded_absname'.
19510         * image.c (XPutPixel): Remove unused variable `height'.
19512         * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
19514         * unexw32.c (get_section_info): Remove unused variable `section'.
19516         * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
19517         (system_process_attributes): Remove unused variable `sess'.
19518         (sys_read): Remove unused variable `err'.
19520         * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
19521         (w32_wnd_proc): Remove unused variable `isdead'.
19522         (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
19523         (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
19524         (x_create_tip_frame): Remove unused variable `tem'.
19526         * w32inevt.c (w32_console_read_socket):
19527         Remove unused variable `no_events'.
19529         * w32term.c (x_draw_composite_glyph_string_foreground):
19530         Remove unused variable `width'.
19532 2011-03-24  Juanma Barranquero  <lekktu@gmail.com>
19534         * w32term.c (x_set_glyph_string_clipping):
19535         Don't pass uninitialized region to CombineRgn.
19537 2011-03-23  Juanma Barranquero  <lekktu@gmail.com>
19539         * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
19540         (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
19541         (Fx_close_connection): Remove unused variable `i'.
19543         * w32font.c (w32font_draw): Return number of glyphs.
19544         (w32font_open_internal): Remove unused variable `i'.
19545         (w32font_driver): Add missing initializer.
19547         * w32menu.c (utf8to16): Remove unused variable `utf16'.
19548         (fill_in_menu): Remove unused variable `items_added'.
19550         * w32term.c (last_mouse_press_frame): Remove static global variable.
19551         (w32_clip_to_row): Remove unused variable `f'.
19552         (x_delete_terminal): Remove unused variable `i'.
19554         * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
19555         (NOTHING): Remove unused static global variable.
19556         (uniscribe_check_otf): Remove unused variable `table'.
19557         (uniscribe_font_driver): Add missing initializers.
19559 2011-03-23  Julien Danjou  <julien@danjou.info>
19561         * term.c (Fsuspend_tty, Fresume_tty):
19562         * minibuf.c (read_minibuf, run_exit_minibuf_hook):
19563         * window.c (temp_output_buffer_show):
19564         * insdel.c (signal_before_change):
19565         * frame.c (Fhandle_switch_frame):
19566         * fileio.c (Fdo_auto_save):
19567         * emacs.c (Fkill_emacs):
19568         * editfns.c (save_excursion_restore):
19569         * cmds.c (internal_self_insert):
19570         * callint.c (Fcall_interactively):
19571         * buffer.c (Fkill_all_local_variables):
19572         * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
19573         Use Frun_hooks.
19574         (command_loop_1): Use Frun_hooks.  Call safe_run_hooks
19575         unconditionally since it does the check itself.
19577 2011-03-23  Paul Eggert  <eggert@cs.ucla.edu>
19579         Fix more problems found by GCC 4.5.2's static checks.
19581         * coding.c (encode_coding_raw_text): Avoid unnecessary test
19582         the first time through the loop, since we know p0 < p1 then.
19583         This also avoids a gcc -Wstrict-overflow warning.
19585         * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
19586         leading to a memory leak, possible in functions like
19587         load_charset_map_from_file that can allocate an unbounded number
19588         of objects (Bug#8318).
19590         * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
19591         that could (at least in theory) be that large.
19593         * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
19594         This is less likely to overflow, and avoids undefined behavior if
19595         overflow does occur.  All callers changed.  Use strtoul to scan
19596         for the unsigned long integer.
19597         (pint2hrstr): Simplify and tune code slightly.
19598         This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19600         * scroll.c (do_scrolling): Work around GCC bug 48228.
19601         See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
19603         * frame.c (Fmodify_frame_parameters): Simplify loop counter.
19604         This also avoids a warning with gcc -Wstrict-overflow.
19605         (validate_x_resource_name): Simplify count usage.
19606         This also avoids a warning with gcc -Wstrict-overflow.
19608         * fileio.c (Fcopy_file): Report error if fchown or fchmod
19609         fail (Bug#8306).
19611         * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
19613         * process.c (Fmake_network_process): Use socklen_t, not int,
19614         where POSIX says socklen_t is required in portable programs.
19615         This fixes a porting bug on hosts like 64-bit HP-UX, where
19616         socklen_t is wider than int (Bug#8277).
19617         (Fmake_network_process, server_accept_connection):
19618         (wait_reading_process_output, read_process_output):
19619         Likewise.
19621         * process.c: Rename or move locals to avoid shadowing.
19622         (list_processes_1, Fmake_network_process):
19623         (read_process_output_error_handler, exec_sentinel_error_handler):
19624         Rename or move locals.
19625         (Fmake_network_process): Define label "retry_connect" only if needed.
19626         (Fnetwork_interface_info): Fix pointer signedness.
19627         (process_send_signal): Add cast to avoid pointer signedness problem.
19628         (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
19629         (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
19631         Make tparam.h and terminfo.c consistent.
19632         * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
19633         Include tparam.h instead, since it declares them.
19634         * cm.h (PC): Remove extern decl; tparam.h now does this.
19635         * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
19636         * terminfo.c: Include tparam.h, to check interfaces.
19637         (tparm): Make 1st arg a const pointer in decl.  Put it at top level.
19638         (tparam): Adjust signature to match interface in tparam.h;
19639         this removes some undefined behavior.  Check that outstring and len
19640         are zero, which they always are with Emacs.
19641         * tparam.h (PC, BC, UP): New extern decls.
19643         * xftfont.c (xftfont_shape): Now static, and defined only if needed.
19644         (xftfont_open): Rename locals to avoid shadowing.
19646         * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
19647         (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
19648         (OTF_TAG_SYM): Omit macro if not needed.
19649         (ftfont_list): Remove unused local.
19650         (get_adstyle_property, ftfont_pattern_entity):
19651         (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
19652         Rename locals to avoid shadowing.
19654         * xfont.c (xfont_list_family): Mark var as initialized.
19656         * xml.c (make_dom): Now static.
19658         * composite.c (composition_compute_stop_pos): Rename local to
19659         avoid shadowing.
19660         (composition_reseat_it): Remove unused locals.
19661         (find_automatic_composition, composition_adjust_point): Likewise.
19662         (composition_update_it): Mark var as initialized.
19663         (find_automatic_composition): Mark vars as initialized,
19664         with a FIXME (Bug#8290).
19666         character.h: Rename locals to avoid shadowing.
19667         * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
19668         (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
19669         (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
19670         (BUF_DEC_POS): Be more systematic about renaming local temporaries
19671         to avoid shadowing.
19673         * textprop.c (property_change_between_p): Remove; unused.
19675         * intervals.c (interval_start_pos): Now static.
19677         * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
19679         * atimer.c (start_atimer, append_atimer_lists, set_alarm):
19680         Rename locals to avoid shadowing.
19682         * sound.c (wav_play, au_play, Fplay_sound_internal):
19683         Fix pointer signedness.
19684         (alsa_choose_format): Remove unused local var.
19685         (wav_play): Initialize a variable to 0, to prevent undefined
19686         behavior (Bug#8278).
19688         * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
19690         * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
19692         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
19693         clobbering (Bug#8298).
19694         * sysdep.c (sys_subshell): Likewise.
19695         Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
19697         * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
19698         This should get cleaned up, so that child_setup has the
19699         same signature on all platforms.
19701         * callproc.c (call_process_cleanup): Now static.
19702         (relocate_fd): Rename locals to avoid shadowing.
19704 2011-03-22  Chong Yidong  <cyd@stupidchicken.com>
19706         * xterm.c (x_clear_frame): Remove XClearWindow call.  This appears
19707         not to be necessary, and produces flickering.
19709 2011-03-20  Glenn Morris  <rgm@gnu.org>
19711         * config.in: Remove file.
19713 2011-03-20  Juanma Barranquero  <lekktu@gmail.com>
19715         * minibuf.c (Vcompleting_read_function): Don't declare, global variables
19716         are now in src/globals.h.
19717         (syms_of_minibuf): Remove spurious & from previous change.
19719 2011-03-20  Leo Liu  <sdl.web@gmail.com>
19721         * minibuf.c (completing-read-function): New variable.
19722         (completing-read-default): Rename from completing-read.
19723         (completing-read): Call completing-read-function.
19725 2011-03-19  Juanma Barranquero  <lekktu@gmail.com>
19727         * xfaces.c (Fx_load_color_file):
19728         Read color file from absolute filename (bug#8250).
19730 2011-03-19  Juanma Barranquero  <lekktu@gmail.com>
19732         * makefile.w32-in: Update dependencies.
19734 2011-03-17  Eli Zaretskii  <eliz@gnu.org>
19736         * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
19738 2011-03-17  Paul Eggert  <eggert@cs.ucla.edu>
19740         Fix more problems found by GCC 4.5.2's static checks.
19742         * process.c (make_serial_process_unwind, send_process_trap):
19743         (sigchld_handler): Now static.
19745         * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
19746         That way, the code declares only the vars that it needs.
19747         * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
19748         * s/cygwin.h (PTY_ITERATION): Likewise.
19749         * s/darwin.h (PTY_ITERATION): Likewise.
19750         * s/gnu-linux.h (PTY_ITERATION): Likewise.
19752         * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
19753         * process.c (allocate_pty): Don't declare stb unless it's needed.
19755         * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
19756         (CONSTANTLIM): Remove; unused.
19757         (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
19758         Define only if needed.
19760         * unexelf.c (unexec): Name an expression,
19761         to avoid gcc -Wbad-function-cast warning.
19762         Use a different way to cause a compilation error if anyone uses
19763         n rather than nn, a way that does not involve shadowing.
19764         (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
19766         * deps.mk (unexalpha.o): Remove; unused.
19768         New file unexec.h, the (simple) interface for unexec (Bug#8267).
19769         * unexec.h: New file.
19770         * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
19771         (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
19772         Depend on unexec.h.
19773         * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
19774         * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
19775         * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
19776         Change as necessary to match prototype in unexec.h.
19778         * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
19779         shadowing.
19780         (back_comment, skip_chars): Mark vars as initialized.
19782         * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
19783         Rename locals to avoid shadowing.
19785         * lread.c (read1): Rewrite so as not to use empty "else".
19786         (Fload, readevalloop, read1): Rename locals to avoid shadowing.
19788         * print.c (Fredirect_debugging_output): Fix pointer signedess.
19790         * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
19791         warning when compiling print.c.
19793         * font.c (font_unparse_fcname): Abort in an "impossible" situation
19794         instead of using an uninitialized var.
19795         (font_sort_entities): Mark var as initialized.
19797         * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
19799         * font.c (font_unparse_xlfd): Don't mix pointers to variables with
19800         pointers to constants.
19801         (font_parse_fcname): Remove unused vars.
19802         (font_delete_unmatched): Now static.
19803         (font_get_spec): Remove; unused.
19804         (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
19805         (font_update_drivers, Ffont_get_glyphs, font_add_log):
19806         Rename or move locals to avoid shadowing.
19808         * fns.c (require_nesting_list, require_unwind): Now static.
19809         (Ffillarray): Rename locals to avoid shadowing.
19811         * floatfns.c (domain_error2): Define only if needed.
19812         (Ffrexp, Fldexp): Rename locals to avoid shadowing.
19814         * alloc.c (mark_backtrace): Move decl from here ...
19815         * lisp.h: ... to here, so that it can be checked.
19817         * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
19818         (Fdefvar): Rewrite so as not to use empty "else".
19819         (lisp_indirect_variable): Name an expression,
19820         to avoid gcc -Wbad-function-cast warning.
19821         (Fdefvar): Rename locals to avoid shadowing.
19823         * callint.c (quotify_arg, quotify_args): Now static.
19824         (Fcall_interactively): Rename locals to avoid shadowing.
19825         Use const pointer when appropriate.
19827         * lisp.h (get_system_name, get_operating_system_release):
19828         Move decls here, to check interfaces.
19829         * process.c (get_operating_system_release): Move decl to lisp.h.
19830         * xrdb.c (get_system_name): Likewise.
19831         * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
19832         (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
19833         some of which prompt warnings from gcc -Wbad-function-cast.
19834         (Fformat_time_string, Fencode_time, Finsert_char):
19835         (Ftranslate_region_internal, Fformat):
19836         Rename or remove local vars to avoid shadowing.
19837         (Ftranslate_region_internal): Mark var as initialized.
19839         * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
19840         avoid shadowing.
19842         * lisp.h (eassert): Check that the argument compiles, even if
19843         ENABLE_CHECKING is not defined.
19845         * data.c (Findirect_variable): Name an expression, to avoid
19846         gcc -Wbad-function-cast warning.
19847         (default_value, arithcompare, arith_driver, arith_error): Now static.
19848         (store_symval_forwarding): Rename local to avoid shadowing.
19849         (Fmake_variable_buffer_local, Fmake_local_variable):
19850         Mark variables as initialized.
19851         (do_blv_forwarding, do_symval_forwarding): Remove; unused.
19853         * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
19854         (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
19855         Rename locals to avoid shadowing.
19856         (mark_stack): Move local variables into the #ifdef region where
19857         they're used.
19858         (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
19859         ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
19860         needed otherwise.
19861         (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
19862         (GC_STRING_CHARS): Remove; not used.
19863         (Fmemory_limit): Cast sbrk's returned value to char *.
19865         * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
19866         avoids undefined behavior in theory.
19868         * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
19870         Use functions, not macros, for up- and down-casing (Bug#8254).
19871         * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
19872         (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove.  All callers changed
19873         to use the following functions instead of these macros.
19874         (downcase): Adjust to lack of DOWNCASE_TABLE.  Return int, not
19875         EMACS_INT, since callers assume the returned value fits in int.
19876         (upcase1): Likewise, for UPCASE_TABLE.
19877         (uppercasep, lowercasep, upcase): New static inline functions.
19878         * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
19879         the race-condition problem in the old DOWNCASE.
19881         * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
19882         Rename locals to avoid shadowing.
19883         (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
19884         (regex_compile, re_search_2, re_match_2_internal):
19885         Remove unused local vars.
19886         (FREE_VAR): Rewrite so as not to use empty "else",
19887         which gcc can warn about.
19888         (regex_compile, re_match_2_internal): Mark locals as initialized.
19889         (RETALLOC_IF): Define only if needed.
19890         (WORDCHAR_P): Likewise.  This one is never needed, but is used
19891         only in a comment talking about a compiler bug, so put inside
19892         the #if 0 of that comment.
19893         (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
19894         (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
19895         Remove; unused.
19897         * search.c (boyer_moore): Rename locals to avoid shadowing.
19898         * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
19899         (PREV_CHAR_BOUNDARY): Likewise.
19901         * search.c (simple_search): Remove unused var.
19903         * dired.c (compile_pattern): Move decl from here ...
19904         * lisp.h: ... to here, so that it can be checked.
19905         (struct re_registers): New forward decl.
19907         * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
19909         * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
19910         All uses changed.
19911         (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
19912         Rename locals to avoid shadowing.
19913         (Fvertical_motion): Mark locals as initialized.
19915         * casefiddle.c (casify_object, casify_region): Now static.
19916         (casify_region): Mark local as initialized.
19918         * cmds.c (internal_self_insert): Rename local to avoid shadowing.
19920         * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
19921         New macros, so that the caller can use some names other than
19922         gcpro1, gcpro2, etc.
19923         (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
19924         of the new macros.
19925         (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
19926         argument, for consistency with GCPRO2_VAR, etc: it is now the
19927         prefix of the variable, not the variable itself.  All uses
19928         changed.
19929         * dired.c (directory_files_internal, file_name_completion):
19930         Rename locals to avoid shadowing.
19932         Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
19933         An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
19934         dired.c's scmp function, had undefined behavior.
19935         * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
19936         (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
19937         * buffer.h: ... to here, because these macros use current_buffer,
19938         and the new implementation with inline functions needs to have
19939         current_buffer in scope now, rather than later when the macros
19940         are used.
19941         (downcase, upcase1): New static inline functions.
19942         (DOWNCASE, UPCASE1): Reimplement using these functions.
19943         This avoids undefined behavior in expressions like
19944         DOWNCASE (x) == DOWNCASE (y), which previously suffered
19945         from race conditions in accessing the global variables
19946         case_temp1 and case_temp2.
19947         * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
19948         * lisp.h (case_temp1, case_temp2): Remove their decls.
19949         * character.h (ASCII_CHAR_P): Move from here ...
19950         * lisp.h: ... to here, so that the inline functions mentioned
19951         above can use them.
19953         * dired.c (directory_files_internal_unwind): Now static.
19955         * fileio.c (file_name_as_directory, directory_file_name):
19956         (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
19957         Now static.
19958         (file_name_as_directory): Use const pointers when appropriate.
19959         (Fexpand_file_name): Likewise.  In particular, newdir might
19960         point at constant storage, so make it a const pointer.
19961         (Fmake_directory_internal, Fread_file_name): Remove unused vars.
19962         (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
19963         signedness issues.
19964         (Fset_file_times, Finsert_file_contents, auto_save_error):
19965         Rename locals to avoid shadowing.
19967         * minibuf.c (choose_minibuf_frame_1): Now static.
19968         (Ftry_completion, Fall_completions): Rename or remove locals
19969         to avoid shadowing.
19971         * marker.c (bytepos_to_charpos): Remove; unused.
19973         * lisp.h (verify_bytepos, count_markers): New decls,
19974         so that gcc does not warn that these functions aren't declared.
19976         * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
19977         (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
19978         (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
19979         (copy_text): Remove unused local var.
19981         * filelock.c (within_one_second): Now static.
19982         (lock_file_1): Rename local to avoid shadowing.
19984         * buffer.c (fix_overlays_before): Mark locals as initialized.
19985         (fix_start_end_in_overlays): Likewise.  This function should be
19986         simplified by using pointers-to-pointers, but that's a different
19987         matter.
19988         (switch_to_buffer_1): Now static.
19989         (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
19990         (report_overlay_modification): Rename locals to avoid shadowing.
19992         * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
19993         Fix pointer signedness issue.
19994         (sys_subshell): Mark local as volatile if checking for lint,
19995         to suppress a gcc -Wclobbered warning that does not seem to be right.
19996         (MAXPATHLEN): Define only if needed.
19998         * process.c (serial_open, serial_configure): Move decls from here ...
19999         * systty.h: ... to here, so that they can be checked.
20001         * fns.c (get_random, seed_random): Move extern decls from here ...
20002         * lisp.h: ... to here, so that they can be checked.
20004         * sysdep.c (reset_io): Now static.
20005         (wait_for_termination_signal): Remove; unused.
20007         * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
20008         (copy_keymap_item, append_key, push_text_char_description):
20009         Now static.
20010         (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
20011         (DENSE_TABLE_SIZE): Remove; unused.
20012         (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
20013         (describe_map_tree):
20014         Rename locals to avoid shadowing.
20016         * keyboard.c: Declare functions static if they are not used elsewhere.
20017         (echo_char, echo_dash, cmd_error, top_level_2):
20018         (poll_for_input, handle_async_input): Now static.
20019         (read_char, kbd_buffer_get_event, make_lispy_position):
20020         (make_lispy_event, make_lispy_movement, apply_modifiers):
20021         (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
20022         (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
20023         (Fread_key_sequence_vector): Rename locals to avoid shadowing.
20024         (read_key_sequence, read_char): Mark locals as initialized.
20025         (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
20027         * keyboard.h (make_ctrl_char): New decl.
20028         (mark_kboards): Move decl here ...
20029         * alloc.c (mark_kboards): ... from here.
20031         * lisp.h (force_auto_save_soon): New decl.
20033         * emacs.c (init_cmdargs): Rename local to avoid shadowing.
20034         (DEFINE_DUMMY_FUNCTION): New macro.
20035         (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
20036         Use it.
20037         (main): Add casts to avoid warnings
20038         if GCC considers string literals to be constants.
20040         * lisp.h (fatal_error_signal): Add decl, since it's exported.
20042         * dbusbind.c: Pointer signedness fixes.
20043         (xd_signature, xd_append_arg, xd_initialize):
20044         (Fdbus_call_method, Fdbus_call_method_asynchronously):
20045         (Fdbus_method_return_internal, Fdbus_method_error_internal):
20046         (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
20047         (Fdbus_register_signal): Use SSDATA when the context wants char *.
20049         * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
20050         if GCC considers string literals to be constants.
20051         (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
20053 2011-03-16  Stefan Monnier  <monnier@iro.umontreal.ca>
20055         * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
20056         (print_preprocess, print_object): New macro to fix last change.
20058         * print.c (print_preprocess): Don't forget font objects.
20060 2011-03-16  Juanma Barranquero  <lekktu@gmail.com>
20062         * emacs.c (USAGE3): Doc fixes.
20064 2011-03-15  Andreas Schwab  <schwab@linux-m68k.org>
20066         * coding.c (detect_coding_iso_2022): Reorganize code to clarify
20067         structure.
20069 2011-03-14  Juanma Barranquero  <lekktu@gmail.com>
20071         * lisp.h (VWindow_system, Qfile_name_history):
20072         * keyboard.h (lispy_function_keys) [WINDOWSNT]:
20073         * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
20074         (w32_system_caret_x, w32_system_caret_y): Declare extern.
20076         * w32select.c: Don't #include "keyboard.h".
20077         (run_protected): Add extern declaration for waiting_for_input.
20079         * w32.c (Qlocal, noninteractive1, inhibit_window_system):
20080         * w32console.c (detect_input_pending, read_input_pending)
20081         (encode_terminal_code):
20082         * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
20083         (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
20084         (w32_system_caret_y, Qfile_name_history):
20085         * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
20086         * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
20087         * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
20088         (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
20089         * w32proc.c (Qlocal, report_file_error):
20090         * w32term.c (Vwindow_system, updating_frame):
20091         * w32uniscribe.c (initialized, uniscribe_font_driver):
20092         Remove unneeded extern declarations.
20094 2011-03-14  Chong Yidong  <cyd@stupidchicken.com>
20096         * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
20098 2011-03-13  Chong Yidong  <cyd@stupidchicken.com>
20100         * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
20101         (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
20102         These macros can no longer be used for assignment.
20104         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
20105         Assign struct members directly, instead of using BUF_BEGV etc.
20106         (record_buffer_markers, fetch_buffer_markers): New functions for
20107         recording and fetching special buffer markers.
20108         (set_buffer_internal_1, set_buffer_temp): Use them.
20110         * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
20112         * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
20114         * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
20115         (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
20117         * xdisp.c (hscroll_window_tree):
20118         (reconsider_clip_changes): Use PT instead of BUF_PT.
20120 2011-03-13  Eli Zaretskii  <eliz@gnu.org>
20122         * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
20123         $(EMACS_ROOT)/lib/intprops.h.
20125 2011-03-13  Paul Eggert  <eggert@cs.ucla.edu>
20127         Fix more problems found by GCC 4.5.2's static checks.
20129         * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
20130         to unsigned char * to avoid compiler diagnostic.
20131         (xg_free_frame_widgets): Make it clear that a local variable is
20132         needed only if USE_GTK_TOOLTIP.
20133         (gdk_window_get_screen): Make it clear that this macro is needed
20134         only if USE_GTK_TOOLTIP.
20135         (int_gtk_range_get_value): New function, which avoids a diagnostic
20136         from gcc -Wbad-function-cast.
20137         (xg_set_toolkit_scroll_bar_thumb): Use it.
20138         (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
20139         diagnostic from gcc -Wbad-function-cast.
20140         (get_utf8_string, xg_get_file_with_chooser):
20141         Rename locals to avoid shadowing.
20142         (create_dialog): Move locals to avoid shadowing.
20144         * xgselect.c (xg_select): Remove unused var.
20146         * image.c (four_corners_best): Mark locals as initialized.
20147         (gif_load): Initialize transparent_p to zero (Bug#8238).
20148         Mark another local as initialized.
20149         (my_png_error, my_error_exit): Mark with NO_RETURN.
20151         * image.c (clear_image_cache): Now static.
20152         (DIM, HAVE_STDLIB_H_1): Remove unused macros.
20153         (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
20154         (x_edge_detection): Remove unnecessary cast that
20155         gcc -Wbad-function-cast diagnoses.
20156         (gif_load): Fix pointer signedness.
20157         (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
20158         (jpeg_load, gif_load): Rename locals to avoid shadowing.
20160 2011-03-12  Paul Eggert  <eggert@cs.ucla.edu>
20162         Improve quality of tests for time stamp overflow.
20163         For example, without this patch (encode-time 0 0 0 1 1
20164         1152921504606846976) returns the obviously-bogus value (-948597
20165         62170) on my RHEL 5.5 x86-64 host.  With the patch, it correctly
20166         reports time overflow.  See
20167         <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
20168         * deps.mk (editfns.o): Depend on ../lib/intprops.h.
20169         * editfns.c: Include limits.h and intprops.h.
20170         (TIME_T_MIN, TIME_T_MAX): New macros.
20171         (time_overflow): Move earlier, to before first use.
20172         (hi_time, lo_time): New functions, for an accurate test for
20173         out-of-range times.
20174         (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
20175         (Fget_internal_run_time): Don't assume time_t fits in int.
20176         (make_time): Use list2 instead of Fcons twice.
20177         (Fdecode_time): More accurate test for out-of-range times.
20178         (check_tm_member): New function.
20179         (Fencode_time): Use it, to test for out-of-range times.
20180         (lisp_time_argument): Don't rely on undefined left-shift and
20181         right-shift behavior when checking for time stamp overflow.
20183         * editfns.c (time_overflow): New function, refactoring common code.
20184         (Fformat_time_string, Fdecode_time, Fencode_time):
20185         (Fcurrent_time_string): Use it.
20187         Move 'make_time' to be next to its inverse 'lisp_time_argument'.
20188         * dired.c (make_time): Move to ...
20189         * editfns.c (make_time): ... here.
20190         * systime.h: Note the move.
20192 2011-03-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
20194         * fringe.c (update_window_fringes): Remove unused variables.
20196         * unexmacosx.c (copy_data_segment): Also copy __got section.
20197         (Bug#8223)
20199 2011-03-12  Eli Zaretskii  <eliz@gnu.org>
20201         * termcap.c [MSDOS]: Include "msdos.h".
20202         (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
20203         Constify `char *' arguments and their references according to
20204         prototypes in tparam.h.
20206         * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
20208         * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
20209         Adapt all references accordingly.
20211         * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
20213 2011-03-11  Tom Tromey  <tromey@redhat.com>
20215         * buffer.c (syms_of_buffer): Remove obsolete comment.
20217 2011-03-11  Eli Zaretskii  <eliz@gnu.org>
20219         * termhooks.h (encode_terminal_code): Declare prototype.
20221         * msdos.c (encode_terminal_code): Don't declare prototype.
20223         * term.c (encode_terminal_code): Now external again, used by
20224         w32console.c and msdos.c.
20226         * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
20227         Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
20229 2011-03-11  Paul Eggert  <eggert@cs.ucla.edu>
20231         Fix some minor problems found by GCC 4.5.2's static checks.
20233         * fringe.c (update_window_fringes): Mark locals as initialized
20234         (Bug#8227).
20235         (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
20237         * alloc.c (mark_fringe_data): Move decl from here ...
20238         * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
20239         to check its interface.
20240         (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
20242         * fontset.c (free_realized_fontset): Now static.
20243         (Fset_fontset_font): Rename local to avoid shadowing.
20244         (fontset_font): Mark local as initialized.
20245         (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
20247         * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
20249         * xselect.c (x_disown_buffer_selections): Remove; not used.
20250         (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
20251         (x_own_selection, Fx_disown_selection_internal): Rename locals
20252         to avoid shadowing.
20253         (x_handle_dnd_message): Remove local to avoid shadowing.
20255         * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
20256         so that the caller can use some name other than gcpro1.
20257         (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
20258         * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
20259         (Fx_backspace_delete_keys_p):
20260         Use them to avoid shadowing, and rename vars to avoid shadowing.
20261         (x_decode_color, x_set_name, x_window): Now static.
20262         (Fx_create_frame): Add braces to silence GCC warning.
20263         (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
20264         (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
20265         Remove unused locals.
20266         (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
20267         (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
20268         Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
20269         macros.
20271         * xterm.h (x_mouse_leave): New decl.
20273         * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
20274         Remove unused functions.
20275         (x_shift_glyphs_for_insert, XTflash, XTring_bell):
20276         (x_calc_absolute_position): Now static.
20277         (XTread_socket): Don't define label "out" unless it's used.
20278         Don't declare local "event" unless it's used.
20279         (x_iconify_frame, x_free_frame_resources): Don't declare locals
20280         unless they are used.
20281         (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
20282         (x_fatal_error_signal): Remove; not used.
20283         (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
20284         (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
20285         (x_error_catcher, x_connection_closed, x_error_handler):
20286         (x_error_quitter, xembed_send_message, x_iconify_frame):
20287         (my_log_handler): Rename locals to avoid shadowing.
20288         (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
20289         (x_connection_closed): Tell GCC not to suggest NO_RETURN.
20291         * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
20292         Rename or move locals to avoid shadowing.
20293         (tty_defined_color, merge_face_heights): Now static.
20294         (free_realized_faces_for_fontset): Remove; not used.
20295         (Fx_list_fonts): Mark variable that gcc -Wuninitialized
20296         does not deduce is never used uninitialized.
20297         (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
20298         (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
20300         * terminal.c (store_terminal_param): Now static.
20302         * xmenu.c (menu_highlight_callback): Now static.
20303         (set_frame_menubar): Remove unused local.
20304         (xmenu_show): Rename parameter to avoid shadowing.
20305         (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
20306         since they might point to immutable storage.
20307         (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
20308         since it's unused otherwise.
20310         * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
20311         Add a FIXME, since the code still doesn't look right.  (Bug#8215)
20312         (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
20313         avoids a gcc -Wuninitialized diagnostic.
20314         (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
20315         (note_mouse_highlight): Mark variables that gcc -Wuninitialized
20316         does not deduce are never used uninitialized.
20318         * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
20320         * xdisp.c (redisplay_window): Rename local to avoid shadowing.
20321         * window.c (window_loop, size_window):
20322         (run_window_configuration_change_hook, enlarge_window): Likewise.
20324         * window.c (display_buffer): Now static.
20325         (size_window): Mark variables that gcc -Wuninitialized
20326         does not deduce are never used uninitialized.
20327         * window.h (check_all_windows): New decl, to forestall
20328         gcc -Wmissing-prototypes diagnostic.
20329         * dispextern.h (bidi_dump_cached_states): Likewise.
20331         * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
20332         shadowing.
20333         * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
20334         Include <limits.h>.
20335         (Fsort_charsets): Redo min/max calculation to shorten the code a bit
20336         and to avoid gcc -Wuninitialized warning.
20337         (load_charset_map): Mark variables that gcc -Wuninitialized
20338         does not deduce are never used uninitialized.
20339         (load_charset): Abort instead of using uninitialized var (Bug#8229).
20341         * coding.c (coding_set_source, coding_set_destination):
20342         Use "else { /* comment */ }" rather than "else /* comment */;"
20343         for clarity, and to avoid gcc -Wempty-body warning.
20344         (Fdefine_coding_system_internal): Don't redeclare 'i' inside
20345         a block, when the outer 'i' will do.
20346         (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
20347         (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
20348         (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
20349         (decode_coding_raw_text, decode_coding_charset, get_translation_table):
20350         (Fdecode_sjis_char, Fdefine_coding_system_internal):
20351         Rename locals to avoid shadowing.
20352         * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
20353         * coding.c (emacs_mule_char, encode_invocation_designation):
20354         Now static, since they're not used elsewhere.
20355         (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
20356         (decode_coding_object, encode_coding_object, detect_coding_system):
20357         (decode_coding_emacs_mule): Mark variables that gcc
20358         -Wuninitialized does not deduce are never used uninitialized.
20359         (detect_coding_iso_2022): Initialize a local variable that might
20360         be used uninitialized.  Leave a FIXME because it's not clear that
20361         this initialization is needed.  (Bug#8211)
20362         (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
20363         (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
20364         (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
20365         (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
20366         Remove unused macros.
20368         * category.c (hash_get_category_set): Remove unused local var.
20369         (copy_category_table): Now static, since it's not used elsewhere.
20370         * character.c (string_count_byte8): Likewise.
20372         * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
20373         (Fregister_code_conversion_map): Rename locals to avoid shadowing.
20375         * chartab.c (copy_sub_char_table): Now static, since it's not used
20376         elsewhere.
20377         (sub_char_table_ref_and_range, char_table_ref_and_range):
20378         Rename locals to avoid shadowing.
20379         (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
20381         * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
20382         (BIDI_BOB): Remove unused macro.
20384         * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
20385         deduce are never used uninitialized.
20386         * term.c (encode_terminal_code): Likewise.
20388         * term.c (encode_terminal_code): Now static.  Remove unused local.
20390         * tparam.h: New file.
20391         * term.c, tparam.h: Include it.
20392         * deps.mk (term.o, tparam.o): Depend on tparam.h.
20393         * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
20394         Move these decls to tparam.h, and make them agree with what
20395         is actually in tparam.c.  The previous trick of using incompatible
20396         decls in different modules does not conform to the C standard.
20397         All callers of tparam changed to use tparam's actual API.
20398         * tparam.c (tparam1, tparam, tgoto):
20399         Use const pointers where appropriate.
20401         * cm.c (calccost, cmgoto): Use const pointers where appropriate.
20402         * cm.h (struct cm): Likewise.
20403         * dispextern.h (do_line_insertion_deletion_costs): Likewise.
20404         * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
20405         * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
20406         (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
20407         (turn_on_face, init_tty): Likewise.
20408         * termchar.h (struct tty_display_info): Likewise.
20410         * term.c (term_mouse_position): Rename local to avoid shadowing.
20412         * alloc.c (mark_ttys): Move decl from here ...
20413         * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
20415 2011-03-11  Andreas Schwab  <schwab@linux-m68k.org>
20417         * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
20419 2011-03-09  Juanma Barranquero  <lekktu@gmail.com>
20421         * search.c (compile_pattern_1): Remove argument regp, unused since
20422         revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
20423         (compile_pattern): Don't pass it.
20425 2011-03-08  Jan Djärv  <jan.h.d@swipnet.se>
20427         * xterm.h (DEFAULT_GDK_DISPLAY): New define.
20428         (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
20429         for ! HAVE_GTK3.
20430         (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
20432         * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
20434         * gtkutil.c: Include gtkx.h if HAVE_GTK3.  If ! HAVE_GTK3, define
20435         gdk_window_get_screen, gdk_window_get_geometry,
20436         gdk_x11_window_lookup_for_display and GDK_KEY_g.
20437         (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
20438         (xg_get_pixbuf_from_pixmap): New function.
20439         (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
20440         to Pixmap, take frame as parameter, remove GdkColormap parameter.
20441         Call xg_get_pixbuf_from_pixmap instead of
20442         gdk_pixbuf_get_from_drawable.
20443         (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
20444         xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
20445         (xg_check_special_colors): Use GtkStyleContext and its functions
20446         for HAVE_GTK3.
20447         (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
20448         (xg_prepare_tooltip, create_dialog, menubar_map_cb)
20449         (xg_update_frame_menubar, xg_tool_bar_detach_callback)
20450         (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
20451         Call gtk_widget_get_preferred_size.
20452         (xg_frame_resized): gdk_window_get_geometry only takes 5
20453         parameters.
20454         (xg_win_to_widget, xg_event_is_for_menubar):
20455         Call gdk_x11_window_lookup_for_display.
20456         (xg_set_widget_bg): New function.
20457         (delete_cb): New function.
20458         (xg_create_frame_widgets): Connect delete-event to delete_cb.
20459         Call xg_set_widget_bg.  Only set background pixmap for ! HAVE_GTK3
20460         (xg_set_background_color): Call xg_set_widget_bg.
20461         (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
20462         (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
20463         Only call gtk_range_set_update_policy if ! HAVE_GTK3.
20464         (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
20465         if ! HAVE_GTK3.
20466         (update_frame_tool_bar): Call gtk_widget_hide.
20467         (xg_initialize): Use GDK_KEY_g.
20469         * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
20470         if ! HAVE_GTK3
20471         (x_session_initialize): Call gdk_x11_set_sm_client_id.
20473         * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
20474         (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
20475         Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
20477 2011-03-08  Juanma Barranquero  <lekktu@gmail.com>
20479         * w32xfns.c (select_palette): Check success of RealizePalette against
20480         GDI_ERROR, not zero.
20482 See ChangeLog.11 for earlier changes.
20484 ;; Local Variables:
20485 ;; coding: utf-8
20486 ;; End:
20488   Copyright (C) 2011-2012 Free Software Foundation, Inc.
20490   This file is part of GNU Emacs.
20492   GNU Emacs is free software: you can redistribute it and/or modify
20493   it under the terms of the GNU General Public License as published by
20494   the Free Software Foundation, either version 3 of the License, or
20495   (at your option) any later version.
20497   GNU Emacs is distributed in the hope that it will be useful,
20498   but WITHOUT ANY WARRANTY; without even the implied warranty of
20499   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20500   GNU General Public License for more details.
20502   You should have received a copy of the GNU General Public License
20503   along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.