]> code.delx.au - gnu-emacs/blob - src/ChangeLog
src/doc.c: Fix bug#13034.
[gnu-emacs] / src / ChangeLog
1 2012-11-30 Juanma Barranquero <lekktu@gmail.com>
2
3 * doc.c (Fdocumentation): Re-add handling of function-documentation,
4 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
5
6 2012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
7
8 * xdisp.c (window_outdated): Remove eassert since it hits
9 some suspicious corner cases (see Bug#13007 and Bug#13012).
10 (mode_line_update_needed): New function.
11 (redisplay_internal, redisplay_window): Use it.
12 (ensure_selected_frame): New function.
13 (redisplay_internal, unwind_redisplay): Use it.
14 (redisplay_internal): Move comment about buffer_shared...
15 (buffer_shared_and_changed): ...near to its real use.
16
17 2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
18
19 * callproc.c (Fcall_process): Don't misreport vfork failure.
20
21 2012-11-28 Paul Eggert <eggert@cs.ucla.edu>
22
23 * callproc.c (Fcall_process): Fix vfork portability problems.
24 Do not assume that fd[0], count, filefd, and save_environ survive
25 vfork. Fix bug whereby wrong errno value could be reported for
26 pipe failure. Some minor cleanups, too, as follows. Move buf and
27 bufsize to the context where they're needed. Change new_argv to
28 be of type char **, as this is more convenient and avoids casts.
29 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
30 Now local constants, not macros.
31
32 2012-11-18 Kenichi Handa <handa@gnu.org>
33
34 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
35 for the variable "f".
36
37 2012-11-13 Kenichi Handa <handa@gnu.org>
38
39 * font.c (font_unparse_xlfd): Exclude special characters from the
40 generating XLFD name.
41
42 2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
43
44 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
45 * dired.c (stat_uname, stat_gname):
46 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
47
48 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
49 * dired.c (directory_files_internal, file_name_completion):
50 Assume EAGAIN and EINTR are defined.
51
52 * fileio.c (Fcopy_file): Assume EISDIR is defined.
53 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
54 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
55 * lread.c (readbyte_from_file): Assume EINTR is defined.
56 * process.c (wait_reading_process_output, send_process) [subprocesses]:
57 Assume EIO and EAGAIN are defined.
58 * unexcoff.c (write_segment): Assume EFAULT is defined.
59
60 2012-11-27 Eli Zaretskii <eliz@gnu.org>
61
62 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
63 (Bug#11964)
64
65 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
66 highlighting on the frame was cleared. Prevents assertion
67 violations when repeatedly clicking on the "Top" link of the
68 "bread-crumbs" in Info buffers.
69
70 2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
71
72 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
73
74 2012-11-24 Ken Brown <kbrown@cornell.edu>
75
76 * keyboard.c (HAVE_MOUSE):
77 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
78 were always defined.
79
80 2012-11-24 Eli Zaretskii <eliz@gnu.org>
81
82 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
83 between bpos_covered and bpos_max. This fixes cursor display when
84 several display strings follow each other.
85
86 * .gdbinit (pgx): If the glyph's object is a string, display the
87 pointer to string data, rather than the value of the string object
88 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
89
90 * indent.c (Fvertical_motion): If the starting position is covered
91 by a display string, return to one position before that, to avoid
92 overshooting it inside move_it_to. (Bug#12930)
93
94 2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
95
96 * frame.h (struct frame): Remove display_preempted member
97 since all users are dead long ago.
98 * nsterm.h (struct x_output): Use the only dummy member.
99 * w32menu.c (pending_menu_activation): Remove since not
100 really used.
101 (set_frame_menubar): Adjust user.
102 * w32term.h (struct x_output): Drop outdated #if 0 code.
103 (struct w32_output): Use bitfields for explicit_parent,
104 asked_for_visible and menubar_active members. Drop
105 unused pending_menu_activation member.
106 * xterm.h (struct x_output): Drop outdated #if 0 code.
107 Use bitfields for explicit_parent, asked_for_visible,
108 has_been_visible and net_wm_state_hidden_seen members.
109
110 2012-11-23 Eli Zaretskii <eliz@gnu.org>
111
112 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
113 of a literal "/". (Bug#12955)
114 (gl-stamp): Invoke fc.exe directly, not through cmd.
115
116 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
117
118 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
119 * dired.c: Assume HAVE_DIRENT_H.
120 (NAMLEN): Remove, replacing with ...
121 (dirent_namelen): New function. All uses changed. Use the GNU macro
122 _D_EXACT_NAMELEN if available, as it's faster than strlen.
123 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
124 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
125 * makefile.w32-in (DIR_H): Remove. All uses replaced with
126 $(NT_INC)/dirent.h.
127 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
128 * ndir.h: Rename to ../nt/inc/dirent.h.
129 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
130 Do not include <dirent.h>; no longer needed.
131 * w32.c: Include <dirent.h> rather than "ndir.h".
132
133 2012-11-23 Chong Yidong <cyd@gnu.org>
134
135 * xftfont.c (xftfont_open): Remove duplicate assignment.
136
137 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
138
139 * alloc.c (Fgarbage_collect): Unblock input after clearing
140 gc_in_progress to avoid note_mouse_highlight glitch with GC.
141 * frame.h (FRAME_MOUSE_UPDATE): New macro.
142 * msdos.c (IT_frame_up_to_date): Use it here...
143 * w32term.c (w32_frame_up_to_date): ...here...
144 * xterm.c (XTframe_up_to_date): ...and here...
145 * nsterm.m (ns_frame_up_to_date): ...but not here.
146 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
147 Adjust users.
148 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
149 Do not check whether GC is in progress.
150
151 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
152
153 * xdisp.c (window_buffer_changed): New function.
154 (update_menu_bar, update_tool_bar): Use it to
155 simplify large 'if' statements.
156 (redisplay_internal): Generalize commonly used
157 'tail' and 'frame' local variables.
158
159 2012-11-22 Eli Zaretskii <eliz@gnu.org>
160
161 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
162 with Windows system header.
163
164 2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
165
166 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
167 * alloc.c: Assume unistd.h exists.
168 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
169 * sysdep.c (get_current_dir_name): Assume getcwd exists.
170 (getwd) [USG]: Remove; no longer needed.
171 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
172 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
173 * w32.h (getcwd): Remove decl.
174
175 2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
176
177 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
178 Make it set selected_window as well.
179 (update_tool_bar): Use it.
180
181 2012-11-21 Ken Brown <kbrown@cornell.edu>
182
183 * emacs.c (main): Set the G_SLICE environment variable for all
184 Cygwin builds, not just GTK builds. See
185 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
186
187 2012-11-21 Eli Zaretskii <eliz@gnu.org>
188
189 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
190 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
191 Define for the MSVC compiler.
192
193 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
194
195 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
196 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
197 dostounix_filename. Prevents crashes down the road, because
198 dostounix_filename assumes it gets a unibyte string. Reported by
199 Michel de Ruiter <michel@sentient.nl>, see
200 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
201
202 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
203
204 Conflate Qnil and Qunbound for `symbol-function'.
205 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
206 * lread.c (init_obarray): Set `function' fields to Qnil.
207 * eval.c (Fcommandp): Ignore Qunbound.
208 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
209 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
210 Test NILP rather than Qunbound.
211 (Ffmakunbound): Set to Qnil.
212 (Fsymbol_function): Never signal an error.
213 (Finteractive_form): Ignore Qunbound.
214
215 2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
216
217 * eval.c (interactive_p): Remove no-longer-used decl.
218
219 2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
220
221 * xdisp.c (buffer_shared): Adjust comment.
222 (buffer_shared_and_changed): New function.
223 (prepare_menu_bars, redisplay_internal): Use it to
224 decide whether all windows or frames should be updated.
225 (window_outdated): New function.
226 (text_outside_line_unchanged_p, redisplay_window): Use it.
227 (redisplay_internal): Likewise. Fix indentation.
228
229 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
230
231 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
232 (syms_of_eval): Remove corresponding defsubr.
233 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
234
235 2012-11-19 Daniel Colascione <dancol@dancol.org>
236
237 * w32fns.c (Fx_file_dialog):
238 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
239 cygwin_convert_file_name*.
240
241 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
242 Rename cygwin_convert_path* to cygwin_convert_file_name*.
243
244 2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
245
246 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
247
248 2012-11-18 Eli Zaretskii <eliz@gnu.org>
249
250 * w32select.c: Include w32common.h before w32term.h, so that
251 windows.h gets included before w32term.h uses some of its
252 features, see below.
253
254 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
255 New typedefs.
256 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
257 New prototypes.
258 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
259
260 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
261
262 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
263 (ns_select): Return at once if events are held (Bug#12834).
264
265 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
266
267 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
268 Needed following 2012-10-20 change. (Bug#12902)
269
270 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
271
272 * w32proc.c (waitpid): Remove unused label get_result.
273
274 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
275
276 * makefile.w32-in (SYSWAIT_H): New macro.
277 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
278 ($(BLD)/sysdep.$(O)): Update dependencies.
279
280 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
281
282 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
283 * callproc.c (relocate_fd): Assume F_DUPFD.
284 * emacs.c, term.c (O_RDWR): Remove.
285 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
286 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
287 * nsterm.m: Assume <fcntl.h> exists.
288 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
289 (create_pty, Fmake_network_process, server_accept_connection)
290 (wait_reading_process_output, init_process_emacs):
291 Assume O_NONBLOCK.
292 (wait_reading_process_output): Put in a special case for WINDOWSNT
293 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
294 It's not clear this is needed, but it's a more-conservative change.
295 (create_process): Assume FD_CLOEXEC.
296 (create_process, create_pty): Assume O_NOCTTY.
297 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
298 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
299 Omit if not DOS_NT, since F_GETFL is not defined there.
300 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
301 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
302 (O_NOCTTY): Remove.
303 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
304 lack it, since gnulib guarantees this.
305 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
306
307 2012-11-17 Eli Zaretskii <eliz@gnu.org>
308
309 * w32.c (faccessat): Pretend that directories have the execute bit
310 set. Emacs expects that, e.g., in files.el:cd-absolute.
311
312 * w32proc.c (create_child): Don't clip the PID of the child
313 process to fit into an Emacs integer, as this is no longer a
314 restriction.
315 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
316 reaping only the process specified by PID argument, if that is
317 positive. Use PID instead of dead_child to know which process to
318 reap. Wait for the child to die only if WNOHANG is not in
319 OPTIONS.
320 (sys_select): Don't set dead_child.
321
322 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
323 as it is no longer needed.
324
325 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
326 no longer needed.
327 (record_child_status_change): Remove the setting of
328 record_at_most_one_child for the !WNOHANG case.
329
330 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
331
332 Fix problems in ns port found by static checking.
333 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
334 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
335 not to process group.
336 (ns_select): Use emacs_write, not write, as that's more robust
337 in the presence of signals.
338 (fd_handler:): Check for read errors.
339
340 2012-11-16 Glenn Morris <rgm@gnu.org>
341
342 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
343
344 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
345
346 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
347
348 2012-11-16 Eli Zaretskii <eliz@gnu.org>
349
350 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
351 use the same value of thread handle.
352 (start_timer_thread): If the timer thread exited (due to error),
353 clean up by closing the two handles it used. Duplicate the caller
354 thread's handle here, so it gets duplicated only once, when
355 launching the timer thread. Set priority of the timer thread, not
356 the caller thread.
357 (getitimer): Don't duplicate the caller thread's handle here.
358 (Bug#12832)
359
360 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
361
362 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
363 called (Bug#12834).
364
365 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
366
367 Remove no-longer-used pty_max_bytes variable.
368 * process.c (pty_max_bytes): Remove; unused.
369 (send_process): Do not set it.
370
371 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
372
373 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
374 Update dependencies.
375
376 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
377
378 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
379 This follows up on the 2012-09-29 patch that removed indirection
380 for the 'function' field. Reported by Sergey Vinokurov in
381 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
382
383 2012-11-14 Eli Zaretskii <eliz@gnu.org>
384
385 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
386 different name, as the MS runtime does not have such a function,
387 and probably never will.) All callers changed. Ignore DIRFD
388 value if PATH is an absolute file name, to match Posix spec
389 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
390 symlinks.
391
392 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
393
394 * xdisp.c (echo_area_display, redisplay_internal):
395 Omit redundant check whether frame_garbaged is set.
396
397 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
398
399 Use faccessat, not access, when checking file permissions (Bug#12632).
400 This fixes a bug that has been present in Emacs since its creation.
401 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
402 which must set some sort of record. (Torek's bug report was against
403 a predecessor of GNU Emacs, but GNU Emacs happened to have the
404 same common flaw.) See Torek's Usenet posting
405 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
406 Posted: Fri Apr 8 14:18:56 1983.
407 * Makefile.in (LIB_EACCESS): New macro.
408 (LIBES): Use it.
409 * callproc.c (init_callproc):
410 * charset.c (init_charset):
411 * fileio.c (check_existing, check_executable, check_writable)
412 (Ffile_readable_p):
413 * lread.c (openp, load_path_check):
414 * process.c (allocate_pty):
415 * xrdb.c (file_p):
416 Use effective UID when checking permissions, not real UID.
417 * callproc.c (init_callproc):
418 * charset.c (init_charset):
419 * lread.c (load_path_check, init_lread):
420 Test whether directories are accessible, not merely whether they exist.
421 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
422 * fileio.c (check_existing, check_executable, check_writable)
423 (Ffile_readable_p):
424 Use symbolic names instead of integers for the flags, as they're
425 portable now.
426 (check_writable): New arg AMODE. All uses changed.
427 Set errno on failure.
428 (Ffile_readable_p): Use faccessat, not stat + open + close.
429 (Ffile_writable_p): No need to call check_existing + check_writable.
430 Just call check_writable and then look at errno. This saves a syscall.
431 dir should never be nil; replace an unnecessary runtime check
432 with an eassert. When checking the parent directory of a nonexistent
433 file, check that the directory is searchable as well as writable, as
434 we can't create files in unsearchable directories.
435 (file_directory_p): New function, which uses 'stat' on most platforms
436 but faccessat with D_OK (for efficiency) if WINDOWSNT.
437 (Ffile_directory_p, Fset_file_times): Use it.
438 (file_accessible_directory_p): New function, which uses a single
439 syscall for efficiency.
440 (Ffile_accessible_directory_p): Use it.
441 * xrdb.c (file_p): Use file_directory_p.
442 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
443 * lread.c (openp): When opening a file, use fstat rather than
444 stat, as that avoids a permissions race. When not opening a file,
445 use file_directory_p rather than stat.
446 (dir_warning): First arg is now a usage string, not a format.
447 Use errno. All uses changed.
448 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
449 that merely introduced a race.
450 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
451 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
452 and similarly for the other O_* flags.
453 * w32.c (sys_faccessat): Rename from sys_access and switch to
454 faccessat's API. All uses changed.
455 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
456 (magic_db): Rename from magic_file_p.
457 (magic_db, search_magic_path): Return an XrmDatabase rather than a
458 char *, so that we don't have to test for file existence
459 separately from opening the file for reading. This removes a race
460 fixes a permission-checking problem, and simplifies the code.
461 All uses changed.
462 (file_p): Remove; no longer needed.
463
464 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
465
466 Omit glyphs initialization at startup.
467 * dispnew.c (glyphs_initialized_initially_p): Remove.
468 (adjust_frame_glyphs_initially): Likewise. Adjust users.
469 (Fredraw_frame): Move actual code from here...
470 (redraw_frame): ...to here. Add eassert. Adjust comment.
471 (Fredraw_display): Use redraw_frame.
472 * xdisp.c (clear_garbaged_frames): Likewise.
473
474 2012-11-13 Eli Zaretskii <eliz@gnu.org>
475
476 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
477 passed to pint2str and pint2hrstr to be at most the size of the
478 frame's decode_mode_spec_buffer. This avoids crashes with very
479 large values of FIELD_WIDTH argument to decode_mode_spec.
480 (Bug#12867)
481
482 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
483
484 Fix a race with verify-visited-file-modtime (Bug#12863).
485 Since at least 1991 Emacs has ignored an mtime difference of no
486 more than one second, but my guess is that this was to work around
487 file system bugs that were fixed long ago. Since the race is
488 causing problems now, let's remove that code.
489 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
490 whose time stamp is off by no more than a second. Insist that the
491 file time stamps match exactly.
492
493 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
494
495 * frame.h (struct frame): Convert external_tool_bar member to
496 1-bit unsigned bitfield.
497 * termhooks.h (struct terminal): Remove mouse_moved member since
498 all users are long dead. Adjust comment on mouse_position_hook.
499
500 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
501
502 Simplify by using FOR_EACH_FRAME here and there.
503 * frame.c (next_frame, prev_frame, other_visible_frames)
504 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
505 * w32term.c (x_window_to_scroll_bar): Likewise.
506 * window.c (window_list): Likewise.
507 * xdisp.c (x_consider_frame_title): Likewise.
508 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
509 * xfns.c (x_window_to_frame, x_any_window_to_frame)
510 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
511 * xmenu.c (menubar_id_to_frame): Likewise.
512 * xselect.c (frame_for_x_selection): Likewise.
513 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
514 (x_window_to_menu_bar): Likewise.
515 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
516
517 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
518
519 * data.c (Qdefalias_fset_function): Now static.
520
521 Another tweak to vectorlike_header change.
522 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
523 Remove, and replace all uses with ...
524 (next_in_free_list, set_next_in_free_list):
525 New functions, which respect C's aliasing rules better.
526
527 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
528
529 * window.c (list4i): Rename from 'quad'. All uses changed.
530 Needed because <sys/types.h> defines 'quad' on Solaris 10.
531
532 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
533
534 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
535 warning about mixing declarations and code in ISO C90.
536
537 2012-11-10 Martin Rudalics <rudalics@gmx.at>
538
539 * window.c (Fsplit_window_internal): Set combination limit of
540 new parent window to t iff Vwindow_combination_limit is t;
541 fixing a regression introduced with the change from 2012-09-22.
542 (Fset_window_combination_limit): Fix doc-string.
543
544 2012-11-10 Eli Zaretskii <eliz@gnu.org>
545
546 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
547 amount when the scroll margins are too large. When scrolling
548 backwards in the buffer, give up if cannot reach point or the
549 scroll margin within a reasonable number of screen lines.
550 Fixes point position in window under scroll-up/down-aggressively when
551 point is positioned many lines beyond the window top/bottom.
552 (Bug#12811)
553
554 * ralloc.c (relinquish): If real_morecore fails to return memory
555 to the system, don't crash; instead, leave the last heap
556 unchanged and return. (Bug#12774)
557
558 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
559
560 * lisp.h (AUTOLOADP): New macro.
561 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
562 * data.c (Ffset): Remove special ad-advice-info handling.
563 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
564 (Fsubr_arity): CSE.
565 (Finteractive_form): Simplify.
566 (Fquo): Don't insist on having at least 2 arguments.
567 (Qdefalias_fset_function): New var.
568
569 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
570
571 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
572
573 * nsfont.m (Qcondensed, Qexpanded): New variables.
574 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
575 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
576
577 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
578
579 Fix recently introduced crash on MS-Windows (Bug#12839).
580 * w32term.h (struct scroll_bar): Use convenient header.
581 (SCROLL_BAR_VEC_SIZE): Remove.
582 * w32term.c (x_scroll_bar_create): Use VECSIZE.
583
584 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
585
586 Tweak last vectorlike_header change.
587 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
588 vectorlike object on the free list. This is introduced to avoid
589 some (but not all) pointer casting and aliasing problems, see
590 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
591 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
592 objects.
593 (xvectype, xvecsize): Use them to examine Lisp_Object values.
594
595 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
596
597 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
598 been removed, so remove them here also.
599
600 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
601
602 * doc.c (Fdocumentation): Handle new property
603 dynamic-docstring-function to replace the old ad-advice-info.
604
605 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
606
607 * fns.c (Qeql, hashtest_eq): Now static.
608
609 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
610
611 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
612 * fns.c (hashfn_eq, hashfn_eql, sxhash):
613 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
614 * buffer.c (compare_overlays): Use XLI rather than XHASH.
615
616 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
617
618 Use same hash function for hashfn_profiler as for hash_string etc.
619 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
620 * lisp.h (sxhash_combine): New inline function, with the contents
621 of the old SXHASH_COMBINE.
622 * profiler.c (hashfn_profiler): Use it, instead of having a
623 special hash function containing a comparison that always yields 1.
624
625 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
626
627 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
628 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
629 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
630 Remove unused vars.
631
632 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
633
634 * image.c (xpm_make_color_table_h): Fix compiler error because
635 make_hash_table changed.
636
637 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
638
639 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
640
641 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
642
643 Use ad-hoc comparison function for the profiler's hash-tables.
644 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
645 (make_log): Use them.
646 (handle_profiler_signal): Don't inhibit quit any longer since we don't
647 call Fequal any more.
648 (Ffunction_equal): New function.
649 (cmpfn_profiler, hashfn_profiler): New functions.
650 (syms_of_profiler): Initialize them.
651 * lisp.h (struct hash_table_test): New struct.
652 (struct Lisp_Hash_Table): Use it.
653 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
654 * fns.c (make_hash_table): Take a struct to describe the test.
655 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
656 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
657 (hash_lookup, hash_remove_from_table): Move assertion checking of
658 hashfn result here. Check hash-equality before calling cmpfn.
659 (Fmake_hash_table): Adjust call to make_hash_table.
660 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
661 (syms_of_fns): Initialize them.
662 * emacs.c (main): Move syms_of_fns earlier.
663 * xterm.c (syms_of_xterm):
664 * category.c (hash_get_category_set): Adjust call to make_hash_table.
665 * print.c (print_object): Adjust to new hash-table struct.
666 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
667
668 2012-11-08 Eli Zaretskii <eliz@gnu.org>
669
670 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
671 value of w32-scroll-lock-modifier is neither nil nor one of the
672 known key modifiers. (Bug#12806)
673
674 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
675
676 Shrink struct vectorlike_header to the only size field.
677 * lisp.h (enum pvec_type): Avoid explicit enum member values.
678 Adjust comment.
679 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
680 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
681 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
682 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
683 information from the vector header. Adjust comment.
684 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
685 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
686 layout.
687 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
688 (struct vectorlike_header): Remove next member. Adjust comment.
689 (struct Lisp_Subr): Add convenient header. Adjust comment.
690 (allocate_pseudovector): Adjust prototype.
691 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
692 (sweep_string, lisp_malloc): Remove useless prototypes.
693 (enum mem_type): Adjust comment.
694 (NEXT_IN_FREE_LIST): New macro.
695 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
696 (Fmake_bool_vector): Likewise.
697 (struct large_vector): New type to represent allocation unit for
698 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
699 (large_vectors): Change type to struct large_vector.
700 (allocate_vector_from_block): Simplify.
701 (PSEUDOVECTOR_NBYTES): Replace with...
702 (vector_nbytes): ...new function. Adjust users.
703 (sweep_vectors): Adjust processing of large vectors.
704 (allocate_vectorlike): Likewise.
705 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
706 Add easserts. Adjust XSETPVECTYPESIZE usage.
707 (allocate_buffer): Use BUFFER_PVEC_INIT.
708 (live_vector_p): Adjust to match large vector.
709 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
710 * buffer.h (struct buffer): Add next member.
711 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
712 New macros.
713 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
714 * fns.c (internal_equal): Adjust to match enum pvec_type change.
715 (copy_hash_table): Adjust to match vector header change.
716 * lread.c (defsubr): Use XSETPVECTYPE.
717 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
718 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
719 (xvecsize): New command.
720
721 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
722
723 * keyboard.c (event_to_kboard): Do not dereference
724 frame_or_window field of SELECTION_REQUEST_EVENT
725 and SELECTION_CLEAR_EVENT events (Bug#12814).
726 * xterm.h (struct selection_input_event): Adjust comment.
727
728 2012-11-07 Eli Zaretskii <eliz@gnu.org>
729
730 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
731 such as Scroll Lock, if the respective keys are treated as
732 function keys, not as modifiers. This avoids destroying non-ASCII
733 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
734
735 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
736
737 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
738
739 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
740
741 Restore some duplicate definitions (Bug#12814).
742 This undoes part of the 2012-11-03 changes. Some people build
743 with plain -g rather than with -g3, and they need the duplicate
744 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
745 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
746 Define as macros, as well as as enums or as constants.
747
748 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
749
750 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
751 to keypad keys (Bug#12816).
752
753 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
754
755 Minor adjustments of recently-changed frame functions.
756 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
757 known to be a frame (we're in the FRAMEP branch).
758 * lisp.h (Qframep): Remove decl. frame.h declares this.
759 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
760 since they're meant for Lisp fixnum values.
761
762 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
763
764 * window.c (Fwindow_combination_limit): Revert to the only
765 required argument and adjust docstring as suggested in
766 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
767 by Martin Rudalics <rudalics@gmx.at>.
768
769 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
770
771 Widely used frame validity and checking functions.
772 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
773 * frame.c (decode_live_frame, decode_any_frame): New functions.
774 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
775 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
776 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
777 (Fframe_pointer_visible_p): Use decode_any_frame.
778 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
779 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
780 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
781 (Fframe_focus): Likewise. Allow zero number of arguments.
782 Adjust docstring.
783 (frame_buffer_list, frame_buffer_predicate): Remove.
784 * lisp.h (frame_buffer_predicate): Remove prototype.
785 * buffer.c (Fother_buffer): Use decode_any_frame.
786 * xdisp.c (Ftool_bar_lines_needed): Likewise.
787 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
788 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
789 (Fclose_font, Ffont_info): Use decode_live_frame.
790 * fontset.c (check_fontset_name): Likewise.
791 * terminal.c (Fframe_terminal): Likewise.
792 * w32fns.c (check_x_frame): Likewise.
793 * window.c (Fminibuffer_window, Fwindow_at)
794 (Fcurrent_window_configuration): Likewise.
795 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
796 Likewise. Allow zero number of arguments. Adjust docstring.
797 * dispnew.c (Fredraw_frame): Likewise.
798 * xfaces.c (frame_or_selected_frame): Remove.
799 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
800 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
801 (Fframe_face_alist): Use decode_live_frame.
802 * xfns.c (check_x_frame): Likewise.
803
804 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
805
806 * window.c (quad): New function.
807 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
808 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
809 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
810 (Fwindow_line_height): Use it.
811 (Fwindow_fringes): Use list3.
812 (Fwindow_scroll_bars): Use list4.
813 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
814 (Fwindow_combination_limit): Allow zero number of arguments.
815
816 2012-11-05 Eli Zaretskii <eliz@gnu.org>
817
818 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
819
820 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
821 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
822 file descriptor 2 for standard error. (Bug#12805)
823
824 2012-11-05 Chong Yidong <cyd@gnu.org>
825
826 * process.c (wait_reading_process_output): Revert previous change.
827
828 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
829
830 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
831 This removes code that has been obsolete since around 1990.
832 * callproc.c (Fcall_process):
833 * emacs.c (main):
834 * process.c (create_process):
835 * term.c (dissociate_if_controlling_tty):
836 Assume setsid exists.
837 * callproc.c (child_setup): Assume setpgid exists and behaves as
838 per POSIX.1-1988 or later.
839 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
840 * emacs.c (shut_down_emacs):
841 * sysdep.c (sys_suspend, init_foreground_group):
842 Assume getpgrp behaves as per POSIX.1-1998 or later.
843 * msdos.c (setpgrp): Remove.
844 (tcgetpgrp, setpgid, setsid): New functions.
845 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
846 * term.c (no_controlling_tty): Remove; unused.
847 * w32proc.c (setpgrp): Remove.
848 (setsid, tcgetpgrp): New functions.
849
850 Simplify by assuming __fpending.
851 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
852 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
853 Do not assume that __fpending's result fits in int.
854
855 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
856
857 Remove EMACS_OUTQSIZE+sleep hack.
858 * dispnew.c (update_frame_1): Remove hack for terminals slower
859 than 2400 bps, which throttled Emacs by having it sleep.
860 This code hasn't worked since at least 2007, when the multi-tty stuff
861 was added, and anyway those old terminals are long dead.
862 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
863 without the dispnew.c change, as dispnew.c doesn't include systty.h.
864
865 Fix data-loss with --version (Bug#9574).
866 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
867 as we can't assume that emacs_strerror is initialized, and strerror
868 is good enough here.
869 (main): Invoke atexit earlier, to catch earlier instances of
870 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
871
872 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
873
874 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
875 (keyDown): Remap keypad keys to X11 virtual key codes.
876
877 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
878
879 Fix data-loss with --batch (Bug#9574).
880 * emacs.c: Include <close-stream.h>.
881 (close_output_streams): New function.
882 (main): Pass it to atexit, so that Emacs closes stdout and stderr
883 and handles errors appropriately.
884 (Fkill_emacs): Don't worry about flushing, as close_output_stream
885 does that now.
886
887 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
888 The symptom is a diagnostic "GLib-WARNING **: In call to
889 g_spawn_sync(), exit status of a child process was requested but
890 SIGCHLD action was set to SIG_IGN and ECHILD was received by
891 waitpid(), so exit status can't be returned." The diagnostic
892 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
893 The real bug is a race condition between Emacs and glib: Emacs
894 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
895 so that glib can't find it. Work around the bug by invoking
896 waitpid only on subprocesses that Emacs itself creates.
897 * process.c (create_process, record_child_status_change):
898 Don't use special value -1 in pid field, as the caller now must
899 know the pid rather than having the callee infer it.
900 The inference was sometimes incorrect anyway, due to another race.
901 (create_process): Set new 'alive' member if child is created.
902 (process_status_retrieved): New function.
903 (record_child_status_change): Use it.
904 Accept negative 1st argument, which means to wait for the
905 processes that Emacs already knows about. Move special-case code
906 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
907 processes that have already been waited for, by testing and
908 clearing new 'alive' member.
909 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
910 now does this internally.
911 (handle_child_signal): Let record_child_status_change do all
912 the work, since we do not want to reap all exited child processes,
913 only the child processes that Emacs itself created.
914 * process.h (Lisp_Process): New boolean member 'alive'.
915
916 Omit duplicate definitions no longer needed with gcc -g3.
917 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
918 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
919 Define only as macros. There's no longer any need to also define
920 these symbols as enums or as constants, since we now assume
921 gcc -g3 when debugging.
922
923 2012-11-03 Eli Zaretskii <eliz@gnu.org>
924
925 * lisp.mk: Adjust comments to the fact that term/internal is now
926 loaded from loadup.el.
927
928 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
929 (msdos_fatal_signal): New function.
930 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
931 its argument list.
932
933 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
934 for GCC versions before 4.
935 (emacs_raise): Define to call msdos_fatal_signal.
936
937 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
938 iterator when starting in the middle of a display or overlay
939 string. (Bug#12745)
940
941 2012-11-03 Chong Yidong <cyd@gnu.org>
942
943 * process.c (wait_reading_process_output): Clean up the last
944 change.
945
946 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
947
948 * process.c (wait_reading_process_output): Avoid a race condition
949 with SIGIO delivery (Bug#11536).
950
951 2012-11-03 Chong Yidong <cyd@gnu.org>
952
953 * buffer.c (cursor_type): Untabify docstring.
954
955 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
956
957 * frame.h (struct frame): Drop can_have_scroll_bars member
958 which is meaningless for a long time. Adjust comments.
959 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
960 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
961
962 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
963
964 * window.c (decode_next_window_args): Update window arg after
965 calling decode_live_window and so fix crash reported at
966 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
967 by Juanma Barranquero <lekktu@gmail.com>.
968 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
969 * font.c (Ffont_at): Likewise.
970
971 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
972
973 * widget.c (resize_cb): New function.
974 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
975 (EmacsFrameResize): Check if all is up to date before changing frame
976 size.
977
978 2012-11-02 Eli Zaretskii <eliz@gnu.org>
979
980 Implement backtrace output for fatal errors on MS-Windows.
981 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
982 (BACKTRACE_LIMIT_MAX): New macro.
983 (w32_backtrace): New function.
984 (emacs_abort): Use w32_backtrace when the user chooses not to
985 attach a debugger. Update the text of the abort dialog.
986
987 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
988
989 Window-related stuff cleanup here and there.
990 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
991 Use decode_any_window.
992 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
993 * xdisp.c (Fformat_mode_line): Likewise.
994 * font.c (Ffont_at): Use decode_live_window.
995 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
996 * window.c (decode_next_window_args): Likewise.
997 (decode_any_window): Remove static.
998 * window.h (decode_any_window): Add prototype.
999 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
1000 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
1001 respectively.
1002
1003 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
1004
1005 Remove pad from struct input_event.
1006 * termhooks.h (struct input_event): Remove padding field.
1007 Adjust comment.
1008 * keyboard.c (event_to_kboard): Simplify because frame_or_window
1009 member is never cons for a long time. Adjust comment.
1010 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
1011 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
1012 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
1013 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
1014
1015 2012-11-01 Eli Zaretskii <eliz@gnu.org>
1016
1017 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
1018
1019 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
1020
1021 Fix crash when using Emacs as commit editor for git (Bug#12697).
1022 * callproc.c (setpgrp): Remove macro, as we now use setpgid
1023 and it is configured in conf_post.h.
1024 (Fcall_process): Don't invoke both setsid and setpgid; the former
1025 is enough, if it exists.
1026 * callproc.c (Fcall_process, child_setup):
1027 * process.c (create_process): Use setpgid.
1028 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
1029 for the real thing.
1030 * dispnew.c (init_display): Initialize the foreground group
1031 if we are running a tty display.
1032 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
1033 * lisp.h (init_foreground_group): New decl.
1034 * sysdep.c (inherited_pgroup): New static var.
1035 (init_foreground_group, tcsetpgrp_without_stopping)
1036 (narrow_foreground_group, widen_foreground_group): New functions.
1037 (init_sys_modes): Narrow foreground group.
1038 (reset_sys_modes): Widen foreground group.
1039
1040 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
1041
1042 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
1043
1044 2012-10-31 Martin Rudalics <rudalics@gmx.at>
1045
1046 * minibuf.c (read_minibuf): Restore current buffer since
1047 choose_minibuf_frame calling Fset_frame_selected_window may
1048 change it (Bug#12766).
1049
1050 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
1051
1052 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
1053
1054 2012-10-30 Kenichi Handa <handa@gnu.org>
1055
1056 * font.c (Ffont_at): If WINDOW is specified and it is not
1057 displaying the current buffer, signal an error.
1058
1059 2012-10-29 Daniel Colascione <dancol@dancol.org>
1060
1061 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
1062 In preparation for fixing bug#12739, move these functions from
1063 here...
1064
1065 * coding.h, coding.c: ... to here, and compile them only when
1066 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
1067 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
1068
1069 2012-10-28 Eli Zaretskii <eliz@gnu.org>
1070
1071 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
1072 (timer_loop, getitimer, setitimer): Use it instead of
1073 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
1074 'clock'.
1075 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
1076 literal 10000.
1077
1078 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
1079
1080 * nsterm.m (NO_APPDEFINED_DATA): New define.
1081 (last_appdefined_event_data): New variable
1082 (last_appdefined_event): Remove.
1083 (ns_select): Initialize t from last_appdefined_event_data instead
1084 of [last_appdefined_event data1].
1085 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
1086 remove last_appdefined_event (Bug#12698).
1087
1088 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
1089
1090 * frame.c (x_set_font): Catch internal error.
1091
1092 2012-10-27 Eli Zaretskii <eliz@gnu.org>
1093
1094 Avoid overflow in w32 implementation of interval timers.
1095 When possible, for ITIMER_PROF count only times the main thread
1096 actually executes.
1097 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
1098 'volatile ULONGLONG' types. All the other data which was
1099 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
1100 (GetThreadTimes_Proc): New typedef.
1101 (w32_get_timer_time): New function, returns a suitable time value
1102 for the timer.
1103 (timer_loop): Enter critical section when accessing ULONGLONG
1104 values of the itimer_data struct, as these accesses are no longer
1105 atomic. Call 'w32_get_timer_time' instead of 'clock'.
1106 Remove unused variable.
1107 (init_timers): Initialize s_pfn_Get_Thread_Times.
1108 (start_timer_thread): Don't assign itimer->caller_thread here.
1109 (getitimer): Assign itimer->caller_thread here.
1110 (setitimer): Always call getitimer to get the value of ticks_now.
1111 (sys_spawnve): Avoid compiler warning about format mismatch.
1112
1113 2012-10-26 Eli Zaretskii <eliz@gnu.org>
1114
1115 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
1116 mouse movement events if the menu bar is active. This avoids
1117 producing a busy "hour-glass" cursor by Windows if the mouse
1118 pointer is positioned over a tooltip shown for some menu item.
1119
1120 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
1121
1122 Don't assume process IDs fit in int.
1123 * emacs.c (shut_down_emacs) [!DOS_NT]:
1124 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
1125 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
1126 Use pid_t, not int, to store process IDs, as 'int'
1127 is not wide enough on a few platforms (e.g., AIX and IRIX).
1128
1129 2012-10-23 Kenichi Handa <handa@gnu.org>
1130
1131 The following change is to make face-font-rescale-alist work
1132 correctly for non-ASCII fonts.
1133
1134 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
1135 (font_open_for_lface): Handle Vface_font_rescale_alist.
1136
1137 2012-10-23 Chong Yidong <cyd@gnu.org>
1138
1139 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
1140
1141 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
1142
1143 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
1144 for screen font.
1145 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
1146
1147 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
1148 event (Bug#12681).
1149
1150 2012-10-21 Glenn Morris <rgm@gnu.org>
1151
1152 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
1153
1154 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
1155
1156 Port to OpenBSD 5.1.
1157 * frame.c (Fmouse_position, Fmouse_pixel_position):
1158 * xdisp.c (produce_stretch_glyph):
1159 Declare local vars only when they're needed.
1160 This is clearer and avoids a warning on OpenBSD about unused vars.
1161 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
1162 This is safer, and avoids OpenBSD warnings about unused vars.
1163 * keyboard.c (record_menu_key): Remove unnecessary decl.
1164 (poll_timer): Define only if POLL_FOR_INPUT is defined.
1165 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
1166 as our definition clashes with OpenBSD's.
1167 * xfaces.c (load_face_colors, check_lface_attrs)
1168 (get_lface_attributes_no_remap, get_lface_attributes)
1169 (lface_fully_specified_p, x_supports_face_attributes_p)
1170 (tty_supports_face_attributes_p, face_fontset, realize_face)
1171 (realize_x_face, realize_tty_face):
1172 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
1173 merely Lisp_Object *. This is more informative and avoids
1174 a warning on OpenBSD about accessing beyond an object's size.
1175
1176 2012-10-20 Chong Yidong <cyd@gnu.org>
1177
1178 * lread.c (Fload): Doc fix (Bug#12592).
1179
1180 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
1181
1182 * font.c (Ffont_at): Fix previous change.
1183
1184 2012-10-19 Eli Zaretskii <eliz@gnu.org>
1185
1186 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
1187 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
1188 for the reasons.
1189
1190 * alloc.c (NSTATICS): Decrease to 0x800.
1191
1192 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
1193
1194 * fns.c (Fnreverse): Include the problem element when signalling an
1195 error (bug#12677).
1196
1197 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
1198
1199 * nsterm.m (ns_select): Check writefds before call to
1200 FD_ISSET (Bug#12668).
1201
1202 2012-10-18 Daniel Colascione <dancol@dancol.org>
1203
1204 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
1205 (staticpro): If we run out of staticpro slots, die with an
1206 informative error instead of just calling emacs_abort.
1207
1208 2012-10-18 Martin Rudalics <rudalics@gmx.at>
1209
1210 Fix two flaws reported by Dmitry Antipov.
1211 * window.c (Ftemp_output_buffer_show): Remove.
1212 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
1213 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
1214
1215 2012-10-17 Eli Zaretskii <eliz@gnu.org>
1216
1217 * makefile.w32-in ($(BLD)/w32.$(O)):
1218 ($(BLD)/vm-limit.$(O)):
1219 ($(BLD)/term.$(O)):
1220 ($(BLD)/unexw32.$(O)):
1221 ($(BLD)/fileio.$(O)):
1222 ($(BLD)/dispnew.$(O)): Update dependencies.
1223
1224 * w32term.h (w32_initialize_display_info, initialize_w32_display):
1225 Add prototypes.
1226
1227 * w32proc.c: Include ctype.h.
1228
1229 * w32.h (init_environment, check_windows_init_file)
1230 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
1231 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
1232 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
1233 (sys_link): Add prototypes.
1234
1235 * w32.c: Include w32select.h.
1236 (sys_access, e_malloc, sys_select): Add prototypes.
1237 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
1238
1239 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
1240
1241 * unexw32.c: Include lisp.h and w32.h.
1242
1243 * term.c [WINDOWSNT]: Include w32term.h.
1244
1245 * process.c [WINDOWSNT]: Add prototype of sys_select.
1246
1247 * fileio.c [WINDOWSNT]: Include w32.h.
1248
1249 * dispnew.c [WINDOWSNT]: Include w32.h.
1250
1251 * cygw32.c (Fcygwin_convert_path_to_windows)
1252 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
1253 Lisp_Object values. (Bug#12661)
1254
1255 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
1256 to Lisp_Object. (Bug#12661)
1257
1258 2012-10-17 Kenichi Handa <handa@gnu.org>
1259
1260 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
1261 invalidate.
1262
1263 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
1264
1265 * buffer.c (Fkill_buffer): When unchaining the marker,
1266 reset its buffer pointer to NULL (Bug#12652).
1267
1268 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
1269
1270 Do not verify indirection counters of killed buffers (Bug#12579).
1271 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
1272 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
1273
1274 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
1275
1276 * alloc.c (Fmake_byte_code): Fix typo in comment.
1277 * print.c (print_interval): Define as static to match prototype.
1278 * indent.c (disptab_matches_widthtab, recompute_width_table):
1279 Convert to eassert.
1280
1281 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
1282
1283 * editfns.c (get_system_name): Remove.
1284 * lisp.h (get_system_name): Remove prototype.
1285 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
1286 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
1287
1288 2012-10-15 Daniel Colascione <dancol@dancol.org>
1289
1290 * dbusbind.c: Add comment explaining reason for previous change.
1291
1292 2012-10-15 Martin Rudalics <rudalics@gmx.at>
1293
1294 * window.c (Fwindow_end): Rewrite check whether cached position
1295 can be used (Bug#12600).
1296 (resize_frame_windows, grow_mini_window, shrink_mini_window):
1297 Set windows_or_buffers_changed.
1298
1299 2012-10-15 Daniel Colascione <dancol@dancol.org>
1300
1301 * dbusbind.c: Fix cygw32 build break when compiling with dbus
1302 enabled by undefining the symbol "interface", which the platform
1303 headers define to something incompatible.
1304
1305 2012-10-14 Daniel Colascione <dancol@dancol.org>
1306
1307 * image.c (init_tiff_functions, init_imagemagick_functions)
1308 (init_svg_functions): Fix cygw32 build break by using these
1309 functions only when WINDOWSNT _and_ HAVE_NTGUI.
1310
1311 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
1312
1313 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
1314
1315 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
1316
1317 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
1318
1319 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
1320
1321 * coding.c (detect_coding): Set coding->id before calling
1322 this->detector.
1323
1324 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
1325
1326 * fileio.c: Formatting fixes.
1327
1328 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
1329
1330 Fix some stat-related races.
1331 * fileio.c (Fwrite_region): Avoid race condition if a file is
1332 removed or renamed by some other process immediately after Emacs
1333 writes it but before Emacs stats it. Do not assume that stat (or
1334 fstat) succeeds.
1335 * image.c (slurp_file): Resolve the file name with fopen + fstat
1336 rather than stat + fopen.
1337 (pbm_read_file) [0]: Remove unused code with stat race.
1338 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
1339 Remove ineffective code with stat race.
1340
1341 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
1342
1343 * doc.c (get_doc_string): Don't signal an error if the file is missing.
1344
1345 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
1346
1347 * nsterm.m (hold_event_q): New static variable.
1348 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
1349 ! q_event_ptr.
1350 (hold_event): New function.
1351 (ns_read_socket): If hold_event_q have events, store them and
1352 return (Bug#12384).
1353 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
1354 is zero (Bug#12384).
1355
1356 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
1357
1358 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
1359
1360 2012-10-12 Eli Zaretskii <eliz@gnu.org>
1361
1362 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
1363
1364 * fileio.c (check_existing): New function.
1365 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
1366 instead of calling 'stat', when what's needed is to check whether
1367 a file exists. This avoids expensive system calls on MS-Windows.
1368 (Bug#12587)
1369
1370 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
1371
1372 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
1373 determine whether a file exists and is not a directory.
1374
1375 * lisp.h (check_existing): Add prototype.
1376
1377 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
1378
1379 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
1380
1381 2012-10-12 Glenn Morris <rgm@gnu.org>
1382
1383 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
1384
1385 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
1386
1387 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
1388
1389 * eval.c (Fautoload): Remember previous autoload status in load-history.
1390
1391 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
1392
1393 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
1394 * lread.c (load_each_byte, new_backquote_flag, readchar)
1395 (read_filtered_event, lisp_file_lexically_bound_p)
1396 (safe_to_load_version, Fload, complete_filename_p, openp)
1397 (build_load_history, readevalloop, read_escape, read1)
1398 (string_to_number, read_vector, read_list):
1399 * macros.c (Fstart_kbd_macro):
1400 * marker.c (CONSIDER):
1401 * menu.c (parse_single_submenu, digest_single_submenu)
1402 (find_and_return_menu_selection, Fx_popup_menu):
1403 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
1404 (Ftry_completion):
1405 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
1406 (ns_menu_show):
1407 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
1408 (xmenu_show, xdialog_show):
1409 Use bool for booleans.
1410 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
1411 as it's not a predicate. All uses changed. Omit unnecessary
1412 buffer termination.
1413
1414 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
1415
1416 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
1417 (save_excursion_restore): Do not restore mark if it was not saved.
1418
1419 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
1420
1421 * marker.c (cached_modiff): EMACS_INT, not int.
1422
1423 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
1424 instead of having a wrong decl.
1425 * nsmenu.m (waiting_for_input): Remove wrong decl.
1426
1427 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
1428
1429 keyboard.c, keymap.c: Use bool for booleans.
1430 * dispnew.c (sit_for): Distinguish between 3-way display_option
1431 and boolean do_display.
1432 * keyboard.c (single_kboard, this_command_key_count_reset)
1433 (waiting_for_input, echoing, immediate_quit, input_pending)
1434 (interrupt_input, interrupts_deferred, pop_kboard)
1435 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
1436 (command_loop_1, adjust_point_for_property)
1437 (safe_run_hooks_error, input_polling_used, read_char):
1438 (help_char_p, readable_events, kbd_buffer_events_waiting)
1439 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
1440 (lucid_event_type_list_p, get_input_pending):
1441 (gobble_input, menu_separator_name_p, menu_bar_item)
1442 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
1443 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
1444 (keyremap_step, test_undefined, read_key_sequence)
1445 (detect_input_pending, detect_input_pending_ignore_squeezables)
1446 (detect_input_pending_run_timers, requeued_events_pending_p)
1447 (quit_throw_to_read_char, Fset_input_interrupt_mode):
1448 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
1449 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
1450 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
1451 (accessible_keymaps_1, Fkey_description, push_key_description):
1452 (shadow_lookup, struct where_is_internal_data)
1453 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
1454 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
1455 (describe_map, describe_vector):
1456 * menu.c (single_menu_item):
1457 * nsmenu.m (ns_update_menubar):
1458 * process.c (wait_reading_process_output):
1459 * search.c (scan_buffer, scan_newline):
1460 Use bool for boolean.
1461 * keyboard.c (timers_run, swallow_events)
1462 (detect_input_pending_run_timers):
1463 * process.c (wait_reading_process_output):
1464 Use unsigned for counter where wraparound-on-overflow is desired,
1465 since unsigned is guaranteed to have that behavior and signed is not.
1466 (read_char): Use ptrdiff_t for string length.
1467 (get_input_pending): Remove first argument, since it was always
1468 the same pointer-to-int (now pointer-to-boolean) &input_pending,
1469 and behave as if it had that value. Return new value of
1470 input_pending. All callers changed.
1471 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
1472 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
1473 a string length.
1474 * keymap.c (push_key_description): Omit last arg, which was always 1.
1475 All callers changed.
1476
1477 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
1478
1479 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
1480
1481 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
1482 ($(BLD)/term.$(O)): Update dependencies.
1483
1484 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
1485
1486 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
1487 * lisp.h (enum pvec_type): Adjust comments and omit explicit
1488 initializer for PVEC_NORMAL_VECTOR.
1489
1490 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
1491
1492 Clean out old termopts cruft.
1493 * termopts.h (flow_control, meta_key): Remove unused decls.
1494 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
1495 Don't include termopts.h.
1496
1497 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
1498
1499 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
1500
1501 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
1502
1503 * commands.h (immediate_quit): Remove duplicate decl.
1504
1505 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
1506
1507 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
1508 caching.
1509 (nsfont_open): Remove setting of Vfonts_in_cache.
1510 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
1511
1512 2012-10-09 Eli Zaretskii <eliz@gnu.org>
1513
1514 * w32fns.c (w32_last_error): Change the return value to DWORD, to
1515 match what GetLastError returns. Explain why the function is
1516 needed.
1517
1518 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
1519 'is_tooltip_frame', to avoid confusion with its global namesake.
1520
1521 2012-10-08 Daniel Colascione <dancol@dancol.org>
1522
1523 * xdisp.c (start_hourglass): Call w32_note_current_window when
1524 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
1525 build that caused Emacs to display the hourglass cursor forever.
1526
1527 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
1528 which is broken under remote desktop, calculate the number of
1529 colors available for a display based on the display's number of
1530 planes and number of bits per pixel per plane. (bug#10397).
1531
1532 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
1533
1534 * nsfont.m (Vfonts_in_cache): New variable.
1535 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
1536 are used. Add cached fonts to Vfonts_in_cache.
1537 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
1538
1539 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
1540
1541 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
1542 in nt/config.nt.
1543 (FONT_H): Define after FRAME_H.
1544 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
1545 Update dependencies.
1546
1547 * w32term.c: Remove leftover declaration of keyboard_codepage.
1548
1549 2012-10-08 Eli Zaretskii <eliz@gnu.org>
1550
1551 * makefile.w32-in (FONT_H): Add $(FRAME_H).
1552 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
1553 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
1554 (GLOBAL_SOURCES): Add cygw32.c.
1555 ($(BLD)/unexw32.$(O)):
1556 ($(BLD)/w32.$(O)):
1557 ($(BLD)/w32console.$(O)):
1558 ($(BLD)/w32fns.$(O)):
1559 ($(BLD)/w32heap.$(O)):
1560 ($(BLD)/w32menu.$(O)):
1561 ($(BLD)/w32proc.$(O)): Add w32common.h.
1562
1563 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
1564 'const char *'.
1565 (x_to_w32_color): Don't modify the argument, modify a copy instead.
1566
1567 2012-10-08 Daniel Colascione <dancol@dancol.org>
1568
1569 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
1570 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
1571 accidental message numbering hole. Change other messages to
1572 match.
1573
1574 * w32select.h (HAVE_W32SELECT): Remove.
1575
1576 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1577 w32common.h instead of w32heap.h.
1578
1579 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
1580 (get_allocation_unit, get_processor_type, get_w32_major_version)
1581 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
1582 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
1583 (OS_NT, os_subtype, cache_system_info): Move declarations to
1584 w32common.
1585
1586 * w32heap.c: Include w32common.h.
1587 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
1588 (w32_minor_version, w32_build_number, w32_subtype):
1589 Remove duplicate definitions.
1590
1591 * w32fns.c: Include w32common.h; include w32heap.h only in
1592 WINDOWSNT.
1593
1594 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
1595 Use `report_file_error' instead of `error' in order to better
1596 inform users of what went wrong. Increase NTGUI_UNICODE file
1597 dialog box file name length to 32k, the maximum allowed by the NT
1598 kernel.
1599
1600 * w32common.h: New file.
1601 (ROUND_UP, ROUND_DOWN, get_page_size)
1602 (get_allocation_unit, get_processor_type, get_w32_major_version)
1603 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
1604 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
1605 (OS_NT, os_subtype, cache_system_info): Move here.
1606
1607 * unexw32.c, unexcw.c: Include w32common.h.
1608
1609 * emacs.c (main): Use (defined (WINDOWSNT) || defined
1610 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
1611 to call syms_of_w32select.
1612
1613 * cygw32.h: Remove obsolete EXFUN declarations.
1614
1615 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
1616
1617 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
1618 of w32inevt.o from SOME_MACHINE_OBJECTS.
1619
1620 2012-10-08 Daniel Colascione <dancol@dancol.org>
1621
1622 * image.c: Permanent fix for JPEG compilation issue --- limit
1623 jpeglib `boolean' redefinition to Cygwin builds.
1624
1625 2012-10-08 Eli Zaretskii <eliz@gnu.org>
1626
1627 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
1628
1629 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
1630 Cygwin.
1631
1632 2012-10-08 Daniel Colascione <dancol@dancol.org>
1633
1634 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
1635 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
1636 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
1637 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
1638 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
1639 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
1640 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
1641 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
1642 now a supported configuration.
1643
1644 * Makefile.in: consolidate image variables into LIBIMAGE; add
1645 W32_OBJ and W32_LIBS. Compile new files.
1646
1647 * conf_post.h:
1648 (_DebPrint) declare tracing facility for W32 debugging. We need
1649 to unify tracing later.
1650
1651 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
1652 unconditional use of W32 Unicode functions. Cygwin runs only on
1653 100% Unicode operating systems.
1654
1655 * cygw32.c: New file. Define Cygwin-specific facilities.
1656 (Fcygwin_convert_path_to_windows)
1657 (Fcygwin_convert_path_from_windows): New user functions for
1658 accessing Cygwin path-munging routines.
1659
1660 * cygw32.h: New file.
1661 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
1662 UTF-16LE strings temporarily inside non-Lisp-visible string
1663 objects.
1664
1665 (w32_strerror): Just what it says on the tin.
1666
1667 * emacs.c: Make the NS fork-then-exec code for daemon-launching
1668 also run for Cygwin; both systems have the same problem with using
1669 GUI facilities in a forked child. Also call syms_of_cygw32,
1670 syms_of_w32select in correct places.
1671
1672 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
1673 needs fork-then-exec for daemon launching.
1674
1675 * font.h: Include frame.h.
1676
1677 * image.c: Use the image library cache machinery only when we're
1678 compiling for native WINDOWSNT; Cygwin can use shared libraries
1679 like any other Unixlike system.
1680
1681 * keyboard.c: Clarify a comment regarding the input loop.
1682
1683 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
1684 functions directly instead of trying to detect at runtime that our
1685 host operating system supports them. We make this change for two
1686 reasons: Cygwin lacks support for the multibyte character
1687 conversion functions used by the legacy menu code, and Cygwin
1688 never needs to rely on non-Unicode APIs.
1689
1690 * unexw32.c (hinst): Declare extern.
1691
1692 * w32.c: Change header order;
1693 (w32_strerror): Move to w32fns.c because we need it for
1694 non-WINDOWSNT builds.
1695
1696 * w32.h: Add #error macro to make sure we don't include w32.h for
1697 Cygwin builds. Remove w32select declarations.
1698
1699 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1700 w32fns.c. w32console.c is WINDOWSNT-only.
1701
1702 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
1703 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
1704 POSIXy alternative.
1705 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
1706 (w32_major_version, w32_minor_version, w32_build_number)
1707 (os_subtype, sound_type): Define here
1708 (w32_defined_color): Make color parameter const for consistency
1709 with other _defined_color functions.
1710 (w32_createwindow): Unconditionally call w32_init_class instead of
1711 doing so only when hprevinst is non-NULL. Plumbing hprevinst
1712 through the code is complex and unnecessary because class
1713 registration is practically free.
1714 (w32_name_of_message): New EMACSDEBUG-only function.
1715 (Fset_message_beep): Move here
1716 (Fx_open_connection): Require that the display name for Windows be
1717 "w32" for consistency, emacsclient disambiguation, and maybe, one
1718 day, multi-window-system support.
1719 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
1720 Cygwin files for W32 GUI facilities, since these clearly don't
1721 expect Cygwin names.
1722 (_DebPrint): Define.
1723 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
1724 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
1725 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
1726 (w32_last_error): Remove.
1727
1728 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
1729
1730 * w32heap.c (syspage_mask): Declare here.
1731 (cache_system_info): Remove.
1732
1733 * w32inevt.c (faked_key): Define globally, not statically.
1734 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
1735 (w32_console_toggle_lock_key): Move to w32fns.c.
1736
1737 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
1738
1739 * w32proc.c (_DebPrint): Move to w32fns.c.
1740 * w32select.c: Include string.h, stdio.h for Cygwin.
1741 * w32select.h: New File.
1742
1743 * w32term.c: Include io.h for non-CYGWIN builds; needed for
1744 get_osfhandle.
1745 (w32_message_fd): New variable. Under Cygwin, holds the file
1746 descriptor the system used to tell us about pending thread
1747 messages.
1748
1749 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
1750 that prevented compilation under non-WINDOWSNT systems.
1751
1752 (w32_initialize): Open /dev/windows and assign it to
1753 w32_message_fd. Provide w32 feature.
1754
1755 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
1756 (WM_EMACS_INPUT_READY): add.
1757 (prepend_msg, w32_message_fd): Declare globally.
1758
1759 * w32xfns.c:
1760 (keyboard_handle): Use only when WINDOWSNT.
1761 (notify_msg_ready): New function. Posts a message to the main
1762 thread's message queue under CYGWIN, which wakes up the main
1763 thread from select(2) by making the /dev/windows file descriptor
1764 ready. Under WINDOWSNT, it sets an event the same way the old
1765 code did.
1766
1767 (post, prepend_msg): Actually call notify_msg_ready instead of
1768 setting the input event directly.
1769
1770 2012-10-07 Eli Zaretskii <eliz@gnu.org>
1771
1772 * ralloc.c (relinquish): If a heap is ready to be relinquished,
1773 but it still has blocs in it, don't return it to the system,
1774 instead of aborting. (Bug#12402)
1775
1776 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
1777
1778 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
1779
1780 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
1781 MAC_OS_X_VERSION_10_6.
1782 (syms_of_nsterm): Remove comment about Panther and above for
1783 ns-antialias-text.
1784 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
1785 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
1786 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
1787
1788 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
1789 MAC_OS_X_VERSION_10_4.
1790
1791 * nsmenu.m (fillWithWidgetValue:): Remove code for <
1792 MAC_OS_X_VERSION_10_2.
1793
1794 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
1795
1796 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
1797 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
1798
1799 * nsterm.m (ns_in_resize): Remove (Bug#12479).
1800 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
1801 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
1802 Remove ns_in_resize check.
1803 (ns_clear_frame_area): Remove resize handle code.
1804
1805 * nsfns.m (ns_in_resize): Remove.
1806 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
1807 Remove ns_in_resize check.
1808
1809 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
1810
1811 Improve sys_siglist detection.
1812 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
1813 defined as a macro, as is done in Solaris.
1814 (sys_siglist_entries): New macro.
1815 (save_strsignal): Use it.
1816 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
1817 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
1818
1819 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
1820
1821 * nsfns.m (Fx_create_frame): Call x_default_parameter with
1822 fullscreen/Fullscreen.
1823
1824 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
1825 tobar_height is new.
1826
1827 * nsterm.m (x_make_frame_visible): Check for fullscreen.
1828 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
1829 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
1830 (windowDidResize:): Check for correct window if old style fullscreen.
1831 Capitalize word in comment. Remove incorrect comment.
1832 (initFrameFromEmacs:): tbar_height renamed tibar_height.
1833 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
1834 error in drawing background.
1835 (toggleFullScreen:): Remove comment. Rearrange calls.
1836 Set toolbar values to zero, save old height in tobar_height.
1837 Restore tool bar height when leaving fullscreen.
1838 (canBecomeMainWindow): New function.
1839
1840 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
1841
1842 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
1843
1844 2012-10-05 Eli Zaretskii <eliz@gnu.org>
1845
1846 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
1847
1848 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
1849 that time stamps of directories could also be changed.
1850 Don't request the too broad GENERIC_WRITE, only the more restrictive
1851 FILE_WRITE_ATTRIBUTES access rights.
1852
1853 * fileio.c (Fset_file_times): Special-case ignoring errors for
1854 directories only on MSDOS, not on MS-Windows.
1855
1856 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
1857
1858 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
1859
1860 2012-10-04 Eli Zaretskii <eliz@gnu.org>
1861
1862 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
1863 see whether CreateFile failed.
1864
1865 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
1866
1867 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
1868 to avoid similar races.
1869 * keyboard.c (pending_signals): Now bool, not int.
1870
1871 Port timers to OpenBSD, plus check for timer failures.
1872 OpenBSD problem reported by Han Boetes.
1873 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
1874 and/or setitimer.
1875 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
1876 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
1877 like OpenBSD, which has timer_settime but does not declare it.
1878 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
1879 whether to use itimerspec-related primitives. All uses of
1880 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
1881
1882 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
1883
1884 * profiler.c (handle_profiler_signal): Fix a malloc race
1885 that caused Emacs to hang on Fedora 17 when profiling Lisp.
1886
1887 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
1888
1889 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
1890
1891 2012-10-02 Eli Zaretskii <eliz@gnu.org>
1892
1893 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
1894 consistent with the change in return value of 'safe_strsignal'.
1895
1896 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
1897
1898 Prefer plain 'static' to 'static inline' (Bug#12541).
1899 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
1900 (bidi_set_sor_type, bidi_push_embedding_level)
1901 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
1902 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
1903 (bidi_cache_search, bidi_cache_ensure_space)
1904 (bidi_cache_iterator_state, bidi_cache_find)
1905 (bidi_peek_at_next_level, bidi_set_paragraph_end)
1906 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
1907 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
1908 Now 'static', not 'static inline'.
1909
1910 Count overruns when profiling; change units to ns.
1911 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
1912 Give extra weight to samples after overruns, to attempt to count
1913 the time more accurately.
1914 (setup_cpu_timer): Change sampling interval units from ms to ns, since
1915 the underlying primitives nominally do ns.
1916 (Fprofiler_cpu_start): Document the change. Mention that
1917 the sampling intervals are only approximate.
1918
1919 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
1920
1921 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
1922
1923 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
1924 case for the special 0 coding-system.
1925
1926 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
1927 (Fmake_overlay): Remove redundant tests.
1928 (fix_start_end_in_overlays): Remove redundant recentering.
1929
1930 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
1931
1932 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
1933 Update dependencies.
1934
1935 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1936
1937 Fix a malloc race condition involving strsignal.
1938 A signal can arrive in the middle of a malloc, and Emacs's signal
1939 handler can invoke strsignal, which can invoke malloc, which is
1940 not portable. This race condition bug makes Emacs hang on GNU/Linux.
1941 Fix it by altering the signal handler so that it does not invoke
1942 strsignal.
1943 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
1944 * process.c (status_message): Use const pointer, in case strsignal
1945 is #defined to safe_strsignal.
1946 * sysdep.c (sys_siglist, init_signals): Always define and
1947 initialize a substitute sys_siglist if the system does not define
1948 one, even if HAVE_STRSIGNAL.
1949 (safe_strsignal): Rename from strsignal. Always define,
1950 using sys_siglist. Return a const pointer.
1951 * syssignal.h (safe_strsignal): New decl.
1952 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
1953
1954 2012-10-01 Eli Zaretskii <eliz@gnu.org>
1955
1956 * w32proc.c (timer_loop): Fix code that waits for timer
1957 expiration, to avoid high CPU usage.
1958
1959 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
1960
1961 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
1962 (sweep_weak_table): Remove redundant prototypes.
1963
1964 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
1965
1966 * emacs.c: Move the inclusion of TERM_HEADER after including
1967 windows.h on WINDOWSNT. This avoids compilation problems with
1968 MSVC.
1969
1970 2012-10-01 Eli Zaretskii <eliz@gnu.org>
1971
1972 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
1973 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
1974 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
1975 as the previous version used 'void *'.
1976
1977 * ralloc.c (ROUNDUP): Fix last change.
1978 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
1979 'size_t'.
1980
1981 * w32proc.c <disable_itimers>: New static flag.
1982 (init_timers): Initialize it to zero, after creating the critical
1983 sections used by the timer threads.
1984 (term_timers): Set to 1 before deleting the critical sections.
1985 (getitimer, setitimer): If disable_itimers is non-zero, return an
1986 error indication without doing anything. Reported by Fabrice
1987 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
1988 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
1989 return results.
1990 [!HAVE_SETITIMER]: Behave as the previous version that didn't
1991 support timers.
1992
1993 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
1994 term_ntproc after all the other bookkeeping, to get timers working
1995 as long as possible.
1996
1997 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1998
1999 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
2000 Suggested by Juri Linkov in
2001 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
2002
2003 Prefer plain 'static' to 'static inline' (Bug#12541).
2004 With static functions, modern compilers inline pretty well by
2005 themselves; advice from programmers often hurts as much as it helps.
2006 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
2007 this change shrinks the text size of the Emacs executable by 1.1%
2008 without affecting CPU significantly in my benchmark.
2009 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
2010 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
2011 (mark_maybe_object, mark_maybe_pointer, bounded_number):
2012 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2013 (bset_auto_fill_function, bset_auto_save_file_format)
2014 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2015 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2016 (bset_cache_long_line_scans, bset_case_fold_search)
2017 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2018 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2019 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2020 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2021 (bset_header_line_format, bset_indicate_buffer_boundaries)
2022 (bset_indicate_empty_lines, bset_invisibility_spec)
2023 (bset_left_fringe_width, bset_major_mode, bset_mark)
2024 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2025 (bset_name, bset_overwrite_mode, bset_pt_marker)
2026 (bset_right_fringe_width, bset_save_length)
2027 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2028 (bset_scroll_up_aggressively, bset_selective_display)
2029 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2030 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
2031 (set_buffer_overlays_after):
2032 * category.c (bset_category_table):
2033 * charset.c (read_hex):
2034 * coding.c (produce_composition, produce_charset)
2035 (handle_composition_annotation, handle_charset_annotation)
2036 (char_encodable_p):
2037 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
2038 (assign_row, set_frame_matrix_frame, make_current)
2039 (add_row_entry):
2040 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
2041 * fns.c (maybe_resize_hash_table):
2042 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
2043 * gmalloc.c (register_heapinfo):
2044 * image.c (lookup_image_type):
2045 * intervals.c (set_interval_object, set_interval_left)
2046 (set_interval_right, copy_interval_parent, rotate_right)
2047 (rotate_left, balance_possible_root_interval):
2048 * keyboard.c (kset_echo_string, kset_kbd_queue)
2049 (kset_keyboard_translate_table, kset_last_prefix_arg)
2050 (kset_last_repeatable_command, kset_local_function_key_map)
2051 (kset_overriding_terminal_local_map, kset_real_last_command)
2052 (kset_system_key_syms, clear_event, set_prop):
2053 * lread.c (digit_to_number):
2054 * marker.c (attach_marker, live_buffer, set_marker_internal):
2055 * nsterm.m (ns_compute_glyph_string_overhangs):
2056 * process.c (pset_buffer, pset_command)
2057 (pset_decode_coding_system, pset_decoding_buf)
2058 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
2059 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
2060 (pset_status, pset_tty_name, pset_type, pset_write_queue):
2061 * syntax.c (bset_syntax_table, dec_bytepos):
2062 * terminal.c (tset_param_alist):
2063 * textprop.c (interval_has_some_properties)
2064 (interval_has_some_properties_list):
2065 * window.c (wset_combination_limit, wset_dedicated)
2066 (wset_display_table, wset_hchild, wset_left_fringe_width)
2067 (wset_left_margin_cols, wset_new_normal, wset_new_total)
2068 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2069 (wset_right_fringe_width, wset_right_margin_cols)
2070 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
2071 (wset_vertical_scroll_bar_type, wset_window_parameters):
2072 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2073 (wset_column_number_displayed, wset_region_showing)
2074 (window_box_edges, run_window_scroll_functions)
2075 (append_glyph_string_lists, prepend_glyph_string_lists)
2076 (append_glyph_string, set_glyph_string_background_width)
2077 (append_glyph, append_composite_glyph)
2078 (take_vertical_position_into_account):
2079 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
2080 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
2081 (lface_hash, lface_same_font_attributes_p, lookup_face):
2082 * xml.c (libxml2_loaded_p):
2083 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
2084 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
2085 Now 'static', not 'static inline'.
2086
2087 * bidi.c: Tune.
2088 (bidi_copy_it): Do the whole copy with a single memcpy.
2089 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
2090
2091 Revert the FOLLOW-SYMLINKS change for file-attributes.
2092 Doing it right would require several changes to Tramp, and there's
2093 not enough time to get that tested before the freeze today.
2094 * dired.c (directory_files_internal, Ffile_attributes):
2095 Undo last change.
2096
2097 * frame.c (x_report_frame_params): Port better to wider ints.
2098 Do not assume that EMACS_UINT is the same width as uprintmax_t,
2099 or that pointers can be printed in 15 decimal digits.
2100 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
2101
2102 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
2103
2104 Support x64 build on MS-Windows.
2105 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
2106 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
2107 compatibility with x64.
2108 (x_get_focus_frame): Add prototype.
2109
2110 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
2111 defining an XRectangle structure.
2112
2113 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
2114 arithmetics for compatibility with x64.
2115
2116 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
2117 compatibility with x64.
2118
2119 * w32heap.h: Adjust prototypes and declarations.
2120
2121 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
2122 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
2123 DWORD, long, and unsigned long, for compatibility with x64.
2124 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
2125 (sbrk): Argument is now of type ptrdiff_t.
2126
2127 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
2128 less than 0x0500.
2129 (w32_msg_pump): Use WPARAM type for 'result'.
2130
2131 * w32.c (init_environment, get_emacs_configuration): Support AMD64
2132 architecture.
2133 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
2134 compatibility with x64.
2135
2136 * vm-limit.c (lim_data): Now size_t.
2137 (check_memory_limits): Adjust prototypes of real_morecore and
2138 __morecore to receive argument of type ptrdiff_t. Use size_t for
2139 five_percent and data_size.
2140
2141 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
2142 variables, for compatibility with x64.
2143 (rva_to_section, offset_to_section, relocate_offset)
2144 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
2145 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
2146 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
2147 for compatibility with x64.
2148
2149 * sysdep.c (STDERR_FILENO): Define if not already defined.
2150
2151 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
2152 (__morecore): Argument type is now ptrdiff_t.
2153 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
2154 (relinquish): Use ptrdiff_t type for 'excess'.
2155 (r_alloc_sbrk): Argument type is now ptrdiff_t.
2156
2157 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
2158 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
2159 instead of a literal number.
2160
2161 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
2162 (min): Define only if not already defined.
2163
2164 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
2165 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
2166 hosts.
2167
2168 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
2169 'bitmaps' is a pointer.
2170
2171 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
2172
2173 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
2174
2175 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2176
2177 file-attributes has a new optional arg FOLLOW-SYMLINKS.
2178 * dired.c (directory_files_internal, Ffile_attributes):
2179 New arg follow_symlinks. All uses changed.
2180
2181 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
2182
2183 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
2184
2185 2012-09-30 Eli Zaretskii <eliz@gnu.org>
2186
2187 Support atimers and CPU profiler via profile.c on MS-Windows.
2188 * w32proc.c (sig_mask, crit_sig): New static variables.
2189 (sys_signal): Support SIGALRM and SIGPROF.
2190 (sigemptyset, sigaddset, sigfillset, sigprocmask)
2191 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
2192 sigfillset, and sigprocmask are no longer no-ops.
2193 (sigismember): New function.
2194 (struct itimer_data): New definition.
2195 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
2196 (crit_prof): New static variables.
2197 (MAX_SINGLE_SLEEP): New definition.
2198 (timer_loop, stop_timer_thread, term_timers, init_timers)
2199 (start_timer_thread, getitimer, setitimer): New functions.
2200 (alarm): No longer a no-op, calls setitimer.
2201
2202 * w32.c (term_ntproc): Call term_timers.
2203 (init_ntproc): Make sure all signals are unblocked at startup, to
2204 erase any traces of dumping. Call init_timers.
2205
2206 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
2207 Windows-specific code to display the hourglass mouse pointer is no
2208 longer used.
2209 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
2210 to hourglass timer expiration.
2211 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
2212 Remove, no longer used.
2213 (w32_note_current_window, show_hourglass, hide_hourglass):
2214 New functions, in support of hourglass cursor display similar to other
2215 window systems.
2216 (syms_of_w32fns): Don't initialize hourglass_timer.
2217
2218 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
2219 WINDOWSNT as well.
2220 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
2221
2222 * w32.h (init_timers, term_timers): Add prototypes.
2223
2224 2012-09-30 Kenichi Handa <handa@gnu.org>
2225
2226 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
2227 to the buffer relocation which may be caused by ccl_driver.
2228
2229 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
2230
2231 * xfns.c (Fx_file_dialog): Update comment.
2232
2233 * w32fns.c (Fx_file_dialog): Update comment.
2234
2235 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
2236 Initialize panel name field if OSX >= 10.6.
2237
2238 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
2239
2240 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
2241
2242 * nsterm.m (NEW_STYLE_FS): New define.
2243 (ns_fullscreen_hook, windowWillEnterFullScreen)
2244 (windowDidEnterFullScreen, windowWillExitFullScreen)
2245 (windowDidExitFullScreen, toggleFullScreen, handleFS)
2246 (setFSValue): New functions.
2247 (EmacsFSWindow): New implementation.
2248 (canBecomeKeyWindow): New function for EmacsFSWindow.
2249 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
2250 (dealloc): Release nonfs_window if in fullscreen.
2251 (updateFrameSize:): Call windowDidMove to update top/left.
2252 (windowWillResize:toSize:): Check if frame is still maximized.
2253 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
2254 next_maximized, maximized_width, maximized_height and nonfs_window.
2255 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
2256 tbar_height.
2257 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
2258 fullscreen. Set maximized_width/height. Act on next_maximized.
2259
2260 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
2261 (EmacsView): Add variables for fullscreen.
2262 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
2263 (EmacsFSWindow): New interface for fullscreen.
2264
2265 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
2266
2267 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2268
2269 2012-09-30 Chong Yidong <cyd@gnu.org>
2270
2271 * fns.c (Frandom): Doc fix.
2272
2273 2012-09-30 Martin Rudalics <rudalics@gmx.at>
2274
2275 * window.c (Vwindow_combination_limit): New default value.
2276 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
2277
2278 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2279
2280 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
2281 Suggested by Eli Zaretskii in
2282 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
2283
2284 2012-09-30 Eli Zaretskii <eliz@gnu.org>
2285
2286 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
2287 HAVE_TIMER_SETTIME is defined.
2288
2289 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2290
2291 Profiler improvements: more-accurate timers, overflow checks.
2292 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
2293 signal.h, setjmp.h. Include systime.h instead.
2294 (saturated_add): New function.
2295 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
2296 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
2297 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
2298 New static vars.
2299 (enum profiler_cpu_running): New enum.
2300 (profiler_cpu_running): Now of that enum type, not bool.
2301 All uses changed to store the new value.
2302 (handle_profiler_signal): Rename from sigprof_handler_1,
2303 for consistency with other handlers. Do not check whether
2304 cpu_log is a hash-table if garbage collecting, since it
2305 doesn't matter in that case.
2306 (deliver_profiler_signal): Rename from sigprof_handler,
2307 for consistency with other handlers.
2308 (setup_cpu_timer): New function, with much of what used to be in
2309 Fprofiler_cpu_start. Check for out-of-range argument.
2310 Prefer timer_settime if available, and prefer
2311 thread cputime clocks, then process cputime clocks, then
2312 monotonic clocks, to the old realtime clock. Use make_timeval
2313 to round more-correctly when falling back to setitimer.
2314 (Fprofiler_cpu_start): Use it.
2315 (Fprofiler_cpu_stop): Prefer timer_settime if available.
2316 Don't assume that passing NULL as the 2nd argument of setitimer
2317 is the same as passing a pointer to all-zero storage.
2318 Ignore SIGPROF afterwards.
2319 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
2320 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
2321 non-fatal signal handlers. Ignore SIGPROF on startup.
2322 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
2323 in profiler.c, since sysdep.c now uses it.
2324
2325 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
2326 Suggested by Eli Zaretskii in
2327 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
2328
2329 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
2330
2331 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2332
2333 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
2334
2335 * lisp.h (struct backtrace): Remove indirection for `function' field.
2336 * xdisp.c (redisplay_internal):
2337 * profiler.c (record_backtrace, sigprof_handler_1):
2338 * alloc.c (Fgarbage_collect):
2339 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
2340 (Fbacktrace_frame): Adjust accordingly.
2341
2342 2012-09-28 Glenn Morris <rgm@gnu.org>
2343
2344 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
2345 (Frun_hook_with_args_until_failure): Doc fixes.
2346
2347 2012-09-28 Eli Zaretskii <eliz@gnu.org>
2348
2349 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
2350 Qautomatic_redisplay and change the symbol name. All users changed.
2351
2352 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
2353
2354 * profiler.c (sigprof_handler): Fix race condition.
2355
2356 2012-09-28 Glenn Morris <rgm@gnu.org>
2357
2358 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
2359
2360 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
2361
2362 Check more robustly for timer_settime.
2363 * Makefile.in (LIB_TIMER_TIME): New macro.
2364 (LIBES): Add it.
2365 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
2366 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
2367 call timer_settime.
2368
2369 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
2370
2371 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
2372
2373 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
2374
2375 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2376
2377 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
2378
2379 * character.h (MAYBE_UNIFY_CHAR): Remove.
2380 * charset.c, charset.h (maybe_unify_char): Now static.
2381 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
2382 Since this stuff is now private to charset.c, there's no need for
2383 a public macro and no need to inline by hand.
2384
2385 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
2386 Stefan Monnier <monnier@iro.umontreal.ca>
2387 Juanma Barranquero <lekktu@gmail.com>
2388
2389 * profiler.c: New file.
2390 * Makefile.in (base_obj): Add profiler.o.
2391 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
2392 ($(BLD)/profiler.$(O)): New target.
2393 * emacs.c (main): Call syms_of_profiler.
2394 * alloc.c (Qautomatic_gc): New constant.
2395 (MALLOC_PROBE): New macro.
2396 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
2397 (total_bytes_of_live_objects): New function.
2398 (Fgarbage_collect): Use it. Record itself in backtrace_list.
2399 Call malloc_probe for the memory profiler.
2400 (syms_of_alloc): Define Qautomatic_gc.
2401 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
2402 race condition.
2403 (struct backtrace): Move definition...
2404 * lisp.h (struct backtrace): ..here.
2405 (Qautomatic_gc, profiler_memory_running): Declare vars.
2406 (malloc_probe, syms_of_profiler): Declare functions.
2407 * xdisp.c (Qautomatic_redisplay): New constant.
2408 (redisplay_internal): Record itself in backtrace_list.
2409 (syms_of_xdisp): Define Qautomatic_redisplay.
2410
2411 2012-09-25 Eli Zaretskii <eliz@gnu.org>
2412 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
2413
2414 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
2415
2416 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
2417
2418 Prefer POSIX timers if available.
2419 They avoid a race if the timer is too close to the current time.
2420 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
2421 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
2422 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
2423
2424 2012-09-25 Eli Zaretskii <eliz@gnu.org>
2425
2426 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
2427 CHAR_STRING_ADVANCE.
2428 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
2429 STRING_CHAR_ADVANCE.
2430
2431 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
2432
2433 Move Vlibrary_cache to emacs.c and reset before dumping.
2434
2435 * lisp.h (reset_image_types): Declare.
2436 [WINDOWSNT] (Vlibrary_cache): Declare.
2437
2438 * image.c (reset_image_types): New function.
2439
2440 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
2441 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
2442 (Fdump_emacs): Reset Vlibrary_cache and image_types.
2443
2444 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
2445 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
2446
2447 * w32.h (Vlibrary_cache): Do not declare.
2448
2449 2012-09-25 Eli Zaretskii <eliz@gnu.org>
2450
2451 * w32proc.c (sys_signal): Handle all signals defined by the
2452 MS-Windows runtime, not just SIGCHLD. Actually install the signal
2453 handlers for signals supported by Windows. Don't override
2454 term_ntproc as the handler for SIGABRT.
2455 (sigaction): Rewrite to call sys_signal instead of duplicating its
2456 code.
2457 (sys_kill): Improve commentary.
2458
2459 * w32.c (term_ntproc): Accept (and ignore) one argument, for
2460 consistency with a signature of a signal handler. All callers
2461 changed.
2462 (init_ntproc): Accept an argument DUMPING. If dumping, don't
2463 install term_ntproc as a signal handler for SIGABRT, as that
2464 should be done by the dumped Emacs.
2465
2466 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
2467
2468 * w32select.c (term_w32select): Protect against repeated
2469 invocation by setting clipboard_owner to NULL after calling
2470 DestroyWindow.
2471
2472 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
2473 and term_ntproc to their modified signatures.
2474
2475 * character.c (char_string, string_char): Remove calls to
2476 MAYBE_UNIFY_CHAR. See the discussion starting at
2477 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
2478 for the details.
2479
2480 2012-09-25 Chong Yidong <cyd@gnu.org>
2481
2482 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
2483
2484 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
2485
2486 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
2487 when encountering an unknown bytecode.
2488
2489 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
2490
2491 image.c, indent.c: Use bool for booleans.
2492 * dispextern.h (struct image_type): Members valid_p, load, init
2493 now return bool, not int. All uses changed.
2494 * image.c: Omit unnecessary static decls.
2495 (x_create_bitmap_mask, x_build_heuristic_mask):
2496 Return void, not int, since callers don't care about the return value.
2497 (x_create_bitmap_mask, define_image_type, valid_image_p)
2498 (struct image_keyword, parse_image_spec, image_spec_value)
2499 (check_image_size, image_background)
2500 (image_background_transparent, x_clear_image_1)
2501 (postprocess_image, lookup_image, x_check_image_size)
2502 (x_create_x_image_and_pixmap, xbm_image_p)
2503 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
2504 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
2505 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
2506 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
2507 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
2508 (png_image_p, init_png_functions, png_load_body, png_load)
2509 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
2510 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
2511 (init_gif_functions, gif_load, imagemagick_image_p)
2512 (imagemagick_load_image, imagemagick_load, svg_image_p)
2513 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
2514 (gs_load):
2515 * nsimage.m (ns_load_image):
2516 * nsterm.m (ns_defined_color):
2517 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
2518 * xfns.c (x_defined_color):
2519 * xterm.c (x_alloc_lighter_color_for_widget)
2520 (x_alloc_nearest_color_1, x_alloc_nearest_color)
2521 (x_alloc_lighter_color):
2522 * indent.c (disptab_matches_widthtab, current_column)
2523 (scan_for_column, string_display_width, indented_beyond_p)
2524 (compute_motion, vmotion, Fvertical_motion):
2525 Use bool for booleans.
2526
2527 2012-09-24 Chong Yidong <cyd@gnu.org>
2528
2529 * chartab.c (Fset_char_table_default): Obsolete function removed.
2530
2531 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2532
2533 Move pid_t related decls out of lisp.h.
2534 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
2535 (interruptible_wait_for_termination):
2536 Move these decls from lisp.h to syswait.h, since they use pid_t.
2537 Needed on FreeBSD; see Herbert J. Skuhra in
2538 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
2539 * callproc.c: Include syswait.h.
2540
2541 gnutls.c, gtkutil.c: Use bool for boolean.
2542 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
2543 (emacs_gnutls_handle_error):
2544 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
2545 (xg_hide_tooltip, xg_create_frame_widgets)
2546 (create_dialog, xg_uses_old_file_dialog)
2547 (xg_get_file_with_chooser, xg_get_file_with_selection)
2548 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
2549 (xg_item_label_same_p, xg_update_menubar)
2550 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
2551 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
2552 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
2553 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
2554 (update_frame_tool_bar, free_frame_tool_bar):
2555 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
2556 * nsmenu.m (ns_update_menubar):
2557 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
2558 * xfns.c (Fx_show_tip) [USE_GTK]:
2559 Use bool for boolean.
2560 * gtkutil.c (xg_update_frame_menubar):
2561 * xmenu.c (update_frame_menubar):
2562 Return void, not int, since caller ignores return value.
2563 * gtkutil.c (xg_change_toolbar_position):
2564 Return void, not 1.
2565
2566 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
2567
2568 * makefile.w32-in (BLOCKINPUT_H): Remove.
2569 (SYSSIGNAL_H): New macro.
2570 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
2571 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
2572 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
2573 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
2574 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
2575 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
2576 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
2577 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
2578 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
2579 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
2580 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
2581 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
2582 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
2583 ($(BLD)/w32xfns.$(O)): Update dependencies.
2584
2585 2012-09-23 Eli Zaretskii <eliz@gnu.org>
2586
2587 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
2588 fatal_error_backtrace.
2589
2590 * w32proc.c (sys_kill): Undo last change: don't do anything when
2591 invoked to deliver SIGABRT to our own process. This is now
2592 handled by emacs_raise.
2593
2594 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
2595
2596 * w32term.c (w32_read_socket): Remove leftover reference to
2597 interrupt_input_pending.
2598
2599 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2600
2601 Do not use SA_NODEFER.
2602 Problem reported by Dani Moncayo in
2603 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
2604 * alloc.c (die):
2605 * sysdep.c (emacs_abort): Do not reset signal handler.
2606 * emacs.c (terminate_due_to_signal): Reset signal handler here.
2607 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
2608 wanted even on POSIXish hosts, and it doesn't work on Windows.
2609
2610 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
2611
2612 * xterm.c (x_term_init): Call fixup_locale before and after calling
2613 gtk_init (Bug#12392).
2614
2615 2012-09-23 Chong Yidong <cyd@gnu.org>
2616
2617 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
2618 Vdynamic_library_alist.
2619
2620 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
2621 (Fgnutls_available_p): Caller changed.
2622
2623 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
2624 (Flibxml_parse_xml_region): Likewise.
2625
2626 * dispextern.h (struct image_type): Remove arg from init function.
2627
2628 * image.c (Finit_image_library, lookup_image_type)
2629 (define_image_type): Remove now-unneeded second arg.
2630 (init_xpm_functions, init_png_functions, init_jpeg_functions)
2631 (init_tiff_functions, init_gif_functions, init_svg_functions):
2632 Arglist and w32_delayed_load calling convention changed.
2633 (gs_type): Remove init_gs_functions; there is no such function.
2634 (valid_image_p, make_image): Fix caller to lookup_image_type.
2635
2636 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2637
2638 Simplify and avoid signal-handling races (Bug#12471).
2639 * alloc.c (die):
2640 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
2641 Avoid recursive loop if there's a fatal error in the function itself.
2642 * atimer.c (pending_atimers):
2643 * blockinput.h: Don't include "atimer.h"; no longer needed.
2644 (interrupt_input_pending): Remove. All uses removed.
2645 pending_signals now counts both atimers and ordinary interrupts.
2646 This is less racy than having three separate pending-signal flags.
2647 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
2648 (input_blocked_p):
2649 Rename from their upper-case counterparts BLOCK_INPUT,
2650 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
2651 INPUT_BLOCKED_P, and turn into functions. All uses changed.
2652 This makes it easier to access volatile variables more accurately.
2653 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
2654 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
2655 that's more reliable if the code is buggy and sets
2656 interrupt_input_blocked to a negative value. All uses changed.
2657 * atimer.c (deliver_alarm_signal):
2658 Remove. No need to deliver this to the parent; any thread can
2659 handle this signal now. All uses replaced by underlying handler.
2660 * atimer.c (turn_on_atimers):
2661 * dispnew.c (handle_window_change_signal):
2662 * emacs.c (handle_danger_signal):
2663 * keyboard.c (kbd_buffer_get_event):
2664 Don't reestablish signal handler; not needed with sigaction.
2665 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
2666 (UNBLOCK_INPUT_TO):
2667 Rework to avoid unnecessary accesses to volatile variables.
2668 (UNBLOCK_INPUT_TO): Now a function.
2669 (totally_unblock_input, unblock_input): New decls.
2670 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
2671 (init_data): Remove. Necessary stuff now done in init_signal.
2672 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
2673 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
2674 (fatal_error_code): Remove; no longer needed.
2675 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
2676 it doesn't always backtrace. All uses changed. No need to reset
2677 signal to default, since sigaction and/or die does that for us now.
2678 Use emacs_raise (FOO), not kill (getpid (), FOO).
2679 (main): Check more-accurately whether we're dumping.
2680 Move fatal-error setup to sysdep.c
2681 * floatfns.c: Do not include "syssignal.h"; no longer needed.
2682 * gtkutil.c (xg_get_file_name, xg_get_font):
2683 Remove no-longer-needed signal-mask manipulation.
2684 * keyboard.c, process.c (POLL_FOR_INPUT):
2685 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
2686 * keyboard.c (read_avail_input): Remove.
2687 All uses replaced by gobble_input.
2688 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
2689 (kbd_buffer_store_event_hold, gobble_input):
2690 (record_asynch_buffer_change) [USABLE_SIGIO]:
2691 (store_user_signal_events):
2692 No need to mess with signal mask.
2693 (gobble_input): If blocking input and there are terminals, simply
2694 set pending_signals to 1 and return. All hooks changed to not
2695 worry about whether input is blocked.
2696 (process_pending_signals): Clear pending_signals before processing
2697 them, in case a signal comes in while we're processing.
2698 By convention callers now test pending_signals before calling us.
2699 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
2700 New functions, to support changes to blockinput.h.
2701 (handle_input_available_signal): Now extern.
2702 (reinvoke_input_signal): Remove. All uses replaced by
2703 handle_async_input.
2704 (quit_count): Now volatile, since a signal handler uses it.
2705 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
2706 All callers changed. Block SIGINT only if not already blocked.
2707 Clear sigmask reliably, even if Fsignal returns, which it can.
2708 Omit unnecessary accesses to volatile var.
2709 (quit_throw_to_read_char): No need to restore sigmask.
2710 * keyboard.c (gobble_input, handle_user_signal):
2711 * process.c (wait_reading_process_output):
2712 Call signal-handling code rather than killing ourselves.
2713 * lisp.h: Include <float.h>, for...
2714 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
2715 (pending_signals): Now volatile.
2716 (syms_of_data): Now const if IEEE floating point.
2717 (handle_input_available_signal) [USABLE_SIGIO]:
2718 (terminate_due_to_signal, record_child_status_change): New decls.
2719 * process.c (create_process): Avoid disaster if memory is exhausted
2720 while we're processing a vfork, by tightening the critical section
2721 around the vfork.
2722 (send_process_frame, process_sent_to, handle_pipe_signal)
2723 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
2724 ignores SIGPIPE.
2725 (send_process): No need for setjmp/longjmp any more, since the
2726 SIGPIPE stuff is now gone. Instead, report an error if errno
2727 is EPIPE.
2728 (record_child_status_change): Now extern. PID and W are now args.
2729 Return void, not bool. All callers changed.
2730 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
2731 Remove. All uses removed. This bug should be fixed now in a
2732 different way.
2733 (wait_for_termination_1): Use waitpid rather than sigsuspend,
2734 and record the child status change directly. This avoids the
2735 need to futz with the signal mask.
2736 (process_fatal_action): Move here from emacs.c.
2737 (emacs_sigaction_flags): New function, containing
2738 much of what used to be in emacs_sigaction_init.
2739 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
2740 caught by emacs, to make races less likely.
2741 (deliver_process_signal): Rename from handle_on_main_thread.
2742 All uses changed.
2743 (BACKTRACE_LIMIT_MAX): Now at top level.
2744 (thread_backtrace_buffer, threadback_backtrace_pointers):
2745 New static vars.
2746 (deliver_thread_signal, deliver_fatal_thread_signal):
2747 New functions, for more-accurate delivery of thread-specific signals.
2748 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
2749 (deliver_arith_signal): Handle in this thread, not
2750 in the main thread, since it's triggered by this thread.
2751 (maybe_fatal_sig): New function.
2752 (init_signals): New arg DUMPING so that we can be more accurate
2753 about whether we're dumping. Caller changed.
2754 Treat thread-specific signals differently from process-general signals.
2755 Block all signals while handling fatal error; that's safer.
2756 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
2757 on IEEE hosts.
2758 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
2759 Ignore SIGPIPE unless batch.
2760 (emacs_backtrace): Output backtrace for the appropriate thread,
2761 which is not necessarily the main thread.
2762 * syssignal.h: Include <stdbool.h>.
2763 (emacs_raise): New macro.
2764 * xterm.c (x_connection_signal): Remove; no longer needed
2765 now that we use sigaction.
2766 (x_connection_closed): No need to mess with sigmask now.
2767 (x_initialize): No need to reset SIGPIPE handler here, since
2768 init_signals does this for us now.
2769
2770 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
2771
2772 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
2773 background rect may be larger (Bug#12245).
2774
2775 2012-09-23 Chong Yidong <cyd@gnu.org>
2776
2777 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
2778
2779 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
2780
2781 * .gdbinit: Just stop at fatal_error_backtrace.
2782 See Stefan Monnier's request in
2783 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
2784 Remove no-longer-used query of system type.
2785
2786 2012-09-22 Chong Yidong <cyd@gnu.org>
2787
2788 * search.c (Freplace_match): Doc fix (Bug#12325).
2789
2790 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
2791
2792 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
2793 (Fline_end_position): Doc fix.
2794
2795 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
2796
2797 2012-09-22 Chong Yidong <cyd@gnu.org>
2798
2799 * dispextern.h (struct image_type): Add new slot, storing a type
2800 initialization function.
2801
2802 * image.c (define_image_type): Call the image initializer function
2803 if it is defined. Arguments and return value changed.
2804 (valid_image_p, make_image): Callers changed.
2805 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
2806 (gif_type, imagemagick_type, svg_type, gs_type):
2807 Add initialization functions.
2808 (Finit_image_library): Call lookup_image_type.
2809 (CHECK_LIB_AVAILABLE): Macro deleted.
2810 (lookup_image_type): Call define_image_type here, rather than via
2811 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
2812 (syms_of_image): Move define_image_type calls for xbm_type and
2813 pbm_type to lookup_image_type.
2814
2815 2012-09-22 Eli Zaretskii <eliz@gnu.org>
2816
2817 * keyboard.c (timer_check_2): Move calculation of 'timers' and
2818 'idle_timers' from here ...
2819 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
2820 lists, to avoid infloops when the timer does something stupid,
2821 like reinvoke itself with the same or smaller time-out.
2822 (Bug#12447)
2823
2824 2012-09-22 Martin Rudalics <rudalics@gmx.at>
2825
2826 * window.c (Fsplit_window_internal): Handle only Qt value of
2827 Vwindow_combination_limit separately.
2828 (Qtemp_buffer_resize): New symbol.
2829 (Vwindow_combination_limit): New default value.
2830 Rewrite doc-string.
2831
2832 2012-09-22 Eli Zaretskii <eliz@gnu.org>
2833
2834 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
2835 the new overlay string. (Bug#10159)
2836
2837 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
2838
2839 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
2840 or that fprintf is async-signal-safe. POSIX doesn't require
2841 either assumption.
2842
2843 2012-09-22 Chong Yidong <cyd@gnu.org>
2844
2845 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
2846 (Bug#8207).
2847
2848 2012-09-22 Kenichi Handa <handa@gnu.org>
2849
2850 * composite.c (composition_reseat_it): Handle the case that a
2851 grapheme cluster is not covered by a single font (Bug#12352).
2852
2853 2012-09-21 Chong Yidong <cyd@gnu.org>
2854
2855 * image.c (define_image_type): Avoid adding duplicate types to
2856 image_types (Bug#12463). Suggested by Jörg Walter.
2857
2858 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2859
2860 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
2861 (print_load_command_name): Add case LC_DATA_IN_CODE.
2862 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
2863
2864 2012-09-21 Glenn Morris <rgm@gnu.org>
2865
2866 * eval.c (Frun_hook_with_args_until_success)
2867 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
2868
2869 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
2870
2871 * fileio.c (Ffile_selinux_context): Only call freecon when
2872 lgetfilecon succeeded.
2873 (Fset_file_selinux_context): Likewise. (Bug#12444)
2874
2875 2012-09-21 Eli Zaretskii <eliz@gnu.org>
2876
2877 * xdisp.c (try_window_reusing_current_matrix): Under bidi
2878 reordering, locate the cursor by calling set_cursor_from_row; if
2879 that fails, clear the desired glyph matrix before returning a
2880 failure indication to the caller. Fixes leaving garbled display
2881 when fast scrolling with a down-key. (Bug#12403)
2882 (compute_stop_pos_backwards): Fix a typo that caused crashes while
2883 scrolling through multibyte text.
2884
2885 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
2886
2887 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
2888 calling mark_vectorlike since that's the one that marks the window.
2889 (mark_discard_killed_buffers): Mark the final cdr.
2890 * window.h (struct window): Move prev/next_buffers to the
2891 non-standard fields.
2892 * window.c (make_window): Initialize prev/next_buffers manually.
2893
2894 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
2895
2896 Omit unused arg EXPECTED from socket hooks.
2897 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
2898 * nsterm.m (ns_term_init):
2899 * termhooks.h (struct terminal.read_socket_hook):
2900 * w32inevt.c (w32_console_read_socket):
2901 * w32term.c (w32_read_socket):
2902 * xterm.c (XTread_socket):
2903 Omit unused arg EXPECTED. All callers changed.
2904 (store_user_signal_events): Return void, not int, since callers no
2905 longer care about the return value. All uses changed.
2906
2907 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
2908
2909 * w32gui.h (XParseGeometry): Do not declare.
2910
2911 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
2912
2913 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
2914 Ignore 'expected'. See Eli Zaretskii in
2915 <http://bugs.gnu.org/12471#8> (last line).
2916
2917 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
2918 (XParseGeometry): Now static. Substitute extremal values for
2919 values that are out of range.
2920
2921 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
2922
2923 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
2924
2925 * nsfns.m (XParseGeometry): Remove.
2926 (Fx_create_frame): Call x_set_offset to correctly interpret
2927 top_pos in geometry.
2928
2929 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
2930 (Fx_parse_geometry): If there is a space in string, call
2931 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
2932
2933 2012-09-17 Eli Zaretskii <eliz@gnu.org>
2934
2935 * search.c (scan_buffer): Use character positions in calls to
2936 region_cache_forward and region_cache_backward, not byte
2937 positions. (Bug#12196)
2938
2939 * w32term.c (w32_read_socket): Set pending_signals to 1, like
2940 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
2941
2942 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
2943 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
2944 emacs_blocked_malloc, now deleted.
2945
2946 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
2947
2948 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
2949 The workaround was for improving performance on Solaris 2.4, but
2950 is getting in the way now. Emacs will still work if someone is
2951 still running Solaris 2.4 in a museum somewhere; Sun dropped
2952 support for Solaris 2.4 in 2003.
2953 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
2954 * process.c (create_process) [HAVE_WORKING_VFORK]:
2955 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
2956 since Emacs no longer uses vfork on that platform.
2957
2958 2012-09-17 Glenn Morris <rgm@gnu.org>
2959
2960 * emacs.c: Use COPYRIGHT.
2961
2962 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
2963
2964 Remove configure's --without-sync-input option (Bug#12450).
2965 When auditing signal-handling in preparation for cleaning it up,
2966 I found that SYNC_INPUT has race conditions and would be a real
2967 pain to fix. Since it's an undocumented and deprecated
2968 configure-time option, now seems like a good time to remove it.
2969 Also see <http://bugs.gnu.org/11080#16>.
2970 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
2971 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
2972 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2973 (malloc_hysteresis):
2974 (check_depth) [XMALLOC_OVERRUN_CHECK]:
2975 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
2976 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
2977 (dont_register_blocks, bytes_used_when_reconsidered)
2978 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
2979 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
2980 [!SYSTEM_MALLOC && !SYNC_INPUT]:
2981 Remove. All uses removed.
2982 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
2983 implementation, one that depends on whether the new macro
2984 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
2985 is defined.
2986 * atimer.c (run_timers, handle_alarm_signal):
2987 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
2988 (handle_async_input, process_pending_signals)
2989 (handle_input_available_signal, init_keyboard):
2990 * nsterm.m (ns_read_socket):
2991 * process.c (wait_reading_process_output):
2992 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
2993 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
2994 (emacs_write):
2995 * xterm.c (XTread_socket):
2996 Assume SYNC_INPUT.
2997 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
2998 * eval.c (handling_signal): Remove. All uses removed.
2999 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
3000 All uses replaced with the SYNC_INPUT version.
3001 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
3002 Remove decls.
3003 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3004 Now static.
3005
3006 * font.c (Ffont_shape_gstring): Remove unused local.
3007
3008 2012-09-16 Glenn Morris <rgm@gnu.org>
3009
3010 * Makefile.in (clean): No longer run nextstep's clean.
3011
3012 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
3013 (ns_frag): Remove.
3014 (ns-app): Move here from ns.mk, and simplify.
3015 (clean): Simplify nextstep entry.
3016 * ns.mk: Remove file.
3017
3018 2012-09-17 Kenichi Handa <handa@gnu.org>
3019
3020 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
3021 not covert the last few charactes.
3022
3023 2012-09-16 Kenichi Handa <handa@gnu.org>
3024
3025 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
3026 here, but just check the validity of glyphs in the glyph-string.
3027
3028 2012-09-16 Martin Rudalics <rudalics@gmx.at>
3029
3030 * window.c (Fwindow_parameter, Fset_window_parameter):
3031 Accept any window as argument (Bug#12452).
3032
3033 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
3034
3035 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
3036 to ns_term_init to avoid memory leak.
3037
3038 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
3039 explicit retain/release.
3040 (ns_term_init): Only allow one display. Initialize outerpool and
3041 ns_*_types.
3042
3043 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
3044
3045 Port _setjmp fix to POSIXish hosts as well as Microsoft.
3046 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
3047 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
3048 the Microsoft problem in a different way, by altering ../nt/config.nt.
3049
3050 2012-09-15 Eli Zaretskii <eliz@gnu.org>
3051
3052 * w32xfns.c:
3053 * w32uniscribe.c:
3054 * w32term.c:
3055 * w32select.c:
3056 * w32reg.c:
3057 * w32proc.c:
3058 * w32menu.c:
3059 * w32inevt.c:
3060 * w32heap.c:
3061 * w32font.c:
3062 * w32fns.c:
3063 * w32console.c:
3064 * w32.c:
3065 * w16select.c: Remove inclusion of setjmp.h, as it is now included
3066 by lisp.h. This completes removal of setjmp.h inclusion
3067 erroneously announced in the previous commit. (Bug#12446)
3068
3069 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
3070 more accurate.
3071
3072 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
3073 not defined as a macro. The latter happens on MS-Windows.
3074 (Bug#12446)
3075
3076 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
3077
3078 Port better to POSIX hosts lacking _setjmp (Bug#12446).
3079 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
3080 Some instances of '#include <setjmp.h>' removed, if the
3081 only reason for the instance was because "lisp.h" was included.
3082 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
3083 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
3084 and _longjmp with the new symbols. Emacs already uses _setjmp if
3085 available, so this change affects only POSIXish hosts that have
3086 sigsetjmp but not _setjmp, such as some versions of Solaris and
3087 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
3088 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
3089 (png_load_body) [HAVE_PNG]:
3090 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
3091 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
3092 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
3093 since PNG requires jmp_buf. This is the only exception to the
3094 general rule that we now use sys_setjmp and sys_longjmp.
3095 This exception is OK since this code does not change the signal
3096 mask or longjmp out of a signal handler.
3097
3098 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
3099
3100 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
3101 Include "syssignal.h", for 'main_thread'.
3102
3103 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
3104
3105 Avoid out-of-range marker position (Bug#12426).
3106 * insdel.c (replace_range, replace_range_2):
3107 Adjust markers before overlays, as suggested by comments.
3108 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
3109 Remove redundant check before calling offset_intervals.
3110
3111 2012-09-14 Martin Rudalics <rudalics@gmx.at>
3112
3113 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
3114 current buffer (Bug#12387).
3115
3116 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
3117
3118 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
3119
3120 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
3121
3122 Use a more backwards-compatible timer format (Bug#12430).
3123 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
3124 vector element, not from the 4th, since PSECS is now at the end.
3125 (Fcurrent_idle_time): Doc fix.
3126
3127 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
3128
3129 Function to mark objects and remove killed buffers at once.
3130 * alloc.c (discard_killed_buffers): Rename to ...
3131 (mark_discard_killed buffers) ... new name. Add marking
3132 of remaining objects. Fix comment. Adjust users.
3133 (mark_object): Do not touch frame buffer lists here.
3134 * frame.c (delete_frame): Reset frame buffer lists here.
3135
3136 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
3137
3138 Better workaround for GNOME bug when --enable-gcc-warnings.
3139 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
3140 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
3141 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
3142
3143 Simplify SIGIO usage (Bug#12408).
3144 The code that dealt with SIGIO was crufty and confusing, e.g., it
3145 played tricks like "#undef SIGIO" but these tricks were not used
3146 consistently. Simplify mostly by not #undeffing standard symbols,
3147 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
3148 or not as we please) rather than "defined SIGIO" (standard symbol
3149 that we probably shouldn't #undef).
3150 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
3151 Modules that need it can include it.
3152 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
3153 * dispextern.h (ignore_sigio): New decl.
3154 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
3155 unconditionally, since it's now a no-op if !USABLE_SIGIO.
3156 * emacs.c (shut_down_emacs):
3157 * keyboard.c (kbd_buffer_store_event_hold):
3158 Use ignore_sigio rather than invoking 'signal' directly.
3159 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
3160 for FIONREAD.
3161 (FIONREAD, SIGIO): Do not #undef.
3162 (tty_read_avail_input): Use #error rather than a syntax error.
3163 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
3164 for I_PIPE, used by SETUP_SLAVE_PTY.
3165 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
3166 * sysdep.c (croak): Remove; no longer needed. This bit of
3167 temporary code, with Fred N. Fish's comment that it's temporary,
3168 has been in Emacs since at least 1992!
3169 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
3170 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
3171 * syssignal.h (croak): Remove decl.
3172 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
3173 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
3174 now that we're termios-only.
3175 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
3176 * term.c (dissociate_if_controlling_tty): Use #error rather than
3177 a run-time error.
3178
3179 Work around GCC and GNOME bugs when --enable-gcc-warnings.
3180 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
3181 to work around GNOME bug 683906.
3182 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
3183 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
3184 This works around GCC bug 54561.
3185
3186 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
3187
3188 More fixes for 'volatile' and setjmp/longjmp.
3189 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
3190 * image.c (struct png_load_context) [HAVE_PNG]: New type.
3191 (png_load_body) [HAVE_PNG]:
3192 (jpeg_load_body) [HAVE_JPEG]:
3193 New function, with most of the old parent function's body.
3194 (png_load) [HAVE_PNG]:
3195 (jpeg_load) [HAVE_JPEG]:
3196 Invoke the new function, to avoid longjmp munging our locals.
3197 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
3198 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
3199 longjmp is passed 2, as the C standard doesn't guarantee this.
3200 Instead, store the failure code into mgr->failure_code.
3201
3202 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
3203
3204 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
3205 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
3206 (syms_of_keyboard): Remove support for unread-command-char.
3207
3208 2012-09-12 Eli Zaretskii <eliz@gnu.org>
3209
3210 * w32proc.c (sys_kill): If PID is our process ID and the signal is
3211 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
3212 violation. (Bug#12426)
3213
3214 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
3215
3216 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
3217
3218 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
3219
3220 * eval.c: Add `inhibit-debugger'.
3221 (Qinhibit_debugger): New symbol.
3222 (call_debugger): Bind it instead of Qdebug_on_error.
3223 (maybe_call_debugger): Test Vinhibit_debugger.
3224 (syms_of_eval): Define inhibit-debugger.
3225 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
3226 (syms_of_xdisp): Remove inhibit-debug-on-message.
3227
3228 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
3229
3230 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
3231 If a nonvolatile local variable is written before a _longjmp to
3232 the frame containing the variable, and is read after the _longjmp,
3233 the value read is indeterminate. Some local variables of type
3234 'struct handler' and 'struct catchtag' are used in this way, so
3235 mark each of their slots as volatile if the slot can be set before
3236 _longjmp and read afterwards.
3237 * lisp.h (struct handler): var and chosen_clause are now volatile.
3238 (struct catchtag): val, next, and pdlcount are now volatile.
3239
3240 * bidi.c (bidi_push_it, bidi_pop_it):
3241 * fns.c (copy_hash_table):
3242 * image.c (define_image_type):
3243 * keyboard.c (kbd_buffer_store_event_hold):
3244 * process.c (Fprocess_send_eof):
3245 * xfaces.c (x_create_gc) [HAVE_NS]:
3246 * xgselect.c (xg_select):
3247 Prefer assignment to memcpy when either will do.
3248
3249 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
3250 Use pointer-to-a-pointer to simplify and avoid a NILP check each
3251 time an item is removed. No need to mark this function 'inline';
3252 the compiler knows better than we do.
3253
3254 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
3255
3256 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
3257 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
3258 to change_frame_size (Bug#12388).
3259 (windowDidResize:): Pass YES to updateFrameSize.
3260
3261 * nsterm.h: Add delay parameter to updateFrameSize.
3262
3263 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
3264
3265 Discard killed buffers from deleted window and frame objects.
3266 This reduces an amount of references to killed buffers and
3267 helps GC to reclaim them faster.
3268 * alloc.c (discard_killed_buffers): New function.
3269 (mark_object): Use it for deleted windows and frames.
3270 (mark_object): If symbol's value is set up for a killed buffer
3271 or deleted frame, restore its global binding.
3272 * data.c (swap_in_global_binding): Add GC notice.
3273 (swap_in_symval_forwarding): Use convenient set_blv_where.
3274 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
3275 * window.h: ... to here.
3276
3277 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
3278
3279 Convenient macro to check whether the buffer is live.
3280 * buffer.h (BUFFER_LIVE_P): New macro.
3281 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
3282 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
3283
3284 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3285
3286 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
3287 composition cases (Bug#12364).
3288
3289 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
3290 overhang of succeeding glyphs overlapping box cursor.
3291
3292 * w32term.c (x_draw_glyph_string): Likewise.
3293
3294 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
3295
3296 Simplify, document, and port floating-point (Bug#12381).
3297 The porting part of this patch fixes bugs on non-IEEE platforms
3298 with frexp, ldexp, logb.
3299 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
3300 Now static.
3301 * floatfns.c: Simplify discussion of functions that Emacs doesn't
3302 support, by removing commented-out code and briefly listing the
3303 C89 functions excluded. The commented-out stuff was confusing
3304 maintenance, e.g., we thought we needed cbrt but it was commented out.
3305 (logb): Remove decl; no longer needed.
3306 (isfinite): New macro, if not already supplied.
3307 (isnan): Don't replace any existing macro.
3308 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
3309 are present on all C89 platforms.
3310 (Ffrexp): Do not special-case zero, as frexp does the right thing
3311 for that case.
3312 (Flogb): Do not use logb, as it doesn't have the desired meaning
3313 on hosts that use non-base-2 floating point. Instead, stick with
3314 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
3315 frexp, to avoid getting an unspecified result.
3316
3317 * xdisp.c (Qinhibit_debug_on_message): Now static.
3318
3319 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
3320
3321 * nsterm.m (ns_update_begin): Set clip path to whole view by using
3322 NSBezierPath (Bug#12131).
3323
3324 2012-09-10 Chong Yidong <cyd@gnu.org>
3325
3326 * fns.c (Fdelq, Fdelete): Doc fix.
3327
3328 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
3329
3330 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
3331 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
3332
3333 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
3334
3335 * lisp.h (make_lisp_ptr): New macro to replace XSET.
3336 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
3337 Use it.
3338
3339 2012-09-09 Eli Zaretskii <eliz@gnu.org>
3340
3341 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
3342 left fringe if the window has a left margin. This avoids leaving
3343 traces of the cursor because its leftmost pixel is not drawn over.
3344
3345 * dispnew.c (update_window_line): When the left margin area of a
3346 screen line is updated, set the redraw_fringe_bitmaps_p flag of
3347 that screen line. (Bug#12277)
3348
3349 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
3350
3351 Assume C89 or later for math functions (Bug#12381).
3352 This simplifies the code, and makes it a bit smaller and faster,
3353 and (most important) makes it easier to clean up signal handling
3354 since we can stop worring about floating-point exceptions in
3355 library code. That was a problem before C89, but the problem
3356 went away many years ago on all practical Emacs targets.
3357 * data.c, image.c, lread.c, print.c:
3358 Don't include <math.h>; no longer needed.
3359 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
3360 might be autoconfigured, as that never happens.
3361 * data.c (fmod):
3362 * doprnt.c (DBL_MAX_10_EXP):
3363 * print.c (DBL_DIG):
3364 Remove. C89 or later always defines these.
3365 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
3366 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
3367 (arith_error, domain_error, domain_error2):
3368 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
3369 no longer needed -- we simply return what C returns. All uses removed.
3370 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
3371 the wrapped code.
3372 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
3373 Remove. All uses expanded, as these macros are no longer used
3374 more than once and are now more trouble than they're worth.
3375 (Ftan): Use tan, not sin / cos.
3376 (Flogb): Assume C89 frexp.
3377 (fmod_float): Assume C89 fmod.
3378 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
3379 (init_floatfns): Remove. All uses removed.
3380
3381 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
3382
3383 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
3384 compositeToPoint for OSX < 10.6 (Bug#12390).
3385
3386 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
3387
3388 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
3389 This produces more-accurate results.
3390
3391 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
3392
3393 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
3394 changes (Bug#12088).
3395
3396 2012-09-08 Chong Yidong <cyd@gnu.org>
3397
3398 * syntax.c (Fstring_to_syntax): Doc fix.
3399
3400 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
3401
3402 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
3403 in the internal border.
3404 (x_set_window_size): Remove static variables and their usage.
3405 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3406 (ns_after_update_window_line, ns_draw_fringe_bitmap):
3407 Remove fringe/internal border adjustment (Bug#11052).
3408 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
3409 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
3410 (ns_fix_rect_ibw): Remove.
3411 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
3412 (ns_dumpglyphs_box_or_relief): Ditto.
3413 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
3414 adjustment.
3415 (ns_dumpglyphs_image): Ditto.
3416 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
3417 border adjustment.
3418 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
3419 their usage. Add fringe_extended_p and its use as in other terms.
3420 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
3421 scroll bar was removed.
3422 (updateFrameSize): New function.
3423 (windowDidResize): Move code to updateFrameSize and call it.
3424
3425 * nsterm.h (EmacsView): Add updateFrameSize.
3426
3427 2012-09-07 Chong Yidong <cyd@gnu.org>
3428
3429 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
3430
3431 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
3432
3433 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
3434
3435 More signal-handler cleanup (Bug#12327).
3436 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
3437 Problem introduced when merging patches. Noted by Eli Zaretskii in
3438 <http://bugs.gnu.org/12327#67>.
3439 * floatfns.c: Comment fix.
3440 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
3441 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
3442 and anyway the declaration is harmless even if SIGDANGER is not defined.
3443 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
3444 defined BROKEN_FIONREAD). systty.h formerly did this, but other
3445 source files not surprisingly expected syssignal.h to define, or
3446 not define, SIGIO, and it's cleaner to do it that way, for consistency.
3447 Include <sys/ioctl.h>, for FIONREAD.
3448 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
3449 This eliminates a problem whereby other files mysteriously had
3450 to include "syssignal.h" before including "systty.h" if they
3451 wanted to use "#ifdef SIGIO".
3452
3453 2012-09-07 Eli Zaretskii <eliz@gnu.org>
3454
3455 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
3456
3457 * w32.c (sigemptyset): Empty the set.
3458 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
3459
3460 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
3461
3462 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
3463
3464 * alloc.c (mark_buffer): Revert unsafe marking optimization.
3465 (mark_object): Likewise for frame objects.
3466
3467 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
3468
3469 * syssignal.h (handle_on_main_thread): Always declare,
3470 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
3471 This ports to platforms without HAVE_PTHREAD.
3472
3473 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
3474
3475 Signal-handler cleanup (Bug#12327).
3476 Emacs's signal handlers were written in the old 4.2BSD style with
3477 sigblock and sigmask and so forth, and this led to some
3478 inefficiencies and confusion. Rewrite these to use
3479 pthread_sigmask etc. without copying signal sets around. Also,
3480 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
3481 'signal', and instead use functions that do not attempt to take
3482 over the system name space. This patch causes Emacs's text
3483 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
3484 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
3485 Do not include <signal.h> or "syssignal.h", as these
3486 modules do not use signals.
3487 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
3488 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
3489 Do not include <signal.h>, as "syssignal.h" does that for us now.
3490 * atimer.c (sigmask_atimers): New function.
3491 (block_atimers, unblock_atimers): New functions,
3492 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
3493 All uses replaced.
3494 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
3495 no longer needed here.
3496 * emacs.c (main): Inspect existing signal handler with sigaction,
3497 so that there's no need to block and unblock SIGHUP.
3498 * sysdep.c (struct save_signal): New member 'action', replacing
3499 old member 'handler'.
3500 (save_signal_handlers, restore_signal_handlers):
3501 Use sigaction instead of 'signal' to save and restore.
3502 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
3503 New function. All users of 'signal' modified to use set_sighandler
3504 if they're writeonly, and to use sys_signal if they're read+write.
3505 (emacs_sigaction_init, forwarded_signal): New functions.
3506 (sys_signal): Remove. All uses replaced by calls to sigaction
3507 and emacs_sigaction_init, or by direct calls to 'signal'.
3508 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
3509 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
3510 all uses replaced by pthread_sigmask etc. calls.
3511 * syssignal.h: Include <signal.h>.
3512 (emacs_sigaction_init, forwarded_signal): New decls.
3513 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
3514 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
3515 (sigmask, sys_sigmask): Remove; no longer needed.
3516 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
3517 (sigblock, sigunblock, sigfree):
3518 (sigsetmask) [!defined sigsetmask]:
3519 Remove. All uses replaced by pthread_sigmask.
3520 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
3521 no longer need to be replaced, and its typical old uses
3522 are now done via emacs_sigaction_init and sigaction.
3523 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
3524 (sys_sigdel): Remove; unused.
3525 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
3526
3527 2012-09-06 Eli Zaretskii <eliz@gnu.org>
3528
3529 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
3530 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
3531
3532 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
3533
3534 Explicitly mark buffer_defaults and buffer_local_symbols.
3535 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
3536 mark_local_symbols here.
3537 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
3538 since special buffers aren't marked here any more.
3539 (allocate_buffer): Chain new buffer with all_buffers here...
3540 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
3541 not here.
3542 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
3543 (syms_of_buffer): Remove staticpro of the above.
3544 (init_buffer_once): Set names for buffer_defaults and
3545 buffer_local_symbols.
3546
3547 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
3548
3549 Use bool for booleans in font-related modules.
3550 * font.c (font_intern_prop, font_style_to_value)
3551 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
3552 (generate_otf_features, font_check_otf_features, font_check_otf)
3553 (font_match_p, font_list_entities, font_at):
3554 * fontset.c (fontset_id_valid_p, reorder_font_vector
3555 (fontset_find_font, Fset_fontset_font)
3556 (face_suitable_for_char_p) [0]:
3557 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
3558 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
3559 (m17n_flt_initialized, ftfont_shape_by_flt):
3560 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
3561 * nsfont.m (nsfont_draw):
3562 * w32font.c (w32font_draw):
3563 * w32term.c (x_draw_glyphless_glyph_string_foreground):
3564 Use bool for booleans.
3565 * font.h: Adjust to above API changes.
3566 (struct font, struct font_driver, struct font_driver_list):
3567 Use bool for booleans.
3568 (struct font): Remove useless member encoding_type.
3569 All users removed.
3570 * fontset.c, xftfont.c: Omit unnecessary static decls.
3571
3572 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
3573
3574 * alloc.c (mark_object): Revert window marking code
3575 since it's unsafe for the Fset_window_configuration.
3576
3577 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
3578
3579 Fix race conditions with signal handlers and errno (Bug#12327).
3580 Be more systematic about preserving errno whenever a signal
3581 handler returns, even if it's not in the main thread. Do this by
3582 renaming signal handlers to distinguish between signal delivery
3583 and signal handling. All uses changed.
3584 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
3585 * data.c (deliver_arith_signal): Rename from arith_error.
3586 * dispnew.c (deliver_window_change_signal): Rename from
3587 window_change_signal.
3588 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
3589 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
3590 * keyboard.c (deliver_input_available_signal): Rename from
3591 input_available_signal.
3592 (deliver_user_signal): Rename from handle_user_signal.
3593 (deliver_interrupt_signal): Rename from interrupt_signal.
3594 * process.c (deliver_pipe_signal): Rename from send_process_trap.
3595 (deliver_child_signal): Rename from sigchld_handler.
3596 * atimer.c (handle_alarm_signal):
3597 * data.c (handle_arith_signal):
3598 * dispnew.c (handle_window_change_signal):
3599 * emacs.c (handle_fatal_signal, handle_danger_signal):
3600 * keyboard.c (handle_input_available_signal):
3601 * keyboard.c (handle_user_signal, handle_interrupt_signal):
3602 * process.c (handle_pipe_signal, handle_child_signal):
3603 New functions, with the actual signal-handling code taken from the
3604 original respective signal handlers, sans the sporadic attempts to
3605 preserve errno, since that's now done by handle_on_main_thread.
3606 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
3607 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
3608 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3609 Move to sysdep.c.
3610 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3611 Move initialization of main_thread to sysdep.c's init_signals.
3612 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
3613 our usage, and simplifies the mainline code.
3614 (record_child_status_change): New static function, as a helper
3615 for handle_child_signal, and with most of the old child handler's
3616 contents.
3617 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
3618 (handle_child_signal): Use the above.
3619 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3620 Moved here from emacs.c.
3621 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
3622 code moved here from emacs.c's main function.
3623 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3624 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
3625 This lets callers save and restore errno properly.
3626
3627 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3628
3629 Remove redundant or unused things here and there.
3630 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
3631 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
3632 * editfns.c (Fcompare_buffer_substrings): Likewise.
3633 * frame.h (struct terminal, struct font_driver_list):
3634 Remove redundant declarations.
3635 * window.h (Qleft, Qright): Likewise.
3636
3637 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3638
3639 Do not mark objects from deleted buffers, windows and frames.
3640 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
3641 (mark_object): Likewise for windows and frames.
3642
3643 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3644
3645 * alloc.c (valid_lisp_object_p): Treat killed buffers,
3646 buffer_defaults and buffer_local_symbols as valid objects.
3647 Return special value to denote them.
3648
3649 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
3650
3651 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
3652 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
3653 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
3654 (file_name_absolute_p, Fsubstitute_in_file_name):
3655 (check_executable, check_writable, Ffile_accessible_directory_p)
3656 (Fset_file_selinux_context, Fdefault_file_modes)
3657 (Finsert_file_contents, choose_write_coding_system)
3658 (Fwrite_region, build_annotations, a_write, e_write)
3659 (Fdo_auto_save):
3660 * filelock.c (boot_time_initialized, get_boot_time)
3661 (get_boot_time_1, lock_file_1, within_one_second):
3662 * floatfns.c (in_float):
3663 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
3664 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
3665 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
3666 * lisp.h (struct Lisp_Hash_Table.cmpfn):
3667 * window.c (compare_window_configurations):
3668 Use bool for booleans.
3669 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
3670 (Fdefault_file_modes): Now mode_t, not int, for modes.
3671 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
3672 (internal_delete_file): Now returns void, not a (boolean) int,
3673 since nobody was looking at the return value.
3674 * lisp.h, window.h: Adjust to above API changes.
3675
3676 * xdisp.c (set_message): Simplify and reindent last change.
3677
3678 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
3679
3680 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
3681
3682 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
3683
3684 * eval.c (call_debugger): Make the function non-static so that we
3685 can call it from set_message.
3686
3687 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
3688 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
3689
3690 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3691
3692 Give more-useful info on a fatal error (Bug#12328).
3693 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
3694 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
3695 of doing the work ourselves.
3696 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
3697 do most of the work.
3698 (fatal_error_backtrace): New function, taken from the guts
3699 of the old fatal_error_signal, but with a new option to output
3700 a backtrace.
3701 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
3702 info about the signal than just its number.
3703 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
3704 * sysdep.c: Include <execinfo.h>
3705 (emacs_backtrace): New function, taken partly from the previous
3706 code of the 'die' function.
3707 (emacs_abort): Call fatal_error_backtrace rather than abort.
3708
3709 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
3710
3711 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
3712 eager (load-time) macro-expansion.
3713 * lisp.mk (lisp): Add macroexp.
3714
3715 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3716
3717 Simplify redefinition of 'abort' (Bug#12316).
3718 Do not try to redefine the 'abort' function. Instead, redo
3719 the code so that it calls 'emacs_abort' rather than 'abort'.
3720 This removes the need for the NO_ABORT configure-time macro
3721 and makes it easier to change the abort code to do a backtrace.
3722 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
3723 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
3724 Remove; sysdep.c's emacs_abort now takes its place.
3725 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
3726 'abort' changed to use 'emacs_abort'.
3727 * msdos.c (dos_abort) [defined abort]: Remove; not used.
3728 (abort) [!defined abort]: Rename to ...
3729 (emacs_abort): ... new name.
3730 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
3731 the place of the old 'abort' in emacs.c.
3732 * w32.c, w32fns.c (abort): Do not #undef.
3733 * w32.c (emacs_abort): Rename from w32_abort.
3734
3735 2012-09-04 Eli Zaretskii <eliz@gnu.org>
3736
3737 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
3738 offsets[j].dv, since the y axis of the screen coordinates points
3739 down, while the y axis of the font definition coordinates points
3740 up. This fixes display of Arabic diacritics such as KASRA and
3741 KASRATAN. (Bug#11860)
3742
3743 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3744
3745 Be more systematic about _setjmp vs setjmp.
3746 * alloc.c (test_setjmp, mark_stack):
3747 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
3748 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
3749 (png_load, my_error_exit, jpeg_load):
3750 * process.c (send_process_trap, send_process):
3751 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
3752 The underscored versions are up to 30x faster on some hosts.
3753 Formerly, the code used setjmp+longjmp sometimes and
3754 _setjmp+_longjmp at other times, with no particular reason to
3755 prefer setjmp+longjmp.
3756
3757 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
3758
3759 Fix minor problem found by static checking.
3760 * buffer.c (Fdelete_all_overlays): Return nil.
3761
3762 2012-09-03 Martin Rudalics <rudalics@gmx.at>
3763
3764 * buffer.c (Fdelete_all_overlays): New function.
3765
3766 2012-09-03 Chong Yidong <cyd@gnu.org>
3767
3768 * gtkutil.c: Add extern decl for Qxft.
3769
3770 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
3771
3772 * emacs.c, eval.c: Use bool for boolean.
3773 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
3774 (malloc_using_checking) [DOUG_LEA_MALLOC]:
3775 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
3776 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
3777 (main, decode_env_path, Fdaemon_initialized):
3778 * eval.c (call_debugger, Finteractive_p, interactive_p):
3779 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
3780 (maybe_call_debugger, Fbacktrace):
3781 * process.c (read_process_output, exec_sentinel):
3782 Use bool for booleans.
3783 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
3784 All callers changed.
3785 * eval.c (interactive_p): Omit always-true boolean argument
3786 EXCLUDE_SUBRS_P. All callers changed.
3787 * dispextern.h, lisp.h: Reflect above API changes.
3788 * firstfile.c (dummy): Use the address of 'main', whose signature
3789 won't change, instead of the address of 'initialize', whose
3790 signature just changed from int to bool.
3791 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
3792 * msdos.c (fatal_error_in_progress): ... from here.
3793 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
3794 of incrementing it.
3795 (redisplay_internal, unwind_redisplay): Simply clear
3796 REDISPLAYING_P when unwinding, instead of saving its previous,
3797 always-false value and then restoring it.
3798
3799 Clean up some extern decls.
3800 Mostly, this hoists extern decls out of .c files and into .h files.
3801 That way, we're more likely to catch errors if the interfaces change.
3802 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
3803 declare xg_mark_data.
3804 * dispextern.h (x_frame_parm_handlers):
3805 * font.h (Qxft):
3806 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
3807 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
3808 (Qultra_bold, Qoblique, Qitalic):
3809 Move extern decl here from .c file.
3810 * alloc.c (xg_mark_data) [USE_GTK]:
3811 * doc.c (Qclosure):
3812 * eval.c (Qlexical_binding):
3813 * fns.c (time) [!HAVE_UNISTD_H]:
3814 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
3815 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
3816 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
3817 * lread.c (Qinternal_interpreter_environment):
3818 * minibuf.c (Qbuffer):
3819 * process.c (QCfamily, QCfilter):
3820 * widget.c (free_frame_faces):
3821 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
3822 * xfont.c (x_clear_errors):
3823 * xterm.c (x_frame_parm_handlers):
3824 Remove now-redundant extern decls.
3825 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
3826 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
3827 Now static.
3828 * xfaces.c: Remove unnecessary static decls.
3829 * xterm.c (updating_frame): Remove decl of nonexistent object.
3830
3831 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
3832 when building globals.h, as the objects that are not built on
3833 this host are not needed to compile C files on this host.
3834
3835 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
3836
3837 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
3838
3839 * frame.h: Add missing prototype for x_wm_set_size_hint.
3840
3841 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
3842
3843 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
3844 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
3845 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
3846 (Fsubstitute_command_keys):
3847 * editfns.c (region_limit, find_field, Fconstrain_to_field)
3848 (save_excursion_save, save_excursion_restore)
3849 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
3850 (format_time_string, general_insert_function)
3851 (make_buffer_string, make_buffer_string_both)
3852 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
3853 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
3854 (copy_text, insert_1, insert_1_both, insert_from_string)
3855 (insert_from_string_before_markers, insert_from_string_1)
3856 (insert_from_buffer, insert_from_buffer_1, replace_range)
3857 (replace_range_2, del_range_1, del_range_byte, del_range_both)
3858 (del_range_2, modify_region):
3859 * intervals.c (intervals_equal, balance_possible_root_interval)
3860 (adjust_intervals_for_insertion, merge_properties_sticky)
3861 (graft_intervals_into_buffer, lookup_char_property)
3862 (adjust_for_invis_intang, set_point_both)
3863 (get_property_and_range, compare_string_intervals)
3864 (set_intervals_multibyte_1, set_intervals_multibyte):
3865 * keyboard.c (decode_timer):
3866 Use bool for boolean.
3867 * intervals.h, lisp.h, systime.h: Reflect above API changes.
3868 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
3869
3870 2012-09-02 Chong Yidong <cyd@gnu.org>
3871
3872 * keymap.c (push_key_description): Print M-TAB as C-M-i
3873 (Bug#11758).
3874
3875 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
3876
3877 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
3878 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
3879 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
3880 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
3881 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
3882 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
3883 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3884
3885 2012-09-01 Eli Zaretskii <eliz@gnu.org>
3886
3887 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
3888 more than one grapheme cluster passed to the shaper: compute the
3889 offset adjustment values separately for each cluster. (Bug#11860)
3890
3891 * image.c: Restore mistakenly removed inclusion of w32.h. Without
3892 it, GCC doesn't see prototypes of w32_delayed_load, and complains
3893 about implicit conversions from integer to pointer.
3894
3895 2012-09-01 Daniel Colascione <dancol@dancol.org>
3896
3897 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
3898 system used too early.
3899
3900 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
3901
3902 Better seed support for (random).
3903 * emacs.c (main): Call init_random.
3904 * fns.c (Frandom): Set the seed from a string argument, if given.
3905 Remove long-obsolete Gentzel cruft.
3906 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
3907 (init_random): New function.
3908
3909 2012-09-01 Daniel Colascione <dancol@dancol.org>
3910
3911 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
3912 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
3913 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
3914 x_wm_set_size_hint, x_query_colors, x_real_positions,
3915 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
3916 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
3917 all of which have been moved to common code.
3918
3919 * xfaces.c: Include TERM_HEADER instead of listing all possible
3920 window-system headers.
3921
3922 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
3923 to match header.
3924
3925 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
3926 directly accessing frame internals.
3927
3928 * w32font.h: Include font.h. Define syms_of_w32font and
3929 globals_of_w32font.
3930
3931 * process.c: Include TERM_HEADER instead of listing all possible
3932 window-system headers.
3933
3934 * nsterm.h: Remove declarations now in frame.h.
3935 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
3936
3937 * menu.c: Include TERM_HEADER instead of listing all possible
3938 window-system headers.
3939
3940 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
3941 window system.
3942
3943 * keyboard.c: Include TERM_HEADER instead of listing all possible
3944 window-system headers.
3945
3946 * image.c: Include TERM_HEADER instead of listing all possible
3947 window-system headers. Declare Vlibrary_cache when compiling for
3948 Windows.
3949
3950 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
3951 window system declarations.
3952
3953 * frame.h: Move common functions here: set_frame_menubar,
3954 x_set_window_size, x_sync, x_get_focus_frame,
3955 x_set_mouse_position, x_set_mouse_pixel_position,
3956 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
3957 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
3958 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
3959 x_activate_menubar, x_real_positions, x_bitmap_icon,
3960 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
3961 and x_query_colors.
3962
3963 * frame.c: Include TERM_HEADER instead of listing all possible
3964 window-system headers.
3965
3966 * font.c: Include TERM_HEADER instead of listing all possible
3967 window-system headers.
3968
3969 * emacs.c: Include TERM_HEADER.
3970
3971 * dispnew.c: Include TERM_HEADER instead of listing all possible
3972 window-system headers.
3973
3974 * ccl.h: Include character.h.
3975
3976 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
3977 the current window system; include in list of objects to link into
3978 Emacs.
3979
3980 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3981
3982 Remove mark_ttys function and fix tty_display_info initialization.
3983 * lisp.h (mark_ttys): Remove prototype.
3984 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
3985 to mark_ttys because all possible values of 'top_frame' slot are
3986 the frames which are reachable from Vframe_list.
3987 * term.c (mark_ttys): Remove.
3988 (init_tty): Safely initialize 'top_frame' slot with Qnil.
3989
3990 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3991
3992 Change struct frame bitfields from unsigned char to unsigned.
3993 * frame.h (struct frame): Change type of 'display_preempted',
3994 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
3995 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
3996 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
3997 bitfields from unsigned char to unsigned.
3998
3999 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4000
4001 Remove unused member of struct x_output and struct w32_output.
4002 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
4003 * w32term.h (struct w32_output): Likewise.
4004
4005 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
4006
4007 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
4008 does not become zero (Bug#12234).
4009
4010 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
4011
4012 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
4013 for GCC 4.7.1 x86-64.
4014
4015 2012-08-30 Glenn Morris <rgm@gnu.org>
4016
4017 * lread.c (init_lread): For out-of-tree builds, only add the
4018 source directory's site-lisp dir to the load-path if it exists,
4019 consistent with in-tree builds. (Bug#12302)
4020
4021 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
4022
4023 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
4024 button_values to NULL. Call setStykeMask so dialogs get a close button.
4025 (windowShouldClose:): Set window_closed.
4026 (dealloc): New member, free button_values.
4027 (process_dialog:): Make member function. Remove window argument,
4028 replace window with self. Count buttons and allocate and store values
4029 in button_values.
4030 (addButton:value:row:): value is int with the name tag. Call setTag
4031 with tag. Remove return self, declare return value as void.
4032 (addString:row:): Remove return self, declare return value as void.
4033 (addSplit): Remove return self, declare return value as void.
4034 (clicked:): Remove return self, declare return value as void.
4035 Set dialog_return to button_values[seltag]. Code formatting change.
4036 (initFromContents:isQuestion:): Adjust call to process_dialog.
4037 Code formatting change.
4038 (timeout_handler:): Set timer_fired to YES.
4039 (runDialogAt:): Set timer_fired to NO.
4040 Handle click on close button as quit.
4041
4042 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
4043 Add window_closed and button_values. Add void as return value for
4044 add(Button|String|Split). addButton takes int instead of Lisp_Object.
4045 Add process_dialog as new member.
4046
4047 2012-08-28 Eli Zaretskii <eliz@gnu.org>
4048
4049 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
4050 is not one of the heaps we manage. (Bug#12242)
4051
4052 2012-08-28 Glenn Morris <rgm@gnu.org>
4053
4054 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
4055
4056 2012-08-28 Martin Rudalics <rudalics@gmx.at>
4057
4058 * window.c (Fset_window_configuration): Remove handling of
4059 auto-buffer-name window parameter. Install revision of reverted
4060 fix.
4061
4062 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4063
4064 Do not allow to set major mode for a dead buffer.
4065 * buffer.c (Fset_buffer_major_mode): Signal an error
4066 if the buffer is dead.
4067 (Fother_buffer, other_buffer_safely): Remove redundant
4068 nested declaration.
4069
4070 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4071
4072 Always use set_buffer_if_live to restore original buffer at unwind.
4073 * buffer.h (record_unwind_current_buffer): New function.
4074 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
4075 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
4076 * undo.c, window.c: Adjust users.
4077 * buffer.c (set_buffer_if_live): Fix comment.
4078
4079 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4080
4081 Fix usage of set_buffer_internal.
4082 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
4083 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
4084 * coding.c (decode_coding): Omit redundant test.
4085 * fileio.c (decide_coding_unwind): Likewise.
4086 * fns.c (secure_hash): Likewise.
4087 * insdel.c (modify_region): Likewise.
4088 * keyboard.c (command_loop_1): Likewise.
4089 * print.c (PRINTFINISH): Likewise.
4090 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
4091
4092 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
4093
4094 * dispnew.c: Use bool for boolean.
4095 (frame_garbaged, display_completed, delayed_size_change)
4096 (fonts_changed_p, add_window_display_history)
4097 (add_frame_display_history, verify_row_hash)
4098 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
4099 (row_equal_p, realloc_glyph_pool)
4100 (allocate_matrices_for_frame_redisplay)
4101 (showing_window_margins_p)
4102 (adjust_frame_glyphs_for_frame_redisplay)
4103 (build_frame_matrix_from_leaf_window, make_current)
4104 (mirrored_line_dance, mirror_line_dance, update_frame)
4105 (update_window_tree, update_single_window)
4106 (check_current_matrix_flags, update_window, update_text_area)
4107 (update_window_line, set_window_update_flags, scrolling_window)
4108 (update_frame_1, scrolling, buffer_posn_from_coords)
4109 (do_pending_window_change, change_frame_size)
4110 (change_frame_size_1, sit_for):
4111 Use bool for boolean.
4112 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
4113 and remove last int (actually boolean) argument, which was always 0.
4114 All callers changed.
4115 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
4116 * dispextern.h (struct composition_it): Use bool for boolean.
4117 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
4118 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
4119 * dired.c (file_name_completion):
4120 Use bool for boolean. (This was missed in an earlier change.)
4121
4122 2012-08-27 Martin Rudalics <rudalics@gmx.at>
4123
4124 * window.c (Fset_window_configuration): Revert first part of
4125 last change.
4126
4127 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
4128
4129 * nsterm.h (NSPanel): New class variable dialog_return.
4130
4131 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
4132 Initialize dialog_return.
4133 (windowShouldClose:): Use stop instead of stopModalWithCode.
4134 (clicked:): Ditto, and also set dialog_return (Bug#12258).
4135 (timeout_handler:): Use stop instead of abortModal. Send a dummy
4136 event.
4137 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
4138 modal loop returns.
4139
4140 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
4141
4142 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
4143 * composite.c (find_composition, composition_gstring_p)
4144 (composition_reseat_it, find_automatic_composition):
4145 * data.c (let_shadows_buffer_binding_p)
4146 (let_shadows_global_binding_p, set_internal, make_blv)
4147 (Fmake_variable_buffer_local, Fmake_local_variable)
4148 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
4149 (cons_to_signed, arith_driver):
4150 * dbusbind.c (xd_in_read_queued_messages):
4151 * dired.c (directory_files_internal, file_name_completion):
4152 Use bool for booleans.
4153 * dired.c (file_name_completion):
4154 * process.h (fd_callback):
4155 Omit int (actually boolean) argument. It wasn't being used.
4156 All uses changed.
4157 * composite.h, lisp.h: Reflect above API changes.
4158
4159 * cmds.c, coding.c: Use bool for booleans.
4160 * cmds.c (move_point, Fself_insert_command):
4161 * coding.h (struct composition status, struct coding_system):
4162 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
4163 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
4164 (emacs_mule_char, decode_coding_emacs_mule)
4165 (encode_coding_emacs_mule, detect_coding_iso_2022)
4166 (decode_coding_iso_2022, encode_invocation_designation)
4167 (encode_designation_at_bol, encode_coding_iso_2022)
4168 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
4169 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
4170 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
4171 (encode_coding_raw_text, detect_coding_charset)
4172 (decode_coding_charset, encode_coding_charset, detect_eol)
4173 (detect_coding, get_translation_table, produce_chars)
4174 (consume_chars, reused_workbuf_in_use)
4175 (make_conversion_work_buffer, code_conversion_save)
4176 (decode_coding_object, encode_coding_object)
4177 (detect_coding_system, char_encodable_p)
4178 (Funencodable_char_position, code_convert_region)
4179 (code_convert_string, code_convert_string_norecord)
4180 (Fset_coding_system_priority):
4181 * fileio.c (Finsert_file_contents):
4182 Use bool for booleans.
4183 * coding.h, lisp.h: Reflect above API changes.
4184 * coding.c: Remove unnecessary static function decls.
4185 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
4186 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
4187 not a boolean 'int', since callers never look at the return value.
4188 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
4189 * coding.h (decoding_buffer_size, encoding_buffer_size)
4190 (emacs_mule_string_char): Remove unused extern decls.
4191 (struct iso_2022_spec, struct coding_system):
4192 Use 'unsigned int : 1' for boolean fields, since there's more than one.
4193 (struct emacs_mule_spec): Remove unused field 'full_support'.
4194 All initializations removed.
4195 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
4196
4197 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
4198
4199 Fix spare memory change (Bug#12286).
4200 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
4201 (valid_lisp_object_p): Likewise.
4202
4203 2012-08-27 Martin Rudalics <rudalics@gmx.at>
4204
4205 * window.c (Fset_window_configuration): Record any window's old
4206 buffer if it's replaced (see Bug#8789). If the new current
4207 buffer doesn't appear in the selected window, go to its old
4208 point (Bug#12208).
4209
4210 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
4211
4212 Special MEM_TYPE_SPARE to denote reserved memory.
4213 * alloc.c (enum mem_type): New memory type.
4214 (refill_memory_reserve): Use new type for spare memory.
4215 This prevents live_cons_p and live_string_p from incorrect
4216 detection of uninitialized objects from spare memory as live.
4217
4218 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
4219
4220 Spelling fixes.
4221 * Makefile.in (.PHONY): versioclean -> versionclean.
4222
4223 Remove unused external symbols.
4224 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
4225 * window.c (Qwindow_valid_p, decode_valid_window):
4226 Now static, not extern.
4227 * data.c (Qinterval): Remove; unused.
4228 (syms_of_data): Do not define 'interval'.
4229 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
4230 * window.h (decode_valid_window):
4231 Remove decls.
4232
4233 * character.c, charset.c, chartab.c: Use bool for booleans.
4234 * character.c (lisp_string_width, string_count_byte8)
4235 (string_escape_byte8):
4236 * charset.c (charset_map_loaded, load_charset_map, read_hex):
4237 (load_charset_map_from_file, map_charset_chars)
4238 (Fdefine_charset_internal, define_charset_internal)
4239 (Fdeclare_equiv_charset, find_charsets_in_text)
4240 (Ffind_charset_region, char_charset, Fiso_charset):
4241 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
4242 (sub_char_table_set, sub_char_table_set_range)
4243 (char_table_set_range, optimize_sub_char_table)
4244 (map_sub_char_table):
4245 Use bool for boolean.
4246 * character.c (str_to_unibyte): Omit last boolean argument; it was
4247 always 0. All callers changed.
4248 * character.h, charset.h: Adjust to match previous changes.
4249 * character.h (char_printable_p): Remove decl of nonexistent function.
4250 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
4251 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
4252 are all boolean, so make them single-bit bitfields.
4253
4254 * lisp.h (ASET): Remove attempt to detect side effects.
4255 It was meant to be temporary and it often doesn't work,
4256 because when IDX has side effects the behavior of IDX==IDX
4257 is undefined. See Stefan Monnier in
4258 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
4259
4260 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
4261
4262 * lisp.h (functionp): New function (extracted from Ffunctionp).
4263 (FUNCTIONP): Use it.
4264 * eval.c (Ffunctionp): Use it.
4265
4266 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
4267
4268 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
4269 as that's faster and simpler than static storage. Don't bother
4270 with the g_main_context_query overhead if g_main_context_pending
4271 says no events are pending.
4272 (gfds, gfds_size): Remove these static vars.
4273 (xgselect_initialize): Remove; no longer needed.
4274 All uses and decls removed.
4275
4276 * emacs.c (fatal_error_signal_hook): Remove.
4277 All uses removed. This leftover from old code was always 0.
4278
4279 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
4280 * casefiddle.c (casify_object, casify_region):
4281 * casetab.c (set_case_table):
4282 * category.c, category.h (word_boundary_p):
4283 * category.h (CHAR_HAS_CATEGORY):
4284 Use bool for booleans, instead of int.
4285
4286 2012-08-25 Eli Zaretskii <eliz@gnu.org>
4287
4288 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
4289
4290 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
4291
4292 On assertion failure, print backtrace if available.
4293 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
4294 (die) [ENABLE_CHECKING]: Print a backtrace if available.
4295 * Makefile.in (LIB_EXECINFO): New macro.
4296 (LIBES): Use it.
4297
4298 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
4299 * bytecode.c (exec_byte_code):
4300 * callint.c (check_mark, Fcall_interactively):
4301 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
4302 (getenv_internal, sync_process_alive, call_process_exited):
4303 * lisp.h (USE_SAFE_ALLOCA):
4304 Use bool for booleans, instead of int.
4305 * lisp.h, process.h: Adjust prototypes to match above changes.
4306 * callint.c (Fcall_interactively): Don't assume the mark's
4307 offset fits in 'int'.
4308
4309 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
4310
4311 * buffer.c, buffer.h: Use bool for boolean.
4312 * buffer.c (reset_buffer_local_variables)
4313 (buffer_lisp_local_variables, Fset_buffer_modified_p)
4314 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
4315 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
4316 (overlay_touches_p, overlay_strings, Foverlay_put)
4317 (report_overlay_modification, call_overlay_mod_hooks):
4318 (mmap_enlarge, mmap_set_vars):
4319 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
4320 Use bool for booleans, instead of int.
4321 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
4322 since the 1-or-0 return value is always ignored anyway.
4323 (mmap_initialized_p):
4324 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
4325 * buffer.h, lisp.h: Adjust prototypes to match above changes.
4326
4327 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
4328
4329 * bidi.c: Use bool for boolean.
4330 This is a bit more readable, and makes the text segment of bidi.o
4331 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
4332 Presumably it's faster too.
4333 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
4334 Now bool.
4335 (bidi_cache_find_level_change, bidi_cache_iterator_state)
4336 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
4337 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
4338 (bidi_explicit_dir_char, bidi_level_of_next_char)
4339 (bidi_find_other_level_edge, bidi_move_to_visually_next):
4340 Use bool for booleans, instead of int.
4341 * dispextern.h (bidi_init_it, bidi_paragraph_init)
4342 (bidi_unshelve_cache): Adjust decls to match code.
4343
4344 2012-08-23 Martin Rudalics <rudalics@gmx.at>
4345
4346 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
4347 argument.
4348
4349 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
4350
4351 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
4352 * atimer.h: Include <stdbool.h>.
4353
4354 2012-08-22 Dan Nicolaescu <dann@gnu.org>
4355
4356 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
4357 compile time tests instead of run time tests on systems that do
4358 not use them.
4359 (FRAME_MAC_P): Remove leftover from deleted code.
4360 * frame.c (syms_of_frame): Remove leftover from deleted code.
4361
4362 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
4363
4364 * nsterm.m (insertText:): Don't clear modifiers if code is space.
4365
4366 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
4367
4368 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
4369 Otherwise, the compiler complains about (A?B:C) where B is void
4370 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
4371 (fontset_add): Return void, for FONTSET_ADD.
4372
4373 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
4374
4375 * alloc.c: Use bool for booleans.
4376 (gc_in_progress, abort_on_gc)
4377 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
4378 (dont_register_blocks) [GC_MALLOC_CHECK]:
4379 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
4380 (check_string_bytes, make_specified_string, memory_full)
4381 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
4382 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
4383 (mark_stack, valid_pointer_p, make_pure_string)
4384 (Fgarbage_collect, survives_gc_p, gc_sweep):
4385 Use bool for booleans, instead of int.
4386 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
4387 Remove unused local.
4388 * alloc.c (PURE_POINTER_P):
4389 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
4390 * editfns.c (Fformat):
4391 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
4392 (Fdo_auto_save):
4393 * fns.c (sweep_weak_table):
4394 * lisp.h (suppress_checking, push_message, survives_gc_p)
4395 (make_pure_string, gc_in_progress, abort_on_gc):
4396 * lread.c (readchar, read1):
4397 * print.c (Fprin1_to_string):
4398 * xdisp.c (push_message):
4399 Use bool for booleans affected directly or indirectly by
4400 alloc.c's changes.
4401
4402 Make recently-introduced setters macros.
4403 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
4404 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
4405 (set_fontset_default, set_fontset_fallback): Rename from their
4406 upper-case counterparts, and make them functions rather than macros.
4407 This is more consistent with the other recently-introduced setters.
4408 These don't need to be inline, since they're local.
4409
4410 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
4411
4412 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
4413 the loop (Bug#12247).
4414
4415 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
4416
4417 * lisp.h (vcopy): Use memcpy rather than our own loop.
4418 This fixes a performance regression introduced by the recent
4419 addition of vcopy. This means 'vcopy' will need to be modified
4420 for a copying collector, but that's OK. Also, tighten the
4421 checking in the assertion.
4422
4423 2012-08-21 Eli Zaretskii <eliz@gnu.org>
4424
4425 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
4426 components for RTL text (Bug#11860). Adjust X-OFFSET of each
4427 non-base glyph for the width of the base character, according to
4428 what x_draw_composite_glyph_string_foreground expects.
4429 Generate WADJUST value according to composition_gstring_width's
4430 expectations, to produce correct width of the composed character.
4431 Reverse the sign of the DU offset produced by ScriptPlace.
4432
4433 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
4434
4435 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
4436
4437 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
4438
4439 Avoid direct writes to contents member of struct Lisp_Vector.
4440 * lisp.h (vcopy): New function to copy data into vector.
4441 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
4442 * fns.c (Ffillarray): Use ASET.
4443 * keyboard.c (timer_check_2): Use AREF and ASET.
4444 (append_tool_bar_item, Frecent_keys): Use vcopy.
4445 * lread.c (read_vector): Use ASET.
4446 * msdos.c (Frecent_doskeys): Use vcopy.
4447 * xface.c (Finternal_copy_lisp_face): Use vcopy.
4448 (Finternal_merge_in_global_face): Use ASET and vcopy.
4449 * xfont.c (xfont_list_pattern): Likewise.
4450
4451 2012-08-21 Martin Rudalics <rudalics@gmx.at>
4452
4453 * window.c (Fwindow_point): For the selected window always return
4454 the position of its buffer's point.
4455 (Fset_window_point): For the selected window always go in its
4456 buffer to the specified position.
4457
4458 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
4459
4460 Setter macros for fontsets.
4461 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
4462 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
4463 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
4464 Adjust users.
4465
4466 2012-08-20 Glenn Morris <rgm@gnu.org>
4467
4468 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
4469 Don't assume that `ln -f' works.
4470
4471 2012-08-20 Eli Zaretskii <eliz@gnu.org>
4472
4473 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
4474 and later about non-assignments with no effect. See discussion at
4475 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
4476 details.
4477
4478 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4479
4480 Inline setter functions for Lisp_Objects slots of struct specbinding.
4481 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
4482 Adjust users.
4483
4484 2012-08-20 Martin Rudalics <rudalics@gmx.at>
4485
4486 * window.c (select_window): Always make selected window's buffer
4487 current.
4488
4489 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4490
4491 Use AREF and ASET for docstrings of category tables.
4492 * category.h (CATEGORY_DOCSTRING): Use AREF.
4493 (SET_CATEGORY_DOCSTRING): Use ASET.
4494 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
4495
4496 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4497
4498 Inline setter functions for hash table members.
4499 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
4500 (set_hash_hash, set_hash_index): Rename with _slot suffix.
4501 (set_hash_key_and_value, set_hash_index, set_hash_next)
4502 (set_hash_hash): New functions.
4503 * charset.c, fns.c: Adjust users.
4504
4505 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4506
4507 Inline getter and setter functions for per-buffer values.
4508 * buffer.h (per_buffer_default, set_per_buffer_default)
4509 (per_buffer_value, set_per_buffer_value): New functions.
4510 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
4511 * buffer.c, data.c: Adjust users.
4512
4513 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
4514
4515 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
4516
4517 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
4518
4519 Rely on <config.h> + <unistd.h> to declare 'environ',
4520 as gnulib does this if the system doesn't.
4521 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
4522 Remove declaration. MS-Windows declares it on stdlib.h which is
4523 included by conf_post.h.
4524 * emacs.c (environ) [DOUG_LEA_MALLOC]:
4525 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
4526 * vm-limit.c: Include <unistd.h>, for 'environ'.
4527
4528 * unexaix.c, unexcoff.c: Include "mem-limits.h".
4529 (start_of_data): Remove decl; mem-limits.h provides it.
4530
4531 * xdisp.c (handle_invisible_prop): Make it a bit faster
4532 and avoid a gcc -Wmaybe-uninitialized diagnostic.
4533
4534 2012-08-19 Chong Yidong <cyd@gnu.org>
4535
4536 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
4537 ends (Bug#3874).
4538
4539 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
4540
4541 * .gdbinit: Use call instead of set when calling a function in the
4542 inferior.
4543
4544 * data.c (set_internal): Don't use set_blv_found.
4545 (Fkill_local_variable): Likewise.
4546
4547 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
4548
4549 * nsfont.m (ns_ascii_average_width): Ensure the string
4550 ascii_printable is initialized with a null-terminated character
4551 array. Otherwise, it can contain undesired extra characters.
4552
4553 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
4554
4555 port new setting code to Sun C 5.8 2005/10/13
4556 * chartab.c, lisp.h (char_table_set, char_table_set_range):
4557 Return void, not Lisp_Object. Otherwise, the compiler
4558 complains about (A?B:C) where B is void and C is Lisp_Object
4559 when compiling CHAR_TABLE_SET, due to the recent change to
4560 the API of sub_char_table_set_contents.
4561
4562 2012-08-18 Chong Yidong <cyd@gnu.org>
4563
4564 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
4565 for the string case (Bug#3874).
4566
4567 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
4568
4569 * buffer.h (BSET): Remove (Bug#12215).
4570 Replace all uses with calls to new setter functions.
4571 (bset_bidi_paragraph_direction, bset_case_canon_table)
4572 (bset_case_eqv_table, bset_directory, bset_display_count)
4573 (bset_display_time, bset_downcase_table)
4574 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
4575 (bset_last_selected_window, bset_local_var_alist)
4576 (bset_mark_active, bset_point_before_scroll, bset_read_only)
4577 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
4578 (bset_width_table):
4579 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
4580 (bset_auto_fill_function, bset_auto_save_file_format)
4581 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
4582 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
4583 (bset_cache_long_line_scans, bset_case_fold_search)
4584 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
4585 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
4586 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
4587 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
4588 (bset_header_line_format, bset_indicate_buffer_boundaries)
4589 (bset_indicate_empty_lines, bset_invisibility_spec)
4590 (bset_left_fringe_width, bset_major_mode, bset_mark)
4591 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
4592 (bset_name, bset_overwrite_mode, bset_pt_marker)
4593 (bset_right_fringe_width, bset_save_length)
4594 (bset_scroll_bar_width, bset_scroll_down_aggressively)
4595 (bset_scroll_up_aggressively, bset_selective_display)
4596 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
4597 (bset_word_wrap, bset_zv_marker):
4598 * category.c (bset_category_table):
4599 * syntax.c (bset_syntax_table):
4600 New setter functions.
4601
4602 * process.h (PSET): Remove (Bug#12215).
4603 Replace all uses with calls to new setter functions.
4604 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4605 (PROCESS_INLINE): New macro.
4606 (pset_childp): New setter function.
4607 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
4608 * process.c (PROCESS_INLINE):
4609 Define to EXTERN_INLINE, so that the corresponding functions
4610 are compiled into code.
4611 (pset_buffer, pset_command, pset_decode_coding_system)
4612 (pset_decoding_buf, pset_encode_coding_system)
4613 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
4614 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
4615 (pset_type, pset_write_queue): New setter functions.
4616
4617 * window.h (WSET): Remove (Bug#12215).
4618 Replace all uses with calls to new setter functions.
4619 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4620 (WINDOW_INLINE): New macro.
4621 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
4622 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
4623 (wset_total_lines, wset_vertical_scroll_bar)
4624 (wset_window_end_pos, wset_window_end_valid)
4625 (wset_window_end_vpos): New setter functions.
4626 * window.c (WINDOW_INLINE):
4627 Define to EXTERN_INLINE, so that the corresponding functions
4628 are compiled into code.
4629 (wset_combination_limit, wset_dedicated, wset_display_table)
4630 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
4631 (wset_new_normal, wset_new_total, wset_next_buffers)
4632 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
4633 (wset_prev_buffers, wset_right_fringe_width)
4634 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
4635 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
4636 (wset_window_parameters):
4637 * xdisp.c (wset_base_line_number, wset_base_line_pos)
4638 (wset_column_number_displayed, wset_region_showing):
4639 New setter functions.
4640
4641 * termhooks.h (TSET): Remove (Bug#12215).
4642 Replace all uses with calls to new setter functions.
4643 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4644 (TERMHOOKS_INLINE): New macro.
4645 (tset_charset_list, tset_selection_alist): New setter functions.
4646 * terminal.c (TERMHOOKS_INLINE):
4647 Define to EXTERN_INLINE, so that the corresponding functions
4648 are compiled into code.
4649 (tset_param_alist): New setter function.
4650
4651 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
4652
4653 * keyboard.h (KSET): Remove (Bug#12215).
4654 Replace all uses with calls to new setter functions.
4655 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4656 (KEYBOARD_INLINE): New macro.
4657 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
4658 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
4659 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
4660 New setter functions.
4661 * keyboard.c (KEYBOARD_INLINE):
4662 Define to EXTERN_INLINE, so that the corresponding functions
4663 are compiled into code.
4664 (kset_echo_string, kset_kbd_queue)
4665 (kset_keyboard_translate_table, kset_last_prefix_arg)
4666 (kset_last_repeatable_command, kset_local_function_key_map)
4667 (kset_overriding_terminal_local_map, kset_real_last_command)
4668 (kset_system_key_syms): New setter functions.
4669
4670 * frame.h (FSET): Remove (Bug#12215).
4671 Replace all uses with calls to new setter functions.
4672 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4673 (FRAME_INLINE): New macro.
4674 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
4675 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
4676 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
4677 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
4678 (fset_param_alist, fset_root_window, fset_scroll_bars)
4679 (fset_selected_window, fset_title, fset_tool_bar_items)
4680 (fset_tool_bar_position, fset_tool_bar_window): New functions.
4681 * frame.c (FRAME_INLINE):
4682 Define to EXTERN_INLINE, so that the corresponding functions
4683 are compiled into code.
4684 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
4685
4686 A few more naming-convention fixes for getters and setters.
4687 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
4688 and rename from buffer_overlays_set_before.
4689 (set_buffer_overlays_after): Move here from buffer.h, and rename
4690 from buffer_overlays_set_after.
4691 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
4692 All uses changed.
4693 (set_buffer_intervals): Rename from buffer_set_intervals.
4694 * intervals.c (set_interval_object): Move here from intervals.h,
4695 and rename from interval_set_object.
4696 (set_interval_left): Move here from intervals.h, and rename from
4697 interval_set_left.
4698 (set_interval_right): Move here from intervals.h, and rename from
4699 interval_set_right.
4700 (copy_interval_parent): Move here from intervals.h, and rename from
4701 interval_copy_parent.
4702 * intervals.h (set_interval_parent): Rename from interval_set_parent.
4703 (set_interval_plist): Rename from interval_set_plist.
4704 Return void, not Lisp_Object, since no caller uses the result.
4705 * lisp.h (string_intervals): Rename from string_get_intervals.
4706 (set_string_intervals): Rename from string_set_intervals.
4707
4708 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
4709 (set_char_table_contents): Rename from char_table_set_contents.
4710 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
4711 All uses changed. See the end of
4712 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
4713
4714 * lisp.h (CSET): Remove (Bug#12215).
4715 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
4716 (set_char_table_purpose): New functions,
4717 replacing CSET. All uses changed. For example, replace
4718 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
4719 "set_char_table_parent (char_table, parent);".
4720 The old version was confusing because it used the same name
4721 'parent' for two different things.
4722
4723 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
4724
4725 Functions to get and set Lisp_Object fields of buffer-local variables.
4726 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
4727 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
4728 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
4729 * data.c, eval.c, frame.c: Adjust users.
4730
4731 2012-08-17 Chong Yidong <cyd@gnu.org>
4732
4733 * xfaces.c (merge_face_vectors): If the target font specfies a
4734 font spec, make the font's attributes take precedence over
4735 directly-specified attributes.
4736 (merge_face_ref): Recognize :font.
4737
4738 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
4739
4740 Do not use memcpy for copying intervals.
4741 * intervals.c (reproduce_interval): New function.
4742 (reproduce_tree, reproduce_tree_obj): Use it.
4743 (reproduce_tree_obj): Remove prototype.
4744
4745 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
4746
4747 * lisp.h (duration_to_sec_usec): Remove unused decl.
4748
4749 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
4750
4751 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
4752 to an allocated instance of NSString, not to the class itself.
4753
4754 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
4755
4756 * makefile.w32-in (C_CTYPE_H): New macro.
4757 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
4758 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
4759 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
4760
4761 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
4762
4763 Use ASCII tests for character types.
4764 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
4765 * xfns.c, xterm.c:
4766 Don't include <ctype.h>; was not needed.
4767 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
4768 * sysdep.c, xfaces.c:
4769 Include <c-ctype.h> instead of <ctype.h>.
4770 * nsterm.m: Include <c-ctype.h>.
4771 * charset.c (read_hex):
4772 * doc.c (Fsnarf_documentation):
4773 * fileio.c (IS_DRIVE) [WINDOWSNT]:
4774 (DRIVE_LETTER) [DOS_NT]:
4775 (Ffile_name_directory, Fexpand_file_name)
4776 (Fsubstitute_in_file_name):
4777 * font.c (font_parse_xlfd, font_parse_fcname):
4778 * frame.c (x_set_font_backend):
4779 * gtkutil.c (xg_get_font):
4780 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
4781 * nsimage.m (hexchar):
4782 * nsterm.m (ns_xlfd_to_fontname):
4783 * sysdep.c (system_process_attributes):
4784 * xfaces.c (hash_string_case_insensitive):
4785 Use C-locale tests instead of locale-specific tests for character
4786 types, since we want the ASCII interpretation here, not the
4787 interpretation suitable for whatever happens to be the current locale.
4788
4789 2012-08-16 Martin Rudalics <rudalics@gmx.at>
4790
4791 Consistently check windows for validity/liveness
4792 (Bug#11984, Bug#12025, Bug#12026).
4793 * lisp.h (CHECK_VALID_WINDOW): New macro.
4794 * window.c (decode_window): Rename to decode_live_window.
4795 (decode_valid_window, Fwindow_valid_p): New functions.
4796 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
4797 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
4798 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
4799 (Fwindow_prev_sibling, Fwindow_combination_limit)
4800 (Fset_window_combination_limit, Fwindow_use_time)
4801 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
4802 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
4803 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
4804 (Fwindow_hscroll, Fset_window_hscroll)
4805 (Fwindow_redisplay_end_trigger)
4806 (Fset_window_redisplay_end_trigger, Fwindow_edges)
4807 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
4808 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
4809 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
4810 (Fwindow_end, Fset_window_point, Fset_window_start)
4811 (Fpos_visible_in_window_p, Fwindow_line_height)
4812 (Fwindow_dedicated_p, Fset_window_dedicated_p)
4813 (Fwindow_prev_buffers, Fset_window_prev_buffers)
4814 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
4815 (Fset_window_parameter, Fwindow_display_table)
4816 (Fset_window_display_table, Fdelete_other_windows_internal)
4817 (Fset_window_buffer, Fset_window_new_total)
4818 (Fset_window_new_normal, Fdelete_window_internal)
4819 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
4820 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
4821 (Fwindow_scroll_bars): Check whether argument window is a valid or
4822 live window. Update doc-strings.
4823 (syms_of_window): New symbol Qwindow_valid_p.
4824 * keyboard.c (Fposn_at_x_y): Check whether argument
4825 frame_or_window denotes a valid window.
4826
4827 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
4828
4829 Fix previous char table change.
4830 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
4831 * chartab.c (optimize_sub_char_table): Likewise.
4832
4833 2012-08-16 Chong Yidong <cyd@gnu.org>
4834
4835 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
4836
4837 * xfont.c (xfont_open):
4838 * xftfont.c (xftfont_open): Set the font's max_width field.
4839
4840 * nsfont.m (nsfont_open): Similar to the Xft backend, set
4841 min_width to space_width and average_width to the average over
4842 printable ASCII characters.
4843 (ns_char_width): Code cleanup.
4844 (ns_ascii_average_width): New utility function.
4845
4846 * font.h (struct font): Update comments.
4847
4848 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
4849
4850 Simple interface to set Lisp_Object fields of character tables.
4851 * lisp.h (CSET): New macro.
4852 (char_table_set_extras, char_table_set_contents)
4853 (sub_char_table_set_contents): New function.
4854 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
4855 * syntax.c: Adjust users.
4856
4857 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
4858
4859 * eval.c (eval_sub): Bind lexical-binding.
4860 * lread.c (Qlexical_binding): Make non-static.
4861
4862 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
4863
4864 * nsmenu.m (popupSession): Remove.
4865 (pop_down_menu): Remove endModalSession.
4866 (timeout_handler:): New method.
4867 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
4868 Call runModalForWindow. Check timer_fired when it returns.
4869 If not set, cancel timer and break out of loop.
4870 Otherwise loop again, with a new timeout.
4871
4872 * nsterm.m: Include fcntl.h if present.
4873 (fd_entry, t_readfds, inNsSelect): Remove.
4874 (select_writefds, select_valid, select_timeout, selfds)
4875 (select_mutex, apploopnr): Add.
4876 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
4877 Otherwise call kbd_buffer_store_event.
4878 (ns_send_appdefined): Remove release of fd_entry.
4879 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
4880 Increment and decrement apploopnr.
4881 (ns_select): If no file descriptors, just do a NSTimer.
4882 Otherwise copy read/write masks and start select thread (fd_handler).
4883 Start main loop and wait for application defined event.
4884 Inform select thread to stop selecting after main loop is exited.
4885 (ns_term_init): Create selfds pipe and set non-blocking.
4886 Initialize select_mutex. Start the select thread (fd_handler).
4887 (fd_handler:): Loop forever, wait for info from the main thread
4888 to either start or stop selecting. When select returns, send
4889 and appdefined event.
4890 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
4891 If not call kbd_buffer_store_event.
4892
4893 * nsterm.h (EmacsApp): fd_handler takes id argument.
4894 (EmacsDialogPanel): Add timer_fired and timeout_handler.
4895
4896 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
4897
4898 2012-08-15 Eli Zaretskii <eliz@gnu.org>
4899
4900 * region-cache.c (move_cache_gap): Update gap_len using the actual
4901 growth of the boundaries array. Do not change cache_len.
4902 (Bug#12196)
4903
4904 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
4905
4906 Generalize and cleanup font subsystem checks.
4907 * font.h (FONT_DEBUG, font_assert): Remove.
4908 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
4909 Change font_assert to eassert. Use eassert where appropriate.
4910
4911 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
4912
4913 * gtkutil.c (xg_get_font): Use pango_units_to_double.
4914
4915 2012-08-15 Chong Yidong <cyd@gnu.org>
4916
4917 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
4918 When using the new font chooser, use gtk_font_chooser_get_font_desc to
4919 extract the font descriptor instead of just the font name.
4920 In that case, return a font spec instead of a string.
4921 (x_last_font_name): Move to this file from xfns.c.
4922
4923 * xfns.c (Fx_select_font): The return value can also be a font
4924 spec. Move x_last_font_name management to gtkutil.c.
4925
4926 * xfaces.c: Make font weight and style symbols non-static.
4927
4928 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
4929
4930 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
4931 (bug#12117).
4932
4933 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
4934
4935 * alloc.c (Fgarbage_collect): Use plural form consistently.
4936
4937 2012-08-14 Eli Zaretskii <eliz@gnu.org>
4938
4939 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
4940 iteration through the command loop. Fixes a problem whereby mouse
4941 movements are ignored until the first mouse click.
4942
4943 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4944
4945 Use bool, not int, for Lisp booleans.
4946 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
4947 makes Emacs a bit smaller and presumably a bit faster.
4948 * lisp.h: Include <stdbool.h>.
4949 (struct Lisp_Boolfwd, defvar_bool):
4950 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
4951 * regex.c [!emacs]: Include <stdbool.h>.
4952 (false, true): Remove; <stdbool.h> does this for us now.
4953
4954 2012-08-14 Chong Yidong <cyd@gnu.org>
4955
4956 * character.c (Fcharacterp): Doc fix (Bug#12076).
4957
4958 * data.c (Findirect_variable): Doc fix (Bug#11040).
4959
4960 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
4961
4962 * editfns.c (Fformat): Doc fix (Bug#12059).
4963 (Fsave_current_buffer): Doc fix (Bug#11542).
4964
4965 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
4966
4967 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
4968 (bug#12022).
4969
4970 2012-08-14 Martin Rudalics <rudalics@gmx.at>
4971
4972 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
4973 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
4974 * minibuf.c (choose_minibuf_frame, read_minibuf):
4975 * w32fns.c (x_create_tip_frame):
4976 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
4977 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
4978
4979 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4980
4981 * intervals.c (offset_intervals): Remove obsolete comment.
4982
4983 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
4984
4985 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
4986
4987 2012-08-14 Gergely Risko <gergely@risko.hu>
4988
4989 * coding.c (decode_coding): Record buffer modification before
4990 disabling undo_list (Bug#11773).
4991
4992 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4993
4994 Revert and cleanup some recent overlay changes.
4995 * buffer.h (enum overlay_type): Remove.
4996 (buffer_get_overlays, buffer_set_overlays): Likewise.
4997 (buffer_set_overlays_before, buffer_set_overlays_after):
4998 New function. Adjust users.
4999 (unchain_both): Add eassert.
5000
5001 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
5002
5003 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
5004
5005 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5006
5007 * gtkutil.c (xg_mark_data): Don't assume C99.
5008
5009 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
5010
5011 * gtkutil.c (xg_frame_tb_info): New struct.
5012 (TB_INFO_KEY): New define.
5013 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
5014 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
5015 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
5016 if not present.
5017 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
5018 is up to date. Otherwise store new data.
5019 (free_frame_tool_bar): Free xg_frame_tb_info if present.
5020
5021 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
5022
5023 Use KSET for write access to Lisp_Object members of struct kboard.
5024 * keyboard.h (KSET): New macro.
5025 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
5026 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
5027 * xterm.c: Adjust users.
5028
5029 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
5030
5031 Use BSET for write access to Lisp_Object members of struct buffer.
5032 * buffer.h (BSET): New macro.
5033 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
5034 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
5035 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
5036 * window.c, xdisp.c, xfns.c: Adjust users.
5037
5038 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
5039
5040 * lread.c (syms_of_lread): Initialize Vlexical_binding.
5041
5042 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
5043
5044 * nsterm.m (not_in_argv): New function.
5045 (application:openFile, application:openTempFile:):
5046 (application:openFileWithoutUI:, application:openFiles:): Open file
5047 if not_in_argv returns non-zero (bug#12171).
5048
5049 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
5050 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
5051 Define for Gtk+ versions less than 3.2.
5052 (xg_get_font_name): Use those functions/macros here.
5053 Reported by Frans Oilinki <moilinki@gmail.com>.
5054
5055 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5056
5057 * unexmacosx.c (copy_data_segment): Copy initialized data in
5058 statically linked libraries from input file rather than memory.
5059
5060 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
5061 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
5062 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
5063
5064 2012-08-10 Glenn Morris <rgm@gnu.org>
5065
5066 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
5067 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
5068
5069 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5070
5071 Fix last change to allow compilation with low optimization levels.
5072 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
5073 Reported by Jan Djärv <jan.h.d@swipnet.se>.
5074
5075 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5076
5077 Use common inline syntax in intervals.h.
5078 * intervals.h (INTERVALS_INLINE): New macro.
5079 Change all users from LISP_INLINE.
5080
5081 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5082
5083 Define Qnone once for all platforms.
5084 * frame.c (Qnone): Define here.
5085 (syms_of_frame): DEFSYM it.
5086 * lisp.h (Qnone): New declaration.
5087 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
5088 * xfns.c: Remove duplication. Adjust users.
5089
5090 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5091
5092 Remove unused macros from intervals.h.
5093 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
5094 * intervals.c: Adjust comment.
5095
5096 2012-08-10 Eli Zaretskii <eliz@gnu.org>
5097
5098 * w32fns.c <w32_unicode_gui>: New static variable.
5099 (globals_of_w32fns): Initialize it according to os_subtype.
5100 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
5101 testing os_subtype.
5102
5103 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
5104 Eli Zaretskii <eliz@gnu.org>
5105
5106 Fix bug #10299 with Unicode characters sent by customized
5107 keyboards created by MSKLC.
5108 * w32fns.c (INIT_WINDOW_CLASS): New macro.
5109 (w32_init_class): Use it to initialize the Emacs class with either
5110 ANSI or Unicode API calls.
5111 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
5112 later.
5113 (w32_wnd_proc): If the character code sent by WM_CHAR or
5114 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
5115 original message. Call DefWindowProcW on NT and later.
5116
5117 2012-08-10 Glenn Morris <rgm@gnu.org>
5118
5119 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
5120
5121 * lisp.h (DIRECTORY_SEP): Let configure set it.
5122
5123 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
5124
5125 Use TSET for write access to Lisp_Object slots of struct terminal.
5126 * termhooks.h (TSET): New macro.
5127 * coding.c, terminal.c, xselect.c: Adjust users.
5128
5129 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
5130
5131 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
5132 the failing expression, include them in the error message.
5133 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
5134 * lisp.h (internal_condition_case_n): Update declaration.
5135
5136 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5137
5138 Inline functions to examine and change buffer overlays.
5139 * buffer.c (unchain_both): New function.
5140 * buffer.h (buffer_get_overlays, buffer_set_overlays):
5141 (buffer_has_overlays): New function.
5142 (enum overlay_type): New enum.
5143 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
5144 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
5145
5146 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5147
5148 Inline functions to examine and change buffer intervals.
5149 * alloc.c (mark_interval_tree): Remove.
5150 (MARK_INTERVAL_TREE): Simplify.
5151 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
5152 * intervals.c (buffer_balance_intervals): New function.
5153 (graft_intervals_into_buffer): Adjust indentation.
5154 (set_intervals_multibyte): Simplify.
5155 * buffer.h (BUF_INTERVALS): Remove.
5156 (buffer_get_intervals, buffer_set_intervals): New function.
5157 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
5158 * intervals.c, textprop.c: Adjust users.
5159
5160 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5161
5162 Inline functions to examine and change string intervals.
5163 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
5164 (string_get_intervals, string_set_intervals): New function.
5165 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
5166 * lread.c, print.c, textprop.c: Adjust users.
5167
5168 2012-08-08 Glenn Morris <rgm@gnu.org>
5169
5170 * lisp.mk (lisp): Remove language/persian.elc.
5171
5172 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5173
5174 Cleanup intervals.
5175 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
5176 (NULL_INTERVAL_P): Likewise. Adjust users.
5177 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
5178 Adjust comment. Move under #if 0.
5179 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
5180 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
5181
5182 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5183
5184 Check total length of intervals with eassert.
5185 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
5186 * intervals.c: Change all users to eassert.
5187
5188 2012-08-07 Eli Zaretskii <eliz@gnu.org>
5189
5190 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
5191 Rename fields to match removal of FGET and WGET and disuse of
5192 INTERNAL_FIELD in Lisp_Cons.
5193
5194 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5195
5196 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
5197 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
5198 name since all xname users are fixed long time ago. Do not
5199 use INTERNAL_FIELD.
5200 (set_symbol_name, set_symbol_function, set_symbol_plist):
5201 (set_symbol_next, set_overlay_plist): New function.
5202 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
5203 (struct Lisp_Overlay): Likewise.
5204 (CVAR, MVAR, SVAR): Remove.
5205 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
5206 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
5207 * xterm.c: Adjust users.
5208 * .gdbinit: Change to use name field of struct Lisp_Symbol
5209 where appropriate.
5210
5211 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5212
5213 Basic functions to set Lisp_Object and pointer slots of intervals.
5214 * intervals.h (interval_set_parent, interval_set_object):
5215 (interval_set_left, interval_set_right, interval_set_plist):
5216 (interval_copy_parent): New function.
5217 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
5218 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
5219 Adjust indentation.
5220 (INTERVAL_SIZE): Remove. Adjust users.
5221 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
5222
5223 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5224
5225 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
5226 * process.h (PGET): Remove.
5227 (struct Lisp_Process): Do not use INTERNAL_FIELD.
5228 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
5229
5230 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5231
5232 Drop WGET and revert read access to Lisp_Objects slots of struct window.
5233 * window.h (WGET): Remove.
5234 (struct window): Do not use INTERNAL_FIELD.
5235 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5236 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5237 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
5238 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
5239 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
5240 Adjust users.
5241
5242 2012-08-07 Chong Yidong <cyd@gnu.org>
5243
5244 * window.c (Fwindow_edges, Fwindow_pixel_edges)
5245 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
5246 (Fdelete_window_internal): Signal an error if the window is not on
5247 a live frame (Bug#12025).
5248
5249 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5250
5251 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
5252 * frame.h (FGET): Remove.
5253 (struct frame): Do not use INTERNAL_FIELD.
5254 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
5255 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
5256 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5257 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
5258
5259 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
5260
5261 * w32.c: Silence compiler warnings.
5262 (map_w32_filename): Remove unused variable `is_fat'.
5263 (chase_symlinks): Add parentheses around expression.
5264
5265 2012-08-06 Glenn Morris <rgm@gnu.org>
5266
5267 * sysdep.c: Respect BROKEN_GETWD.
5268
5269 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
5270 Let configure handle it.
5271 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
5272
5273 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5274
5275 Use GCALIGNMENT where appropriate.
5276 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
5277 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
5278 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
5279
5280 2012-08-06 Eli Zaretskii <eliz@gnu.org>
5281
5282 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
5283 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5284
5285 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
5286
5287 * buffer.h (struct buffer): Revert `indirections' to a simple int;
5288 that should be sufficient for everyone.
5289
5290 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
5291
5292 * keyboard.c (timer_check_2): Add break so timer_check returns next
5293 timeout.
5294
5295 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5296
5297 Fix Windows build errors introduced after converting to WGET and WSET.
5298 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
5299 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
5300
5301 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
5302
5303 * nsterm.m (ns_frame_rehighlight): Use FSET.
5304
5305 * nsmenu.m (ns_update_menubar): Use FSET.
5306
5307 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5308
5309 Separate read and write access to Lisp_Object slots of Lisp_Process.
5310 * process.h (PGET, PSET): New macros similar to AREF and ASET.
5311 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
5312
5313 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5314
5315 Separate read and write access to Lisp_Object slots of struct window.
5316 * window.h (WGET, WSET): New macros similar to AREF and ASET.
5317 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5318 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5319 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
5320 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
5321 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
5322 Adjust users.
5323
5324 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5325
5326 Fix Windows build errors introduced after converting to FGET and FSET.
5327 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
5328 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
5329 (w32_judge_scroll_bars): Change to use FSET.
5330 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
5331
5332 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5333
5334 Fix replacement typo.
5335 * window.c (replace_window): Set root_window instead of
5336 selected_window. This fixes a total window subsystem
5337 malfunction reported by Bastien Guerry <bzg@gnu.org>.
5338
5339 2012-08-06 Glenn Morris <rgm@gnu.org>
5340
5341 * lisp.mk (lisp): Add language/persian.elc.
5342
5343 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5344
5345 Separate read and write access to Lisp_Object slots of struct frame.
5346 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
5347 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
5348 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
5349 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5350 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
5351
5352 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
5353
5354 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
5355
5356 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
5357
5358 Generalize common compile-time constants.
5359 * lisp.h (header_size, bool_header_size, word_size): Now here.
5360 (struct Lisp_Vector): Add comment.
5361 (struct Lisp_Bool_Vector): Move up to define handy constants.
5362 (VECSIZE, PSEUDOVECSIZE): Simplify.
5363 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
5364 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
5365 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
5366 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
5367 * xfont.c, xmenu.c: Use word_size where appropriate.
5368
5369 2012-08-05 Lawrence Mitchell <wence@gmx.li>
5370
5371 * search.c (Freplace_match): Treat \? in the replacement text
5372 literally (Bug#8161).
5373
5374 2012-08-05 Chong Yidong <cyd@gnu.org>
5375
5376 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
5377 * frame.c (Vdelete_frame_functions):
5378 * emacs.c (Vkill_emacs_hook): Doc fix.
5379
5380 2012-08-04 Eli Zaretskii <eliz@gnu.org>
5381
5382 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
5383 --with-x-toolkit=no builds.
5384 Reported by Carsten Mattner <carstenmattner@gmail.com>.
5385
5386 2012-08-04 Chong Yidong <cyd@gnu.org>
5387
5388 * syntax.c (Fmodify_syntax_entry): Doc fix.
5389
5390 2012-08-04 Eli Zaretskii <eliz@gnu.org>
5391
5392 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
5393 * w32.c (init_environment): Change the default values of many
5394 environment variables in dflt_envvars[] to NULL, to avoid pushing
5395 them into environment when they were not already defined.
5396 Remove the code that deletes site-lisp subdirectories from the default
5397 value of EMACSLOADPATH, as it is no longer needed.
5398 (check_windows_init_file): Now external, not static.
5399 Use Vload_path as is, without adding anything, as this function is now
5400 called when Vload_path is already set up.
5401
5402 * w32.h (check_windows_init_file): Add prototype.
5403
5404 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
5405 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
5406 compatibility with Posix platforms.
5407 (main): Move the call to check_windows_init_file to here from
5408 w32.c.
5409 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
5410 any, in the DEFALT argument into the root of the Emacs build or
5411 installation tree, as appropriate.
5412
5413 * callproc.c (init_callproc_1): Call decode_env_path instead of
5414 doing its equivalent by hand.
5415 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
5416 the code that sets Vexec_path run on MS-Windows.
5417
5418 * lread.c (init_lread): Add comments to #ifdef's.
5419
5420 * msdos.c (dos_set_window_size, IT_update_begin)
5421 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
5422 instead of direct references.
5423
5424 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
5425
5426 Export DEFAULT_REHASH_* to GDB.
5427 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
5428 Now constants, not macros.
5429
5430 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
5431
5432 Remove unnecessary casts involving pointers.
5433 These casts are no longer needed now that we assume C89 or later,
5434 since they involve casting to or from void *.
5435 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
5436 (make_pure_float, make_pure_vector):
5437 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
5438 * macros.c (Fstart_kbd_macro):
5439 * menu.c (find_and_return_menu_selection):
5440 * minibuf.c (read_minibuf_noninteractive):
5441 * sysdep.c (closedir):
5442 * xdisp.c (x_produce_glyphs):
5443 * xfaces.c (compare_fonts_by_sort_order):
5444 * xfns.c (x_real_positions, select_visual):
5445 * xselect.c (x_stop_queuing_selection_requests)
5446 (x_get_window_property, x_get_window_property_as_lisp_data):
5447 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
5448 Remove unnecessary pointer casts.
5449 * alloc.c (record_xmalloc): New function.
5450 * lisp.h (record_xmalloc): New decl.
5451 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
5452 more like a function. This is because the pointer cast is not
5453 needed. All uses changed.
5454 * print.c (print_string, print_error_message): Avoid length recalc.
5455
5456 Improve fix for macroexp crash with debugging (Bug#12118).
5457 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
5458 ARRAY_MARK_FLAG when checking subscripts, because ASET is
5459 not supposed to be invoked from the garbage collector.
5460 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
5461 (gc_aset): New function, which is like ASET but can be
5462 used in the garbage collector.
5463 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
5464 (set_hash_index): Use it instead of ASET.
5465
5466 2012-08-03 Eli Zaretskii <eliz@gnu.org>
5467
5468 Support symlinks on latest versions of MS-Windows.
5469 * w32.c: Include winioctl.h and aclapi.h.
5470 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
5471 (revert_to_self): Forward declarations of static functions.
5472 <static BOOL g_b_init_get_security_info>:
5473 <g_b_init_create_symbolic_link>: New static flags.
5474 (globals_of_w32): Initialize them to zero.
5475 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
5476 (map_w32_filename): Improve commentary. Simplify switch.
5477 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
5478 headers (most versions of MinGW w32api don't).
5479 (get_security_info, create_symbolic_link)
5480 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
5481 New functions.
5482 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
5483 in the argument file name.
5484 (sys_access): Call unc_volume_file_attributes only if
5485 GetFileAttributes fails with network-related error codes.
5486 (sys_rename): Diagnose renaming of a symlink when the user doesn't
5487 have the required privileges.
5488 (get_file_security_desc_by_name): Rename from
5489 get_file_security_desc.
5490 (stat_worker): New function, with most of the guts of 'stat', and
5491 with addition of handling of symlinks and support for 'lstat'.
5492 If possible, get file's attributes and security information by
5493 handle, not by name. Produce S_IFLNK bit for symlinks, when
5494 called from 'lstat'.
5495 (stat, lstat): New functions, call 'stat_worker'.
5496 (symlink, readlink, careadlinkat): Rewritten to create and resolve
5497 symlinks when the underlying filesystem supports them.
5498
5499 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
5500
5501 Fix macroexp crash on Windows with debugging (Bug#12118).
5502 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
5503 checking subscripts; problem introduced with the recent
5504 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
5505 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
5506 since it's used in non-static inline functions now.
5507
5508 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
5509 Don't assume buffer size fits in 'int'. Remove unused local.
5510
5511 Use C99-style 'extern inline' if available.
5512 * buffer.h (BUFFER_INLINE):
5513 * category.h (CATEGORY_INLINE):
5514 * character.h (CHARACTER_INLINE):
5515 * charset.h (CHARSET_INLINE):
5516 * composite.h (COMPOSITE_INLINE):
5517 * dispextern.h (DISPEXTERN_INLINE):
5518 * lisp.h (LISP_INLINE):
5519 * systime.h (SYSTIME_INLINE):
5520 New macro, replacing 'static inline' in this header.
5521 * buffer.h, category.h, character.h, charset.h, composite.h:
5522 * dispextern.h, lisp.h, systime.h:
5523 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5524 * alloc.c (LISP_INLINE):
5525 * buffer.c (BUFFER_INLINE):
5526 * category.c (CATEGORY_INLINE):
5527 * character.c (CHARACTER_INLINE):
5528 * charset.c (CHARSET_INLINE):
5529 * composite.c (COMPOSITE_INLINE):
5530 * dispnew.c (DISPEXTERN_INLINE):
5531 * sysdep.c (SYSTIME_INLINE):
5532 Define to EXTERN_INLINE, so that the corresponding functions
5533 are compiled into code.
5534 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
5535 (INLINE_HEADER_END): New macros.
5536 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
5537 since it's used in non-static inline functions now.
5538 (VALMASK) [!USE_LSB_TAG]: Likewise.
5539
5540 2012-08-02 Glenn Morris <rgm@gnu.org>
5541
5542 * s/: Remove empty directory.
5543
5544 * s/ms-w32.h: Move to ../nt/inc.
5545 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
5546 Update for new ms-w32.h location.
5547
5548 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
5549
5550 Port to Solaris 8.
5551 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
5552
5553 2012-08-02 Glenn Morris <rgm@gnu.org>
5554
5555 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
5556 hard-coding the path separator.
5557
5558 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
5559
5560 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
5561 This how ASET and AREF are supposed to work, and makes
5562 it easier to think about future improvements. See
5563 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
5564 * charset.h (set_charset_attr): New function.
5565 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
5566 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
5567 (aref_addr): New function. All uses of &AREF(...) changed.
5568 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
5569 (set_hash_index): New functions. All lvalue-style uses of
5570 HASH_KEY etc. changed.
5571 * keyboard.c (set_prop): New function. All lvalue-style uses
5572 of PROP changed.
5573
5574 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
5575
5576 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
5577 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
5578 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
5579 * nsfns.m (ns_set_name_as_filename): Likewise.
5580 * nsmenu.m (ns_update_menubar): Likewise.
5581 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
5582
5583 2012-08-01 Eli Zaretskii <eliz@gnu.org>
5584
5585 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
5586 Adapt to latest changes in field names of the corresponding Lisp
5587 objects.
5588
5589 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
5590
5591 2012-08-01 Glenn Morris <rgm@gnu.org>
5592
5593 * s/msdos.h: Remove file.
5594 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
5595 * Makefile.in (S_FILE): Remove.
5596 (config_h): Remove S_FILE.
5597
5598 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
5599
5600 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
5601 Remove; moved to nt/config.nt.
5602
5603 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5604
5605 Use INTERNAL_FIELD for conses and overlays.
5606 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
5607 Remove obsolete comment.
5608 (MVAR): New macro.
5609 (struct Lisp_Overlay): Use INTERNAL_FIELD.
5610 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
5611
5612 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5613
5614 Use INTERNAL_FIELD for symbols.
5615 * lisp.h (SVAR): New macro. Adjust users.
5616 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
5617 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
5618
5619 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5620
5621 Use INTERNAL_FIELD for processes.
5622 * process.h (PVAR): New macro. Adjust style.
5623 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
5624 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
5625
5626 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5627
5628 Use INTERNAL_FIELD for windows.
5629 * window.h (WVAR): New macro.
5630 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
5631 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5632 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5633 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
5634 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
5635 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
5636
5637 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
5638
5639 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
5640
5641 2012-08-01 Glenn Morris <rgm@gnu.org>
5642
5643 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
5644 Move to configure.ac.
5645
5646 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
5647
5648 * makefile.w32-in (CONFIG_H): Update dependencies.
5649 (CONF_POST_H): New macro.
5650
5651 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
5652
5653 2012-07-31 Glenn Morris <rgm@gnu.org>
5654
5655 * Makefile.in (S_FILE): No longer set by configure.
5656
5657 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
5658 is available.
5659 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
5660
5661 * process.h (NULL_DEVICE):
5662 * emacs.c (SEPCHAR):
5663 * editfns.c (USER_FULL_NAME): Let configure set them.
5664
5665 * s/README, s/template.h: Remove files.
5666
5667 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
5668
5669 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
5670 Move to configure.ac.
5671
5672 2012-07-31 Eli Zaretskii <eliz@gnu.org>
5673
5674 * .gdbinit (xframe): Adapt to introduction of FVAR and the
5675 resulting renaming of 'struct frame' members.
5676
5677 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
5678
5679 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
5680 after introduction of FVAR.
5681
5682 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
5683
5684 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
5685
5686 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
5687 instead of compositeToPoint.
5688 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
5689
5690 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
5691
5692 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
5693
5694 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
5695 * lisp.h (INTERNAL_FIELD): New macro.
5696 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
5697 (BVAR): Change to use INTERNAL_FIELD.
5698 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
5699 (KVAR): Change to use INTERNAL_FIELD.
5700 * frame.h (FVAR): New macro.
5701 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
5702 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
5703 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
5704 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5705 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
5706
5707 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
5708
5709 Miscellaneous fixes for non-default X toolkits.
5710 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
5711 * xterm.c (x_frame_of_widget): Remove redundant prototype.
5712 Move under #ifdef USE_LUCID.
5713 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
5714 definition and usage to avoid warnings.
5715
5716 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
5717
5718 * nsterm.m (openFiles): Fix previous checkin.
5719
5720 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
5721
5722 * indent.c (compute_motion): Remove unused local.
5723
5724 2012-07-31 Glenn Morris <rgm@gnu.org>
5725
5726 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
5727
5728 * conf_post.h [USG5_4]:
5729 Move remaining contents of s/usg5-4-common.h here.
5730 * s/usg5-4-common.h: Remove file.
5731
5732 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
5733 * s/irix6-5.h: Remove file.
5734
5735 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
5736 * s/darwin.h: Remove file.
5737
5738 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
5739 * s/hpux10-20.h: Remove file, which is now empty.
5740
5741 2012-07-30 Glenn Morris <rgm@gnu.org>
5742
5743 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
5744 * Makefile.in (config_h): Add conf_post.h.
5745 * makefile.w32-in (CONFIG_H): Add conf_post.h.
5746
5747 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
5748
5749 * nsterm.m (ns_do_open_file): New variable.
5750 (ns_term_init): Set ns_do_open_file to YES after run returns.
5751 (openFile, openTempFile, openFileWithoutUI, openFiles):
5752 Open files only if ns_do_open_file.
5753
5754 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5755
5756 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
5757 This no-op macro hasn't been needed for many years.
5758 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
5759
5760 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
5761 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
5762 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
5763 gdb_make_enums_visible.
5764 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
5765 (DIRECTORY_SEP): Now a constant, not a macro.
5766
5767 2012-07-30 Eli Zaretskii <eliz@gnu.org>
5768
5769 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
5770 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
5771
5772 * w32term.c <w32_keyboard_codepage>: Renamed from
5773 keyboard_codepage and now external. All users changed.
5774
5775 * w32term.h: Add declaration of w32_keyboard_codepage.
5776
5777 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
5778 the codepage to translate keys to Unicode. If this argument is
5779 -1, use the value returned by GetConsoleCP. All callers changed.
5780
5781 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5782
5783 Update .PHONY listings in makefiles.
5784 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
5785 bootstrap-clean, distclean, maintainer-clean, versioclean,
5786 extraclean, frc.
5787
5788 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
5789 This is a bit clearer. Fix some commentary typos.
5790
5791 2012-07-30 Glenn Morris <rgm@gnu.org>
5792
5793 * s/netbsd.h: Let configure include signal.h if needed.
5794 Remove file, which is now empty.
5795
5796 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
5797 Let configure set them.
5798 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
5799 No more need to undefine.
5800
5801 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
5802
5803 * keymap.c (Fkey_description): Don't remove 0x80 bit from
5804 non-single-byte char when adding meta modifier. (Bug#12090)
5805
5806 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
5807
5808 Convert safe_call to use variable number of arguments.
5809 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
5810 (safe_call2): Fix comment.
5811 * lisp.h (safe_call): Adjust prototype.
5812 * coding.c (encode_coding_object): Change to use safe_call2.
5813 * xfaces.c (merge_face_heights): Change to use safe_call1.
5814
5815 2012-07-30 Glenn Morris <rgm@gnu.org>
5816
5817 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
5818 does that unconditionally. Remove file, which is now empty.
5819
5820 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
5821 Remove empty files.
5822
5823 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5824
5825 Export to GDB most of lisp.h's remaining object-like macros.
5826 * lisp.h (min, max): Move earlier, because they're used earlier now.
5827 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
5828 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
5829 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
5830 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
5831 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
5832 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
5833 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
5834 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
5835 Now constants, for GDB. They need not be macros.
5836 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
5837 Now constants, for GDB, as well as macros, for static initializers.
5838 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
5839 Move to after the definition of struct Lisp_Char_Table,
5840 since the former now needs that type defined.
5841 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
5842 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
5843 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
5844 New enums, for gdb_make_enums_visible.
5845 (GLYPH_MODE_LINE_FACE): Remove; unused.
5846 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
5847 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
5848 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
5849 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
5850 enum maxargs, enum MAX_ALLOCA.
5851 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
5852 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
5853 no longer needed, now that they are done in lisp.h.
5854
5855 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
5856
5857 Cleanup string bytes checking.
5858 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
5859 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
5860 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
5861 (check_sblock, compact_small_strings): Simplify.
5862
5863 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5864
5865 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
5866 These macros are confusing and no longer need to be defined, as
5867 the enum values now suffice. All uses replaced with definiens.
5868 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
5869
5870 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
5871
5872 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
5873 ($(BLD)/w32console.$(O)): Update dependencies.
5874
5875 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5876
5877 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
5878 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
5879 time. Adjust users.
5880 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
5881
5882 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
5883
5884 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
5885 setting sitelisp (Bug#12010).
5886
5887 2012-07-29 Eli Zaretskii <eliz@gnu.org>
5888
5889 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
5890
5891 * w32heap.c (cache_system_info):
5892 * w32.c (sys_rename):
5893 * w32proc.c (find_child_console, sys_kill): All users changed.
5894
5895 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5896
5897 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
5898
5899 2012-07-29 Eli Zaretskii <eliz@gnu.org>
5900
5901 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
5902
5903 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5904
5905 Cleanup statistics calculation in Fgarbage_collect.
5906 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
5907 Fix zombies percentage calculation. Simplify elapsed time calculation.
5908
5909 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5910
5911 Generalize marker debugging code under MARKER_DEBUG and use eassert.
5912 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
5913 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
5914 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
5915 (replace_range, replace_range_2, del_range_2): Change to eassert.
5916 * marker.c (byte_char_debug_check): Adjust style.
5917
5918 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5919
5920 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
5921 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
5922 long-ago-commented-out code that talks about "WIN32".
5923 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
5924 All uses changed.
5925
5926 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
5927
5928 Use Gnulib stdalign module (Bug#9772, Bug#9960).
5929 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
5930 Simplify by using alignof.
5931 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
5932 * lisp.h: Include <stdalign.h>.
5933 (GCALIGNMENT): New macro and constant.
5934 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
5935 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
5936 (stdalign): New macro, if not already defined.
5937
5938 2012-07-28 Eli Zaretskii <eliz@gnu.org>
5939
5940 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
5941 * w32inevt.c: Include w32inevt.h.
5942 (w32_read_console_input): New inline function, calls either
5943 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
5944 w32_console_unicode_input.
5945 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
5946 (w32_kbd_patch_key, key_event): Use the codepage returned by
5947 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
5948 (key_event): use uChar.UnicodeChar only if
5949 w32_console_unicode_input is non-zero.
5950
5951 * w32console.c: Include w32heap.h.
5952 <w32_console_unicode_input>: New global variable.
5953 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
5954 family of Windows, zero otherwise.
5955
5956 * w32inevt.h: Declare w32_console_unicode_input.
5957
5958 * xdisp.c (init_iterator): Don't reference tip_frame in a build
5959 --without-x. (Bug#11742)
5960
5961 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5962
5963 Adjust GDB to reflect pvec_type changes (Bug#12036).
5964 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
5965 2012-07-04 changes to pseudovector representation.
5966 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
5967
5968 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
5969
5970 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
5971 bus address.
5972 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
5973
5974 2012-07-27 Eli Zaretskii <eliz@gnu.org>
5975
5976 * alloc.c (listn): Fix the order the arguments are consed onto the
5977 list.
5978
5979 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
5980 enumeration constants, as PURE and HEAP are too general, and clash
5981 with other headers and sources, such as gmalloc.c and the
5982 MS-Windows system headers. All users changed.
5983
5984 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5985
5986 Revert last save_excursion_save and save_excursion_restore changes.
5987 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
5988 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
5989
5990 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5991
5992 Fix recently-introduced typos in Windows port.
5993 Reported by Martin Rudalics <rudalics@gmx.at>.
5994 * w32.c (init_environment): Replace comma with semicolon.
5995 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
5996
5997 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5998
5999 Improve GDB symbol export (Bug#12036).
6000 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
6001 arms of an 'if', not using conditional expressions; otherwise GDB
6002 complains about the types in the unevaluated arm when the argument
6003 is an integer literal.
6004 (xgetint): Simplify expression.
6005 * alloc.c (gdb_make_enums_visible): New constant. This ports to
6006 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
6007 Zaretskii in <http://bugs.gnu.org/12036#13>.
6008 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
6009 needed now that we have gdb_make_enums_visible.
6010 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
6011 (enum enum_USE_LSB_TAG):
6012 New enum types, packaging up enums that need to be exported to GDB.
6013
6014 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6015
6016 Utility function to make a list from specified amount of objects.
6017 * lisp.h (enum constype): New datatype.
6018 (listn): New prototype.
6019 * alloc.c (listn): New function.
6020 (Fmemory_use_count, syms_of_alloc): Use it.
6021 * buffer.c (syms_of_buffer): Likewise.
6022 * callint.c (syms_of_callint): Likewise.
6023 * charset.c (define_charset_internal): Likewise.
6024 * coding.c (syms_of_coding): Likewise.
6025 * keymap.c (syms_of_keymap): Likewise.
6026 * search.c (syms_of_search): Likewise.
6027 * syntax.c (syms_of_syntax): Likewise.
6028 * w32.c (init_environment): Likewise.
6029 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
6030 * xdisp.c (syms_of_xdisp): Likewise.
6031 * xfns.c (syms_of_xfns): Likewise.
6032
6033 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6034
6035 Fast save_excursion_save and save_excursion_restore.
6036 * lisp.h (struct Lisp_Excursion): New data type.
6037 (PVEC_EXCURSION): New pseudovector type.
6038 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
6039 to deal with it. Adjust comments.
6040 (init_marker, attach_marker): New prototype.
6041 (unchain_marker): Adjust prototype.
6042 * marker.c (attach_marker): Change to global.
6043 (init_marker): New function.
6044 * alloc.c (Fmake_marker, build_marker): Use it.
6045 (build_marker): More easserts.
6046 (mark_object): Handle struct Lisp_Excursion.
6047 * editfns.c (save_excursion_save, save_excursion_restore):
6048 Reimplement to use struct Lisp_Excursion. Add comments.
6049
6050 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
6051
6052 Fix export of symbols to GDB (Bug#12036).
6053 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
6054 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
6055 emacs.c, as this is a more-suitable home. Had this been done earlier
6056 the fix for 12036 would have avoided some of the problems noted in
6057 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
6058 would have been more obvious.
6059 * emacs.c: Do not include <verify.h>; no longer needed.
6060 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
6061 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
6062 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
6063 Remove; now done in lisp.h.
6064 * lisp.h (PUBLISH_TO_GDB): New macro.
6065 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
6066 (DATA_SEG_BITS): Use it.
6067 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
6068 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
6069 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
6070 not be usable in #if. This simplifies things.
6071
6072 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
6073
6074 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
6075
6076 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
6077
6078 Simplify export of symbols to GDB (Bug#12036).
6079 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
6080 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
6081 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
6082 Adjust to changes in lisp.h and emacs.c, by using
6083 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
6084 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
6085 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
6086 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
6087 instead of gdb_valbits.
6088 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
6089 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
6090 instead of gdb_array_mark_flag.
6091 (xboolvector): Get size from $->size, not $->header.size.
6092 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
6093 (xreload, hook-run, hookpost-run): Remove.
6094 * emacs.c: Include <verify.h>.
6095 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
6096 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
6097 Remove.
6098 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
6099 (gdb_USE_LSB_TAG): New enum constants.
6100 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
6101 Also define these as enum constants, so they're visible to GDB.
6102 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
6103 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
6104 as constants, so they're visible to GDB.
6105 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
6106 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
6107 Now enum constants, not macros, so they're visible to GDB.
6108 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
6109 more convenient now. All uses changed.
6110 (VALMASK) [USE_LSB_TAG]: Also define in this case.
6111 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
6112
6113 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
6114
6115 Explicitly free restriction data that are not needed anymore.
6116 * editfns.c (save_restriction_restore): Free restriction data.
6117
6118 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
6119
6120 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
6121 add argument, tune behavior, and adjust all callers.
6122
6123 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
6124
6125 Use typedef for EMACS_INT, EMACS_UINT.
6126 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
6127 than macros. This simplifies debugging in the usual case, since
6128 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
6129 and it allows expressions involving EMACS_INT casts.
6130 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
6131
6132 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
6133
6134 * nsterm.m (ns_read_socket): Return early if there is a modal
6135 window (Bug#12043).
6136
6137 2012-07-25 Martin Rudalics <rudalics@gmx.at>
6138
6139 * frame.c (Fredirect_frame_focus): In doc-string don't mention
6140 that FOCUS-FRAME can be omitted.
6141
6142 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
6143
6144 Adjust buffer text indirection counters at the end of Fkill_buffer.
6145 * buffer.c (Fkill_buffer): Adjust indirection counters when the
6146 buffer is definitely dead. This should really fix an issue reported
6147 by Christoph Scholtes again. (Bug#12007).
6148 (init_buffer_once): Initialize indirection counters of
6149 buffer_defaults and buffer_local_symbols (for sanity and safety).
6150
6151 2012-07-24 Eli Zaretskii <eliz@gnu.org>
6152
6153 * xdisp.c (init_iterator): Don't compute dimensions of truncation
6154 and continuation glyphs on tooltip frames, leave them at zero.
6155 Avoids continued lines in tooltips. (Bug#11832)
6156
6157 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
6158
6159 Simplify copy_overlay.
6160 * buffer.c (copy_overlay): Simplify. Use build_marker.
6161 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
6162
6163 2012-07-23 Eli Zaretskii <eliz@gnu.org>
6164
6165 * print.c (print_object): Don't crash when a frame's name is nil
6166 or invalid. (Bug#12025)
6167
6168 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
6169 it signals an error when a tooltip frame is being created.
6170
6171 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
6172
6173 Cleanup miscellaneous objects allocation and initialization.
6174 * alloc.c (allocate_misc): Change to static. Add argument to
6175 specify the subtype. Adjust comment and users.
6176 (build_overlay): New function.
6177 * buffer.c (copy_overlays, Fmake_overlay): Use it.
6178 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
6179 (allocate_misc): Remove prototype.
6180 (build_overlay): Add prototype.
6181
6182 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
6183
6184 Swap buffer text indirection counters in Fbuffer_swap_text.
6185 * buffer.c (Fbuffer_swap_text): Swap indirections too.
6186 This avoids crash reported by Christoph Scholtes at
6187 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
6188
6189 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
6190
6191 * nsmenu.m (Popdown_data): New struct.
6192 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
6193 free Popdown_data.
6194 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
6195 (initWithContentRect): Make imgView and contentView non-static
6196 and autorelease them. Also autorelease img and matrix (Bug#12005).
6197 (dealloc): Remove (Bug#12005).
6198
6199 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
6200
6201 Adjust consing_since_gc when objects are explicitly freed.
6202 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
6203 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
6204 (free_cons, free_misc): Subtract object size from consing_since_gc.
6205
6206 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
6207
6208 Simplify and cleanup markers positioning code.
6209 * marker.c (attach_marker): More useful eassert.
6210 (live_buffer, set_marker_internal): New function.
6211 (Fset_marker, set_marker_restricted): Use set_marker_internal.
6212 (set_marker_both, set_marker_restricted_both): Use live_buffer.
6213
6214 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
6215
6216 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
6217 as it's limited by the amount of memory, not by INT_MAX.
6218
6219 2012-07-21 Eli Zaretskii <eliz@gnu.org>
6220
6221 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
6222 in special-event-map. See the discussion at
6223 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
6224 for the reasons.
6225
6226 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
6227 info.dwItemData. Fixes crashes on 64-bit Windows.
6228 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
6229
6230 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
6231
6232 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
6233 (conversationIdentifier): Return value is NSInteger.
6234 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
6235
6236 2012-07-21 Chong Yidong <cyd@gnu.org>
6237
6238 * window.c (decode_any_window): Signal an error if the window is
6239 on a dead frame (Bug#11984).
6240
6241 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6242
6243 Add indirection counting to speed up Fkill_buffer.
6244 * buffer.h (struct buffer): New member.
6245 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
6246 (Fmake_indirect_buffer): Set indirection counter to -1, increment
6247 base buffer indirection counter.
6248 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
6249 (Fkill_buffer): Adjust indirection counters as needed, don't walk
6250 through buffer list if indirection counter is 0.
6251
6252 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6253
6254 Extend the value returned by Fgarbage_collect with heap statistics.
6255 * alloc.c (Qheap): New symbol.
6256 (syms_of_alloc): DEFSYM it.
6257 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
6258 (Fmemory_free): Remove.
6259 (syms_of_alloc): Don't defsubr it.
6260 * buffer.c (Fcompact_buffer): Remove.
6261 (syms_of_buffer): Don't defsubr it.
6262
6263 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6264
6265 Make maybe_gc inline.
6266 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
6267 * lisp.h (consing_since_gc, gc_relative_threshold)
6268 (memory_full_cons_threshold): Revert declaration.
6269 (maybe_gc): Remove prototype, define as inline.
6270 * alloc.c: Remove old commented-out code.
6271 (consing_since_gc, gc_relative_threshold)
6272 (memory_full_cons_threshold): Revert to global.
6273 (maybe_gc): Remove.
6274
6275 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6276
6277 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
6278 * lisp.h (build_unibyte_string): New function.
6279 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
6280 * sysdep.c, w32fns.c, xfns.c: Use it.
6281 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
6282 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
6283 Adjust users accordingly.
6284 * font.h (font_open_by_name): Adjust prototype.
6285
6286 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6287
6288 Cleanup calls to Fgarbage_collect.
6289 * lisp.h (maybe_gc): New prototype.
6290 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
6291 Remove declarations.
6292 * alloc.c (maybe_gc): New function.
6293 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
6294 Make them static.
6295 * bytecode.c (MAYBE_GC): Use maybe_gc.
6296 * eval.c (eval_sub, Ffuncall): Likewise.
6297 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
6298 to avoid dependency from auto-save feature.
6299
6300 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
6301
6302 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
6303 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
6304 'for_each_per_buffer_object_at'.
6305 All uses changed. It's better to use upper-case for macros that
6306 cannot be implemented as functions, to give the reader a clue
6307 that they're special.
6308
6309 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
6310
6311 * alloc.c (Fgarbage_collect): Tweak docstring.
6312
6313 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6314
6315 Tweak the value returned from Fgarbage_collect again.
6316 * alloc.c (Fgarbage_collect): New return value, as confirmed in
6317 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
6318 Adjust documentation.
6319 (total_vector_bytes): Rename to total_vector_slots, adjust
6320 accounting.
6321 (total_free_vector_bytes): Rename to total_free_vector_slots,
6322 adjust accounting.
6323 (Qstring_bytes, Qvector_slots): New symbols.
6324 (syms_of_alloc): DEFSYM them.
6325
6326 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6327
6328 Buffer compaction primitive which may be used from Lisp.
6329 * buffer.c (compact_buffer, Fcompact_buffer): New function.
6330 (syms_of_buffer): Register Fcompact_buffer.
6331 * alloc.c (Fgarbage_collect): Use compact_buffer.
6332 * buffer.h (compact_buffer): New prototype.
6333 (struct buffer_text): New member.
6334
6335 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6336
6337 New macro to iterate over all buffers, miscellaneous cleanups.
6338 * lisp.h (all_buffers): Remove declaration.
6339 * buffer.h (all_buffers): Add declaration, with comment.
6340 (for_each_buffer): New macro.
6341 * alloc.c (Fgarbage_collect, mark_object): Use it.
6342 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
6343 (init_buffer): Likewise.
6344 * data.c (Fset_default): Likewise.
6345 * coding.c (code_conversion_restore): Remove redundant check
6346 for dead buffer.
6347 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
6348
6349 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
6350
6351 Fix bug that created negative-length intervals.
6352 * intervals.c (merge_interval_right, merge_interval_left):
6353 Do not zero out this interval if it is absorbed by its children,
6354 as this interval's total length doesn't change in that case. See
6355 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
6356
6357 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
6358
6359 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
6360 when invoking (make-bool-vector N t) and N is a positive
6361 multiple of 8 -- the last 8 bits were mistakenly cleared.
6362
6363 Remove some struct layout assumptions in bool vectors.
6364 * alloc.c (bool_header_size): New constant.
6365 (header_size, word_size): Move earlier, as they're now used earlier.
6366 Use 'word_size' in a few more places, where it's appropriate.
6367 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
6368 padding before the data member of a bool vector.
6369 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
6370 than doing the check by hand with an abort ().
6371
6372 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
6373
6374 * eval.c (Fdefvar): Don't check constants since we only set the var if
6375 it's not yet defined anyway (bug#11904).
6376
6377 * lisp.h (last_undo_boundary): Declare new var.
6378 * keyboard.c (command_loop_1): Set it.
6379 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
6380 were auto-added by the command loop (bug#11774).
6381
6382 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
6383
6384 * w32font.c (Qsymbol): Remove local definition.
6385 (syms_of_w32font): Don't DEFSYM it.
6386
6387 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
6388
6389 Fix sweep_vectors to handle large bool vectors correctly.
6390 * alloc.c (sweep_vectors): Account total_vector_bytes for
6391 bool vectors larger than VBLOCK_BYTES_MAX.
6392
6393 2012-07-18 Chong Yidong <cyd@gnu.org>
6394
6395 * frame.c (x_set_frame_parameters): Revert bogus change introduced
6396 in 2012-05-25 commit by Paul Eggert (Bug#11738).
6397
6398 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
6399
6400 Return more descriptive data from Fgarbage_collect.
6401 Suggested by Stefan Monnier in
6402 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
6403 * alloc.c (bounded_number): New function.
6404 (total_buffers, total_vectors): New variable.
6405 (total_string_size): Rename to total_string_bytes, adjust users.
6406 (total_vector_size): Rename to total_vector_bytes, adjust users.
6407 (sweep_vectors): Account total_vectors and total_vector_bytes.
6408 (Fgarbage_collect): New return value. Adjust documentation.
6409 (gc_sweep): Account total_buffers.
6410 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
6411 (VECTOR_SIZE): Remove.
6412 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
6413 (Qinterval, Qmisc): New symbols.
6414 (syms_of_data): Initialize them.
6415 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
6416 (Qcons, Qbuffer): New declarations.
6417
6418 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
6419
6420 * alloc.c (Fmemory_free): Account for memory-free's own storage.
6421 Round up, not down. Improve doc.
6422
6423 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6424
6425 Restore old code in allocate_string_data to avoid Faset breakage.
6426 Reported by Julien Danjou <julien@danjou.info> in
6427 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
6428 * alloc.c (allocate_string_data): Restore old code with minor
6429 adjustments, fix comment to explain this subtle issue.
6430
6431 2012-07-17 Eli Zaretskii <eliz@gnu.org>
6432
6433 Remove FILE_SYSTEM_CASE.
6434 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
6435
6436 * fileio.c (FILE_SYSTEM_CASE): Don't define.
6437 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
6438 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
6439 call-process-region passes it through expand-file-name.
6440
6441 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
6442
6443 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
6444
6445 Fix crash when creating indirect buffer (Bug#11917)
6446 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
6447 Don't handle unbound variables specially if non-zero.
6448 (Fbuffer_local_variables): Pass zero.
6449 (clone_per_buffer_values): Pass non-zero.
6450
6451 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
6452
6453 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
6454 to make the loop interruptible.
6455
6456 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
6457
6458 * gnutls.c (emacs_gnutls_handshake): Only retry if
6459 GNUTLS_E_INTERRUPTED.
6460
6461 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6462
6463 Cleanup and convert miscellaneous checks to eassert.
6464 * alloc.c (mark_interval): Fix comment, partially rephrase
6465 old comment from intervals.h (see below).
6466 * intervals.c (find_interval, adjust_intervals_for_insertion)
6467 (delete_interval, adjust_intervals_for_deletion)
6468 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
6469 Convert to eassert.
6470 (adjust_intervals_for_insertion, make_new_interval):
6471 Remove obsolete and unused code.
6472 * intervals.h (struct interval): Remove obsolete comment.
6473 * textprotp.c (erase_properties): Remove unused code.
6474 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
6475 (Fremove_list_of_text_properties): Convert to eassert.
6476
6477 2012-07-17 Chong Yidong <cyd@gnu.org>
6478
6479 * editfns.c (Finsert_char): Doc fix.
6480
6481 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6482
6483 Fix previous change to make Fmemory_free always accurate.
6484 * alloc.c (make_interval): Update total_free_intervals.
6485 (make_float): Likewise for total_free_floats.
6486 (free_cons, Fcons): Likewise for total_free_conses.
6487 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
6488 Likewise for total_free_vector_bytes.
6489 (Fmake_symbol): Likewise for total_free_symbols.
6490 (bytes_free): Remove.
6491
6492 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6493
6494 Simple free memory accounting feature.
6495 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
6496 (sweep_vectors): Accumulate size of free vectors.
6497 (Fgarbage_collect): Setup bytes_free.
6498 (Fmemory_free): New function.
6499 (syms_of_alloc): Register it.
6500
6501 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6502
6503 Cleanup overlays checking.
6504 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
6505 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
6506 eassert and OVERLAYP.
6507 (sort_overlays): Change to use OVERLAYP.
6508
6509 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
6510
6511 * editfns.c (Finsert_char): Make it interactive, and make the
6512 second arg optional. Copy interactive spec and docstring from
6513 ucs-insert.
6514
6515 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
6516
6517 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
6518 Unlike the other wrapped functions, fabs has an unspecified
6519 effect on errno.
6520
6521 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
6522
6523 * nsterm.m (keyDown): Interpret flags without left/right bits
6524 as the left key (Bug#11670).
6525
6526 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
6527
6528 Remove empty and useless init functions.
6529 * lisp.h (init_character_once, init_fns, init_image)
6530 (init_filelock, init_sound): Remove prototype.
6531 * character.c (init_character_once): Remove.
6532 * filelock.c (init_filelock): Likewise.
6533 * fns.c (init_fns): Likewise.
6534 * image.c (init_image): Likewise.
6535 * sound.c (init_sound): Likewise.
6536 * emacs.c (main): Adjust accordingly.
6537
6538 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
6539
6540 * gtkutil.h: Tiny cleanups.
6541 (use_old_gtk_file_dialog): Remove useless declaration.
6542 (xg_uses_old_file_dialog): Add suggested const attribute.
6543
6544 2012-07-15 Eli Zaretskii <eliz@gnu.org>
6545
6546 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
6547 (bidi_paragraph_init): Use it to limit search forward for a strong
6548 directional character in abnormally large paragraphs full of
6549 neutral or weak characters. (Bug#11943)
6550
6551 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
6552
6553 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
6554 the toolbar (Bug#9451).
6555 (xg_make_tool_item): Give the widget event box a transparent
6556 background.
6557
6558 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
6559
6560 Cleanup basic allocation variables and functions.
6561 * alloc.c (ignore_warnings, init_intervals, init_float)
6562 (init_cons, init_symbol, init_marker): Remove.
6563 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
6564 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
6565 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
6566 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
6567 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
6568 (staticidx, init_alloc_once, init_strings, free_ablock):
6569 Remove redundant initialization.
6570 * fns.c (init_weak_hash_tables): Remove.
6571 * lisp.h (init_weak_hash_tables): Remove prototype.
6572
6573 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
6574
6575 Use zero_vector where appropriate.
6576 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
6577 accordingly.
6578 * lisp.h (zero_vector): New declaration.
6579 * font.c (null_vector): Remove.
6580 (syms_of_font): Remove initialization and staticpro.
6581 (font_list_entities, font_find_for_lface): Change to use zero_vector.
6582 * keymap.c (Faccessible_keymaps): Likewise.
6583
6584 2012-07-15 Leo Liu <sdl.web@gmail.com>
6585
6586 * fringe.c: Fix typo in comments.
6587
6588 2012-07-14 Leo Liu <sdl.web@gmail.com>
6589
6590 * fringe.c: Add a new bitmap exclamation-mark.
6591
6592 2012-07-14 Eli Zaretskii <eliz@gnu.org>
6593
6594 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
6595
6596 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
6597 (HAVE_MENUS): Don't define, defined by editing config.in with
6598 msdos/sed2v2.inp.
6599 (GMALLOC_INHIBIT_VALLOC): Don't define.
6600 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
6601
6602 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
6603
6604 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
6605
6606 2012-07-14 Glenn Morris <rgm@gnu.org>
6607
6608 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
6609 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
6610 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
6611
6612 2012-07-13 Glenn Morris <rgm@gnu.org>
6613
6614 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
6615
6616 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
6617 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
6618
6619 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
6620
6621 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
6622 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
6623 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
6624 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
6625 where appropriate.
6626 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
6627 as boolean expression.
6628 (x_set_window_size): Remove unused variable toolbar.
6629 (ns_get_color_default, ns_mod_to_lisp): Remove.
6630 (ns_mouse_position): Remove unused variables xchar and ychar.
6631 (ns_compute_glyph_string_overhangs): Remove unused variable face.
6632 (ns_set_vertical_scroll_bar): Remove unused variable count.
6633 (ns_delete_terminal): Remove unused variable i.
6634 (ns_term_init): Remove unused variables r, g and b.
6635 (mouseDown): Remove unused variable window.
6636 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
6637 (initFrameFromEmacs): Remove unused variable vbextra.
6638 (mouseEntered): Remove unused variables p and dpyinfo.
6639 (mouseExited): Remove unused variables p and r.
6640 (ns_define_frame_cursor, ns_clear_frame_area)
6641 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
6642 (menuDown): Assign [sender tag] to variable and cast the variable.
6643
6644 * nsterm.h (menuDown): Add id as type to argument sender.
6645 (ns_display_info_for_name): Add Lisp_Object argument.
6646 (ns_term_init): Add Lisp_Object argument.
6647 (ns_map_event_to_object): Add void argument.
6648 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
6649 prototype with arguments and only declare if __OBJC__.
6650 (nxatoms_of_nsselect): Add void argument.
6651 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
6652 (ns_alloc_autorelease_pool): Add void argument.
6653 (ns_release_autorelease_pool): Add void* argument.
6654 (ns_get_defaults_value): Add const char* argument.
6655
6656 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
6657 (initFromContents): Use SSDATA where appropriate.
6658 (ns_update_menubar): Add braces to ambigous if-else.
6659 (initWithTitle): Put () around assignment in if statement.
6660 (ns_menu_show): Remove unused variables window and keymap.
6661 (update_frame_tool_bar): Remove unused variable selected_p.
6662 (initWithContentRect): Remove unused variable this_cmd_name.
6663
6664 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
6665 appropriate.
6666 (setXBMColor): Remove unused variable len.
6667 (setPixmapData): Put () around assignment in loop statement.
6668
6669 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
6670 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
6671 where appropriate.
6672 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
6673 around assignment in loop statement.
6674 (nsfont_open): Remove unused variable i.
6675 (nsfont_open): Remove unused variable len.
6676 (nsfont_draw): Remove unused variable cs.
6677
6678 * nsfns.m (x_set_icon_name, ns_set_name_internal)
6679 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
6680 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
6681 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
6682 (Fns_font_name, Fns_perform_service)
6683 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
6684 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
6685 (ns_set_name): Remove unused variable view.
6686 (x_set_menu_bar_lines): Remove unused variable olines.
6687 (x_set_tool_bar_lines): Remove unused variable root_window.
6688 (Fns_list_colors): Put () around assignment in while statement.
6689 (Fns_perform_service): Remove unused variable len.
6690 (Fns_display_usable_bounds): Remove unused variable top.
6691 (syms_of_nsfns): Remove unused variable i.
6692
6693 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
6694 memcpy (Bug#11907).
6695
6696 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
6697
6698 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
6699 and free it with DestroyExceptionInfo (Bug#11558).
6700
6701 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
6702
6703 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
6704 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
6705 Set here, not in nt/config.nt.
6706
6707 2012-07-13 Eli Zaretskii <eliz@gnu.org>
6708
6709 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
6710 cursor overflow into the last glyph on display line when the right
6711 fringe is off. (Bug#11832)
6712
6713 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
6714
6715 * xdisp.c (produce_special_glyphs): Now static.
6716 * dispextern.h (produce_special_glyphs): Remove decl.
6717
6718 2012-07-13 Glenn Morris <rgm@gnu.org>
6719
6720 * s/bsd-common.h, s/cygwin.h: Remove empty files.
6721 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
6722
6723 * s/usg5-4-common.h (USG, USG5):
6724 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
6725 * s/sol2-6.h (SOLARIS2):
6726 * s/irix6-5.h (IRIX6_5):
6727 * s/hpux10-20.h (USG, USG5, HPUX):
6728 * s/gnu-linux.h (USG, GNU_LINUX):
6729 * s/freebsd.h (BSD_SYSTEM):
6730 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
6731 * s/cygwin.h (CYGWIN):
6732 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
6733 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
6734
6735 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
6736
6737 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
6738
6739 2012-07-13 Glenn Morris <rgm@gnu.org>
6740
6741 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
6742
6743 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
6744
6745 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
6746 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
6747
6748 2012-07-12 Glenn Morris <rgm@gnu.org>
6749
6750 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
6751
6752 * process.c (init_process_emacs): Rename from init_process.
6753 The old name is also the name of a Mach system call.
6754 * lisp.h, emacs.c: Update for this name change.
6755 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
6756 longer needed.
6757
6758 2012-07-12 Eli Zaretskii <eliz@gnu.org>
6759
6760 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
6761 memmove call that removes glyphs covered by the left truncation
6762 glyph. Improve commentary.
6763 (display_line): Fix display of continuation glyphs on GUI frames
6764 when the right fringe is turned off and variable-size fonts are
6765 used in the window. Move the code that appends a stretch glyph to
6766 produce_special_glyphs, so that it could be used for truncation
6767 and continuation glyphs alike.
6768 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
6769 glyph of a suitably computed width, to align the special glyphs at
6770 the window margin. Code moved from display_line. (Bug#11832)
6771
6772 2012-07-12 Glenn Morris <rgm@gnu.org>
6773
6774 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
6775
6776 * s/gnu-linux.h, s/hpux10-20.h:
6777 Do not unconditionally define HAVE_XRMSETDATABASE.
6778
6779 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
6780
6781 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
6782
6783 Fix typos that broke OS X build.
6784 Reported by Randal L. Schwartz in
6785 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
6786 * nsterm.m (ns_timeout): Add missing local decl.
6787 (ns_get_color): snprintf -> sprintf, to fix typo.
6788
6789 2012-07-12 Glenn Morris <rgm@gnu.org>
6790
6791 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
6792 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
6793 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
6794 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
6795
6796 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
6797 Move PTY_OPEN to configure.
6798
6799 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6800 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
6801 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
6802
6803 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
6804
6805 Use empty_unibyte_string where applicable.
6806 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
6807 * lread.c (read1): Likewise.
6808 * xsettings.c (syms_of_xsettings): Likewise.
6809
6810 2012-07-12 Glenn Morris <rgm@gnu.org>
6811
6812 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
6813 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
6814 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
6815 * s/hpux10-20.h (RUN_TIME_REMAP):
6816 * s/bsd-common.h (TABDLY): Move to configure.
6817
6818 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
6819
6820 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
6821
6822 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
6823 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
6824
6825 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
6826
6827 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
6828 * s/template.h: Move NARROWPROTO to configure.
6829
6830 2012-07-11 Glenn Morris <rgm@gnu.org>
6831
6832 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
6833 unused since 2011-01-17 change to systty.h.
6834
6835 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
6836 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
6837 Move HAVE_PTYS and HAVE_SOCKETS to configure.
6838
6839 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
6840
6841 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
6842
6843 2012-07-11 Glenn Morris <rgm@gnu.org>
6844
6845 * s/darwin.h, s/gnu-linux.h, s/template.h:
6846 Move INTERRUPT_INPUT to configure.
6847
6848 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6849
6850 Minor adjustments to interning code.
6851 * lisp.h (intern, intern_c_string): Redefine as static inline
6852 wrappers for intern_1 and intern_c_string_1, respectively.
6853 (intern_1, intern_c_string_1): Rename prototypes.
6854 * lread.c (intern_1, intern_c_string_1, oblookup):
6855 Simplify Vobarray checking.
6856 * font.c (font_intern_prop): Likewise. Adjust comment.
6857 * w32font.c (intern_font_name): Likewise.
6858
6859 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
6860
6861 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
6862
6863 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
6864 of Fcar/Fcdr if possible.
6865 * font.c (check_otf_features): Likewise.
6866 * fontset.c (Fnew_fontset): Likewise.
6867 * gnutls.c (Fgnutls_boot): Likewise.
6868 * minibuf.c (read_minibuf): Likewise.
6869 * msdos.c (IT_set_frame_parameters): Likewise.
6870 * xmenu.c (Fx_popup_dialog): Likewise.
6871 * w32menu.c (Fx_popup_dialog): Likewise.
6872
6873 2012-07-11 Glenn Morris <rgm@gnu.org>
6874
6875 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
6876 since nothing has defined it on these platforms.
6877
6878 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
6879 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
6880
6881 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6882 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
6883 Move CLASH_DETECTION to configure.
6884
6885 * s/gnu.h: Remove file, which is now empty.
6886
6887 * s/gnu.h, s/gnu-linux.h:
6888 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
6889
6890 2012-07-11 John Wiegley <johnw@newartisans.com>
6891
6892 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
6893 function attribute, so we only use it if it exists in the
6894 compiler.
6895
6896 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6897
6898 Avoid call to strlen in fast_c_string_match_ignore_case.
6899 * search.c (fast_c_string_match_ignore_case): Change to use
6900 length argument. Adjust users accordingly.
6901 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
6902
6903 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
6904
6905 Assume mkdir, rmdir.
6906 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
6907 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
6908
6909 Assume rename.
6910 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
6911
6912 Assume perror.
6913 * s/hpux10-20.h (HAVE_PERROR): Remove.
6914 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
6915 Remove dummy definition, as this problem was obsolete long ago.
6916
6917 Assume strerror.
6918 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
6919
6920 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6921
6922 Avoid calls to strlen in font processing functions.
6923 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
6924 (font_open_by_name): Change to use length argument.
6925 Adjust users accordingly.
6926 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
6927 Adjust prototypes.
6928 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
6929 Change to return ptrdiff_t.
6930 (xfont_list_pattern, xfont_match): Use length returned by
6931 xfont_decode_coding_xlfd.
6932 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
6933
6934 2012-07-11 Glenn Morris <rgm@gnu.org>
6935
6936 * s/darwin.h, s/freebsd.h, s/netbsd.h:
6937 Move DONT_REOPEN_PTY to configure.
6938
6939 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
6940 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
6941
6942 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
6943
6944 Remove "#define unix" that is no longer needed (Bug#11905).
6945 * s/aix4-2.h (unix): Remove; no longer needed.
6946
6947 EMACS_TIME simplification (Bug#11875).
6948 This replaces macros (which typically do not work in GDB)
6949 with functions, typedefs and enums, making the code easier to debug.
6950 The functional style also makes code easier to read and maintain.
6951 * systime.h: Include <sys/time.h> on all hosts, not just if
6952 WINDOWSNT, since 'struct timeval' is needed in general.
6953 (EMACS_TIME): Now a typedef, not a macro.
6954 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
6955 not macros.
6956 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
6957 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
6958 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
6959 (EMACS_TIME_LE): Now functions, not macros.
6960 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
6961 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
6962 which are not functions. All uses rewritten to use:
6963 (make_emacs_time): New function.
6964 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
6965 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
6966 not functions. All uses rewritten to use the following, respectively:
6967 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
6968 (add_emacs_time, sub_emacs_time): New functions.
6969 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
6970 * fileio.c (Fcopy_file):
6971 * xterm.c (XTflash): Get the current time closer to when it's used.
6972 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
6973
6974 * bytecode.c (targets): Suppress -Woverride-init warnings.
6975
6976 Simplify by avoiding confusing use of strncpy etc.
6977 * doc.c (Fsnarf_documentation):
6978 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
6979 * frame.c (Fmake_terminal_frame):
6980 * gtkutil.c (get_utf8_string):
6981 * lread.c (openp):
6982 * nsmenu.m (ns_update_menubar):
6983 * regex.c (regerror):
6984 Prefer memcpy to strncpy and strncat when either will do.
6985 * fileio.c (Fsubstitute_in_file_name):
6986 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
6987 (menu_separator_name_p):
6988 * nsmenu.m (ns_update_menubar):
6989 Prefer memcmp to strncmp when either will do.
6990 * nsterm.m: Include <ftoastr.h>.
6991 (ns_get_color):
6992 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
6993 Prefer snprintf to strncpy.
6994 * nsterm.m (ns_term_init):
6995 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
6996 * nsterm.m (ns_term_init):
6997 Avoid the need for strncpy, by using build_string or
6998 make_unibyte_string directly. Use dtoastr, not snprintf.
6999 * process.c (Fmake_network_process): Diagnose service names that
7000 are too long, rather than silently truncating them or creating
7001 non-null-terminated names.
7002 (Fnetwork_interface_info): Likewise, for interface names.
7003 * sysdep.c (system_process_attributes) [GNU_LINUX]:
7004 Prefer sprintf to strncat.
7005 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
7006 Prefer vsnprintf to vsprintf + strncpy.
7007
7008 2012-07-10 Glenn Morris <rgm@gnu.org>
7009
7010 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
7011 Clarify fallback case.
7012
7013 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7014
7015 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
7016 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
7017 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
7018 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7019 where argument type is known to be a Lisp_Cons.
7020
7021 2012-07-10 Tom Tromey <tromey@redhat.com>
7022
7023 * bytecode.c (BYTE_CODE_THREADED): New macro.
7024 (BYTE_CODES): New macro. Replaces all old byte-code defines.
7025 (enum byte_code_op): New type.
7026 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
7027 (exec_byte_code): Use them. Use token threading when applicable.
7028
7029 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7030
7031 Optimize pure C strings initialization.
7032 * lisp.h (make_pure_string): Fix prototype.
7033 (build_pure_c_string): New function, defined as static inline. This
7034 provides a better opportunity to optimize away calls to strlen when
7035 the function is called with compile-time constant argument.
7036 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
7037 argument, adjust users accordingly. Use build_pure_c_string where
7038 appropriate.
7039 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
7040 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
7041 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
7042
7043 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7044
7045 Avoid calls to strlen in miscellaneous functions.
7046 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
7047 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
7048 * lread.c (openp): Likewise.
7049
7050 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7051
7052 Avoid calls to strlen in path processing functions.
7053 * fileio.c (file_name_as_directory): Add comment. Change to add
7054 srclen argument and return the length of result. Adjust users
7055 accordingly.
7056 (directory_file_name): Fix comment. Change to add srclen argument,
7057 swap 1st and 2nd arguments to obey the common convention.
7058 Adjust users accordingly.
7059 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
7060
7061 2012-07-10 Glenn Morris <rgm@gnu.org>
7062
7063 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
7064 Move PENDING_OUTPUT_COUNT definition to configure.
7065
7066 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
7067 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
7068 * s/gnu.h (DATA_START): Move definitions to configure.
7069
7070 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
7071 We include usg5-4-common.h, which defines them both.
7072
7073 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
7074 O_RDONLY already includes it).
7075
7076 Stop ns builds setting the EMACSLOADPATH environment variable.
7077 * nsterm.m (ns_load_path): Rename from ns_init_paths.
7078 Now it does not set EMACSLOADPATH, just returns the load-path string.
7079 * nsterm.h: Update accordingly.
7080 * lread.c [HAVE_NS]: Include nsterm.h.
7081 (init_lread) [HAVE_NS]: Use ns_load_path.
7082 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
7083
7084 2012-07-09 Glenn Morris <rgm@gnu.org>
7085
7086 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
7087 since the included bsd-common.h does so.
7088
7089 Stop ns builds setting the EMACSPATH environment variable.
7090 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
7091 (ns_init_paths): Do not set EMACSPATH.
7092 * nsterm.h (ns_exec_path): Add it.
7093 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
7094 Use ns_exec_path.
7095
7096 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
7097
7098 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
7099
7100 * process.c (wait_reading_process_output): 'waitchannels' was unset
7101 when read_kbd || !NILP (wait_for_cell); fix this.
7102
7103 Add GCC-style 'const' attribute to functions that can use it.
7104 * character.h (char_resolve_modifier_mask):
7105 * keyboard.h (make_ctrl_char):
7106 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
7107 (init_character_once, next_almost_prime, init_fns, init_image)
7108 (flush_pending_output, init_sound):
7109 * mem-limits.h (start_of_data):
7110 * menu.h (finish_menu_items):
7111 Add ATTRIBUTE_CONST.
7112 * emacs.c (DEFINE_DUMMY_FUNCTION):
7113 Declare the dummy function with ATTRIBUTE_CONST.
7114 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
7115 Add decls with ATTRIBUTE_CONST.
7116
7117 Minor improvements to make_formatted_string.
7118 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
7119 where int is good enough, as vsprintf returns an int.
7120 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
7121
7122 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
7123
7124 Use make_formatted_string to avoid double length calculation.
7125 * lisp.h (make_formatted_string): New prototype.
7126 * alloc.c (make_formatted_string): New function.
7127 * buffer.c (Fgenerate_new_buffer_name): Use it.
7128 * dbusbind.c (syms_of_dbusbind): Likewise.
7129 * editfns.c (Fcurrent_time_zone): Likewise.
7130 * filelock.c (get_boot_time): Likewise.
7131 * frame.c (make_terminal_frame, set_term_frame_name)
7132 (x_report_frame_params): Likewise.
7133 * image.c (gs_load): Likewise.
7134 * minibuf.c (get_minibuffer): Likewise.
7135 * msdos.c (dos_set_window_size): Likewise.
7136 * process.c (make_process): Likewise.
7137 * xdisp.c (ensure_echo_area_buffers): Likewise.
7138 * xsettings.c (apply_xft_settings): Likewise.
7139
7140 2012-07-09 Glenn Morris <rgm@gnu.org>
7141
7142 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
7143 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
7144 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
7145 * nsterm.h (ns_etc_directory): Add it.
7146 * callproc.c [HAVE_NS]: Include nsterm.h.
7147 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
7148
7149 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
7150
7151 Move marker debugging code under MARKER_DEBUG.
7152 * marker.c (MARKER_DEBUG): Move marker debugging code under
7153 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
7154 for bootstrap with --enable-checking (~3x slowdown reported
7155 by Juanma Barranquero <lekktu@gmail.com>).
7156 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
7157
7158 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
7159
7160 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
7161 See <http://bugs.gnu.org/11825#29>.
7162
7163 2012-07-08 Eli Zaretskii <eliz@gnu.org>
7164
7165 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
7166 has no font, use the frame's font. (Bug#11813)
7167 (display_line): Add commentary about displaying truncation glyphs
7168 on GUI frames.
7169 (produce_special_glyphs): Move here from term.c.
7170
7171 * term.c (produce_special_glyphs): Move to xdisp.c.
7172
7173 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
7174 section.
7175
7176 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
7177
7178 * xdisp.c (display_line): Avoid warning about implicit declaration
7179 of FRAME_FONT.
7180
7181 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
7182
7183 * lisp.h: Remove empty conditional.
7184
7185 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
7186
7187 * lread.c (load_path_check): Now static.
7188
7189 Fix some minor --with-ns problems found by static checking.
7190 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
7191 (x_set_font) [!HAVE_X_WINDOWS]:
7192 * image.c (xpm_load_image) [HAVE_NS]:
7193 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
7194 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
7195 Remove unused local.
7196 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
7197 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
7198 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
7199 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
7200 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
7201 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
7202 Fix pointer signedness problem.
7203 * xfaces.c (FRAME_X_FONT_TABLE):
7204 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
7205
7206 2012-07-07 Glenn Morris <rgm@gnu.org>
7207
7208 * lread.c (load_path_check): New function, split from init_lread.
7209 (init_lread): Reorganize. Motivation:
7210 If EMACSLOADPATH is set, check/warn about that rather than the
7211 defaults, which we are not going to use. Hence we can remove
7212 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
7213 Don't warn if site-lisp directories are missing.
7214 If not installed, start from a blank load-path, since
7215 PATH_LOADSEARCH refers to the eventual installation directories.
7216
7217 2012-07-07 Eli Zaretskii <eliz@gnu.org>
7218
7219 Support truncation and continuation glyphs on GUI frames, when
7220 fringes are disabled. (Bug#11832)
7221 * xdisp.c (init_iterator): Get dimensions of truncation and
7222 continuation glyphs even if on GUI frames.
7223 Adjust it->last_visible_x on GUI frames when the left or right fringes,
7224 or both, are absent.
7225 (start_display, move_it_in_display_line_to): Handle the case of a
7226 GUI frame without a fringe to display continuation or truncation
7227 glyphs.
7228 (insert_left_trunc_glyphs): Support GUI frames: make sure
7229 truncation glyphs overwrite enough glyphs from the current line to
7230 have sufficient space in pixels.
7231 (display_line): Support truncation and continuation glyphs on GUI
7232 frames. If some spare pixels are left on the line after inserting
7233 the truncation glyphs, fill that space with a stretch glyph of a
7234 suitably computed width.
7235
7236 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
7237 produce_glyphs, to support GUI sessions.
7238
7239 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
7240
7241 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
7242
7243 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
7244
7245 Do not require float-time's arg to fit in time_t (Bug#11825).
7246 This works better on hosts where time_t is unsigned, and where
7247 float-time is applied to the (negative) difference between two times.
7248 * editfns.c (decode_time_components): Last arg is now double *,
7249 not int *, and means to store all the result as a double, without
7250 worrying about whether the seconds part fits in time_t.
7251 All callers changed.
7252 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
7253 All callers changed.
7254 (Ffloat_time): Do not fail merely because the specified time falls
7255 outside of time_t range.
7256
7257 2012-07-07 Glenn Morris <rgm@gnu.org>
7258
7259 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
7260 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
7261 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
7262
7263 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
7264
7265 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
7266 Update dependencies.
7267
7268 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
7269
7270 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7271
7272 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
7273 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
7274 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
7275 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
7276 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
7277 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
7278
7279 * xfont.c (compare_font_names): Redo to omit the need for casts.
7280
7281 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
7282
7283 * xfns.c (Fx_change_window_property): Doc fix.
7284 * w32fns.c (Fx_change_window_property): Doc fix.
7285
7286 * w32fns.c (Fx_window_property): Accept the same arguments as the
7287 X Windows version. Doc fix.
7288 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
7289
7290 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
7291 Eli Zaretskii <eliz@gnu.org>
7292
7293 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
7294 Windows-specific code from nt/config.nt moved here.
7295 Obsolete settings removed.
7296
7297 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7298
7299 * process.c: Avoid unnecessary calls to gettime.
7300 (wait_reading_process_output): Don't get the time of day
7301 when gobbling data immediately and not waiting, as there's no need
7302 for it in that case. This removes a FIXME.
7303
7304 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
7305
7306 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
7307 is defined (Bug#11768).
7308
7309 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7310
7311 Fix marker debugging code.
7312 * marker.c (byte_char_debug_check): Do not perform the check
7313 if buffer is not multibyte.
7314 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
7315 Call byte_char_debug_check with correct arguments.
7316
7317 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7318
7319 Compile marker debugging code only if ENABLE_CHECKING is defined.
7320 * marker.c (byte_char_debug_check, count_markers):
7321 Use only if ENABLE_CHECKING is defined.
7322 (byte_debug_flag): Remove.
7323 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
7324 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
7325
7326 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7327
7328 Avoid code repetition in marker-related functions.
7329 * marker.c (attach_marker): New function.
7330 (Fset_marker, set_marker_restricted, set_marker_both)
7331 (set_marker_restricted_both): Use it.
7332 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
7333 Consistently rename charno to charpos.
7334 (marker_position): Add eassert.
7335 (marker_byte_position): Convert to eassert.
7336
7337 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7338
7339 Simplify list operations in unchain_overlay and unchain_marker.
7340 * buffer.c (unchain_overlay): Simplify. Add comment.
7341 * marker.c (unchain_marker): Simplify. Fix comments.
7342
7343 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7344
7345 Introduce fast path for the widely used marker operation.
7346 * alloc.c (build_marker): New function.
7347 * lisp.h (build_marker): New prototype.
7348 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
7349 * composite.c (autocmp_chars): Likewise.
7350 * editfns.c (buildmark): Remove.
7351 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
7352 (save_restriction_save): Use build_marker.
7353 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
7354 * window.c (save_window_save): Likewise.
7355
7356 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7357
7358 Do not use Fdelete_overlay in delete_all_overlays
7359 to avoid redundant calls to unchain_overlay.
7360 * buffer.c (drop_overlay): New function.
7361 (delete_all_overlays, Fdelete_overlay): Use it.
7362 * minibuf.c (get_minibuffer): Fix comment.
7363
7364 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7365
7366 Port to OpenBSD 5.1 amd64.
7367 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
7368 This is needed for OpenBSD, and should be harmless on all BSD systems.
7369 Also, include <sys/sysctl.h>, as it should be available on all
7370 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
7371 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
7372 use p_pid member, not kp_proc.pid.
7373
7374 2012-07-06 Glenn Morris <rgm@gnu.org>
7375
7376 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
7377
7378 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
7379
7380 More xmalloc and related cleanup.
7381 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
7382 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
7383 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
7384 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
7385 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
7386 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
7387 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
7388 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
7389 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
7390 * xterm.c:
7391 Omit needless casts involving void * pointers and allocation.
7392 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
7393 as the former is more robust if P's type is changed.
7394 Prefer xzalloc to xmalloc + memset 0.
7395 Simplify malloc-or-realloc to realloc.
7396 Don't worry about xmalloc returning a null pointer.
7397 Prefer xstrdup to xmalloc + strcpy.
7398 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
7399 growing it.
7400 * keyboard.c (apply_modifiers_uncached): Prefer local array to
7401 alloca of a constant.
7402
7403 2012-07-05 Eli Zaretskii <eliz@gnu.org>
7404
7405 * xdisp.c (display_line): Fix horizontal pixel coordinates when
7406 hscroll is larger than the line width. Fixes long and futile
7407 looping inside extend_face_to_end_of_line (on a TTY) producing
7408 glyphs that are not needed and thrown away.
7409
7410 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
7411
7412 * marker.c (set_marker_restricted_both): Simplify by using
7413 clip_to_bounds.
7414
7415 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
7416
7417 * editfns.c (region_limit): Simplify by using clip_to_bounds.
7418
7419 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
7420
7421 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
7422 not defined (Bug#11768).
7423 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
7424 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
7425 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
7426 followed by gtk_box_set_homogeneous (Bug#11768).
7427 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
7428 (update_theme_scrollbar_width, xg_create_scroll_bar):
7429 Use gtk_scrollbar_new (Bug#11768).
7430 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
7431 (is_box_type): New function (Bug#11768).
7432 (xg_tool_item_stale_p): Call is_box_type.
7433 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
7434 with default display (Bug#11768).
7435
7436 2012-07-05 Eli Zaretskii <eliz@gnu.org>
7437
7438 * xdisp.c (window_hscroll_limited): New function.
7439 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
7440 coordinates when window's hscroll is set to insanely large
7441 values. (Bug#11857)
7442
7443 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
7444
7445 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
7446 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
7447
7448 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
7449
7450 Cleanup xmalloc.
7451 * lisp.h (xzalloc): New prototype. Omit needless casts.
7452 * alloc.c (xzalloc): New function. Omit needless casts.
7453 * charset.c: Omit needless casts. Convert all calls to
7454 xmalloc with following memset to xzalloc.
7455 * dispnew.c: Likewise.
7456 * fringe.c: Likewise.
7457 * image.c: Likewise.
7458 * sound.c: Likewise.
7459 * term.c: Likewise.
7460 * w32fns.c: Likewise.
7461 * w32font.c: Likewise.
7462 * w32term.c: Likewise.
7463 * xfaces.c: Likewise.
7464 * xfns.c: Likewise.
7465 * xterm.c: Likewise.
7466 * atimer.c: Omit needless casts.
7467 * buffer.c: Likewise.
7468 * callproc.c: Likewise.
7469 * ccl.c: Likewise.
7470 * coding.c: Likewise.
7471 * composite.c: Likewise.
7472 * doc.c: Likewise.
7473 * doprnt.c: Likewise.
7474 * editfns.c: Likewise.
7475 * emacs.c: Likewise.
7476 * eval.c: Likewise.
7477 * filelock.c: Likewise.
7478 * fns.c: Likewise.
7479 * gtkutil.c: Likewise.
7480 * keyboard.c: Likewise.
7481 * lisp.h: Likewise.
7482 * lread.c: Likewise.
7483 * minibuf.c: Likewise.
7484 * msdos.c: Likewise.
7485 * print.c: Likewise.
7486 * process.c: Likewise.
7487 * region-cache.c: Likewise.
7488 * search.c: Likewise.
7489 * sysdep.c: Likewise.
7490 * termcap.c: Likewise.
7491 * terminal.c: Likewise.
7492 * tparam.c: Likewise.
7493 * w16select.c: Likewise.
7494 * w32.c: Likewise.
7495 * w32reg.c: Likewise.
7496 * w32select.c: Likewise.
7497 * w32uniscribe.c: Likewise.
7498 * widget.c: Likewise.
7499 * xdisp.c: Likewise.
7500 * xmenu.c: Likewise.
7501 * xrdb.c: Likewise.
7502 * xselect.c: Likewise.
7503
7504 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
7505
7506 * fileio.c (time_error_value): Check the right error number.
7507 Problem reported by Troels Nielsen in
7508 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
7509
7510 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7511
7512 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
7513 This should be fixed in a better way; see Eli Zaretskii in
7514 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
7515 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
7516
7517 * fileio.c (time_error_value): Rename from special_mtime.
7518 The old name's problems were noted by Eli Zaretskii in
7519 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
7520
7521 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
7522 This variable's comment says Emacs needs at least one GDB-visible
7523 symbol of type enum pvec_type, to work around GDB problems.
7524 The symbol's value doesn't matter.
7525
7526 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
7527 that causes compilation to fail on pre-C99 compilers.
7528
7529 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
7530
7531 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
7532 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
7533
7534 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
7535
7536 * buffer.c (init_buffer_once): Fix initialization of
7537 headers for buffer_defaults and buffer_local_symbols.
7538 Reported by Juanma Barranquero <lekktu@gmail.com>.
7539
7540 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
7541
7542 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
7543 * lisp.h (enum pvec_type): Use fewer bits.
7544 (PSEUDOVECTOR_SIZE_BITS): New constant.
7545 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
7546 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
7547 change in pvec_type.
7548 (PSEUDOVECTOR_TYPEP): New macro.
7549 (TYPED_PSEUDOVECTORP): Use it.
7550 * fns.c (internal_equal): Adapt code to extract pvectype.
7551 * emacs.c (gdb_pvec_type): Update type.
7552 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
7553 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
7554 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
7555 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
7556 (sweep_vectors): Use it. Use local var `total_bytes' instead of
7557 abusing vector->header.next.nbytes.
7558 (live_vector_p): Use PVEC_TYPE.
7559 (mark_object): Adapt code to extract pvectype. Use switch.
7560
7561 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7562
7563 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
7564 Tighten new eassert a bit.
7565
7566 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
7567
7568 Fix compilation with --enable-gcc-warnings and -O1
7569 optimization level.
7570 * doprnt.c (doprnt): Change type of tem to int, initialize
7571 to avoid compiler warning. Add eassert.
7572 * search.c (simple_search): Initialize match_byte to avoid
7573 compiler warning. Add eassert.
7574
7575 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7576
7577 Avoid weird behavior with large horizontal scrolls.
7578 Without this change, for example, large hscroll values would
7579 mess up Emacs's display on Fedora 15 x86, presumably due to
7580 overflows in int calculations in the display code.
7581 Also, if buffers had long lines, Emacs would freeze.
7582 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
7583 (set_window_hscroll): New function, containing the old guts of
7584 Fset_window_hscroll. Return the clipped value.
7585 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
7586 This avoids the need to check against PTRDIFF_MAX.
7587
7588 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
7589
7590 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
7591
7592 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
7593
7594 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7595
7596 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
7597 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
7598 since GCC 4.4.6 issues a bogus warning for them.
7599
7600 Fix bugs in file timestamp newness comparisons.
7601 * fileio.c (Ffile_newer_than_file_p):
7602 * lread.c (Fload): Use full timestamp resolution of files,
7603 not just the 1-second resolution, so that files that are only
7604 slightly newer still count as newer.
7605 * fileio.c (Ffile_newer_than_file_p): Don't assume file
7606 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
7607
7608 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
7609
7610 * fileio.c: Improve handling of file time marker. (Bug#11852)
7611 (special_mtime): New function.
7612 (Finsert_file_contents, Fverify_visited_file_modtime):
7613 Use it to set special mtime values consistently.
7614
7615 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
7616
7617 * fileio.c (Finsert_file_contents): Properly handle st_mtime
7618 marker for non-existing file. (Bug#11852)
7619
7620 2012-07-03 Glenn Morris <rgm@gnu.org>
7621
7622 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
7623 and did not make it into globals.h).
7624
7625 2012-07-03 Tom Tromey <tromey@redhat.com>
7626
7627 * window.c (Fset_window_margins, Fset_window_fringes)
7628 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
7629 * textprop.c (Fprevious_property_change): No longer static.
7630 * syntax.c (Fsyntax_table_p): No longer static.
7631 * process.c (Fget_process, Fprocess_datagram_address): No longer
7632 static.
7633 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
7634 * keyboard.c (Fcommand_execute): No longer static.
7635 Remove EXFUN.
7636 * insdel.c (Fcombine_after_change_execute): No longer static.
7637 * image.c (Finit_image_library): No longer static.
7638 * fileio.c (Fmake_symbolic_link): No longer static.
7639 * eval.c (Ffetch_bytecode): No longer static.
7640 * editfns.c (Fuser_full_name): No longer static.
7641 * doc.c (Fdocumentation_property, Fsnarf_documentation):
7642 No longer static.
7643 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
7644 static.
7645 * dired.c (Ffile_attributes): No longer static.
7646 * composite.c (Fcomposition_get_gstring): No longer static.
7647 * callproc.c (Fgetenv_internal): No longer static.
7648
7649 * ccl.h: Remove EXFUNs.
7650 * buffer.h: Remove EXFUNs.
7651 * dispextern.h: Remove EXFUNs.
7652 * intervals.h: Remove EXFUNs.
7653 * fontset.h: Remove EXFUN.
7654 * font.h: Remove EXFUNs.
7655 * dosfns.c (system_process_attributes): Remove EXFUN.
7656 * keymap.h: Remove EXFUNs.
7657 * lisp.h: Remove EXFUNs.
7658 * w32term.h: Remove EXFUNs.
7659 * window.h: Remove EXFUNs.
7660 * xsettings.h: Remove EXFUN.
7661 * xterm.h: Remove EXFUN.
7662
7663 2012-07-03 Glenn Morris <rgm@gnu.org>
7664
7665 * lisp.h (Frandom): Make it visible to C.
7666 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
7667 buffer for invisible buffers. (Bug#1229)
7668
7669 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7670
7671 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
7672 values which aren't power of 2.
7673 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
7674 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
7675 accordingly.
7676
7677 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
7678
7679 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
7680
7681 * alloc.c (mark_object): Revert part of last patch to use `switch'.
7682
7683 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7684
7685 * alloc.c (allocate_vector_block): Remove redundant
7686 calls to mallopt if DOUG_LEA_MALLOC is defined.
7687 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
7688 avoid calls to mallopt if zero_vector is returned.
7689
7690 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7691
7692 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
7693 is enabled, avoid dereferencing NULL current_sblock if
7694 running undumped.
7695
7696 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7697
7698 Cleanup basic buffer management.
7699 * buffer.h (struct buffer): Change layout to use generic vector
7700 marking code. Fix some comments. Change type of 'clip_changed'
7701 to bitfield. Remove unused #ifndef old.
7702 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
7703 (GET_OVERLAYS_AT): Fix indentation.
7704 (for_each_per_buffer_object_at): New macro.
7705 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
7706 (Fbuffer_local_variables): Use it.
7707 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
7708 * alloc.c (allocate_buffer): Adjust to match new layout of
7709 struct buffer. Fix comment.
7710 (mark_overlay): New function.
7711 (mark_buffer): Use it. Use mark_vectorlike to mark normal
7712 Lisp area of struct buffer.
7713 (mark_object): Use it. Adjust marking of misc objects
7714 and related comments.
7715
7716 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
7717
7718 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
7719 wrapper that is not needed because the wrapped code is a no-op (zero
7720 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
7721 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
7722
7723 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
7724
7725 * alloc.c (mark_buffer): Simplify. Remove prototype.
7726 (mark_object): Add comment. Reorganize marking of vector-like
7727 objects. Use CHECK_LIVE for all vector-like objects except buffers
7728 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
7729 Avoid redundant calls to mark_vectorlike for bool vectors.
7730
7731 2012-06-30 Glenn Morris <rgm@gnu.org>
7732
7733 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
7734
7735 * epaths.in (PATH_SITELOADSEARCH): New.
7736 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
7737 This is rather than relying on --enable-locallisppath elements
7738 having "site-lisp" in their names. (Bug#10208#25, 11658)
7739
7740 2012-06-30 Eli Zaretskii <eliz@gnu.org>
7741
7742 * w32proc.c (sys_select): Accept and ignore one more argument.
7743
7744 * w32.c (emacs_gnutls_pull): Call select with one more argument.
7745
7746 * sysselect.h [DOS_NT]: Don't include sys/select.h.
7747 (pselect) [!MS_DOS]: Redirect to sys_select.
7748
7749 * sysdep.c: Don't include dos.h and dosfns.h.
7750
7751 * process.c (sys_select):
7752 * msdos.c (sys_select): Accept one more argument and ignore it.
7753
7754 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
7755 adapt data types and code to that.
7756
7757 * dosfns.c:
7758 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
7759 which clashes with the gnulib function of the same name.
7760
7761 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
7762
7763 * font.c (font_style_to_value, font_style_symbolic)
7764 (font_prop_validate_style): Add type checks for values in
7765 font_style_table.
7766
7767 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
7768 argument.
7769 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
7770 uses.
7771
7772 2012-06-29 Eli Zaretskii <eliz@gnu.org>
7773
7774 * xdisp.c (try_window_id): Undo last change.
7775
7776 * w32.c (getwd): Adjust commentary about startup_dir.
7777 (init_environment): Always call sys_access, even in non-MSVC
7778 builds. Don't chdir to the directory of the Emacs executable.
7779 This undoes code from 1997 which was justified by the need to
7780 "avoid conflicts when removing and renaming directories". But its
7781 downside was that every relative file name was being interpreted
7782 relative to the directory of the Emacs executable, which can never
7783 be TRT. In particular, it broke sys_access when called with
7784 relative file names.
7785 (sys_access): Map GetLastError to errno.
7786
7787 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7788
7789 * window.h (struct window): Change type of 'fringes_outside_margins'
7790 to bitfield. Fix comment. Adjust users accordingly.
7791 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
7792 Adjust comment.
7793 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
7794 to ptrdiff_t.
7795
7796 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
7797
7798 * gnutls.c (emacs_gnutls_handshake):
7799 Add QUIT to make the loop interruptible.
7800
7801 2012-06-29 Glenn Morris <rgm@gnu.org>
7802
7803 * charset.c (init_charset): Make lack of etc/charsets fatal.
7804
7805 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7806
7807 * editfns.c (region_limit): Fix type mismatch.
7808
7809 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7810
7811 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
7812 undefined. Convert from xassert to eassert.
7813 * nsmenu.m: Convert from xassert to eassert.
7814 * nsterm.m: Likewise.
7815
7816 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
7817
7818 * editfns.c (region_limit): Clip to narrowing (bug#11770).
7819
7820 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
7821
7822 Avoid integer overflow on scroll-left and scroll-right.
7823 * window.c (HSCROLL_MAX): New macro.
7824 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
7825 overflow when requested scroll falls outside ptrdiff_t range.
7826
7827 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7828
7829 * window.h (struct window): Change type of 'hscroll',
7830 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
7831 'last_modified' and 'last_overlay_modified' to EMACS_INT.
7832 Adjust users accordingly.
7833 * xdisp.c (try_cursor_movement): Replace type check with eassert.
7834 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
7835 from EMACS_INT to ptrdiff_t.
7836 (make_window): Omit redundant initialization.
7837
7838 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
7839
7840 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
7841
7842 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7843
7844 * window.h (struct window): Change type of 'use_time' and
7845 'sequence_number' from Lisp_Object to int.
7846 * frame.c (make_frame): Adjust users accordingly.
7847 * print.c (print_object): Likewise.
7848 * window.c (select_window, Fwindow_use_time, make_parent_window)
7849 (make_window): Likewise.
7850
7851 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7852
7853 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
7854 enabled with --enable-checking=[all,glyphs] configure option.
7855 Fix GLYPH_DEBUG usage assuming that it may be undefined,
7856 adjust comments accordingly.
7857 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
7858 undefined, adjust comments accordingly.
7859 * image.c: Likewise.
7860 * scroll.c: Likewise.
7861 * w32fns.c: Likewise.
7862 * w32term.c: Likewise.
7863 * xdisp.c: Likewise.
7864 * xfaces.c: Likewise.
7865 * xfns.c: Likewise.
7866 * xterm.c: Likewise.
7867
7868 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7869
7870 Generalize run-time debugging checks.
7871 * dispextern.h (XASSERTS): Remove.
7872 * fontset.c (xassert): Remove.
7873 Convert from xassert to eassert.
7874 * alloc.c: Convert from xassert to eassert.
7875 * bidi.c: Likewise.
7876 * dispnew.c: Likewise.
7877 * fns.c: Likewise.
7878 * fringe.c: Likewise.
7879 * ftfont.c: Likewise.
7880 * gtkutil.c: Likewise.
7881 * image.c: Likewise.
7882 * keyboard.c: Likewise.
7883 * menu.c: Likewise.
7884 * process.c: Likewise.
7885 * scroll.c: Likewise.
7886 * sound.c: Likewise.
7887 * term.c: Likewise.
7888 * w32console.c: Likewise.
7889 * w32fns.c: Likewise.
7890 * w32term.c: Likewise.
7891 * window.c: Likewise.
7892 * xdisp.c: Likewise.
7893 * xfaces.c: Likewise.
7894 * xfns.c: Likewise.
7895 * xselect.c: Likewise.
7896 * xterm.c: Likewise.
7897
7898 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
7899
7900 * fns.c (maybe_resize_hash_table): Output message when growing the
7901 purify-hashtable.
7902
7903 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7904
7905 * alloc.c (allocate_string_data): Remove dead code.
7906 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
7907 avoid GCC warning about unused macro.
7908
7909 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7910
7911 * alloc.c (allocate_string): Omit intervals initialization.
7912 * alloc.c (make_uninit_multibyte_string): Initialize intervals
7913 as in make_pure_string and make_pure_c_string.
7914
7915 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7916
7917 * alloc.c (allocate_string): Fix last change.
7918
7919 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7920
7921 * alloc.c (allocate_string): Remove two redundant calls
7922 to memset, add explicit initialization where appropriate.
7923
7924 2012-06-27 Glenn Morris <rgm@gnu.org>
7925
7926 * lisp.mk (lisp): Remove paths.elc.
7927
7928 2012-06-27 Chong Yidong <cyd@gnu.org>
7929
7930 * doc.c (Fsubstitute_command_keys): Fix punctuation.
7931
7932 2012-06-26 John Wiegley <johnw@newartisans.com>
7933
7934 * unexmacosx.c (copy_data_segment): Add two section names used
7935 on Mac OS X Lion: __mod_init_func and __mod_term_func.
7936
7937 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
7938 when building with Clang.
7939
7940 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
7941
7942 * eval.c (Fapply): Allow calling it with a single argument.
7943
7944 2012-06-26 Eli Zaretskii <eliz@gnu.org>
7945
7946 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
7947 _stricmp and _strnicmp.
7948 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
7949
7950 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7951
7952 * alloc.c (allocate_window): Zero out non-Lisp part of newly
7953 allocated window.
7954 (allocate_process): Likewise for new process.
7955 (allocate_terminal): Change to use offsetof.
7956 (allocate_frame): Likewise.
7957 * frame.c (make_frame): Omit redundant initialization.
7958 * window.c (make_parent_window): Use memset.
7959 (make_window): Omit redundant initialization.
7960 * process.c (make_process): Omit redundant initialization.
7961 * terminal.c (create_terminal): Likewise.
7962
7963 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7964
7965 * term.c (delete_tty): Remove redundant call to memset.
7966
7967 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7968
7969 * alloc.c: Remove build_string.
7970 * lisp.h: Define build_string as static inline. This provides
7971 a better opportunity to optimize away calls to strlen when the
7972 function is called with compile-time constant argument.
7973 * image.c (imagemagick_error): Convert to build_string.
7974 * w32proc.c (sys_spawnve): Likewise.
7975 * xterm.c (x_term_init): Likewise.
7976
7977 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
7978
7979 Use sprintf return value instead of invoking strlen on result.
7980 In the old days this wasn't portable, since some sprintf
7981 implementations returned char *. But they died out years ago and
7982 Emacs already assumes sprintf returns int.
7983 Similarly for float_to_string.
7984 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
7985 * ccl.c (ccl_driver):
7986 * character.c (string_escape_byte8):
7987 * data.c (Fnumber_to_string):
7988 * doprnt.c (doprnt):
7989 * print.c (print_object):
7990 * xdisp.c (message_dolog):
7991 * xfns.c (syms_of_xfns):
7992 Use sprintf or float_to_string result to avoid need to call strlen.
7993 * data.c (Fnumber_to_string):
7994 Use make_unibyte_string, since the string must be ASCII.
7995 * lisp.h, print.c (float_to_string): Now returns int length.
7996 * term.c (produce_glyphless_glyph):
7997 Use sprintf result rather than recomputing it.
7998
7999 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
8000 * Makefile.in (ALL_CFLAGS):
8001 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
8002 * gmalloc.c, regex.c: Include <config.h> unconditionally.
8003
8004 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8005
8006 * dispextern.h (xstrcasecmp): Define to library function
8007 strcasecmp if available.
8008 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
8009
8010 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
8011
8012 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
8013 Avoid comma operator.
8014 * menu.c (push_submenu_start, push_submenu_end)
8015 (push_left_right_boundary, push_menu_pane): Likewise.
8016 * msdos.c (dos_rawgetc): Likewise.
8017
8018 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8019
8020 * xfns.c (xic_create_fontsetname): Remove redundant calls
8021 to memset.
8022
8023 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
8024
8025 * gtkutil.c (get_utf8_string): Remove redundant assignment.
8026 sprintf already null-terminates its output.
8027
8028 * xfns.c (x_window): Remove redundant cast.
8029
8030 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8031
8032 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
8033 `const char *' to `char *' to avoid compiler warning.
8034
8035 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8036
8037 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
8038 instead of truncating it to 63 (admittedly a generous limit).
8039
8040 * process.c: Fix spelling and caps in comments.
8041
8042 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
8043
8044 * emacs.c (setpgrp): Remove definition, unused.
8045 * sysdep.c (setpgrp): Remove definition, not used in this file.
8046
8047 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
8048
8049 * makefile.w32-in: Update dependencies.
8050
8051 2012-06-24 Eli Zaretskii <eliz@gnu.org>
8052
8053 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
8054 (SYSTIME_H): Add nt/inc/sys/time.h.
8055
8056 * systime.h [WINDOWSNT]: Include sys/time.h.
8057
8058 * s/ms-w32.h (struct timespec): Definition moved from
8059 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
8060
8061 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8062
8063 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
8064 * buffer.h (buffer_slot_type_mismatch):
8065 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
8066 * eval.c (unwind_to_catch):
8067 * image.c (my_png_error, my_error_exit):
8068 * keyboard.c (quit_throw_to_read_char, user_error)
8069 (Fexit_recursive_edit, Fabort_recursive_edit):
8070 * lisp.h (die, args_out_of_range, args_out_of_range_3)
8071 (wrong_type_argument, buffer_overflow, __executable_start)
8072 (memory_full, buffer_memory_full, string_overflow, Fthrow)
8073 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
8074 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
8075 (fatal):
8076 (child_setup) [!DOS_NT]:
8077 * lread.c (end_of_file_error, invalid_syntax):
8078 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
8079 * puresize.h (pure_write_error):
8080 * search.c (matcher_overflow):
8081 * sound.c (sound_perror, alsa_sound_perror):
8082 * sysdep.c, syssignal.h (croak):
8083 * term.c (maybe_fatal, vfatal):
8084 * textprop.c (text_read_only):
8085 * undo.c (user_error):
8086 * unexmacosx.c (unexec_error):
8087 * xterm.c (x_ins_del_lines, x_delete_glyphs):
8088 Use _Noreturn rather than NO_RETURN.
8089 No need for separate decl merely because of _Noreturn.
8090 * sound.c (sound_warning, parse_sound):
8091 Remove unnecessary forward decls.
8092
8093 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8094
8095 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
8096 * lisp.h (WAIT_READING_MAX): New macro.
8097 * dispnew.c (Fsleep_for, sit_for):
8098 * keyboard.c (kbd_buffer_get_event):
8099 * process.c (Faccept_process_output):
8100 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
8101 This improves on the previous patch, which introduced a bug
8102 when time_t is unsigned and as wide as intmax_t.
8103 See <http://bugs.gnu.org/9000#51>.
8104
8105 2012-06-23 Eli Zaretskii <eliz@gnu.org>
8106
8107 * dispnew.c (sit_for, Fsleep_for):
8108 * keyboard.c (kbd_buffer_get_event):
8109 * process.c (Faccept_process_output): Avoid compiler warnings when
8110 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
8111
8112 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
8113
8114 * makefile.w32-in: Update dependencies.
8115
8116 * w32.c (ltime): Add return type and declare static.
8117 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
8118
8119 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
8120
8121 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
8122 Privately reported by Herbert J. Skuhra.
8123 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
8124 All uses changed.
8125 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
8126 not make_lisp_timeval, when the argument is of type EMACS_TIME.
8127
8128 2012-06-23 Eli Zaretskii <eliz@gnu.org>
8129
8130 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
8131 last argument of make_unibyte_string.
8132
8133 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
8134 language ID in the event parameters.
8135
8136 * w32term.c (w32_read_socket): Put the new keyboard codepage into
8137 event.code, not the obscure "character set ID".
8138
8139 2012-06-23 Chong Yidong <cyd@gnu.org>
8140
8141 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
8142
8143 2012-06-23 Eli Zaretskii <eliz@gnu.org>
8144
8145 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
8146 * w32.c (fdutimens): New function.
8147
8148 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
8149
8150 * s/ms-w32.h (pselect): Redirect to sys_select.
8151
8152 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
8153
8154 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
8155 in the logic of incrementing and decrementing the value of
8156 use_relocatable_buffers.
8157
8158 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
8159
8160 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
8161 Privately reported by Herbert J. Skuhra.
8162 [__FreeBSD__]: Remove "*/" typo after "#include".
8163 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
8164 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
8165 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
8166 Don't assume EMACS_TIME and struct timeval are the same type.
8167
8168 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
8169
8170 Support higher-resolution time stamps (Bug#9000).
8171 The time stamps are only nanosecond-resolution at the C level,
8172 since that's the best that any real-world system supports now.
8173 But they are picosecond-resolution at the Lisp level, as that's
8174 easy, and leaves room for future OS improvements.
8175
8176 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
8177 (LIBES): Use it.
8178
8179 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
8180 Don't get current time unless it's needed.
8181
8182 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
8183 now provides it if it's absent.
8184 (start_atimer): Port to higher-res time stamps.
8185 Check for time stamp overflow. Don't get current time more
8186 often than is needed.
8187
8188 * buffer.h (struct buffer): Buffer modtime now has high resolution.
8189 Include systime.h, not time.h.
8190 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
8191
8192 * dired.c: Include stat-time.h.
8193 (Ffile-attributes): File times now have higher resolution.
8194
8195 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
8196 (struct image): Timestamp now has higher resolution.
8197
8198 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
8199 has at least microseconds now. All uses removed.
8200 (update_frame, update_single_window, update_window, update_frame_1)
8201 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
8202 (duration_to_sec_usec): Remove; no longer needed.
8203
8204 * editfns.c (time_overflow): Now extern.
8205 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
8206 (float-time, Fformat_time_string, Fcurrent_time_string)
8207 (Fcurrent_time_zone): Accept and generate higher-resolution
8208 time stamps.
8209 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
8210 (decode_time_components, lisp_seconds_argument): New functions.
8211 (make_time): Now static.
8212 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
8213 Report an error if the time is invalid, rather than having the caller
8214 do that.
8215
8216 * fileio.c: Include <stat-time.h>
8217 (Fcopy_file): Copy higher-resolution time stamps.
8218 Prefer to set the time stamp via a file descriptor if that works.
8219 (Fset_file_times, Finsert_file_contents, Fwrite_region)
8220 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
8221 (Fvisited_file_modtime, Fset_visited_file_modtime):
8222 Support higher-resolution time stamps.
8223
8224 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
8225
8226 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
8227
8228 * image.c (prepare_image_for_display, clear_image_cache)
8229 (lookup_image): Port to higer-resolution time stamps.
8230
8231 * keyboard.c (start_polling, bind_polling_period):
8232 Check for time stamp overflow.
8233 (read_char, kbd_buffer_get_event, timer_start_idle)
8234 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
8235 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
8236 Port to higher-resolution time stamps. Do not assume time_t is signed.
8237 (decode_timer): New function. Timers are now vectors of length 9,
8238 not 8, to accommodate the picosecond component.
8239 (timer_check_2): Use it.
8240
8241 * nsterm.m (select_timeout, timeval_subtract): Remove.
8242 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
8243 as they're a bit more accurate and handle overflow better.
8244 (ns_select): Change prototype to be compatible with pselect.
8245 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
8246 * nsterm.h (ns_select): Adjust prototype.
8247
8248 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
8249 us-resolution time stamps.
8250 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
8251
8252 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
8253
8254 * lisp.h (time_overflow): New decl.
8255 (wait_reading_process_output): First arg is now intmax_t, not int,
8256 to accommodate larger waits.
8257
8258 * process.h (struct Lisp_Process.read_output_delay):
8259 Now counts nanoseconds, not microseconds.
8260 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
8261 EMACS_HAS_USECS.
8262 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
8263 (wait_reading_process_output):
8264 Port to ns-resolution time stamps.
8265 (Faccept_process_output, wait_reading_process_output):
8266 Check for time stamp overflow. Do not assume time_t is signed.
8267 (select_wrapper): Remove; we now use pselect.
8268 (Fprocess_attributes): Now generates ns-resolution time stamps.
8269
8270 * sysdep.c: Include utimens.h. Don't include utime.h
8271 or worry about struct utimbuf; gnulib does that for us now.
8272 (gettimeofday): Remove; gnulib provides a substitute.
8273 (make_timeval): New function.
8274 (set_file_times): Now sets ns-resolution time stamps.
8275 New arg FD; all uses changed.
8276 (time_from_jiffies, ltime_from_jiffies, get_up_time)
8277 (system_process_attributes):
8278 Now returns ns-resolution time stamp. All uses changed.
8279 Check for time stamp overflow.
8280
8281 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
8282 provides a substitute now.
8283
8284 * systime.h: Include timespec.h rather than sys/time.h and time.h,
8285 since it guarantees struct timespec.
8286 (EMACS_TIME): Now struct timespec, so that we can support
8287 ns-resolution time stamps.
8288 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
8289 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
8290 (EMACS_USECS): Remove.
8291 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
8292 so multiply the arg by 1000 before storing it.
8293 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
8294 New macros.
8295 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
8296 Port to ns-resolution time stamps.
8297 (EMACS_TIME_NEG_P): Remove; replaced by....
8298 (EMACS_TIME_SIGN): New macro.
8299 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
8300 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
8301 (set_file_times, make_time, lisp_time_argument): Adjust signature.
8302 (make_timeval, make_lisp_time, decode_time_components): New decls.
8303 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
8304 that it mishandled time_t overflow. You can't compare by subtracting!
8305 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
8306 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
8307
8308 * term.c: Include <sys/time.h>.
8309 (timeval_to_Time): New function, for proper overflow wraparound.
8310 (term_mouse_position, term_mouse_click): Use it.
8311
8312 * undo.c (record_first_change): Support higher-resolution time stamps
8313 in the undo buffer.
8314 (Fprimitive_undo): Use them when restoring time stamps.
8315
8316 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
8317 (w32_get_internal_run_time):
8318 Port to higher-resolution Emacs time stamps.
8319 (ltime): Now accepts single 64-bit integer, as that's more convenient
8320 for callers.
8321
8322 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
8323
8324 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
8325 for compatibility with pselect. Support ns-resolution time stamps.
8326
8327 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
8328
8329 * xselect.c (wait_for_property_change, x_get_foreign_selection):
8330 Check for time stamp overflow, and support ns-resolution time stamps.
8331
8332 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
8333 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
8334 (timeval_subtract): Remove; no longer needed.
8335 (XTflash, XTring_bell, x_wait_for_event):
8336 Port to ns-resolution time stamps. Don't assume time_t is signed.
8337
8338 2012-06-22 Chong Yidong <cyd@gnu.org>
8339
8340 * xdisp.c (x_consider_frame_title): Revert last change.
8341
8342 2012-06-22 Eli Zaretskii <eliz@gnu.org>
8343
8344 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
8345 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
8346 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
8347 staticidx goes up to 1597 out of 1600 = 0x640.)
8348
8349 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
8350
8351 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
8352 Otherwise, the umask might be mistakenly 0 while handling input signals.
8353
8354 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
8355
8356 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
8357
8358 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
8359
8360 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
8361 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
8362 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
8363 access to `contents' member of Lisp_Vector objects with AREF and ASET
8364 where appropriate.
8365
8366 2012-06-19 Chong Yidong <cyd@gnu.org>
8367
8368 * frame.c (delete_frame): When selecting a frame on a different
8369 text terminal, do not alter the terminal's top-frame.
8370
8371 * xdisp.c (format_mode_line_unwind_data): Record the target
8372 frame's selected window and its terminal's top-frame.
8373 (unwind_format_mode_line): Restore them.
8374 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
8375 Callers changed.
8376 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
8377 since tty frames can be explicitly named.
8378 (prepare_menu_bars): Likewise.
8379
8380 * term.c (Ftty_top_frame): New function.
8381
8382 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
8383
8384 Port byte-code-meter to modern targets.
8385 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
8386 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8387 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
8388 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
8389 (METER_1, METER_2): Simplify.
8390
8391 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
8392
8393 * data.c (Fdefalias): Return `symbol' (bug#11686).
8394
8395 2012-06-18 Martin Rudalics <rudalics@gmx.at>
8396
8397 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
8398 gets killed during executing of this function (Bug#11665).
8399 Try to always return Qt when the buffer has been actually killed.
8400 (Vkill_buffer_query_functions): In doc-string say that functions
8401 run by this hook should not change the current buffer.
8402
8403 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
8404
8405 Fix recently-introduced process.c problems found by static checking.
8406 * process.c (write_queue_push, write_queue_pop, send_process):
8407 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
8408 (write_queue_pop): Fix pointer signedness problem.
8409 (send_process): Remove unused local.
8410
8411 2012-06-17 Chong Yidong <cyd@gnu.org>
8412
8413 * xdisp.c (redisplay_internal): No need to redisplay terminal
8414 frames that are not on top.
8415
8416 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
8417
8418 * process.c (make_process): Initialize write_queue.
8419 (write_queue_push, write_queue_pop): New functions.
8420 (send_process): Use them to maintain correct ordering of process
8421 writes (Bug#10815).
8422
8423 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
8424
8425 * lisp.h (eassert): Assume C89 or later.
8426 This removes the need for CHECK.
8427 (CHECK): Remove. Its comments about always evaluating its
8428 argument were confusing, as 'eassert' typically does not evaluate
8429 its argument.
8430
8431 * coding.c (produce_chars): Use ptrdiff_t, not int.
8432
8433 * xterm.c (x_draw_underwave): Check for integer overflow.
8434 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
8435
8436 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
8437
8438 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
8439 referenced (Bug#11583).
8440
8441 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
8442
8443 Implement wave-style variant of underlining.
8444 * dispextern.h (face_underline_type): New enum.
8445 (face): Add field for underline type.
8446 * nsterm.m (ns_draw_underwave): New function.
8447 (ns_draw_text_decoration): Use it.
8448 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
8449 New functions.
8450 (x_draw_glyph_string): Use them.
8451 * xfaces.c (Qline, Qwave): New Lisp objects.
8452 (check_lface_attrs, merge_face_ref)
8453 (Finternal_set_lisp_face_attribute, realize_x_face):
8454 Handle wave-style underline face attributes.
8455 * xterm.c (x_draw_underwave): New function.
8456 (x_draw_glyph_string): Use it.
8457
8458 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
8459
8460 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
8461 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
8462 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
8463 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
8464 ($(BLD)/w32select.$(O)): Update dependencies.
8465
8466 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
8467
8468 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
8469 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
8470 * character.c (_fetch_multibyte_char_p): Remove.
8471 * alloc.c: Include "character.h" before "buffer.h".
8472 * bidi.c: Likewise.
8473 * buffer.c: Likewise.
8474 * bytecode.c: Likewise.
8475 * callint.c: Likewise.
8476 * callproc.c: Likewise.
8477 * casefiddle.c: Likewise.
8478 * casetab.c: Likewise.
8479 * category.c: Likewise.
8480 * cmds.c: Likewise.
8481 * coding.c: Likewise.
8482 * composite.c: Likewise.
8483 * dired.c: Likewise.
8484 * dispnew.c: Likewise.
8485 * doc.c: Likewise.
8486 * dosfns.c: Likewise.
8487 * editfns.c: Likewise.
8488 * emacs.c: Likewise.
8489 * fileio.c: Likewise.
8490 * filelock.c: Likewise.
8491 * font.c: Likewise.
8492 * fontset.c: Likewise.
8493 * fringe.c: Likewise.
8494 * indent.c: Likewise.
8495 * insdel.c: Likewise.
8496 * intervals.c: Likewise.
8497 * keyboard.c: Likewise.
8498 * keymap.c: Likewise.
8499 * lread.c: Likewise.
8500 * macros.c: Likewise.
8501 * marker.c: Likewise.
8502 * minibuf.c: Likewise.
8503 * nsfns.m: Likewise.
8504 * nsmenu.m: Likewise.
8505 * print.c: Likewise.
8506 * process.c: Likewise.
8507 * regex.c: Likewise.
8508 * region-cache.c: Likewise.
8509 * search.c: Likewise.
8510 * syntax.c: Likewise.
8511 * term.c: Likewise.
8512 * textprop.c: Likewise.
8513 * undo.c: Likewise.
8514 * unexsol.c: Likewise.
8515 * w16select.c: Likewise.
8516 * w32fns.c: Likewise.
8517 * w32menu.c: Likewise.
8518 * window.c: Likewise.
8519 * xdisp.c: Likewise.
8520 * xfns.c: Likewise.
8521 * xmenu.c: Likewise.
8522 * xml.c: Likewise.
8523 * xselect.c: Likewise.
8524
8525 2012-06-16 Eli Zaretskii <eliz@gnu.org>
8526
8527 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
8528 If all the glyphs of the glyph row came from strings, and we have no
8529 cursor positioning clues, put the cursor on the first glyph of the
8530 row.
8531 (handle_face_prop): Use chunk-relative overlay string index when
8532 indexing into it->string_overlays array. (Bug#11653)
8533 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
8534 the rightmost. (Bug#11720)
8535
8536 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
8537
8538 * category.h (CHAR_HAS_CATEGORY): Define as inline.
8539 (CATEGORY_MEMBER): Enforce 1/0 value.
8540 * category.c (_temp_category_set): Remove.
8541
8542 2012-06-16 Eli Zaretskii <eliz@gnu.org>
8543
8544 * window.c (Fdelete_other_windows_internal)
8545 (Fdelete_window_internal): Don't access frame's mouse highlight
8546 info of the initial frame. (Bug#11677)
8547
8548 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
8549
8550 * .gdbinit (xgetint): Fix recently-introduced paren typo.
8551 Assume USE_2_TAGS_FOR_INTS.
8552 (xreload): Adjust $tagmask width to match recent lisp.h change.
8553
8554 Simplify lisp.h in minor ways that should not affect code.
8555 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
8556 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
8557 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
8558 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
8559 (INTTYPEBITS): New macro, for clarity.
8560 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
8561 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
8562 Simplify now that USE_LSB_TAG is always defined.
8563 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
8564 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
8565
8566 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
8567
8568 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
8569
8570 2012-06-13 Glenn Morris <rgm@gnu.org>
8571
8572 * s/bsd-common.h (BSD4_3):
8573 * s/usg5-4-common.h (USG5_4): No longer define; unused.
8574
8575 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
8576
8577 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
8578 instead of union.
8579 (XLI, XIL): Define.
8580 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
8581 Use them.
8582 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
8583 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
8584 * alloc.c (widen_to_Lisp_Object): Remove.
8585 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
8586 * frame.c (delete_frame): Remove outdated comment.
8587 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
8588 USE_LISP_UNION_TYPE.
8589 (Fw32_unregister_hot_key): Likewise.
8590 (Fw32_toggle_lock_key): Likewise.
8591 * w32menu.c (add_menu_item): Likewise.
8592 (w32_menu_display_help): Use XIL instead of checking
8593 USE_LISP_UNION_TYPE.
8594 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
8595 (init_heap): Likewise.
8596 * w32term.c (w32_read_socket): Update comment.
8597
8598 2012-06-13 Glenn Morris <rgm@gnu.org>
8599
8600 * s/usg5-4-common.h, src/s/unixware.h:
8601 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
8602
8603 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
8604
8605 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
8606
8607 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
8608 * alloc.c (make_number) [!defined make_number]:
8609 Remove, as lisp.h always defines this now.
8610 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
8611 (roundup_size): Verify that it is a power of 2.
8612 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
8613 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
8614 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
8615 -DUSE_LSB_TAG=0, to override the automatically-selected default.
8616 USE_LSB_TAG now is always defined to be either 0 or 1.
8617 All uses changed.
8618 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
8619 code works fine either way, and efficiency is not a concern here,
8620 as the union type is for debugging, not for production.
8621 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
8622 Use an inline function on all platforms when using the union type,
8623 since this is simpler and 'static inline' can be used portably
8624 within Emacs now.
8625 (LISP_INITIALLY_ZERO): New macro.
8626 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
8627 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
8628
8629 2012-06-12 Glenn Morris <rgm@gnu.org>
8630
8631 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
8632
8633 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
8634
8635 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
8636 Move BROKEN_SIGIO to configure.
8637
8638 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
8639 Move NO_TERMIO to configure.
8640
8641 2012-06-12 Chong Yidong <cyd@gnu.org>
8642
8643 * image.c (imagemagick_load_image): Use MagickFlattenImage if
8644 MagickMergeImageLayers is undefined. Use pixel pusher loop if
8645 MagickExportImagePixels is undefined.
8646
8647 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
8648
8649 * image.c (imagemagick_load_image): Remove unused label.
8650
8651 2012-06-11 Glenn Morris <rgm@gnu.org>
8652
8653 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
8654 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
8655 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
8656 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
8657
8658 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
8659
8660 * alloc.c (make_byte_code): New function.
8661 (Fmake_byte_code): Use it. Don't purify here.
8662 * lread.c (read1): Use it as well to avoid extra allocation.
8663
8664 2012-06-11 Chong Yidong <cyd@gnu.org>
8665
8666 * image.c (imagemagick_load_image): Implement transparency.
8667
8668 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
8669
8670 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
8671 account for preceding backslashes. (Bug#11663)
8672
8673 2012-06-09 Chong Yidong <cyd@gnu.org>
8674
8675 * term.c: Support italics in capable terminals (Bug#9652).
8676 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
8677 (turn_on_face): Output using TS_enter_italic_mode if available.
8678 Don't handle unused blinking and alt-charset cases.
8679 (turn_off_face): Handle italic case; discard unused tty_blinking_p
8680 and tty_alt_charset_p cases.
8681 (tty_capable_p, init_tty): Support italics.
8682
8683 * termchar.h (struct tty_display_info): Add field for italics.
8684 Remove unused blink field.
8685
8686 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
8687 Handle slant.
8688
8689 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
8690 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
8691 tty_alt_charset_p. Add tty_italic_p.
8692
8693 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
8694
8695 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
8696 dbus_type_is_basic if available.
8697 (xd_extract_signed, xd_extract_unsigned): Rename from
8698 extract_signed and extract_unsigned, respectively. Adapt callers.
8699
8700 2012-06-09 Chong Yidong <cyd@gnu.org>
8701
8702 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
8703
8704 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
8705 case (Bug#9752).
8706
8707 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
8708
8709 * xdisp.c (vmessage): Treat frame message as multibyte.
8710 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
8711 would generate the diagnostic "Making \302\247 buffer-local while
8712 let-bound!".
8713
8714 2012-06-08 Eli Zaretskii <eliz@gnu.org>
8715
8716 * dispnew.c (showing_window_margins_p): Undo last change, which
8717 was done due to an inadvertent commit.
8718 (adjust_frame_glyphs_for_frame_redisplay): Do call
8719 showing_window_margins_p.
8720
8721 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
8722
8723 * eval.c (Fmake_var_non_special): New primitive.
8724 (syms_of_eval): Defsubr it.
8725 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
8726
8727 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
8728
8729 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
8730 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
8731
8732 2012-06-08 Eli Zaretskii <eliz@gnu.org>
8733
8734 * alloc.c (allocate_vectorlike): Fix last change.
8735
8736 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
8737
8738 Block-based vector allocation of small vectors.
8739 * lisp.h (struct vectorlike_header): New field `nbytes',
8740 adjust comment accordingly.
8741 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
8742 to denote vector blocks. Adjust users (live_vector_p,
8743 mark_maybe_pointer, valid_lisp_object_p) accordingly.
8744 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
8745 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
8746 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
8747 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
8748 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
8749 (roundup_size): New constant.
8750 (struct vector_block): New data type.
8751 (vector_blocks, vector_free_lists, zero_vector): New variables.
8752 (all_vectors): Rename to `large_vectors'.
8753 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
8754 (sweep_vectors): New functions.
8755 (allocate_vectorlike): Return `zero_vector' as the only vector of
8756 0 items. Allocate new vector from block if vector size is less than
8757 or equal to VBLOCK_BYTES_MAX.
8758 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
8759 (init_alloc_once): Add call to init_vectors.
8760
8761 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
8762
8763 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
8764
8765 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
8766
8767 * doprnt.c (doprnt): Truncate multibyte char correctly.
8768 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
8769 would mishandle a string argument "Xc" if X was a multibyte
8770 character of length 2: it would truncate after X's first byte
8771 rather than including all of X.
8772
8773 2012-06-06 Chong Yidong <cyd@gnu.org>
8774
8775 * buffer.c (word_wrap): Doc fix.
8776
8777 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
8778
8779 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
8780
8781 2012-06-03 Glenn Morris <rgm@gnu.org>
8782
8783 * xdisp.c (tool-bar-style): Doc fix.
8784
8785 2012-06-03 Ulrich Müller <ulm@gentoo.org>
8786
8787 * Makefile.in (PAXCTL): Define.
8788 (temacs$(EXEEXT)): Disable memory randomization for the temacs
8789 binary via PaX flags if the paxctl utility is available.
8790 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
8791 Restore PaX flags to their default. (Bug#11398)
8792
8793 2012-06-03 Chong Yidong <cyd@gnu.org>
8794
8795 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
8796 buffer (Bug#11226).
8797
8798 2012-06-03 Chong Yidong <cyd@gnu.org>
8799
8800 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
8801 (note_mode_line_or_margin_highlight): If there is no help echo,
8802 use mode-line-default-help-echo. Handle the case where the mouse
8803 position is past the end of the mode line string.
8804
8805 * buffer.c (buffer_local_value_1): New function, split from
8806 Fbuffer_local_value; can return Qunbound.
8807 (Fbuffer_local_value): Use it.
8808 (Vmode_line_format): Docstring tweaks.
8809
8810 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
8811
8812 * sysdep.c (system_process_attributes): Improve comment.
8813
8814 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
8815
8816 * keyboard.c: Export real-this-command to Elisp.
8817 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
8818 and DEFVAR it. Update all users.
8819
8820 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
8821
8822 * minibuf.c (Fassoc_string): Remove duplicate declaration.
8823
8824 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
8825 Convert pctcpu and pctmem to Lisp float properly.
8826 Let the compiler fold better, as 100.0/0x8000 is exact.
8827
8828 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
8829
8830 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
8831 cons_block.
8832
8833 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
8834
8835 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
8836
8837 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
8838
8839 For a 'struct window', replace some Lisp_Object fields to
8840 bitfields where appropriate, remove unused fields.
8841 * window.h (struct window): Remove unused 'last_mark_x' and
8842 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
8843 change its type from Lisp_Object to bitfield.
8844 Change type of 'force_start', 'optional_new_start',
8845 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
8846 fields from Lisp_Object to bitfield. Adjust users accordingly.
8847
8848 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
8849
8850 Pacify gcc -Wdouble-precision when using Xaw.
8851 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
8852 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
8853 Use 'float' consistently, rather than 'float' in most places
8854 and 'double' in a couple of places.
8855
8856 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8857
8858 * xdisp.c (handle_stop): Detect whether we have overlay strings
8859 loaded by testing it->current.overlay_string_index to be
8860 non-negative, instead of checking whether n_overlay_strings is
8861 positive. (Bug#11587)
8862
8863 2012-05-31 Chong Yidong <cyd@gnu.org>
8864
8865 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
8866
8867 * doc.c (Fsubstitute_command_keys): Doc fix.
8868
8869 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8870
8871 * search.c (search_buffer): Remove calls to
8872 r_alloc_inhibit_buffer_relocation, as it is now called by
8873 maybe_unify_char, which was the cause of relocation of buffer text
8874 in bug#11519.
8875
8876 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8877
8878 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
8879 for the duration of call to load_charset, to avoid problems with
8880 callers of maybe_unify_char that access buffer text through C
8881 pointers.
8882
8883 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
8884 decrement the inhibition flag, instead of just setting or
8885 resetting it.
8886
8887 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
8888
8889 Remove obsolete '#define static' cruft.
8890 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
8891 This #undef was "temporary" in 2000; it is no longer needed
8892 now that '#define static' has gone away.
8893 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
8894 (gray_bitmap_bits): Remove; no longer needed.
8895 All uses replaced with definiens.
8896 * xterm.c: Include "bitmaps/gray.xbm".
8897
8898 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
8899
8900 Clean up __executable_start, monstartup when --enable-profiling.
8901 The following changes affect the code only when profiling.
8902 * dispnew.c (__executable_start): Rename from safe_bcopy.
8903 Define only on platforms that need it.
8904 * emacs.c: Include <sys/gmon.h> when profiling.
8905 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
8906 (__executable_start): Remove decl, since lisp.h does it now.
8907 (safe_bcopy): Remove decl; no longer has that name.
8908 (main): Coalesce #if into single bit of code, for simplicity.
8909 Cast pointers to uintptr_t, since standard libraries want integers
8910 and not pointers.
8911 * lisp.h (__executable_start): New decl.
8912
8913 2012-05-31 Glenn Morris <rgm@gnu.org>
8914
8915 * image.c (Fimagemagick_types): Doc fix.
8916
8917 2012-05-30 Jim Meyering <meyering@redhat.com>
8918
8919 * callproc.c (Fcall_process_region): Include directory component
8920 in mkstemp error message (Bug#11586).
8921
8922 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
8923
8924 * alloc.c, lisp.h (make_pure_vector): Now static.
8925
8926 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
8927
8928 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
8929 Move to byte-run.el.
8930 (Fautoload): Do the hash-doc more carefully.
8931 * data.c (Fdefalias): Purify definition, except for keymaps.
8932 (Qdefun): Move from eval.c.
8933 * lisp.h (Qdefun): Remove.
8934 * lread.c (read1): Tiny simplification.
8935
8936 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
8937
8938 Do not create empty overlays with the evaporate property (Bug#9642).
8939 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
8940 Bug#9642, but explicitly check that the buffer the overlay would
8941 be moved to is live and rearrange lines to make sure that errors
8942 will not put the overlay in an inconsistent state.
8943 (Fdelete_overlay): Cosmetics.
8944
8945 2012-05-28 Eli Zaretskii <eliz@gnu.org>
8946
8947 * w32term.c (my_bring_window_to_top): New function.
8948 (x_raise_frame): Use handle returned by DeferWindowPos, which
8949 could be different from the original one.
8950 Call my_bring_window_to_top instead of my_set_foreground_window.
8951 (Bug#11513)
8952
8953 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
8954 by calling BringWindowToTop.
8955
8956 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
8957 (WM_EMACS_END): Increase by one.
8958
8959 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
8960
8961 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
8962 This avoids undefined behavior that might cause the eassert
8963 to not catch an out-of-range value.
8964
8965 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
8966
8967 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
8968 Update dependencies.
8969
8970 2012-05-27 Eli Zaretskii <eliz@gnu.org>
8971
8972 * bidi.c (bidi_mirror_char): Fix last change.
8973
8974 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
8975
8976 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
8977 when referring to sectname field in printf format.
8978
8979 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
8980
8981 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
8982 Only r_alloc_inhibit_buffer_relocation needed to be added;
8983 the others were already declared.
8984
8985 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
8986 before checking whether it's out of range. Put the check inside
8987 eassert. See
8988 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
8989
8990 2012-05-27 Ken Brown <kbrown@cornell.edu>
8991
8992 * callproc.c (Fcall_process): Restore a line that was accidentally
8993 commented out in the 2011-02-13 change (bug#11547).
8994
8995 2012-05-27 Eli Zaretskii <eliz@gnu.org>
8996
8997 * lisp.h [REL_ALLOC]: Add prototypes for external functions
8998 defined on ralloc.c.
8999
9000 * buffer.c [REL_ALLOC]: Remove prototypes of
9001 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
9002 they are now on lisp.h.
9003
9004 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
9005
9006 * search.c (search_buffer): Use it to inhibit relocation of buffer
9007 text while re_search_2 is doing its job, because re_search_2 is
9008 passed C pointers to buffer text. (Bug#11519)
9009
9010 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
9011 Update value to 24.
9012
9013 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
9014 state after an additional call to move_it_in_display_line_to, keep
9015 the values of it->max_ascent and it->max_descent found for the
9016 entire line.
9017 (pos_visible_p): Revert the comparison against bottom_y to what it
9018 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
9019 (Bug#11464)
9020
9021 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
9022
9023 Fix coding-related core dumps with gcc -ftrapv.
9024 The code was computing A - B, where A and B are pointers, and B is
9025 random garbage. This can lead to core dumps on platforms that
9026 have special pointer registers, and it also leads to core dumps on
9027 x86-64 when compiled with gcc -ftrapv. The fix is to compute
9028 A - B only when B is initialized properly.
9029 * coding.c (coding_set_source, coding_set_destination): Return void.
9030 (coding_change_source, coding_change_destinations): New functions,
9031 with the old behaviors of coding_set_source and coding_set_destination.
9032 All callers that need an offset changed to use these new functions.
9033
9034 2012-05-26 Glenn Morris <rgm@gnu.org>
9035
9036 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
9037
9038 2012-05-26 Eli Zaretskii <eliz@gnu.org>
9039
9040 Extend mouse support on W32 text-mode console.
9041 * xdisp.c (draw_row_with_mouse_face):
9042 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
9043
9044 * w32console.c: Include window.h.
9045 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
9046 New functions.
9047 (initialize_w32_display): Initialize mouse-highlight data.
9048
9049 * w32inevt.c: Include termchar.h and window.h.
9050 (do_mouse_event): Support mouse-autoselect-window. When the mouse
9051 moves, call note_mouse_highlight. If help_echo changed, call
9052 gen_help_event to produce help-echo message in the echo area.
9053 Call clear_mouse_face if mouse_face_hidden is set in the mouse
9054 highlight info.
9055
9056 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
9057
9058 * lread.c (read1): Simplify slightly to avoid an overflow warning
9059 with GCC 4.7.0 on x86-64.
9060
9061 2012-05-26 Eli Zaretskii <eliz@gnu.org>
9062
9063 * bidi.c (bidi_mirror_char): Revert last change: an int is
9064 definitely wide enough here.
9065
9066 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
9067
9068 Fix integer width and related bugs (Bug#9874).
9069 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
9070 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
9071 (string_bytes, check_sblock, allocate_string_data):
9072 (compact_small_strings, Fmake_bool_vector, make_string)
9073 (make_unibyte_string, make_multibyte_string)
9074 (make_string_from_bytes, make_specified_string)
9075 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
9076 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
9077 (mark_vectorlike):
9078 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9079 (allocate_pseudovector):
9080 Use int, not EMACS_INT, where int is wide enough.
9081 (inhibit_garbage_collection, Fgarbage_collect):
9082 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9083 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
9084 int might not be wide enough.
9085 (bidi_cache_search, bidi_cache_find, bidi_init_it)
9086 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
9087 (bidi_at_paragraph_end, bidi_find_paragraph_start)
9088 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
9089 (bidi_level_of_next_char, bidi_move_to_visually_next):
9090 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9091 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
9092 (Fkill_buffer, Fset_buffer_major_mode)
9093 (advance_to_char_boundary, Fbuffer_swap_text)
9094 (Fset_buffer_multibyte, overlays_at, overlays_in)
9095 (overlay_touches_p, struct sortvec, record_overlay_string)
9096 (overlay_strings, recenter_overlay_lists)
9097 (adjust_overlays_for_insert, adjust_overlays_for_delete)
9098 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
9099 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
9100 (Foverlay_recenter, last_overlay_modification_hooks_used)
9101 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
9102 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9103 (validate_region): Omit unnecessary test for b <= e,
9104 since that's guaranteed by the previous test.
9105 (adjust_overlays_for_delete): Avoid pos + length overflow.
9106 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
9107 (report_overlay_modification):
9108 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9109 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
9110 Omit pointer cast, which isn't needed anyway, and doesn't work
9111 after the EMACS_INT -> ptrdiff_t change.
9112 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
9113 * buffer.h: Adjust decls to match defn changes elsewhere.
9114 (struct buffer_text, struct buffer):
9115 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9116 Use EMACS_INT, not int, where int might not be wide enough.
9117 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
9118 not int, to avoid needless 32-bit limit on 64-bit hosts.
9119 (exec_byte_code): Use tighter memory-full test, one that checks
9120 for alloca overflow. Don't compute the address of the object just
9121 before an array, as that's not portable. Use EMACS_INT, not
9122 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
9123 * callint.c (Fcall_interactively):
9124 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9125 * callproc.c (call_process_kill, Fcall_process):
9126 Don't assume pid_t fits into an Emacs fixnum.
9127 (call_process_cleanup, Fcall_process, child_setup):
9128 Don't assume pid_t fits into int.
9129 (call_process_cleanup, Fcall_process, delete_temp_file)
9130 (Fcall_process_region):
9131 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9132 (Fcall_process): Simplify handling of volatile integers.
9133 Use int, not EMACS_INT, where int will do.
9134 * casefiddle.c (casify_object, casify_region, operate_on_word)
9135 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
9136 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9137 (casify_object): Avoid integer overflow when overallocating buffer.
9138 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
9139 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
9140 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
9141 * category.h (CATEGORYP): Don't assume arg is nonnegative.
9142 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
9143 integers are now checked earlier. All uses replaced with XINT.
9144 (ccl_driver):
9145 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9146 For CCL_MapSingle, check that content and value are in int range.
9147 (ccl_driver, Fregister_code_conversion_map):
9148 Check that Vcode_version_map_vector is a vector.
9149 (resolve_symbol_ccl_program): Check that vector header is in range.
9150 Always copy the vector, so that we can check its contents reliably
9151 now rather than having to recheck each instruction as it's being
9152 executed. Check that vector words fit in 'int'.
9153 (ccl_get_compiled_code, Fregister_ccl_program)
9154 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
9155 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
9156 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
9157 contents are in range.
9158 (Fccl_execute_on_string): Check that status is in range.
9159 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
9160 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
9161 Accept and return EMACS_INT, not int, because callers can pass values
9162 out of 'int' range.
9163 (c_string_width, strwidth, lisp_string_width, chars_in_text)
9164 (multibyte_chars_in_text, parse_str_as_multibyte)
9165 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
9166 (str_as_unibyte, str_to_unibyte, string_count_byte8)
9167 (string_escape_byte8, Fget_byte):
9168 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9169 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
9170 avoid mishandling large integers.
9171 * character.h: Adjust decls to match defn changes elsewhere.
9172 * charset.c (load_charset_map_from_file, find_charsets_in_text)
9173 (Ffind_charset_region):
9174 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9175 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
9176 (load_charset_map_from_vector, Fdefine_charset_internal):
9177 Don't assume fixnum fits in int.
9178 (load_charset_map_from_vector, Fmap_charset_chars):
9179 Remove now-unnecessary CHECK_NATNUMs.
9180 (Fdefine_charset_internal): Check ranges here, more carefully.
9181 Don't rely on undefined behavior with signed left shift overflow.
9182 Don't assume unsigned int fits into fixnum, or that fixnum fits
9183 into unsigned int. Don't require max_code to be a valid fixnum;
9184 that's not true for gb10830 4-byte on a 32-bit host. Allow
9185 invalid_code to be a cons, for the same reason. Require code_offset
9186 to be a character. Avoid int overflow if max_char is close
9187 to INT_MAX.
9188 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
9189 this is intended anyway and avoids some undefined behavior.
9190 (load_charset_map): Pass unsigned, not int, as 2nd arg of
9191 INDEX_TO_CODE_POINT, as that's what it expects.
9192 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
9193 * charset.h (DECODE_CHAR): Return int, not unsigned;
9194 this is what was intended anyway, and it avoids undefined behavior.
9195 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
9196 integer-overflow issues.
9197 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
9198 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
9199 where the argument is EMACS_INT, and this behavior is not intended.
9200 * chartab.c (Fmake_char_table, Fset_char_table_range)
9201 (uniprop_get_decoder, uniprop_get_encoder):
9202 Don't assume fixnum fits in int.
9203 * cmds.c (move_point): New function, that does the gist of
9204 Fforward_char and Fbackward_char, but does so while checking
9205 for integer overflow more accurately.
9206 (Fforward_char, Fbackward_char): Use it.
9207 (Fforward_line, Fend_of_line, internal_self_insert)
9208 (internal_self_insert):
9209 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9210 Fix a FIXME, by checking for integer overflow when calculating
9211 target_clm and actual_clm.
9212 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
9213 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
9214 (ASSURE_DESTINATION, coding_alloc_by_realloc)
9215 (coding_alloc_by_making_gap, alloc_destination)
9216 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
9217 (encode_coding_utf_16, detect_coding_emacs_mule)
9218 (decode_coding_emacs_mule, encode_coding_emacs_mule)
9219 (detect_coding_iso_2022, decode_coding_iso_2022)
9220 (encode_invocation_designation, encode_designation_at_bol)
9221 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
9222 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
9223 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
9224 (encode_coding_ccl, encode_coding_raw_text)
9225 (detect_coding_charset, decode_coding_charset)
9226 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
9227 (produce_composition, produce_charset, produce_annotation)
9228 (decode_coding, handle_composition_annotation)
9229 (handle_charset_annotation, consume_chars, decode_coding_gap)
9230 (decode_coding_object, encode_coding_object, detect_coding_system)
9231 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
9232 (code_convert_region, code_convert_string)
9233 (Fdefine_coding_system_internal)
9234 (coding_set_source, coding_set_destination):
9235 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9236 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
9237 (Fdefine_coding_system_internal):
9238 Don't assume fixnums fit in int.
9239 (decode_coding_gap, decode_coding_object, encode_coding_object)
9240 (Fread_coding_system, Fdetect_coding_region)
9241 (Funencodable_char_position, Fcheck_coding_systems_region)
9242 (get_translation, handle_composition_annotation, consume_chars):
9243 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9244 (consume_chars): Rewrite to not calculate an address outside buffer.
9245 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
9246 Don't access memory outside of the args array.
9247 (Fdefine_coding_system_internal): Check for charset-id overflow.
9248 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
9249 result of ENCODE_CHAR.
9250 * coding.h: Adjust decls to match defn changes elsewhere.
9251 (struct coding_system):
9252 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9253 * composite.c (get_composition_id, find_composition)
9254 (run_composition_function, update_compositions)
9255 (compose_text, composition_gstring_put_cache)
9256 (composition_gstring_p, composition_gstring_width)
9257 (fill_gstring_header, fill_gstring_body, autocmp_chars)
9258 (composition_compute_stop_pos, composition_reseat_it)
9259 (composition_update_it, struct position_record)
9260 (find_automatic_composition, composition_adjust_point)
9261 (Fcomposition_get_gstring, Ffind_composition_internal):
9262 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9263 (update_compositions):
9264 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9265 * composite.h: Adjust decls to match defn changes elsewhere.
9266 (struct composition):
9267 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9268 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
9269 Do not attempt to compute the address of the object just before a
9270 buffer; this is not portable.
9271 (Faref, Faset):
9272 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9273 (Faset): Use int, not EMACS_INT, where int is wide enough.
9274 (Fstring_to_number): Don't assume fixnums fit in int.
9275 (Frem): Don't assume arg is nonnegative.
9276 * dbusbind.c (xd_append_arg): Check for integers out of range.
9277 (Fdbus_call_method): Don't overflow the timeout int.
9278 (extract_signed, extract_unsigned): New functions.
9279 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
9280 (xd_get_connection_references): Return ptrdiff_t, not int.
9281 All uses changed.
9282 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
9283 (xd_read_message_1):
9284 Use int, not unsigned, where the dbus API uses int.
9285 (Fdbus_message_internal): Don't overflow mtype.
9286 (syms_of_dbusbind): Allocate right-sized buffer for integers.
9287 * dired.c (directory_files_internal, file_name_completion, scmp)
9288 (file_name_completion_stat):
9289 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9290 (file_name_completion): Don't overflow matchcount.
9291 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
9292 * dispextern.h: Adjust decls to match defn changes elsewhere.
9293 (struct text_pos, struct glyph, struct bidi_saved_info)
9294 (struct bidi_string_data, struct bidi_it, struct composition_it)
9295 (struct it):
9296 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9297 (struct display_pos, struct composition_it, struct it):
9298 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9299 * dispnew.c (increment_matrix_positions)
9300 (increment_row_positions, mode_line_string)
9301 (marginal_area_string):
9302 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9303 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
9304 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9305 (duration_to_sec_usec): New function, to check for overflow better.
9306 (Fsleep_for, sit_for): Use it.
9307 * doc.c (get_doc_string, store_function_docstring):
9308 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9309 (get_doc_string, Fsnarf_documentation):
9310 Use int, not EMACS_INT, where int is wide enough.
9311 (get_doc_string):
9312 Use SAFE_ALLOCA, not alloca.
9313 Check for overflow when converting EMACS_INT to off_t.
9314 * doprnt.c (doprnt):
9315 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9316 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
9317 Don't assume uid_t fits into fixnum.
9318 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
9319 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
9320 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
9321 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
9322 (general_insert_function)
9323 (Finsert_char, make_buffer_string, make_buffer_string_both)
9324 (update_buffer_properties, Fbuffer_substring)
9325 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
9326 (Fsubst_char_in_region, check_translation)
9327 (Ftranslate_region_internal, save_restriction_restore, Fformat)
9328 (transpose_markers, Ftranspose_regions):
9329 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9330 (clip_to_bounds): Move to lisp.h as an inline function).
9331 (Fconstrain_to_field): Don't assume integers are nonnegative.
9332 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
9333 (Fsubst_char_in_region, Fsave_restriction):
9334 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9335 (Femacs_pid): Don't assume pid_t fits into fixnum.
9336 (lo_time): Use int, not EMACS_INT, when int suffices.
9337 (lisp_time_argument): Check for usec out of range.
9338 (Fencode_time): Don't assume fixnum fits in int.
9339 (Fuser_login_name, Fuser_full_name): Signal an error
9340 if a uid argument is out of range, rather than relying on
9341 undefined behavior.
9342 (Fformat_time_string): Remove now-unnecessary check.
9343 lisp_time_argument checks for out-of-range usec now.
9344 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
9345 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
9346 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
9347 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
9348 (init_cmdargs, Fdump_emacs):
9349 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9350 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
9351 the bottom (typically) 32 bits of the fixnum.
9352 * eval.c (specpdl_size, call_debugger):
9353 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9354 (when_entered_debugger, Fbacktrace_debug):
9355 Don't assume fixnum can fit in int.
9356 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
9357 the object just before a buffer; this is not portable.
9358 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
9359 (grow_specpdl, unbind_to):
9360 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9361 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
9362 (grow_specpdl): Simplify allocation by using xpalloc.
9363 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
9364 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
9365 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
9366 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9367 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
9368 (a_write, e_write):
9369 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9370 (Fcopy_file, non_regular_nbytes, read_non_regular)
9371 (Finsert_file_contents):
9372 Use int, not EMACS_INT, where int is wide enough.
9373 (READ_BUF_SIZE): Verify that it fits in int.
9374 (Finsert_file_contents): Check that counts are in proper range,
9375 rather than assuming fixnums fit into ptrdiff_t etc.
9376 Don't assume fixnums fit into int.
9377 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
9378 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
9379 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
9380 (string_char_to_byte, string_byte_to_char)
9381 (string_make_multibyte, string_to_multibyte)
9382 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
9383 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
9384 (substring_both, Fdelete, internal_equal, Ffillarray)
9385 (Fclear_string, mapcar1)
9386 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
9387 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
9388 (larger_vector, make_hash_table, maybe_resize_hash_table)
9389 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
9390 (Fmaphash, secure_hash):
9391 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9392 (concat): Check for string index and length overflow.
9393 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
9394 (Frequire):
9395 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9396 (larger_vector): New API (vec, incr_min, size_max) replaces old
9397 one (vec, new_size, init). This catches size overflow.
9398 INIT was removed because it was always Qnil.
9399 All callers changed.
9400 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
9401 the upper bound on a hash table index size.
9402 (make_hash_table, maybe_resize_hash_table): Use it.
9403 (secure_hash): Computer start_byte and end_byte only after
9404 they're known to be in ptrdiff_t range.
9405 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
9406 (Ffont_get_glyphs, Ffont_at):
9407 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9408 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
9409 (Flist_fonts, Fopen_font):
9410 Don't assume fixnum can fit in int.
9411 (check_gstring): Don't assume index can fit in int.
9412 (font_match_p): Check that fixnum is a character, not a nonnegative
9413 fixnum, since the later code needs to stuff it into an int.
9414 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
9415 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
9416 conversion overflow issues.
9417 (Fopen_font): Check for integer out of range.
9418 (Ffont_get_glyphs): Don't assume index can fit in int.
9419 * font.h: Adjust decls to match defn changes elsewhere.
9420 * fontset.c (reorder_font_vector): Redo score calculation to avoid
9421 integer overflow.
9422 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
9423 printmax_t, where ptrdiff_t is wide enough.
9424 (Finternal_char_font):
9425 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9426 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
9427 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
9428 (Fset_frame_position, x_set_frame_parameters)
9429 (x_set_line_spacing, x_set_border_width)
9430 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
9431 Check that fixnums are in proper range for system types.
9432 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
9433 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9434 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
9435 Use SAFE_ALLOCA_LISP, not alloca.
9436 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
9437 intptr_t is wide enough.
9438 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
9439 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
9440 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
9441 Check for fixnum out of range.
9442 * ftfont.c (ftfont_list): Don't assume index fits in int.
9443 Check that fixnums are in proper range for system types.
9444 (ftfont_shape_by_flt):
9445 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9446 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
9447 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9448 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
9449 Check that fixnums are in proper range for system types.
9450 * gnutls.h: Adjust decls to match defn changes elsewhere.
9451 * gtkutil.c (xg_dialog_run):
9452 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9453 (update_frame_tool_bar):
9454 Check that fixnums are in proper range for system types.
9455 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
9456 (lookup_image): Check that fixnums are in range for system types.
9457 * indent.c (last_known_column, last_known_column_point):
9458 (current_column_bol_cache):
9459 (skip_invisible, current_column, check_display_width):
9460 (check_display_width, scan_for_column, current_column_1)
9461 (Findent_to, Fcurrent_indentation, position_indentation)
9462 (indented_beyond_p, Fmove_to_column, compute_motion):
9463 (Fcompute_motion, Fvertical_motion):
9464 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9465 (last_known_column_modified): Use EMACS_INT, not int.
9466 (check_display_width):
9467 (Fcompute_motion):
9468 Check that fixnums and floats are in proper range for system types.
9469 (compute_motion): Don't assume index or fixnum fits in int.
9470 (compute_motion, Fcompute_motion):
9471 Use int, not EMACS_INT, when it is wide enough.
9472 (vmotion): Omit local var start_hpos that is always 0; that way
9473 we don't need to worry about overflow in expressions involving it.
9474 * indent.h: Adjust decls to match defn changes elsewhere.
9475 (struct position):
9476 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9477 Use int, not EMACS_INT, where int is wide enough.
9478 Remove unused members ovstring_chars_done and tab_offset;
9479 all uses removed.
9480 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
9481 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
9482 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
9483 (make_gap, copy_text, insert, insert_and_inherit)
9484 (insert_before_markers, insert_before_markers_and_inherit)
9485 (insert_1, count_combining_before, count_combining_after)
9486 (insert_1_both, insert_from_string)
9487 (insert_from_string_before_markers, insert_from_string_1)
9488 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
9489 (adjust_after_replace, adjust_after_insert, replace_range)
9490 (replace_range_2, del_range, del_range_1, del_range_byte)
9491 (del_range_both, del_range_2, modify_region)
9492 (prepare_to_modify_buffer, signal_before_change)
9493 (signal_after_change, Fcombine_after_change_execute):
9494 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9495 * intervals.c (traverse_intervals, rotate_right, rotate_left)
9496 (balance_an_interval, split_interval_right, split_interval_left)
9497 (find_interval, next_interval, update_interval)
9498 (adjust_intervals_for_insertion, delete_node, delete_interval)
9499 (interval_deletion_adjustment, adjust_intervals_for_deletion)
9500 (static_offset_intervals, offset_intervals)
9501 (merge_interval_right, merge_interval_left, make_new_interval)
9502 (graft_intervals_into_buffer, temp_set_point_both)
9503 (temp_set_point, set_point, adjust_for_invis_intang)
9504 (set_point_both, move_if_not_intangible, get_property_and_range)
9505 (get_local_map, copy_intervals, copy_intervals_to_string)
9506 (compare_string_intervals, set_intervals_multibyte_1):
9507 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9508 * intervals.h: Adjust decls to match defn changes elsewhere.
9509 (struct interval):
9510 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9511 * keyboard.c (this_command_key_count, this_single_command_key_start)
9512 (before_command_key_count, before_command_echo_length, echo_now)
9513 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
9514 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
9515 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
9516 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
9517 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9518 (last_non_minibuf_size, last_point_position, echo_truncate)
9519 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
9520 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
9521 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
9522 (stuff_buffered_input):
9523 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9524 (last_auto_save, command_loop_1, read_char):
9525 Use EMACS_INT, not int, to avoid integer overflow.
9526 (record_char): Avoid overflow in total_keys computation.
9527 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
9528 * keyboard.h: Adjust decls to match defn changes elsewhere.
9529 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
9530 (Fkey_description, Fdescribe_vector, Flookup_key):
9531 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9532 (click_position): New function, to check that positions are in range.
9533 (Fcurrent_active_maps):
9534 (describe_command):
9535 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9536 (Faccessible_keymaps, Fkey_description):
9537 (preferred_sequence_p):
9538 Don't assume fixnum can fit into int.
9539 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
9540 Check for integer overflow in size calculations.
9541 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
9542 avoid mishandling large integers.
9543 * lisp.h: Adjust decls to match defn changes elsewhere.
9544 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
9545 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
9546 (struct Lisp_Marker):
9547 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9548 (clip_to_bounds): Now an inline function, moved here from editfns.c.
9549 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
9550 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
9551 All callers changed.
9552 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
9553 Assume the arg has valid form, since it always does.
9554 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
9555 unsigned integer system type.
9556 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
9557 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
9558 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9559 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
9560 (duration_to_sec_usec): New decl.
9561 * lread.c (read_from_string_index, read_from_string_index_byte)
9562 (read_from_string_limit, readchar, unreadchar, openp)
9563 (read_internal_start, read1, oblookup):
9564 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9565 (Fload, readevalloop, Feval_buffer, Feval_region):
9566 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9567 (openp): Check for out-of-range argument to 'access'.
9568 (read1): Use int, not EMACS_INT, where int is wide enough.
9569 Don't assume fixnum fits into int.
9570 Fix off-by-one error that can read outside a buffer.
9571 (read_filtered_event): Use duration_to_sec_usec
9572 to do proper overflow checking on durations.
9573 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
9574 in size calculation.
9575 (Fexecute_kbd_macro):
9576 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9577 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
9578 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
9579 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
9580 (set_marker_both, set_marker_restricted_both, marker_position)
9581 (marker_byte_position, Fbuffer_has_markers_at):
9582 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9583 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
9584 * menu.c (ensure_menu_items): Rename from grow_menu_items.
9585 It now merely ensures that the menu is large enough, without
9586 necessarily growing it, as this avoids some integer overflow issues.
9587 All callers changed.
9588 (keymap_panes, parse_single_submenu, Fx_popup_menu):
9589 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9590 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
9591 Use SAFE_ALLOCA_LISP, not alloca.
9592 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
9593 to EMACS_INT. Check that fixnums are in proper range for system types.
9594 * minibuf.c (minibuf_prompt_width, string_to_object)
9595 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
9596 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
9597 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9598 (get_minibuffer, read_minibuf_unwind):
9599 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9600 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
9601 this simplifies overflow checking. All callers changed.
9602 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
9603 (Ftest_completion):
9604 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9605 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
9606 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
9607 Check that fixnums are in proper range for system types.
9608 (Fx_create_frame, Fx_show_tip):
9609 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9610 * nsfont.m (ns_findfonts, nsfont_list_family):
9611 Don't assume fixnum fits in long.
9612 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
9613 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9614 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
9615 wide enough.
9616 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
9617 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9618 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
9619 (PRINTDECLARE, PRINTPREPARE):
9620 (strout, print_string):
9621 (print, print_preprocess, print_check_string_charset_prop)
9622 (print_object):
9623 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9624 (PRINTDECLARE):
9625 (temp_output_buffer_setup, Fprin1_to_string, print_object):
9626 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9627 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
9628 (printchar, strout): Use xpalloc to catch size calculation overflow.
9629 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
9630 (print_error_message): Use SAFE_ALLOCA, not alloca.
9631 (print_object): Use int, not EMACS_INT, where int is wide enough.
9632 (print_depth, new_backquote_output, print_number_index):
9633 Use ptrdiff_t, not int, where int might not be wide enough.
9634 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
9635 (Fset_process_window_size, Fformat_network_address)
9636 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
9637 (sigchld_handler):
9638 Check that fixnums are in proper range for system types.
9639 (Fsignal_process): Simplify by avoiding a goto.
9640 Check for process-ids out of pid_t range rather than relying on
9641 undefined behavior.
9642 (process_tick, update_tick): Use EMACS_INT, not int.
9643 (Fformat_network_address, read_process_output, send_process)
9644 (Fprocess_send_region, status_notify):
9645 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9646 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
9647 (wait_reading_process_output, read_process_output, exec_sentinel):
9648 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9649 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
9650 (Faccept_process_output): Use duration_to_sec_usec to do proper
9651 overflow checking on durations.
9652 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
9653 Don't assume pid_t fits in int.
9654 * process.h (struct Lisp_Process): Members tick and update_tick
9655 are now of type EMACS_INT, not int.
9656 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
9657 configured --with-wide-int.
9658 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
9659 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
9660 * search.c (looking_at_1, string_match_1):
9661 (fast_string_match, fast_c_string_match_ignore_case)
9662 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
9663 (scan_newline, find_before_next_newline, search_command)
9664 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
9665 (set_search_regs, wordify):
9666 (Freplace_match):
9667 (Fmatch_data):
9668 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9669 (string_match_1, search_buffer, set_search_regs):
9670 (Fmatch_data):
9671 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9672 (wordify): Check for overflow in size calculation.
9673 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
9674 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
9675 Check that fixnums are in proper range for system types.
9676 * sound.c (struct sound_device)
9677 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
9678 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9679 (Fplay_sound_internal):
9680 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9681 * syntax.c (struct lisp_parse_state, find_start_modiff)
9682 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
9683 (Fparse_partial_sexp):
9684 Don't assume fixnums can fit in int.
9685 (struct lisp_parse_state, find_start_pos, find_start_value)
9686 (find_start_value_byte, find_start_begv)
9687 (update_syntax_table, char_quoted, dec_bytepos)
9688 (find_defun_start, prev_char_comend_first, back_comment):
9689 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
9690 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
9691 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9692 (Finternal_describe_syntax_value): Check that match_lisp is a
9693 character, not an integer, since the code stuffs it into int.
9694 (scan_words, scan_sexps_forward):
9695 Check that fixnums are in proper range for system types.
9696 (Fforward_word):
9697 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9698 (scan_sexps_forward):
9699 Use CHARACTERP, not INTEGERP, since the value must fit into int.
9700 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
9701 * syntax.h: Adjust decls to match defn changes elsewhere.
9702 (struct gl_state_s):
9703 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9704 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
9705 MOST_POSITIVE_FIXNUM.
9706 * sysdep.c (wait_for_termination_1, wait_for_termination)
9707 (interruptible_wait_for_termination, mkdir):
9708 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
9709 (emacs_read, emacs_write):
9710 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9711 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
9712 and double all fit in int.
9713 * term.c (set_tty_color_mode):
9714 Check that fixnums are in proper range for system types.
9715 * termhooks.h (struct input_event):
9716 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9717 * textprop.c (validate_interval_range, interval_of)
9718 (Fadd_text_properties, set_text_properties_1)
9719 (Fremove_text_properties, Fremove_list_of_text_properties)
9720 (Ftext_property_any, Ftext_property_not_all)
9721 (copy_text_properties, text_property_list, extend_property_ranges)
9722 (verify_interval_modification):
9723 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9724 (Fnext_single_char_property_change)
9725 (Fprevious_single_char_property_change):
9726 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9727 (copy_text_properties):
9728 Check for integer overflow in index calculation.
9729 * undo.c (last_boundary_position, record_point, record_insert)
9730 (record_delete, record_marker_adjustment, record_change)
9731 (record_property_change):
9732 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9733 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
9734 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9735 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
9736 (Fx_hide_tip, Fx_file_dialog):
9737 * w32menu.c (set_frame_menubar):
9738 Use ptrdiff_t, not int, for consistency with rest of code.
9739 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
9740 (select_window, Fdelete_other_windows_internal)
9741 (window_scroll_pixel_based, window_scroll_line_based)
9742 (Frecenter, Fset_window_configuration):
9743 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9744 (Fset_window_hscroll, run_window_configuration_change_hook)
9745 (set_window_buffer, temp_output_buffer_show, scroll_command)
9746 (Fscroll_other_window, Frecenter):
9747 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9748 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
9749 Don't assume fixnum fits in int.
9750 (Fset_window_scroll_bars):
9751 Check that fixnums are in proper range for system types.
9752 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
9753 (string_pos, c_string_pos, number_of_chars, init_iterator)
9754 (in_ellipses_for_invisible_text_p, init_from_display_pos)
9755 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
9756 (compute_display_string_end, handle_face_prop)
9757 (face_before_or_after_it_pos, handle_invisible_prop)
9758 (handle_display_prop, handle_display_spec, handle_single_display_spec)
9759 (display_prop_intangible_p, string_buffer_position_lim)
9760 (string_buffer_position, handle_composition_prop, load_overlay_strings)
9761 (get_overlay_strings_1, get_overlay_strings)
9762 (iterate_out_of_display_property, forward_to_next_line_start)
9763 (back_to_previous_visible_line_start, reseat, reseat_to_string)
9764 (get_next_display_element, set_iterator_to_next)
9765 (get_visually_first_element, compute_stop_pos_backwards)
9766 (handle_stop_backwards, next_element_from_buffer)
9767 (move_it_in_display_line_to, move_it_in_display_line)
9768 (move_it_to, move_it_vertically_backward, move_it_by_lines)
9769 (add_to_log, message_dolog, message_log_check_duplicate)
9770 (message2, message2_nolog, message3, message3_nolog
9771 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
9772 (current_message_1, truncate_echo_area, truncate_message_1)
9773 (set_message, set_message_1, store_mode_line_noprop)
9774 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
9775 (text_outside_line_unchanged_p, check_point_in_composition)
9776 (reconsider_clip_changes)
9777 (redisplay_internal, set_cursor_from_row, try_scrolling)
9778 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
9779 (redisplay_window, find_last_unchanged_at_beg_row)
9780 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
9781 (trailing_whitespace_p, find_row_edges, display_line)
9782 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
9783 (display_mode_element, store_mode_line_string)
9784 (pint2str, pint2hrstr, decode_mode_spec)
9785 (display_count_lines, display_string, draw_glyphs)
9786 (x_produce_glyphs, x_insert_glyphs)
9787 (rows_from_pos_range, mouse_face_from_buffer_pos)
9788 (fast_find_string_pos, mouse_face_from_string_pos)
9789 (note_mode_line_or_margin_highlight, note_mouse_highlight):
9790 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9791 (safe_call, init_from_display_pos, handle_fontified_prop)
9792 (handle_single_display_spec, load_overlay_strings)
9793 (with_echo_area_buffer, setup_echo_area_for_printing)
9794 (display_echo_area, echo_area_display)
9795 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
9796 (update_tool_bar, hscroll_window_tree, redisplay_internal)
9797 (redisplay_window, dump_glyph_row, display_mode_line)
9798 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
9799 (handle_display_spec, display_prop_string_p):
9800 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9801 (handle_single_display_spec, build_desired_tool_bar_string)
9802 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
9803 (get_specified_cursor_type):
9804 Check that fixnums are in proper range for system types.
9805 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
9806 (Flookup_image_map):
9807 Don't assume fixnums fit in int.
9808 (compare_overlay_entries):
9809 Avoid mishandling comparisons due to subtraction overflow.
9810 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
9811 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
9812 (handle_tool_bar_click):
9813 Use int, not unsigned, since we prefer signed and the signedness
9814 doesn't matter here.
9815 (get_next_display_element, next_element_from_display_vector):
9816 Use int, not EMACS_INT, when int is wide enough.
9817 (start_hourglass): Use duration_to_sec_usec to do proper
9818 overflow checking on durations.
9819 * xfaces.c (Fbitmap_spec_p):
9820 Check that fixnums are in proper range for system types.
9821 (compare_fonts_by_sort_order):
9822 Avoid mishandling comparisons due to subtraction overflow.
9823 (Fx_family_fonts, realize_basic_faces):
9824 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9825 (Fx_family_fonts):
9826 Don't assume fixnum fits in int.
9827 Use SAFE_ALLOCA_LISP, not alloca.
9828 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
9829 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
9830 (face_at_buffer_position, face_for_overlay_string)
9831 (face_at_string_position):
9832 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9833 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
9834 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
9835 (Fx_show_tip):
9836 Check that fixnums are in proper range for system types.
9837 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
9838 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
9839 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9840 (Fx_change_window_property): Don't assume fixnums fit in int.
9841 * xfont.c (xfont_chars_supported):
9842 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9843 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
9844 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
9845 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9846 * xml.c (parse_region):
9847 * xrdb.c (magic_file_p):
9848 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9849 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
9850 (x_get_local_selection, x_reply_selection_request)
9851 (x_handle_selection_request, wait_for_property_change):
9852 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9853 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
9854 short is wide enough.
9855 (x_send_client_event): Don't assume fixnum fits in int.
9856 * xterm.c (x_x_to_emacs_modifiers):
9857 Don't assume EMACS_INT overflows nicely into int.
9858 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
9859 may come from Lisp.
9860 (handle_one_xevent): NATNUMP can eval its arg twice.
9861 (x_connection_closed):
9862 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9863 * xterm.h: Adjust decls to match defn changes elsewhere.
9864 (struct scroll_bar): Use struct vectorlike_header
9865 rather than rolling our own approximation.
9866 (SCROLL_BAR_VEC_SIZE): Remove; not used.
9867
9868 2012-05-25 Glenn Morris <rgm@gnu.org>
9869
9870 * lisp.mk (lisp): Update for more files being compiled now.
9871
9872 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
9873
9874 * lread.c: Remove `read_pure' which makes no difference.
9875 (read_pure): Remove var.
9876 (unreadpure): Remove function.
9877 (readevalloop): Don't call read_list with -1 flag.
9878 (read1, read_vector): Don't test read_pure any more.
9879 (read_list): Simplify.
9880
9881 * fileio.c, character.h: Minor style tweaks.
9882
9883 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
9884
9885 * window.h (clip_changed): Remove useless declaration.
9886
9887 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
9888
9889 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
9890 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
9891
9892 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
9893
9894 Remove src/m/*.
9895 This directory predates autoconf and is no longer needed nowadays.
9896 Move its few remaining bits of functionality to where they're needed.
9897 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
9898 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
9899 * m/template.h: Remove.
9900 * Makefile.in (M_FILE): Remove. All uses removed.
9901 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
9902 * lisp.h (USE_LSB_TAG):
9903 * mem-limits.h (EXCEEDS_LISP_PTR):
9904 Use VAL_MAX, not VALBITS, in #if.
9905 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
9906 (EMACS_UINT): Define unconditionally now.
9907 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
9908 (BITS_PER_EMACS_INT): New constants, replacing
9909 what used to be in config.h, but not useful in #if.
9910 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
9911 define them any more.
9912 (VAL_MAX): New macro.
9913 (VALMASK): Use it.
9914 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
9915 BITS_PER_EMACS_INT, in #if.
9916 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
9917 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
9918 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
9919 * s/ms-w32.h (DATA_START):
9920 Move here from removed file m/intel386.h.
9921 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
9922 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
9923
9924 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
9925
9926 Assume C89 or later.
9927 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
9928 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
9929 (xrealloc):
9930 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
9931 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
9932 * textprop.c, tparam.c (NULL): Remove.
9933 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
9934 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
9935 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
9936 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
9937 * xterm.c (input_signal_count): Assume volatile works.
9938
9939 2012-05-21 Ken Brown <kbrown@cornell.edu>
9940
9941 * xgselect.c (xg_select): Fix first argument in call to 'select'
9942 (bug#11508).
9943
9944 2012-05-20 Ken Brown <kbrown@cornell.edu>
9945
9946 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
9947 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
9948
9949 2012-05-19 Ken Brown <kbrown@cornell.edu>
9950
9951 * xfns.c (x_in_use): Remove `static' qualifier.
9952 * xterm.h (x_in_use): Declare.
9953 * xgselect.c: Include xterm.h.
9954 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
9955 and `display_arg' (bug#9754).
9956
9957 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
9958
9959 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
9960
9961 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
9962 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
9963
9964 2012-05-18 Eli Zaretskii <eliz@gnu.org>
9965
9966 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
9967
9968 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
9969 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
9970
9971 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
9972 reference to image_cache->refcount.
9973 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
9974
9975 2012-05-17 Juri Linkov <juri@jurta.org>
9976
9977 * search.c (Fword_search_regexp, Fword_search_backward)
9978 (Fword_search_forward, Fword_search_backward_lax)
9979 (Fword_search_forward_lax): Move functions to isearch.el
9980 (bug#10145, bug#11381).
9981
9982 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
9983
9984 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
9985
9986 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
9987
9988 * lread.c (init_obarray): Declare Qt and Qnil as special.
9989
9990 2012-05-14 Glenn Morris <rgm@gnu.org>
9991
9992 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
9993 Put "libexec" before "bin", for the sake of init_callproc_1.
9994
9995 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9996
9997 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
9998
9999 * unexaix.c: Port to more-recent AIX compilers.
10000 (report_error, report_error_1, make_hdr, copy_sym)
10001 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
10002 Make arguments const char *, not char *, to avoid violations of C
10003 standard and to fix some AIX warnings reported by Gilles Pion.
10004
10005 2012-05-14 Eli Zaretskii <eliz@gnu.org>
10006
10007 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
10008 already have overlays loaded.
10009 (handle_single_display_spec): Before returning without displaying
10010 fringe bitmap, synchronize the bidi iterator with the main display
10011 iterator, by calling iterate_out_of_display_property.
10012 (iterate_out_of_display_property): Detect buffer iteration by
10013 testing that it->string is a Lisp string.
10014 (get_next_display_element): When the current object is exhausted,
10015 and there's something on it->stack, call set_iterator_to_next to
10016 proceed with what's on the stack, instead of returning zero.
10017 (set_iterator_to_next): If called at the end of a Lisp string,
10018 proceed to consider_string_end without incrementing string
10019 position. Don't increment display vector index past the end of
10020 the display vector. (Bug#11417)
10021 (pos_visible_p): Don't report a position visible when move_it_to
10022 stopped at the last line of window, which happens to be scanned
10023 backwards by the bidi iteration. (Bug#11464)
10024
10025 2012-05-14 Eli Zaretskii <eliz@gnu.org>
10026
10027 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
10028 and right-margin display specs even if the spec is invalid or we
10029 are on a TTY, and thus unable to display on the fringes.
10030 That's because the text with the property will not be displayed anyway,
10031 so we need to signal to the caller that this is a "replacing"
10032 display spec. This fixes display when the spec is invalid or we
10033 are on a TTY.
10034
10035 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
10036
10037 * unexaix.c (make_hdr): Fix typo in prototype.
10038 This bug broke the build on AIX. Problem reported by Gilles Pion.
10039
10040 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
10041
10042 * keyboard.c (kbd_buffer_get_event): Read special events also in
10043 batch mode. (Bug#11415)
10044
10045 2012-05-12 Glenn Morris <rgm@gnu.org>
10046
10047 * ns.mk: Update for ns_appbindir no longer having trailing "/".
10048
10049 2012-05-12 Eli Zaretskii <eliz@gnu.org>
10050
10051 * lisp.mk (lisp): Add newcomment.elc.
10052
10053 2012-05-12 Glenn Morris <rgm@gnu.org>
10054
10055 * Makefile.in (MKDIR_P): New, set by configure.
10056 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
10057
10058 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
10059
10060 Remove unused function hourglass_started.
10061 * dispextern.h (hourglass_started):
10062 * w32fns.c (hourglass_started):
10063 * xdisp.c (hourglass_started): Remove.
10064
10065 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
10066
10067 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
10068 Update dependencies.
10069
10070 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
10071
10072 * xgselect.c (xg_select): Put maxfds+1 into a var.
10073 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
10074
10075 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
10076
10077 2012-05-10 Dave Abrahams <dave@boostpro.com>
10078
10079 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
10080 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
10081
10082 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
10083
10084 * dbusbind.c (xd_registered_buses): New internal Lisp object.
10085 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
10086 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
10087 Initialize xd_registered_buses.
10088
10089 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
10090
10091 Untag more efficiently if USE_LSB_TAG.
10092 This is based on a proposal by YAMAMOTO Mitsuharu in
10093 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
10094 For an admittedly artificial (nth 8000 longlist) benchmark on
10095 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
10096 Emacs's overall text size by 1%.
10097 * lisp.h (XUNTAG): New macro.
10098 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
10099 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
10100 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
10101 * eval.c (Fautoload):
10102 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
10103 * frame.h (XFRAME): Use XUNTAG.
10104
10105 Port recent dbusbind.c changes to 32-bit --with-wide-int.
10106 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
10107 Remove unportable assumptions about print widths of types like
10108 dbus_uint32_t.
10109 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
10110 intptr_t when converting between pointer and integer, to avoid GCC
10111 warnings about wrong width.
10112
10113 2012-05-09 Eli Zaretskii <eliz@gnu.org>
10114
10115 * w32proc.c (new_child): Force Windows to reserve only 64KB of
10116 stack for each reader_thread, instead of defaulting to 8MB
10117 determined by the linker. This avoids failures in creating
10118 subprocesses on Windows 7, see the discussion in this thread:
10119 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
10120
10121 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
10122
10123 Fix up display of the *Minibuf-0* buffer in the mini window.
10124 * keyboard.c (read_char): Don't clear the echo area if there's no
10125 message to clear.
10126 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
10127 contents of *Minibuf-0*) if there's no message displayed in its stead.
10128
10129 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
10130
10131 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
10132 batch mode.
10133
10134 2012-05-06 Chong Yidong <cyd@gnu.org>
10135
10136 * lisp.mk (lisp): Update.
10137
10138 2012-05-05 Jim Meyering <meyering@redhat.com>
10139
10140 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
10141
10142 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
10143
10144 * data.c (PUT_ERROR): New macro.
10145 (syms_of_data): Use it. Add new error type `user-error'.
10146 * undo.c (user_error): New function.
10147 (Fprimitive_undo): Use it.
10148 * print.c (print_error_message): Adjust print style for `user-error'.
10149 * keyboard.c (user_error): New function.
10150 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
10151
10152 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
10153
10154 Do not limit current-time-string to years 1000..9999.
10155 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
10156 (Fcurrent_time_string): Support any year that is supported by the
10157 underlying localtime representation. Don't use asctime, as it
10158 has undefined behavior for years outside the range -999..9999.
10159
10160 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
10161
10162 Fix race conditions involving setenv, gmtime, localtime, asctime.
10163 Without this fix, interrupts could mess up code that uses these
10164 nonreentrant functions, since setting TZ invalidates existing
10165 tm_zone or tzname values, and since most of these functions return
10166 pointers to static storage.
10167 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
10168 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
10169 Grow the critical sections to include not just invoking
10170 localtime/gmtime, but also accessing these functions' results
10171 including their tm_zone values if any, and any related TZ setting.
10172 (format_time_string): Last arg is now struct tm *, not struct tm **,
10173 so that the struct tm is saved in the critical section.
10174 All callers changed. Simplify allocation of initial buffer, partly
10175 motivated by the fact that memory allocation needs to be outside
10176 the critical section.
10177
10178 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
10179
10180 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
10181 with RESET_INTERVAL.
10182
10183 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
10184 Remove duplicated buffer name initialization.
10185
10186 2012-05-02 Jim Meyering <jim@meyering.net>
10187
10188 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
10189
10190 * xfns.c (x_window): Use xstrdup (Bug#11375).
10191
10192 2012-05-02 Eli Zaretskii <eliz@gnu.org>
10193
10194 * xdisp.c (pos_visible_p): If already at a newline from the
10195 display string before the 'while' loop, don't walk back the glyphs
10196 from it3.glyph_row. Solves assertion violation when the display
10197 string begins with a newline (egg.el). (Bug#11367)
10198
10199 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
10200
10201 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
10202 Move to simple.el.
10203
10204 2012-05-01 Glenn Morris <rgm@gnu.org>
10205
10206 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
10207 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
10208 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
10209 All were removed before 23.1.
10210
10211 * dispnew.c: Remove HAVE_LIBNCURSES test;
10212 it is always true on relevant platforms.
10213
10214 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
10215 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
10216
10217 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
10218
10219 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
10220
10221 * .gdbinit (xpr): Remove checks for no longer existing misc types.
10222 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
10223 Remove.
10224
10225 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
10226
10227 Do not avoid creating empty evaporating overlays (Bug#9642).
10228 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
10229 That is, do not delete an evaporating overlay if it becomes
10230 empty after its bounds are adjusted to fit within its buffer.
10231 This fix caused other problems, and I'm reverting it until we get
10232 to the bottom of them.
10233
10234 2012-04-27 Chong Yidong <cyd@gnu.org>
10235
10236 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
10237
10238 2012-04-27 Eli Zaretskii <eliz@gnu.org>
10239
10240 * xdisp.c (pos_visible_p): If the window start position is beyond
10241 ZV, start the display from buffer beginning. Prevents assertion
10242 violation in init_iterator when the minibuffer window is scrolled
10243 via the scroll bar.
10244
10245 * window.c (window_scroll_pixel_based): Likewise.
10246
10247 2012-04-27 Chong Yidong <cyd@gnu.org>
10248
10249 * keymap.c (where_is_internal): Doc fix (Bug#10872).
10250
10251 2012-04-27 Glenn Morris <rgm@gnu.org>
10252
10253 * fileio.c (Fcopy_file, Fset_file_selinux_context):
10254 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
10255
10256 2012-04-27 Eli Zaretskii <eliz@gnu.org>
10257
10258 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
10259 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
10260
10261 2012-04-26 Eli Zaretskii <eliz@gnu.org>
10262
10263 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
10264 display element, check also the underlying string or buffer
10265 character. (Bug#11341)
10266
10267 * w32menu.c: Include w32heap.h.
10268 (add_menu_item): If the call to AppendMenuW (via
10269 unicode_append_menu) fails, disable Unicode menus only if we are
10270 running on Windows 9X/Me.
10271
10272 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
10273
10274 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
10275 (xgetint): Add missing shift for LSB tags.
10276
10277 2012-04-24 Martin Rudalics <rudalics@gmx.at>
10278
10279 * keyboard.c (read_char): Don't wipe echo area for select window
10280 events: These might get delayed via `mouse-autoselect-window'
10281 (Bug#11304).
10282
10283 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
10284
10285 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
10286 manipulation of :loaded-from data.
10287
10288 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
10289
10290 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
10291 now a cons (bug#11311).
10292
10293 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
10294
10295 Do not create empty overlays with the evaporate property (Bug#9642).
10296 * buffer.c (Fmove_overlay): Delete an evaporating overlay
10297 if it becomes empty after its bounds are adjusted to fit within
10298 its buffer. Without this fix, in a nonempty buffer (let ((o
10299 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
10300 yields an empty overlay that has the evaporate property, which is
10301 not supposed to happen.
10302
10303 Fix minor GTK3 problems found by static checking.
10304 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
10305 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
10306 (struct _EmacsFixedClass, emacs_fixed_get_type):
10307 Move decls here from emacsgtkfixed.h, since they needn't be public.
10308 (emacs_fixed_get_type): Now static.
10309 (emacs_fixed_class_init): Omit unused local.
10310 (emacs_fixed_child_type): Remove; unused.
10311 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
10312 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
10313 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
10314 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
10315 (EMACS_FIXED_GET_CLASS): Remove; unused.
10316 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
10317
10318 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
10319 Problem reported by Juanma Barranquero for Windows -Wunused-function.
10320
10321 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
10322
10323 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
10324 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
10325 (__malloc_size_t, __malloc_ptrdiff_t):
10326 Remove. All uses removed, replaced by the definiens if needed,
10327 since we can assume C89 or better now.
10328 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
10329 (protect_malloc_state, align, get_contiguous_space)
10330 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
10331 (malloc_atfork_handler_child, malloc_enable_thread)
10332 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
10333 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
10334 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
10335 (special_realloc, _realloc_internal_nolock, _realloc_internal)
10336 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
10337 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
10338 Define using prototypes, not old style.
10339 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
10340 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
10341 (align): Don't assume that signed integer overflow wraps around.
10342 Omit unused local var.
10343 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
10344 (_free_internal_nolock, memalign, mallochook, reallochook):
10345 Omit no-longer-needed casts.
10346 (valloc): Use getpagesize, not __getpagesize.
10347 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
10348 (struct hdr): The 'magic' member is now size_t, not unsigned long.
10349
10350 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
10351
10352 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
10353
10354 Move functions from C to Lisp. Make non-blocking method calls
10355 the default. Implement further D-Bus standard interfaces.
10356
10357 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
10358 (QCdbus_request_name_allow_replacement)
10359 (QCdbus_request_name_replace_existing)
10360 (QCdbus_request_name_do_not_queue)
10361 (QCdbus_request_name_reply_primary_owner)
10362 (QCdbus_request_name_reply_in_queue)
10363 (QCdbus_request_name_reply_exists)
10364 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
10365 (QCdbus_registered_serial, QCdbus_registered_method)
10366 (QCdbus_registered_signal): New Lisp objects.
10367 (XD_DEBUG_MESSAGE): Use sizeof.
10368 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
10369 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
10370 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
10371 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
10372 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
10373 (xd_signature, xd_append_arg): Allow float for integer types.
10374 (xd_get_connection_references): New function.
10375 (xd_get_connection_address): Rename from xd_initialize.
10376 Return cached address.
10377 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
10378 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
10379 level.
10380 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
10381 Return number of refcounts.
10382 (Fdbus_get_unique_name): Make stronger parameter check.
10383 (Fdbus_message_internal): New defun.
10384 (Fdbus_call_method, Fdbus_call_method_asynchronously)
10385 (Fdbus_method_return_internal, Fdbus_method_error_internal)
10386 (Fdbus_send_signal, Fdbus_register_service)
10387 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
10388 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
10389 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
10390 (Vdbus_compiled_version, Vdbus_runtime_version)
10391 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
10392 (Vdbus_message_type_method_return, Vdbus_message_type_error)
10393 (Vdbus_message_type_signal): New defvars.
10394 (Vdbus_registered_buses, Vdbus_registered_objects_table):
10395 Adapt docstring.
10396
10397 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
10398
10399 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
10400 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
10401 Do not assume ptrdiff_t is the same width as 'int'.
10402
10403 * alloc.c: Handle unusual debugging option combinations.
10404 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
10405 since the two debugging options are incompatible.
10406 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
10407 is defined.
10408 (mem_init, mem_insert, mem_insert_fixup):
10409 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
10410 (NEED_MEM_INSERT): Remove; no longer needed.
10411
10412 2012-04-22 Leo Liu <sdl.web@gmail.com>
10413
10414 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
10415
10416 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
10417
10418 * sysdep.c [__FreeBSD__]: Minor cleanups.
10419 (list_system_processes, system_process_attributes) [__FreeBSD__]:
10420 Use Emacs indenting style more consistently. Avoid some casts.
10421 Use 'double' consistently rather than mixing 'float' and 'double'.
10422
10423 2012-04-21 Eduard Wiebe <usenet@pusto.de>
10424
10425 * sysdep.c (list_system_processes, system_process_attributes):
10426 Add implementation for FreeBSD (Bug#5243).
10427
10428 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
10429
10430 * lisp.mk (lisp): Update.
10431
10432 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
10433
10434 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
10435 It is never used otherwise.
10436
10437 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
10438
10439 * print.c (print_preprocess): Only check print_depth if print-circle
10440 is nil.
10441 (print_object): Check for cycles even when print-circle is nil and
10442 print-gensym is t, but only check print_depth if print-circle is nil.
10443
10444 2012-04-20 Chong Yidong <cyd@gnu.org>
10445
10446 * process.c (wait_reading_process_output): If EIO occurs on a pty,
10447 set the status to "failed" and ensure that sentinel is run.
10448
10449 2012-04-20 Glenn Morris <rgm@gnu.org>
10450
10451 * process.c (Fset_process_inherit_coding_system_flag)
10452 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
10453 (Fmake_network_process, Fmake_serial_process): Doc fix.
10454
10455 2012-04-20 Eli Zaretskii <eliz@gnu.org>
10456
10457 * xdisp.c (string_buffer_position_lim): Limit starting position to
10458 BEGV.
10459 (set_cursor_from_row): If called for a mode-line or header-line
10460 row, return zero immediately.
10461 (try_cursor_movement): If inside continuation line, don't back up
10462 farther than the first row after the header line, if any.
10463 Don't consider the header-line row as "partially visible", even if
10464 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
10465
10466 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
10467
10468 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
10469 (bug#11238).
10470
10471 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
10472 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
10473
10474 configure: new option --enable-gcc-warnings (Bug#11207)
10475 * Makefile.in (C_WARNINGS_SWITCH): Remove.
10476 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
10477 (ALL_CFLAGS): Use new macros rather than old.
10478 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
10479 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
10480 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
10481 -Wunused-result, -Wunused-variable. This should go away once
10482 the Emacs and Gnulib regex code is merged.
10483 (xmalloc, xrealloc): Now static.
10484
10485 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
10486
10487 * dired.c (Fsystem_groups): Remove unused local.
10488
10489 2012-04-17 Glenn Morris <rgm@gnu.org>
10490
10491 * dired.c (Fsystem_users): Doc fix.
10492
10493 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
10494
10495 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
10496 (syms_of_dired): Add them.
10497
10498 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
10499
10500 Fix minor alloc.c problems found by static checking.
10501 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
10502 New extern decls, to avoid calling undeclared functions.
10503 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
10504 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
10505 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
10506 (NEED_MEM_INSERT): New macro.
10507 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
10508 Remove one incorrect comment and fix another.
10509
10510 Fix minor ralloc.c problems found by static checking.
10511 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
10512 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
10513 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
10514 (r_alloc_sbrk): Now static.
10515
10516 Improve ralloc.c interface checking.
10517 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
10518 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
10519 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
10520 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
10521 [REL_ALLOC]: ... to here, to check interface.
10522 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
10523 Remove decls. This fixes an "It stinks!".
10524
10525 * alloc.c (which_symbols): Fix alignment issue / type clash.
10526
10527 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
10528
10529 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
10530 (struct Lisp_Misc_Any): Likewise.
10531 (struct Lisp_Free): Likewise.
10532 * alloc.c (union aligned_Lisp_Symbol): Define.
10533 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
10534 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
10535 (union aligned_Lisp_Misc): Define.
10536 (MARKER_BLOCK_SIZE, struct marker_block): Use union
10537 aligned_Lisp_Misc instead of union Lisp_Misc.
10538 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
10539
10540 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
10541
10542 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
10543 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
10544 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
10545 * s/netbsd.h, s/sol2-6.h:
10546 Remove definition of GC_MARK_STACK, since the default now works.
10547 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
10548 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
10549 no longer the default.
10550 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
10551
10552 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
10553
10554 * lread.c (lisp_file_lexically_bound_p):
10555 Fix hang at ";-*-\n" (bug#11238).
10556
10557 2012-04-14 Eli Zaretskii <eliz@gnu.org>
10558
10559 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
10560 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
10561
10562 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
10563
10564 * nsterm.m (constrainFrameRect): Always constrain when there is only
10565 one screen (Bug#10962).
10566
10567 2012-04-13 Ken Brown <kbrown@cornell.edu>
10568
10569 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
10570
10571 2012-04-13 Reuben Thomas <rrt@sc3d.org>
10572
10573 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
10574
10575 2012-04-11 Daniel Colascione <dancol@dancol.org>
10576
10577 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
10578 against is gone. It's better to use vfork now so that when Cygwin
10579 gains a new, working vfork, we use it automatically (bug#10398).
10580
10581 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
10582
10583 * window.c (save_window_save): Obey window-point-insertion-type.
10584
10585 2012-04-11 Glenn Morris <rgm@gnu.org>
10586
10587 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
10588
10589 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
10590
10591 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
10592
10593 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
10594
10595 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
10596 (force_quit_count): New var.
10597 (handle_interrupt): Use it.
10598
10599 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
10600
10601 * w32.c (w32_delayed_load): Record the full path of the library
10602 being loaded (bug#10424).
10603
10604 2012-04-09 Glenn Morris <rgm@gnu.org>
10605
10606 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
10607 not just in the obarray, before snarfing them. (Bug#11036)
10608
10609 * Makefile.in ($(leimdir)/leim-list.el):
10610 Pass EMACS rather than BUILT_EMACS.
10611
10612 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
10613
10614 * process.c (make_process):
10615 * process.h: Add integer `gnutls_handshakes_tried' member to
10616 process struct.
10617
10618 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
10619 Add convenience `GNUTLS_LOG2i' macro.
10620
10621 * gnutls.c (gnutls_log_function2i): Convenience log function.
10622 (emacs_gnutls_read): Use new log functions,
10623 `gnutls_handshakes_tried' process member, and
10624 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
10625 attempts per process (connection).
10626
10627 2012-04-09 Chong Yidong <cyd@gnu.org>
10628
10629 * eval.c (Fuser_variable_p, user_variable_p_eh)
10630 (lisp_indirect_variable): Functions deleted.
10631 (Fdefvar): Caller changed.
10632
10633 * callint.c (Finteractive, Fcall_interactively):
10634 * minibuf.c (Fread_variable): Callers changed.
10635
10636 2012-04-09 Eli Zaretskii <eliz@gnu.org>
10637
10638 * xdisp.c (set_cursor_from_row): If the display string appears in
10639 the buffer at position that is closer to point than the position
10640 after the display string, display the cursor on the first glyph of
10641 the display string. Fixes cursor display when a 'display' text
10642 property immediately follows invisible text. (Bug#11094)
10643
10644 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
10645
10646 composite.c: use 'double' consistently
10647 * composite.c (get_composition_id): Use 'double' consistently
10648 instead of converting 'float' to 'double' and vice versa; this is
10649 easier to understand and avoids a GCC warning.
10650
10651 2012-04-09 Glenn Morris <rgm@gnu.org>
10652
10653 * Makefile.in: Generate leim-list with bootstrap-emacs, in
10654 preparation for dumping it with emacs. (Bug#4789)
10655 (leimdir): New variable.
10656 ($(leimdir)/leim-list.el): New rule.
10657 (emacs$(EXEEXT)): Depend on leim-list.el.
10658
10659 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
10660 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
10661 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
10662
10663 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
10664
10665 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
10666 proper alignment.
10667
10668 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
10669
10670 * xml.c (init_libxml2_functions) [WINDOWSNT]:
10671 Remove unused local variable.
10672
10673 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
10674
10675 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
10676 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
10677 (mark_memory): Mark Lisp_Objects only if pointers might hide in
10678 objects, as mark_maybe_pointer will catch them otherwise.
10679 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
10680 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
10681
10682 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
10683
10684 Fix typo that broke non-Windows builds.
10685 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
10686
10687 2012-04-07 Eli Zaretskii <eliz@gnu.org>
10688
10689 Support building on MS-Windows with libxml2.
10690
10691 * makefile.w32-in (OBJ2): Add xml.$(O).
10692 (GLOBAL_SOURCES): Add xml.c.
10693 ($(BLD)/xml.$(O)): New dependency list.
10694
10695 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
10696 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
10697 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
10698 [!WINDOWSNT]: New macros.
10699 (init_libxml2_functions, libxml2_loaded_p): New functions.
10700 (parse_region): Call fn_xmlCheckVersion instead of using the macro
10701 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
10702 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
10703 Calls xmlCleanupParser only if libxml2 was loaded (or statically
10704 linked in).
10705 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
10706 Call init_libxml2_functions before calling libxml2 functions.
10707 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
10708
10709 * emacs.c: Don't include libxml/parser.h.
10710 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
10711 xmlCleanupParser directly.
10712
10713 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
10714
10715 2012-04-07 Eli Zaretskii <eliz@gnu.org>
10716
10717 * indent.c (Fvertical_motion): If there is a display string at
10718 point, use it.vpos to compute how many lines to backtrack after
10719 move_it_to point. (Bug#11133)
10720
10721 2012-04-06 Eli Zaretskii <eliz@gnu.org>
10722
10723 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
10724 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
10725 about subtle differences between FETCH_CHAR* and STRING_CHAR*
10726 macros related to unification of CJK characters. For the details,
10727 see the discussion following the message here:
10728 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
10729
10730 2012-04-04 Chong Yidong <cyd@gnu.org>
10731
10732 * keyboard.c (Vdelayed_warnings_list): Doc fix.
10733
10734 2012-04-01 Eli Zaretskii <eliz@gnu.org>
10735
10736 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
10737 instead of alloca. (Bug#11138)
10738
10739 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
10740
10741 * w32menu.c (is_simple_dialog): Properly check lisp types.
10742 (Bug#11141)
10743
10744 2012-03-31 Eli Zaretskii <eliz@gnu.org>
10745
10746 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
10747 position we get to after a call to move_it_to fails the
10748 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
10749 only if we wind up in a string from display property. (Bug#11063)
10750
10751 * window.c (Fdelete_other_windows_internal): Invalidate the row
10752 and column information about mouse highlight, so that redisplay
10753 restores it after reallocating the glyph matrices. (Bug#7464)
10754
10755 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
10756 string comes from a `display' text property, use the buffer
10757 position of that property as if we actually saw that position in
10758 the row's glyphs.
10759 (move_it_by_lines): Remove the assertion that
10760 "it->current_x == 0 && it->hpos == 0" which can be legitimately
10761 violated when there's a before-string at the beginning of a line.
10762 (Bug#11063)
10763
10764 2012-03-30 Eli Zaretskii <eliz@gnu.org>
10765
10766 * xdisp.c (append_space_for_newline): If the default face was
10767 remapped, use the remapped face for the appended newline.
10768 (extend_face_to_end_of_line): Use the remapped default face for
10769 extending the face to the end of the line.
10770 (display_line): Call extend_face_to_end_of_line when the default
10771 face was remapped. (Bug#11068)
10772
10773 2012-03-29 Eli Zaretskii <eliz@gnu.org>
10774
10775 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
10776
10777 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
10778
10779 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
10780
10781 2012-03-27 Glenn Morris <rgm@gnu.org>
10782
10783 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
10784 Doc fixes.
10785
10786 2012-03-26 Kenichi Handa <handa@m17n.org>
10787
10788 * dispextern.h (struct glyph): Fix previous change. Change the
10789 bit length of glyphless.ch to 25 (Bug#11082).
10790
10791 2012-03-26 Chong Yidong <cyd@gnu.org>
10792
10793 * keyboard.c (Vselection_inhibit_update_commands): New variable.
10794 (command_loop_1): Use it; inhibit selection update for
10795 handle-select-window too (Bug#8996).
10796
10797 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
10798
10799 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
10800
10801 2012-03-25 Kenichi Handa <handa@m17n.org>
10802
10803 * dispextern.h (struct glyph): Change the bit length of
10804 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
10805
10806 2012-03-24 Eli Zaretskii <eliz@gnu.org>
10807
10808 * s/ms-w32.h (tzname): Include time.h before redirecting to
10809 _tzname. Fixes the MSVC build. (Bug#9960)
10810
10811 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
10812
10813 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
10814 characters.
10815
10816 * xterm.c (XTread_socket): Only modify handling_signal if
10817 !SYNC_INPUT. (Bug#11080)
10818
10819 2012-03-23 Eli Zaretskii <eliz@gnu.org>
10820
10821 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
10822 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
10823 when fetching a multibyte character consumes more bytes than
10824 CHAR_BYTES returns, due to unification of CJK characters in
10825 string_char. (Bug#11073)
10826
10827 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
10828
10829 * process.c (wait_reading_process_output): Handle pty disconnect
10830 by refraining from sending oneself a SIGCHLD (bug#10933).
10831
10832 2012-03-22 Chong Yidong <cyd@gnu.org>
10833
10834 * dispextern.h (struct it): New member string_from_prefix_prop_p.
10835
10836 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
10837 Mark string as coming from a prefix property.
10838 (handle_face_prop): Use default face for prefix strings (Bug#4281).
10839 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
10840
10841 2012-03-21 Chong Yidong <cyd@gnu.org>
10842
10843 * xfaces.c (Vface_remapping_alist): Doc fix.
10844
10845 2012-03-20 Eli Zaretskii <eliz@gnu.org>
10846
10847 * w32proc.c (Fw32_set_console_codepage)
10848 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
10849 Doc fixes.
10850
10851 2012-03-20 Chong Yidong <cyd@gnu.org>
10852
10853 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
10854 to reflect default non-nil value of redisplay-dont-pause.
10855
10856 2012-03-19 Kenichi Handa <handa@m17n.org>
10857
10858 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
10859 it fit in a valid range (Bug#11003).
10860
10861 2012-03-18 Eli Zaretskii <eliz@gnu.org>
10862
10863 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
10864 that is not from display property, accept the row as a "cursor
10865 row" if one of the string's character has a non-nil `cursor'
10866 property. Fixes cursor positioning when there are newlines in
10867 overlay strings, e.g. in icomplete.el. (Bug#11035)
10868
10869 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
10870
10871 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
10872
10873 2012-03-12 Chong Yidong <cyd@gnu.org>
10874
10875 * eval.c (inhibit_lisp_code): Rename from
10876 inhibit_window_configuration_change_hook; move from window.c.
10877
10878 * xfns.c (unwind_create_frame_1, Fx_create_frame):
10879 * window.c (run_window_configuration_change_hook)
10880 (syms_of_window): Callers changed.
10881
10882 2012-03-11 Chong Yidong <cyd@gnu.org>
10883
10884 * keymap.c (Fkey_description): Doc fix (Bug#9700).
10885
10886 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
10887
10888 2012-03-10 Chong Yidong <cyd@gnu.org>
10889
10890 * frame.c (other_visible_frames): Don't assume the selected frame
10891 is visible (Bug#10955).
10892
10893 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
10894
10895 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
10896
10897 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
10898
10899 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
10900 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
10901 zero (Bug#10954).
10902
10903 2012-03-03 Glenn Morris <rgm@gnu.org>
10904
10905 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
10906
10907 2012-03-02 Eli Zaretskii <eliz@gnu.org>
10908
10909 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
10910 position past the first glyph_row that ends at ZV. (Bug#10902)
10911 (redisplay_window, next_element_from_string): Fix typos in
10912 comments.
10913 (redisplay_window): Pass to move_it_vertically the margin in
10914 pixels, not in screen lines.
10915
10916 2012-03-02 Glenn Morris <rgm@gnu.org>
10917
10918 * buffer.c (buffer-list-update-hook): Doc fix.
10919
10920 2012-02-29 Eli Zaretskii <eliz@gnu.org>
10921
10922 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
10923 push_it before setting up the iterator for the first overlay
10924 string, even if we have an empty string loaded.
10925 (next_overlay_string): If there's an empty string on the iterator
10926 stack, pop the stack. (Bug#10903)
10927
10928 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
10929
10930 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
10931 Suggested by Stefan Monnier in
10932 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
10933 * alloc.c (widen_to_Lisp_Object): New static function.
10934 (mark_memory): Also mark Lisp_Objects by fetching pointer words
10935 and widening them to Lisp_Objects. This would work even if
10936 USE_LSB_TAG is defined and wide integers are used, which might
10937 happen in a future version of Emacs.
10938
10939 2012-02-25 Chong Yidong <cyd@gnu.org>
10940
10941 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
10942 Doc fix.
10943
10944 * xselect.c (Fx_selection_exists_p): Doc fix.
10945 (x_clipboard_manager_save_all): Print an informative message
10946 before saving to clipboard manager.
10947
10948 2012-02-24 Chong Yidong <cyd@gnu.org>
10949
10950 * keyboard.c (process_special_events): Handle all X selection
10951 requests in kbd_buffer, not just the next one (Bug#8869).
10952
10953 2012-02-23 Chong Yidong <cyd@gnu.org>
10954
10955 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
10956 call when setting menu-bar-lines and tool-bar-lines parameters.
10957 (unwind_create_frame_1): New helper function.
10958
10959 * window.c (inhibit_window_configuration_change_hook): New var.
10960 (run_window_configuration_change_hook): Obey it.
10961 (syms_of_window): Initialize it.
10962
10963 2012-02-22 Chong Yidong <cyd@gnu.org>
10964
10965 * xterm.c (x_draw_image_relief): Add missing type check for
10966 Vtool_bar_button_margin (Bug#10743).
10967
10968 2012-02-21 Chong Yidong <cyd@gnu.org>
10969
10970 * fileio.c (Vfile_name_handler_alist): Doc fix.
10971
10972 * buffer.c (Fget_file_buffer): Protect against invalid file
10973 handler return value.
10974
10975 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
10976
10977 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
10978 when computing $valmask.
10979
10980 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
10981 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
10982 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
10983 It's useless in that case, and it can cause problems on hosts
10984 that allocate halves of EMACS_INT values separately.
10985 Reported by Dan Horák. Diagnosed by Andreas Schwab in
10986 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
10987 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
10988 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
10989 it avoids undefined behavior on hosts where shifting right by more
10990 than the word width has undefined behavior.
10991
10992 2012-02-19 Chong Yidong <cyd@gnu.org>
10993
10994 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
10995 (Funhandled_file_name_directory, Ffile_name_as_directory)
10996 (Fdirectory_file_name, Fexpand_file_name)
10997 (Fsubstitute_in_file_name): Protect against invalid file handler
10998 return values (Bug#10845).
10999
11000 2012-02-18 Eli Zaretskii <eliz@gnu.org>
11001
11002 * .gdbinit (pitx): Fix incorrect references to fields of the
11003 iterator stack.
11004
11005 2012-02-17 Chong Yidong <cyd@gnu.org>
11006
11007 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
11008
11009 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
11010
11011 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
11012 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
11013
11014 2012-02-15 Chong Yidong <cyd@gnu.org>
11015
11016 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
11017 marked as special. Also, starting docstrings with * is obsolete.
11018
11019 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
11020
11021 * gnutls.c (emacs_gnutls_write): Fix last change.
11022
11023 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
11024
11025 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
11026 send_process.
11027
11028 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
11029
11030 * keymap.c (Fsingle_key_description): Handle char ranges.
11031
11032 2012-02-12 Chong Yidong <cyd@gnu.org>
11033
11034 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
11035 as that creates a dangerous corner case.
11036
11037 * window.c (Fdelete_window_internal): Invalidate the mouse
11038 highlight (Bug#9904).
11039
11040 2012-02-12 Glenn Morris <rgm@gnu.org>
11041
11042 * xselect.c (Fx_own_selection_internal)
11043 (Fx_get_selection_internal, Fx_disown_selection_internal)
11044 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
11045 * nsselect.m (Fx_own_selection_internal)
11046 (Fx_disown_selection_internal, Fx_selection_exists_p)
11047 (Fx_selection_owner_p, Fx_get_selection_internal):
11048 Sync docs and argument specs with the xselect.c versions.
11049
11050 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
11051
11052 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
11053
11054 2012-02-11 Eli Zaretskii <eliz@gnu.org>
11055
11056 * w32select.c (Fx_selection_exists_p): Sync doc string and
11057 argument list with xselect.c. (Bug#10783)
11058
11059 * w16select.c (Fx_selection_exists_p): Sync doc string and
11060 argument list with xselect.c. (Bug#10783)
11061
11062 2012-02-10 Glenn Morris <rgm@gnu.org>
11063
11064 * fns.c (Fsecure_hash): Doc fix.
11065
11066 2012-02-09 Kenichi Handa <handa@m17n.org>
11067
11068 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
11069
11070 2012-02-07 Chong Yidong <cyd@gnu.org>
11071
11072 * buffer.c (Fbuffer_local_variables)
11073 (buffer_lisp_local_variables): Handle unbound vars correctly;
11074 don't let Qunbound leak into Lisp.
11075
11076 2012-02-07 Glenn Morris <rgm@gnu.org>
11077
11078 * image.c (Fimagemagick_types): Doc fix.
11079
11080 * image.c (imagemagick-render-type): Change it from a lisp object
11081 to an integer. Move the doc here from the lisp manual.
11082 Treat all values not equal to 0 the same.
11083
11084 2012-02-06 Chong Yidong <cyd@gnu.org>
11085
11086 * doc.c (store_function_docstring): Avoid applying docstring of
11087 alias to base function (Bug#2603).
11088
11089 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
11090
11091 * .gdbinit (pp1, pv1): Remove redundant defines.
11092 (pr): Use pp.
11093
11094 2012-02-04 Chong Yidong <cyd@gnu.org>
11095
11096 * nsterm.m: Declare a global (Bug#10694).
11097
11098 2012-02-04 Eli Zaretskii <eliz@gnu.org>
11099
11100 * w32.c (get_emacs_configuration_options):
11101 Include --enable-checking, if specified, in the return value.
11102
11103 2012-02-04 Martin Rudalics <rudalics@gmx.at>
11104
11105 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
11106 after rounding frame sizes. (Bug#9723)
11107
11108 2012-02-04 Eli Zaretskii <eliz@gnu.org>
11109
11110 * keyboard.c (adjust_point_for_property): Don't position point
11111 before BEGV. (Bug#10696)
11112
11113 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
11114
11115 Handle overflow when computing char display width (Bug#9496).
11116 * character.c (char_width): Return EMACS_INT, not int.
11117 (char_width, c_string_width): Check for overflow when
11118 computing the width; this is possible now that individual
11119 characters can have unbounded width. Problem introduced
11120 by merge from Emacs 23 on 2012-01-19.
11121
11122 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
11123
11124 * dbusbind.c (Fdbus_register_method): Mention the return value
11125 :ignore in the docstring.
11126
11127 2012-02-02 Glenn Morris <rgm@gnu.org>
11128
11129 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
11130
11131 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11132 Unconditionally set to t. (Bug#10673)
11133 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11134 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
11135 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
11136
11137 2012-02-02 Kenichi Handa <handa@m17n.org>
11138
11139 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
11140 0, do not call append_composite_glyph.
11141
11142 2012-02-02 Kenichi Handa <handa@m17n.org>
11143
11144 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
11145 NULL (Bug#6988).
11146 (x_produce_glyphs): If the component of a composition is a null
11147 string, set it->pixel_width to 1 to avoid zero-width glyph.
11148
11149 2012-02-01 Eli Zaretskii <eliz@gnu.org>
11150
11151 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
11152 first 2 arguments are identical. This makes inserting large
11153 output from a subprocess an order of magnitude faster on
11154 MS-Windows, where all sbrk'ed memory is always contiguous.
11155
11156 2012-01-31 Glenn Morris <rgm@gnu.org>
11157
11158 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11159 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
11160 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
11161
11162 2012-01-29 Glenn Morris <rgm@gnu.org>
11163
11164 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
11165
11166 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
11167
11168 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
11169
11170 2012-01-28 Chong Yidong <cyd@gnu.org>
11171
11172 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
11173
11174 2012-01-26 Chong Yidong <cyd@gnu.org>
11175
11176 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
11177
11178 * search.c (Fsearch_forward, Fsearch_backward): Document negative
11179 repeat counts (Bug#10507).
11180
11181 2012-01-26 Glenn Morris <rgm@gnu.org>
11182
11183 * lread.c (syms_of_lread): Doc fix.
11184
11185 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
11186
11187 * coding.c (encode_designation_at_bol): Change return value to
11188 EMACS_INT.
11189
11190 2012-01-25 Chong Yidong <cyd@gnu.org>
11191
11192 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
11193
11194 2012-01-21 Chong Yidong <cyd@gnu.org>
11195
11196 * floatfns.c (Fcopysign): Make the second argument non-optional,
11197 since nil is not allowed anyway.
11198
11199 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
11200
11201 * process.c (read_process_output): Use p instead of XPROCESS (proc).
11202 (send_process): Likewise.
11203
11204 2012-01-19 Martin Rudalics <rudalics@gmx.at>
11205
11206 * window.c (save_window_save, Fcurrent_window_configuration)
11207 (Vwindow_persistent_parameters): Do not use Qstate.
11208 Rewrite doc-strings.
11209
11210 2012-01-19 Kenichi Handa <handa@m17n.org>
11211
11212 * character.c (char_width): New function.
11213 (Fchar_width, c_string_width, lisp_string_width):
11214 Use char_width (Bug#9496).
11215
11216 2012-01-16 Martin Rudalics <rudalics@gmx.at>
11217
11218 * window.c (Vwindow_persistent_parameters): New variable.
11219 (Fset_window_configuration, save_window_save): Handle persistent
11220 window parameters.
11221
11222 2012-01-14 Eli Zaretskii <eliz@gnu.org>
11223
11224 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
11225 thrashing the stack of the thread. (Bug#9087)
11226
11227 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
11228
11229 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
11230
11231 2012-01-11 Eli Zaretskii <eliz@gnu.org>
11232
11233 * xdisp.c (rows_from_pos_range): Handle the case where the
11234 highlight ends on a newline. (Bug#10464)
11235 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
11236 he end column for display of highlight that ends on a newline
11237 before a R2L line.
11238
11239 2012-01-11 Glenn Morris <rgm@gnu.org>
11240
11241 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
11242 from load-path also when installation-directory is nil. (Bug#10208)
11243
11244 2012-01-10 Glenn Morris <rgm@gnu.org>
11245
11246 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
11247
11248 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
11249 Update template values to be closer to their typical values these days.
11250
11251 2012-01-09 Eli Zaretskii <eliz@gnu.org>
11252
11253 * xdisp.c (rows_from_pos_range): Accept additional argument
11254 DISP_STRING, and accept any glyph in a row whose object is that
11255 string as eligible for mouse highlight. Fixes mouse highlight of
11256 display strings from overlays. (Bug#10464)
11257
11258 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
11259
11260 emacs: fix an auto-save permissions race condition (Bug#10400)
11261 * fileio.c (auto_saving_dir_umask): New static var.
11262 (Fmake_directory_internal): Use it.
11263 (do_auto_save_make_dir): Set it, instead of invoking chmod after
11264 creating the directory. The old code temporarily assigns
11265 too-generous permissions to the directory.
11266 (do_auto_save_eh): Clear it.
11267 (Fdo_auto_save): Catch all errors, not just file errors, so
11268 that the var is always cleared.
11269
11270 2012-01-07 Eli Zaretskii <eliz@gnu.org>
11271
11272 * search.c (scan_buffer): Pass character positions to
11273 know_region_cache, not byte positions. (Bug#6540)
11274
11275 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
11276
11277 * w32.c (sys_rename): Report EXDEV when rename of a directory
11278 fails because the target is on another logical disk. (Bug#10284)
11279
11280 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
11281
11282 * xterm.c (x_embed_request_focus): New function.
11283
11284 * xterm.h: Add prototype.
11285
11286 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
11287
11288 2012-01-05 Glenn Morris <rgm@gnu.org>
11289
11290 * emacs.c (emacs_copyright): Update short copyright year to 2012.
11291
11292 2012-01-01 Eli Zaretskii <eliz@gnu.org>
11293
11294 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
11295 Load gnutls_transport_set_lowat only if GnuTLS version is below
11296 2.11.1.
11297 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
11298 GnuTLS versions below 2.11.1.
11299
11300 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
11301
11302 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
11303 to the doc string advising against its use for altering the way
11304 windows are scrolled.
11305
11306 2011-12-28 Kenichi Handa <handa@m17n.org>
11307
11308 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
11309 coding-system ASCII compatible only when it does not produce BOM
11310 on encoding (Bug#10383).
11311
11312 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
11313
11314 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
11315 can scroll.
11316 (create_and_show_popup_menu): Always use menu_position_func for
11317 Gtk3 (Bug#10361).
11318
11319 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
11320
11321 * callint.c (Fcall_interactively): Don't truncate prompt string.
11322
11323 2011-12-23 Eli Zaretskii <eliz@gnu.org>
11324
11325 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
11326 property that ends at ZV, so that the bidi iteration could be
11327 resumed from there (after widening). (Bug#10360)
11328
11329 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
11330
11331 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
11332
11333 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
11334
11335 * nsterm.m (x_free_frame_resources):
11336 Release f->output_data.ns->miniimage.
11337 (ns_index_color): Fix indentation. Do not retain
11338 color_table->colors[i].
11339
11340 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
11341 before returning.
11342
11343 * nsfns.m (x_set_background_color): Assign return value from
11344 ns_index_color to face-background instead of NSColor*.
11345 (ns_implicitly_set_icon_type): Fix indentation.
11346 Change assignment in for loop to comparison.
11347
11348 * emacs.c (ns_pool): New variable.
11349 (main): Assign ns_pool.
11350 (Fkill_emacs): Call ns_release_autorelease_pool.
11351
11352 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
11353 autorelease fdesc, release fdAttrs and tdict.
11354 (ns_get_covering_families): Release charset.
11355 (ns_findfonts): Release NSFontDescriptor created with new.
11356 (ns_uni_to_glyphs): Fix indentation.
11357 (setString): Release attrStr before assigning new value.
11358
11359 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
11360
11361 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
11362 and NS_IMPL_COCOA.
11363 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
11364 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
11365
11366 2011-12-18 David Reitter <reitter@cmu.edu>
11367
11368 * nsterm.m (ns_term_init): Subscribe for notifications
11369 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
11370 to method trackingNotification in EmacsMenu.
11371
11372 * nsmenu.m (trackingMenu): New variable.
11373 (trackingNotification): New method (from Aquamacs).
11374 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
11375 from Aquamacs (Bug#7030).
11376
11377 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
11378
11379 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
11380 (symbol_to_nsstring): Fix indentation.
11381 (ns_symbol_to_pb): New function.
11382 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
11383 (Fns_rotate_cut_buffers_internal): Remove.
11384 (Fns_store_selection_internal): Rename from
11385 Fns_store_cut_buffer_internal.
11386 (ns_get_foreign_selection, Fx_own_selection_internal)
11387 (Fx_disown_selection_internal, Fx_selection_exists_p)
11388 (Fns_get_selection_internal, Fns_store_selection_internal):
11389 Use ns_symbol_to_pb and check if return value is nil.
11390 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
11391 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
11392 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
11393 renamed to Sns_store_selection_internal.
11394 (ns_handle_selection_request): Move code to Fx_own_selection_internal
11395 and remove this function.
11396 (ns_handle_selection_clear): Remove, never used.
11397 (Fx_own_selection_internal): Move code from ns_handle_selection_request
11398 here.
11399
11400 2011-12-17 Ken Brown <kbrown@cornell.edu>
11401
11402 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
11403 GID is unknown (Bug#10257).
11404
11405 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
11406
11407 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
11408 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
11409 which caused a build failure on GNU/Linux IA-64. This problem was
11410 introduced by my 2011-10-07 patch.
11411
11412 2011-12-15 Juri Linkov <juri@jurta.org>
11413
11414 * image.c (imagemagick_error): New function. (Bug#10112)
11415 (imagemagick_load_image): Comment out `MagickSetResolution' call.
11416 Use `imagemagick_error' where ImageMagick functions return
11417 `MagickFalse'.
11418 (Fimagemagick_types): Add `Fnreverse' to return the list in the
11419 proper order.
11420
11421 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11422
11423 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
11424 fill background (Bug#8992).
11425
11426 2011-12-13 Martin Rudalics <rudalics@gmx.at>
11427
11428 * window.c (Vwindow_combination_resize)
11429 (Vwindow_combination_limit): Use t instead of non-nil in
11430 doc-strings.
11431 (Vrecenter_redisplay): Add first sentence of doc-string on
11432 separate line.
11433 (Frecenter): Fix doc-string typo.
11434
11435 2011-12-11 Kenichi Handa <handa@m17n.org>
11436
11437 * coding.c (Funencodable_char_position): Pay attention to the
11438 buffer text relocation (Bug#9389).
11439
11440 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
11441
11442 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
11443 gtk_init (Bug#10100).
11444
11445 2011-12-10 Eli Zaretskii <eliz@gnu.org>
11446
11447 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
11448 IT->string is nil. (Bug#10263)
11449
11450 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
11451
11452 * nsterm.h (x_free_frame_resources): Declare.
11453
11454 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
11455 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
11456
11457 * nsterm.h (ns_get_defaults_value): Declare.
11458
11459 * nsterm.m (ns_default): Call ns_get_defaults_value.
11460
11461 2011-12-09 Eli Zaretskii <eliz@gnu.org>
11462
11463 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
11464 (Bug#10170)
11465
11466 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11467
11468 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
11469 that where the value of an _OBJC_* symbol points to is in the .bss
11470 section (Bug#10240).
11471
11472 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
11473
11474 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
11475 after the loop to call ccl_driver at least once (Bug#8619).
11476
11477 2011-12-08 Kenichi Handa <handa@m17n.org>
11478
11479 * ftfont.c (get_adstyle_property): Fix previous change
11480 (Bug#10233).
11481
11482 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
11483
11484 * w32.c (init_environment): If no_site_lisp, remove site-lisp
11485 dirs from the default value of EMACSLOADPATH (bug#10208).
11486
11487 2011-12-07 Glenn Morris <rgm@gnu.org>
11488
11489 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
11490 installation and source directories as well. (Bug#10208)
11491
11492 2011-12-06 Chong Yidong <cyd@gnu.org>
11493
11494 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
11495
11496 2011-12-06 Glenn Morris <rgm@gnu.org>
11497
11498 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
11499 as an error, not just -1. (Bug#10217)
11500
11501 2011-12-05 Chong Yidong <cyd@gnu.org>
11502
11503 * keyboard.c (process_special_events): New function.
11504 (swallow_events, Finput_pending_p): Use it (Bug#10195).
11505
11506 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
11507
11508 * coding.c (encode_designation_at_bol): Don't use uninitialized
11509 local variable (Bug#9318).
11510
11511 2011-12-05 Kenichi Handa <handa@m17n.org>
11512
11513 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
11514 return Qnil (Bug#8046, Bug#10193).
11515
11516 2011-12-05 Kenichi Handa <handa@m17n.org>
11517
11518 * coding.c (encode_designation_at_bol): New args charbuf_end and
11519 dst. Return the number of produced bytes. Callers changed.
11520 (coding_set_source): Return how many bytes coding->source was
11521 relocated.
11522 (coding_set_destination): Return how many bytes
11523 coding->destination was relocated.
11524 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
11525 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
11526
11527 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
11528
11529 * coding.c (CODING_CHAR_CHARSET_P): New macro.
11530 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
11531 macro (Bug#9318).
11532
11533 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
11534
11535 The following changes are to fix Bug#9318.
11536
11537 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
11538 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
11539 (encode_coding_iso_2022, encode_coding_sjis)
11540 (encode_coding_big5, encode_coding_charset): Use the above macros.
11541
11542 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
11543
11544 * lisp.h (process_quit_flag): Fix external declaration.
11545
11546 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
11547
11548 Don't macro-inline non-performance-critical code.
11549 * eval.c (process_quit_flag): New function.
11550 * lisp.h (QUIT): Use it.
11551
11552 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
11553
11554 * nsfns.m (get_geometry_from_preferences): New function.
11555 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
11556
11557 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
11558
11559 * emacs.c (Qkill_emacs): Define.
11560 (syms_of_emacs): Initialize it.
11561 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
11562 Qquit_flag to `kill-emacs' instead.
11563 (quit_throw_to_read_char): Add parameter `from_signal'.
11564 All callers changed. Call Fkill_emacs if requested and safe.
11565 * lisp.h (QUIT): Call Fkill_emacs if requested.
11566
11567 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
11568
11569 * widget.c (update_wm_hints): Return if wmshell is null.
11570 (widget_update_wm_size_hints): New function.
11571
11572 * widget.h (widget_update_wm_size_hints): Declare.
11573
11574 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
11575 widget_update_wm_size_hints (Bug#10104).
11576
11577 2011-12-03 Eli Zaretskii <eliz@gnu.org>
11578
11579 * xdisp.c (handle_invisible_prop): If the invisible text ends just
11580 before a newline, prepare the bidi iterator for consuming the
11581 newline, and keep the current paragraph direction. (Bug#10183)
11582 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
11583
11584 2011-12-02 Juri Linkov <juri@jurta.org>
11585
11586 * search.c (Fword_search_regexp): New Lisp function created from
11587 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
11588 (Fword_search_backward, Fword_search_forward)
11589 (Fword_search_backward_lax, Fword_search_forward_lax):
11590 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
11591 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
11592
11593 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
11594
11595 * fileio.c (Finsert_file_contents): Move after-change-function call
11596 to before the "handled:" label, since all "goto handled" appear in
11597 cases where the *-change-functions have already been properly called
11598 (bug#10117).
11599
11600 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
11601
11602 * keyboard.c (interrupt_signal): Don't call kill-emacs when
11603 waiting for input. (Bug#10169)
11604
11605 2011-11-30 Eli Zaretskii <eliz@gnu.org>
11606
11607 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
11608 verifies glyph row's hash code--we have just reallocated the
11609 glyphs, so their contents can be complete garbage. (Bug#10164)
11610
11611 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
11612
11613 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
11614
11615 2011-11-30 Eli Zaretskii <eliz@gnu.org>
11616
11617 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
11618 attributes are tested _before_ calling verify_row_hash, to protect
11619 against GCC re-ordering of the tests. (Bug#10164)
11620
11621 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
11622
11623 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
11624
11625 * xterm.c (handle_one_xevent): Only set async_visible and friends
11626 if net_wm_state_hidden_seen is non-zero (Bug#10002)
11627 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
11628 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
11629
11630 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
11631
11632 Remove GCPRO-related macros that exist only to avoid shadowing locals.
11633 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
11634 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
11635 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
11636 All uses changed to use GCPRO1 etc.
11637 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
11638 Revert to old implementation (i.e., before 2011-03-11).
11639
11640 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11641
11642 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
11643 of scroll runs so as to avoid assigning disabled bogus rows and
11644 unnecessary graphics copy operations.
11645
11646 2011-11-27 Eli Zaretskii <eliz@gnu.org>
11647
11648 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
11649 (snprintf) [_MSC_VER]: Redirect to _snprintf.
11650 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
11651 (malloc, free, realloc, calloc): Redirect to e_* only when
11652 compiling Emacs.
11653
11654 * lisp.h (GCTYPEBITS): Move before first use.
11655 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
11656 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
11657 this macro definition.
11658
11659 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
11660 _MSC_VER.
11661
11662 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
11663
11664 * gtkutil.c (xg_create_frame_widgets):
11665 Call gtk_window_set_has_resize_grip (FALSE) if that function is
11666 present with Gtk+ 2.0.
11667
11668 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
11669
11670 * fileio.c (Finsert_file_contents): Undo previous change; see
11671 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
11672
11673 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
11674
11675 Rename locals to avoid shadowing.
11676 * fileio.c (Finsert_file_contents):
11677 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
11678 * process.c (wait_reading_process_output):
11679 Rename inner 'proc' to 'p' to avoid shadowing.
11680 Indent for consistency with usual Emacs style.
11681
11682 2011-11-25 Eli Zaretskii <eliz@gnu.org>
11683
11684 * xdisp.c (redisplay_window): If cursor row is not fully visible
11685 after recentering, and scroll-conservatively is set to a large
11686 number, scroll window by a few more lines to make the cursor fully
11687 visible and out of scroll-margin. (Bug#10105)
11688 (start_display): Don't move to the next line if the display should
11689 start at a newline that is part of a display vector or an overlay
11690 string. (Bug#10119)
11691
11692 2011-11-24 Juri Linkov <juri@jurta.org>
11693
11694 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
11695 after the `MagickPingImage' call. (Bug#10112)
11696
11697 2011-11-23 Chong Yidong <cyd@gnu.org>
11698
11699 * window.c (Fcoordinates_in_window_p): Accept only live windows.
11700
11701 2011-11-23 Martin Rudalics <rudalics@gmx.at>
11702
11703 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
11704 making another buffer current. (Bug#10114)
11705
11706 2011-11-23 Glenn Morris <rgm@gnu.org>
11707
11708 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
11709
11710 2011-11-23 Chong Yidong <cyd@gnu.org>
11711
11712 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
11713 using it (Bug#5984).
11714
11715 2011-11-22 Eli Zaretskii <eliz@gnu.org>
11716
11717 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
11718 and header-lines, as they don't have one computed for them.
11719 (Bug#10098)
11720
11721 * .gdbinit (prow): Make displayed values more self-explaining.
11722 Add row's hash code.
11723
11724 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
11725
11726 * process.c (wait_reading_process_output): Fix asynchrounous
11727 GnuTLS socket handling on some versions of the GnuTLS library.
11728 (wait_reading_process_output): Add comment and URL.
11729
11730 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
11731
11732 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
11733
11734 2011-11-21 Chong Yidong <cyd@gnu.org>
11735
11736 * window.c (Fnext_window, Fprevious_window): Doc fix.
11737
11738 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
11739
11740 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
11741
11742 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
11743
11744 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
11745
11746 2011-11-20 Martin Rudalics <rudalics@gmx.at>
11747
11748 * window.c (Fset_window_combination_limit): Rename argument
11749 STATUS to LIMIT.
11750 (Vwindow_combination_limit): Remove "status" from doc-string.
11751
11752 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
11753
11754 * m/ibms390.h: Remove.
11755 * m/ibms390x.h: Don't include "ibms390.h".
11756
11757 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
11758
11759 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
11760 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
11761
11762 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
11763
11764 * casetab.c (Fset_case_table):
11765 * charset.c (Fcharset_after): Fix typos.
11766
11767 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
11768
11769 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
11770 Otherwise, valgrind does not work on some platforms.
11771 Problem reported by Andreas Schwab in
11772 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
11773 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
11774 is set, removing the need for VIRT_ADDRESS_VARIES.
11775 (PURE_P): Use a more-efficient implementation that needs just one
11776 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
11777 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
11778 to 4 (xorl, subq, cmpq, setbe).
11779 * alloc.c (pure): Always extern now, since that's the
11780 VIRT_ADDR_VARIES behavior.
11781 (PURE_POINTER_P): Use a single comparison, not two, for
11782 consistency with the new puresize.h.
11783 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
11784 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
11785 Remove VIRT_ADDR_VARIES no longer needed.
11786
11787 2011-11-19 Eli Zaretskii <eliz@gnu.org>
11788
11789 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
11790 (erase_phys_cursor, update_window_cursor, show_mouse_face)
11791 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
11792 behave as if the cursor position were at the window margin.
11793
11794 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
11795 and the cursor position is out of bounds, behave as if the cursor
11796 position were at the window margin. (Bug#10075)
11797
11798 2011-11-18 Chong Yidong <cyd@gnu.org>
11799
11800 * window.c (Fwindow_combination_limit): Make first argument
11801 non-optional, since it is meaningless for live windows like the
11802 selected window.
11803
11804 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
11805
11806 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
11807
11808 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
11809
11810 * intervals.c: Fix grafting over the whole buffer (bug#10071).
11811 (graft_intervals_into_buffer): Simplify.
11812
11813 2011-11-18 Eli Zaretskii <eliz@gnu.org>
11814
11815 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
11816 hash values of the two rows.
11817 (copy_row_except_pointers): Preserve the used[] arrays and the
11818 hash values of the two rows. (Bug#10035)
11819 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
11820
11821 * xdisp.c (row_hash): New function, body extracted from
11822 compute_line_metrics.
11823 (compute_line_metrics): Call row_hash, instead of computing the
11824 hash code inline.
11825
11826 * dispnew.c (verify_row_hash): Call row_hash for computing the
11827 hash code of a row, instead of duplicating code from xdisp.c.
11828
11829 * dispextern.h (row_hash): Add prototype.
11830
11831 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
11832
11833 * frame.c (delete_frame): Don't delete the terminal when the last
11834 X frame is closed if emacs is built with GTK toolkit.
11835
11836 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
11837
11838 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
11839
11840 2011-11-17 Martin Rudalics <rudalics@gmx.at>
11841
11842 * window.c (Vwindow_splits): Rename to
11843 Vwindow_combination_resize. Suggested by Juri Linkov.
11844 (Fsplit_window_internal): Use Vwindow_combination_resize instead
11845 of Vwindow_splits.
11846
11847 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
11848
11849 * nsfns.m (Fns_font_name):
11850 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
11851
11852 2011-11-16 Martin Rudalics <rudalics@gmx.at>
11853
11854 * window.h (window): Rename slot "nest" to "combination_limit".
11855 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
11856 (Fset_window_nest): Rename to Fset_window_combination_limit.
11857 (Vwindow_nest): Rename to Vwindow_combination_limit.
11858 (recombine_windows, make_parent_window, make_window)
11859 (Fsplit_window_internal, saved_window)
11860 (Fset_window_configuration, save_window_save): Rename all
11861 occurrences of window_nest to window_combination_limit.
11862
11863 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
11864
11865 * image.c (imagemagick_load_image): Fix typo.
11866
11867 2011-11-14 Eli Zaretskii <eliz@gnu.org>
11868
11869 * xdisp.c (display_line): Move the call to
11870 highlight_trailing_whitespace before the call to
11871 compute_line_metrics, since the latter needs to see the final
11872 faces of all the glyphs to compute ROW's hash value.
11873 Fixes assertion violations in row_equal_p. (Bug#10035)
11874
11875 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
11876
11877 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
11878 just return (bug#10044).
11879
11880 2011-11-12 Eli Zaretskii <eliz@gnu.org>
11881
11882 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
11883 with user-defined heap size. Bump the default size of the temacs
11884 heap to 27MB, to avoid memory warning when running temacs.
11885 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
11886
11887 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
11888 current_matrix and desired_matrix. (Bug#9990)
11889 (verify_row_hash) [XASSERTS]: New function.
11890 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
11891 that the hash value of glyph rows is correct.
11892
11893 2011-11-12 Martin Rudalics <rudalics@gmx.at>
11894
11895 * window.h (window): Remove splits slot.
11896 * window.c (Fwindow_splits, Fset_window_splits): Remove.
11897 (Fdelete_other_windows_internal, make_parent_window)
11898 (make_window, Fsplit_window_internal, Fdelete_window_internal)
11899 (Fset_window_configuration, save_window_save): Don't deal with
11900 split status of windows.
11901 (saved_window): Remove splits slot.
11902 (Vwindow_splits): Rewrite doc-string.
11903
11904 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
11905
11906 * xfns.c (unwind_create_frame):
11907 * nsfns.m (unwind_create_frame):
11908 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
11909 Vframe_list (Bug#9999).
11910
11911 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
11912
11913 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
11914
11915 2011-11-11 Kenichi Handa <handa@m17n.org>
11916
11917 * callproc.c (Fcall_process): Set the member dst_multibyte of
11918 process_coding.
11919
11920 2011-11-11 Johan Bockgård <bojohan@gnu.org>
11921
11922 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
11923 avoid a crash (bug#9496).
11924
11925 2011-11-09 Chong Yidong <cyd@gnu.org>
11926
11927 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
11928 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
11929
11930 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11931
11932 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
11933
11934 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11935
11936 Avoid some portability problems by eschewing 'extern inline' functions.
11937 The trivial performance wins aren't worth the portability hassles; see
11938 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
11939 et seq.
11940 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11941 (window_box_width, window_box_left, window_box_left_offset)
11942 (window_box_right, window_box_right_offset): Undo previous change,
11943 by removing the "extern"s.
11944 * intervals.c (adjust_intervals_for_insertion)
11945 (adjust_intervals_for_deletion): Undo previous change,
11946 making these static again.
11947 (offset_intervals, temp_set_point_both, temp_set_point)
11948 (copy_intervals_to_string): No longer inline.
11949 * xdisp.c (window_text_bottom_y, window_box_width)
11950 (window_box_height, window_box_left_offset)
11951 (window_box_right_offset, window_box_left, window_box_right)
11952 (window_box): No longer inline.
11953
11954 2011-11-08 Chong Yidong <cyd@gnu.org>
11955
11956 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
11957 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
11958 Signal an error if not a live window.
11959 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
11960 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
11961
11962 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
11963
11964 * lisp.h (syms_of_abbrev): Remove declaration.
11965 Reported by CHENG Gao <chenggao@royau.me>.
11966
11967 2011-11-07 Eli Zaretskii <eliz@gnu.org>
11968
11969 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
11970 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
11971 of temacs in GUI mode.
11972
11973 2011-11-07 Martin Rudalics <rudalics@gmx.at>
11974
11975 * window.h: Declare delete_all_child_windows instead of
11976 delete_all_subwindows.
11977 * window.c (Fwindow_nest, Fset_window_nest)
11978 (Fset_window_new_total, Fset_window_new_normal)
11979 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
11980 (delete_all_subwindows): Rename to delete_all_child_windows.
11981 (Fdelete_other_windows_internal, Fset_window_configuration):
11982 Call delete_all_child_windows instead of delete_all_subwindows.
11983 * frame.c (delete_frame): Call delete_all_child_windows instead
11984 of delete_all_subwindows.
11985
11986 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
11987
11988 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
11989 This is also needed for porting to any host where GC_MARK_STACK is
11990 not GC_MAKE_GCPROS_NOOPS.
11991 (which_symbols): Use it.
11992
11993 2011-11-07 Kenichi Handa <handa@m17n.org>
11994
11995 * coding.c (coding_set_destination): Check coding->src_pos only
11996 when coding->src_object is a buffer (bug#9910).
11997
11998 * process.c (send_process): Set the member src_multibyte of coding
11999 to 0 (bug#9911) when sending a unibyte text.
12000
12001 * callproc.c (Fcall_process): Set the member src_multibyte of
12002 process_coding to 0 (bug#9912).
12003
12004 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12005
12006 * xmenu.c (cleanup_widget_value_tree): New function.
12007 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
12008 calling free_menubar_widget_value_tree directly (Bug#9830).
12009
12010 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
12011
12012 Fix some portability problems with 'inline'.
12013 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
12014 (window_box_width, window_box_left, window_box_left_offset)
12015 (window_box_right, window_box_right_offset): Declare extern.
12016 Otherwise, these inline functions do not conform to C99 and
12017 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
12018 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
12019 * intervals.c (adjust_intervals_for_insertion)
12020 (adjust_intervals_for_deletion): Now extern, because otherwise the
12021 extern inline functions 'offset_intervals' couldn't refer to it.
12022 (static_offset_intervals): Remove.
12023 (offset_intervals): Rewrite using the old contents of
12024 static_offset_intervals. The old version didn't conform to C99
12025 because an extern inline function contained a reference to an
12026 identifier with static linkage.
12027
12028 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
12029
12030 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
12031 GC.
12032
12033 2011-11-06 Eli Zaretskii <eliz@gnu.org>
12034
12035 * xdisp.c (init_iterator, reseat_to_string): Don't set the
12036 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
12037 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
12038 return Qleft_to_right.
12039
12040 2011-11-06 Chong Yidong <cyd@gnu.org>
12041
12042 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
12043 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
12044 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
12045 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
12046 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
12047 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
12048 (Fwindow_vscroll): Doc fix.
12049 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
12050 argument, since it makes no sense to pass a live window and for
12051 consistency with window-child.
12052
12053 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
12054
12055 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
12056 support MSVC.
12057
12058 2011-11-05 Jason Rumney <jasonr@gnu.org>
12059
12060 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
12061 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
12062 fonts (Bug#6029).
12063 (add_font_entity_to_list): Fix logic errors in mixed boolean and
12064 bitwise arithmetic preventing use of unicode-sip and non-truetype
12065 opentype fonts.
12066
12067 2011-11-05 Eli Zaretskii <eliz@gnu.org>
12068
12069 * s/ms-w32.h (fstat, stat, utime): Move redirections to
12070 "emacs"-only part.
12071
12072 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
12073 initialization code to keep similarity to xfns.c after changes
12074 from 2011-11-05.
12075
12076 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
12077
12078 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
12079 (unwind_create_frame): New function (Bug#9943).
12080 (Fx_create_frame): Restructure code to be more similar to the one in
12081 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
12082 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
12083 Move terminal->reference_count++ just before making the frame official
12084 (Bug#9943).
12085
12086 * nsterm.m (x_free_frame_resources): New function.
12087 (x_destroy_window): Move code to x_free_frame_resources.
12088
12089 * xfns.c (unwind_create_frame): Fix comment.
12090 (Fx_create_frame, x_create_tip_frame):
12091 Move terminal->reference_count++ just before making the frame
12092 official. Move initialization of image_cache_refcount and
12093 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
12094
12095 2011-11-05 Eli Zaretskii <eliz@gnu.org>
12096
12097 Support MSVC build with newer versions of Visual Studio.
12098 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
12099 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
12100 nt/gmake.defs.
12101
12102 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
12103 which are not supported by MSVC.
12104 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
12105 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
12106 bitfields.
12107 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
12108 types in bitfields.
12109 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
12110
12111 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
12112
12113 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
12114
12115 Support MSVC build with newer versions of Visual Studio.
12116 * w32.c: Don't include w32api.h for MSVC.
12117 (init_environment) [_MSC_VER]: Call sys_access, not _access.
12118
12119 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
12120 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
12121 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
12122 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
12123 e_* cousins.
12124 (alloca) [_MSC_VER]: Define to _alloca.
12125
12126 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
12127
12128 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
12129
12130 2011-11-04 Eli Zaretskii <eliz@gnu.org>
12131
12132 * xdisp.c (note_mouse_highlight): If either of
12133 previous/next-single-property-change returns nil, treat that as
12134 the beginning or the end of the buffer. (Bug#9955)
12135
12136 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
12137
12138 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
12139 label is not null (Bug#9951).
12140 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
12141 may be NULL.
12142
12143 2011-11-04 Eli Zaretskii <eliz@gnu.org>
12144
12145 * window.c (Fwindow_body_size): Mention in the doc string that the
12146 return value is in frame's canonical units. (Bug#9949)
12147
12148 2011-11-03 Eli Zaretskii <eliz@gnu.org>
12149
12150 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
12151
12152 * w32fns.c (unwind_create_frame): If needed, free the glyph
12153 matrices of the partially constructed frame. (Bug#9943)
12154 * xfns.c (unwind_create_frame): Likewise.
12155
12156 2011-11-01 Eli Zaretskii <eliz@gnu.org>
12157
12158 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
12159 Don't stop backward scan on the continuation glyph, even though
12160 its CHARPOS is positive.
12161 (mouse_face_from_buffer_pos, note_mouse_highlight):
12162 Rename cover_string to disp_string.
12163
12164 2011-11-01 Martin Rudalics <rudalics@gmx.at>
12165
12166 * window.c (temp_output_buffer_show): Don't use
12167 Vtemp_buffer_show_specifiers.
12168 (Vtemp_buffer_show_specifiers): Remove unused variable.
12169
12170 2011-10-30 Eli Zaretskii <eliz@gnu.org>
12171
12172 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
12173 past the beginning of the current glyph matrix.
12174
12175 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
12176
12177 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
12178 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
12179 HAVE_GTK3 (Bug#9869).
12180
12181 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
12182 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
12183
12184 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
12185
12186 * xterm.c: Declare x_handle_net_wm_state to return int.
12187 (handle_one_xevent): Check if we are iconified but don't have
12188 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
12189 (get_current_wm_state): Return non-zero if not hidden,
12190 check for _NET_WM_STATE_HIDDEN (Bug#9893).
12191 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
12192 (x_handle_net_wm_state): Return what get_current_wm_state returns.
12193 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
12194
12195 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
12196
12197 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
12198 so that this new function doesn't get optimized away by a
12199 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
12200
12201 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
12202
12203 * frame.h (MOUSE_HL_INFO): Remove excess parens.
12204
12205 2011-10-29 Eli Zaretskii <eliz@gnu.org>
12206
12207 Fix the `xbytecode' command.
12208 * .gdbinit (xprintbytestr): New command.
12209 (xwhichsymbols): Rename from `which'; all callers changed.
12210 (xbytecode): Print the byte-code string as well.
12211
12212 2011-10-29 Kim Storm <storm@cua.dk>
12213
12214 * alloc.c (which_symbols): New function.
12215
12216 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
12217
12218 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
12219 line. (Bug#9903)
12220
12221 2011-10-29 Glenn Morris <rgm@gnu.org>
12222
12223 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
12224 Not clear what it was for, and it causes various bugs. (Bug#9839)
12225
12226 2011-10-28 Eli Zaretskii <eliz@gnu.org>
12227
12228 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
12229 possible random value that matches one of those tested as
12230 condition to clear the mouse face.
12231
12232 2011-10-28 Chong Yidong <cyd@gnu.org>
12233
12234 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
12235
12236 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
12237
12238 * window.c (make_window): Initialize phys_cursor_on_p.
12239
12240 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
12241
12242 * lisp.h (struct Lisp_Symbol): Update comments.
12243
12244 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
12245
12246 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
12247
12248 2011-10-28 Eli Zaretskii <eliz@gnu.org>
12249
12250 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
12251 <oslsachem@gmail.com> for helping to debug this.
12252
12253 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
12254 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
12255 (g_b_init_get_glyph_outline_w): New static variables.
12256 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
12257 (GetGlyphOutlineW_Proc): New typedefs.
12258 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
12259 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
12260 New functions.
12261 (w32font_open_internal, compute_metrics):
12262 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
12263 instead of calling the "wide" APIs directly.
12264
12265 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
12266
12267 * w32.h (syms_of_w32font): Add prototype.
12268
12269 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
12270
12271 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
12272 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
12273 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
12274 (Fmove_to_window_line): Doc fix.
12275
12276 2011-10-27 Chong Yidong <cyd@gnu.org>
12277
12278 * process.c (make_process): Set gnutls_state to NULL.
12279
12280 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
12281 non-NULL, regardless of GNUTLS_INITSTAGE.
12282 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
12283 an error. Set process slots as soon as we allocate them.
12284
12285 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
12286
12287 2011-10-27 Chong Yidong <cyd@gnu.org>
12288
12289 * gnutls.c (emacs_gnutls_deinit): New function.
12290 Deallocate credentials structures as well as calling gnutls_deinit.
12291 (Fgnutls_deinit, Fgnutls_boot): Use it.
12292
12293 * process.c (make_process): Initialize GnuTLS credentials to NULL.
12294 (deactivate_process): Call emacs_gnutls_deinit.
12295
12296 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
12297
12298 * image.c (x_create_x_image_and_pixmap):
12299 * w32.c (sys_rename, w32_delayed_load):
12300 * w32font.c (fill_in_logfont):
12301 * w32reg.c (x_get_string_resource): Silence compiler warnings.
12302
12303 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
12304
12305 * w32fns.c (w32_default_color_map): New function,
12306 extracted from Fw32_default_color_map.
12307 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
12308
12309 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
12310
12311 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
12312
12313 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
12314
12315 * keyboard.c (test_undefined): New function (bug#9751).
12316 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
12317
12318 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
12319
12320 * sysdep.c (init_sys_modes): Fix the check for the controlling
12321 terminal (Bug#6649).
12322
12323 2011-10-20 Eli Zaretskii <eliz@gnu.org>
12324
12325 * dispextern.h (struct bidi_it): New member next_en_type.
12326
12327 * bidi.c (bidi_line_init): Initialize the next_en_type member.
12328 (bidi_resolve_explicit_1): When next_en_pos is valid for the
12329 current character, check also for next_en_type being WEAK_EN.
12330 (bidi_resolve_weak): Don't enter the expensive loop if the current
12331 position is before next_en_pos. Record the bidi type of the first
12332 non-ET, non-BN character we find, in addition to its position.
12333 (bidi_level_of_next_char): Invalidate next_en_type when
12334 next_en_pos is over-stepped.
12335
12336 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
12337
12338 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
12339 * editfns.c: Rewrite current-time-zone so that it invokes
12340 the equivalent of (format-time-string "%Z") to get the time zone name.
12341 This fixes a bug when the time zone name contains characters that
12342 need converting from the system time locale to Emacs internal format.
12343 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
12344 that patch fixed format-time-string to do the conversion, but
12345 I forgot to fix current-time-zone.
12346 (format_time_string): New function, containing most of
12347 what Fformat_time_string used to contain.
12348 (Fformat_time_string): Rewrite in terms of format_time_string.
12349 This doesn't change this function's behavior.
12350 (current-time-zone): Rewrite to use format_time_string.
12351 This fixes the bug reported by Michael Schierl in
12352 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
12353 Jason Rumney's 2007-06-07 change worked around this bug, but
12354 didn't fix it.
12355 * systime.h (tzname, timezone): Remove no-longer-used declarations.
12356
12357 2011-10-19 Eli Zaretskii <eliz@gnu.org>
12358
12359 * xdisp.c (start_display): If the character at POS is displayed
12360 via a display vector, reset IT->current.dpvec_index to zero.
12361 (try_window_reusing_current_matrix): If a line ends in a display
12362 vector or the next line starts in a display vector, continue
12363 redrawing the window even though the character position of
12364 start_row was reached.
12365 (Bug#9771, part 2)
12366
12367 2011-10-18 Chong Yidong <cyd@gnu.org>
12368
12369 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
12370 with nobreak-char-display too.
12371
12372 2011-10-18 Eli Zaretskii <eliz@gnu.org>
12373
12374 Fix part 3 of bug#9771.
12375 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
12376 (bidi_resolve_neutral): Don't enter the expensive loop looking for
12377 non-neutral characters if the current character is a paragraph
12378 separator (a.k.a. Newline). This avoids running the same
12379 expensive loop twice, once when we consume the preceding newline
12380 and the other time when the line actually needs to be displayed.
12381 Avoid the loop when we see neutrals on the base embedding level
12382 following a character whose directionality is the same as the
12383 paragraph's. This avoids running the expensive loop when a line
12384 ends in a long sequence of neutrals, like control characters.
12385 Add assertion against STRONG_AL type. Slightly rearrange code
12386 that determines the type of a neutral given the first non-neutral
12387 that follows it.
12388 (bidi_level_of_next_char): Set next_en_pos to zero when
12389 invalidating its info.
12390
12391 2011-10-17 Eli Zaretskii <eliz@gnu.org>
12392
12393 * xdisp.c (push_display_prop): Determine whether to record string
12394 or buffer position by IT->string, not by IT->method. Allow
12395 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
12396 (move_it_vertically_backward): Don't look for character position
12397 immediately after the newline when in a continuation line.
12398 (Bug#9771, part 1)
12399
12400 2011-10-15 Martin Rudalics <rudalics@gmx.at>
12401
12402 * window.c (coordinates_in_window): Rewrite and delabelize
12403 vertical border check. (Bug#5357) (Bug#9618)
12404
12405 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
12406
12407 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
12408 errors in XSetWindowBorder (bug#9310).
12409
12410 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
12411
12412 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
12413 avoid crash when xmalloc overrun checking is enabled.
12414
12415 2011-10-13 Eli Zaretskii <eliz@gnu.org>
12416
12417 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
12418 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
12419 cursor motion with <left> and <right> arrow keys.
12420
12421 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
12422 some callers set that themselves.
12423
12424 2011-10-12 Eli Zaretskii <eliz@gnu.org>
12425
12426 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
12427 display string and the previous row comes from the same string and
12428 is empty. (Bug#9739) (Bug#9738)
12429
12430 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
12431
12432 * doc.c (get_doc_string): Encode file name (bug#9735).
12433
12434 2011-10-12 Eli Zaretskii <eliz@gnu.org>
12435
12436 * bidi.c (bidi_level_of_next_char):
12437 * xdisp.c (get_visually_first_element): Remove old incorrect
12438 comments regarding the Unicode Line Separator character.
12439
12440 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
12441
12442 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
12443
12444 * alloc.c (Fgc_status): Do not access beyond zombies array
12445 boundary if nzombies > MAX_ZOMBIES.
12446 * alloc.c (dump_zombies): Add missing format specifier.
12447
12448 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
12449
12450 * xdisp.c (set_cursor_from_row): Simplify conditionals,
12451 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
12452
12453 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
12454 Some packages use them to denote characters with modifiers.
12455
12456 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
12457
12458 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
12459 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
12460 matching a pp-number. Rename parameter var to var1.
12461
12462 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
12463
12464 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
12465
12466 2011-10-08 Glenn Morris <rgm@gnu.org>
12467
12468 * callint.c (Fcall_interactively): Give a more explicit error for the
12469 'c' case with a non-character input. (Bug#8479)
12470
12471 2011-10-08 Eli Zaretskii <eliz@gnu.org>
12472
12473 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
12474 lines.
12475 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
12476 lines that are hscrolled on the left.
12477
12478 * dispnew.c (buffer_posn_from_coords): Account for a possible
12479 presence of header-line. (Bug#4426)
12480
12481 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
12482
12483 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
12484 Don't advertise functionality which we discourage or doesn't work.
12485
12486 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
12487
12488 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
12489 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
12490 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
12491 this makes Emacs dump core during garbage collection on rare
12492 occasions. sizeof is obviously inferior to offsetof here, so
12493 stick with offsetof.
12494 (GC_POINTER_ALIGNMENT): New macro.
12495 (mark_memory): Omit 3rd (offset) arg; caller changed.
12496 Don't assume EMACS_INT alignment is the same as pointer alignment.
12497
12498 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
12499
12500 * keyboard.c (read_key_sequence_remapped): New var.
12501 (read_key_sequence): Compute remapping in the right buffer.
12502 (command_loop_1): Use read_key_sequence's remapping directly.
12503
12504 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
12505
12506 * dired.c (file_name_completion): Don't expand file name.
12507 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
12508 before checking file name handler.
12509
12510 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
12511 they've been requested explicitly (bug#9591).
12512
12513 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
12514
12515 * keymap.c (Fsingle_key_description): Use make_specified_string
12516 instead of build_string to build string from push_key_description.
12517 (Bug#5193)
12518
12519 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
12520
12521 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
12522 This fixes a Y2038 bug on 64-bit hosts.
12523 * buffer.c (reset_buffer):
12524 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
12525 (Fclear_buffer_auto_save_failure):
12526 Use 0, not -1, to represent an unset failure time, since time_t
12527 might not be signed.
12528
12529 Remove dependency on glibc malloc internals.
12530 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12531 Move back here from lisp.h, but with their new implementations.
12532 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
12533 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
12534 * charset.c (charset_table_init): New static var.
12535 (syms_of_charset): Use it instead of xmalloc. This removes a
12536 dependency on glibc malloc internals. See Eli Zaretskii's comment in
12537 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
12538 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12539 Move back to alloc.c.
12540 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
12541 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
12542
12543 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
12544
12545 * nsterm.m (windowDidResize): Call x_set_window_size only when
12546 ns_in_resize is true. Otherwise set pixelwidth/height and
12547 call change_frame_size (Bug#9628).
12548
12549 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
12550
12551 Port --enable-checking=all to Fedora 14 x86-64.
12552 * charset.c (syms_of_charset): Also account for glibc malloc's
12553 internal overhead when calculating the initial malloc maximum.
12554
12555 Port --enable-checking=all to Fedora 14 x86.
12556 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12557 Move to lisp.h.
12558 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
12559 (overrun_check_realloc, overrun_check_free):
12560 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
12561 That way, xmalloc returns a properly-aligned pointer even if
12562 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
12563 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
12564 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
12565 into account when calculating the initial malloc maximum.
12566 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12567 Move here from alloc.c, so that charset.c can use it too.
12568 Properly align; the old code wasn't right for common 32-bit hosts
12569 when configured with --enable-checking=all.
12570 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
12571 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
12572
12573 2011-09-29 Eli Zaretskii <eliz@gnu.org>
12574
12575 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
12576 use EDOM.
12577
12578 2011-09-28 Eli Zaretskii <eliz@gnu.org>
12579
12580 * xdisp.c (compute_display_string_end): If there's no display
12581 string at CHARPOS, return -1.
12582
12583 * bidi.c (bidi_fetch_char): When compute_display_string_end
12584 returns a negative value, treat the character as a normal
12585 character not covered by a display string. (Bug#9624)
12586
12587 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
12588
12589 * lread.c (Fread_from_string): Fix typo in docstring.
12590
12591 2011-09-27 Eli Zaretskii <eliz@gnu.org>
12592
12593 * xdisp.c (handle_invisible_prop): If invisible text ends on a
12594 newline, reseat the iterator instead of bidi-iterating there one
12595 character at a time. (Bug#9610)
12596 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
12597 TO_CHARPOS if the bidi iterator is at base embedding level.
12598
12599 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
12600
12601 * lread.c (readevalloop): Use correct code for NBSP.
12602 (read1): Likewise. (Bug#9608)
12603
12604 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
12605
12606 * dbusbind.c (Fdbus_register_signal): When service is not
12607 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
12608
12609 2011-09-25 Glenn Morris <rgm@gnu.org>
12610
12611 * buffer.c (truncate-lines): Doc fix.
12612
12613 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
12614
12615 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
12616 (Fset_window_next_buffers): Doc fix.
12617
12618 2011-09-24 Glenn Morris <rgm@gnu.org>
12619
12620 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
12621
12622 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
12623
12624 Fix minor problems found by static checking.
12625 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
12626 * indent.c (Fvertical_motion): Fix == vs = typo.
12627
12628 2011-09-24 Eli Zaretskii <eliz@gnu.org>
12629
12630 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
12631 Default value is now t. Doc fix.
12632
12633 * indent.c (Fvertical_motion): Compute and apply the overshoot
12634 logic when moving up, not only when moving down. Fix the
12635 confusing name and values of the it_overshoot_expected variable;
12636 logic changes accordingly. (Bug#9254) (Bug#9549)
12637
12638 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
12639 CHARPOS is covered by a display string which includes newlines.
12640 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
12641 is covered by a display string with embedded newlines.
12642
12643 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
12644
12645 * dbusbind.c (Fdbus_register_signal): Add match rule to
12646 Vdbus_registered_objects_table. (Bug#9581)
12647 (Fdbus_register_method, Vdbus_registered_objects_table):
12648 Fix docstring.
12649
12650 2011-09-24 Jim Meyering <meyering@redhat.com>
12651
12652 do not ignore write error for any output size
12653 The previous change was incomplete.
12654 While it makes emacs --batch detect the vast majority of stdout
12655 write failures, errors were still ignored whenever the output size is
12656 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
12657 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
12658 && echo FAIL: ignored write error
12659 FAIL: ignored write error
12660 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
12661 && echo FAIL: ignored write error
12662 FAIL: ignored write error
12663 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
12664
12665 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
12666
12667 * emacs.c (Fkill_emacs): In noninteractive mode exit
12668 non-successfully if a write error occurred on stdout. (Bug#9574)
12669
12670 2011-09-21 Eli Zaretskii <eliz@gnu.org>
12671
12672 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
12673 the xassert test.
12674
12675 * dispextern.h (struct it): Update the comment documenting what
12676 can it->OBJECT be.
12677
12678 2011-09-20 Eli Zaretskii <eliz@gnu.org>
12679
12680 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
12681 a display string, extend search for cursor position to end of row.
12682 (find_row_edges): If the row ends in a newline from a display
12683 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
12684 Handle the case of a display string with multiple newlines.
12685 (Fcurrent_bidi_paragraph_direction): Fix search for previous
12686 non-empty line. Fixes confusing cursor motion with arrow keys at
12687 the beginning of a line that starts with whitespace.
12688
12689 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12690
12691 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
12692 (bug#9493).
12693
12694 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
12695
12696 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
12697 boolean (Bug#9154).
12698
12699 2011-09-18 Eli Zaretskii <eliz@gnu.org>
12700
12701 * xdisp.c (display_line): Record maximum and minimum buffer
12702 positions even if no glyphs were produced (e.g., by a zero-width
12703 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
12704 buffer positions that will be removed from the glyph row because
12705 they don't fit.
12706 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
12707 column is beyond frame width: don't subtract 1 "pixel" when
12708 computing width of the stretch.
12709 (reseat_at_next_visible_line_start): Undo the change made on
12710 2011-09-17 that saved paragraph information and restored it after
12711 the call to `reseat'. (Bug#9545)
12712
12713 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12714
12715 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
12716 and turn window cursor on if cleared (Bug#9415).
12717
12718 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
12719
12720 * search.c (boyer_moore): Take unibyte characters from pattern
12721 literally. (Bug#9458)
12722
12723 2011-09-18 Eli Zaretskii <eliz@gnu.org>
12724
12725 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
12726
12727 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
12728
12729 Fix minor problem found by static checking.
12730 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
12731 initialized, to pacify gcc -Wuninitialized.
12732
12733 * fileio.c: Report proper errno when syscall falls.
12734 (Finsert_file_contents): Save and restore errno,
12735 so that report_file_error outputs the correct diagnostic.
12736 (Fwrite_region) [CLASH_DETECTION]: Likewise.
12737
12738 2011-09-18 Eli Zaretskii <eliz@gnu.org>
12739
12740 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
12741
12742 2011-09-17 Eli Zaretskii <eliz@gnu.org>
12743
12744 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
12745 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
12746
12747 2011-09-17 Eli Zaretskii <eliz@gnu.org>
12748
12749 * xdisp.c (reseat_at_next_visible_line_start): Keep information
12750 about the current paragraph and restore it after the call to reseat.
12751
12752 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
12753 (bidi_find_paragraph_start): Search back for paragraph beginning
12754 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
12755 (bidi_move_to_visually_next): Only trigger paragraph-related
12756 computations when the last character is a newline or at EOB, not
12757 just any NEUTRAL_B. (Bug#9470)
12758
12759 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
12760 truncated lines if point is covered by a display string. (Bug#9524)
12761
12762 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
12763
12764 * xselect.c: Relax test for outgoing X longs (Bug#9498).
12765 (cons_to_x_long): New function.
12766 (lisp_data_to_selection_data): Use it. Correct the test for
12767 short-versus-long data; it was negated. Break out of vector
12768 loop, for efficiency, when a long datum is discovered.
12769
12770 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
12771
12772 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
12773
12774 2011-09-16 Eli Zaretskii <eliz@gnu.org>
12775
12776 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
12777 GCC PR/17406) by declaring this function with external scope.
12778
12779 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
12780
12781 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
12782 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
12783
12784 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
12785
12786 * editfns.c (Fformat): Correctly handle text properties on "%%".
12787
12788 2011-09-15 Eli Zaretskii <eliz@gnu.org>
12789
12790 * xterm.c (x_draw_composite_glyph_string_foreground):
12791 * w32term.c (x_draw_composite_glyph_string_foreground):
12792 * term.c (encode_terminal_code):
12793 * composite.c (composition_update_it, get_composition_id):
12794 * xdisp.c (get_next_display_element)
12795 (fill_composite_glyph_string): Add comments about special meaning
12796 of TAB characters in a composition.
12797
12798 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
12799
12800 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
12801 This occurs when processing a multibyte format.
12802 Problem reported by Wolfgang Jenker.
12803
12804 2011-09-15 Johan Bockgård <bojohan@gnu.org>
12805
12806 * xdisp.c (try_cursor_movement): Only check for exact match if
12807 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
12808
12809 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
12810
12811 Remove unused external symbols.
12812 * dispextern.h (calc_pixel_width_or_height): Remove decl.
12813 * xdisp.c (calc_pixel_width_or_height): Now static.
12814 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
12815 * indent.c (check_display_width):
12816 * w32term.c: Fix comment to match code.
12817 * xterm.c, xterm.h (x_catching_errors): Remove.
12818
12819 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
12820
12821 * xselect.c: Use signed conversions more consistently (Bug#9498).
12822 (selection_data_to_lisp_data): Assume incoming selection data are
12823 signed integers, not unsigned. This is to be consistent with
12824 outgoing selection data, which was modified to use signed integers
12825 in as part of the fix to Bug#9196 in response to Jan D.'s comment
12826 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
12827 expects long, not unsigned long.
12828
12829 2011-09-14 Eli Zaretskii <eliz@gnu.org>
12830
12831 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
12832 computation of loop end. Reported by Johan Bockgård
12833 <bojohan@gnu.org>.
12834
12835 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
12836
12837 * frame.c (Fother_visible_frames_p): Function deleted.
12838
12839 2011-09-12 Eli Zaretskii <eliz@gnu.org>
12840
12841 * indent.c (compute_motion): Process display vector front to back
12842 rather than the other way around. (Bug#2496)
12843
12844 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
12845
12846 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
12847
12848 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
12849
12850 * minibuf.c (Fread_from_minibuffer): Doc fix.
12851
12852 2011-09-11 Eli Zaretskii <eliz@gnu.org>
12853
12854 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
12855 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
12856
12857 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12858
12859 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
12860 value for non-existent files.
12861
12862 2011-09-11 Eli Zaretskii <eliz@gnu.org>
12863
12864 * fileio.c (Finsert_file_contents): If the file cannot be opened,
12865 set its "size" to -1. This will set the modtime_size field of
12866 the corresponding buffer to -1, which is what
12867 verify-visited-file-modtime expects for files that do not exist.
12868 (Bug#9139)
12869
12870 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
12871
12872 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
12873 here ...
12874 * lisp.h: ... from here. push_key_description is no longer
12875 defined in keyboard.c, so its declaration should not be in
12876 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
12877 logically belongs with push_key_description.
12878
12879 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
12880
12881 * buffer.h: Include <sys/types.h> instead of <time.h>.
12882 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
12883 Problem reported by Herbert J. Skuhra.
12884
12885 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
12886
12887 * xml.c (parse_region): Make the parsing work for
12888 non-comment-starting XML files again (bug#9144).
12889
12890 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
12891
12892 * image.c (gif_load): Fix calculation of bottom and right corner.
12893 (Bug#9468)
12894
12895 2011-09-10 Eli Zaretskii <eliz@gnu.org>
12896
12897 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
12898 redisplay in small windows.
12899
12900 2011-09-09 Eli Zaretskii <eliz@gnu.org>
12901
12902 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
12903
12904 2011-09-08 Martin Rudalics <rudalics@gmx.at>
12905
12906 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
12907 Operate on live windows only.
12908
12909 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
12910
12911 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
12912
12913 2011-09-07 Eli Zaretskii <eliz@gnu.org>
12914
12915 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
12916 only under bidi iteration.
12917
12918 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
12919
12920 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
12921
12922 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12923
12924 isnan: Fix porting problem to Solaris 10 with bundled gcc.
12925 Without this fix, the command to link temacs failed due to an
12926 undefined symbol __builtin_isnan. This is because
12927 /usr/include/iso/math_c99.h #defines isnan(x) to
12928 __builtin_isnan(x), but the bundled gcc, which identifies itself
12929 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
12930 a __builtin_isnan.
12931 * floatfns.c (isnan): #undef, and then #define to a clone of
12932 what's in data.c.
12933 (Fisnan): Always define, since it's always available now.
12934 (syms_of_floatfns): Always define isnan at the Lisp level.
12935
12936 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12937
12938 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
12939
12940 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12941
12942 * fileio.c: Fix bugs with large file offsets (Bug#9428).
12943 The previous code assumed that file offsets (off_t values) fit in
12944 EMACS_INT variables, which is not true on typical 32-bit hosts.
12945 The code messed up by falsely reporting buffer overflow in cases
12946 such as (insert-file-contents "big" nil 1 2) into an empty buffer
12947 when "big" contains more than 2**29 bytes, even though this
12948 inserts just one byte and does not overflow the buffer.
12949 (Finsert_file_contents): Store file offsets as off_t
12950 values, not as EMACS_INT values. Check for overflow when
12951 converting between EMACS_INT and off_t. When checking for
12952 buffer overflow or for overlap, take the offsets into account.
12953 Don't use EMACS_INT for small values where int suffices.
12954 When checking for overlap, fix a typo: ZV was used where
12955 ZV_BYTE was intended.
12956 (Fwrite_region): Don't assume off_t fits into 'long'.
12957 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
12958
12959 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
12960
12961 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
12962
12963 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12964
12965 sprintf-related integer and memory overflow issues (Bug#9412).
12966
12967 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
12968 (esprintf, exprintf, evxprintf): New functions.
12969 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
12970 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
12971 (modify_event_symbol): Do not assume that the length of
12972 name_alist_or_stem is safe to alloca and fits in int.
12973 (Fexecute_extended_command): Likewise for function name and binding.
12974 (Frecursion_depth): Wrap around reliably on integer overflow.
12975 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
12976 since some callers pass EMACS_INT values.
12977 (Fsingle_key_description): Don't crash if symbol name contains more
12978 than MAX_ALLOCA bytes.
12979 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
12980 (get_minibuffer): Arg is now EMACS_INT, not int.
12981 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
12982 (esprintf, exprintf, evxprintf): New decls.
12983 * window.h (command_loop_level, minibuf_level): Reflect API changes.
12984
12985 * dbusbind.c (signature_cat): New function.
12986 (xd_signature, Fdbus_register_signal):
12987 Do not overrun buffer; instead, report string overflow.
12988
12989 * dispnew.c (add_window_display_history): Don't overrun buffer.
12990 Truncate instead; this is OK since it's just a log.
12991
12992 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
12993 even if the time zone offset is outlandishly large.
12994 Don't mishandle offset == INT_MIN.
12995
12996 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
12997 when creating daemon; the previous buffer-overflow check was incorrect.
12998
12999 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
13000 which has the guts of the old verror function.
13001
13002 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
13003 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
13004
13005 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
13006 (font_unparse_xlfd): Don't blindly alloca long strings.
13007 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
13008 fits in int, when using sprintf. Use single snprintf to count
13009 length of string rather than counting it via multiple sprintfs;
13010 that's simpler and more reliable.
13011 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
13012 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
13013 sprintf, in case result does not fit in int.
13014
13015 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
13016 (fontset_from_font): Print it.
13017
13018 * frame.c (tty_frame_count): Now printmax_t, not int.
13019 (make_terminal_frame, set_term_frame_name): Print it.
13020 (x_report_frame_params): In X, window IDs are unsigned long,
13021 not signed long, so print them as unsigned.
13022 (validate_x_resource_name): Check for implausibly long names,
13023 and don't assume name length fits in 'int'.
13024 (x_get_resource_string): Don't blindly alloca invocation name;
13025 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
13026 not fit in int.
13027
13028 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
13029 (xg_check_special_colors, xg_set_geometry):
13030 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
13031
13032 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
13033 Use esprintf, not sprintf, in case result does not fit in int.
13034
13035 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
13036 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
13037 it as a large positive number.
13038 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
13039 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
13040
13041 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
13042 in case result does not fit in int.
13043
13044 * print.c (float_to_string): Detect width overflow more reliably.
13045 (print_object): Make sprintf buffer a bit bigger, to avoid potential
13046 buffer overrun. Don't assume list length fits in 'int'. Treat
13047 print length of 0 as 0, not as infinity; to be consistent with other
13048 uses of print length in this function. Don't overflow print length
13049 index. Don't assume hash table size fits in 'long', or that
13050 vectorlike size fits in 'unsigned long'.
13051
13052 * process.c (make_process): Use printmax_t, not int, to format
13053 process-name gensyms.
13054
13055 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
13056
13057 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
13058 to avoid potential buffer overrun.
13059
13060 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
13061 if X resource line is longer than 512 bytes.
13062
13063 * xfns.c (x_window): Make sprintf buffer a bit bigger
13064 to avoid potential buffer overrun.
13065
13066 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
13067
13068 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
13069
13070 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
13071
13072 Integer overflow fixes for scrolling, etc.
13073 Without these, Emacs silently mishandles large integers sometimes.
13074 For example, "C-u 4294967297 M-x recenter" was treated as if
13075 it were "C-u 1 M-x recenter" on a typical 64-bit host.
13076
13077 * xdisp.c (try_window_id): Check Emacs fixnum range before
13078 converting to 'int'.
13079
13080 * window.c (window_scroll_line_based, Frecenter):
13081 Check that an Emacs fixnum is in range before assigning it to 'int'.
13082 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
13083 values converted from Emacs fixnums.
13084 (Frecenter): Don't wrap around a line count if it is out of 'int'
13085 range; instead, treat it as an extreme value.
13086 (Fset_window_configuration, compare_window_configurations):
13087 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
13088
13089 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
13090 that can exceed INT_MAX. Check that EMACS_INT value is in range
13091 before assigning it to the (possibly-narrower) index.
13092 (match_limit): Don't assume that a fixnum can fit in 'int'.
13093
13094 * print.c (print_object): Use ptrdiff_t, not int, for index that can
13095 exceed INT_MAX.
13096
13097 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
13098 (Fvertical_motion): Don't wrap around LINES values that don't fit
13099 in 'int'. Instead, treat them as extreme values. This is good
13100 enough for windows, which can't have more than INT_MAX lines anyway.
13101
13102 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13103
13104 * Require libxml/parser.h to avoid compilation warning.
13105
13106 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
13107
13108 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
13109 since this reportedly can destroy thread storage.
13110
13111 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
13112
13113 * syntax.c (find_defun_start): Update all cache variables if
13114 exiting early (Bug#9401).
13115
13116 2011-08-30 Eli Zaretskii <eliz@gnu.org>
13117
13118 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
13119
13120 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
13121 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
13122 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
13123
13124 * term.c (tty_append_glyph): New function.
13125 (produce_stretch_glyph): Static function and its prototype deleted.
13126
13127 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
13128 Add prototypes.
13129
13130 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
13131
13132 * image.c (parse_image_spec): Check for nonnegative, not for positive,
13133 when checking :margin (Bug#9390).
13134 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
13135 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
13136 so that the name doesn't mislead. All uses changed.
13137
13138 2011-08-28 Johan Bockgård <bojohan@gnu.org>
13139
13140 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
13141 set_tty_hooks.
13142
13143 2011-08-27 Eli Zaretskii <eliz@gnu.org>
13144
13145 * xdisp.c (move_it_to): Don't bail out early when reaching
13146 position beyond to_charpos, if we are scanning backwards.
13147 (move_it_vertically_backward): When DY == 0, make sure we get to
13148 the first character in the line after the newline.
13149
13150 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
13151
13152 * ccl.c: Improve and simplify overflow checking (Bug#9196).
13153 (ccl_driver): Do not generate an out-of-range pointer.
13154 (Fccl_execute_on_string): Remove unnecessary check for
13155 integer overflow, noted by Stefan Monnier in
13156 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
13157 Remove a FIXME that didn't need fixing.
13158 Simplify the newly-introduced buffer reallocation code.
13159
13160 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
13161
13162 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
13163
13164 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
13165
13166 Integer and memory overflow issues (Bug#9196).
13167
13168 * doc.c (get_doc_string): Rework so that
13169 get_doc_string_buffer_size is the actual buffer size, rather than
13170 being 1 less than the actual buffer size; this makes xpalloc more
13171 convenient.
13172
13173 * image.c (x_allocate_bitmap_record, cache_image):
13174 * xselect.c (Fx_register_dnd_atom):
13175 Simplify previous changes by using xpalloc.
13176
13177 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
13178 since either will do and ptrdiff_t is convenient with xpalloc.
13179
13180 * charset.c (charset_table_size)
13181 (struct charset_sort_data.priority): Now ptrdiff_t.
13182 (charset_compare): Don't overflow if priorities differ greatly.
13183 (Fsort_charsets): Don't assume list length fits in int.
13184 Check for size-calculation overflow when allocating sort data.
13185 (syms_of_charset): Allocate an initial charset table that is
13186 just under 64 KiB, to avoid problems with glibc malloc and mmap.
13187
13188 * cmds.c (internal_self_insert): Check for size-calculation overflow.
13189
13190 * composite.h (struct composition.glyph_len): Now int, not unsigned.
13191 The actual value is always <= INT_MAX, and leaving it unsigned made
13192 overflow checking harder.
13193
13194 * dispextern.h (struct glyph_matrix.rows_allocated)
13195 (struct face_cache.size): Now ptrdiff_t, for convenience in use
13196 with xpalloc. The values are still always <= INT_MAX.
13197
13198 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
13199
13200 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
13201 (SAFE_NALLOCA): New macro.
13202
13203 * region-cache.c (struct boundary.pos, find_cache_boundary)
13204 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
13205 (set_cache_region, invalidate_region_cache)
13206 (revalidate_region_cache, know_region_cache, region_cache_forward)
13207 (region_cache_backward, pp_cache):
13208 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
13209 so that ptrdiff_t * can be passed to xpalloc.
13210 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
13211 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
13212 (pp_cache): Don't assume cache_len fits in int.
13213 * region-cache.h: Adjust extern decls to match.
13214
13215 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
13216 EMACS_INT, since either will do, for xpalloc.
13217
13218 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
13219 (xnmalloc, xnrealloc, xpalloc): New functions.
13220
13221 * bidi.c (bidi_shelve_header_size): New constant.
13222 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
13223 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
13224
13225 * bidi.c (bidi_cache_shrink):
13226 * buffer.c (overlays_at, overlays_in, record_overlay_string)
13227 (overlay_strings):
13228 Don't update size of array until after memory allocation succeeds,
13229 because xmalloc/xrealloc may not return.
13230 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
13231 now that we have proper integer overflow checking.
13232 (record_overlay_string, overlay_strings): Catch overflows when
13233 calculating size of overlay_str_buf.
13234
13235 * callproc.c (Fcall_process): Check for size overflow when
13236 calculating size of args2.
13237 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
13238 Normally we prefer signed values, but sticking with ptrdiff_t would
13239 require adding more-complicated checks.
13240
13241 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
13242 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
13243 Redo buffer-overflow calculations to avoid integer overflow.
13244 Add a FIXME comment where memory seems to be over-allocated.
13245
13246 * character.c (Fstring): Check for size-calculation overflow.
13247
13248 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
13249 unnecessary integer overflow. Check for size overflow.
13250 (encode_coding_object): Don't update size until xmalloc succeeds.
13251
13252 * composite.c (get_composition_id): Check for overflow in glyph
13253 length calculations.
13254
13255 Integer and memory overflow fixes for display code.
13256 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
13257 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
13258 (scrolling_window): Check for overflow in size calculations.
13259 (line_draw_cost, realloc_glyph_pool, add_row_entry):
13260 Don't assume glyph table len fits in int.
13261 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
13262 (row_table_size): Now ptrdiff_t, not int.
13263 (scrolling_window): Avoid overflow in size calculations.
13264 Don't update size until allocation succeeds.
13265 * fns.c (concat): Check for overflow in size calculations.
13266 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
13267 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
13268 (NEXT_ALMOST_PRIME_LIMIT): New constant.
13269
13270 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
13271 (get_doc_string): Check for size calculation overflow.
13272 Don't update size until allocation succeeds.
13273 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
13274 EMACS_INT, where ptrdiff_t will do.
13275 (Fsubstitute_command_keys): Check for string overflow.
13276
13277 * editfns.c (set_time_zone_rule): Don't assume environment length
13278 fits in int.
13279 (message_length): Now ptrdiff_t, not int.
13280 (Fmessage_box): Don't update size until allocation succeeds.
13281 Don't assume message length fits in int.
13282 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
13283
13284 * emacs.c (main): Do not reallocate argv, since there is a null at
13285 the end that can be overwritten, and this way there's no need to
13286 worry about size-calculation overflow.
13287 (sort_args): Check for size-calculation overflow.
13288
13289 * eval.c (init_eval_once, grow_specpdl): Don't update size until
13290 alloc succeeds.
13291 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
13292
13293 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
13294 (x_set_scroll_bar_width, x_figure_window_size):
13295 Check for integer overflow.
13296 (x_set_alpha): Do not assume XINT fits in int.
13297
13298 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
13299 This is for the members text_lines, text_cols, total_lines, total_cols,
13300 where the system imposes an 'int' limit.
13301
13302 * fringe.c (Fdefine_fringe_bitmap):
13303 Don't update size until alloc works.
13304
13305 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
13306 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
13307
13308 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
13309 Check for size-calculation overflow.
13310 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
13311 do, as we prefer signed integers.
13312 (id_to_widget.max_size, id_to_widget.used)
13313 (xg_store_widget_in_map, xg_remove_widget_from_map)
13314 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
13315 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
13316 Use and return ptrdiff_t, not int.
13317 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
13318 * gtkutil.h: Change prototypes to match the above.
13319
13320 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
13321 are duplicate now that they've been promoted to lisp.h.
13322 (x_allocate_bitmap_record, x_alloc_image_color)
13323 (make_image_cache, cache_image, xpm_load):
13324 Don't update size until alloc is done.
13325 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
13326 (x_detect_edges):
13327 Check for size calculation overflow.
13328 (ct_colors_allocated_max): New constant.
13329 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
13330 overflow.
13331
13332 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
13333 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
13334 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
13335 Use ptrdiff_t, not int, to count maps.
13336 (read_char_minibuf_menu_prompt): Check for overflow in size
13337 calculations. Don't update size until allocation succeeds.
13338 Redo calculations to avoid overflow.
13339 * keyboard.h: Change prototypes to match the above.
13340
13341 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
13342 to count maps.
13343 (current_minor_maps): Check for size calculation overflow.
13344 * keymap.h: Change prototypes to match the above.
13345
13346 * lread.c (read1, init_obarray): Don't update size until alloc done.
13347
13348 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
13349 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
13350
13351 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
13352 Now ptrdiff_t, not int.
13353 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
13354 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
13355
13356 * process.c (Fnetwork_interface_list): Check for overflow
13357 in size calculation.
13358
13359 * region-cache.c (move_cache_gap): Check for size calculation overflow.
13360
13361 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
13362 overflow. Don't bother calling xmalloc when xrealloc will do.
13363
13364 * search.c (Freplace_match): Check for size calculation overflow.
13365 (Fset_match_data): Don't assume list lengths fit in 'int'.
13366
13367 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
13368 for command line length. Do not attempt to address one before the
13369 beginning of an array, as that's not portable.
13370
13371 * term.c (max_frame_lines): Remove; unused.
13372 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
13373 not int.
13374 (encode_terminal_code, calculate_costs): Check for size
13375 calculation overflow.
13376 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
13377 table lengths and related sizes. Don't update size until alloc
13378 done. Redo calculations to avoid overflow.
13379 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
13380
13381 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
13382 subtracting pointers.
13383 (gobble_line): Check for overflow more carefully. Don't update size
13384 until alloc done.
13385
13386 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
13387 Don't update size until alloc done.
13388 Redo size calculations to avoid overflow.
13389 Check for size calculation overflow.
13390 (main) [DEBUG]: Fix typo in invoking tparam1.
13391
13392 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
13393 Use ptrdiff_t, not int, for sizes.
13394 (store_mode_line_noprop_char): Don't update size until alloc done.
13395
13396 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
13397 Use ptrdiff_t, not int, for sizes.
13398 (Finternal_make_lisp_face, cache_face):
13399 Check for size calculation overflow.
13400 (cache_face): Treat size calculation overflows as if they were
13401 memory exhaustion (the usual treatment), rather than aborting.
13402
13403 * xfns.c (x_encode_text, x_set_name_internal)
13404 (Fx_change_window_property): Use ptrdiff_t, not int, to count
13405 sizes, since they can exceed INT_MAX in size. Check for size
13406 calculation overflow.
13407
13408 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
13409 (xg_select): Check for size calculation overflow.
13410 Don't update size until alloc done.
13411
13412 * xrdb.c (get_environ_db): Don't assume path length fits in int,
13413 as sprintf is limited to int lengths.
13414
13415 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
13416 (X_LONG_MIN): New macros.
13417 Use them to make the following changes clearer.
13418 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
13419 This change doesn't affect the value now, but it may help remind
13420 future maintainers not to raise the value too much later.
13421 (SELECTION_QUANTUM): Remove, replacing with ...
13422 (selection_quantum): ... new function, which avoids overflow.
13423 All uses changed.
13424 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
13425 assumption that selection length fits in 'int'.
13426 (x_reply_selection_request, x_handle_selection_request)
13427 (x_get_window_property, receive_incremental_selection)
13428 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
13429 (lisp_data_to_selection_data, clean_local_selection_data):
13430 Use ptrdiff_t, not int, to record length of selection.
13431 (x_reply_selection_request, x_get_window_property)
13432 (receive_incremental_selection, x_property_data_to_lisp):
13433 Redo calculations to avoid overflow.
13434 (x_reply_selection_request): When sending hint, ceiling it at
13435 X_LONG_MAX rather than relying on wraparound overflow to send
13436 something.
13437 (x_get_window_property, receive_incremental_selection)
13438 (lisp_data_to_selection_data, x_property_data_to_lisp):
13439 Check for size-calculation overflow.
13440 (x_get_window_property, receive_incremental_selection)
13441 (lisp_data_to_selection_data, Fx_register_dnd_atom):
13442 Don't store size until memory allocation succeeds.
13443 (x_get_window_property): Plug memory leak on memory exhaustion.
13444 Don't double-block input; malloc is safe here. Don't assume 2**34
13445 - 4 fits in unsigned long. Add an xassert to check
13446 XGetWindowProperty overflow. Be more careful about overflow
13447 calculations, and distinguish size from memory overflow better.
13448 (receive_incremental_selection): When tracing, don't assume
13449 unsigned int is less than INT_MAX.
13450 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
13451 harmful) conversions of unsigned short to int.
13452 (lisp_data_to_selection_data): Don't assume that integers
13453 in the range -65535 through -1 fit in an X unsigned short.
13454 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
13455 result parameters unless successful. Rely on cons_to_unsigned
13456 to report problems with elements; the old code wasn't right anyway.
13457 (x_check_property_data): Check for int overflow; we cannot use
13458 a wider type due to X limits.
13459 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
13460
13461 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
13462
13463 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
13464 (x_term_init): Check for size calculation overflow.
13465 (x_color_cells): Don't store size until memory allocation succeeds.
13466 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
13467 Don't assume alloca size is less than MAX_ALLOCA.
13468 (x_term_init): Don't assume length fits in int (sprintf is limited
13469 to int size).
13470
13471 Use ptrdiff_t for composition IDs.
13472 * character.c (lisp_string_width):
13473 * composite.c (composition_table_size, n_compositions)
13474 (get_composition_id, composition_gstring_from_id):
13475 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
13476 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
13477 * window.c (Frecenter):
13478 Use ptrdiff_t, not int, for composition IDs.
13479 * composite.c (get_composition_id): Check for integer overflow.
13480 * composite.h: Adjust prototypes to match the above changes.
13481
13482 Use ptrdiff_t for hash table indexes.
13483 * category.c (hash_get_category_set):
13484 * ccl.c (ccl_driver):
13485 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
13486 * coding.c (coding_system_charset_list, detect_coding_system):
13487 * coding.h (struct coding_system.id):
13488 * composite.c (get_composition_id, gstring_lookup_cache):
13489 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
13490 * image.c (xpm_get_color_table_h):
13491 * lisp.h (hash_lookup, hash_put):
13492 * minibuf.c (Ftest_completion):
13493 Use ptrdiff_t for hash table indexes, not int (which is too
13494 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
13495 32-bit --with-wide-int hosts).
13496
13497 * charset.c (Fdefine_charset_internal): Check for integer overflow.
13498 Add a FIXME comment about memory leaks.
13499 (syms_of_charset): Don't assume xmalloc returns.
13500
13501 Don't assume that stated character widths fit in int.
13502 * character.c (Fchar_width, c_string_width, lisp_string_width):
13503 * character.h (CHAR_WIDTH):
13504 * indent.c (MULTIBYTE_BYTES_WIDTH):
13505 Use sanitize_char_width to avoid undefined and/or bad behavior
13506 with outlandish widths.
13507 * character.h (sanitize_tab_width): Rename from sanitize_width,
13508 now that we have two such functions. All uses changed.
13509 (sanitize_char_width): New inline function.
13510
13511 Don't assume that tab-width fits in int.
13512 * character.h (sanitize_width): New inline function.
13513 (SANE_TAB_WIDTH): New macro.
13514 (ASCII_CHAR_WIDTH): Use it.
13515 * indent.c (sane_tab_width): Remove. All uses replaced by
13516 SANE_TAB_WIDTH (current_buffer).
13517 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
13518
13519 * fileio.c: Integer overflow issues with file modes.
13520 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
13521
13522 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
13523 Remove unreachable code.
13524 (read_hex, load_charset_map_from_file): Check for integer overflow.
13525
13526 * xterm.c: Don't go over XClientMessageEvent limit.
13527 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
13528 (x_send_scroll_bar_event): Likewise. Check that the size does not
13529 exceed limits imposed by XClientMessageEvent, as well as the usual
13530 ptrdiff_t and size_t limits.
13531
13532 * keyboard.c: Overflow, signedness and related fixes.
13533 (make_lispy_movement): Use same integer type in forward decl
13534 that is used in the definition.
13535 (read_key_sequence, keyremap_step):
13536 Change bufsize argument back to int, undoing my 2011-03-30 change.
13537 We prefer signed types, and int is wide enough here.
13538 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
13539 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
13540 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
13541 length, not size_t. Use ptrdiff_t for index, not int.
13542 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
13543 possibility of integer overflow.
13544
13545 Overflow, signedness and related fixes for images.
13546
13547 * dispextern.h (struct it.stack[0].u.image.image_id)
13548 (struct_it.image_id, struct image.id, struct image_cache.size)
13549 (struct image_cache.used, struct image_cache.ref_count):
13550 * gtkutil.c (update_frame_tool_bar):
13551 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
13552 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
13553 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
13554 * nsmenu.m (update_frame_tool_bar):
13555 * xdisp.c (calc_pixel_width_or_height):
13556 * xfns.c (image_cache_refcount):
13557 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
13558 on typical 64-bit hosts.
13559
13560 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
13561 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
13562 Omit unnecessary casts to int.
13563 (parse_image_spec): Check that integers fall into 'int' range
13564 when the callers expect that.
13565 (image_ascent): Redo ascent calculation to avoid int overflow.
13566 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
13567 (lookup_image): Remove unnecessary tests.
13568 (xbm_image_p): Locals are now of int, not EMACS_INT,
13569 since parse_image_check makes sure they fit into int.
13570 (png_load, gif_load, svg_load_image):
13571 Prefer int to unsigned where either will do.
13572 (tiff_handler): New function, combining the cores of the
13573 old tiff_error_handler and tiff_warning_handler.
13574 This function is rewritten to use vsnprintf and thereby avoid
13575 stack buffer overflows. It uses only the features of vsnprintf
13576 that are common to both POSIX and native Microsoft.
13577 (tiff_error_handler, tiff_warning_handler): Use it.
13578 (tiff_load, gif_load, imagemagick_load_image):
13579 Don't assume :index value fits in 'int'.
13580 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
13581 (imagemagick_load_image): Check that crop parameters fit into
13582 the integer types that MagickCropImage accepts. Don't assume
13583 Vimagemagick_render_type has a nonnegative value. Don't assume
13584 size_t fits in 'long'.
13585 (gs_load): Use printmax_t to print the widest integers possible.
13586 Check for integer overflow when computing image height and width.
13587
13588 2011-08-26 Eli Zaretskii <eliz@gnu.org>
13589
13590 * xdisp.c (redisplay_window): Don't force window start if point
13591 will be invisible in the resulting window. (Bug#9324)
13592
13593 2011-08-25 Eli Zaretskii <eliz@gnu.org>
13594
13595 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
13596 the display spec is of the form `(space ...)'.
13597 (handle_display_spec): Return the value returned by
13598 handle_single_display_spec, not just 1 or zero.
13599 (handle_single_display_spec): If the display spec is of the form
13600 `(space ...)', and specifies display in the text area, return 2
13601 rather than 1.
13602 (try_cursor_movement): Check for the need to scroll more
13603 accurately, and prefer exact match for point under bidi.
13604 Don't advance `row' beyond the last row of the window.
13605
13606 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
13607 into disp_prop; all users changed.
13608
13609 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
13610 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
13611 for the text covered by the display property.
13612
13613 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
13614
13615 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
13616 Change return value to nil.
13617 (Frecord_buffer): Delete unused function.
13618
13619 2011-08-24 Eli Zaretskii <eliz@gnu.org>
13620
13621 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
13622 buffers, return left-to-right.
13623 (set_cursor_from_row): Consider candidate row a win if its glyph
13624 represents a newline and point is on that newline. Fixes cursor
13625 positioning on the newline at EOL of R2L text within L2R
13626 paragraph, and vice versa.
13627 (try_cursor_movement): Check continued rows, in addition to
13628 continuation rows. Fixes unwarranted scroll when point enters a
13629 continued line of R2L text within an L2R paragraph, or vice versa.
13630 (cursor_row_p): Consider the case of point being equal to
13631 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
13632 from the end of a short line to the beginning of a continued line
13633 of R2L text within L2R paragraph.
13634 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
13635 composed characters.
13636
13637 * bidi.c (bidi_check_type): Use xassert.
13638 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
13639 members.
13640
13641 2011-08-23 Eli Zaretskii <eliz@gnu.org>
13642
13643 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
13644 a character.
13645
13646 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
13647
13648 * nsfont.m (ns_otf_to_script): Fix typo.
13649
13650 2011-08-22 Kenichi Handa <handa@m17n.org>
13651
13652 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
13653 extra slot even if the purpose is char-code-property-table.
13654
13655 2011-08-23 Eli Zaretskii <eliz@gnu.org>
13656
13657 * xdisp.c (redisplay_window): When computing centering_position,
13658 account for the height of the header line. (Bug#8874)
13659
13660 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
13661 instead of CHAR_TO_BYTE. Fixes a crash when a completion
13662 candidate is selected by the mouse, and that candidate has a
13663 composed character under the mouse.
13664
13665 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
13666 coordinates reported by pos-visible-in-window-p for a composed
13667 character in column zero.
13668
13669 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
13670
13671 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
13672
13673 2011-08-22 Eli Zaretskii <eliz@gnu.org>
13674
13675 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
13676 consider it a hit if to_charpos is anywhere in the range of the
13677 composed buffer positions.
13678
13679 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
13680
13681 * image.c (gif_load): Don't assume that each subimage has the same
13682 dimensions as the base image. Handle disposal method that is
13683 "undefined" by the gif spec (Bug#9335).
13684
13685 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
13686
13687 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
13688 (Fcondition_case): Document `debug' symbol in error handler.
13689
13690 2011-08-19 Eli Zaretskii <eliz@gnu.org>
13691
13692 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
13693 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
13694 from an Org mode buffer to a Speedbar frame.
13695
13696 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
13697 a composition, take its buffer position from IT->cmp_it.charpos.
13698 Fixes cursor positioning at the beginning of a line that begins
13699 with a composed character.
13700
13701 2011-08-18 Eli Zaretskii <eliz@gnu.org>
13702
13703 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
13704 character bidirectional type, use STRONG_L instead. Fixes crashes
13705 in a buffer produced by `describe-categories'.
13706
13707 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
13708 members before the level stack, so they would be saved and
13709 restored when copying iterator state. Fixes incorrect reordering
13710 around TABs covered by display properties.
13711
13712 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
13713
13714 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
13715
13716 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
13717
13718 * eval.c (internal_condition_case, internal_condition_case_1)
13719 (internal_condition_case_2, internal_condition_case_n):
13720 Remove unnecessary aborts (Bug#9081).
13721
13722 2011-08-17 Eli Zaretskii <eliz@gnu.org>
13723
13724 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
13725 has no `load' handler, try opening the file locally. (Bug#9311)
13726
13727 2011-08-16 Ken Brown <kbrown@cornell.edu>
13728
13729 * gmalloc.c: Expand comment.
13730
13731 2011-08-16 Eli Zaretskii <eliz@gnu.org>
13732
13733 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
13734 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
13735
13736 2011-08-16 Ken Brown <kbrown@cornell.edu>
13737
13738 Fix memory allocation problems in Cygwin build (Bug#9273).
13739
13740 * unexcw.c ( __malloc_initialized): Declare external variable.
13741 (fixup_executable): Force the dumped emacs to reinitialize malloc.
13742
13743 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
13744 New variables.
13745 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
13746 dumped emacs.
13747 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
13748 in the static heap.
13749 [CYGWIN] (special_realloc): New function.
13750 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
13751 requests to realloc storage in the static heap.
13752
13753 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
13754
13755 * bidi.c (bidi_initialize): Remove unused local.
13756
13757 2011-08-15 Eli Zaretskii <eliz@gnu.org>
13758
13759 * bidimirror.h:
13760 * biditype.h: Remove file.
13761 * makefile.w32-in ($(BLD)/bidi.$(O)):
13762 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
13763
13764 * dispextern.h: Fix a typo in the comment to bidi_type_t.
13765
13766 * chartab.c: Improve commentary for the uniprop_table API.
13767
13768 * bidi.c (bidi_paragraph_init): Support zero value of
13769 bidi_ignore_explicit_marks_for_paragraph_level.
13770 (bidi_initialize): Use uniprop_table instead of including
13771 biditype.h and bidimirror.h.
13772
13773 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
13774 coordinates of the iterator when restoring from ppos_it.
13775 (Bug#9296)
13776
13777 2011-08-14 Kenichi Handa <handa@m17n.org>
13778
13779 * process.c (create_process): Call setup_process_coding_systems
13780 after the pid of the process is set to -1 (Bug#8162).
13781
13782 2011-08-14 Eli Zaretskii <eliz@gnu.org>
13783
13784 * xdisp.c (move_it_in_display_line_to): Don't invoke
13785 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
13786 ppos_it. Fixes vertical cursor motion when line beginning is
13787 covered by an image. (Bug#9296)
13788
13789 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
13790
13791 * nsterm.h (ns_run_ascript): Declare.
13792 (NSAPP_DATA2_RUNASSCRIPT): Define.
13793
13794 * nsfns.m (as_script, as_result, as_status): New static variables.
13795 (ns_run_ascript): New function.
13796 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
13797 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
13798 the event loop. Get status from as_status (Bug#7276).
13799
13800 * nsterm.m (sendEvent): If event is NSApplicationDefined and
13801 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
13802 the event loop (Bug#7276).
13803
13804 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
13805
13806 * gnutls.c (QCgnutls_bootprop_priority)
13807 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
13808 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
13809 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
13810 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
13811 (QCgnutls_bootprop_verify_hostname_error)
13812 (QCgnutls_bootprop_callbacks_verify): Rename from
13813 Qgnutls_bootprop_..., all uses changed.
13814
13815 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
13816 uses changed.
13817
13818 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
13819
13820 * xfaces.c (Qframe_set_background_mode): Now static.
13821 * dispextern.h (Qframe_set_background_mode): Remove decl.
13822
13823 * process.c (Fnetwork_interface_info): Declare local only if needed.
13824
13825 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
13826
13827 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
13828 (Fnetwork_interface_list): Allocate in increments of bytes instead
13829 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
13830 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
13831 sockaddr.
13832 (struct ifflag_def): notrailers is smart on OSX.
13833 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
13834 Get hardware address with getifaddrs if available.
13835
13836 2011-08-12 Eli Zaretskii <eliz@gnu.org>
13837
13838 * xdisp.c (iterate_out_of_display_property): xassert that
13839 IT->position is set to within IT->object's boundaries. Break from
13840 the loop as soon as EOB is reached; avoids infloops in redisplay
13841 when IT->position is set up wrongly due to some bug.
13842 Set IT->current to match the bidi iterator unconditionally.
13843 (push_display_prop): Allow GET_FROM_STRING as IT->method on
13844 entry. Force push_it to save on the stack the current
13845 buffer/string position, to be restored by pop_it. Fix flags in
13846 the iterator structure wrt the object coming from a display
13847 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
13848 properties. (Bug#9284)
13849
13850 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
13851
13852 * fontset.c (fontset_get_font_group): Add proper type checks.
13853 (Bug#9172)
13854
13855 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13856
13857 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
13858 and LC_VERSION_MIN_MACOSX.
13859 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
13860 (dump_it) [LC_FUNCTION_STARTS]: Use it.
13861
13862 2011-08-08 Eli Zaretskii <eliz@gnu.org>
13863
13864 * xdisp.c (forward_to_next_line_start): Allow to use the
13865 no-display-properties-and-no-overlays under bidi display.
13866 Set disp_pos in the bidi iterator to avoid searches for display
13867 properties and overlays.
13868
13869 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
13870
13871 * editfns.c (Fset_time_zone_rule): Document relationship with the
13872 setenv function.
13873
13874 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
13875 the font entity extracted from the cache (Bug#8109).
13876
13877 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
13878
13879 * composite.c (autocmp_chars): Don't reset point. That is done by
13880 restore_point_unwind (Bug#5984).
13881
13882 2011-08-07 Juri Linkov <juri@jurta.org>
13883
13884 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
13885 to show the arg `TIME' instead of `TIMEVAL'.
13886
13887 2011-08-06 Eli Zaretskii <eliz@gnu.org>
13888
13889 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
13890 display property strides EOL and includes a newline, as in
13891 longlines-mode. (Bug#9254)
13892 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
13893 word-wrap under bidirectional display. (Bug#9224)
13894
13895 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
13896 is non-zero, even if the data buffer is NULL. Fixes a crash in
13897 vertical-motion with longlines-mode. (Bug#9254)
13898
13899 2011-08-05 Eli Zaretskii <eliz@gnu.org>
13900
13901 * bidi.c <bidi_cache_total_alloc>: Now static.
13902 (bidi_initialize): Initialize bidi_cache_total_alloc.
13903
13904 * xdisp.c (display_line): Release buffer allocated for shelved bidi
13905 cache. (Bug#9221)
13906
13907 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
13908 amount allocated this far in `bidi_cache_total_alloc'.
13909 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
13910 non-zero, only free the data buffer without restoring the cache
13911 contents. All callers changed.
13912
13913 * dispextern.h (bidi_unshelve_cache): Update prototype.
13914
13915 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
13916 (move_it_in_display_line, move_it_to)
13917 (move_it_vertically_backward, move_it_by_lines): Replace the call
13918 to xfree to an equivalent call to bidi_unshelve_cache.
13919 (move_it_in_display_line_to): Fix logic of returning
13920 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
13921
13922 2011-08-05 Eli Zaretskii <eliz@gnu.org>
13923
13924 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
13925 came from a string character with a `cursor' property. (Bug#9229)
13926
13927 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13928
13929 * Makefile.in (LIB_PTHREAD): New variable.
13930 (LIBES): Add LIB_PTHREAD (Bug#9216).
13931
13932 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
13933 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
13934
13935 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
13936
13937 * regex.c (re_iswctype): Remove some redundant boolean conversions.
13938
13939 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13940
13941 * xterm.c (x_find_topmost_parent): New function.
13942 (x_set_frame_alpha): Find topmost parent window with
13943 x_find_topmost_parent and set the property there also (bug#9181).
13944 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
13945
13946 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
13947
13948 * callproc.c (Fcall_process): Avoid vfork clobbering
13949 the local vars buffer, coding_systems, current_dir.
13950
13951 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
13952
13953 * keymap.c (Fmake_composed_keymap): Move to subr.el.
13954
13955 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
13956
13957 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
13958 so that it is not optimized away.
13959
13960 * xdisp.c (compute_display_string_pos): Remove unused local.
13961
13962 2011-08-02 Eli Zaretskii <eliz@gnu.org>
13963
13964 Fix slow cursor motion and scrolling in large buffers with
13965 selective display, like Org Mode buffers. (Bug#9218)
13966
13967 * dispextern.h (struct bidi_it): New member disp_prop_p.
13968
13969 * xdisp.c: Remove one-slot cache of display string positions.
13970 (compute_display_string_pos): Accept an additional argument
13971 DISP_PROP_P; callers changed. Scan at most 5K characters forward
13972 for a display string or property. If found, set DISP_PROP_P
13973 non-zero.
13974
13975 * bidi.c (bidi_fetch_char): Accept an additional argument
13976 DISP_PROP_P, and pass it to compute_display_string_pos.
13977 Only handle text covered by a display string if DISP_PROP_P is returned
13978 non-zero. All callers of bidi_fetch_char changed.
13979
13980 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
13981
13982 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
13983
13984 2010-12-03 Don March <don@ohspite.net>
13985
13986 * keymap.c (Fdefine_key): Fix non-prefix key error message when
13987 last character M-[char] is translated to ESC [char] (bug#7541).
13988
13989 2011-08-02 Kenichi Handa <handa@m17n.org>
13990
13991 * lisp.h (uniprop_table): Extern it.
13992
13993 * chartab.c (uniprop_table): Make it non-static.
13994
13995 2011-08-01 Eli Zaretskii <eliz@gnu.org>
13996
13997 * xdisp.c (forward_to_next_line_start): Accept additional argument
13998 BIDI_IT_PREV, and store into it the state of the bidi iterator had
13999 on the newline.
14000 (reseat_at_next_visible_line_start): Use the bidi iterator state
14001 returned by forward_to_next_line_start to restore the state of
14002 it->bidi_it after backing up to previous newline. (Bug#9212)
14003
14004 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
14005
14006 * regex.c (re_comp): Protoize.
14007 (re_exec): Fix return type.
14008 (regexec): Fix type of `ret'. (Bug#9203)
14009
14010 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14011
14012 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
14013 This is needed if max-image-size is a floating-point number.
14014
14015 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
14016
14017 * print.c (print_object): Print empty symbol as ##.
14018
14019 * lread.c (read1): Read ## as empty symbol.
14020
14021 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
14022
14023 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
14024 setting frame foreground color (Bug#9175).
14025 (x_set_background_color): Likewise.
14026
14027 * nsmenu.m (-setText): Size tooltip dimensions precisely to
14028 contents (Bug#9176).
14029 (EmacsTooltip -init): Remove bezels and add shadows to
14030 tooltip windows.
14031
14032 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
14033 or scroll bar (Bug#8470).
14034
14035 * nsfont.m (nsfont_open): Remove assignment to voffset and
14036 unnecessary vars hshink, expand, hd, full_height, min_height.
14037 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
14038
14039 * nsterm.h (nsfont_info): Remove voffset field.
14040
14041 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
14042
14043 Implement strike-through and overline on NextStep (Bug#8863).
14044
14045 * nsfont.m (nsfont_open): Use underline position provided by font,
14046 instead of hard-coded value of 2.
14047 (nsfont_draw): Call ns_draw_text_decoration instead.
14048
14049 * nsterm.h: Add declaration for ns_draw_text_decoration.
14050
14051 * nsterm.m (ns_draw_text_decoration): New function for drawing
14052 underline, overline, and strike-through.
14053 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
14054 ns_draw_text_decoration. Change treatment of cursor drawing to
14055 accommodate underlining, etc.
14056
14057 2011-07-28 Eli Zaretskii <eliz@gnu.org>
14058
14059 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
14060 default.
14061
14062 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14063
14064 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
14065 Without this fix, if a signal arrives just after memory fills up,
14066 'malloc' might be invoked reentrantly.
14067
14068 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
14069 In other words, assume that every image size is allowed, on non-X
14070 hosts. This assumption is probably wrong, but it lets Emacs compile.
14071
14072 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
14073
14074 * regex.c (re_iswctype): Convert return values to boolean.
14075
14076 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
14077
14078 * xdisp.c (compute_display_string_pos): Don't use cached display
14079 string position if the buffer had its restriction changed.
14080 (Bug#9184)
14081
14082 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14083
14084 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14085
14086 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14087
14088 Integer signedness and overflow and related fixes. (Bug#9079)
14089
14090 * bidi.c: Integer size and overflow fixes.
14091 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
14092 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
14093 (bidi_cache_find_level_change, bidi_cache_ensure_space)
14094 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
14095 (bidi_find_other_level_edge):
14096 Use ptrdiff_t instead of EMACS_INT where either will do.
14097 This works better on 32-bit hosts configured --with-wide-int.
14098 (bidi_cache_ensure_space): Check for size-calculation overflow.
14099 Use % rather than repeated addition, for better worst-case speed.
14100 Don't set bidi_cache_size until after xrealloc returns, because it
14101 might not return.
14102 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
14103 (bidi_cache_ensure_space): Also check that the bidi cache size
14104 does not exceed that of the largest Lisp string or buffer. See Eli
14105 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
14106
14107 * alloc.c (__malloc_size_t): Remove.
14108 All uses replaced by size_t. See Andreas Schwab's note
14109 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
14110
14111 * image.c: Improve checking for integer overflow.
14112 (check_image_size): Assume that f is nonnull, since
14113 it is always nonnull in practice. This is one less thing to
14114 worry about when checking for integer overflow later.
14115 (x_check_image_size): New function, which checks for integer
14116 overflow issues inside X.
14117 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
14118 This removes the need for a memory_full check.
14119 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
14120 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
14121 (xbm_read_bitmap_data): Change locals back to 'int', since
14122 their values must fit in 'int'.
14123 (xpm_load_image, png_load, tiff_load):
14124 Invoke x_create_x_image_and_pixmap earlier,
14125 to avoid much needless work if the image is too large.
14126 (tiff_load): Treat overly large images as if
14127 x_create_x_image_and_pixmap failed, not as malloc failures.
14128 (gs_load): Use x_check_image_size.
14129
14130 * gtkutil.c: Omit integer casts.
14131 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
14132 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
14133
14134 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
14135
14136 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
14137 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
14138 would wrongly return t on a 64-bit host.
14139
14140 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
14141 The plain *_OVERFLOW macros run afoul of GCC bug 49705
14142 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
14143 and therefore cause GCC to emit a bogus diagnostic in some cases.
14144
14145 * image.c: Integer signedness and overflow and related fixes.
14146 This is not an exhaustive set of fixes, but it's time to
14147 record what I've got.
14148 (lookup_pixel_color, check_image_size): Remove redundant decls.
14149 (check_image_size): Don't assume that arbitrary EMACS_INT values
14150 fit in 'int', or that arbitrary 'double' values fit in 'int'.
14151 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
14152 (tiff_load, imagemagick_load_image):
14153 Check for overflow in size calculations.
14154 (x_create_x_image_and_pixmap): Remove unnecessary test for
14155 xmalloc returning NULL; that can't happen.
14156 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
14157 (xpm_color_bucket): Use better integer hashing function.
14158 (xpm_cache_color): Don't possibly over-allocate memory.
14159 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
14160 (gif_memory_source):
14161 Use ptrdiff_t, not int or size_t, to record sizes.
14162 (png_load): Don't assume values greater than 2**31 fit in 'int'.
14163 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
14164 either works, as we prefer signed integers.
14165 (tiff_read_from_memory, tiff_write_from_memory):
14166 Return tsize_t, not size_t, since that's what the TIFF API wants.
14167 (tiff_read_from_memory): Don't fail simply because the read would
14168 go past EOF; instead, return a short read.
14169 (tiff_load): Omit no-longer-needed casts.
14170 (Fimagemagick_types): Don't assume size fits into 'int'.
14171
14172 Improve hashing quality when configured --with-wide-int.
14173 * fns.c (hash_string): New function, taken from sxhash_string.
14174 Do not discard information about ASCII character case; this
14175 discarding is no longer needed.
14176 (sxhash-string): Use it. Change sig to match it. Caller changed.
14177 * lisp.h: Declare it.
14178 * lread.c (hash_string): Remove, since we now use fns.c's version.
14179 The fns.c version returns a wider integer if --with-wide-int is
14180 specified, so this should help the quality of the hashing a bit.
14181
14182 * emacs.c: Integer overflow minor fix.
14183 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
14184 Define only if GNU_LINUX.
14185 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
14186
14187 * dispnew.c: Integer signedness and overflow fixes.
14188 Remove unnecessary forward decls, that were a maintenance hassle.
14189 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
14190 All uses changed.
14191 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
14192 (scrolling_window): Use ptrdiff_t, not int, for byte count.
14193 (prepare_desired_row, line_draw_cost):
14194 Use int, not unsigned, where either works.
14195 (save_current_matrix, restore_current_matrix):
14196 Use ptrdiff_t, not size_t, where either works.
14197 (init_display): Check for overflow more accurately, and without
14198 relying on undefined behavior.
14199
14200 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
14201 Remove, replacing with the new symbols in lisp.h. All uses changed.
14202 * fileio.c (make_temp_name):
14203 * filelock.c (lock_file_1, lock_file):
14204 * xdisp.c (message_dolog):
14205 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
14206 Use pMd etc. instead.
14207 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
14208 replacing the pWIDE etc. symbols removed from editfns.c.
14209
14210 * keyboard.h (num_input_events): Now uintmax_t.
14211 This is (very slightly) less likely to mess up due to wraparound.
14212 All uses changed.
14213
14214 * buffer.c: Integer signedness fixes.
14215 (alloc_buffer_text, enlarge_buffer_text):
14216 Use ptrdiff_t rather than size_t when either will do, as we prefer
14217 signed integers.
14218
14219 * alloc.c: Integer signedness and overflow fixes.
14220 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
14221 (__malloc_size_t): Default to size_t, not to int.
14222 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
14223 (Fgarbage_collect, mark_object_loop_halt, mark_object):
14224 Prefer ptrdiff_t to size_t when either would do, as we prefer
14225 signed integers.
14226 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
14227 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
14228 Now const. Initialize with values that are in range even if char
14229 is signed.
14230 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
14231 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
14232 These functions do the right thing with sizes > 2**32.
14233 (check_depth): Now ptrdiff_t, not int.
14234 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
14235 Adjust to new way of storing sizes. Check for size overflow bugs
14236 in rest of code.
14237 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
14238 slightly wrong anyway, as it missed one instance of
14239 XMALLOC_OVERRUN_CHECK_OVERHEAD.
14240 (refill_memory_reserve): Omit needless cast to size_t.
14241 (mark_object_loop_halt): Mark as externally visible.
14242
14243 * xselect.c: Integer signedness and overflow fixes.
14244 (Fx_register_dnd_atom, x_handle_dnd_message):
14245 Use ptrdiff_t, not size_t, since we prefer signed.
14246 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
14247 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
14248 x_dnd_atoms_size and x_dnd_atoms_length.
14249
14250 * doprnt.c: Prefer signed to unsigned when either works.
14251 * eval.c (verror):
14252 * doprnt.c (doprnt):
14253 * lisp.h (doprnt):
14254 * xdisp.c (vmessage):
14255 Use ptrdiff_t, not size_t, when using or implementing doprnt,
14256 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
14257 prefer signed arithmetic to avoid comparison confusion.
14258 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
14259 but is a bit tricky.
14260
14261 Assume freestanding C89 headers, string.h, stdlib.h.
14262 * data.c, doprnt.c, floatfns.c, print.c:
14263 Include float.h unconditionally.
14264 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
14265 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
14266 * regex.c: Likewise for stddef.h, string.h.
14267 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
14268 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
14269 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
14270 (STDC_HEADERS): Remove obsolete defines.
14271 * sysdep.c: Include limits.h unconditionally.
14272
14273 Assume support for memcmp, memcpy, memmove, memset.
14274 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
14275 * regex.c (memcmp, memcpy):
14276 Remove; we assume C89 now.
14277
14278 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
14279 (__malloc_safe_bcopy): Remove; no longer needed.
14280
14281 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
14282 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
14283 well either way, and we prefer signed to unsigned.
14284
14285 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
14286
14287 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
14288 closes the connection while we're reading (bug#9182).
14289
14290 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
14291
14292 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
14293 are specified (Bug#9168).
14294
14295 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
14296
14297 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
14298 Found by GCC static checking and --with-wide-int on a 32-bit host.
14299
14300 2011-07-25 Eli Zaretskii <eliz@gnu.org>
14301
14302 * xdisp.c (compute_display_string_pos): Fix logic of caching
14303 previous display string position. Initialize cached_prev_pos to
14304 -1. Fixes slow-down at the beginning of a buffer.
14305
14306 2011-07-24 Eli Zaretskii <eliz@gnu.org>
14307
14308 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
14309 for attrs[LFACE_FONTSET_INDEX].
14310
14311 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
14312
14313 * xml.c (parse_region): Remove unused local
14314 that was recently introduced.
14315
14316 2011-07-23 Eli Zaretskii <eliz@gnu.org>
14317
14318 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
14319 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
14320
14321 * xdisp.c (move_it_in_display_line_to): Record the best matching
14322 position for TO_CHARPOS while scanning the line, and restore it on
14323 exit if none of the characters scanned was an exact match.
14324 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
14325 when exact match is impossible due to invisible text, and the
14326 lines are truncated.
14327
14328 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
14329
14330 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
14331 for OSX >= 10.7.
14332
14333 2011-07-22 Eli Zaretskii <eliz@gnu.org>
14334
14335 Fix a significant slow-down of cursor motion with C-n, C-p,
14336 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
14337 auto-repeat under bidi redisplay in fontified buffers.
14338 * xdisp.c (compute_stop_pos_backwards): New function.
14339 (next_element_from_buffer): Call compute_stop_pos_backwards to
14340 find a suitable prev_stop when we find ourselves before
14341 base_level_stop.
14342 (reseat): Don't look for prev_stop, as that could mean a very long
14343 run.
14344 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
14345 <cached_disp_overlay_modiff>: Cache for last found display string
14346 position.
14347 (compute_display_string_pos): Return the cached position if asked
14348 about the same buffer in the same area of character positions, and
14349 the buffer wasn't changed since the time the display string
14350 position was cached.
14351
14352 2011-07-22 Eli Zaretskii <eliz@gnu.org>
14353
14354 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
14355 is an integer, which is important for empty lines. (Bug#9149)
14356
14357 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
14358
14359 * frame.c (Fmodify_frame_parameters): In tty case, update the
14360 default face if necessary (Bug#4238).
14361
14362 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
14363
14364 * editfns.c (Fstring_to_char): No need to explain what a character
14365 is in the docstring (Bug#6576).
14366
14367 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
14368
14369 * xml.c (parse_region): Make sure we always return a tree.
14370
14371 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
14372
14373 * xml.c (parse_region): If a document contains only comments,
14374 return that, too.
14375
14376 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
14377
14378 * xml.c (make_dom): Return comments, too.
14379
14380 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
14381
14382 Port to OpenBSD.
14383 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
14384 and the surrounding thread.
14385 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
14386 rather than fgets, and retry after EINTR. Otherwise, 'emacs
14387 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
14388 timer goes off.
14389 * s/openbsd.h (BROKEN_SIGIO): Define.
14390 * unexelf.c (unexec) [__OpenBSD__]:
14391 Don't update the .mdebug section of the Alpha COFF symbol table.
14392
14393 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
14394
14395 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
14396 (bug#8460).
14397
14398 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
14399
14400 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
14401 This fixes some race conditions on the permissions of any newly
14402 created file.
14403
14404 * alloc.c (valid_pointer_p): Use pipe, not open.
14405 This fixes some permissions issues when debugging.
14406
14407 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
14408 If fchown fails to set both uid and gid, try to set just gid,
14409 as that is sometimes allowed. Adjust the file's mode to eliminate
14410 setuid or setgid bits that are inappropriate if fchown fails.
14411
14412 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
14413
14414 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
14415 to compare Lisp_Objects.
14416 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
14417 global_gnutls_log_level, don't mistake it for a Lisp_Object.
14418 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
14419
14420 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
14421
14422 * lread.c (read_integer): Unread even EOF character.
14423 (read1): Likewise. Properly record start position of symbol.
14424
14425 * lread.c (read1): Read `#:' as empty uninterned symbol if no
14426 symbol character follows.
14427
14428 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
14429
14430 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
14431 This works around a problem with the previous change to Fcopy_file.
14432 Recent glibc declares fchown with __attribute__((warn_unused_result)),
14433 and without this change, GCC might complain about discarding
14434 fchown's return value.
14435
14436 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
14437
14438 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
14439
14440 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
14441
14442 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
14443
14444 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
14445
14446 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
14447 it's used from the C level.
14448
14449 * process.c: Use the same condition for POLL_FOR_INPUT in both
14450 keyboard.c and process.c (bug#1858).
14451
14452 2011-07-09 Lawrence Mitchell <wence@gmx.li>
14453
14454 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
14455 (Fgnutls_boot): Use it.
14456
14457 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
14458
14459 * doc.c (Fsubstitute_command_keys): Revert last change.
14460
14461 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
14462
14463 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
14464 quotes the next character, and doesn't affect other longer
14465 sequences (bug#8935).
14466
14467 * lread.c (syms_of_lread): Clarify that is isn't only
14468 `eval-buffer' and `eval-defun' that's affected by
14469 `lexical-binding' (bug#8460).
14470
14471 2011-07-15 Eli Zaretskii <eliz@gnu.org>
14472
14473 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
14474 bidi redisplay when a line includes both an image and is truncated.
14475
14476 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
14477
14478 Fix minor problems found by static checking.
14479 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
14480 (elsz): Now a signed constant, not a size_t var. We prefer signed
14481 types to unsigned, to avoid integer comparison confusion. Without
14482 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
14483 "cannot optimize loop, the loop counter may overflow", a symptom
14484 of the confusion.
14485 * indent.c (Fvertical_motion): Mark locals as initialized.
14486 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
14487
14488 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
14489
14490 * search.c (Fre_search_backward): Mention `case-fold-search' in
14491 all the re_search_* functions (bug#8138).
14492
14493 * keyboard.c (Fopen_dribble_file): Document when the file is
14494 closed (bug#8056).
14495
14496 2011-07-14 Eli Zaretskii <eliz@gnu.org>
14497
14498 * bidi.c (bidi_dump_cached_states): Fix format of displaying
14499 bidi_cache_idx.
14500
14501 Support bidi reordering of display and overlay strings.
14502 * xdisp.c (compute_display_string_pos)
14503 (compute_display_string_end): Accept additional argument STRING.
14504 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
14505 (reseat_to_string): Initialize bidi_it->string.s and
14506 bidi_it->string.schars.
14507 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
14508 NULL (avoids a crash in bidi_paragraph_init).
14509 Initialize itb.string.lstring.
14510 (init_iterator): Call bidi_init_it only of a valid
14511 buffer position was specified. Initialize paragraph_embedding to
14512 L2R.
14513 (reseat_to_string): Initialize the bidi iterator.
14514 (display_string): If we need to ignore text properties of
14515 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
14516 original value of -1 will not work with bidi.)
14517 (compute_display_string_pos): First arg is now struct
14518 `text_pos *'; all callers changed. Support display properties on
14519 Lisp strings.
14520 (compute_display_string_end): Support display properties on Lisp
14521 strings.
14522 (init_iterator, reseat_1, reseat_to_string): Initialize the
14523 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
14524 when iterating on a string not from display properties).
14525 (compute_display_string_pos, compute_display_string_end):
14526 Fix calculation of the object to scan. Fixes an error when using
14527 arrow keys.
14528 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
14529 base_level_stop; instead, set base_level_stop to BEGV.
14530 Fixes crashes in vertical-motion.
14531 (next_element_from_buffer): Improve commentary for when
14532 the iterator is before prev_stop.
14533 (init_iterator): Initialize bidi_p from the default value of
14534 bidi-display-reordering, not from buffer-local value. Use the
14535 buffer-local value only if initializing for buffer iteration.
14536 (handle_invisible_prop): Support invisible properties on strings
14537 that are being bidi-reordered.
14538 (set_iterator_to_next): Support bidi reordering of C strings and
14539 Lisp strings.
14540 (next_element_from_string): Support bidi reordering of Lisp
14541 strings.
14542 (handle_stop_backwards): Support Lisp strings as well.
14543 (display_string): Support display of R2L glyph rows.
14544 Use IT_STRING_CHARPOS when displaying from a Lisp string.
14545 (init_iterator): Don't initialize it->bidi_p for strings
14546 here.
14547 (reseat_to_string): Initialize it->bidi_p for strings here.
14548 (next_element_from_string, next_element_from_c_string)
14549 (next_element_from_buffer): Add xassert's for correspondence
14550 between IT's object being iterated and it->bidi_it.string
14551 structure.
14552 (face_before_or_after_it_pos): Support bidi iteration.
14553 (next_element_from_c_string): Handle the case of the first string
14554 character that is not the first one in the visual order.
14555 (get_visually_first_element): New function, refactored from common
14556 parts of next_element_from_buffer, next_element_from_string, and
14557 next_element_from_c_string.
14558 (tool_bar_lines_needed, redisplay_tool_bar)
14559 (display_menu_bar): Force left-to-right direction. Add a FIXME
14560 comment for making that be controlled by a user option.
14561 (push_it, pop_it): Save and restore the state of the
14562 bidi iterator. Save and restore the bidi_p flag.
14563 (pop_it): Iterate out of display property for string iteration as
14564 well.
14565 (iterate_out_of_display_property): Support iteration over strings.
14566 (handle_single_display_spec): Set up it->bidi_it for iteration
14567 over a display string, and call bidi_init_it.
14568 (handle_single_display_spec, next_overlay_string)
14569 (get_overlay_strings_1, push_display_prop): Set up the bidi
14570 iterator for displaying display or overlay strings.
14571 (forward_to_next_line_start): Don't use the shortcut if
14572 bidi-iterating.
14573 (back_to_previous_visible_line_start): If handle_display_prop
14574 pushed the iterator stack, restore the internal state of the bidi
14575 iterator by calling bidi_pop_it same number of times.
14576 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
14577 and we are bidi-iterating, don't decrement the iterator position;
14578 instead, set the first_elt flag in the bidi iterator, to produce
14579 the same effect.
14580 (reseat_1): Remove redundant setting of string_from_display_prop_p.
14581 (push_display_prop): xassert that we are iterating a buffer.
14582 (push_it, pop_it): Save and restore paragraph_embedding member.
14583 (handle_single_display_spec, next_overlay_string)
14584 (get_overlay_strings_1, reseat_1, reseat_to_string)
14585 (push_display_prop): Set up the `unibyte' member of bidi_it.string
14586 correctly. Don't assume unibyte strings are not bidi-reordered.
14587 (compute_display_string_pos)
14588 (compute_display_string_end): Fix handling the case of C string.
14589 (push_it, pop_it): Save and restore from_disp_prop_p.
14590 (handle_single_display_spec, push_display_prop): Set the
14591 from_disp_prop_p flag.
14592 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
14593 (pop_it): Call iterate_out_of_display_property only if we are
14594 popping after iteration over a string that came from a display
14595 property. Fix a typo in popping stretch info. Add an assertion
14596 for verifying that the iterator position is in sync with the bidi
14597 iterator.
14598 (handle_single_display_spec, get_overlay_strings_1)
14599 (push_display_prop): Fix initialization of paragraph direction for
14600 string when that of the parent object is not yet determined.
14601 (reseat_1): Call bidi_init_it to resync the bidi
14602 iterator with IT's position. (Bug#7616)
14603 (find_row_edges): If ROW->start.pos gives position
14604 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
14605 (handle_stop, back_to_previous_visible_line_start, reseat_1):
14606 Reset the from_disp_prop_p flag.
14607 (SAVE_IT, RESTORE_IT): New macros.
14608 (pos_visible_p, face_before_or_after_it_pos)
14609 (back_to_previous_visible_line_start)
14610 (move_it_in_display_line_to, move_it_in_display_line)
14611 (move_it_to, move_it_vertically_backward, move_it_by_lines)
14612 (try_scrolling, redisplay_window, display_line): Use them when
14613 saving a temporary copy of the iterator and restoring it back.
14614 (back_to_previous_visible_line_start, reseat_1)
14615 (init_iterator): Empty the bidi cache "stack".
14616 (move_it_in_display_line_to): If iterator ended up at
14617 EOL, but we never saw any buffer positions smaller than
14618 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
14619 motion in bidi-reordered lines.
14620 (move_it_in_display_line_to): Record prev_method and prev_pos
14621 immediately before the call to set_iterator_to_next. Fixes cursor
14622 motion in bidi-reordered lines with stretch glyphs and strings
14623 displayed in margins. (Bug#8133) (Bug#8867)
14624 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
14625 TO_CHARPOS.
14626 (pos_visible_p): Support positions in bidi-reordered lines.
14627 Save and restore bidi cache.
14628
14629 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
14630 (bidi_paragraph_info): Delete unused struct.
14631 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
14632 (bidi_cache_start): New variable.
14633 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
14634 to zero.
14635 (bidi_cache_fetch_state, bidi_cache_search)
14636 (bidi_cache_find_level_change, bidi_cache_iterator_state)
14637 (bidi_cache_find, bidi_peek_at_next_level)
14638 (bidi_level_of_next_char, bidi_find_other_level_edge)
14639 (bidi_move_to_visually_next): Compare cache index with
14640 bidi_cache_start rather than with zero.
14641 (bidi_fetch_char): Accept new argument STRING; all callers
14642 changed. Support iteration over a string. Support strings with
14643 display properties. Support unibyte strings. Fix the type of
14644 `len' according to what STRING_CHAR_AND_LENGTH expects.
14645 (bidi_paragraph_init, bidi_resolve_explicit_1)
14646 (bidi_resolve_explicit, bidi_resolve_weak)
14647 (bidi_level_of_next_char, bidi_move_to_visually_next):
14648 Support iteration over a string.
14649 (bidi_set_sor_type, bidi_resolve_explicit_1)
14650 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
14651 can now be zero (for strings); special values 0 and -1 were
14652 changed to -1 and -2, respectively.
14653 (bidi_char_at_pos): New function.
14654 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
14655 Call it instead of FETCH_MULTIBYTE_CHAR.
14656 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
14657 initialized to valid values.
14658 (bidi_init_it): Don't initialize charpos and bytepos with invalid
14659 values.
14660 (bidi_level_of_next_char): Allow the sentinel "position" to pass
14661 the test for valid cached positions. Fix the logic for looking up
14662 the sentinel state in the cache. GCPRO the Lisp string we are
14663 iterating.
14664 (bidi_push_it, bidi_pop_it): New functions.
14665 (bidi_initialize): Initialize the bidi cache start stack pointer.
14666 (bidi_cache_ensure_space): New function, refactored from part of
14667 bidi_cache_iterator_state. Don't assume the required size is just
14668 one BIDI_CACHE_CHUNK away.
14669 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
14670 (bidi_count_bytes, bidi_char_at_pos): New functions.
14671 (bidi_cache_search): Don't assume bidi_cache_last_idx is
14672 always valid if bidi_cache_idx is valid.
14673 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
14674 is valid if it's going to be used.
14675 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
14676 (bidi_cache_fetch_state, bidi_cache_search)
14677 (bidi_cache_find_level_change, bidi_cache_ensure_space)
14678 (bidi_cache_iterator_state, bidi_cache_find)
14679 (bidi_find_other_level_edge, bidi_cache_start_stack):
14680 All variables related to cache indices are now EMACS_INT.
14681
14682 * dispextern.h (struct bidi_string_data): New structure.
14683 (struct bidi_it): New member `string'. Make flag members be 1-bit
14684 fields, and put them last in the struct.
14685 (compute_display_string_pos, compute_display_string_end):
14686 Update prototypes.
14687 (bidi_push_it, bidi_pop_it): Add prototypes.
14688 (struct iterator_stack_entry): New members bidi_p,
14689 paragraph_embedding, and from_disp_prop_p.
14690 (struct it): Member bidi_p is now a bit field 1 bit wide.
14691 (bidi_shelve_cache, bidi_unshelve_cache):
14692 Declare prototypes.
14693
14694 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
14695 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
14696 and vector-like objects.
14697
14698 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
14699 cache around display iteration.
14700
14701 * window.c (Fwindow_end, window_scroll_pixel_based)
14702 (displayed_window_lines, Frecenter): Save and restore the bidi
14703 cache around display iteration.
14704
14705 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
14706
14707 * editfns.c (Fdelete_region): Clarify the use of the named
14708 parameters (bug#6788).
14709
14710 2011-07-14 Martin Rudalics <rudalics@gmx.at>
14711
14712 * indent.c (Fvertical_motion): Set and restore w->pointm when
14713 saving and restoring the window's buffer (Bug#9006).
14714
14715 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
14716
14717 * editfns.c (Fstring_to_char): Clarify just what is returned
14718 (bug#6576). Text by Eli Zaretskii.
14719
14720 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
14721
14722 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
14723
14724 2011-07-13 Eli Zaretskii <eliz@gnu.org>
14725
14726 * buffer.c (mmap_find): Fix a typo.
14727
14728 2011-07-13 Johan Bockgård <bojohan@gnu.org>
14729
14730 Fix execution of x selection hooks.
14731 * xselect.c (Qx_lost_selection_functions)
14732 (Qx_sent_selection_functions): New vars.
14733 (syms_of_xselect): DEFSYM them.
14734 (x_handle_selection_request): Pass Qx_sent_selection_functions
14735 rather than Vx_sent_selection_functions to Frun_hook_with_args.
14736 (x_handle_selection_clear,x_clear_frame_selections):
14737 Pass Qx_lost_selection_functions rather than
14738 Vx_lost_selection_functions to Frun_hook_with_args.
14739
14740 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
14741
14742 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
14743 The old code sometimes used this field without initializing it.
14744
14745 * alloc.c (gc_sweep): Don't read past end of array.
14746 In theory, the old code could also have corrupted Emacs internals,
14747 though it'd be very unlikely.
14748
14749 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
14750
14751 * character.c (Fcharacterp): Don't advertise optional ignored
14752 argument. (Bug#4026)
14753
14754 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
14755
14756 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
14757 key" (bug#4257).
14758
14759 * window.c (Fset_window_start): Doc fix (bug#4199).
14760 (Fset_window_hscroll): Ditto.
14761
14762 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
14763
14764 Fix minor new problems caught by GCC 4.6.1.
14765 * term.c (init_tty): Remove unused local.
14766 * xsettings.c (store_monospaced_changed): Define this function only
14767 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
14768 not used otherwise.
14769
14770 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
14771
14772 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
14773
14774 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
14775
14776 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
14777 are the mini-buffer and the echo area (bug#3320).
14778
14779 * term.c (init_tty): Remove support for supdup, c10 and perq
14780 terminals, which are no longer supported (bug#1482).
14781
14782 2011-07-10 Johan Bockgård <bojohan@gnu.org>
14783
14784 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
14785
14786 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
14787
14788 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
14789 for non-popups (Bug#3642).
14790
14791 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
14792
14793 * alloc.c (reset_malloc_hooks): Protoize.
14794 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
14795 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
14796 * cm.c (losecursor): Likewise.
14797 * data.c (fmod): Likewise.
14798 * dispnew.c (swap_glyphs_in_rows): Likewise.
14799 * emacs.c (memory_warning_signal): Likewise.
14800 * floatfns.c (float_error): Likewise.
14801 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
14802 (otf_open, font_otf_capability, generate_otf_features)
14803 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
14804 Likewise.
14805 * image.c (pbm_read_file): Likewise.
14806 * indent.c (string_display_width): Likewise.
14807 * intervals.c (check_for_interval, search_for_interval)
14808 (inc_interval_count, count_intervals, root_interval)
14809 (adjust_intervals_for_insertion, make_new_interval): Likewise.
14810 * lread.c (defalias): Likewise.
14811 * ralloc.c (r_alloc_check): Likewise.
14812 * regex.c (set_image_of_range_1, set_image_of_range)
14813 (regex_grow_registers): Likewise.
14814 * sysdep.c (strerror): Likewise.
14815 * termcap.c (valid_filename_p, tprint, main): Likewise.
14816 * tparam.c (main): Likewise.
14817 * unexhp9k800.c (run_time_remap, save_data_space)
14818 (update_file_ptrs, read_header, write_header, calculate_checksum)
14819 (copy_file, copy_rest, display_header): Likewise.
14820 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
14821 Likewise.
14822 * xdisp.c (check_it): Likewise.
14823 * xfaces.c (register_color, unregister_color, unregister_colors):
14824 Likewise.
14825 * xfns.c (print_fontset_result): Likewise.
14826 * xrdb.c (member, fatal, main): Likewise.
14827
14828 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
14829
14830 Fix minor problems found by static checking (Bug#9031).
14831 * chartab.c (char_table_set_range, map_sub_char_table):
14832 Remove unused locals.
14833 (uniprop_table): Now static.
14834 * composite.c (_work_char): Remove unused static var.
14835
14836 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
14837
14838 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
14839
14840 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
14841
14842 * gtkutil.c (qttip_cb): Remove code without function.
14843
14844 2011-07-09 Eli Zaretskii <eliz@gnu.org>
14845
14846 * w32.c (pthread_sigmask): New stub.
14847
14848 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
14849
14850 Use pthread_sigmask, not sigprocmask (Bug#9010).
14851 sigprocmask is portable only for single-threaded applications, and
14852 Emacs can be multi-threaded when it uses GTK.
14853 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
14854 (LIBES): Use it.
14855 * callproc.c (Fcall_process):
14856 * process.c (create_process):
14857 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
14858 Use pthread_sigmask, not sigprocmask.
14859
14860 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14861
14862 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
14863 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
14864 wrong (Bug#8591).
14865
14866 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14867
14868 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
14869 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
14870 (xg_hide_tooltip): Fix comment.
14871
14872 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
14873 in registerServicesMenuSendTypes.
14874 (validRequestorForSendType): Don't check ns_return_types.
14875
14876 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
14877 ns_return_type.
14878
14879 2011-07-08 Jason Rumney <jasonr@gnu.org>
14880
14881 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
14882 SH_SHOW for hidden windows (Bug#5482).
14883
14884 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
14885 frame struct members of non-existent frames (Bug#6284).
14886
14887 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14888
14889 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
14890 variable firstTime not needed on OSX >= 10.6.
14891 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
14892 >= 10.5. Use setKnobProportion, setDoubleValue.
14893
14894 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
14895 (MAC_OS_X_VERSION_10_5): Define if not defined.
14896 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
14897 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
14898 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
14899
14900 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
14901 cString and lossyCString on OSX >= 10.4.
14902
14903 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
14904 sizeToFit on OSX >= 10.2.
14905
14906 * nsimage.m (allocInitFromFile): Don't use deprecated method
14907 bestRepresentationForDevice on OSX >= 10.6.
14908
14909 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
14910 to avoid warning.
14911
14912 * emacs.c: Declare unexec_init_emacs_zone.
14913
14914 * nsgui.h: Fix compiler warning about gnulib redefining verify.
14915
14916 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
14917
14918 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
14919 on svcsMenu (Bug#8842).
14920
14921 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
14922 ns_return_types.
14923 (Fns_list_services): Just return Qnil on 10.6, code not working there.
14924
14925 * nsterm.m (QUTF8_STRING): Declare.
14926 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
14927 (validRequestorForSendType): Return type is (id).
14928 Change indexOfObjectIdenticalTo to indexOfObject.
14929 Check if we have local selection before returning self (Bug#8842).
14930 (writeSelectionToPasteboard): Put local selection into paste board
14931 if we have a local selection (Bug#8842).
14932 (syms_of_nsterm): DEFSYM QUTF8_STRING.
14933
14934 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
14935 (ns_get_local_selection): Declare.
14936
14937 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
14938
14939 * keymap.c (describe_map_tree): Don't insert a double newline at
14940 the end of the buffer (bug#1169) and return whether we inserted
14941 something.
14942
14943 * callint.c (Fcall_interactively): Change "reading args" to
14944 "providing args" to try to clarify what it does (bug#1010).
14945
14946 2011-07-07 Kenichi Handa <handa@m17n.org>
14947
14948 * composite.c (composition_compute_stop_pos): Ignore a static
14949 composition starting before CHARPOS (Bug#8915).
14950
14951 * xdisp.c (handle_composition_prop): Likewise.
14952
14953 2011-07-07 Eli Zaretskii <eliz@gnu.org>
14954
14955 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
14956 (Bug#9015)
14957
14958 2011-07-07 Kenichi Handa <handa@m17n.org>
14959
14960 * character.h (unicode_category_t): New enum type.
14961
14962 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
14963 (Qchar_code_property_table): New variable.
14964 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
14965 (UNIPROP_COMPRESSED_FORM_P): New macros.
14966 (char_table_ascii): Uncompress the compressed values.
14967 (sub_char_table_ref): New arg is_uniprop. Callers changed.
14968 Uncompress the compressed values.
14969 (sub_char_table_ref_and_range): Likewise.
14970 (char_table_ref_and_range): Uncompress the compressed values.
14971 (sub_char_table_set): New arg is_uniprop. Callers changed.
14972 Uncompress the compressed values.
14973 (sub_char_table_set_range): Args changed. Callers changed.
14974 (char_table_set_range): Adjuted for the above change.
14975 (map_sub_char_table): Delete args default_val and parent. Add arg
14976 top. Give decoded values to a Lisp function.
14977 (map_char_table): Adjust for the above change. Give decoded
14978 values to a Lisp function. Gcpro more variables.
14979 (uniprop_table_uncompress)
14980 (uniprop_decode_value_run_length): New functions.
14981 (uniprop_decoder, uniprop_decoder_count): New variables.
14982 (uniprop_get_decoder, uniprop_encode_value_character)
14983 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
14984 New functions.
14985 (uniprop_encoder, uniprop_encoder_count): New variables.
14986 (uniprop_get_encoder, uniprop_table)
14987 (Funicode_property_table_internal, Fget_unicode_property_internal)
14988 (Fput_unicode_property_internal): New functions.
14989 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
14990 Sunicode_property_table_internal, Sget_unicode_property_internal,
14991 and Sput_unicode_property_internal. Defvar_lisp
14992 char-code-property-alist.
14993
14994 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
14995 Vunicode_category_table.
14996
14997 * font.c (font_range): Adjust for the change of
14998 Vunicode_category_table.
14999
15000 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
15001
15002 * m/iris4d.h: Remove file, move contents ...
15003 * s/irix6-5.h: ... here.
15004
15005 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
15006
15007 Remove unportable assumption about struct layout (Bug#8884).
15008 * alloc.c (mark_buffer):
15009 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
15010 (clone_per_buffer_values): Don't assume that
15011 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
15012 This isn't true in general, and it's particularly not true
15013 if Emacs is configured with --with-wide-int.
15014 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
15015 New macros, used in the buffer.c change.
15016
15017 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
15018
15019 * xsettings.c: Use both GConf and GSettings if both are available.
15020 (store_config_changed_event): Add comment.
15021 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
15022 (store_tool_bar_style_changed): New functions.
15023 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
15024 (struct xsettings): Move font inside HAVE_XFT.
15025 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
15026 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
15027 Move inside HAVE_XFT.
15028 (something_changed_gsettingsCB): Rename from something_changedCB.
15029 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
15030 also.
15031 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
15032 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
15033 (something_changed_gconfCB): Rename from something_changedCB.
15034 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
15035 (parse_settings): Move check for font inside HAVE_XFT.
15036 (read_settings, apply_xft_settings): Add comment.
15037 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
15038 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
15039 call store_font_name_changed.
15040 (xft_settings_event): Add comment.
15041 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
15042 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
15043 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
15044 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
15045 (xsettings_initialize): Call init_gsettings last.
15046 (xsettings_get_system_font, xsettings_get_system_normal_font):
15047 Add comment.
15048
15049 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
15050
15051 Random fixes. E.g., (random) never returned negative values.
15052 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
15053 subseconds part to the entropy, as that's a bit more random.
15054 Prefer signed to unsigned, since the signedness doesn't matter and
15055 in general we prefer signed. When given a limit, use a
15056 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
15057 latter isn't right if USE_2_TAGS_FOR_INTS.
15058 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
15059 not 0..VALMASK. Don't discard "excess" bits that random () returns.
15060
15061 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
15062
15063 * textprop.c (text_property_stickiness):
15064 Obey Vtext_property_default_nonsticky.
15065 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
15066 * w32fns.c (syms_of_w32fns):
15067 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
15068
15069 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
15070
15071 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
15072 This is more efficient than Ffile_directory_p and avoids a minor race.
15073
15074 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
15075
15076 * buffer.c (Foverlay_put): Say what the return value is
15077 (bug#7835).
15078
15079 * fileio.c (barf_or_query_if_file_exists): Check first if the file
15080 is a directory before asking whether to use the file name
15081 (bug#7564).
15082 (barf_or_query_if_file_exists): Make the "File is a directory"
15083 error be more correct.
15084
15085 * fns.c (Frequire): Remove the mention of the .gz files, since
15086 that's installation-specific, but keep the mention of
15087 `get-load-suffixes'.
15088
15089 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
15090
15091 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
15092 Report string overflow if the output is too long.
15093
15094 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
15095
15096 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
15097 (syms_of_gnutls): Remove duplicate DEFSYM for
15098 Qgnutls_bootprop_verify_hostname_error, an error for
15099 Qgnutls_bootprop_verify_error (which is no longer used).
15100
15101 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
15102 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
15103 Also (re)move comments that are misplaced or no longer relevant.
15104
15105 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15106
15107 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
15108
15109 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
15110
15111 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
15112 and background color parameters if they have been changed.
15113
15114 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15115
15116 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
15117
15118 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
15119
15120 * xsettings.c (SYSTEM_FONT): Define only when used.
15121 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
15122
15123 * keymap.c (access_keymap_1): Now static.
15124
15125 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
15126
15127 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
15128 leave any prefix arg for the up event (Bug#1586).
15129
15130 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
15131
15132 * lread.c (syms_of_lread): Mention single symbols defined by
15133 `defvar' or `defconst' (bug#7154).
15134
15135 * fns.c (Frequire): Mention .el.gz files (bug#7314).
15136 (Frequire): Mention get-load-suffixes.
15137
15138 2011-07-02 Martin Rudalics <rudalics@gmx.at>
15139
15140 * window.h (window): Remove clone_number slot.
15141 * window.c (Fwindow_clone_number, Fset_window_clone_number):
15142 Remove.
15143 (make_parent_window, make_window, saved_window)
15144 (Fset_window_configuration, save_window_save): Don't deal with
15145 clone numbers.
15146 * buffer.c (Qclone_number): Remove declaration.
15147 (sort_overlays, overlay_strings): Don't deal with clone numbers.
15148
15149 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
15150
15151 Add multiple inheritance to keymaps.
15152 * keymap.c (Fmake_composed_keymap): New function.
15153 (Fset_keymap_parent): Simplify.
15154 (fix_submap_inheritance): Remove.
15155 (access_keymap_1): New function extracted from access_keymap to handle
15156 embedded parents and handle lists of maps.
15157 (access_keymap): Use it.
15158 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
15159 (Fcopy_keymap): Handle embedded parents.
15160 (Fcommand_remapping, define_as_prefix): Simplify.
15161 (Fkey_binding): Simplify.
15162 (syms_of_keymap): Move minibuffer-local-completion-map,
15163 minibuffer-local-filename-completion-map,
15164 minibuffer-local-must-match-map, and
15165 minibuffer-local-filename-must-match-map to Elisp.
15166 (syms_of_keymap): Defsubr make-composed-keymap.
15167 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
15168 (parse_menu_item): Trivial simplification.
15169
15170 2011-07-01 Glenn Morris <rgm@gnu.org>
15171
15172 * Makefile.in (SETTINGS_LIBS): Fix typo.
15173
15174 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15175
15176 * coding.c (Fencode_coding_string): Record the last coding system
15177 used, as the function doc string says (bug#8738).
15178
15179 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
15180
15181 * xsettings.c (store_monospaced_changed): Take new font as arg and
15182 check for change against current_mono_font.
15183 (EMACS_TYPE_SETTINGS): Remove this and related defines.
15184 (emacs_settings_constructor, emacs_settings_get_property)
15185 (emacs_settings_set_property, emacs_settings_class_init)
15186 (emacs_settings_init, gsettings_obj): Remove.
15187 (something_changedCB): New function for HAVE_GSETTINGS.
15188 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
15189 with value as argument.
15190 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
15191 g_settings_new (Bug#8967). Do not create gsettings_obj.
15192 Remove calls to g_settings_bind. Connect something_changedCB to
15193 "changed".
15194
15195 * xgselect.c: Add defined (HAVE_GSETTINGS).
15196 (xgselect_initialize): Ditto.
15197
15198 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
15199 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
15200 xg_select.
15201
15202 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
15203
15204 * eval.c (struct backtrace): Simplify and port the data structure.
15205 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
15206 signed bit field, as this assumption is not portable and it makes
15207 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
15208 "char debug_on_exit : 1" as this is not portable either; instead,
15209 use the portable "unsigned int debug_on_exit : 1". Remove unused
15210 member evalargs. Remove obsolete comments about cc bombing out.
15211
15212 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
15213
15214 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
15215 Let HAVE_GSETTINGS override HAVE_GCONF.
15216 (store_monospaced_changed): New function.
15217 (EMACS_SETTINGS): A new type derived from GObject to handle
15218 GSettings notifications.
15219 (emacs_settings_constructor, emacs_settings_get_property)
15220 (emacs_settings_set_property, emacs_settings_class_init):
15221 New functions.
15222 (gsettings_client, gsettings_obj): New variables.
15223 (GSETTINGS_SCHEMA): New define.
15224 (something_changedCB): Call store_monospaced_changed.
15225 (init_gsettings): New function.
15226 (xsettings_initialize): Call init_gsettings.
15227 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
15228 to NULL.
15229
15230 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
15231 GCONF_CFLAGS/LIBS.
15232
15233 2011-06-29 Martin Rudalics <rudalics@gmx.at>
15234
15235 * window.c (resize_root_window, grow_mini_window)
15236 (shrink_mini_window): Rename Qresize_root_window to
15237 Qwindow_resize_root_window and Qresize_root_window_vertically to
15238 Qwindow_resize_root_window_vertically.
15239
15240 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
15241
15242 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
15243
15244 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
15245
15246 * makefile.w32-in: Redesign dependencies so they reflect more
15247 clearly which files are directly included by each source file,
15248 and not through other includes.
15249
15250 2011-06-27 Martin Rudalics <rudalics@gmx.at>
15251
15252 * buffer.c (Qclone_number): Declare static and DEFSYM it.
15253 (sort_overlays, overlay_strings): When an overlay's clone number
15254 matches the window's clone number process the overlay even if
15255 the overlay's window property doesn't match the current window.
15256
15257 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
15258 (Fwindow_hchild): Rename to Fwindow_left_child.
15259 (Fwindow_next): Rename to Fwindow_next_sibling.
15260 (Fwindow_prev): Rename to Fwindow_prev_sibling.
15261 (resize_window_check): Rename to window_resize_check.
15262 (resize_window_apply): Rename to window_resize_apply.
15263 (Fresize_window_apply): Rename to Fwindow_resize_apply.
15264 (Fdelete_other_windows_internal, resize_frame_windows)
15265 (Fsplit_window_internal, Fdelete_window_internal)
15266 (grow_mini_window, shrink_mini_window)
15267 (Fresize_mini_window_internal): Fix callers accordingly.
15268
15269 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
15270
15271 * emacsgtkfixed.h: State that this is only used with Gtk+3.
15272 (emacs_fixed_set_min_size): Remove.
15273 (emacs_fixed_new): Take frame as argument.
15274
15275 * emacsgtkfixed.c: State that this is only used with Gtk+3.
15276 (_EmacsFixedPrivate): Remove minwidth/height.
15277 Add struct frame *f.
15278 (emacs_fixed_init): Initialize priv->f.
15279 (get_parent_class, emacs_fixed_set_min_size): Remove.
15280 (emacs_fixed_new): Set priv->f to argument.
15281 (emacs_fixed_get_preferred_width)
15282 (emacs_fixed_get_preferred_height): Use min_width/height from
15283 frames size_hint to set minimum and natural (Bug#8919).
15284 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
15285 and use min_width/height from frames size_hint to set
15286 min_width/height (Bug#8919).
15287
15288 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
15289 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
15290 Fix indentation.
15291
15292 2011-06-26 Eli Zaretskii <eliz@gnu.org>
15293
15294 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
15295 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
15296 called at ZV.
15297
15298 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
15299
15300 * process.c (wait_reading_process_output): Bypass select if
15301 waiting for a cell while ignoring keyboard input, and input is
15302 pending. Suggested by Jan Djärv (Bug#8869).
15303
15304 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
15305
15306 Use gnulib's dup2 module instead of rolling our own.
15307 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
15308
15309 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15310
15311 * dispnew.c (scrolling_window): Before scrolling, turn off a
15312 mouse-highlight in the window being scrolled.
15313
15314 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
15315
15316 Move DEFSYM to lisp.h and use everywhere.
15317
15318 * character.h (DEFSYM): Move declaration...
15319 * lisp.h (DEFSYM): ...here.
15320
15321 * gnutls.c:
15322 * minibuf.c:
15323 * w32menu.c:
15324 * w32proc.c:
15325 * w32select.c: Don't include character.h.
15326
15327 * alloc.c (syms_of_alloc):
15328 * buffer.c (syms_of_buffer):
15329 * bytecode.c (syms_of_bytecode):
15330 * callint.c (syms_of_callint):
15331 * casefiddle.c (syms_of_casefiddle):
15332 * casetab.c (init_casetab_once):
15333 * category.c (init_category_once, syms_of_category):
15334 * ccl.c (syms_of_ccl):
15335 * cmds.c (syms_of_cmds):
15336 * composite.c (syms_of_composite):
15337 * dbusbind.c (syms_of_dbusbind):
15338 * dired.c (syms_of_dired):
15339 * dispnew.c (syms_of_display):
15340 * doc.c (syms_of_doc):
15341 * editfns.c (syms_of_editfns):
15342 * emacs.c (syms_of_emacs):
15343 * eval.c (syms_of_eval):
15344 * fileio.c (syms_of_fileio):
15345 * fns.c (syms_of_fns):
15346 * frame.c (syms_of_frame):
15347 * fringe.c (syms_of_fringe):
15348 * insdel.c (syms_of_insdel):
15349 * keymap.c (syms_of_keymap):
15350 * lread.c (init_obarray, syms_of_lread):
15351 * macros.c (syms_of_macros):
15352 * msdos.c (syms_of_msdos):
15353 * print.c (syms_of_print):
15354 * process.c (syms_of_process):
15355 * search.c (syms_of_search):
15356 * sound.c (syms_of_sound):
15357 * syntax.c (init_syntax_once, syms_of_syntax):
15358 * terminal.c (syms_of_terminal):
15359 * textprop.c (syms_of_textprop):
15360 * undo.c (syms_of_undo):
15361 * w32.c (globals_of_w32):
15362 * window.c (syms_of_window):
15363 * xdisp.c (syms_of_xdisp):
15364 * xfaces.c (syms_of_xfaces):
15365 * xfns.c (syms_of_xfns):
15366 * xmenu.c (syms_of_xmenu):
15367 * xsettings.c (syms_of_xsettings):
15368 * xterm.c (syms_of_xterm): Use DEFSYM.
15369
15370 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
15371
15372 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
15373
15374 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
15375
15376 Integer and buffer overflow fixes (Bug#8873).
15377
15378 * print.c (printchar, strout): Check for string overflow.
15379 (PRINTPREPARE, printchar, strout):
15380 Don't set size unless allocation succeeds.
15381
15382 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
15383 for sizes. Check for string overflow more accurately.
15384 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
15385
15386 * macros.c: Integer and buffer overflow fixes.
15387 * keyboard.h (struct keyboard.kbd_macro_bufsize):
15388 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
15389 Use ptrdiff_t, not int, for sizes.
15390 Don't increment bufsize until after realloc succeeds.
15391 Check for size-calculation overflow.
15392 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
15393
15394 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
15395
15396 * lread.c: Integer overflow fixes.
15397 (read_integer): Radix is now EMACS_INT, not int,
15398 to improve quality of diagnostics for out-of-range radices.
15399 Calculate buffer size correctly for out-of-range radices.
15400 (read1): Check for integer overflow in radices, and in
15401 read-circle numbers.
15402 (read_escape): Avoid int overflow.
15403 (Fload, openp, read_buffer_size, read1)
15404 (substitute_object_recurse, read_vector, read_list, map_obarray):
15405 Use ptrdiff_t, not int, for sizes.
15406 (read1): Use EMACS_INT, not int, for sizes.
15407 Check for size overflow.
15408
15409 * image.c (cache_image): Check for size arithmetic overflow.
15410
15411 * lread.c: Integer overflow issues.
15412 (saved_doc_string_size, saved_doc_string_length)
15413 (prev_saved_doc_string_size, prev_saved_doc_string_length):
15414 Now ptrdiff_t, not int.
15415 (read1): Don't assume doc string length fits in int. Check for
15416 out-of-range doc string lengths.
15417 (read_list): Don't assume file position fits in int.
15418 (read_escape): Check for hex character overflow.
15419
15420 2011-06-22 Leo Liu <sdl.web@gmail.com>
15421
15422 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
15423 Move to minibuffer.el.
15424
15425 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
15426
15427 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
15428 The following patches are for when GLYPH_DEBUG && !XASSERT.
15429 * dispextern.h (trace_redisplay_p, dump_glyph_string):
15430 * dispnew.c (flush_stdout):
15431 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
15432 Mark as externally visible.
15433 * dispnew.c (check_window_matrix_pointers): Now static.
15434 * dispnew.c (window_to_frame_vpos):
15435 * xfns.c (unwind_create_frame):
15436 * xterm.c (x_check_font): Remove unused local.
15437 * scroll.c (CHECK_BOUNDS):
15438 * xfaces.c (cache_fache): Rename local to avoid shadowing.
15439 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
15440 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
15441 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
15442 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
15443 Now static.
15444 (debug_method_add): Use va_list and vsprintf rather than relying
15445 on undefined behavior with wrong number of arguments.
15446 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
15447 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
15448 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
15449 since we're not interested in debugging glyphs with old libraries.
15450 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
15451 GCC 4.6.0's static checking.
15452
15453 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
15454
15455 Integer overflow and signedness fixes (Bug#8873).
15456 A few related buffer overrun fixes, too.
15457
15458 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
15459
15460 * dispextern.h (struct face.stipple):
15461 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
15462 (x_bitmap_mask, x_allocate_bitmap_record)
15463 (x_create_bitmap_from_data, x_create_bitmap_from_file)
15464 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
15465 (x_create_bitmap_from_xpm_data):
15466 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
15467 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
15468 (.bitmaps_last):
15469 * xfaces.c (load_pixmap):
15470 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
15471 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
15472 (.bitmaps_last, struct x_output.icon_bitmap):
15473 Use ptrdiff_t, not int, for bitmap indexes.
15474 (x_allocate_bitmap_record): Check for size overflow.
15475 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
15476
15477 Use ptrdiff_t, not int, for overlay counts.
15478 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
15479 * editfns.c (overlays_around, get_pos_property):
15480 * textprop.c (get_char_property_and_overlay):
15481 * xdisp.c (next_overlay_change, note_mouse_highlight):
15482 * xfaces.c (face_at_buffer_position):
15483 * buffer.c (OVERLAY_COUNT_MAX): New macro.
15484 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
15485 (Fnext_overlay_change, Fprevious_overlay_change)
15486 (mouse_face_overlay_overlaps, Foverlays_in):
15487 Use ptrdiff_t, not int, for sizes.
15488 (overlays_at, overlays_in): Check for size-calculation overflow.
15489
15490 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
15491
15492 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
15493 (x_session_initialize): Do not assume string length fits in int.
15494
15495 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
15496 This is unlikely, but can occur if DPI is outlandish.
15497
15498 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
15499 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
15500
15501 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
15502 * xrdb.c (magic_file_p, search_magic_path):
15503 Omit last arg SUFFIX; it was always 0. All callers changed.
15504 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
15505
15506 * xfont.c (xfont_match): Avoid need for strlen.
15507
15508 * xfns.c: Don't assume strlen fits in int.
15509 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
15510
15511 * xdisp.c (message_log_check_duplicate): Return intmax_t,
15512 not unsigned long, as we prefer signed integers. All callers changed.
15513 Detect integer overflow in repeat count.
15514 (message_dolog): Don't assume print length fits in 39 bytes.
15515 (display_mode_element): Don't assume strlen fits in int.
15516
15517 * termcap.c: Don't assume sizes fit in int and never overflow.
15518 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
15519 (gobble_line): Check for size-calculation overflow.
15520
15521 * minibuf.c (Fread_buffer):
15522 * lread.c (intern, intern_c_string):
15523 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
15524 Don't assume string length fits in int.
15525
15526 * keyboard.c (parse_tool_bar_item):
15527 * gtkutil.c (style_changed_cb): Avoid need for strlen.
15528
15529 * font.c: Don't assume string length fits in int.
15530 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
15531 Use ptrdiff_t, not int.
15532 (font_intern_prop): Don't assume string length fits in int.
15533 Don't assume integer property fits in fixnum.
15534 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
15535
15536 * filelock.c: Fix some buffer overrun and integer overflow issues.
15537 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
15538 Reformulate so as not to need the command string.
15539 Invoke gzip -cd rather than gunzip, as it's more portable.
15540 (lock_info_type, lock_file_1, lock_file):
15541 Don't assume pid_t and time_t fit in unsigned long.
15542 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
15543 (current_lock_owner): Prefer signed type for sizes.
15544 Use memcpy, not strncpy, where memcpy is what is really wanted.
15545 Don't assume (via atoi) that time_t and pid_t fit in int.
15546 Check for time_t and/or pid_t out of range, e.g., via a network share.
15547 Don't alloca where an auto var works fine.
15548
15549 * fileio.c: Fix some integer overflow issues.
15550 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
15551 Don't assume string length fits in int.
15552 (directory_file_name): Don't assume string length fits in long.
15553 (make_temp_name): Don't assume pid fits in int, or that its print
15554 length is less than 20.
15555
15556 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
15557
15558 * coding.c (make_subsidiaries): Don't assume string length fits in int.
15559
15560 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
15561
15562 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
15563 We prefer signed integers, even for size calculations.
15564
15565 * emacs.c: Don't assume string length fits in 'int'.
15566 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
15567 (main): Don't invoke strlen when not needed.
15568
15569 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
15570 (XD_DEBUG_MESSAGE): Don't waste a byte.
15571
15572 * callproc.c (getenv_internal_1, getenv_internal)
15573 (Fgetenv_internal):
15574 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
15575
15576 * lread.c (invalid_syntax): Omit length argument.
15577 All uses changed. This doesn't fix a bug, but it simplifies the
15578 code away from its former Hollerith-constant appearance, and it's
15579 one less 'int' to worry about when looking at integer-overflow issues.
15580 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
15581
15582 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
15583 This didn't break anything, but it didn't help either.
15584 It's confusing to put a bogus integer in a place where the actual
15585 value does not matter.
15586 (LIST_END_P): Remove unused macro and its bogus comment.
15587 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
15588
15589 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
15590 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
15591 implementation.
15592 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
15593 We prefer signed types, and the value cannot exceed the EMACS_INT
15594 range anyway (because otherwise the length would not be representable).
15595 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
15596 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
15597 This avoids a GCC warning when WIDE_EMACS_INT.
15598
15599 * indent.c (sane_tab_width): New function.
15600 (current_column, scan_for_column, Findent_to, position_indentation)
15601 (compute_motion): Use it. This is just for clarity.
15602 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
15603
15604 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
15605
15606 * lisp.h (lint_assume): New macro.
15607 * composite.c (composition_gstring_put_cache):
15608 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
15609
15610 * editfns.c, insdel.c:
15611 Omit unnecessary forward decls, to simplify future changes.
15612
15613 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
15614
15615 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
15616
15617 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
15618 Use much-faster test for byte-length change.
15619 Don't assume string byte-length fits in 'int'.
15620 Check that character arg fits in 'int'.
15621 (mapcar1): Declare byte as byte, for clarity.
15622
15623 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
15624
15625 * fns.c (concat): Catch string overflow earlier.
15626 Do not rely on integer wraparound.
15627
15628 * dispextern.h (struct it.overlay_strings_charpos)
15629 (struct it.selective): Now EMACS_INT, not int.
15630 * xdisp.c (forward_to_next_line_start)
15631 (back_to_previous_visible_line_start)
15632 (reseat_at_next_visible_line_start, next_element_from_buffer):
15633 Don't arbitrarily truncate the value of 'selective' to int.
15634
15635 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
15636
15637 * composite.c: Don't truncate sizes to 'int'.
15638 (composition_gstring_p, composition_reseat_it)
15639 (composition_adjust_point): Use EMACS_INT, not int.
15640 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
15641 not EMACS_UINT, for indexes.
15642
15643 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
15644
15645 * buffer.c: Include <verify.h>.
15646 (struct sortvec.priority, struct sortstr.priority):
15647 Now EMACS_INT, not int.
15648 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
15649 (struct sortstr.size, record_overlay_string)
15650 (struct sortstrlist.size, struct sortlist.used):
15651 Don't truncate size to int.
15652 (record_overlay_string): Check for size-calculation overflow.
15653 (init_buffer_once): Check at compile-time, not run-time.
15654
15655 2011-06-22 Jim Meyering <meyering@redhat.com>
15656
15657 Don't leak an XBM-image-sized buffer
15658 * image.c (xbm_load): Free the image buffer after using it.
15659
15660 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
15661
15662 Port to Sun C.
15663 * composite.c (find_automatic_composition): Omit needless 'return 0;'
15664 that Sun C diagnosed.
15665 * fns.c (secure_hash): Fix pointer signedness issue.
15666 * intervals.c (static_offset_intervals): New function.
15667 (offset_intervals): Use it.
15668
15669 2011-06-21 Leo Liu <sdl.web@gmail.com>
15670
15671 * deps.mk (fns.o):
15672 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
15673 sha512.h.
15674
15675 * fns.c (secure_hash): Rename from crypto_hash_function and change
15676 the first arg to accept symbols.
15677 (Fsecure_hash): New primitive.
15678 (syms_of_fns): New symbols.
15679
15680 2011-06-20 Deniz Dogan <deniz@dogan.se>
15681
15682 * process.c (Fset_process_buffer): Clarify return value in
15683 docstring.
15684
15685 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
15686
15687 * dispnew.c (add_window_display_history): Use BVAR.
15688
15689 * xdisp.c (debug_method_add): Use BVAR.
15690 (check_window_end, dump_glyph_matrix, dump_glyph)
15691 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
15692
15693 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
15694 Likewise.
15695
15696 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
15697 check till after the cache is created in init_frame_faces.
15698
15699 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
15700
15701 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
15702
15703 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
15704
15705 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
15706 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
15707 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
15708
15709 Improve buffer-overflow checking (Bug#8873).
15710 * fileio.c (Finsert_file_contents):
15711 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
15712 Remove the old (too-loose) buffer overflow checks.
15713 They weren't needed, since make_gap checks for buffer overflow.
15714 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
15715 The old code merely checked for Emacs fixnum overflow, and relied
15716 on undefined (wraparound) behavior. The new code avoids undefined
15717 behavior, and also checks for ptrdiff_t and/or size_t overflow.
15718
15719 * editfns.c (Finsert_char): Don't dump core with very negative counts.
15720 Tune. Don't use wider integers than needed. Don't use alloca.
15721 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
15722
15723 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
15724
15725 * insdel.c, lisp.h (buffer_overflow): New function.
15726 (insert_from_buffer_1, replace_range, replace_range_2):
15727 * insdel.c (make_gap_larger):
15728 * editfns.c (Finsert_char):
15729 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
15730
15731 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
15732
15733 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
15734
15735 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
15736
15737 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
15738 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
15739
15740 * fileio.c: Don't assume EMACS_INT fits in off_t.
15741 (emacs_lseek): New static function.
15742 (Finsert_file_contents, Fwrite_region): Use it.
15743 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
15744
15745 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
15746
15747 * fns.c: Don't overflow int when computing a list length.
15748 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
15749 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
15750 truncation on 64-bit hosts. Check for QUIT every
15751 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
15752 faster and is responsive enough.
15753 (Flength): Report an error instead of overflowing an integer.
15754 (Fsafe_length): Return a float if the value is not representable
15755 as a fixnum. This shouldn't happen except in contrived situations.
15756 (Fnthcdr, Fsort): Don't assume list length fits in int.
15757 (Fcopy_sequence): Don't assume vector length fits in int.
15758
15759 * alloc.c: Check that resized vectors' lengths fit in fixnums.
15760 (header_size, word_size): New constants.
15761 (allocate_vectorlike): Don't check size overflow here.
15762 (allocate_vector): Check it here instead, since this is the only
15763 caller of allocate_vectorlike that could cause overflow.
15764 Check that the new vector's length is representable as a fixnum.
15765
15766 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
15767 The previous code was bogus. For example, next_almost_prime (32)
15768 returned 39, which is undesirable as it is a multiple of 3; and
15769 next_almost_prime (24) returned 25, which is a multiple of 5 so
15770 why was the code bothering to check for multiples of 7?
15771
15772 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
15773
15774 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
15775
15776 Variadic C functions now count arguments with ptrdiff_t.
15777 This partly undoes my 2011-03-30 change, which replaced int with size_t.
15778 Back then I didn't know that the Emacs coding style prefers signed int.
15779 Also, in the meantime I found a few more instances where arguments
15780 were being counted with int, which may truncate counts on 64-bit
15781 machines, or EMACS_INT, which may be unnecessarily wide.
15782 * lisp.h (struct Lisp_Subr.function.aMANY)
15783 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
15784 Arg counts are now ptrdiff_t, not size_t.
15785 All variadic functions and their callers changed accordingly.
15786 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
15787 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
15788 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
15789 * callint.c (Fcall_interactively): Check arg count for overflow,
15790 to avoid potential buffer overrun. Use signed char, not 'int',
15791 for 'varies' array, so that we needn't bother to check its size
15792 calculation for overflow.
15793 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
15794 * eval.c (apply_lambda):
15795 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
15796 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
15797 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
15798
15799 * callint.c (Fcall_interactively): Don't use index var as event count.
15800
15801 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
15802 * mem-limits.h (SIZE): Remove; no longer used.
15803
15804 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
15805
15806 Remove unnecessary casts.
15807 * xterm.c (x_term_init):
15808 * xfns.c (x_set_border_pixel):
15809 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
15810 These aren't needed now that we assume ANSI C.
15811
15812 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
15813 It's more likely to cause problems (due to unsigned overflow)
15814 than to cure them.
15815
15816 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
15817
15818 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
15819
15820 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
15821
15822 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
15823
15824 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
15825
15826 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
15827
15828 GLYPH_CODE_FACE returns EMACS_INT, not int.
15829 * dispextern.h (merge_faces):
15830 * xfaces.c (merge_faces):
15831 * xdisp.c (get_next_display_element, next_element_from_display_vector):
15832 Don't assume EMACS_INT fits in int.
15833
15834 * character.h (CHAR_VALID_P): Remove unused parameter.
15835 * fontset.c, lisp.h, xdisp.c: All uses changed.
15836
15837 * editfns.c (Ftranslate_region_internal): Omit redundant test.
15838
15839 * fns.c (concat): Minor tuning based on overflow analysis.
15840 This doesn't fix any bugs. Use int to hold character, instead
15841 of constantly refetching from Emacs object. Use XFASTINT, not
15842 XINT, for value known to be a character. Don't bother comparing
15843 a single byte to 0400, as it's always less.
15844
15845 * floatfns.c (Fexpt):
15846 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
15847
15848 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
15849 for characters.
15850
15851 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
15852
15853 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
15854 Without this fix, on a 64-bit host (aset S 0 4294967386) would
15855 incorrectly succeed when S was a string, because 4294967386 was
15856 truncated before it was used.
15857
15858 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
15859 Otherwise, an out-of-range integer could cause undefined behavior
15860 on a 64-bit host.
15861
15862 * composite.c: Use int, not EMACS_INT, for characters.
15863 (fill_gstring_body, composition_compute_stop_pos): Use int, not
15864 EMACS_INT, for values that are known to be in character range.
15865 This doesn't fix any bugs but is the usual style inside Emacs and
15866 may generate better code on 32-bit machines.
15867
15868 Make sure a 64-bit char is never passed to ENCODE_CHAR.
15869 This is for reasons similar to the recent CHAR_STRING fix.
15870 * charset.c (Fencode_char): Check that character arg is actually
15871 a character. Pass an int to ENCODE_CHAR.
15872 * charset.h (ENCODE_CHAR): Verify that the character argument is no
15873 wider than 'int', as a compile-time check to prevent future regressions
15874 in this area.
15875
15876 * character.c (char_string): Remove unnecessary casts.
15877
15878 Make sure a 64-bit char is never passed to CHAR_STRING.
15879 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
15880 by silently ignoring the top 32 bits, allowing some values
15881 that were far too large to be valid characters.
15882 * character.h: Include <verify.h>.
15883 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
15884 arguments are no wider than unsigned, as a compile-time check
15885 to prevent future regressions in this area.
15886 * data.c (Faset):
15887 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
15888 (Fsubst_char_in_region):
15889 * fns.c (concat):
15890 * xdisp.c (decode_mode_spec_coding):
15891 Adjust to CHAR_STRING's new requirement.
15892 * editfns.c (Finsert_char, Fsubst_char_in_region):
15893 * fns.c (concat): Check that character args are actually
15894 characters. Without this test, these functions did the wrong
15895 thing with wildly out-of-range values on 64-bit hosts.
15896
15897 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
15898 These casts should not be needed on 32-bit hosts, either.
15899 * keyboard.c (read_char):
15900 * lread.c (Fload): Remove casts to unsigned.
15901
15902 * lisp.h (UNSIGNED_CMP): New macro.
15903 This fixes comparison bugs on 64-bit hosts.
15904 (ASCII_CHAR_P): Use it.
15905 * casefiddle.c (casify_object):
15906 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
15907 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
15908 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
15909 * dispextern.h (FACE_FROM_ID):
15910 * keyboard.c (read_char): Use UNSIGNED_CMP.
15911
15912 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
15913 not to EMACS_INT, to avoid GCC warning.
15914
15915 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
15916
15917 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
15918 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
15919 isn't needed on 32-bit machines.
15920
15921 * buffer.c (Fgenerate_new_buffer_name):
15922 Use EMACS_INT for count, not int.
15923 (advance_to_char_boundary): Return EMACS_INT, not int.
15924
15925 * data.c (Qcompiled_function): Now static.
15926
15927 * window.c (window_body_lines): Now static.
15928
15929 * image.c (gif_load): Rename local to avoid shadowing.
15930
15931 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
15932 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
15933 * alloc.c (make_save_value): Integer argument is now of type
15934 ptrdiff_t, not int.
15935 (mark_object): Use ptrdiff_t, not int.
15936 * lisp.h (pD): New macro.
15937 * print.c (print_object): Use it.
15938
15939 * alloc.c: Use EMACS_INT, not int, to count objects.
15940 (total_conses, total_markers, total_symbols, total_vector_size)
15941 (total_free_conses, total_free_markers, total_free_symbols)
15942 (total_free_floats, total_floats, total_free_intervals)
15943 (total_intervals, total_strings, total_free_strings):
15944 Now EMACS_INT, not int. All uses changed.
15945 (Fgarbage_collect): Compute overall total using a double, so that
15946 integer overflow is less likely to be a problem. Check for overflow
15947 when converting back to an integer.
15948 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
15949 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
15950 These were 'int' variables that could overflow on 64-bit hosts;
15951 they were never used, so remove them instead of repairing them.
15952 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
15953 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
15954 Previously, this ceilinged at INT_MAX, but that doesn't work on
15955 64-bit machines.
15956 (allocate_pseudovector): Don't use EMACS_INT when int would do.
15957
15958 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
15959 (allocate_vectorlike): Check for ptrdiff_t overflow.
15960 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
15961 when a (possibly-narrower) signed value would do just as well.
15962 We prefer using signed arithmetic, to avoid comparison confusion.
15963
15964 * alloc.c: Catch some string size overflows that we were missing.
15965 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
15966 for convenience in STRING_BYTES_MAX.
15967 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
15968 The definition here is exact; the one in lisp.h was approximate.
15969 (allocate_string_data): Check for string overflow. This catches
15970 some instances we weren't catching before. Also, it catches
15971 size_t overflow on (unusual) hosts where SIZE_MAX <= min
15972 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
15973 and ptrdiff_t and EMACS_INT are both 64 bits.
15974
15975 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
15976 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
15977 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
15978
15979 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
15980
15981 * alloc.c (Fmake_string): Check for out-of-range init.
15982
15983 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
15984
15985 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
15986
15987 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
15988
15989 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
15990 xg_get_default_scrollbar_width.
15991
15992 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
15993 (int_gtk_range_get_value): Move to the scroll bar part of the file.
15994 (style_changed_cb): Call update_theme_scrollbar_width and call
15995 x_set_scroll_bar_default_width and xg_frame_set_char_size for
15996 all frames (Bug#8505).
15997 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
15998 Call gtk_window_set_resizable if HAVE_GTK3.
15999 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
16000 and height if HAVE_GTK3 (Bug#8505).
16001 (scroll_bar_width_for_theme): New variable.
16002 (update_theme_scrollbar_width): New function.
16003 (xg_get_default_scrollbar_width): Move code to
16004 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
16005 (xg_initialize): Call update_theme_scrollbar_width.
16006
16007 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
16008
16009 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
16010
16011 2011-06-12 Martin Rudalics <rudalics@gmx.at>
16012
16013 * frame.c (make_frame): Call other_buffer_safely instead of
16014 other_buffer.
16015
16016 * window.c (temp_output_buffer_show): Call display_buffer with
16017 second argument Vtemp_buffer_show_specifiers and reset latter
16018 immediately after the call.
16019 (Vtemp_buffer_show_specifiers): New variable.
16020 (auto_window_vscroll_p, next_screen_context_lines)
16021 (Vscroll_preserve_screen_position): Remove leading asterisks from
16022 doc-strings.
16023
16024 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
16025
16026 Fix minor problems found by GCC 4.6.0 static checking.
16027 * buffer.c (Qclone_number): Remove for now, as it's unused.
16028 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
16029 (record_buffer): Remove unused local.
16030 * frame.c (other_visible_frames, frame_buffer_list): Now static.
16031 (set_frame_buffer_list): Remove; unused.
16032 * frame.h (other_visible_frames): Remove decl.
16033 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
16034 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
16035 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
16036 if HAVE_GPM.
16037 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
16038 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
16039 Define only if HAVE_GPM.
16040 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
16041 (update_hints_inhibit): Remove; never set. All uses removed.
16042 * widgetprv.h (emacsFrameClassRec): Remove decl.
16043 * window.c (delete_deletable_window): Now returns void, since it
16044 wasn't returning anything.
16045 (compare_window_configurations): Remove unused locals.
16046 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
16047 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
16048 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
16049 the same widths as pointers. This follows up on the 2011-05-06 patch.
16050 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
16051 * xterm.h: Likewise.
16052 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
16053
16054 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
16055
16056 * makefile.w32-in: Update dependencies.
16057 (LISP_H): Add lib/intprops.h.
16058
16059 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
16060
16061 * image.c (gif_load): Add animation frame delay to the metadata.
16062 (syms_of_image): Use DEFSYM. New symbol `delay'.
16063
16064 2011-06-11 Martin Rudalics <rudalics@gmx.at>
16065
16066 * window.c (delete_deletable_window): Re-add.
16067 (Fset_window_configuration): Rewrite to handle dead buffers and
16068 consequently deletable windows.
16069 (window_tree, Fwindow_tree): Remove. Supply functionality in
16070 window.el.
16071 (compare_window_configurations): Simplify code.
16072
16073 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
16074
16075 * image.c (imagemagick_load_image): Fix type mismatch.
16076 (Fimagemagick_types): Likewise.
16077
16078 * window.h (replace_buffer_in_windows): Declare.
16079
16080 2011-06-11 Martin Rudalics <rudalics@gmx.at>
16081
16082 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
16083 Qclone_number. Remove external declaration of Qdelete_window.
16084 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
16085 code.
16086 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
16087 Run Qbuffer_list_update_hook if allowed.
16088 (Fother_buffer): Rewrite doc-string. Major rewrite for new
16089 buffer list implementation.
16090 (other_buffer_safely): New function.
16091 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
16092 calls to replace_buffer_in_windows and
16093 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
16094 if allowed.
16095 (record_buffer): Inhibit quitting and rewrite using quittable
16096 functions. Run Qbuffer_list_update_hook if allowed.
16097 (Frecord_buffer, Funrecord_buffer): New functions.
16098 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
16099 Move switch-to-buffer to window.el.
16100 (bury-buffer): Move to window.el.
16101 (Vbuffer_list_update_hook): New variable.
16102
16103 * lisp.h (other_buffer_safely): Add prototype in buffer.c
16104 section.
16105
16106 * window.h (resize_frame_windows): Move up in code.
16107 (Fwindow_frame): Remove EXFUN.
16108 (replace_buffer_in_all_windows): Remove prototype.
16109 (replace_buffer_in_windows_safely): Add prototype.
16110
16111 * window.c: Declare Qdelete_window static again. Move down
16112 declaration of select_count.
16113 (Fnext_window, Fprevious_window): Rewrite doc-strings.
16114 (Fother_window): Move to window.el.
16115 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
16116 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
16117 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
16118 window.el.
16119 (replace_buffer_in_windows): Implement by calling
16120 Qreplace_buffer_in_windows.
16121 (replace_buffer_in_all_windows): Remove with some functionality
16122 moved into replace_buffer_in_windows_safely.
16123 (replace_buffer_in_windows_safely): New function.
16124 (select_window_norecord, select_frame_norecord): Move in front
16125 of run_window_configuration_change_hook. Remove now obsolete
16126 declarations.
16127 (Fset_window_buffer): Rewrite doc-string.
16128 Call Qrecord_window_buffer.
16129 (keys_of_window): Move binding for other-window to window.el.
16130
16131 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
16132
16133 * dispextern.h (struct image): Replace data member, whose int_val
16134 and ptr_val fields were not used by anything, with a single
16135 lisp_val object.
16136
16137 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
16138 (gif_clear_image, gif_load, imagemagick_load_image)
16139 (gs_clear_image, gs_load): Callers changed.
16140
16141 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
16142
16143 * buffer.h: Include <time.h>, for time_t.
16144 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
16145
16146 Fix minor problems found by static checking.
16147
16148 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
16149
16150 Make identifiers static if they are not used in other modules.
16151 * data.c (Qcompiled_function, Qframe, Qvector):
16152 * image.c (QimageMagick, Qsvg):
16153 * minibuf.c (Qmetadata):
16154 * window.c (resize_window_check, resize_root_window): Now static.
16155 * window.h (resize_window_check, resize_root_window): Remove decls.
16156
16157 * window.c (window_deletion_count, delete_deletable_window):
16158 Remove; unused.
16159 (window_body_lines): Now static.
16160 (Fdelete_other_windows_internal): Mark vars as initialized.
16161 Make sure 'resize_failed' is initialized.
16162 (run_window_configuration_change_hook): Rename local to avoid shadowing.
16163 (resize_window_apply): Remove unused local.
16164 * window.h (delete_deletable_window): Remove decl.
16165
16166 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
16167 (imagemagick_load_image): Fix pointer signedness problem by changing
16168 last arg from unsigned char * to char *. All uses changed.
16169 Also, fix a local for similar reasons.
16170 Remove unused locals. Remove locals to avoid shadowing.
16171 (fn_rsvg_handle_free): Remove; unused.
16172 (svg_load, svg_load_image): Fix pointer signedness problem.
16173 (imagemagick_load_image): Don't use garbage pointer image_wand.
16174
16175 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
16176
16177 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
16178
16179 * image.c (gif_load): Fix omitted cast error introduced by
16180 2011-06-06 change.
16181
16182 2011-06-10 Martin Rudalics <rudalics@gmx.at>
16183
16184 * window.h (resize_proportionally, orig_total_lines)
16185 (orig_top_line): Remove from window structure.
16186 (set_window_height, set_window_width, change_window_heights)
16187 (Fdelete_window): Remove prototypes.
16188 (resize_frame_windows): Remove duplicate declaration.
16189
16190 2011-06-10 Eli Zaretskii <eliz@gnu.org>
16191
16192 * window.h (resize_frame_windows, resize_window_check)
16193 (delete_deletable_window, resize_root_window)
16194 (resize_frame_windows): Declare prototypes.
16195
16196 * window.c (resize_window_apply): Make definition be "static" to
16197 match the prototype.
16198
16199 2011-06-10 Martin Rudalics <rudalics@gmx.at>
16200
16201 * window.c: Remove declarations of Qwindow_size_fixed,
16202 window_min_size_1, window_min_size_2, window_min_size,
16203 size_window, window_fixed_size_p, enlarge_window, delete_window.
16204 Remove static from declaration of Qdelete_window, it's
16205 temporarily needed by Fbury_buffer.
16206 (replace_window): Don't assign orig_top_line and
16207 orig_total_lines.
16208 (Fdelete_window, delete_window): Remove. Window deletion is
16209 handled by window.el.
16210 (window_loop): Remove DELETE_OTHER_WINDOWS case.
16211 Replace Fdelete_window calls with calls to Qdelete_window.
16212 (Fdelete_other_windows): Remove. Deleting other windows is
16213 handled by window.el.
16214 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
16215 handled in window.el.
16216 (window_min_size_2, window_min_size_1, window_min_size): Remove.
16217 Window minimum sizes are handled in window.el.
16218 (shrink_windows, size_window, set_window_height)
16219 (set_window_width, change_window_heights, window_height)
16220 (window_width, CURBEG, CURSIZE, enlarge_window)
16221 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
16222 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
16223 handled in window.el.
16224 (make_dummy_parent): Rename to make_parent_window and give it a
16225 second argument horflag.
16226 (make_window): Don't set resize_proportionally any more.
16227 (Fsplit_window): Remove. Windows are split in window.el.
16228 (save_restore_action, save_restore_orig_size)
16229 (shrink_window_lowest_first, save_restore_orig_size): Remove.
16230 Resize mini windows in window.el.
16231 (grow_mini_window, shrink_mini_window): Implement by calling
16232 Qresize_root_window_vertically, resize_window_check and
16233 resize_window_apply.
16234 (saved_window, Fset_window_configuration, save_window_save):
16235 Do not handle orig_top_line, orig_total_lines, and
16236 resize_proportionally.
16237 (window_min_height, window_min_width): Move to window.el.
16238 (keys_of_window): Move bindings for delete-other-windows,
16239 split-window, delete-window and enlarge-window to window.el.
16240
16241 * buffer.c: Temporarily extern Qdelete_window.
16242 (Fbury_buffer): Temporarily call Qdelete_window instead of
16243 Fdelete_window (Fbury_buffer will move to window.el soon).
16244
16245 * frame.c (set_menu_bar_lines_1): Remove code handling
16246 orig_top_line and orig_total_lines.
16247
16248 * dispnew.c (adjust_frame_glyphs_initially): Don't use
16249 set_window_height but set heights directly.
16250 (change_frame_size_1): Use resize_frame_windows.
16251
16252 * xdisp.c (init_xdisp): Don't use set_window_height but set
16253 heights directly.
16254
16255 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
16256 Use resize_frame_windows instead of change_window_heights and run
16257 run_window_configuration_change_hook.
16258
16259 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
16260 instead of change_window_heights and run
16261 run_window_configuration_change_hook.
16262
16263 2011-06-09 Martin Rudalics <rudalics@gmx.at>
16264
16265 * window.c (replace_window): Rename second argument REPLACEMENT to
16266 NEW. New third argument SETFLAG. Rewrite.
16267 (delete_window, make_dummy_parent): Call replace_window with
16268 third argument 1.
16269 (window_list_1): Move down in code.
16270 (run_window_configuration_change_hook): Move set_buffer part
16271 before select_frame_norecord part in order to unwind correctly.
16272 Rename count1 to count.
16273 (recombine_windows, delete_deletable_window, resize_root_window)
16274 (Fdelete_other_windows_internal)
16275 (Frun_window_configuration_change_hook, make_parent_window)
16276 (resize_window_check, resize_window_apply, Fresize_window_apply)
16277 (resize_frame_windows, Fsplit_window_internal)
16278 (Fdelete_window_internal, Fresize_mini_window_internal):
16279 New functions.
16280 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
16281
16282 2011-06-08 Martin Rudalics <rudalics@gmx.at>
16283
16284 * window.h (window): Add some new members to window structure -
16285 normal_lines, normal_cols, new_total, new_normal, clone_number,
16286 splits, nest, prev_buffers, next_buffers.
16287 (WINDOW_TOTAL_SIZE): Move here from window.c.
16288 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
16289
16290 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
16291 Remove.
16292 (make_dummy_parent): Set new members of windows structure.
16293 (make_window): Move down in code. Handle new members of window
16294 structure.
16295 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
16296 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
16297 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
16298 (Fset_window_prev_buffers, Fwindow_next_buffers)
16299 (Fset_window_next_buffers, Fset_window_clone_number):
16300 New functions.
16301 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
16302 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
16303 Doc-string fixes.
16304 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
16305 Argument WINDOW can be now internal window too.
16306 (Fwindow_use_time): Move up in code.
16307 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
16308 Rewrite doc-string.
16309 (Fset_window_configuration, saved_window)
16310 (Fcurrent_window_configuration, save_window_save): Handle new
16311 members of window structure.
16312 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
16313 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
16314 (syms_of_window): New Lisp objects Qrecord_window_buffer,
16315 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
16316 Qget_mru_window, Qresize_root_window,
16317 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
16318 Qauto_buffer_name; staticpro them.
16319
16320 2011-06-07 Martin Rudalics <rudalics@gmx.at>
16321
16322 * window.c (Fwindow_total_size, Fwindow_left_column)
16323 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
16324 (Fwindow_list_1): New functions.
16325 (window_box_text_cols): Replace with window_body_cols.
16326 (Fwindow_width, Fscroll_left, Fscroll_right):
16327 Use window_body_cols instead of window_box_text_cols.
16328 (delete_window, Fset_window_configuration):
16329 Call delete_all_subwindows with window as argument.
16330 (delete_all_subwindows): Take a window as argument and not a
16331 structure. Rewrite.
16332 (window_loop): Remove handling of GET_LRU_WINDOW and
16333 GET_LARGEST_WINDOW.
16334 (Fget_lru_window, Fget_largest_window): Move to window.el.
16335
16336 * window.h: Extern window_body_cols instead of
16337 window_box_text_cols. delete_all_subwindows now takes a
16338 Lisp_Object as argument.
16339
16340 * indent.c (compute_motion, Fcompute_motion):
16341 Use window_body_cols instead of window_box_text_cols.
16342
16343 * frame.c (delete_frame): Call delete_all_subwindows with root
16344 window as argument.
16345
16346 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
16347
16348 * fns.c (Fputhash): Document return value.
16349
16350 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
16351
16352 * image.c (gif_load): Implement gif89a spec "no disposal" method.
16353
16354 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
16355
16356 Cons<->int and similar integer overflow fixes (Bug#8794).
16357
16358 Check for overflow when converting integer to cons and back.
16359 * charset.c (Fdefine_charset_internal, Fdecode_char):
16360 Use cons_to_unsigned to catch overflow.
16361 (Fencode_char): Use INTEGER_TO_CONS.
16362 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
16363 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
16364 * data.c (long_to_cons, cons_to_long): Remove.
16365 (cons_to_unsigned, cons_to_signed): New functions.
16366 These signal an error for invalid or out-of-range values.
16367 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
16368 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
16369 * font.c (Ffont_variation_glyphs):
16370 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
16371 * lisp.h: Include <intprops.h>.
16372 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
16373 (cons_to_signed, cons_to_unsigned): New decls.
16374 (long_to_cons, cons_to_long): Remove decls.
16375 * undo.c (record_first_change): Use INTEGER_TO_CONS.
16376 (Fprimitive_undo): Use CONS_TO_INTEGER.
16377 * xfns.c (Fx_window_property): Likewise.
16378 * xselect.c: Include <limits.h>.
16379 (x_own_selection, selection_data_to_lisp_data):
16380 Use INTEGER_TO_CONS.
16381 (x_handle_selection_request, x_handle_selection_clear)
16382 (x_get_foreign_selection, Fx_disown_selection_internal)
16383 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
16384 (lisp_data_to_selection_data): Use cons_to_unsigned.
16385 (x_fill_property_data): Use cons_to_signed.
16386 Report values out of range.
16387
16388 Check for buffer and string overflow more precisely.
16389 * buffer.h (BUF_BYTES_MAX): New macro.
16390 * lisp.h (STRING_BYTES_MAX): New macro.
16391 * alloc.c (Fmake_string):
16392 * character.c (string_escape_byte8):
16393 * coding.c (coding_alloc_by_realloc):
16394 * doprnt.c (doprnt):
16395 * editfns.c (Fformat):
16396 * eval.c (verror):
16397 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
16398 since they may not be the same number.
16399 * editfns.c (Finsert_char):
16400 * fileio.c (Finsert_file_contents):
16401 Likewise for BUF_BYTES_MAX.
16402
16403 * image.c: Use ptrdiff_t, not int, for sizes.
16404 (slurp_file): Switch from int to ptrdiff_t.
16405 All uses changed.
16406 (slurp_file): Check that file size fits in both size_t (for
16407 malloc) and ptrdiff_t (for sanity and safety).
16408
16409 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
16410 if b->modtime has its maximal value.
16411
16412 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
16413
16414 Don't assume time_t can fit into int.
16415 * buffer.h (struct buffer.modtime): Now time_t, not int.
16416 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
16417 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
16418
16419 Minor fixes for signed vs unsigned integers.
16420 * character.h (MAYBE_UNIFY_CHAR):
16421 * charset.c (maybe_unify_char):
16422 * keyboard.c (read_char, reorder_modifiers):
16423 XINT -> XFASTINT, since the integer must be nonnegative.
16424 * ftfont.c (ftfont_spec_pattern):
16425 * keymap.c (access_keymap, silly_event_symbol_error):
16426 XUINT -> XFASTINT, since the integer must be nonnegative.
16427 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
16428 since it makes no difference and we prefer signed.
16429 * keyboard.c (record_char): Use XUINT when all the neighbors do.
16430 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
16431 nonnegative.
16432
16433 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
16434
16435 * window.h (Fwindow_frame): Declare.
16436
16437 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
16438
16439 * alloc.c: Simplify handling of large-request failures (Bug#8800).
16440 (SPARE_MEMORY): Always define.
16441 (LARGE_REQUEST): Remove.
16442 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
16443
16444 2011-06-06 Martin Rudalics <rudalics@gmx.at>
16445
16446 * lisp.h: Move EXFUNS for Fframe_root_window,
16447 Fframe_first_window and Fset_frame_selected_window to window.h.
16448
16449 * window.h: Move EXFUNS for Fframe_root_window,
16450 Fframe_first_window and Fset_frame_selected_window here from
16451 lisp.h.
16452
16453 * frame.c (Fwindow_frame, Fframe_first_window)
16454 (Fframe_root_window, Fframe_selected_window)
16455 (Fset_frame_selected_window): Move to window.c.
16456 (Factive_minibuffer_window): Move to minibuf.c.
16457 (Fother_visible_frames_p): New function.
16458
16459 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
16460
16461 * window.c (decode_window, decode_any_window): Move up in code.
16462 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
16463 (inhibit_frame_unsplittable): Remove unused variable.
16464 (Fwindow_buffer): Move up and rewrite doc-string.
16465 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
16466 (Fwindow_prev): New functions.
16467 (Fwindow_frame): Move here from frame.c. Accept any window as
16468 argument.
16469 (Fframe_root_window, Fframe_first_window)
16470 (Fframe_selected_window): Move here from frame.c. Accept frame
16471 or arbitrary window as argument. Update doc-strings.
16472 (Fminibuffer_window): Move up in code.
16473 (Fwindow_minibuffer_p): Move up in code and simplify.
16474 (Fset_frame_selected_window): Move here from frame.c.
16475 Marginal rewrite.
16476 (Fselected_window, select_window, Fselect_window): Move up in
16477 code. Minor doc-string fixes.
16478
16479 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
16480
16481 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
16482 Do not assume that spare memory exists; that assumption is valid
16483 only if SYSTEM_MALLOC.
16484 (LARGE_REQUEST): New macro, so that the issue of large requests
16485 is separated from the issue of spare memory.
16486
16487 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
16488
16489 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
16490 format. (Bug#8806)
16491
16492 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
16493
16494 * xfns.c (x_set_scroll_bar_default_width): Move declarations
16495 before statements.
16496
16497 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
16498
16499 * gtkutil.c (xg_get_default_scrollbar_width): New function.
16500
16501 * gtkutil.h: Declare xg_get_default_scrollbar_width.
16502
16503 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
16504 min width by calling x_set_scroll_bar_default_width (Bug#8505).
16505
16506 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
16507
16508 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
16509
16510 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
16511
16512 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
16513 (x_clipboard_manager_save): Add return value.
16514 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
16515 New error handlers.
16516 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
16517 Obey Vx_select_enable_clipboard_manager. Catch errors in
16518 x_clipboard_manager_save (Bug#8779).
16519 (Vx_select_enable_clipboard_manager): New variable.
16520 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
16521
16522 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
16523
16524 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
16525
16526 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16527
16528 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
16529 in the current matrix if keep_current_p is non-zero.
16530
16531 2011-06-04 Eli Zaretskii <eliz@gnu.org>
16532
16533 * bidi.c (bidi_level_of_next_char): Fix last change.
16534
16535 2011-06-03 Eli Zaretskii <eliz@gnu.org>
16536
16537 Support bidi reordering of text covered by display properties.
16538
16539 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
16540 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
16541 (bidi_cache_search, bidi_cache_iterator_state)
16542 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
16543 (bidi_level_of_next_char, bidi_move_to_visually_next):
16544 Support character positions inside a run of characters covered by a
16545 display string.
16546 (bidi_paragraph_init, bidi_resolve_explicit_1)
16547 (bidi_level_of_next_char): Call bidi_fetch_char and
16548 bidi_fetch_char_advance instead of FETCH_CHAR and
16549 FETCH_CHAR_ADVANCE.
16550 (bidi_init_it): Initialize new members.
16551 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
16552 definitions.
16553 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
16554 instead of using explicit *_CHAR codes.
16555 (bidi_resolve_explicit, bidi_resolve_weak):
16556 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
16557 bidirectional text is supported only in multibyte buffers.
16558 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
16559 it to initialize the frame_window_p member of struct bidi_it.
16560 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
16561 (bidi_resolve_explicit, bidi_resolve_weak)
16562 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
16563 bidi_it->nchars is non-positive.
16564 (bidi_level_of_next_char): Don't try to lookup the cache for the
16565 next/previous character if nothing is cached there yet, or if we
16566 were just reseat()'ed to a new position.
16567
16568 * xdisp.c (set_cursor_from_row): Set start and stop points
16569 according to the row's direction when priming the loop that looks
16570 for the glyph on which to display cursor.
16571 (single_display_spec_intangible_p): Function deleted.
16572 (display_prop_intangible_p): Reimplement to call
16573 handle_display_spec instead of single_display_spec_intangible_p.
16574 Accept 3 additional arguments needed by handle_display_spec.
16575 This fixes incorrect cursor motion across display property with complex
16576 values: lists, `(when COND...)' forms, etc.
16577 (single_display_spec_string_p): Support property values that are
16578 lists with the argument STRING its top-level element.
16579 (display_prop_string_p): Fix the condition for processing a
16580 property that is a list to be consistent with handle_display_spec.
16581 (handle_display_spec): New function, refactored from the
16582 last portion of handle_display_prop.
16583 (compute_display_string_pos): Accept additional argument
16584 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
16585 value of a `display' property is a "replacing spec".
16586 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
16587 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
16588 the display property, but just return a value indicating whether
16589 the display property will replace the characters it covers.
16590 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
16591 frame_window_p members of struct bidi_it.
16592 (compute_display_string_pos, compute_display_string_end):
16593 New functions.
16594 (push_it): Accept second argument POSITION, where pop_it should
16595 jump to continue iteration.
16596 (reseat_1): Initialize bidi_it.disp_pos.
16597
16598 * keyboard.c (adjust_point_for_property): Adjust the call to
16599 display_prop_intangible_p to its new signature.
16600
16601 * dispextern.h (struct bidi_it): New member frame_window_p.
16602 (bidi_init_it): Update prototypes.
16603 (display_prop_intangible_p): Update prototype.
16604 (compute_display_string_pos, compute_display_string_end):
16605 Declare prototypes.
16606 (struct bidi_it): New members nchars and disp_pos. ch_len is now
16607 EMACS_INT.
16608
16609 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
16610
16611 Malloc failure behavior now depends on size of allocation.
16612 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
16613 * lisp.h: Change signatures accordingly.
16614 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
16615 All callers changed. (Bug#8762)
16616
16617 * gnutls.c: Use Emacs's memory allocators.
16618 Without this change, the gnutls library would invoke malloc etc.
16619 directly, which causes problems on non-SYNC_INPUT hosts, and which
16620 runs afoul of improving memory_full behavior. (Bug#8761)
16621 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
16622 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
16623 xfree instead of the default malloc, realloc, free.
16624 (Fgnutls_boot): No need to check for memory allocation failure,
16625 since xmalloc does that for us.
16626
16627 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
16628 * category.c (hash_get_category_set):
16629 * ccl.c (ccl_driver):
16630 * charset.c (Fdefine_charset_internal):
16631 * charset.h (struct charset.hash_index):
16632 * composite.c (get_composition_id, gstring_lookup_cache)
16633 (composition_gstring_put_cache):
16634 * composite.h (struct composition.hash_index):
16635 * dispextern.h (struct image.hash):
16636 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
16637 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
16638 (hashfn_equal, hashfn_user_defined, make_hash_table)
16639 (maybe_resize_hash_table, hash_lookup, hash_put)
16640 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
16641 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
16642 (Fsxhash, Fgethash, Fputhash, Fmaphash):
16643 * image.c (make_image, search_image_cache, lookup_image)
16644 (xpm_put_color_table_h):
16645 * lisp.h (struct Lisp_Hash_Table):
16646 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
16647 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
16648 for hashes and hash indexes, instead of 'unsigned' and 'int'.
16649 * alloc.c (allocate_vectorlike):
16650 Check for overflow in vector size calculations.
16651 * ccl.c (ccl_driver):
16652 Check for overflow when converting EMACS_INT to int.
16653 * fns.c, image.c: Remove unnecessary static decls that would otherwise
16654 need to be updated by these changes.
16655 * fns.c (make_hash_table, maybe_resize_hash_table):
16656 Check for integer overflow with large hash tables.
16657 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
16658 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
16659 (SXHASH_REDUCE): New macro.
16660 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
16661 Use it instead of discarding useful hash info with large hash values.
16662 (sxhash_float): New function.
16663 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
16664 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
16665 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
16666 Rewrite to use FIXNUM_BITS, as this simplifies things.
16667 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
16668 Adjust signatures to match updated version of code.
16669 (consing_since_gc): Now EMACS_INT, since a single hash table can
16670 use more than INT_MAX bytes.
16671
16672 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
16673
16674 Make it possible to build with GCC-4.6+ -O2 -flto.
16675
16676 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
16677
16678 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
16679
16680 * minibuf.c (get_minibuffer, read_minibuf_unwind):
16681 Call minibuffer-inactive-mode.
16682
16683 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
16684
16685 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
16686 Update dependencies.
16687
16688 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16689
16690 * data.c (init_data): Remove code for UTS, this system is not
16691 supported anymore.
16692
16693 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16694
16695 Don't force ./temacs to start in terminal mode.
16696
16697 * frame.c (make_initial_frame): Initialize faces in all cases, not
16698 only when CANNOT_DUMP is defined.
16699 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
16700
16701 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16702
16703 * dispnew.c (add_window_display_history): Use const for the string
16704 pointer. Remove declaration, not needed.
16705
16706 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
16707
16708 Use 'inline', not 'INLINE'.
16709 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
16710 * alloc.c, fontset.c (INLINE): Remove.
16711 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
16712 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
16713 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
16714 * gmalloc.c (register_heapinfo): Use inline unconditionally.
16715 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
16716
16717 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16718
16719 Make it possible to run ./temacs.
16720
16721 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
16722 syms_of_callproc does the same thing. Remove test for
16723 "initialized", do it in the caller.
16724 * emacs.c (main): Avoid calling set_initial_environment when dumping.
16725
16726 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
16727
16728 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
16729 (read_minibuf): Use get_minibuffer.
16730 (syms_of_minibuf): Use DEFSYM.
16731 (Qmetadata): New var.
16732 * data.c (Qbuffer): Don't make it static.
16733 (syms_of_data): Use DEFSYM.
16734
16735 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
16736
16737 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
16738 (CCL_CODE_MIN): New macro.
16739
16740 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
16741
16742 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
16743
16744 * eval.c (Qdebug): Now static.
16745 * lisp.h (Qdebug): Remove decl. This reverts a part of the
16746 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
16747 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
16748
16749 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
16750
16751 * image.c: Various fixes to ImageMagick code comments.
16752 (Fimagemagick_types): Doc fix.
16753
16754 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
16755
16756 Minor fixes prompted by GCC 4.6.0 warnings.
16757
16758 * xselect.c (converted_selections, conversion_fail_tag): Now static.
16759
16760 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
16761 (x_clipboard_manager_save_all): Move extern decl to ...
16762 * xterm.h: ... here, so that it can be checked for consistency.
16763
16764 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
16765
16766 * xselect.c (x_clipboard_manager_save_frame)
16767 (x_clipboard_manager_save_all): New functions.
16768 (Fx_clipboard_manager_save): Lisp function deleted.
16769
16770 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
16771 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
16772
16773 * xterm.h: Update prototype.
16774
16775 2011-05-28 William Xu <william.xwl@gmail.com>
16776
16777 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
16778 exiting (Bug#8239).
16779
16780 2011-05-28 Jim Meyering <meyering@redhat.com>
16781
16782 Avoid a sign-extension bug in crypto_hash_function.
16783 * fns.c (to_uchar): Define.
16784 (crypto_hash_function): Use it to convert some newly-signed
16785 variables to unsigned, to avoid sign-extension bugs. For example,
16786 without this change, (md5 "truc") would evaluate to
16787 45723a2aff78ff4fff7fff1114760e62 rather than the expected
16788 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
16789 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
16790
16791 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
16792
16793 Integer overflow fixes.
16794
16795 * dbusbind.c: Serial number integer overflow fixes.
16796 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
16797 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
16798 to hold a serial number that is too large for a fixnum.
16799 (Fdbus_method_return_internal, Fdbus_method_error_internal):
16800 Check for serial numbers out of range. Decode any serial number
16801 that was so large that it became a float. (Bug#8722)
16802
16803 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
16804 (Fdbus_call_method, Fdbus_call_method_asynchronously):
16805 Use XFASTINT rather than XUINT when numbers are nonnegative.
16806 (xd_append_arg, Fdbus_method_return_internal):
16807 (Fdbus_method_error_internal): Likewise. Also, for unsigned
16808 arguments, check that Lisp number is nonnegative, rather than
16809 silently wrapping negative numbers around. (Bug#8722)
16810 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
16811 (Bug#8722)
16812
16813 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
16814
16815 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
16816
16817 ccl: Add integer overflow checks.
16818 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
16819 (IN_INT_RANGE): New macros.
16820 (ccl_driver): Use them to check for integer overflow when
16821 decoding a CCL program. Many of the new checks are whether XINT (x)
16822 fits in int; it doesn't always, on 64-bit hosts. The new version
16823 doesn't catch all possible integer overflows, but it's an
16824 improvement. (Bug#8719)
16825
16826 * alloc.c (make_event_array): Use XINT, not XUINT.
16827 There's no need for unsigned here.
16828
16829 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
16830 This follows up to the 2011-05-06 change that substituted uintptr_t
16831 for EMACS_INT. This case wasn't caught back then.
16832
16833 Rework Fformat to avoid integer overflow issues.
16834 * editfns.c: Include <float.h> unconditionally, as it's everywhere
16835 now (part of C89). Include <verify.h>.
16836 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
16837 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
16838 (Fformat): Avoid the prepass trying to compute sizes; it was only
16839 approximate and thus did not catch overflow reliably. Instead, walk
16840 through the format just once, formatting and computing sizes as we go,
16841 checking for integer overflow at every step, and allocating a larger
16842 buffer as needed. Keep track separately whether the format is
16843 multibyte. Keep only the most-recently calculated precision, rather
16844 than them all. Record whether each argument has been converted to
16845 string. Use EMACS_INT, not int, for byte and char and arg counts.
16846 Support field widths and precisions larger than INT_MAX. Avoid
16847 sprintf's undefined behavior with conversion specifications such as %#d
16848 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
16849 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
16850 formatting out-of-range floating point numbers with int
16851 formats. (Bug#8668)
16852
16853 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
16854
16855 * data.c: Avoid integer truncation in expressions involving floats.
16856 * data.c: Include <intprops.h>.
16857 (arith_driver): When there's an integer overflow in an expression
16858 involving floating point, convert the integers to floating point
16859 so that the resulting value does not suffer from catastrophic
16860 integer truncation. For example, on a 64-bit host (* 4
16861 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
16862 Do not rely on undefined behavior after integer overflow.
16863
16864 merge count_size_as_multibyte, parse_str_to_multibyte
16865 * character.c, character.h (count_size_as_multibyte):
16866 Rename from parse_str_to_multibyte; all uses changed.
16867 Check for integer overflow.
16868 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
16869 since it's now a duplicate of the other. This is more of
16870 a character than a buffer op, so better that it's in character.c.
16871 * fns.c, print.c: Adjust to above changes.
16872
16873 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
16874
16875 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
16876
16877 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
16878
16879 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
16880 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
16881 (x_clipboard_manager_save): Now static.
16882 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
16883
16884 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
16885 (crypto_hash_function): Now static.
16886 Fix pointer signedness problems. Avoid unnecessary initializations.
16887
16888 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
16889
16890 * termhooks.h (Vselection_alist): Make it terminal-local.
16891
16892 * terminal.c (create_terminal): Initialize it.
16893
16894 * xselect.c: Support for clipboard managers.
16895 (Vselection_alist): Move to termhooks.h as terminal-local var.
16896 (LOCAL_SELECTION): New macro.
16897 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
16898 (symbol_to_x_atom): Remove gratuitous arg.
16899 (x_handle_selection_request, lisp_data_to_selection_data)
16900 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
16901 (x_own_selection, x_get_local_selection, x_convert_selection):
16902 New arg, specifying work frame. Use terminal-local Vselection_alist.
16903 (some_frame_on_display): Delete unused function.
16904 (Fx_own_selection_internal, Fx_get_selection_internal)
16905 (Fx_disown_selection_internal, Fx_selection_owner_p)
16906 (Fx_selection_exists_p): New optional frame arg.
16907 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
16908 (x_handle_selection_clear): Don't treat other terminals with the
16909 same keyboard specially. Use the terminal-local Vselection_alist.
16910 (x_clear_frame_selections): Use Frun_hook_with_args.
16911
16912 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
16913
16914 * xterm.h: Add support for those atoms.
16915
16916 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
16917
16918 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
16919 (converted_selections, conversion_fail_tag): New global variables.
16920 (x_selection_request_lisp_error): Free the above.
16921 (x_get_local_selection): Remove unnecessary code.
16922 (x_reply_selection_request): Args changed; handle arbitrary array
16923 of converted selections stored in converted_selections.
16924 Separate the XChangeProperty and SelectionNotify steps.
16925 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
16926 (x_convert_selection): New function.
16927 (x_handle_selection_event): Simplify.
16928 (x_get_foreign_selection): Don't ignore incoming requests while
16929 waiting for an answer; this will fail when we implement
16930 SAVE_TARGETS, and seems unnecessary anyway.
16931 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
16932 (Vx_sent_selection_functions): Doc fix.
16933
16934 2011-05-26 Leo Liu <sdl.web@gmail.com>
16935
16936 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
16937
16938 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16939
16940 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
16941
16942 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
16943 for fringe update if it has periodic bitmap.
16944 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
16945 and fringe_bitmap_periodic_p.
16946
16947 * fringe.c (get_fringe_bitmap_data): New function.
16948 (draw_fringe_bitmap_1, update_window_fringes): Use it.
16949 (update_window_fringes): Record periodicity of fringe bitmap in glyph
16950 row. Mark glyph row for fringe update if periodicity changed.
16951
16952 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
16953 for fringe update unless it has periodic bitmap.
16954
16955 2011-05-25 Kenichi Handa <handa@m17n.org>
16956
16957 * xdisp.c (get_next_display_element): Set correct it->face_id for
16958 a static composition.
16959
16960 2011-05-24 Leo Liu <sdl.web@gmail.com>
16961
16962 * deps.mk (fns.o):
16963 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
16964
16965 * fns.c (crypto_hash_function, Fsha1): New function.
16966 (Fmd5): Use crypto_hash_function.
16967 (syms_of_fns): Add Ssha1.
16968
16969 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16970
16971 * gnutls.c: Remove unused macros.
16972 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
16973 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
16974 Remove macros that are defined and never used.
16975 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
16976
16977 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
16978
16979 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
16980 (Fx_get_selection_internal): Minor cleanup.
16981 (Fx_own_selection_internal): Rename arguments for consistency with
16982 select.el.
16983
16984 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16985
16986 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
16987
16988 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
16989
16990 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
16991
16992 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16993
16994 * dispnew.c (scrolling_window): Don't exclude the case that the
16995 last enabled row in the desired matrix touches the bottom boundary.
16996
16997 2011-05-21 Glenn Morris <rgm@gnu.org>
16998
16999 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
17000 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
17001 and add some more files.
17002
17003 2011-05-20 Eli Zaretskii <eliz@gnu.org>
17004
17005 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
17006 report_file_error introduced by the change from 2011-05-07.
17007
17008 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
17009
17010 * systime.h (Time): Define only if emacs is defined.
17011 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
17012 where the include path doesn't have X11/X.h by default. See
17013 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
17014
17015 2011-05-20 Kenichi Handa <handa@m17n.org>
17016
17017 * composite.c (find_automatic_composition): Fix previous change.
17018
17019 2011-05-20 Glenn Morris <rgm@gnu.org>
17020
17021 * lisp.mk: New file, split from Makefile.in.
17022 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
17023 (shortlisp): Remove.
17024 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
17025
17026 2011-05-19 Glenn Morris <rgm@gnu.org>
17027
17028 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
17029 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
17030 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
17031 (lisp): Set the order to that of loadup.el.
17032 (shortlisp): Make it a copy of $lisp.
17033 (SOME_MACHINE_LISP): Remove.
17034 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
17035 Use just $shortlisp, not $SOME_MACHINE_LISP too.
17036
17037 2011-05-18 Kenichi Handa <handa@m17n.org>
17038
17039 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
17040 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
17041 (find_automatic_composition): Mostly rewrite for efficiency.
17042
17043 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
17044
17045 * makefile.w32-in: Update dependencies.
17046
17047 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
17048
17049 * menu.c: Include limits.h (fixes the MS-Windows build broken by
17050 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
17051
17052 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
17053
17054 Fix some integer overflow issues, such as string length overflow.
17055
17056 * insdel.c (count_size_as_multibyte): Check for string overflow.
17057
17058 * character.c (lisp_string_width): Check for string overflow.
17059 Use EMACS_INT, not int, for string indexes and lengths; in
17060 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
17061 the resulting string length overflows an EMACS_INT; instead,
17062 report a string overflow if no precision given. When checking for
17063 precision exhaustion, use a check that cannot possibly have
17064 integer overflow. (Bug#8675)
17065 * character.h (lisp_string_width): Adjust to new signature.
17066
17067 * alloc.c (string_overflow): New function.
17068 (Fmake_string): Use it. This doesn't change behavior, but saves
17069 a few bytes and will simplify future changes.
17070 * character.c (string_escape_byte8): Likewise.
17071 * lisp.h (string_overflow): New decl.
17072
17073 Fixups, following up to the user-interface timestamp change.
17074 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
17075 for UI timestamps, instead of unsigned long.
17076 * msdos.c (mouse_get_pos): Likewise.
17077 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
17078 * w32gui.h (Time): Define by including "systime.h" rather than by
17079 declaring it ourselves. (Bug#8664)
17080
17081 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
17082 * image.c (clear_image_cache): Likewise.
17083
17084 * term.c (term_mouse_position): Don't assume time_t wraparound.
17085
17086 Be more systematic about user-interface timestamps.
17087 Before, the code sometimes used 'Time', sometimes 'unsigned long',
17088 and sometimes 'EMACS_UINT', to represent these timestamps.
17089 This change causes it to use 'Time' uniformly, as that's what X uses.
17090 This makes the code easier to follow, and makes it easier to catch
17091 integer overflow bugs such as Bug#8664.
17092 * frame.c (Fmouse_position, Fmouse_pixel_position):
17093 Use Time, not unsigned long, for user-interface timestamps.
17094 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
17095 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
17096 * keyboard.h (last_event_timestamp): Likewise.
17097 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
17098 * menu.h (xmenu_show): Likewise.
17099 * term.c (term_mouse_position): Likewise.
17100 * termhooks.h (struct input_event.timestamp): Likewise.
17101 (struct terminal.mouse_position_hook): Likewise.
17102 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
17103 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
17104 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
17105 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
17106 what it was before.
17107 * menu.h, termhooks.h: Include "systime.h", for Time.
17108
17109 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
17110 Don't assume that the difference between two unsigned long values
17111 can fit into an integer. At this point, we know button_down_time
17112 <= event->timestamp, so the difference must be nonnegative, so
17113 there's no need to cast the result if double-click-time is
17114 nonnegative, as it should be; check that it's nonnegative, just in
17115 case. This bug is triggered when events are more than 2**31 ms
17116 apart (about 25 days). (Bug#8664)
17117
17118 * xselect.c (last_event_timestamp): Remove duplicate decl.
17119 (x_own_selection): Remove needless cast to unsigned long.
17120
17121 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
17122 that always fit in int. Use a sentinel instead of a counter, to
17123 avoid a temp and to allay GCC's concerns about possible int overflow.
17124 * frame.h (struct frame): Use int for menu_bar_items_used
17125 instead of EMACS_INT, since it always fits in int.
17126
17127 * menu.c (grow_menu_items): Check for int overflow.
17128
17129 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
17130
17131 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
17132 Before, the code was not consistent. These values cannot exceed
17133 2**31 - 1 so there's no need to make them unsigned.
17134 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
17135 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
17136 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
17137 as modifiers.
17138 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
17139
17140 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
17141 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
17142 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
17143 presumably because the widths might not match.
17144
17145 * window.c (size_window): Avoid needless test at loop start.
17146
17147 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
17148
17149 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
17150
17151 2011-05-12 Drew Adams <drew.adams@oracle.com>
17152
17153 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
17154
17155 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17156
17157 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
17158 `width' to `bar_area_x' and `bar_area_width', respectively.
17159 (x_scroll_run): Take account of fringe background extension.
17160
17161 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
17162 Rename local vars `left' and `width' to `bar_area_x' and
17163 `bar_area_width', respectively.
17164 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
17165 background extension.
17166
17167 2011-05-10 Jim Meyering <meyering@redhat.com>
17168
17169 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
17170
17171 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
17172
17173 * image.c (Finit_image_library): Return t for built-in image types,
17174 like pbm and xbm. (Bug#8640)
17175
17176 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
17177
17178 * w32menu.c (set_frame_menubar): Fix submenu allocation.
17179
17180 2011-05-07 Eli Zaretskii <eliz@gnu.org>
17181
17182 * w32console.c (Fset_screen_color): Doc fix.
17183 (Fget_screen_color): New function.
17184 (syms_of_ntterm): Defsubr it.
17185
17186 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
17187 unlink the temporary file if Fcall_process didn't create it in the
17188 first place.
17189 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
17190 child process will be redirected to a file specified with `:file'.
17191 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
17192 cue to call_process_cleanup not to close that handle.
17193
17194 2011-05-07 Ben Key <bkey76@gmail.com>
17195
17196 * makefile.w32-in: The bootstrap-temacs rule now makes use of
17197 one of two shell specific rules, either bootstrap-temacs-CMD or
17198 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
17199 to the previous implementation of the bootstrap-temacs rule.
17200 The bootstrap-temacs-CMD rule is similar to the previous
17201 implementation of the bootstrap-temacs rule except that it
17202 makes use of the ESC_CFLAGS variable instead of the CFLAGS
17203 variable.
17204
17205 These changes, along with some changes to nt/configure.bat,
17206 nt/gmake.defs, and nt/nmake.defs, are required to extend my
17207 earlier fix to add support for --cflags and --ldflags options
17208 that include quotes so that it works whether make uses cmd or
17209 sh as the shell.
17210
17211 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
17212
17213 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
17214 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
17215 is a constant.
17216 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
17217 a string. Handle both cases.
17218 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
17219 (Fdbus_register_method): Use Qinvalid_function.
17220
17221 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
17222
17223 * makefile.w32-in: Update dependencies.
17224 (LISP_H): Add inttypes.h and stdin.h.
17225 (PROCESS_H): Add unistd.h.
17226
17227 2011-05-06 Eli Zaretskii <eliz@gnu.org>
17228
17229 * lread.c: Include limits.h (fixes the MS-Windows build broken by
17230 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
17231
17232 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
17233
17234 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
17235
17236 * term.c (vfatal): Remove stray call to va_end.
17237 It's not needed and the C Standard doesn't allow it here anyway.
17238
17239 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
17240 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
17241
17242 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
17243 bytes.
17244
17245 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
17246
17247 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
17248
17249 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
17250
17251 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
17252
17253 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
17254
17255 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
17256 * charset.c (Fdefine_charset_internal): Don't initialize
17257 charset.code_space[15]. The value was garbage, on hosts with
17258 32-bit int (Bug#8600).
17259
17260 * lread.c (read_integer): Be more consistent with string-to-number.
17261 Use string_to_number to do the actual conversion; this avoids
17262 rounding errors and fixes some other screwups. Without this fix,
17263 for example, #x1fffffffffffffff was misread as -2305843009213693952.
17264 (digit_to_number): Move earlier, for benefit of read_integer.
17265 Return -1 if the digit is out of range for the base, -2 if it is
17266 not a digit in any supported base. (Bug#8602)
17267
17268 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
17269
17270 * dispnew.c (scrolling_window): Return 1 if we scrolled,
17271 to match comment at start of function. This also removes a
17272 GCC warning about overflow in a 32+64-bit port.
17273
17274 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
17275
17276 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
17277 Reported by Stefan Monnier in
17278 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
17279 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
17280 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
17281
17282 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
17283 (EMACS_UINTPTR): Likewise, with uintptr_t.
17284
17285 * lisp.h: Prefer 64-bit EMACS_INT if available.
17286 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
17287 on 32-bit hosts that have 64-bit int, so that they can access
17288 large files.
17289 However, temporarily disable this change unless the temporary
17290 symbol WIDE_EMACS_INT is defined.
17291
17292 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
17293
17294 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
17295 This removes an assumption that EMACS_INT and long are the same
17296 width as pointers. The assumption is true for Emacs porting targets
17297 now, but we want to make other targets possible.
17298 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
17299 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
17300 In the rest of the code, change types of integers that hold casted
17301 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
17302 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
17303 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
17304 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
17305 No need to cast type when ORing.
17306 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
17307 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
17308 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
17309 assume EMACS_INT is the same width as char *.
17310 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
17311 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
17312 Remove no-longer-needed casts.
17313 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
17314 (xg_tool_bar_help_callback, xg_make_tool_item):
17315 Use EMACS_INTPTR to hold an integer
17316 that will be cast to void *; this can avoid a GCC warning
17317 if EMACS_INT is not the same width as void *.
17318 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
17319 * xdisp.c (display_echo_area_1, resize_mini_window_1):
17320 (current_message_1, set_message_1):
17321 Use a local to convert to proper width without a cast.
17322 * xmenu.c (dialog_selection_callback): Likewise.
17323
17324 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
17325 Also, don't assume VALBITS / RAND_BITS is less than 5,
17326 and don't rely on undefined behavior when shifting a 1 left into
17327 the sign bit.
17328 * lisp.h (get_random): Change signature to match.
17329
17330 * lread.c (hash_string): Use size_t, not int, for hash computation.
17331 Normally we prefer signed values; but hashing is special, because
17332 it's better to use unsigned division on hash table sizes so that
17333 the remainder is nonnegative. Also, size_t is the natural width
17334 for hashing into memory. The previous code used 'int', which doesn't
17335 retain enough info to hash well into very large tables.
17336 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
17337
17338 * dbusbind.c: Don't possibly lose pointer info when converting.
17339 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
17340 Use XPNTR rather than XHASH, so that the high-order bits of
17341 the pointer aren't lost when converting through void *.
17342
17343 * eval.c (Fautoload): Don't double-shift a pointer.
17344
17345 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
17346
17347 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
17348
17349 * gnutls.c (DEF_GNUTLS_FN):
17350 * image.c (DEF_IMGLIB_FN): Make function pointers static.
17351
17352 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
17353
17354 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
17355 marker. (Bug#8610)
17356
17357 2011-05-05 Eli Zaretskii <eliz@gnu.org>
17358
17359 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
17360 New version that can reserve upto 2GB of heap space.
17361
17362 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
17363
17364 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
17365
17366 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
17367
17368 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
17369 `gnutls_certificate_set_x509_key_file'.
17370
17371 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
17372
17373 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
17374 Update dependencies.
17375
17376 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
17377
17378 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
17379 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
17380 Remove unused parameter `fildes'.
17381 * process.c (read_process_output, send_process): Don't pass it.
17382
17383 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
17384
17385 Fix previous change: the library cache is defined in w32.c.
17386 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
17387 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
17388
17389 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
17390
17391 Implement dynamic loading of GnuTLS on Windows.
17392
17393 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
17394 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
17395 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
17396 Declare.
17397
17398 * gnutls.c (Qgnutls_dll): Define.
17399 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
17400 (gnutls_*): Declare function pointers.
17401 (init_gnutls_functions): New function to initialize function pointers.
17402 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
17403 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
17404 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
17405 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
17406 (emacs_gnutls_write, emacs_gnutls_read)
17407 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
17408 (Fgnutls_available_p): New function.
17409 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
17410 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
17411 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
17412
17413 * image.c: Include w32.h.
17414 (Vimage_type_cache): Delete.
17415 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
17416 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
17417 (w32_delayed_load): Move to w32.c.
17418
17419 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
17420
17421 * w32.c (QCloaded_from, Vlibrary_cache): Define.
17422 (w32_delayed_load): Move from image.c. When loading a library, record
17423 its filename in the :loaded-from property of the library id.
17424 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
17425 Initialize and staticpro them.
17426 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
17427
17428 * process.c: Include lisp.h before w32.h, not after.
17429 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
17430 instead of gnutls_record_check_pending.
17431
17432 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
17433
17434 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
17435
17436 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
17437 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
17438 as passed in.
17439
17440 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
17441
17442 * xterm.c (x_set_frame_alpha): Do not set property on anything
17443 else than FRAME_X_OUTER_WINDOW (Bug#8608).
17444
17445 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
17446
17447 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
17448
17449 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
17450
17451 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
17452 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
17453 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
17454 (gnutls_global_initialized, Qgnutls_bootprop_priority)
17455 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
17456 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
17457 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
17458 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
17459 (Qgnutls_bootprop_callbacks_verify): Make static.
17460
17461 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
17462
17463 * callproc.c: Indentation fixup.
17464
17465 * sysdep.c (wait_for_termination_1): Make static.
17466 (wait_for_termination, interruptible_wait_for_termination):
17467 Move after wait_for_termination_1.
17468
17469 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
17470
17471 * sysdep.c (interruptible_wait_for_termination): New function
17472 which is like wait_for_termination, but allows keyboard
17473 interruptions.
17474
17475 * callproc.c (Fcall_process): Add (:file "file") as an option for
17476 the STDOUT buffer.
17477 (Fcall_process_region): Ditto.
17478
17479 2011-04-30 Eli Zaretskii <eliz@gnu.org>
17480
17481 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
17482 rather than `XVECTOR (FOO)->size'.
17483
17484 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
17485 inttypes.h, as a gnulib replacement is used if it not available in
17486 system headers.
17487
17488 2011-04-21 Eli Zaretskii <eliz@gnu.org>
17489
17490 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
17491 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
17492 of MOST_POSITIVE_FIXNUM. (Bug#8528)
17493
17494 * coding.c (coding_alloc_by_realloc): Error out if destination
17495 will grow beyond MOST_POSITIVE_FIXNUM.
17496 (decode_coding_emacs_mule): Abort if there isn't enough place in
17497 charbuf for the composition carryover bytes. Reserve an extra
17498 space for up to 2 characters produced in a loop.
17499 (decode_coding_iso_2022): Abort if there isn't enough place in
17500 charbuf for the composition carryover bytes.
17501
17502 2011-04-21 Eli Zaretskii <eliz@gnu.org>
17503
17504 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
17505 aborting when %lld or %lll format is passed.
17506 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
17507 %llo or %llx format is passed. (Bug#8545)
17508
17509 * window.c (window_scroll_line_based): Use a marker instead of
17510 simple variables to record original value of point. (Bug#7952)
17511
17512 * doprnt.c (doprnt): Fix the case where a multibyte sequence
17513 produced by %s or %c overflows available buffer space. (Bug#8545)
17514
17515 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
17516
17517 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
17518 (SIZE_MAX): Move defn after all includes, as they might #define it.
17519
17520 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
17521
17522 * w32.c (init_environment): Warn about defaulting HOME to C:\.
17523
17524 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
17525
17526 * keyboard.c (Qdelayed_warnings_hook): Define.
17527 (command_loop_1): Run `delayed-warnings-hook'
17528 if Vdelayed_warnings_list is non-nil.
17529 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
17530 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
17531
17532 2011-04-28 Eli Zaretskii <eliz@gnu.org>
17533
17534 * doprnt.c (doprnt): Don't return value smaller than the buffer
17535 size if the message was truncated. (Bug#8545).
17536
17537 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
17538
17539 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
17540 (Fx_window_property): #if-0 the whole functions, not just the bodies.
17541
17542 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
17543
17544 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
17545
17546 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
17547
17548 * makefile.w32-in: Update dependencies.
17549
17550 2011-04-27 Eli Zaretskii <eliz@gnu.org>
17551
17552 Improve `doprnt' and its usage. (Bug#8545)
17553 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
17554 `format_end'. Remove support for %l as a conversion specifier.
17555 Don't use xrealloc. Improve diagnostics when the %l size modifier
17556 is used. Update the commentary.
17557
17558 * eval.c (verror): Simplify calculation of size_t.
17559
17560 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
17561 messages.
17562
17563 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
17564
17565 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
17566 change.
17567
17568 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
17569
17570 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
17571 This makes this file independent of the recent pseudovector change.
17572
17573 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
17574
17575 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
17576
17577 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
17578 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
17579 Remove unused local.
17580 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
17581
17582 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
17583 GCC 4.6.0 optimizes based on type-based alias analysis.
17584 For example, if b is of type struct buffer * and v of type struct
17585 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
17586 != &v->size, and therefore "v->size = 1; b->size = 2; return
17587 v->size;" must therefore return 1. This assumption is incorrect
17588 for Emacs, since it type-puns struct Lisp_Vector * with many other
17589 types. To fix this problem, this patch adds a new type struct
17590 vectorlike_header that documents the constraints on layout of vectors
17591 and pseudovectors, and helps optimizing compilers not get fooled
17592 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
17593 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
17594 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
17595 the size member.
17596 (XSETPVECTYPE): Rewrite in terms of new macro.
17597 (XSETPVECTYPESIZE): New macro, specifying both type and size.
17598 This is a bit clearer, and further avoids the possibility of
17599 undesirable aliasing.
17600 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
17601 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
17602 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
17603 since Lisp_Subr is a special case (no "next" field).
17604 (ASIZE): Now uses header.size rather than size.
17605 All previous uses of XVECTOR (foo)->size replaced to use this macro,
17606 to avoid the hassle of writing XVECTOR (foo)->header.size.
17607 (struct vectorlike_header): New type.
17608 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
17609 object, to help avoid aliasing.
17610 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
17611 (SUBRP): Likewise, since Lisp_Subr is a special case.
17612 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
17613 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
17614 (struct Lisp_Hash_Table): Combine first two members into a single
17615 struct vectorlike_header member. All uses of "size" and "next" members
17616 changed to be "header.size" and "header.next".
17617 * buffer.h (struct buffer): Likewise.
17618 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
17619 * frame.h (struct frame): Likewise.
17620 * process.h (struct Lisp_Process): Likewise.
17621 * termhooks.h (struct terminal): Likewise.
17622 * window.c (struct save_window_data, struct saved_window): Likewise.
17623 * window.h (struct window): Likewise.
17624 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
17625 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
17626 * buffer.c (init_buffer_once): Likewise.
17627 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
17628 special case.
17629 * process.c (Fformat_network_address): Use local var for size,
17630 for brevity.
17631
17632 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
17633
17634 Make the Lisp reader and string-to-float more consistent (Bug#8525)
17635 * data.c (atof): Remove decl; no longer used or needed.
17636 (digit_to_number): Move to lread.c.
17637 (Fstring_to_number): Use new string_to_number function, to be
17638 consistent with how the Lisp reader treats infinities and NaNs.
17639 Do not assume that floating-point numbers represent EMACS_INT
17640 without losing information; this is not true on most 64-bit hosts.
17641 Avoid double-rounding errors, by insisting on integers when
17642 parsing non-base-10 numbers, as the documentation specifies.
17643 * lisp.h (string_to_number): New decl, replacing ...
17644 (isfloat_string): Remove.
17645 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
17646 (read1): Do not accept +. and -. as integers; this
17647 appears to have been a coding error. Similarly, do not accept
17648 strings like +-1e0 as floating point numbers. Do not report
17649 overflow for integer overflows unless the base is not 10 which
17650 means we have no simple and reliable way to continue.
17651 Break out the floating-point parsing into a new
17652 function string_to_number, so that Fstring_to_number parses
17653 floating point numbers consistently with the Lisp reader.
17654 (digit_to_number): Move here from data.c. Make it static inline.
17655 (E_CHAR, EXP_INT): Remove, replacing with ...
17656 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
17657 (string_to_number): New function, replacing isfloat_string.
17658 This function checks for valid syntax and produces the resulting
17659 Lisp float number too. Rework it so that string-to-number
17660 no longer mishandles examples like "1.0e+". Use strtoumax,
17661 so that overflow for non-base-10 numbers is reported only when
17662 there's no portable and simple way to convert to floating point.
17663
17664 * textprop.c (set_text_properties_1): Rewrite for clarity,
17665 and to avoid GCC warning about integer overflow.
17666
17667 * intervals.h (struct interval): Use EMACS_INT for members
17668 where EMACS_UINT might cause problems. See
17669 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
17670 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
17671 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
17672 All uses changed.
17673 (offset_intervals): Tell GCC not to worry about length overflow
17674 when negating a negative length.
17675
17676 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
17677 (overrun_check_free): Likewise.
17678
17679 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
17680 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
17681 word size.
17682
17683 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
17684 (gnutls_make_error): Rename local to avoid shadowing.
17685 (gnutls_emacs_global_deinit): ifdef out; not used.
17686 (Fgnutls_boot): Use const for pointer to readonly storage.
17687 Comment out unused local. Fix pointer signedness problems.
17688
17689 * lread.c (openp): Don't stuff size_t into an 'int'.
17690 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
17691 about possible signed overflow.
17692
17693 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
17694 (GDK_KEY_g): Don't define if already defined.
17695 (xg_prepare_tooltip): Avoid pointer signedness problem.
17696 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
17697
17698 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
17699 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
17700
17701 * xfns.c (Fx_window_property): Simplify a bit,
17702 to make a bit faster and to avoid GCC 4.6.0 warning.
17703 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
17704
17705 * fns.c (internal_equal): Don't assume size_t fits in int.
17706
17707 * alloc.c (compact_small_strings): Tighten assertion a little.
17708
17709 Replace pEd with more-general pI, and fix some printf arg casts.
17710 * lisp.h (pI): New macro, generalizing old pEd macro to other
17711 conversion specifiers. For example, use "...%"pI"d..." rather
17712 than "...%"pEd"...".
17713 (pEd): Remove. All uses replaced with similar uses of pI.
17714 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
17715 * alloc.c (check_pure_size): Don't overflow by converting size to int.
17716 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
17717 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
17718 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
17719 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
17720 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
17721 64-bit hosts.
17722 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
17723 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
17724 * print.c (safe_debug_print, print_object): Likewise.
17725 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
17726 to int.
17727 Use pI instead of if-then-else-abort. Use %p to avoid casts,
17728 avoiding the 0 flag, which is not portable.
17729 * process.c (Fmake_network_process): Use pI to avoid cast.
17730 * region-cache.c (pp_cache): Likewise.
17731 * xdisp.c (decode_mode_spec): Likewise.
17732 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
17733 behavior on 64-bit hosts with printf arg.
17734 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
17735 (x_stop_queuing_selection_requests): Likewise.
17736 (x_get_window_property): Don't truncate byte count to an 'int'
17737 when tracing.
17738
17739 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
17740 here, since it parses constructs like leading '-' and spaces,
17741 which are not wanted; and it overflows with large numbers.
17742 Instead, simply match F[0-9]+, which is what is wanted anyway.
17743
17744 * alloc.c: Remove unportable assumptions about struct layout.
17745 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
17746 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
17747 (allocate_vectorlike, make_pure_vector): Use the new macros,
17748 plus offsetof, to remove unportable assumptions about struct layout.
17749 These assumptions hold on all porting targets that I know of, but
17750 they are not guaranteed, they're easy to remove, and removing them
17751 makes further changes easier.
17752
17753 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
17754 This doesn't fix a bug but makes the code clearer.
17755 (string_overrun_cookie): Now const. Use initializers that
17756 don't formally overflow signed char, to avoid warnings.
17757 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
17758 can cause Emacs to crash when string overrun checking is enabled.
17759 (allocate_buffer): Don't assume sizeof (struct buffer) is a
17760 multiple of sizeof (EMACS_INT); it need not be, if
17761 alignof(EMACS_INT) < sizeof (EMACS_INT).
17762 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
17763
17764 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
17765
17766 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
17767
17768 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
17769
17770 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
17771 supposed to be handshaking. (Bug#8556)
17772 Reported by Paul Eggert <eggert@cs.ucla.edu>.
17773
17774 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
17775
17776 * lisp.h (Qdebug): List symbol.
17777 * eval.c (Qdebug): Restore global linkage.
17778 * keyboard.c (debug-on-event): New variable.
17779 (handle_user_signal): Break into debugger when debug-on-event
17780 matches the current signal symbol.
17781
17782 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
17783
17784 * alloc.c (check_sblock, check_string_bytes)
17785 (check_string_free_list): Convert to standard C.
17786
17787 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
17788
17789 * w32.c (emacs_gnutls_push): Fix typo.
17790
17791 2011-04-25 Eli Zaretskii <eliz@gnu.org>
17792
17793 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
17794 "cast to pointer from integer of different size".
17795
17796 Improve doprnt and its use in verror. (Bug#8545)
17797 * doprnt.c (doprnt): Document the set of format control sequences
17798 supported by the function. Use SAFE_ALLOCA instead of always
17799 using `alloca'.
17800
17801 * eval.c (verror): Don't limit the buffer size at size_max-1, that
17802 is one byte too soon. Don't use xrealloc; instead xfree and
17803 xmalloc anew.
17804
17805 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
17806
17807 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
17808 callbacks stage.
17809
17810 * gnutls.c: Renamed global_initialized to
17811 gnutls_global_initialized. Added internals for the
17812 :verify-hostname-error, :verify-error, and :verify-flags
17813 parameters of `gnutls-boot' and documented those parameters in the
17814 docstring. Start callback support.
17815 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
17816 unless a fatal error occurred. Call gnutls_alert_send_appropriate
17817 on error. Return error code.
17818 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
17819 (emacs_gnutls_read): Likewise.
17820 (Fgnutls_boot): Return handshake error code.
17821 (emacs_gnutls_handle_error): New function.
17822 (wsaerror_to_errno): Likewise.
17823
17824 * w32.h (emacs_gnutls_pull): Add prototype.
17825 (emacs_gnutls_push): Likewise.
17826
17827 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
17828 (emacs_gnutls_push): Likewise.
17829
17830 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
17831
17832 * process.c (wait_reading_process_output): Check if GnuTLS
17833 buffered some data internally if no FDs are set for TLS
17834 connections.
17835
17836 * makefile.w32-in (OBJ2): Add gnutls.$(O).
17837 (LIBS): Link to USER_LIBS.
17838 ($(BLD)/gnutls.$(0)): New target.
17839
17840 2011-04-24 Eli Zaretskii <eliz@gnu.org>
17841
17842 * xdisp.c (handle_single_display_spec): Rename the
17843 display_replaced_before_p argument into display_replaced_p, to
17844 make it consistent with the commentary. Fix typos in the
17845 commentary.
17846
17847 * textprop.c (syms_of_textprop): Remove dead code.
17848 (copy_text_properties): Delete obsolete commentary about an
17849 interface that was deleted long ago. Fix typos in the description
17850 of arguments.
17851
17852 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
17853 to changes in oldXMenu/XMenu.h from 2011-04-16.
17854 <menu_help_message, prev_menu_help_message>: Constify.
17855 (IT_menu_make_room): menu->help_text is now `const char **';
17856 adjust.
17857
17858 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
17859 to changes in oldXMenu/XMenu.h from 2011-04-16.
17860 (struct XMenu): Declare `help_text' `const char **'.
17861
17862 * xfaces.c <Qunspecified>: Make extern again.
17863
17864 * syntax.c: Include sys/types.h before including regex.h, as
17865 required by POSIX.
17866
17867 * doc.c (get_doc_string): Improve the format passed to `error'.
17868
17869 * doprnt.c (doprnt): Improve commentary.
17870
17871 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
17872
17873 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
17874 them with etags.
17875
17876 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
17877 changes in globals.h immediately force recompilation.
17878 (TAGS): Depend on $(CURDIR)/m/intel386.h and
17879 $(CURDIR)/s/ms-w32.h.
17880 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
17881
17882 * character.c (Fchar_direction): Function deleted.
17883 (syms_of_character): Don't defsubr it.
17884 <char-direction-table>: Deleted.
17885
17886 2011-04-23 Eli Zaretskii <eliz@gnu.org>
17887
17888 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
17889 * doprnt.c: Include limits.h.
17890 (SIZE_MAX): New macro.
17891 (doprnt): Return a size_t value. 2nd arg is now size_t.
17892 Many local variables are now size_t instead of int or unsigned.
17893 Improve overflow protection. Support `l' modifier for integer
17894 conversions. Support %l conversion. Don't assume an EMACS_INT
17895 argument for integer conversions and for %c.
17896
17897 * lisp.h (doprnt): Restore prototype.
17898
17899 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
17900 $(SRC)/character.h.
17901
17902 * Makefile.in (base_obj): Add back doprnt.o.
17903
17904 * deps.mk (doprnt.o): Add back prerequisites.
17905 (callint.o): Depend on character.h.
17906
17907 * eval.c (internal_lisp_condition_case): Include the handler
17908 representation in the error message.
17909 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
17910 when breaking from the loop.
17911
17912 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
17913
17914 * callint.c (Fcall_interactively): When displaying error message
17915 about invalid control letter, pass the character's codepoint, not
17916 a pointer to its multibyte form. Improve display of the character
17917 in octal and display also its hex code.
17918
17919 * character.c (char_string): Use %x to display the (unsigned)
17920 codepoint of an invalid character, to avoid displaying a bogus
17921 negative value.
17922
17923 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
17924 `error', not SYMBOL_NAME itself.
17925
17926 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
17927 character arguments to `error'.
17928
17929 * charset.c (check_iso_charset_parameter): Fix incorrect argument
17930 to `error' in error message about FINAL_CHAR argument. Make sure
17931 FINAL_CHAR is a character, and use %c when it is passed as
17932 argument to `error'.
17933
17934 2011-04-23 Eli Zaretskii <eliz@gnu.org>
17935
17936 * s/ms-w32.h (localtime): Redirect to sys_localtime.
17937
17938 * w32.c: Include <time.h>.
17939 (sys_localtime): New function.
17940
17941 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
17942
17943 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
17944
17945 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
17946
17947 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
17948
17949 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
17950 zombies (Bug#8467).
17951
17952 2011-04-19 Eli Zaretskii <eliz@gnu.org>
17953
17954 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
17955 gl_state.e_property when gl_state.object is Qt.
17956
17957 * insdel.c (make_gap_larger): Remove limitation of buffer size
17958 to <= INT_MAX.
17959
17960 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
17961
17962 * xdisp.c (lookup_glyphless_char_display)
17963 (produce_glyphless_glyph): Handle cons cell entry in
17964 glyphless-char-display.
17965 (Vglyphless_char_display): Document it.
17966
17967 * term.c (produce_glyphless_glyph): Handle cons cell entry in
17968 glyphless-char-display.
17969
17970 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
17971
17972 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
17973
17974 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
17975
17976 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
17977 definition for no-X builds.
17978
17979 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
17980
17981 Static checks with GCC 4.6.0 and non-default toolkits.
17982
17983 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
17984
17985 * process.c (keyboard_bit_set): Define only if SIGIO.
17986 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
17987 (send_process): Repair possible setjmp clobbering.
17988
17989 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
17990
17991 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
17992
17993 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
17994
17995 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
17996 Define only if needed.
17997
17998 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
17999 by pacifying GCC about it. Maybe it's time to retire it?
18000 * xfaces.c (USG, __TIMEVAL__): Likewise.
18001
18002 * dispextern.h (struct redisplay_interface): Rename param
18003 to avoid shadowing.
18004 * termhooks.h (struct terminal): Likewise.
18005 * xterm.c (xembed_send_message): Likewise.
18006
18007 * insdel.c (make_gap_smaller): Define only if
18008 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
18009
18010 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
18011 it.
18012
18013 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
18014 so that we aren't warned about unused symbols.
18015
18016 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
18017
18018 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
18019
18020 * xfns.c (x_real_positions): Mark locals as initialized.
18021
18022 * xmenu.c (xmenu_show): Don't use uninitialized vars.
18023
18024 * xterm.c: Fix problems found by static analysis with other toolkits.
18025 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
18026 (x_dispatch_event): Declare static if USE_GTK, and
18027 define if USE_GTK || USE_X_TOOLKIT.
18028 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
18029 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
18030 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
18031 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
18032
18033 * xmenu.c (menu_help_callback): Pointer type fixes.
18034 Use const pointers when pointing at readonly data. Avoid pointer
18035 signedness clashes.
18036 (FALSE): Remove unused macro.
18037 (update_frame_menubar): Remove unused decl.
18038
18039 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
18040
18041 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
18042 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
18043 (single_menu_item): Rename local to avoid shadowing.
18044
18045 * keyboard.c (make_lispy_event): Remove unused local var.
18046
18047 * frame.c, frame.h (x_get_resource_string): Bring this back, but
18048 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
18049
18050 * bitmaps: Change bitmaps from unsigned char back to the X11
18051 compatible char. Avoid the old compiler warnings about
18052 out-of-range initializers by using, for example, '\xab' rather
18053 than 0xab.
18054
18055 * xgselect.c (xgselect_initialize): Check vs interface
18056 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
18057
18058 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
18059
18060 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
18061 to read-only memory.
18062
18063 * fns.c (vector): Remove; this old hack is no longer needed.
18064
18065 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
18066 Remove unused var.
18067 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
18068
18069 * xrdb.c (x_load_resources): Omit unused local.
18070
18071 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
18072 (x_window): Rename locals to avoid shadowing.
18073 (USG): Use the kludged USG macro, to pacify gcc.
18074
18075 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
18076 (x_term_init): Remove local to avoid shadowing.
18077
18078 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
18079
18080 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
18081 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
18082
18083 2011-04-16 Eli Zaretskii <eliz@gnu.org>
18084
18085 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
18086
18087 Fix regex.c, syntax.c and friends for buffers > 2GB.
18088 * syntax.h (struct gl_state_s): Declare character position members
18089 EMACS_INT.
18090
18091 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
18092
18093 * textprop.c (verify_interval_modification, interval_of):
18094 Declare arguments EMACS_INT.
18095
18096 * intervals.c (adjust_intervals_for_insertion): Declare arguments
18097 EMACS_INT.
18098
18099 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
18100
18101 * indent.c (Fvertical_motion): Local variable it_start is now
18102 EMACS_INT.
18103
18104 * regex.c (re_match, re_match_2, re_match_2_internal)
18105 (bcmp_translate, regcomp, regexec, print_double_string)
18106 (group_in_compile_stack, re_search, re_search_2, regex_compile)
18107 (re_compile_pattern, re_exec): Declare arguments and local
18108 variables `size_t' and `ssize_t' and return values `regoff_t', as
18109 appropriate.
18110 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
18111 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
18112 <compile_stack_type>: `size' and `avail' are now `size_t'.
18113
18114 * regex.h <regoff_t>: Use ssize_t, not int.
18115 (re_search, re_search_2, re_match, re_match_2): Arguments that
18116 specify buffer/string position and length are now ssize_t and
18117 size_t. Return type is regoff_t.
18118
18119 2011-04-16 Ben Key <bkey76@gmail.com>
18120
18121 * nsfont.m: Fixed bugs in ns_get_family and
18122 ns_descriptor_to_entity that were caused by using free to
18123 deallocate memory blocks that were allocated by xmalloc (via
18124 xstrdup). This caused Emacs to crash when compiled with
18125 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
18126 --enable-checking=xmallocoverrun). xfree is now used to
18127 deallocate these memory blocks.
18128
18129 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
18130
18131 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
18132
18133 emacs_write: Accept and return EMACS_INT for sizes.
18134 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
18135 et seq.
18136 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
18137 Accept and return EMACS_INT.
18138 (emacs_gnutls_write): Return the number of bytes written on
18139 partial writes.
18140 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
18141 (emacs_read, emacs_write): Remove check for negative size, as the
18142 Emacs source code has been audited now.
18143 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
18144 (emacs_read, emacs_write): Use it.
18145 * process.c (send_process): Adjust to the new signatures of
18146 emacs_write and emacs_gnutls_write. Do not attempt to store
18147 a byte offset into an 'int'; it might overflow.
18148 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
18149
18150 * sound.c: Don't assume sizes fit in 'int'.
18151 (struct sound_device.period_size, alsa_period_size):
18152 Return EMACS_INT, not int.
18153 (struct sound_device.write, vox_write, alsa_write):
18154 Accept EMACS_INT, not int.
18155 (wav_play, au_play): Use EMACS_INT to store sizes and to
18156 record read return values.
18157
18158 2011-04-15 Ben Key <bkey76@gmail.com>
18159
18160 * keyboard.c (Qundefined): Don't declare static since it is used
18161 in nsfns.m.
18162 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
18163 static since they are used in nsfont.m.
18164
18165 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
18166
18167 * process.c (Qprocessp): Don't declare static.
18168 * lisp.h (Qprocessp): Declare again.
18169
18170 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
18171
18172 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
18173
18174 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
18175
18176 Improve C-level modularity by making more things 'static'.
18177
18178 Don't publish debugger-only interfaces to other modules.
18179 * lisp.h (safe_debug_print, debug_output_compilation_hack):
18180 (verify_bytepos, count_markers): Move decls to the only modules
18181 that need them.
18182 * region-cache.h (pp_cache): Likewise.
18183 * window.h (check_all_windows): Likewise.
18184 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
18185
18186 * sysdep.c (croak): Now static, if
18187 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
18188 * syssignal.h (croak): Declare only if not static.
18189
18190 * alloc.c (refill_memory_reserve): Now static if
18191 !defined REL_ALLOC || defined SYSTEM_MALLOC.
18192 * lisp.h (refill_memory_reserve): Declare only if not static.
18193
18194 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
18195 Define only if USE_LUCID.
18196
18197 * xrdb.c (x_customization_string, x_rm_string): Now static.
18198
18199 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
18200 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
18201
18202 * xdisp.c (draw_row_with_mouse_face): Now static.
18203 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
18204
18205 * window.h (check_all_windows): Mark externally visible.
18206
18207 * window.c (window_deletion_count): Now static.
18208
18209 * undo.c: Make symbols static if they're not exported.
18210 (last_undo_buffer, last_boundary_position, pending_boundary):
18211 Now static.
18212
18213 * textprop.c (interval_insert_behind_hooks): Now static.
18214 (interval_insert_in_front_hooks): Likewise.
18215
18216 * term.c: Make symbols static if they're not exported.
18217 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
18218 (max_frame_lines, tty_set_terminal_modes):
18219 (tty_reset_terminal_modes, tty_turn_off_highlight):
18220 (get_tty_terminal): Now static.
18221 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
18222 * termhooks.h (term_mouse_moveto): Do not declare if
18223 HAVE_WINDOW_SYSTEM.
18224 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
18225 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
18226
18227 * sysdep.c: Make symbols static if they're not exported.
18228 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
18229 Now static.
18230 (sigprocmask_set, full_mask): Remove; unused.
18231 (wait_debugging): Mark as visible.
18232 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
18233 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
18234
18235 * syntax.c (syntax_temp): Define only if !__GNUC__.
18236
18237 * sound.c (current_sound_device, current_sound): Now static.
18238
18239 * search.c (searchbufs, searchbuf_head): Now static.
18240
18241 * scroll.c (scroll_cost): Remove; unused.
18242 * dispextern.h (scroll_cost): Remove decl.
18243
18244 * region-cache.h (pp_cache): Mark as externally visible.
18245
18246 * process.c: Make symbols static if they're not exported.
18247 (process_tick, update_tick, create_process, chan_process):
18248 (Vprocess_alist, proc_buffered_char, datagram_access):
18249 (fd_callback_data, send_process_frame, process_sent_to): Now static.
18250 (deactivate_process): Mark defn as static, as well as decl.
18251 * lisp.h (create_process): Remove decl.
18252 * process.h (chan_process, Vprocess_alist): Remove decls.
18253
18254 * print.c: Make symbols static if they're not exported.
18255 (print_depth, new_backquote_output, being_printed, print_buffer):
18256 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
18257 (print_interval, print_number_index, initial_stderr_stream):
18258 Now static.
18259 * lisp.h (Fprinc): Remove decl.
18260 (debug_output_compilation_hack): Mark as externally visible.
18261
18262 * sysdep.c (croak): Move decl from here to syssignal.h.
18263 * syssignal.h (croak): Put it here, so the API can be checked when
18264 'croak' is called from dissociate_if_controlling_tty.
18265
18266 * minibuf.c: Make symbols static if they're not exported.
18267 (minibuf_save_list, choose_minibuf_frame): Now static.
18268 * lisp.h (choose_minibuf_frame): Remove decl.
18269
18270 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
18271
18272 * lread.c: Make symbols static if they're not exported.
18273 (read_objects, initial_obarray, oblookup_last_bucket_number):
18274 Now static.
18275 (make_symbol): Remove; unused.
18276 * lisp.h (initial_obarray, make_symbol): Remove decls.
18277
18278 * keyboard.c: Make symbols static if they're not exported.
18279 (single_kboard, recent_keys_index, total_keys, recent_keys):
18280 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
18281 (this_single_command_key_start, echoing, last_auto_save):
18282 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
18283 (command_loop, echo_now, keyboard_init_hook, help_char_p):
18284 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
18285 (Vlispy_mouse_stem, double_click_count):
18286 Now static.
18287 (force_auto_save_soon): Define only if SIGDANGER.
18288 (ignore_mouse_drag_p): Now static if
18289 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
18290 (print_help): Remove; unused.
18291 (stop_character, last_timer_event): Mark as externally visible.
18292 * keyboard.h (ignore_mouse_drag_p): Declare only if
18293 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
18294 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
18295 * lisp.h (echoing): Remove decl.
18296 (force_auto_save_soon): Declare only if SIGDANGER.
18297 * xdisp.c (redisplay_window): Simplify code, to make it more
18298 obvious that ignore_mouse_drag_p is not accessed if !defined
18299 USE_GTK && !defined HAVE_NS.
18300
18301 * intervals.c: Make symbols static if they're not exported.
18302 (merge_properties_sticky, merge_interval_right, delete_interval):
18303 Now static.
18304 * intervals.h (merge_interval_right, delete_interval): Remove decls.
18305
18306 * insdel.c: Make symbols static if they're not exported.
18307 However, leave prepare_to_modify_buffer alone. It's never
18308 called from outside this function, but that appears to be a bug.
18309 (combine_after_change_list, combine_after_change_buffer):
18310 (adjust_after_replace, signal_before_change): Now static.
18311 (adjust_after_replace_noundo): Remove; unused.
18312 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
18313 (signal_before_change): Remove decls.
18314
18315 * indent.c (val_compute_motion, val_vmotion): Now static.
18316
18317 * image.c: Make symbols static if they're not exported.
18318 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
18319 if USE_GTK.
18320 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
18321 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
18322
18323 * fringe.c (standard_bitmaps): Now static.
18324 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
18325
18326 * frame.c: Make symbols static if they're not exported.
18327 (x_report_frame_params, make_terminal_frame): Now static.
18328 (get_frame_param): Now static, unless HAVE_NS.
18329 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
18330 (x_get_resource_string): Remove; not used.
18331 * frame.h (make_terminal_frame, x_report_frame_params):
18332 (x_get_resource_string); Remove decls.
18333 (x_fullscreen_adjust): Declare only if WINDOWSNT.
18334 * lisp.h (get_frame_param): Declare only if HAVE_NS.
18335
18336 * font.c, fontset.c: Make symbols static if they're not exported.
18337 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
18338 (FACE_SUITABLE_FOR_CHAR_P): Use it.
18339 * font.c (font_close_object): Now static.
18340 * font.h (font_close_object): Remove.
18341 * fontset.c (FONTSET_OBJLIST): Remove.
18342 (free_realized_fontset) #if-0 the body, which does nothing.
18343 (face_suitable_for_char_p): #if-0, as it's never called.
18344 * fontset.h (face_suitable_for_char_p): Remove decl.
18345 * xfaces.c (face_at_string_position):
18346 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
18347 since 0 is always ASCII.
18348
18349 * fns.c (weak_hash_tables): Now static.
18350
18351 * fileio.c: Make symbols static if they're not exported.
18352 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
18353 (Vwrite_region_annotation_buffers): Now static.
18354
18355 * eval.c: Make symbols static if they're not exported.
18356 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
18357 * lisp.h (backtrace_list): Remove decl.
18358
18359 * emacs.c: Make symbols static if they're not exported.
18360 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
18361 (fatal_error_code, fatal_error_signal_hook, standard_args):
18362 Now static.
18363 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
18364 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
18365 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
18366 * lisp.h (fatal_error_signal_hook): Remove decl.
18367 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
18368
18369 * editfns.c: Move a (normally-unused) function to its only use.
18370 * editfns.c, lisp.h (get_operating_system_release): Remove.
18371 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
18372 worth the hassle of breaking this out.
18373
18374 * xterm.c: Make symbols static if they're not exported.
18375 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
18376 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
18377 (x_destroy_window, x_delete_display):
18378 Now static.
18379 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
18380 (x_mouse_leave): Remove; unused.
18381 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
18382 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
18383 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
18384 Remove decls.
18385 (x_mouse_leave): Declare only if WINDOWSNT.
18386 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
18387 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
18388 USE_X_TOOLKIT.
18389
18390 * ftxfont.c: Make symbols static if they're not exported.
18391 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
18392 HAVE_FREETYPE.
18393 * font.h (ftxfont_driver): Likewise.
18394
18395 * xfns.c: Make symbols static if they're not exported.
18396 (x_last_font_name, x_display_info_for_name):
18397 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
18398 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
18399 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
18400 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
18401 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
18402 (last_show_tip_args): Now static.
18403 (xic_defaut_fontset, xic_create_fontsetname): Define only if
18404 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
18405 (x_screen_planes): Remove; unused.
18406 * dispextern.h (x_screen_planes): Remove decl.
18407
18408 * dispnew.c: Make symbols static if they're not exported.
18409 * dispextern.h (redraw_garbaged_frames, scrolling):
18410 (increment_row_positions): Remove.
18411 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
18412 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
18413 Now static.
18414 (redraw_garbaged_frames): Remove; unused.
18415
18416 * xfaces.c: Make symbols static if they're not exported.
18417 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
18418 Remove decls.
18419 * xterm.h (defined_color): Remove decls.
18420 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
18421 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
18422 (menu_face_changed_default, defined_color, free_realized_face):
18423 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
18424 (ascii_face_of_lisp_face): Remove; unused.
18425
18426 * xdisp.c: Make symbols static if they're not exported.
18427 * dispextern.h (scratch_glyph_row, window_box_edges):
18428 (glyph_to_pixel_coords, set_cursor_from_row):
18429 (get_next_display_element, set_iterator_to_next):
18430 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
18431 (show_mouse_face): Remove decls
18432 * frame.h (message_buf_print): Likewise.
18433 * lisp.h (pop_message, set_message, check_point_in_composition):
18434 Likewise.
18435 * xterm.h (set_vertical_scroll_bar): Likewise.
18436 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
18437 (message_buf_print, scratch_glyph_row, displayed_buffer):
18438 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
18439 (get_next_display_element, show_mouse_face, window_box_edges):
18440 (frame_to_window_pixel_xy, check_point_in_composition):
18441 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
18442 (glyph_to_pixel_coords): Remove; unused.
18443
18444 * dired.c (file_name_completion): Now static.
18445
18446 * dbusbind.c (xd_in_read_queued_messages): Now static.
18447
18448 * lisp.h (circular_list_error, FOREACH): Remove; unused.
18449 * data.c (circular_list_error): Remove.
18450
18451 * commands.h (last_point_position, last_point_position_buffer):
18452 (last_point_position_window): Remove decls.
18453 * keyboard.c: Make these variables static.
18454
18455 * coding.h (coding, code_convert_region, encode_coding_gap):
18456 Remove decls.
18457 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
18458 (iso_code_class, detect_coding, code_convert_region): Now static.
18459 (encode_coding_gap): Remove; unused.
18460
18461 * chartab.c (chartab_chars, chartab_bits): Now static.
18462
18463 * charset.h (charset_iso_8859_1): Remove decl.
18464 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
18465 Now static.
18466
18467 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
18468 * ccl.c (Vccl_program_table): Now static.
18469 (check_ccl_update): Remove; unused.
18470
18471 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
18472 * category.h: ... from here.
18473 * category.c (check_category_table, set_category_set): Now static.
18474
18475 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
18476 * lisp.h: Remove these decls.
18477
18478 * buffer.c (buffer_count): Remove unused var.
18479
18480 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
18481 so that it's not optimized away.
18482 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
18483 * dispextern.h (bidi_dump_cached_states): Remove, since it's
18484 exported only to the debugger.
18485
18486 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
18487 * atimer.h (run_all_atimers): Remove; not exported.
18488
18489 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
18490 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
18491 was inaccessible from Lisp.
18492 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
18493 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
18494
18495 alloc.c: Import and export fewer symbols, and remove unused items.
18496 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
18497 is defined.
18498 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
18499 it's not optimized away by whole-program optimization.
18500 (message_enable_multibyte, free_misc): Remove.
18501 (catchlist, handlerlist, mark_backtrace):
18502 Declare only if BYTE_MARK_STACK.
18503 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
18504 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
18505 (message_enable_multibyte): Remove decl.
18506 (free_misc, interval_free_list, float_block, float_block_index):
18507 (n_float_blocks, float_free_list, cons_block, cons_block_index):
18508 (cons_free_list, last_marked_index):
18509 Now static.
18510 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
18511 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
18512 (mark_backtrace): Define only if BYTE_MARK_STACK.
18513 * xdisp.c (message_enable_multibyte): Now static.
18514
18515 Declare Lisp_Object Q* variables to be 'static' if not exported.
18516 This makes it easier for human readers (and static analyzers)
18517 to see whether these variables are used from other modules.
18518 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
18519 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
18520 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
18521 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
18522 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
18523 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
18524 * xmenu.c, xselect.c:
18525 Declare Q* vars static if they are not used in other modules.
18526 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
18527 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
18528 Remove decls of unexported vars.
18529 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
18530
18531 * lisp.h (DEFINE_FUNC): Make sname 'static'.
18532
18533 Make Emacs functions such as Fatom 'static' by default.
18534 This makes it easier for human readers (and static analyzers)
18535 to see whether these functions can be called from other modules.
18536 DEFUN now defines a static function. To make the function external
18537 so that it can be used in other C modules, use the new macro DEFUE.
18538 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
18539 (Finit_image_library):
18540 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
18541 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
18542 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
18543 Remove decls, since these functions are now static.
18544 (Funintern, Fget_internal_run_time): New decls, since these functions
18545 were already external.
18546
18547 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
18548 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
18549 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
18550 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
18551 * keyboard.c, keymap.c, lread.c:
18552 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
18553 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
18554 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
18555 Mark functions with DEFUE instead of DEFUN,
18556 if they are used in other modules.
18557 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
18558 decls for now-static functions.
18559 * buffer.h (Fdelete_overlay): Remove decl.
18560 * callproc.c (Fgetenv_internal): Mark as internal.
18561 * composite.c (Fremove_list_of_text_properties): Remove decl.
18562 (Fcomposition_get_gstring): New forward static decl.
18563 * composite.h (Fcomposite_get_gstring): Remove decl.
18564 * dired.c (Ffile_attributes): New forward static decl.
18565 * doc.c (Fdocumntation_property): New forward static decl.
18566 * eval.c (Ffetch_bytecode): New forward static decl.
18567 (Funintern): Remove extern decl; now in .h file where it belongs.
18568 * fileio.c (Fmake_symbolic_link): New forward static decl.
18569 * image.c (Finit_image_library): New forward static decl.
18570 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
18571 * intervals.h (Fprevious_property_change):
18572 (Fremove_list_of_text_properties): Remove decls.
18573 * keyboard.c (Fthis_command_keys): Remove decl.
18574 (Fcommand_execute): New forward static decl.
18575 * keymap.c (Flookup_key): New forward static decl.
18576 (Fcopy_keymap): Now static.
18577 * keymap.h (Flookup_key): Remove decl.
18578 * process.c (Fget_process): New forward static decl.
18579 (Fprocess_datagram_address): Mark as internal.
18580 * syntax.c (Fsyntax_table_p): New forward static decl.
18581 (skip_chars): Remove duplicate decl.
18582 * textprop.c (Fprevious_property_change): New forward static decl.
18583 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
18584 Now internal.
18585 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
18586 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
18587
18588 * editfns.c (Fformat): Remove unreachable code.
18589
18590 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
18591
18592 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
18593 change. (Bug#8496)
18594
18595 2011-04-13 Eli Zaretskii <eliz@gnu.org>
18596
18597 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
18598 when at ZV. (Bug#8487)
18599
18600 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
18601
18602 * charset.c (Fclear_charset_maps): Use xfree instead of free.
18603 (Bug#8437)
18604 * keyboard.c (parse_tool_bar_item): Likewise.
18605 * sound.c (sound_cleanup, alsa_close): Likewise.
18606 * termcap.c (tgetent): Likewise.
18607 * xfns.c (x_default_font_parameter): Likewise.
18608 * xsettings.c (read_and_apply_settings): Likewise.
18609
18610 * alloc.c (overrun_check_malloc, overrun_check_realloc)
18611 (overrun_check_free): Protoize.
18612
18613 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
18614
18615 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
18616 since callers should never pass a negative size.
18617 Change the signature to match that of plain 'read' and 'write'; see
18618 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
18619 * lisp.h: Update prototypes of emacs_write and emacs_read.
18620
18621 2011-04-11 Eli Zaretskii <eliz@gnu.org>
18622
18623 * xdisp.c (redisplay_window): Don't try to determine the character
18624 position of the scroll margin if the window start point w->startp
18625 is outside the buffer's accessible region. (Bug#8468)
18626
18627 2011-04-10 Eli Zaretskii <eliz@gnu.org>
18628
18629 Fix write-region and its subroutines for buffers > 2GB.
18630 * fileio.c (a_write, e_write): Modify declaration of arguments and
18631 local variables to support buffers larger than 2GB.
18632 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
18633
18634 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
18635 argument, local variables, and return value.
18636
18637 * lisp.h: Update prototypes of emacs_write and emacs_read.
18638
18639 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
18640
18641 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
18642
18643 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
18644
18645 Fix more problems found by GCC 4.6.0's static checks.
18646
18647 * xdisp.c (vmessage): Use a better test for character truncation.
18648
18649 * charset.c (load_charset_map): <, not <=, for optimization,
18650 and to avoid potential problems with integer overflow.
18651 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
18652 * casetab.c (set_identity, shuffle): Likewise.
18653 * editfns.c (Fformat): Likewise.
18654 * syntax.c (skip_chars): Likewise.
18655
18656 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
18657 This also lets GCC 4.6.0 generate slightly better loop code.
18658
18659 * callint.c (Fcall_interactively): <, not <=, for optimization.
18660 (Fcall_interactively): Count the number of arguments produced,
18661 not the number of arguments given. This is simpler and lets GCC
18662 4.6.0 generate slightly better code.
18663
18664 * ftfont.c: Distingish more carefully between FcChar8 and char.
18665 The previous code passed unsigned char * to a functions like
18666 strlen and xstrcasecmp that expect char *, which does not
18667 conform to the C standard.
18668 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
18669 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
18670 char * when the C standard requires it.
18671
18672 * keyboard.c (read_char): Remove unused var.
18673
18674 * eval.c: Port to Windows vsnprintf (Bug#8435).
18675 Include <limits.h>.
18676 (SIZE_MAX): Define if the headers do not.
18677 (verror): Do not give up if vsnprintf returns a negative count.
18678 Instead, grow the buffer. This ports to Windows vsnprintf, which
18679 does not conform to C99. Problem reported by Eli Zaretskii.
18680 Also, simplify the allocation scheme, by avoiding the need for
18681 calling realloc, and removing the ALLOCATED variable.
18682
18683 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
18684
18685 Remove invocations of doprnt, as Emacs now uses vsnprintf.
18686 But keep the doprint source code for now, as we might revamp it
18687 and use it again (Bug#8435).
18688 * lisp.h (doprnt): Remove.
18689 * Makefile.in (base_obj): Remove doprnt.o.
18690 * deps.mk (doprnt.o): Remove.
18691
18692 error: Print 32- and 64-bit integers portably (Bug#8435).
18693 Without this change, on typical 64-bit hosts error ("...%d...", N)
18694 was used to print both 32- and 64-bit integers N, which relied on
18695 undefined behavior.
18696 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
18697 * lisp.h (error, verror): Mark as printf-like functions.
18698 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
18699 Report overflow in size calculations when allocating printf buffer.
18700 Do not truncate output string at its first null byte.
18701 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
18702 Truncate the output at a character boundary, since vsnprintf does not
18703 do that.
18704 * charset.c (check_iso_charset_parameter): Convert internal
18705 character to string before calling 'error', since %c now has the
18706 printf meaning.
18707 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
18708 overflow when computing char to be passed to 'error'. Do not
18709 pass Lisp_Object to 'error'; pass the integer instead.
18710 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
18711 formatted with plain %d.
18712
18713 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
18714
18715 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
18716
18717 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
18718
18719 * xterm.c (x_catch_errors): Remove duplicate declaration.
18720
18721 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
18722
18723 * xdisp.c, lisp.h (message_nolog): Remove; unused.
18724
18725 2011-04-10 Jim Meyering <meyering@redhat.com>
18726
18727 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
18728 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
18729 return ssize_t not "int", and use size_t as the buffer length.
18730 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
18731 * gnutls.h: Update declarations.
18732 * process.c (read_process_output): Use ssize_t, to match.
18733 (send_process): Likewise.
18734
18735 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
18736
18737 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
18738
18739 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
18740
18741 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
18742 Use unsigned char, to match FcChar8 type definition.
18743
18744 * xterm.c (handle_one_xevent):
18745 * xmenu.c (create_and_show_popup_menu):
18746 * xselect.c (x_decline_selection_request)
18747 (x_reply_selection_request): Avoid type-punned deref of X events.
18748
18749 2011-04-09 Eli Zaretskii <eliz@gnu.org>
18750
18751 Fix some uses of `int' instead of EMACS_INT.
18752 * search.c (string_match_1, fast_string_match)
18753 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
18754 (scan_buffer, find_next_newline_no_quit)
18755 (find_before_next_newline, search_command, Freplace_match)
18756 (Fmatch_data): Make some `int' variables be EMACS_INT.
18757
18758 * xdisp.c (display_count_lines): 3rd argument and return value now
18759 EMACS_INT. All callers changed.
18760 (pint2hrstr): Last argument is now EMACS_INT.
18761
18762 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
18763 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
18764 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
18765 (decode_coding_utf_16, decode_coding_emacs_mule)
18766 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
18767 (decode_coding_ccl, decode_coding_charset)
18768 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
18769 (decode_coding_iso_2022, decode_coding_emacs_mule)
18770 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
18771 <char_offset, last_offset>: Declare EMACS_INT.
18772 (encode_coding_utf_8, encode_coding_utf_16)
18773 (encode_coding_emacs_mule, encode_invocation_designation)
18774 (encode_designation_at_bol, encode_coding_iso_2022)
18775 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
18776 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
18777 Declare EMACS_INT.
18778 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
18779 (encode_invocation_designation): Last argument P_NCHARS is now
18780 EMACS_INT.
18781 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
18782 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
18783
18784 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
18785 All users changed.
18786
18787 * ccl.c (Fccl_execute_on_string): Declare some variables
18788 EMACS_INT.
18789
18790 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
18791
18792 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
18793
18794 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
18795
18796 * process.c (Fformat_network_address): Doc fix.
18797
18798 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
18799
18800 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
18801
18802 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
18803
18804 * keyboard.c (read_char): Call Lisp function help-form-show,
18805 instead of using internal_with_output_to_temp_buffer.
18806 (Qhelp_form_show): New var.
18807 (syms_of_keyboard): Use DEFSYM macro.
18808
18809 * print.c (internal_with_output_to_temp_buffer): Function deleted.
18810
18811 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
18812
18813 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
18814
18815 * process.c (Flist_processes): Remove to Lisp.
18816 (list_processes_1): Delete.
18817
18818 2011-04-06 Eli Zaretskii <eliz@gnu.org>
18819
18820 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
18821
18822 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
18823
18824 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
18825
18826 Fix more problems found by GCC 4.6.0's static checks.
18827
18828 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
18829
18830 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
18831
18832 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
18833
18834 * xdisp.c (vmessage): Mark as a printf-like function.
18835
18836 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
18837
18838 * sound.c (sound_warning): Don't crash if arg contains a printf format.
18839
18840 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
18841 printf-like functions.
18842 (tiff_load): Add casts to remove these marks before passing them
18843 to system-supplied API.
18844
18845 * eval.c (Fsignal): Remove excess argument to 'fatal'.
18846
18847 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
18848 This avoids several warnings with gcc -Wstrict-overflow.
18849 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
18850 directly, rather than having caller test rule sign. This avoids
18851 some unnecessary tests.
18852 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
18853 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
18854 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
18855
18856 * xfont.c (xfont_text_extents): Remove var that was set but not used.
18857 (xfont_open): Avoid unnecessary tests.
18858
18859 * composite.c (composition_gstring_put_cache): Use unsigned integer.
18860
18861 * composite.h, composite.c (composition_gstring_put_cache):
18862 Use EMACS_INT, not int, for length.
18863
18864 * composite.h (COMPOSITION_DECODE_REFS): New macro,
18865 breaking out part of COMPOSITION_DECODE_RULE.
18866 (COMPOSITION_DECODE_RULE): Use it.
18867 * composite.c (get_composition_id): Remove unused local vars,
18868 by using the new macro.
18869
18870 * textprop.c (set_text_properties_1): Change while to do-while,
18871 since the condition is always true at first.
18872
18873 * intervals.c (graft_intervals_into_buffer): Mark var as used.
18874 (interval_deletion_adjustment): Return unsigned value.
18875 All uses changed.
18876
18877 * process.c (list_processes_1, create_pty, read_process_output):
18878 (exec_sentinel): Remove vars that were set but not used.
18879 (create_pty): Remove unnecessary "volatile"s.
18880 (Fnetwork_interface_info): Avoid possibility of int overflow.
18881 (read_process_output): Do adaptive read buffering even if carryover.
18882 (read_process_output): Simplify nbytes computation if buffered.
18883
18884 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
18885
18886 * syntax.c (scan_words): Remove var that was set but not used.
18887 (update_syntax_table): Use unsigned instead of int.
18888
18889 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
18890 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
18891 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
18892
18893 * print.c (print_error_message): Avoid int overflow.
18894
18895 * font.c (font_list_entities): Redo for clarity,
18896 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
18897
18898 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
18899 (font_score): Avoid potential overflow in diff calculation.
18900
18901 * fns.c (substring_both): Remove var that is set but not used.
18902 (sxhash): Redo loop for clarity and to avoid wraparound warning.
18903
18904 * eval.c (funcall_lambda): Rename local to avoid shadowing.
18905
18906 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
18907 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
18908 can always succeed if overflow has undefined behavior.
18909
18910 * search.c (boyer_moore, wordify): Remove vars set but not used.
18911 (wordify): Omit three unnecessary tests.
18912
18913 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
18914 All callers changed. This avoids the need for an unused var.
18915
18916 * casefiddle.c (casify_region): Remove var that is set but not used.
18917
18918 * dired.c (file_name_completion): Remove var that is set but not used.
18919
18920 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
18921
18922 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
18923 (Finsert_file_contents): Remove unnecessary code checking fd.
18924
18925 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
18926 Check for integer overflow on size calculations.
18927
18928 * buffer.c (Fprevious_overlay_change): Remove var that is set
18929 but not used.
18930
18931 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
18932 Remove vars that are set but not used.
18933 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
18934 (timer_check_2): Mark vars as initialized.
18935
18936 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
18937
18938 * image.c (lookup_image): Remove var that is set but not used.
18939 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
18940
18941 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
18942 that are set but not used.
18943
18944 * xfns.c (make_invisible_cursor): Don't return garbage
18945 if XCreateBitmapFromData fails (Bug#8410).
18946
18947 * xselect.c (x_get_local_selection, x_handle_property_notify):
18948 Remove vars that are set but not used.
18949
18950 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
18951 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
18952
18953 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
18954 Remove var that is set but not used.
18955 (scroll_bar_windows_size): Now size_t, not int.
18956 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
18957 Check for overflow.
18958
18959 * xfaces.c (realize_named_face): Remove vars that are set but not used.
18960 (map_tty_color) [!defined MSDOS]: Likewise.
18961
18962 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
18963
18964 * coding.c: Remove vars that are set but not used.
18965 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
18966 All callers changed.
18967 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
18968 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
18969 (decode_coding_charset): Remove vars that are set but not used.
18970
18971 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
18972 that is set but not used.
18973
18974 * print.c (print_object): Remove var that is set but not used.
18975
18976 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
18977 The gnulib version avoids calling malloc in the usual case,
18978 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
18979 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
18980 * filelock.c (current_lock_owner): Likewise.
18981 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
18982 * sysdep.c: Include allocator.h, careadlinkat.h.
18983 (emacs_no_realloc_allocator): New static constant.
18984 (emacs_readlink): New function.
18985 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
18986 ../lib/careadlinkat.h.
18987
18988 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
18989
18990 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
18991 first non-nil return value).
18992
18993 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
18994
18995 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
18996 if not defined (Bug#8403).
18997
18998 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
18999
19000 * xdisp.c (display_count_lines): Remove parameter `start',
19001 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
19002 (get_char_face_and_encoding): Remove parameter `multibyte_p',
19003 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
19004 (fill_stretch_glyph_string): Remove parameters `row' and `area',
19005 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
19006 and thereabouts. All callers changed.
19007 (get_per_char_metric): Remove parameter `f', unused since
19008 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
19009
19010 2011-04-02 Jim Meyering <meyering@redhat.com>
19011
19012 do not dereference NULL upon failed strdup
19013 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
19014 (ns_get_family): Likewise.
19015
19016 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
19017
19018 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
19019
19020 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
19021
19022 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
19023 later (Bug#8403).
19024
19025 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
19026
19027 Add lexical binding.
19028
19029 * window.c (Ftemp_output_buffer_show): New fun.
19030 (Fsave_window_excursion):
19031 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
19032
19033 * lread.c (lisp_file_lexically_bound_p): New function.
19034 (Fload): Bind Qlexical_binding.
19035 (readevalloop): Remove `evalfun' arg.
19036 Bind Qinternal_interpreter_environment.
19037 (Feval_buffer): Bind Qlexical_binding.
19038 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
19039 Mark as dynamic.
19040 (syms_of_lread): Declare `lexical-binding'.
19041
19042 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
19043
19044 * keyboard.c (eval_dyn): New fun.
19045 (menu_item_eval_property): Use it.
19046
19047 * image.c (parse_image_spec): Use Ffunctionp.
19048
19049 * fns.c (concat, mapcar1): Accept byte-code-functions.
19050
19051 * eval.c (Fsetq): Handle lexical vars.
19052 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
19053 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
19054 (FletX, Flet): Obey lexical binding.
19055 (Fcommandp): Handle closures.
19056 (Feval): New `lexical' arg.
19057 (eval_sub): New function extracted from Feval. Use it almost
19058 everywhere where Feval was used. Look up vars in lexical env.
19059 Handle closures.
19060 (Ffunctionp): Move from subr.el.
19061 (Ffuncall): Handle closures.
19062 (apply_lambda): Remove `eval_flags'.
19063 (funcall_lambda): Handle closures and new byte-code-functions.
19064 (Fspecial_variable_p): New function.
19065 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
19066 but without exporting it to Lisp.
19067
19068 * doc.c (Fdocumentation, store_function_docstring):
19069 * data.c (Finteractive_form): Handle closures.
19070
19071 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
19072 interactive spec.
19073
19074 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
19075 New byte-codes.
19076 (exec_byte_code): New function extracted from Fbyte_code to handle new
19077 calling convention for byte-code-functions. Add new byte-codes.
19078
19079 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
19080
19081 * alloc.c (Fmake_symbol): Init new `declared_special' field.
19082
19083 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
19084
19085 * xdisp.c (redisplay_internal): Fix prototype.
19086
19087 2011-03-31 Eli Zaretskii <eliz@gnu.org>
19088
19089 * xdisp.c (SCROLL_LIMIT): New macro.
19090 (try_scrolling): Use it when setting scroll_limit.
19091 Limit scrolling to 100 screen lines.
19092 (redisplay_window): Even when falling back on "recentering",
19093 position point in the window according to scroll-conservatively,
19094 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
19095
19096 (try_scrolling): When point is above the window, allow searching
19097 as far as scroll_max, or one screenful, to compute vertical
19098 distance from PT to the scroll margin position. This prevents
19099 try_scrolling from unnecessarily failing when
19100 scroll-conservatively is set to a value slightly larger than the
19101 window height. Clean up the case of PT below the margin at bottom
19102 of window: scroll_max can no longer be INT_MAX. When aggressive
19103 scrolling is in use, don't let point enter the opposite scroll
19104 margin as result of the scroll.
19105 (syms_of_xdisp) <scroll-conservatively>: Document the
19106 threshold of 100 lines for never-recentering scrolling.
19107
19108 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
19109
19110 * dispextern.h (move_it_by_lines):
19111 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
19112 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
19113 (message_log_check_duplicate): Remove parameters `prev_bol' and
19114 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
19115 (redisplay_internal): Remove parameter `preserve_echo_area',
19116 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
19117
19118 * indent.c (Fvertical_motion):
19119 * window.c (window_scroll_pixel_based, Frecenter):
19120 Don't pass `need_y_p' to `move_it_by_lines'.
19121
19122 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
19123
19124 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
19125 steal a few bits to be more compact.
19126 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
19127 Remove unneeded casts.
19128
19129 * bytecode.c (Fbyte_code): CAR and CDR can GC.
19130
19131 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
19132
19133 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
19134 binding" message (bug#7967).
19135
19136 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
19137
19138 Fix more problems found by GCC 4.6.0's static checks.
19139
19140 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
19141 Remove unused local var.
19142
19143 * editfns.c (Fmessage_box): Remove unused local var.
19144
19145 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
19146 (note_mode_line_or_margin_highlight, note_mouse_highlight):
19147 Omit unused local vars.
19148 * window.c (shrink_windows): Omit unused local var.
19149 * menu.c (digest_single_submenu): Omit unused local var.
19150 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
19151 Omit unused local var.
19152
19153 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
19154 Don't assume string length fits in int.
19155 (keyremap_step, read_key_sequence): Use size_t for sizes.
19156 (read_key_sequence): Don't check last_real_key_start redundantly.
19157
19158 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
19159 instead of alloca (Bug#8344).
19160
19161 * eval.c (Fbacktrace): Don't assume nargs fits in int.
19162 (Fbacktrace_frame): Don't assume nframes fits in int.
19163
19164 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
19165
19166 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
19167 concerns.
19168
19169 * term.c (produce_glyphless_glyph): Remove unnecessary test.
19170
19171 * cm.c (calccost): Turn while-do into do-while, for clarity.
19172
19173 * keyboard.c (syms_of_keyboard): Use the same style as later
19174 in this function when indexing through an array. This also
19175 works around GCC bug 48267.
19176
19177 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
19178
19179 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
19180
19181 * chartab.c (sub_char_table_ref_and_range): Redo for slight
19182 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
19183
19184 * keyboard.c, keyboard.h (num_input_events): Now size_t.
19185 This avoids undefined behavior on integer overflow, and is a bit
19186 more convenient anyway since it is compared to a size_t variable.
19187
19188 Variadic C functions now count arguments with size_t, not int.
19189 This avoids an unnecessary limitation on 64-bit machines, which
19190 caused (substring ...) to crash on large vectors (Bug#8344).
19191 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
19192 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
19193 All variadic functions and their callers changed accordingly.
19194 (struct gcpro.nvars): Now size_t, not int. All uses changed.
19195 * data.c (arith_driver, float_arith_driver): Likewise.
19196 * editfns.c (general_insert_function): Likewise.
19197 * eval.c (struct backtrace.nargs, interactive_p)
19198 (internal_condition_case_n, run_hook_with_args, apply_lambda)
19199 (funcall_lambda, mark_backtrace): Likewise.
19200 * fns.c (concat): Likewise.
19201 * frame.c (x_set_frame_parameters): Likewise.
19202 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
19203 0 if not found, not -1. All callers changed.
19204
19205 * alloc.c (garbage_collect): Don't assume stack size fits in int.
19206 (stack_copy_size): Now size_t, not int.
19207 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
19208
19209 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
19210
19211 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
19212 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
19213 All callers changed.
19214
19215 * lisp.h (multibyte_char_to_unibyte):
19216 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
19217 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
19218 * character.h (CHAR_TO_BYTE8):
19219 * cmds.c (internal_self_insert):
19220 * editfns.c (general_insert_function):
19221 * keymap.c (push_key_description):
19222 * search.c (Freplace_match):
19223 * xdisp.c (message_dolog, set_message_1): All callers changed.
19224
19225 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
19226
19227 * keyboard.c (safe_run_hook_funcall): New function.
19228 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
19229 don't set the hook to nil, but remove the offending function instead.
19230 (Qcommand_hook_internal): Remove, unused.
19231 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
19232 Vcommand_hook_internal.
19233
19234 * eval.c (enum run_hooks_condition): Remove.
19235 (funcall_nil, funcall_not): New functions.
19236 (run_hook_with_args): Call each function through a `funcall' argument.
19237 Remove `cond' argument, now redundant.
19238 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
19239 (Frun_hook_with_args_until_failure): Adjust accordingly.
19240 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
19241
19242 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
19243
19244 * dispextern.h (string_buffer_position): Remove declaration.
19245
19246 * print.c (strout): Remove parameter `multibyte', unused since
19247 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
19248
19249 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
19250 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
19251 All callers changed.
19252
19253 * w32.c (_wsa_errlist): Use braces for struct initializers.
19254
19255 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
19256 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
19257 All callers changed.
19258 (string_buffer_position): Likewise. Also, make static (it's never
19259 used outside xdisp.c).
19260 (cursor_row_p): Remove parameter `w', unused since
19261 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
19262 (decode_mode_spec): Remove parameter `precision', introduced during
19263 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
19264 All callers changed.
19265
19266 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
19267
19268 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
19269
19270 2011-03-27 Anders Lindgren <andlind@gmail.com>
19271
19272 * nsterm.m (ns_menu_bar_is_hidden): New variable.
19273 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
19274 (ns_update_auto_hide_menu_bar): New functions.
19275 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
19276 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
19277 ns_constrain_all_frames.
19278 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
19279 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
19280
19281 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
19282
19283 * nsmenu.m (runDialogAt): Remove argument to timer_check.
19284
19285 2011-03-27 Glenn Morris <rgm@gnu.org>
19286
19287 * syssignal.h: Replace RETSIGTYPE with void.
19288 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
19289 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
19290 Replace SIGTYPE with void everywhere.
19291 * s/usg5-4-common.h (SIGTYPE): Remove definition.
19292 * s/template.h (SIGTYPE): Remove commented out definition.
19293
19294 2011-03-26 Eli Zaretskii <eliz@gnu.org>
19295
19296 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
19297 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
19298
19299 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
19300
19301 * w32.c (read_unc_volume): Use parameter `henum', instead of
19302 global variable `wget_enum_handle'.
19303
19304 * keymap.c (describe_vector): Remove parameters `indices' and
19305 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
19306 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
19307
19308 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
19309
19310 * keyboard.c (timer_check): Remove parameter `do_it_now',
19311 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
19312 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
19313 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
19314
19315 * keyboard.c (read_char):
19316 * w32menu.c (w32_menu_display_help):
19317 * xmenu.c (show_help_event, menu_help_callback):
19318 Adjust calls to `show_help_echo'.
19319
19320 * gtkutil.c (xg_maybe_add_timer):
19321 * keyboard.c (readable_events):
19322 * process.c (wait_reading_process_output):
19323 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
19324
19325 * insdel.c (adjust_markers_gap_motion):
19326 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
19327 (gap_left, gap_right): Don't call it.
19328
19329 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
19330
19331 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
19332 incurred during fontification.
19333
19334 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
19335
19336 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
19337 (DEFVAR_PER_BUFFER): Don't pass it.
19338
19339 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
19340 (scrolling_window): Don't pass it.
19341
19342 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
19343
19344 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
19345
19346 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
19347 and `suffix'.
19348 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
19349 of variables specific to SELinux and computation of `encoded_absname'.
19350
19351 * image.c (XPutPixel): Remove unused variable `height'.
19352
19353 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
19354
19355 * unexw32.c (get_section_info): Remove unused variable `section'.
19356
19357 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
19358 (system_process_attributes): Remove unused variable `sess'.
19359 (sys_read): Remove unused variable `err'.
19360
19361 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
19362 (w32_wnd_proc): Remove unused variable `isdead'.
19363 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
19364 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
19365 (x_create_tip_frame): Remove unused variable `tem'.
19366
19367 * w32inevt.c (w32_console_read_socket):
19368 Remove unused variable `no_events'.
19369
19370 * w32term.c (x_draw_composite_glyph_string_foreground):
19371 Remove unused variable `width'.
19372
19373 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
19374
19375 * w32term.c (x_set_glyph_string_clipping):
19376 Don't pass uninitialized region to CombineRgn.
19377
19378 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
19379
19380 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
19381 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
19382 (Fx_close_connection): Remove unused variable `i'.
19383
19384 * w32font.c (w32font_draw): Return number of glyphs.
19385 (w32font_open_internal): Remove unused variable `i'.
19386 (w32font_driver): Add missing initializer.
19387
19388 * w32menu.c (utf8to16): Remove unused variable `utf16'.
19389 (fill_in_menu): Remove unused variable `items_added'.
19390
19391 * w32term.c (last_mouse_press_frame): Remove static global variable.
19392 (w32_clip_to_row): Remove unused variable `f'.
19393 (x_delete_terminal): Remove unused variable `i'.
19394
19395 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
19396 (NOTHING): Remove unused static global variable.
19397 (uniscribe_check_otf): Remove unused variable `table'.
19398 (uniscribe_font_driver): Add missing initializers.
19399
19400 2011-03-23 Julien Danjou <julien@danjou.info>
19401
19402 * term.c (Fsuspend_tty, Fresume_tty):
19403 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
19404 * window.c (temp_output_buffer_show):
19405 * insdel.c (signal_before_change):
19406 * frame.c (Fhandle_switch_frame):
19407 * fileio.c (Fdo_auto_save):
19408 * emacs.c (Fkill_emacs):
19409 * editfns.c (save_excursion_restore):
19410 * cmds.c (internal_self_insert):
19411 * callint.c (Fcall_interactively):
19412 * buffer.c (Fkill_all_local_variables):
19413 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
19414 Use Frun_hooks.
19415 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
19416 unconditionally since it does the check itself.
19417
19418 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
19419
19420 Fix more problems found by GCC 4.5.2's static checks.
19421
19422 * coding.c (encode_coding_raw_text): Avoid unnecessary test
19423 the first time through the loop, since we know p0 < p1 then.
19424 This also avoids a gcc -Wstrict-overflow warning.
19425
19426 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
19427 leading to a memory leak, possible in functions like
19428 load_charset_map_from_file that can allocate an unbounded number
19429 of objects (Bug#8318).
19430
19431 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
19432 that could (at least in theory) be that large.
19433
19434 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
19435 This is less likely to overflow, and avoids undefined behavior if
19436 overflow does occur. All callers changed. Use strtoul to scan
19437 for the unsigned long integer.
19438 (pint2hrstr): Simplify and tune code slightly.
19439 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19440
19441 * scroll.c (do_scrolling): Work around GCC bug 48228.
19442 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
19443
19444 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
19445 This also avoids a warning with gcc -Wstrict-overflow.
19446 (validate_x_resource_name): Simplify count usage.
19447 This also avoids a warning with gcc -Wstrict-overflow.
19448
19449 * fileio.c (Fcopy_file): Report error if fchown or fchmod
19450 fail (Bug#8306).
19451
19452 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
19453
19454 * process.c (Fmake_network_process): Use socklen_t, not int,
19455 where POSIX says socklen_t is required in portable programs.
19456 This fixes a porting bug on hosts like 64-bit HP-UX, where
19457 socklen_t is wider than int (Bug#8277).
19458 (Fmake_network_process, server_accept_connection):
19459 (wait_reading_process_output, read_process_output):
19460 Likewise.
19461
19462 * process.c: Rename or move locals to avoid shadowing.
19463 (list_processes_1, Fmake_network_process):
19464 (read_process_output_error_handler, exec_sentinel_error_handler):
19465 Rename or move locals.
19466 (Fmake_network_process): Define label "retry_connect" only if needed.
19467 (Fnetwork_interface_info): Fix pointer signedness.
19468 (process_send_signal): Add cast to avoid pointer signedness problem.
19469 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
19470 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
19471
19472 Make tparam.h and terminfo.c consistent.
19473 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
19474 Include tparam.h instead, since it declares them.
19475 * cm.h (PC): Remove extern decl; tparam.h now does this.
19476 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
19477 * terminfo.c: Include tparam.h, to check interfaces.
19478 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
19479 (tparam): Adjust signature to match interface in tparam.h;
19480 this removes some undefined behavior. Check that outstring and len
19481 are zero, which they always are with Emacs.
19482 * tparam.h (PC, BC, UP): New extern decls.
19483
19484 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
19485 (xftfont_open): Rename locals to avoid shadowing.
19486
19487 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
19488 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
19489 (OTF_TAG_SYM): Omit macro if not needed.
19490 (ftfont_list): Remove unused local.
19491 (get_adstyle_property, ftfont_pattern_entity):
19492 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
19493 Rename locals to avoid shadowing.
19494
19495 * xfont.c (xfont_list_family): Mark var as initialized.
19496
19497 * xml.c (make_dom): Now static.
19498
19499 * composite.c (composition_compute_stop_pos): Rename local to
19500 avoid shadowing.
19501 (composition_reseat_it): Remove unused locals.
19502 (find_automatic_composition, composition_adjust_point): Likewise.
19503 (composition_update_it): Mark var as initialized.
19504 (find_automatic_composition): Mark vars as initialized,
19505 with a FIXME (Bug#8290).
19506
19507 character.h: Rename locals to avoid shadowing.
19508 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
19509 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
19510 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
19511 (BUF_DEC_POS): Be more systematic about renaming local temporaries
19512 to avoid shadowing.
19513
19514 * textprop.c (property_change_between_p): Remove; unused.
19515
19516 * intervals.c (interval_start_pos): Now static.
19517
19518 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
19519
19520 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
19521 Rename locals to avoid shadowing.
19522
19523 * sound.c (wav_play, au_play, Fplay_sound_internal):
19524 Fix pointer signedness.
19525 (alsa_choose_format): Remove unused local var.
19526 (wav_play): Initialize a variable to 0, to prevent undefined
19527 behavior (Bug#8278).
19528
19529 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
19530
19531 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
19532
19533 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
19534 clobbering (Bug#8298).
19535 * sysdep.c (sys_subshell): Likewise.
19536 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
19537
19538 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
19539 This should get cleaned up, so that child_setup has the
19540 same signature on all platforms.
19541
19542 * callproc.c (call_process_cleanup): Now static.
19543 (relocate_fd): Rename locals to avoid shadowing.
19544
19545 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
19546
19547 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
19548 not to be necessary, and produces flickering.
19549
19550 2011-03-20 Glenn Morris <rgm@gnu.org>
19551
19552 * config.in: Remove file.
19553
19554 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
19555
19556 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
19557 are now in src/globals.h.
19558 (syms_of_minibuf): Remove spurious & from previous change.
19559
19560 2011-03-20 Leo Liu <sdl.web@gmail.com>
19561
19562 * minibuf.c (completing-read-function): New variable.
19563 (completing-read-default): Rename from completing-read.
19564 (completing-read): Call completing-read-function.
19565
19566 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
19567
19568 * xfaces.c (Fx_load_color_file):
19569 Read color file from absolute filename (bug#8250).
19570
19571 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
19572
19573 * makefile.w32-in: Update dependencies.
19574
19575 2011-03-17 Eli Zaretskii <eliz@gnu.org>
19576
19577 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
19578
19579 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
19580
19581 Fix more problems found by GCC 4.5.2's static checks.
19582
19583 * process.c (make_serial_process_unwind, send_process_trap):
19584 (sigchld_handler): Now static.
19585
19586 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
19587 That way, the code declares only the vars that it needs.
19588 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
19589 * s/cygwin.h (PTY_ITERATION): Likewise.
19590 * s/darwin.h (PTY_ITERATION): Likewise.
19591 * s/gnu-linux.h (PTY_ITERATION): Likewise.
19592
19593 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
19594 * process.c (allocate_pty): Don't declare stb unless it's needed.
19595
19596 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
19597 (CONSTANTLIM): Remove; unused.
19598 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
19599 Define only if needed.
19600
19601 * unexelf.c (unexec): Name an expression,
19602 to avoid gcc -Wbad-function-cast warning.
19603 Use a different way to cause a compilation error if anyone uses
19604 n rather than nn, a way that does not involve shadowing.
19605 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
19606
19607 * deps.mk (unexalpha.o): Remove; unused.
19608
19609 New file unexec.h, the (simple) interface for unexec (Bug#8267).
19610 * unexec.h: New file.
19611 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
19612 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
19613 Depend on unexec.h.
19614 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
19615 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
19616 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
19617 Change as necessary to match prototype in unexec.h.
19618
19619 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
19620 shadowing.
19621 (back_comment, skip_chars): Mark vars as initialized.
19622
19623 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
19624 Rename locals to avoid shadowing.
19625
19626 * lread.c (read1): Rewrite so as not to use empty "else".
19627 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
19628
19629 * print.c (Fredirect_debugging_output): Fix pointer signedess.
19630
19631 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
19632 warning when compiling print.c.
19633
19634 * font.c (font_unparse_fcname): Abort in an "impossible" situation
19635 instead of using an uninitialized var.
19636 (font_sort_entities): Mark var as initialized.
19637
19638 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
19639
19640 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
19641 pointers to constants.
19642 (font_parse_fcname): Remove unused vars.
19643 (font_delete_unmatched): Now static.
19644 (font_get_spec): Remove; unused.
19645 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
19646 (font_update_drivers, Ffont_get_glyphs, font_add_log):
19647 Rename or move locals to avoid shadowing.
19648
19649 * fns.c (require_nesting_list, require_unwind): Now static.
19650 (Ffillarray): Rename locals to avoid shadowing.
19651
19652 * floatfns.c (domain_error2): Define only if needed.
19653 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
19654
19655 * alloc.c (mark_backtrace): Move decl from here ...
19656 * lisp.h: ... to here, so that it can be checked.
19657
19658 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
19659 (Fdefvar): Rewrite so as not to use empty "else".
19660 (lisp_indirect_variable): Name an expression,
19661 to avoid gcc -Wbad-function-cast warning.
19662 (Fdefvar): Rename locals to avoid shadowing.
19663
19664 * callint.c (quotify_arg, quotify_args): Now static.
19665 (Fcall_interactively): Rename locals to avoid shadowing.
19666 Use const pointer when appropriate.
19667
19668 * lisp.h (get_system_name, get_operating_system_release):
19669 Move decls here, to check interfaces.
19670 * process.c (get_operating_system_release): Move decl to lisp.h.
19671 * xrdb.c (get_system_name): Likewise.
19672 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
19673 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
19674 some of which prompt warnings from gcc -Wbad-function-cast.
19675 (Fformat_time_string, Fencode_time, Finsert_char):
19676 (Ftranslate_region_internal, Fformat):
19677 Rename or remove local vars to avoid shadowing.
19678 (Ftranslate_region_internal): Mark var as initialized.
19679
19680 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
19681 avoid shadowing.
19682
19683 * lisp.h (eassert): Check that the argument compiles, even if
19684 ENABLE_CHECKING is not defined.
19685
19686 * data.c (Findirect_variable): Name an expression, to avoid
19687 gcc -Wbad-function-cast warning.
19688 (default_value, arithcompare, arith_driver, arith_error): Now static.
19689 (store_symval_forwarding): Rename local to avoid shadowing.
19690 (Fmake_variable_buffer_local, Fmake_local_variable):
19691 Mark variables as initialized.
19692 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
19693
19694 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
19695 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
19696 Rename locals to avoid shadowing.
19697 (mark_stack): Move local variables into the #ifdef region where
19698 they're used.
19699 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
19700 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
19701 needed otherwise.
19702 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
19703 (GC_STRING_CHARS): Remove; not used.
19704 (Fmemory_limit): Cast sbrk's returned value to char *.
19705
19706 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
19707 avoids undefined behavior in theory.
19708
19709 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
19710
19711 Use functions, not macros, for up- and down-casing (Bug#8254).
19712 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
19713 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
19714 to use the following functions instead of these macros.
19715 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
19716 EMACS_INT, since callers assume the returned value fits in int.
19717 (upcase1): Likewise, for UPCASE_TABLE.
19718 (uppercasep, lowercasep, upcase): New static inline functions.
19719 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
19720 the race-condition problem in the old DOWNCASE.
19721
19722 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
19723 Rename locals to avoid shadowing.
19724 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
19725 (regex_compile, re_search_2, re_match_2_internal):
19726 Remove unused local vars.
19727 (FREE_VAR): Rewrite so as not to use empty "else",
19728 which gcc can warn about.
19729 (regex_compile, re_match_2_internal): Mark locals as initialized.
19730 (RETALLOC_IF): Define only if needed.
19731 (WORDCHAR_P): Likewise. This one is never needed, but is used
19732 only in a comment talking about a compiler bug, so put inside
19733 the #if 0 of that comment.
19734 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
19735 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
19736 Remove; unused.
19737
19738 * search.c (boyer_moore): Rename locals to avoid shadowing.
19739 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
19740 (PREV_CHAR_BOUNDARY): Likewise.
19741
19742 * search.c (simple_search): Remove unused var.
19743
19744 * dired.c (compile_pattern): Move decl from here ...
19745 * lisp.h: ... to here, so that it can be checked.
19746 (struct re_registers): New forward decl.
19747
19748 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
19749
19750 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
19751 All uses changed.
19752 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
19753 Rename locals to avoid shadowing.
19754 (Fvertical_motion): Mark locals as initialized.
19755
19756 * casefiddle.c (casify_object, casify_region): Now static.
19757 (casify_region): Mark local as initialized.
19758
19759 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
19760
19761 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
19762 New macros, so that the caller can use some names other than
19763 gcpro1, gcpro2, etc.
19764 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
19765 of the new macros.
19766 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
19767 argument, for consistency with GCPRO2_VAR, etc: it is now the
19768 prefix of the variable, not the variable itself. All uses
19769 changed.
19770 * dired.c (directory_files_internal, file_name_completion):
19771 Rename locals to avoid shadowing.
19772
19773 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
19774 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
19775 dired.c's scmp function, had undefined behavior.
19776 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
19777 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
19778 * buffer.h: ... to here, because these macros use current_buffer,
19779 and the new implementation with inline functions needs to have
19780 current_buffer in scope now, rather than later when the macros
19781 are used.
19782 (downcase, upcase1): New static inline functions.
19783 (DOWNCASE, UPCASE1): Reimplement using these functions.
19784 This avoids undefined behavior in expressions like
19785 DOWNCASE (x) == DOWNCASE (y), which previously suffered
19786 from race conditions in accessing the global variables
19787 case_temp1 and case_temp2.
19788 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
19789 * lisp.h (case_temp1, case_temp2): Remove their decls.
19790 * character.h (ASCII_CHAR_P): Move from here ...
19791 * lisp.h: ... to here, so that the inline functions mentioned
19792 above can use them.
19793
19794 * dired.c (directory_files_internal_unwind): Now static.
19795
19796 * fileio.c (file_name_as_directory, directory_file_name):
19797 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
19798 Now static.
19799 (file_name_as_directory): Use const pointers when appropriate.
19800 (Fexpand_file_name): Likewise. In particular, newdir might
19801 point at constant storage, so make it a const pointer.
19802 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
19803 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
19804 signedness issues.
19805 (Fset_file_times, Finsert_file_contents, auto_save_error):
19806 Rename locals to avoid shadowing.
19807
19808 * minibuf.c (choose_minibuf_frame_1): Now static.
19809 (Ftry_completion, Fall_completions): Rename or remove locals
19810 to avoid shadowing.
19811
19812 * marker.c (bytepos_to_charpos): Remove; unused.
19813
19814 * lisp.h (verify_bytepos, count_markers): New decls,
19815 so that gcc does not warn that these functions aren't declared.
19816
19817 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
19818 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
19819 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
19820 (copy_text): Remove unused local var.
19821
19822 * filelock.c (within_one_second): Now static.
19823 (lock_file_1): Rename local to avoid shadowing.
19824
19825 * buffer.c (fix_overlays_before): Mark locals as initialized.
19826 (fix_start_end_in_overlays): Likewise. This function should be
19827 simplified by using pointers-to-pointers, but that's a different
19828 matter.
19829 (switch_to_buffer_1): Now static.
19830 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
19831 (report_overlay_modification): Rename locals to avoid shadowing.
19832
19833 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
19834 Fix pointer signedness issue.
19835 (sys_subshell): Mark local as volatile if checking for lint,
19836 to suppress a gcc -Wclobbered warning that does not seem to be right.
19837 (MAXPATHLEN): Define only if needed.
19838
19839 * process.c (serial_open, serial_configure): Move decls from here ...
19840 * systty.h: ... to here, so that they can be checked.
19841
19842 * fns.c (get_random, seed_random): Move extern decls from here ...
19843 * lisp.h: ... to here, so that they can be checked.
19844
19845 * sysdep.c (reset_io): Now static.
19846 (wait_for_termination_signal): Remove; unused.
19847
19848 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
19849 (copy_keymap_item, append_key, push_text_char_description):
19850 Now static.
19851 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
19852 (DENSE_TABLE_SIZE): Remove; unused.
19853 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
19854 (describe_map_tree):
19855 Rename locals to avoid shadowing.
19856
19857 * keyboard.c: Declare functions static if they are not used elsewhere.
19858 (echo_char, echo_dash, cmd_error, top_level_2):
19859 (poll_for_input, handle_async_input): Now static.
19860 (read_char, kbd_buffer_get_event, make_lispy_position):
19861 (make_lispy_event, make_lispy_movement, apply_modifiers):
19862 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
19863 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
19864 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
19865 (read_key_sequence, read_char): Mark locals as initialized.
19866 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
19867
19868 * keyboard.h (make_ctrl_char): New decl.
19869 (mark_kboards): Move decl here ...
19870 * alloc.c (mark_kboards): ... from here.
19871
19872 * lisp.h (force_auto_save_soon): New decl.
19873
19874 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
19875 (DEFINE_DUMMY_FUNCTION): New macro.
19876 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
19877 Use it.
19878 (main): Add casts to avoid warnings
19879 if GCC considers string literals to be constants.
19880
19881 * lisp.h (fatal_error_signal): Add decl, since it's exported.
19882
19883 * dbusbind.c: Pointer signedness fixes.
19884 (xd_signature, xd_append_arg, xd_initialize):
19885 (Fdbus_call_method, Fdbus_call_method_asynchronously):
19886 (Fdbus_method_return_internal, Fdbus_method_error_internal):
19887 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
19888 (Fdbus_register_signal): Use SSDATA when the context wants char *.
19889
19890 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
19891 if GCC considers string literals to be constants.
19892 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
19893
19894 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
19895
19896 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
19897 (print_preprocess, print_object): New macro to fix last change.
19898
19899 * print.c (print_preprocess): Don't forget font objects.
19900
19901 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
19902
19903 * emacs.c (USAGE3): Doc fixes.
19904
19905 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
19906
19907 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
19908 structure.
19909
19910 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
19911
19912 * lisp.h (VWindow_system, Qfile_name_history):
19913 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
19914 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
19915 (w32_system_caret_x, w32_system_caret_y): Declare extern.
19916
19917 * w32select.c: Don't #include "keyboard.h".
19918 (run_protected): Add extern declaration for waiting_for_input.
19919
19920 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
19921 * w32console.c (detect_input_pending, read_input_pending)
19922 (encode_terminal_code):
19923 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
19924 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
19925 (w32_system_caret_y, Qfile_name_history):
19926 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
19927 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
19928 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
19929 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
19930 * w32proc.c (Qlocal, report_file_error):
19931 * w32term.c (Vwindow_system, updating_frame):
19932 * w32uniscribe.c (initialized, uniscribe_font_driver):
19933 Remove unneeded extern declarations.
19934
19935 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
19936
19937 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
19938
19939 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
19940
19941 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
19942 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
19943 These macros can no longer be used for assignment.
19944
19945 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
19946 Assign struct members directly, instead of using BUF_BEGV etc.
19947 (record_buffer_markers, fetch_buffer_markers): New functions for
19948 recording and fetching special buffer markers.
19949 (set_buffer_internal_1, set_buffer_temp): Use them.
19950
19951 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
19952
19953 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
19954
19955 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
19956 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
19957
19958 * xdisp.c (hscroll_window_tree):
19959 (reconsider_clip_changes): Use PT instead of BUF_PT.
19960
19961 2011-03-13 Eli Zaretskii <eliz@gnu.org>
19962
19963 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
19964 $(EMACS_ROOT)/lib/intprops.h.
19965
19966 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
19967
19968 Fix more problems found by GCC 4.5.2's static checks.
19969
19970 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
19971 to unsigned char * to avoid compiler diagnostic.
19972 (xg_free_frame_widgets): Make it clear that a local variable is
19973 needed only if USE_GTK_TOOLTIP.
19974 (gdk_window_get_screen): Make it clear that this macro is needed
19975 only if USE_GTK_TOOLTIP.
19976 (int_gtk_range_get_value): New function, which avoids a diagnostic
19977 from gcc -Wbad-function-cast.
19978 (xg_set_toolkit_scroll_bar_thumb): Use it.
19979 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
19980 diagnostic from gcc -Wbad-function-cast.
19981 (get_utf8_string, xg_get_file_with_chooser):
19982 Rename locals to avoid shadowing.
19983 (create_dialog): Move locals to avoid shadowing.
19984
19985 * xgselect.c (xg_select): Remove unused var.
19986
19987 * image.c (four_corners_best): Mark locals as initialized.
19988 (gif_load): Initialize transparent_p to zero (Bug#8238).
19989 Mark another local as initialized.
19990 (my_png_error, my_error_exit): Mark with NO_RETURN.
19991
19992 * image.c (clear_image_cache): Now static.
19993 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
19994 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
19995 (x_edge_detection): Remove unnecessary cast that
19996 gcc -Wbad-function-cast diagnoses.
19997 (gif_load): Fix pointer signedness.
19998 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
19999 (jpeg_load, gif_load): Rename locals to avoid shadowing.
20000
20001 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
20002
20003 Improve quality of tests for time stamp overflow.
20004 For example, without this patch (encode-time 0 0 0 1 1
20005 1152921504606846976) returns the obviously-bogus value (-948597
20006 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
20007 reports time overflow. See
20008 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
20009 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
20010 * editfns.c: Include limits.h and intprops.h.
20011 (TIME_T_MIN, TIME_T_MAX): New macros.
20012 (time_overflow): Move earlier, to before first use.
20013 (hi_time, lo_time): New functions, for an accurate test for
20014 out-of-range times.
20015 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
20016 (Fget_internal_run_time): Don't assume time_t fits in int.
20017 (make_time): Use list2 instead of Fcons twice.
20018 (Fdecode_time): More accurate test for out-of-range times.
20019 (check_tm_member): New function.
20020 (Fencode_time): Use it, to test for out-of-range times.
20021 (lisp_time_argument): Don't rely on undefined left-shift and
20022 right-shift behavior when checking for time stamp overflow.
20023
20024 * editfns.c (time_overflow): New function, refactoring common code.
20025 (Fformat_time_string, Fdecode_time, Fencode_time):
20026 (Fcurrent_time_string): Use it.
20027
20028 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
20029 * dired.c (make_time): Move to ...
20030 * editfns.c (make_time): ... here.
20031 * systime.h: Note the move.
20032
20033 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20034
20035 * fringe.c (update_window_fringes): Remove unused variables.
20036
20037 * unexmacosx.c (copy_data_segment): Also copy __got section.
20038 (Bug#8223)
20039
20040 2011-03-12 Eli Zaretskii <eliz@gnu.org>
20041
20042 * termcap.c [MSDOS]: Include "msdos.h".
20043 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
20044 Constify `char *' arguments and their references according to
20045 prototypes in tparam.h.
20046
20047 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
20048
20049 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
20050 Adapt all references accordingly.
20051
20052 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
20053
20054 2011-03-11 Tom Tromey <tromey@redhat.com>
20055
20056 * buffer.c (syms_of_buffer): Remove obsolete comment.
20057
20058 2011-03-11 Eli Zaretskii <eliz@gnu.org>
20059
20060 * termhooks.h (encode_terminal_code): Declare prototype.
20061
20062 * msdos.c (encode_terminal_code): Don't declare prototype.
20063
20064 * term.c (encode_terminal_code): Now external again, used by
20065 w32console.c and msdos.c.
20066
20067 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
20068 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
20069
20070 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
20071
20072 Fix some minor problems found by GCC 4.5.2's static checks.
20073
20074 * fringe.c (update_window_fringes): Mark locals as initialized
20075 (Bug#8227).
20076 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
20077
20078 * alloc.c (mark_fringe_data): Move decl from here ...
20079 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
20080 to check its interface.
20081 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
20082
20083 * fontset.c (free_realized_fontset): Now static.
20084 (Fset_fontset_font): Rename local to avoid shadowing.
20085 (fontset_font): Mark local as initialized.
20086 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
20087
20088 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
20089
20090 * xselect.c (x_disown_buffer_selections): Remove; not used.
20091 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
20092 (x_own_selection, Fx_disown_selection_internal): Rename locals
20093 to avoid shadowing.
20094 (x_handle_dnd_message): Remove local to avoid shadowing.
20095
20096 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
20097 so that the caller can use some name other than gcpro1.
20098 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
20099 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
20100 (Fx_backspace_delete_keys_p):
20101 Use them to avoid shadowing, and rename vars to avoid shadowing.
20102 (x_decode_color, x_set_name, x_window): Now static.
20103 (Fx_create_frame): Add braces to silence GCC warning.
20104 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
20105 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
20106 Remove unused locals.
20107 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
20108 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
20109 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
20110 macros.
20111
20112 * xterm.h (x_mouse_leave): New decl.
20113
20114 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
20115 Remove unused functions.
20116 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
20117 (x_calc_absolute_position): Now static.
20118 (XTread_socket): Don't define label "out" unless it's used.
20119 Don't declare local "event" unless it's used.
20120 (x_iconify_frame, x_free_frame_resources): Don't declare locals
20121 unless they are used.
20122 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
20123 (x_fatal_error_signal): Remove; not used.
20124 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
20125 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
20126 (x_error_catcher, x_connection_closed, x_error_handler):
20127 (x_error_quitter, xembed_send_message, x_iconify_frame):
20128 (my_log_handler): Rename locals to avoid shadowing.
20129 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
20130 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
20131
20132 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
20133 Rename or move locals to avoid shadowing.
20134 (tty_defined_color, merge_face_heights): Now static.
20135 (free_realized_faces_for_fontset): Remove; not used.
20136 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
20137 does not deduce is never used uninitialized.
20138 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
20139 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
20140
20141 * terminal.c (store_terminal_param): Now static.
20142
20143 * xmenu.c (menu_highlight_callback): Now static.
20144 (set_frame_menubar): Remove unused local.
20145 (xmenu_show): Rename parameter to avoid shadowing.
20146 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
20147 since they might point to immutable storage.
20148 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
20149 since it's unused otherwise.
20150
20151 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
20152 Add a FIXME, since the code still doesn't look right. (Bug#8215)
20153 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
20154 avoids a gcc -Wuninitialized diagnostic.
20155 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
20156 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
20157 does not deduce are never used uninitialized.
20158
20159 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
20160
20161 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
20162 * window.c (window_loop, size_window):
20163 (run_window_configuration_change_hook, enlarge_window): Likewise.
20164
20165 * window.c (display_buffer): Now static.
20166 (size_window): Mark variables that gcc -Wuninitialized
20167 does not deduce are never used uninitialized.
20168 * window.h (check_all_windows): New decl, to forestall
20169 gcc -Wmissing-prototypes diagnostic.
20170 * dispextern.h (bidi_dump_cached_states): Likewise.
20171
20172 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
20173 shadowing.
20174 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
20175 Include <limits.h>.
20176 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
20177 and to avoid gcc -Wuninitialized warning.
20178 (load_charset_map): Mark variables that gcc -Wuninitialized
20179 does not deduce are never used uninitialized.
20180 (load_charset): Abort instead of using uninitialized var (Bug#8229).
20181
20182 * coding.c (coding_set_source, coding_set_destination):
20183 Use "else { /* comment */ }" rather than "else /* comment */;"
20184 for clarity, and to avoid gcc -Wempty-body warning.
20185 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
20186 a block, when the outer 'i' will do.
20187 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
20188 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
20189 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
20190 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
20191 (Fdecode_sjis_char, Fdefine_coding_system_internal):
20192 Rename locals to avoid shadowing.
20193 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
20194 * coding.c (emacs_mule_char, encode_invocation_designation):
20195 Now static, since they're not used elsewhere.
20196 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
20197 (decode_coding_object, encode_coding_object, detect_coding_system):
20198 (decode_coding_emacs_mule): Mark variables that gcc
20199 -Wuninitialized does not deduce are never used uninitialized.
20200 (detect_coding_iso_2022): Initialize a local variable that might
20201 be used uninitialized. Leave a FIXME because it's not clear that
20202 this initialization is needed. (Bug#8211)
20203 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
20204 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
20205 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
20206 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
20207 Remove unused macros.
20208
20209 * category.c (hash_get_category_set): Remove unused local var.
20210 (copy_category_table): Now static, since it's not used elsewhere.
20211 * character.c (string_count_byte8): Likewise.
20212
20213 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
20214 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
20215
20216 * chartab.c (copy_sub_char_table): Now static, since it's not used
20217 elsewhere.
20218 (sub_char_table_ref_and_range, char_table_ref_and_range):
20219 Rename locals to avoid shadowing.
20220 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
20221
20222 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
20223 (BIDI_BOB): Remove unused macro.
20224
20225 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
20226 deduce are never used uninitialized.
20227 * term.c (encode_terminal_code): Likewise.
20228
20229 * term.c (encode_terminal_code): Now static. Remove unused local.
20230
20231 * tparam.h: New file.
20232 * term.c, tparam.h: Include it.
20233 * deps.mk (term.o, tparam.o): Depend on tparam.h.
20234 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
20235 Move these decls to tparam.h, and make them agree with what
20236 is actually in tparam.c. The previous trick of using incompatible
20237 decls in different modules does not conform to the C standard.
20238 All callers of tparam changed to use tparam's actual API.
20239 * tparam.c (tparam1, tparam, tgoto):
20240 Use const pointers where appropriate.
20241
20242 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
20243 * cm.h (struct cm): Likewise.
20244 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
20245 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
20246 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
20247 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
20248 (turn_on_face, init_tty): Likewise.
20249 * termchar.h (struct tty_display_info): Likewise.
20250
20251 * term.c (term_mouse_position): Rename local to avoid shadowing.
20252
20253 * alloc.c (mark_ttys): Move decl from here ...
20254 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
20255
20256 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
20257
20258 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
20259
20260 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
20261
20262 * search.c (compile_pattern_1): Remove argument regp, unused since
20263 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
20264 (compile_pattern): Don't pass it.
20265
20266 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
20267
20268 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
20269 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
20270 for ! HAVE_GTK3.
20271 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
20272
20273 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
20274
20275 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
20276 gdk_window_get_screen, gdk_window_get_geometry,
20277 gdk_x11_window_lookup_for_display and GDK_KEY_g.
20278 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
20279 (xg_get_pixbuf_from_pixmap): New function.
20280 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
20281 to Pixmap, take frame as parameter, remove GdkColormap parameter.
20282 Call xg_get_pixbuf_from_pixmap instead of
20283 gdk_pixbuf_get_from_drawable.
20284 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
20285 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
20286 (xg_check_special_colors): Use GtkStyleContext and its functions
20287 for HAVE_GTK3.
20288 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
20289 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
20290 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
20291 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
20292 Call gtk_widget_get_preferred_size.
20293 (xg_frame_resized): gdk_window_get_geometry only takes 5
20294 parameters.
20295 (xg_win_to_widget, xg_event_is_for_menubar):
20296 Call gdk_x11_window_lookup_for_display.
20297 (xg_set_widget_bg): New function.
20298 (delete_cb): New function.
20299 (xg_create_frame_widgets): Connect delete-event to delete_cb.
20300 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
20301 (xg_set_background_color): Call xg_set_widget_bg.
20302 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
20303 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
20304 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
20305 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
20306 if ! HAVE_GTK3.
20307 (update_frame_tool_bar): Call gtk_widget_hide.
20308 (xg_initialize): Use GDK_KEY_g.
20309
20310 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
20311 if ! HAVE_GTK3
20312 (x_session_initialize): Call gdk_x11_set_sm_client_id.
20313
20314 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
20315 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
20316 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
20317
20318 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
20319
20320 * w32xfns.c (select_palette): Check success of RealizePalette against
20321 GDI_ERROR, not zero.
20322
20323 See ChangeLog.11 for earlier changes.
20324
20325 ;; Local Variables:
20326 ;; coding: utf-8
20327 ;; End:
20328
20329 Copyright (C) 2011-2012 Free Software Foundation, Inc.
20330
20331 This file is part of GNU Emacs.
20332
20333 GNU Emacs is free software: you can redistribute it and/or modify
20334 it under the terms of the GNU General Public License as published by
20335 the Free Software Foundation, either version 3 of the License, or
20336 (at your option) any later version.
20337
20338 GNU Emacs is distributed in the hope that it will be useful,
20339 but WITHOUT ANY WARRANTY; without even the implied warranty of
20340 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20341 GNU General Public License for more details.
20342
20343 You should have received a copy of the GNU General Public License
20344 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.