1 2012-12-15 Paul Eggert <eggert@cs.ucla.edu>
3 * fileio.c (internal_delete_file): Use bool for boolean.
5 2012-12-15 Eli Zaretskii <eliz@gnu.org>
7 Fix bug #13079 on MS-Windows with temp files not being deleted.
8 * w32.h (_child_process): New members input_file and
10 (register_child): First argument is now pid_t.
11 (record_infile, record_pending_deletion): New prototypes.
13 * w32proc.c (new_child): Initialize input_file and
14 pending_deletion members of the child.
15 (delete_child): Delete the child's temporary input file, if any,
16 that is pending deletion.
17 (register_child): First argument is now pid_t.
18 (record_infile, record_pending_deletion): New functions.
19 (reap_subprocess): Fix a typo in DebPrint string.
20 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
22 * fileio.c (internal_delete_file): Return an int again: non-zero
23 if delete-file succeeds, zero otherwise.
25 * lisp.h (internal_delete_file): Adjust prototype.
27 * callproc.c (Fcall_process): Don't overwrite infile with result
29 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
30 asynchronous subprocess, record the name of the input file name,
32 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
33 delete the file, record it as pending deletion when the subprocess
36 2012-12-14 Eli Zaretskii <eliz@gnu.org>
38 * editfns.c [HAVE_PWD_H]: Include grp.h.
40 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
42 2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
44 Fix permissions bugs with setgid directories etc. (Bug#13125)
45 * dired.c (Ffile_attributes): Return t as the 9th attribute,
46 to mark it as a placeholder. The old value was often wrong.
47 The only user of this attribute has been changed to use
48 file-ownership-preserved-p instead, with its new group arg.
49 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
51 2012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
53 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
54 Keep selected_window and selected_frame in sync.
56 2012-12-14 Eli Zaretskii <eliz@gnu.org>
58 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
59 try to get accurate owner and group information from NT file
60 security APIs. This is to make most callers of 'stat' and
61 'lstat', which don't need that information, much faster.
63 * dired.c (Ffile_attributes) [WINDOWSNT]:
64 Set w32_stat_get_owner_group to a non-zero value, to request accurate
65 owner and group information from 'lstat'.
67 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
69 * fileio.c (Finsert_file_contents): Don't put tail into head area,
70 as that confuses set-auto-coding, so insist on the head-read
71 returning the full 1024 bytes. Let lseek compute the tail offset;
72 less work for us. Do not ignore I/O errors when reading the tail.
74 * xdisp.c: Minor style fixes.
75 (init_iterator): Hoist assignment out of if-expression.
76 (markpos_of_region): Callers now test for sign, not for -1.
78 2012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
80 Minor redisplay optimization when the region length is zero.
81 * xdisp.c (markpos_of_region): New function.
82 (init_iterator): Do not highlight the region of zero length.
83 (redisplay_window): Check whether the region is of non-zero length.
84 (try_cursor_movement): Allow if the region length is zero.
85 (try_window_reusing_current_matrix, try_window_id): Likewise.
87 2012-12-13 Eli Zaretskii <eliz@gnu.org>
89 * search.c (search_buffer): Check the inverse translations of each
90 character in pattern when the buffer being searched is unibyte.
93 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
95 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
96 files, fixing a regression from 24.2.
97 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
99 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
101 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
102 fstat shouldn't fail, and if it does fail copy-file should not proceed.
103 Remove unnecessary S_ISLNK test, as (contra the comments) this
104 function can't copy symlinks. Improve quality of error message
105 when attempting to copy files that are neither regular files nor
108 2012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
110 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
111 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
112 * window.c (Frecenter):
113 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
114 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
116 2012-12-12 Daniel Colascione <dancol@dancol.org>
118 * unexcw.c (fixup_executable): use posix_fallocate to ensure that
119 the dumped Emacs is not a sparse file, greatly improving Cygwin
120 "make bootstrap" performance.
122 2012-12-11 Michael Albinus <michael.albinus@gmx.de>
124 * inotify.c (inotify_callback): Generate an Emacs event for every
125 incoming inotify event.
127 2012-12-11 Eli Zaretskii <eliz@gnu.org>
129 * xdisp.c (handle_face_prop): Fix logic of computing
130 it->start_of_box_run_p.
131 (append_space_for_newline): If the glyph row is R2L, reset the
132 iterator's end_of_box_run_p flag before prepending the space glyph.
133 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
134 iterator's start_of_box_run_p flag before prepending the stretch.
135 (append_glyph, produce_image_glyph, append_composite_glyph)
136 (append_stretch_glyph, append_glyphless_glyph): Reverse the
137 left_box_line_p and right_box_line_p flags of the glyph for R2L
138 glyph rows. (Bug#13011)
140 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
142 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
143 if changed buffer is not shown in a window.
144 * insdel.c (prepare_to_modify_buffer): Likewise.
145 * window.c (replace_buffer_in_windows_safely): Do nothing
146 if buffer is not shown in a window.
147 (Fforce_window_update): Likewise if string or buffer argument
150 2012-12-11 Eli Zaretskii <eliz@gnu.org>
152 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
153 encoded_file_name, which is what it is.
155 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
157 Consistently use marker_position and marker_byte_position.
158 * fringe.c (Ffringe_bitmaps_at_pos):
159 * indent.c (Fvertical_motion):
160 * insdel.c (prepare_to_modify_buffer):
161 * keyboard.c (make_lispy_position):
162 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
163 (window_scroll_pixel_based, displayed_window_lines)
164 (Fset_window_configuration):
165 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
166 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
167 Replace direct access to marker fields with calls
168 to marker_position and/or marker_byte_position.
170 2012-12-11 Juanma Barranquero <lekktu@gmail.com>
172 * makefile.w32-in (SIG2STR_H): New macro.
173 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
174 ($(BLD)/w32notify.$(O)): Update dependencies.
176 2012-12-10 Daniel Colascione <dancol@dancol.org>
178 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
179 Windows file notification functionality unless WINDOWSNT.
181 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
184 * w32fns.c (cache_system_info): Initialize the global hinst
185 variable here so various initialization calls DTRT.
187 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused
189 (hinst): Remove unneeded extern declaration.
190 (_start): Remove initialization of above variables; remove
191 initialization of hinst, as cache_system_info now does that.
193 * emacs.c (main): Call cache_system_info early in startup; we
194 previously weren't calling it in Cygwin builds.
196 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
197 Teach the autoconf build system how to compile a Windows resource file
198 and link it to Emacs.
200 2012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
202 Per-buffer window counters.
203 * buffer.h (struct buffer): New member window_count.
204 (buffer_window_count): New function.
205 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
206 Initialize window_count.
207 (Fkill_buffer): Verify window_count for the buffer being killed.
208 (modify_overlay): Do not force redisplay if buffer is not shown
210 (init_buffer_once): Initialize window_count for buffer_defaults
211 and buffer_local_symbols.
212 * window.h (buffer_shared): Remove declaration.
213 (wset_buffer): Convert from inline ...
214 * window.c (wset_buffer): ... to an ordinary function.
215 (adjust_window_count): New function.
216 (make_parent_window): Use it.
217 * xdisp.c (buffer_shared): Remove.
218 (redisplay_internal, redisplay_window): Adjust users.
219 (buffer_shared_and_changed): Use per-buffer window counter.
221 2012-12-10 Eli Zaretskii <eliz@gnu.org>
223 Support for filesystem notifications on MS-Windows.
224 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
225 and this is a TTY frame, signal the caller that keyboard input is
228 * w32xfns.c (drain_message_queue): Now returns an int: an
229 indication whether any WM_EMACS_FILENOTIFY messages were found in
232 * w32inevt.c (handle_file_notifications): New function.
233 (w32_console_read_socket): Call it to process file notifications.
235 * w32console.c (initialize_w32_display): Record the main thread ID
238 * deps.mk (inotify.o): New dependency list.
240 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
242 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
243 (WM_EMACS_END): Bump value by 1.
244 (notification_buffer_in_use, file_notifications)
245 (notifications_size, notifications_desc): Declare.
246 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
249 * w32term.c (lispy_file_action, queue_notifications): New functions.
250 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
251 <Qrenamed_to>: New symbols.
252 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
254 * w32notify.c: New file, implements file event notifications for
257 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
258 by posting it to the w32_read_socket queue.
260 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support
263 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
264 (GLOBAL_SOURCES): Add w32notify.c
265 ($(BLD)/w32notify.$(O)): New set of dependencies.
267 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
269 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]: Handle
271 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
272 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
273 w32notify-handle-event by default.
275 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
278 2012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
280 Support for filesystem notifications on GNU/Linux via inotify.
281 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add
284 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
286 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
287 (syms_of_keyboard): DEFSYM it.
288 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
289 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
290 Qfile_inotify events.
291 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
292 special-event-map to inotify-handle-event.
294 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
296 * Makefile.in (base_obj): Add inotify.o.
298 * inotify.c: New file.
300 2012-12-10 Jan Djärv <jan.h.d@swipnet.se>
302 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
304 2012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
306 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
307 DWORD_PTR, for compatibility with 64-bit builds.
309 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
310 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
311 (system_process_attributes): Use SIZE_T rather than DWORD, for
312 compatibility with 64-bit builds.
314 2012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
316 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
318 2012-12-10 Eli Zaretskii <eliz@gnu.org>
320 * indent.c (Fvertical_motion): If a display string will be
321 displayed on the left or the right margin, don't consider it as a
322 factor in cursor positioning. (Bug#13108)
324 2012-12-10 Martin Rudalics <rudalics@gmx.at>
326 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
328 2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
330 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
333 2012-12-08 Eli Zaretskii <eliz@gnu.org>
335 * w32.c (unsetenv): Return 0 if the input string is too long.
337 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
339 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
340 * alloc.c (xputenv): New function.
341 * dbusbind.c (Fdbus_init_bus):
343 * xterm.c (x_term_init):
344 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
345 * editfns.c (initial_tz): Move static var decl up.
346 (tzvalbuf_in_environ): New static var.
347 (init_editfns): Initialize these two static vars.
348 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
349 Save old TZ value on stack, if it's small.
350 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
351 instead, use xputenv+unsetenv to set and restore TZ.
352 (environbuf): Remove static var. All uses removed.
353 (Fset_time_zone_rule): Do not save TZ and environ;
354 no longer needed here.
355 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
356 Move to inside set_time_zone_rule; they don't need file scope any more.
357 (set_time_zone_rule): Maintain the TZ=value string separately.
358 (syms_of_editfns): Don't initialize initial_tz;
359 init_editfns now does it.
360 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
361 * lisp.h (xputenv): New decl.
363 2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
365 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
367 2012-12-08 Eli Zaretskii <eliz@gnu.org>
369 * w32.c (unsetenv, sys_putenv): New functions.
371 2012-12-08 Chong Yidong <cyd@gnu.org>
373 * editfns.c (Finsert_char): Make the error message more
374 informative (Bug#12992).
376 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
378 Simplify get_lim_data.
379 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
380 Remove USG and vlimit methods; no longer used these days.
381 Add #error catchall just in case.
383 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
384 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
385 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
386 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
387 (deleted_pid_list, Fdelete_process, create_process)
388 (record_child_status_change, handle_child_signal, deliver_child_signal)
389 (init_process_emacs, syms_of_process):
390 Assume SIGCHLD is defined.
391 (parse_signal): Remove. All uses removed.
392 (abbr_to_signal): New static function.
393 (Fsignal_process): Use it to convert signal names to ints.
394 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
395 kill (getpgrp (), ...).
396 (emacs_sigaction_init): Assume SIGCHLD is defined.
397 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
398 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
399 * syssignal.h (EMACS_KILLPG): Remove.
400 All uses replaced by 'kill' with a negative pid.
401 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
402 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
404 2012-12-07 Paul Eggert <eggert@cs.ucla.edu>
406 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
407 This will cause a production Emacs to dump core instead of
410 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
412 * frame.c (make_frame): Do not set window's buffer to t.
413 * window.c (Fsplit_window_internal): Likewise. Previously it was
414 used to indicate that the window is being set up. Now we use
415 set_window_buffer for all new windows, so the condition in ...
416 (Fset_window_buffer): ... is always true and can be removed.
418 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
420 Convenient macro to check whether the buffer is hidden.
421 * buffer.h (BUFFER_HIDDEN_P): New macro.
422 * frame.c (make_frame): Use it. Adjust comment.
423 * buffer.c (candidate_buffer): New function.
424 (Fother_buffer, other_buffer_safely): Use it.
426 2012-12-06 Eli Zaretskii <eliz@gnu.org>
428 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
429 if the child process is still running. Instead, exit the wait
430 loop and return zero. (Bug#13086)
432 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
434 * frame.h (x_char_width, x_char_height): Remove prototypes.
435 * w32term.h (x_char_width, x_char_height): Likewise.
436 * xfns.c (x_char_width, x_char_height): Remove.
437 * w32fns.c (x_char_width, x_char_height): Likewise.
438 * nsfns.c (x_char_width, x_char_height): Likewise.
439 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
441 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
442 * keyboard.c (command_loop_1): Remove prototype.
443 (command_loop_2, top_level_1): Add static to match prototype.
445 2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
447 Fix a recently-introduced delete-process race condition.
448 * callproc.c, process.h (record_kill_process):
449 New function, containing part of the old call_process_kill.
450 (call_process_kill): Use it.
451 This does not change call_process_kill's behavior.
452 * process.c (Fdelete_process): Use record_kill_process to fix a
453 race condition that could cause Emacs to lose track of a child.
455 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
457 Avoid code duplication between prev_frame and next_frame.
458 * frame.c (candidate_frame): New function. Add comment.
459 (prev_frame, next_frame): Use it. Adjust comment.
461 2012-12-06 Eli Zaretskii <eliz@gnu.org>
463 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
464 fails, signal an error instead of continuing with an empty
466 Encode expanded temp file pattern before passing it to mkstemp or
469 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
470 Encode the file name before passing it to dostounix_filename, in
471 case it will downcase it (under w32-downcase-file-names).
474 2012-12-05 Paul Eggert <eggert@cs.ucla.edu>
476 Minor call-process cleanups.
477 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
478 at the same time as other platforms, to simplify analysis.
479 No need for fd0_volatile since we have synch_process_fd.
480 Avoid needless emacs_close; arg is always negative.
482 2012-12-04 Andreas Schwab <schwab@linux-m68k.org>
484 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
487 2012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
489 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
490 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
491 and mouse_face_hidden members to a bitfields.
492 * frame.h (struct frame): Remove set-but-not-used space_width member.
493 (FRAME_SPACE_WIDTH): Remove.
494 * nsterm.m, w32term.c, xterm.c: Adjust users.
495 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
496 member. Adjust users. Convert term_initted, delete_in_insert_mode,
497 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
498 members to a bitfields.
500 2012-12-03 Paul Eggert <eggert@cs.ucla.edu>
502 Don't let call-process be a zombie factory (Bug#12980).
503 Fixing this bug required some cleanup of the signal-handling code.
504 As a side effect, this change also fixes a longstanding rare race
505 condition whereby Emacs could mistakenly kill unrelated processes,
506 and it fixes a bug where a second C-g does not kill a recalcitrant
507 synchronous process in GNU/Linux and similar platforms.
508 The patch should also fix the last vestiges of Bug#9488,
509 a bug which has mostly been fixed on the trunk by other changes.
510 * callproc.c, process.h (synch_process_alive, synch_process_death)
511 (synch_process_termsig, sync_process_retcode):
512 Remove. All uses removed, to simplify analysis and so that
513 less consing is done inside critical sections.
514 * callproc.c (call_process_exited): Remove. All uses replaced
515 with !synch_process_pid.
516 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
517 These take the role of what used to be in unwind-protect arg.
519 (block_child_signal, unblock_child_signal):
520 New functions, to avoid races that could kill innocent-victim processes.
521 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
522 (call_process_kill): Record killed processes as deleted, so that
523 zombies do not clutter up the system. Do this inside a critical
524 section, to avoid a race that would allow the clutter.
525 (call_process_cleanup): Fix code so that the second C-g works again
526 on common platforms such as GNU/Linux.
527 (Fcall_process): Create the child process in a critical section,
528 to fix a race condition. If creating an asynchronous process,
529 record it as deleted so that zombies do not clutter up the system.
530 Do unwind-protect for WINDOWSNT too, as that's simpler in the
531 light of these changes. Omit unnecessary call to emacs_close
532 before failure, as the unwind-protect code does that.
533 * callproc.c (call_process_cleanup):
534 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
535 * process.c (record_deleted_pid): New function, containing
536 code refactored out of Fdelete_process.
537 (Fdelete_process): Use it.
538 (process_status_retrieved): Remove. All callers changed to use
540 (record_child_status_change): Remove, folding its contents into ...
541 (handle_child_signal): ... this signal handler. Now, this
542 function is purely a handler for SIGCHLD, and is not called after
543 a synchronous waitpid returns; the synchronous code is moved to
544 wait_for_termination. There is no need to worry about reaping
545 more than one child now.
546 * sysdep.c (get_child_status, child_status_changed): New functions.
547 (wait_for_termination): Now takes int * status and bool
548 interruptible arguments, too. Do not record child status change;
549 that's now the caller's responsibility. All callers changed.
550 Reimplement in terms of get_child_status.
551 (wait_for_termination_1, interruptible_wait_for_termination):
552 Remove. All callers changed to use wait_for_termination.
553 * syswait.h: Include <stdbool.h>, for bool.
554 (record_child_status_change, interruptible_wait_for_termination):
556 (record_deleted_pid, child_status_changed): New decls.
557 (wait_for_termination): Adjust to API changes noted above.
559 * bytecode.c, lisp.h (Qbytecode): Remove.
560 No longer needed after 2012-11-20 interactive-p changes.
562 2012-12-03 Eli Zaretskii <eliz@gnu.org>
564 * xdisp.c (redisplay_window): If the cursor is visible, but inside
565 the scroll margin, move point outside the margin. (Bug#13055)
567 2012-12-03 Jan Djärv <jan.h.d@swipnet.se>
569 * gtkutil.c (my_log_handler): New function.
570 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
572 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
574 * lisp.h (modify_region): Rename to...
575 (modify_region_1): ...new prototype.
576 * textprop.c (modify_region): Now static. Adjust users.
577 * insdel.c (modify_region): Rename to...
578 (modify_region_1): ...new function to work with current buffer.
579 Adjust comment and users. Use true and false for booleans.
581 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
583 * alloc.c (free_save_value): New function.
584 (safe_alloca_unwind): Use it.
585 * lisp.h (free_save_value): New prototype.
586 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
588 (save_excursion_restore): Adjust to match saved data structure.
589 Use free_save_value to offload some work from GC. Drop obsolete
592 2012-12-03 Chong Yidong <cyd@gnu.org>
594 * fileio.c (Vauto_save_list_file_name): Doc fix.
596 2012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
598 * w32fns.c: Remove prototype of atof.
599 (syspage_mask): Declared DWORD_PTR, for compatibility with 64-bit
601 (file_dialog_callback): Declared UINT_PTR.
603 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
606 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
607 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
610 2012-12-03 Glenn Morris <rgm@gnu.org>
612 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
614 2012-12-02 Paul Eggert <eggert@cs.ucla.edu>
616 Fix xpalloc confusion after memory is exhausted.
617 * alloc.c (xpalloc): Comment fix.
618 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
619 and signals an error, do not clear charset_table_size, as
620 charset_table is still valid.
621 * doprnt.c (evxprintf): Clear *BUF after freeing it.
623 Use execve to avoid need to munge environ (Bug#13054).
624 * callproc.c (Fcall_process):
625 * process.c (create_process):
626 Don't save and restore environ; no longer needed.
627 * callproc.c (child_setup):
628 Use execve, not execvp, to preserve environ.
630 2012-12-01 Paul Eggert <eggert@cs.ucla.edu>
632 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
634 2012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
636 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
637 display for sliced images (Bug#10500).
639 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
641 2012-11-30 Juanma Barranquero <lekktu@gmail.com>
643 * doc.c (Fdocumentation): Re-add handling of function-documentation,
644 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
646 2012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
648 * xdisp.c (window_outdated): Remove eassert since it hits
649 some suspicious corner cases (see Bug#13007 and Bug#13012).
650 (mode_line_update_needed): New function.
651 (redisplay_internal, redisplay_window): Use it.
652 (ensure_selected_frame): New function.
653 (redisplay_internal, unwind_redisplay): Use it.
654 (redisplay_internal): Move comment about buffer_shared...
655 (buffer_shared_and_changed): ...near to its real use.
657 2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
659 * callproc.c (Fcall_process): Don't misreport vfork failure.
661 2012-11-28 Paul Eggert <eggert@cs.ucla.edu>
663 * callproc.c (Fcall_process): Fix vfork portability problems.
664 Do not assume that fd[0], count, filefd, and save_environ survive
665 vfork. Fix bug whereby wrong errno value could be reported for
666 pipe failure. Some minor cleanups, too, as follows. Move buf and
667 bufsize to the context where they're needed. Change new_argv to
668 be of type char **, as this is more convenient and avoids casts.
669 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
670 Now local constants, not macros.
672 2012-11-18 Kenichi Handa <handa@gnu.org>
674 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
675 for the variable "f".
677 2012-11-13 Kenichi Handa <handa@gnu.org>
679 * font.c (font_unparse_xlfd): Exclude special characters from the
680 generating XLFD name.
682 2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
684 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
685 * dired.c (stat_uname, stat_gname):
686 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
688 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
689 * dired.c (directory_files_internal, file_name_completion):
690 Assume EAGAIN and EINTR are defined.
692 * fileio.c (Fcopy_file): Assume EISDIR is defined.
693 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
694 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
695 * lread.c (readbyte_from_file): Assume EINTR is defined.
696 * process.c (wait_reading_process_output, send_process) [subprocesses]:
697 Assume EIO and EAGAIN are defined.
698 * unexcoff.c (write_segment): Assume EFAULT is defined.
700 2012-11-27 Eli Zaretskii <eliz@gnu.org>
702 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
705 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
706 highlighting on the frame was cleared. Prevents assertion
707 violations when repeatedly clicking on the "Top" link of the
708 "bread-crumbs" in Info buffers.
710 2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
712 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
714 2012-11-24 Ken Brown <kbrown@cornell.edu>
716 * keyboard.c (HAVE_MOUSE):
717 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
720 2012-11-24 Eli Zaretskii <eliz@gnu.org>
722 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
723 between bpos_covered and bpos_max. This fixes cursor display when
724 several display strings follow each other.
726 * .gdbinit (pgx): If the glyph's object is a string, display the
727 pointer to string data, rather than the value of the string object
728 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
730 * indent.c (Fvertical_motion): If the starting position is covered
731 by a display string, return to one position before that, to avoid
732 overshooting it inside move_it_to. (Bug#12930)
734 2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
736 * frame.h (struct frame): Remove display_preempted member
737 since all users are dead long ago.
738 * nsterm.h (struct x_output): Use the only dummy member.
739 * w32menu.c (pending_menu_activation): Remove since not
741 (set_frame_menubar): Adjust user.
742 * w32term.h (struct x_output): Drop outdated #if 0 code.
743 (struct w32_output): Use bitfields for explicit_parent,
744 asked_for_visible and menubar_active members.
745 Drop unused pending_menu_activation member.
746 * xterm.h (struct x_output): Drop outdated #if 0 code.
747 Use bitfields for explicit_parent, asked_for_visible,
748 has_been_visible and net_wm_state_hidden_seen members.
750 2012-11-23 Eli Zaretskii <eliz@gnu.org>
752 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
753 of a literal "/". (Bug#12955)
754 (gl-stamp): Invoke fc.exe directly, not through cmd.
756 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
758 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
759 * dired.c: Assume HAVE_DIRENT_H.
760 (NAMLEN): Remove, replacing with ...
761 (dirent_namelen): New function. All uses changed. Use the GNU macro
762 _D_EXACT_NAMELEN if available, as it's faster than strlen.
763 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
764 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
765 * makefile.w32-in (DIR_H): Remove. All uses replaced with
767 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
768 * ndir.h: Rename to ../nt/inc/dirent.h.
769 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
770 Do not include <dirent.h>; no longer needed.
771 * w32.c: Include <dirent.h> rather than "ndir.h".
773 2012-11-23 Chong Yidong <cyd@gnu.org>
775 * xftfont.c (xftfont_open): Remove duplicate assignment.
777 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
779 * alloc.c (Fgarbage_collect): Unblock input after clearing
780 gc_in_progress to avoid note_mouse_highlight glitch with GC.
781 * frame.h (FRAME_MOUSE_UPDATE): New macro.
782 * msdos.c (IT_frame_up_to_date): Use it here...
783 * w32term.c (w32_frame_up_to_date): ...here...
784 * xterm.c (XTframe_up_to_date): ...and here...
785 * nsterm.m (ns_frame_up_to_date): ...but not here.
786 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
788 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
789 Do not check whether GC is in progress.
791 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
793 * xdisp.c (window_buffer_changed): New function.
794 (update_menu_bar, update_tool_bar): Use it to
795 simplify large 'if' statements.
796 (redisplay_internal): Generalize commonly used
797 'tail' and 'frame' local variables.
799 2012-11-22 Eli Zaretskii <eliz@gnu.org>
801 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
802 with Windows system header.
804 2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
806 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
807 * alloc.c: Assume unistd.h exists.
808 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
809 * sysdep.c (get_current_dir_name): Assume getcwd exists.
810 (getwd) [USG]: Remove; no longer needed.
811 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
812 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
813 * w32.h (getcwd): Remove decl.
815 2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
817 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
818 Make it set selected_window as well.
819 (update_tool_bar): Use it.
821 2012-11-21 Ken Brown <kbrown@cornell.edu>
823 * emacs.c (main): Set the G_SLICE environment variable for all
824 Cygwin builds, not just GTK builds. See
825 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
827 2012-11-21 Eli Zaretskii <eliz@gnu.org>
829 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
830 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
831 Define for the MSVC compiler.
833 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
835 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
836 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
837 dostounix_filename. Prevents crashes down the road, because
838 dostounix_filename assumes it gets a unibyte string.
839 Reported by Michel de Ruiter <michel@sentient.nl>, see
840 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
842 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
844 Conflate Qnil and Qunbound for `symbol-function'.
845 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
846 * lread.c (init_obarray): Set `function' fields to Qnil.
847 * eval.c (Fcommandp): Ignore Qunbound.
848 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
849 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
850 Test NILP rather than Qunbound.
851 (Ffmakunbound): Set to Qnil.
852 (Fsymbol_function): Never signal an error.
853 (Finteractive_form): Ignore Qunbound.
855 2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
857 * eval.c (interactive_p): Remove no-longer-used decl.
859 2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
861 * xdisp.c (buffer_shared): Adjust comment.
862 (buffer_shared_and_changed): New function.
863 (prepare_menu_bars, redisplay_internal): Use it to
864 decide whether all windows or frames should be updated.
865 (window_outdated): New function.
866 (text_outside_line_unchanged_p, redisplay_window): Use it.
867 (redisplay_internal): Likewise. Fix indentation.
869 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
871 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
872 (syms_of_eval): Remove corresponding defsubr.
873 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
875 2012-11-19 Daniel Colascione <dancol@dancol.org>
877 * w32fns.c (Fx_file_dialog):
878 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
879 cygwin_convert_file_name*.
881 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
882 Rename cygwin_convert_path* to cygwin_convert_file_name*.
884 2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
886 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
888 2012-11-18 Eli Zaretskii <eliz@gnu.org>
890 * w32select.c: Include w32common.h before w32term.h, so that
891 windows.h gets included before w32term.h uses some of its
894 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
896 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
898 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
900 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
902 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
903 (ns_select): Return at once if events are held (Bug#12834).
905 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
907 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
908 Needed following 2012-10-20 change. (Bug#12902)
910 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
912 * w32proc.c (waitpid): Remove unused label get_result.
914 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
916 * makefile.w32-in (SYSWAIT_H): New macro.
917 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
918 ($(BLD)/sysdep.$(O)): Update dependencies.
920 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
922 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
923 * callproc.c (relocate_fd): Assume F_DUPFD.
924 * emacs.c, term.c (O_RDWR): Remove.
925 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
926 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
927 * nsterm.m: Assume <fcntl.h> exists.
928 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
929 (create_pty, Fmake_network_process, server_accept_connection)
930 (wait_reading_process_output, init_process_emacs):
932 (wait_reading_process_output): Put in a special case for WINDOWSNT
933 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
934 It's not clear this is needed, but it's a more-conservative change.
935 (create_process): Assume FD_CLOEXEC.
936 (create_process, create_pty): Assume O_NOCTTY.
937 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
938 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
939 Omit if not DOS_NT, since F_GETFL is not defined there.
940 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
941 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
943 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
944 lack it, since gnulib guarantees this.
945 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
947 2012-11-17 Eli Zaretskii <eliz@gnu.org>
949 * w32.c (faccessat): Pretend that directories have the execute bit
950 set. Emacs expects that, e.g., in files.el:cd-absolute.
952 * w32proc.c (create_child): Don't clip the PID of the child
953 process to fit into an Emacs integer, as this is no longer a
955 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
956 reaping only the process specified by PID argument, if that is
957 positive. Use PID instead of dead_child to know which process to
958 reap. Wait for the child to die only if WNOHANG is not in
960 (sys_select): Don't set dead_child.
962 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
963 as it is no longer needed.
965 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
967 (record_child_status_change): Remove the setting of
968 record_at_most_one_child for the !WNOHANG case.
970 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
972 Fix problems in ns port found by static checking.
973 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
974 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
975 not to process group.
976 (ns_select): Use emacs_write, not write, as that's more robust
977 in the presence of signals.
978 (fd_handler:): Check for read errors.
980 2012-11-16 Glenn Morris <rgm@gnu.org>
982 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
984 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
986 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
988 2012-11-16 Eli Zaretskii <eliz@gnu.org>
990 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
991 use the same value of thread handle.
992 (start_timer_thread): If the timer thread exited (due to error),
993 clean up by closing the two handles it used. Duplicate the caller
994 thread's handle here, so it gets duplicated only once, when
995 launching the timer thread. Set priority of the timer thread, not
997 (getitimer): Don't duplicate the caller thread's handle here.
1000 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
1002 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
1005 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
1007 Remove no-longer-used pty_max_bytes variable.
1008 * process.c (pty_max_bytes): Remove; unused.
1009 (send_process): Do not set it.
1011 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
1013 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
1014 Update dependencies.
1016 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
1018 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
1019 This follows up on the 2012-09-29 patch that removed indirection
1020 for the 'function' field. Reported by Sergey Vinokurov in
1021 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
1023 2012-11-14 Eli Zaretskii <eliz@gnu.org>
1025 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
1026 different name, as the MS runtime does not have such a function,
1027 and probably never will.) All callers changed. Ignore DIRFD
1028 value if PATH is an absolute file name, to match Posix spec
1029 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
1032 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
1034 * xdisp.c (echo_area_display, redisplay_internal):
1035 Omit redundant check whether frame_garbaged is set.
1037 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
1039 Use faccessat, not access, when checking file permissions (Bug#12632).
1040 This fixes a bug that has been present in Emacs since its creation.
1041 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
1042 which must set some sort of record. (Torek's bug report was against
1043 a predecessor of GNU Emacs, but GNU Emacs happened to have the
1044 same common flaw.) See Torek's Usenet posting
1045 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
1046 Posted: Fri Apr 8 14:18:56 1983.
1047 * Makefile.in (LIB_EACCESS): New macro.
1049 * callproc.c (init_callproc):
1050 * charset.c (init_charset):
1051 * fileio.c (check_existing, check_executable, check_writable)
1053 * lread.c (openp, load_path_check):
1054 * process.c (allocate_pty):
1056 Use effective UID when checking permissions, not real UID.
1057 * callproc.c (init_callproc):
1058 * charset.c (init_charset):
1059 * lread.c (load_path_check, init_lread):
1060 Test whether directories are accessible, not merely whether they exist.
1061 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
1062 * fileio.c (check_existing, check_executable, check_writable)
1064 Use symbolic names instead of integers for the flags, as they're
1066 (check_writable): New arg AMODE. All uses changed.
1067 Set errno on failure.
1068 (Ffile_readable_p): Use faccessat, not stat + open + close.
1069 (Ffile_writable_p): No need to call check_existing + check_writable.
1070 Just call check_writable and then look at errno. This saves a syscall.
1071 dir should never be nil; replace an unnecessary runtime check
1072 with an eassert. When checking the parent directory of a nonexistent
1073 file, check that the directory is searchable as well as writable, as
1074 we can't create files in unsearchable directories.
1075 (file_directory_p): New function, which uses 'stat' on most platforms
1076 but faccessat with D_OK (for efficiency) if WINDOWSNT.
1077 (Ffile_directory_p, Fset_file_times): Use it.
1078 (file_accessible_directory_p): New function, which uses a single
1079 syscall for efficiency.
1080 (Ffile_accessible_directory_p): Use it.
1081 * xrdb.c (file_p): Use file_directory_p.
1082 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
1083 * lread.c (openp): When opening a file, use fstat rather than
1084 stat, as that avoids a permissions race. When not opening a file,
1085 use file_directory_p rather than stat.
1086 (dir_warning): First arg is now a usage string, not a format.
1087 Use errno. All uses changed.
1088 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
1089 that merely introduced a race.
1090 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
1091 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
1092 and similarly for the other O_* flags.
1093 * w32.c (sys_faccessat): Rename from sys_access and switch to
1094 faccessat's API. All uses changed.
1095 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
1096 (magic_db): Rename from magic_file_p.
1097 (magic_db, search_magic_path): Return an XrmDatabase rather than a
1098 char *, so that we don't have to test for file existence
1099 separately from opening the file for reading. This removes a race
1100 fixes a permission-checking problem, and simplifies the code.
1102 (file_p): Remove; no longer needed.
1104 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
1106 Omit glyphs initialization at startup.
1107 * dispnew.c (glyphs_initialized_initially_p): Remove.
1108 (adjust_frame_glyphs_initially): Likewise. Adjust users.
1109 (Fredraw_frame): Move actual code from here...
1110 (redraw_frame): ...to here. Add eassert. Adjust comment.
1111 (Fredraw_display): Use redraw_frame.
1112 * xdisp.c (clear_garbaged_frames): Likewise.
1114 2012-11-13 Eli Zaretskii <eliz@gnu.org>
1116 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
1117 passed to pint2str and pint2hrstr to be at most the size of the
1118 frame's decode_mode_spec_buffer. This avoids crashes with very
1119 large values of FIELD_WIDTH argument to decode_mode_spec.
1122 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
1124 Fix a race with verify-visited-file-modtime (Bug#12863).
1125 Since at least 1991 Emacs has ignored an mtime difference of no
1126 more than one second, but my guess is that this was to work around
1127 file system bugs that were fixed long ago. Since the race is
1128 causing problems now, let's remove that code.
1129 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
1130 whose time stamp is off by no more than a second. Insist that the
1131 file time stamps match exactly.
1133 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
1135 * frame.h (struct frame): Convert external_tool_bar member to
1136 1-bit unsigned bitfield.
1137 * termhooks.h (struct terminal): Remove mouse_moved member since
1138 all users are long dead. Adjust comment on mouse_position_hook.
1140 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
1142 Simplify by using FOR_EACH_FRAME here and there.
1143 * frame.c (next_frame, prev_frame, other_visible_frames)
1144 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
1145 * w32term.c (x_window_to_scroll_bar): Likewise.
1146 * window.c (window_list): Likewise.
1147 * xdisp.c (x_consider_frame_title): Likewise.
1148 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
1149 * xfns.c (x_window_to_frame, x_any_window_to_frame)
1150 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
1151 * xmenu.c (menubar_id_to_frame): Likewise.
1152 * xselect.c (frame_for_x_selection): Likewise.
1153 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
1154 (x_window_to_menu_bar): Likewise.
1155 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
1157 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
1159 * data.c (Qdefalias_fset_function): Now static.
1161 Another tweak to vectorlike_header change.
1162 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
1163 Remove, and replace all uses with ...
1164 (next_in_free_list, set_next_in_free_list):
1165 New functions, which respect C's aliasing rules better.
1167 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
1169 * window.c (list4i): Rename from 'quad'. All uses changed.
1170 Needed because <sys/types.h> defines 'quad' on Solaris 10.
1172 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
1174 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
1175 warning about mixing declarations and code in ISO C90.
1177 2012-11-10 Martin Rudalics <rudalics@gmx.at>
1179 * window.c (Fsplit_window_internal): Set combination limit of
1180 new parent window to t iff Vwindow_combination_limit is t;
1181 fixing a regression introduced with the change from 2012-09-22.
1182 (Fset_window_combination_limit): Fix doc-string.
1184 2012-11-10 Eli Zaretskii <eliz@gnu.org>
1186 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
1187 amount when the scroll margins are too large. When scrolling
1188 backwards in the buffer, give up if cannot reach point or the
1189 scroll margin within a reasonable number of screen lines.
1190 Fixes point position in window under scroll-up/down-aggressively when
1191 point is positioned many lines beyond the window top/bottom.
1194 * ralloc.c (relinquish): If real_morecore fails to return memory
1195 to the system, don't crash; instead, leave the last heap
1196 unchanged and return. (Bug#12774)
1198 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
1200 * lisp.h (AUTOLOADP): New macro.
1201 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
1202 * data.c (Ffset): Remove special ad-advice-info handling.
1203 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
1205 (Finteractive_form): Simplify.
1206 (Fquo): Don't insist on having at least 2 arguments.
1207 (Qdefalias_fset_function): New var.
1209 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
1211 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
1213 * nsfont.m (Qcondensed, Qexpanded): New variables.
1214 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
1215 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
1217 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
1219 Fix recently introduced crash on MS-Windows (Bug#12839).
1220 * w32term.h (struct scroll_bar): Use convenient header.
1221 (SCROLL_BAR_VEC_SIZE): Remove.
1222 * w32term.c (x_scroll_bar_create): Use VECSIZE.
1224 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
1226 Tweak last vectorlike_header change.
1227 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
1228 vectorlike object on the free list. This is introduced to avoid
1229 some (but not all) pointer casting and aliasing problems, see
1230 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
1231 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
1233 (xvectype, xvecsize): Use them to examine Lisp_Object values.
1235 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
1237 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
1238 been removed, so remove them here also.
1240 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
1242 * doc.c (Fdocumentation): Handle new property
1243 dynamic-docstring-function to replace the old ad-advice-info.
1245 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
1247 * fns.c (Qeql, hashtest_eq): Now static.
1249 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
1251 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
1252 * fns.c (hashfn_eq, hashfn_eql, sxhash):
1253 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
1254 * buffer.c (compare_overlays): Use XLI rather than XHASH.
1256 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
1258 Use same hash function for hashfn_profiler as for hash_string etc.
1259 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
1260 * lisp.h (sxhash_combine): New inline function, with the contents
1261 of the old SXHASH_COMBINE.
1262 * profiler.c (hashfn_profiler): Use it, instead of having a
1263 special hash function containing a comparison that always yields 1.
1265 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
1267 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
1268 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
1269 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
1272 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
1274 * image.c (xpm_make_color_table_h): Fix compiler error because
1275 make_hash_table changed.
1277 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
1279 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
1281 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
1283 Use ad-hoc comparison function for the profiler's hash-tables.
1284 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
1285 (make_log): Use them.
1286 (handle_profiler_signal): Don't inhibit quit any longer since we don't
1287 call Fequal any more.
1288 (Ffunction_equal): New function.
1289 (cmpfn_profiler, hashfn_profiler): New functions.
1290 (syms_of_profiler): Initialize them.
1291 * lisp.h (struct hash_table_test): New struct.
1292 (struct Lisp_Hash_Table): Use it.
1293 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
1294 * fns.c (make_hash_table): Take a struct to describe the test.
1295 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
1296 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
1297 (hash_lookup, hash_remove_from_table): Move assertion checking of
1298 hashfn result here. Check hash-equality before calling cmpfn.
1299 (Fmake_hash_table): Adjust call to make_hash_table.
1300 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
1301 (syms_of_fns): Initialize them.
1302 * emacs.c (main): Move syms_of_fns earlier.
1303 * xterm.c (syms_of_xterm):
1304 * category.c (hash_get_category_set): Adjust call to make_hash_table.
1305 * print.c (print_object): Adjust to new hash-table struct.
1306 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
1308 2012-11-08 Eli Zaretskii <eliz@gnu.org>
1310 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
1311 value of w32-scroll-lock-modifier is neither nil nor one of the
1312 known key modifiers. (Bug#12806)
1314 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
1316 Shrink struct vectorlike_header to the only size field.
1317 * lisp.h (enum pvec_type): Avoid explicit enum member values.
1319 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
1320 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
1321 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
1322 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
1323 information from the vector header. Adjust comment.
1324 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
1325 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
1327 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
1328 (struct vectorlike_header): Remove next member. Adjust comment.
1329 (struct Lisp_Subr): Add convenient header. Adjust comment.
1330 (allocate_pseudovector): Adjust prototype.
1331 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
1332 (sweep_string, lisp_malloc): Remove useless prototypes.
1333 (enum mem_type): Adjust comment.
1334 (NEXT_IN_FREE_LIST): New macro.
1335 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
1336 (Fmake_bool_vector): Likewise.
1337 (struct large_vector): New type to represent allocation unit for
1338 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
1339 (large_vectors): Change type to struct large_vector.
1340 (allocate_vector_from_block): Simplify.
1341 (PSEUDOVECTOR_NBYTES): Replace with...
1342 (vector_nbytes): ...new function. Adjust users.
1343 (sweep_vectors): Adjust processing of large vectors.
1344 (allocate_vectorlike): Likewise.
1345 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
1346 Add easserts. Adjust XSETPVECTYPESIZE usage.
1347 (allocate_buffer): Use BUFFER_PVEC_INIT.
1348 (live_vector_p): Adjust to match large vector.
1349 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
1350 * buffer.h (struct buffer): Add next member.
1351 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
1353 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
1354 * fns.c (internal_equal): Adjust to match enum pvec_type change.
1355 (copy_hash_table): Adjust to match vector header change.
1356 * lread.c (defsubr): Use XSETPVECTYPE.
1357 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
1358 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
1359 (xvecsize): New command.
1361 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
1363 * keyboard.c (event_to_kboard): Do not dereference
1364 frame_or_window field of SELECTION_REQUEST_EVENT
1365 and SELECTION_CLEAR_EVENT events (Bug#12814).
1366 * xterm.h (struct selection_input_event): Adjust comment.
1368 2012-11-07 Eli Zaretskii <eliz@gnu.org>
1370 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
1371 such as Scroll Lock, if the respective keys are treated as
1372 function keys, not as modifiers. This avoids destroying non-ASCII
1373 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
1375 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
1377 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
1379 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
1381 Restore some duplicate definitions (Bug#12814).
1382 This undoes part of the 2012-11-03 changes. Some people build
1383 with plain -g rather than with -g3, and they need the duplicate
1384 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
1385 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
1386 Define as macros, as well as as enums or as constants.
1388 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
1390 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
1391 to keypad keys (Bug#12816).
1393 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
1395 Minor adjustments of recently-changed frame functions.
1396 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
1397 known to be a frame (we're in the FRAMEP branch).
1398 * lisp.h (Qframep): Remove decl. frame.h declares this.
1399 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
1400 since they're meant for Lisp fixnum values.
1402 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
1404 * window.c (Fwindow_combination_limit): Revert to the only
1405 required argument and adjust docstring as suggested in
1406 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
1407 by Martin Rudalics <rudalics@gmx.at>.
1409 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
1411 Widely used frame validity and checking functions.
1412 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
1413 * frame.c (decode_live_frame, decode_any_frame): New functions.
1414 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
1415 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
1416 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
1417 (Fframe_pointer_visible_p): Use decode_any_frame.
1418 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
1419 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
1420 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
1421 (Fframe_focus): Likewise. Allow zero number of arguments.
1423 (frame_buffer_list, frame_buffer_predicate): Remove.
1424 * lisp.h (frame_buffer_predicate): Remove prototype.
1425 * buffer.c (Fother_buffer): Use decode_any_frame.
1426 * xdisp.c (Ftool_bar_lines_needed): Likewise.
1427 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
1428 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
1429 (Fclose_font, Ffont_info): Use decode_live_frame.
1430 * fontset.c (check_fontset_name): Likewise.
1431 * terminal.c (Fframe_terminal): Likewise.
1432 * w32fns.c (check_x_frame): Likewise.
1433 * window.c (Fminibuffer_window, Fwindow_at)
1434 (Fcurrent_window_configuration): Likewise.
1435 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
1436 Likewise. Allow zero number of arguments. Adjust docstring.
1437 * dispnew.c (Fredraw_frame): Likewise.
1438 * xfaces.c (frame_or_selected_frame): Remove.
1439 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
1440 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
1441 (Fframe_face_alist): Use decode_live_frame.
1442 * xfns.c (check_x_frame): Likewise.
1444 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
1446 * window.c (quad): New function.
1447 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
1448 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
1449 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
1450 (Fwindow_line_height): Use it.
1451 (Fwindow_fringes): Use list3.
1452 (Fwindow_scroll_bars): Use list4.
1453 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
1454 (Fwindow_combination_limit): Allow zero number of arguments.
1456 2012-11-05 Eli Zaretskii <eliz@gnu.org>
1458 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
1460 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
1461 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
1462 file descriptor 2 for standard error. (Bug#12805)
1464 2012-11-05 Chong Yidong <cyd@gnu.org>
1466 * process.c (wait_reading_process_output): Revert previous change.
1468 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
1470 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
1471 This removes code that has been obsolete since around 1990.
1472 * callproc.c (Fcall_process):
1474 * process.c (create_process):
1475 * term.c (dissociate_if_controlling_tty):
1476 Assume setsid exists.
1477 * callproc.c (child_setup): Assume setpgid exists and behaves as
1478 per POSIX.1-1988 or later.
1479 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
1480 * emacs.c (shut_down_emacs):
1481 * sysdep.c (sys_suspend, init_foreground_group):
1482 Assume getpgrp behaves as per POSIX.1-1998 or later.
1483 * msdos.c (setpgrp): Remove.
1484 (tcgetpgrp, setpgid, setsid): New functions.
1485 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
1486 * term.c (no_controlling_tty): Remove; unused.
1487 * w32proc.c (setpgrp): Remove.
1488 (setsid, tcgetpgrp): New functions.
1490 Simplify by assuming __fpending.
1491 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
1492 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
1493 Do not assume that __fpending's result fits in int.
1495 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
1497 Remove EMACS_OUTQSIZE+sleep hack.
1498 * dispnew.c (update_frame_1): Remove hack for terminals slower
1499 than 2400 bps, which throttled Emacs by having it sleep.
1500 This code hasn't worked since at least 2007, when the multi-tty stuff
1501 was added, and anyway those old terminals are long dead.
1502 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
1503 without the dispnew.c change, as dispnew.c doesn't include systty.h.
1505 Fix data-loss with --version (Bug#9574).
1506 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
1507 as we can't assume that emacs_strerror is initialized, and strerror
1508 is good enough here.
1509 (main): Invoke atexit earlier, to catch earlier instances of
1510 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
1512 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
1514 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
1515 (keyDown): Remap keypad keys to X11 virtual key codes.
1517 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
1519 Fix data-loss with --batch (Bug#9574).
1520 * emacs.c: Include <close-stream.h>.
1521 (close_output_streams): New function.
1522 (main): Pass it to atexit, so that Emacs closes stdout and stderr
1523 and handles errors appropriately.
1524 (Fkill_emacs): Don't worry about flushing, as close_output_stream
1527 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
1528 The symptom is a diagnostic "GLib-WARNING **: In call to
1529 g_spawn_sync(), exit status of a child process was requested but
1530 SIGCHLD action was set to SIG_IGN and ECHILD was received by
1531 waitpid(), so exit status can't be returned." The diagnostic
1532 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
1533 The real bug is a race condition between Emacs and glib: Emacs
1534 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
1535 so that glib can't find it. Work around the bug by invoking
1536 waitpid only on subprocesses that Emacs itself creates.
1537 * process.c (create_process, record_child_status_change):
1538 Don't use special value -1 in pid field, as the caller now must
1539 know the pid rather than having the callee infer it.
1540 The inference was sometimes incorrect anyway, due to another race.
1541 (create_process): Set new 'alive' member if child is created.
1542 (process_status_retrieved): New function.
1543 (record_child_status_change): Use it.
1544 Accept negative 1st argument, which means to wait for the
1545 processes that Emacs already knows about. Move special-case code
1546 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
1547 processes that have already been waited for, by testing and
1548 clearing new 'alive' member.
1549 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
1550 now does this internally.
1551 (handle_child_signal): Let record_child_status_change do all
1552 the work, since we do not want to reap all exited child processes,
1553 only the child processes that Emacs itself created.
1554 * process.h (Lisp_Process): New boolean member 'alive'.
1556 Omit duplicate definitions no longer needed with gcc -g3.
1557 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
1558 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
1559 Define only as macros. There's no longer any need to also define
1560 these symbols as enums or as constants, since we now assume
1561 gcc -g3 when debugging.
1563 2012-11-03 Eli Zaretskii <eliz@gnu.org>
1565 * lisp.mk: Adjust comments to the fact that term/internal is now
1566 loaded from loadup.el.
1568 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
1569 (msdos_fatal_signal): New function.
1570 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
1573 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
1574 for GCC versions before 4.
1575 (emacs_raise): Define to call msdos_fatal_signal.
1577 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
1578 iterator when starting in the middle of a display or overlay
1581 2012-11-03 Chong Yidong <cyd@gnu.org>
1583 * process.c (wait_reading_process_output): Clean up the last
1586 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
1588 * process.c (wait_reading_process_output): Avoid a race condition
1589 with SIGIO delivery (Bug#11536).
1591 2012-11-03 Chong Yidong <cyd@gnu.org>
1593 * buffer.c (cursor_type): Untabify docstring.
1595 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
1597 * frame.h (struct frame): Drop can_have_scroll_bars member
1598 which is meaningless for a long time. Adjust comments.
1599 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
1600 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
1602 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
1604 * window.c (decode_next_window_args): Update window arg after
1605 calling decode_live_window and so fix crash reported at
1606 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
1607 by Juanma Barranquero <lekktu@gmail.com>.
1608 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
1609 * font.c (Ffont_at): Likewise.
1611 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
1613 * widget.c (resize_cb): New function.
1614 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
1615 (EmacsFrameResize): Check if all is up to date before changing frame
1618 2012-11-02 Eli Zaretskii <eliz@gnu.org>
1620 Implement backtrace output for fatal errors on MS-Windows.
1621 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
1622 (BACKTRACE_LIMIT_MAX): New macro.
1623 (w32_backtrace): New function.
1624 (emacs_abort): Use w32_backtrace when the user chooses not to
1625 attach a debugger. Update the text of the abort dialog.
1627 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
1629 Window-related stuff cleanup here and there.
1630 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
1631 Use decode_any_window.
1632 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
1633 * xdisp.c (Fformat_mode_line): Likewise.
1634 * font.c (Ffont_at): Use decode_live_window.
1635 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
1636 * window.c (decode_next_window_args): Likewise.
1637 (decode_any_window): Remove static.
1638 * window.h (decode_any_window): Add prototype.
1639 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
1640 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
1643 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
1645 Remove pad from struct input_event.
1646 * termhooks.h (struct input_event): Remove padding field.
1648 * keyboard.c (event_to_kboard): Simplify because frame_or_window
1649 member is never cons for a long time. Adjust comment.
1650 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
1651 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
1652 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
1653 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
1655 2012-11-01 Eli Zaretskii <eliz@gnu.org>
1657 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
1659 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
1661 Fix crash when using Emacs as commit editor for git (Bug#12697).
1662 * callproc.c (setpgrp): Remove macro, as we now use setpgid
1663 and it is configured in conf_post.h.
1664 (Fcall_process): Don't invoke both setsid and setpgid; the former
1665 is enough, if it exists.
1666 * callproc.c (Fcall_process, child_setup):
1667 * process.c (create_process): Use setpgid.
1668 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
1670 * dispnew.c (init_display): Initialize the foreground group
1671 if we are running a tty display.
1672 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
1673 * lisp.h (init_foreground_group): New decl.
1674 * sysdep.c (inherited_pgroup): New static var.
1675 (init_foreground_group, tcsetpgrp_without_stopping)
1676 (narrow_foreground_group, widen_foreground_group): New functions.
1677 (init_sys_modes): Narrow foreground group.
1678 (reset_sys_modes): Widen foreground group.
1680 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
1682 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
1684 2012-10-31 Martin Rudalics <rudalics@gmx.at>
1686 * minibuf.c (read_minibuf): Restore current buffer since
1687 choose_minibuf_frame calling Fset_frame_selected_window may
1688 change it (Bug#12766).
1690 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
1692 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
1694 2012-10-30 Kenichi Handa <handa@gnu.org>
1696 * font.c (Ffont_at): If WINDOW is specified and it is not
1697 displaying the current buffer, signal an error.
1699 2012-10-29 Daniel Colascione <dancol@dancol.org>
1701 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
1702 In preparation for fixing bug#12739, move these functions from
1705 * coding.h, coding.c: ... to here, and compile them only when
1706 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
1707 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
1709 2012-10-28 Eli Zaretskii <eliz@gnu.org>
1711 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
1712 (timer_loop, getitimer, setitimer): Use it instead of
1713 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
1715 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
1718 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
1720 * nsterm.m (NO_APPDEFINED_DATA): New define.
1721 (last_appdefined_event_data): New variable
1722 (last_appdefined_event): Remove.
1723 (ns_select): Initialize t from last_appdefined_event_data instead
1724 of [last_appdefined_event data1].
1725 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
1726 remove last_appdefined_event (Bug#12698).
1728 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
1730 * frame.c (x_set_font): Catch internal error.
1732 2012-10-27 Eli Zaretskii <eliz@gnu.org>
1734 Avoid overflow in w32 implementation of interval timers.
1735 When possible, for ITIMER_PROF count only times the main thread
1737 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
1738 'volatile ULONGLONG' types. All the other data which was
1739 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
1740 (GetThreadTimes_Proc): New typedef.
1741 (w32_get_timer_time): New function, returns a suitable time value
1743 (timer_loop): Enter critical section when accessing ULONGLONG
1744 values of the itimer_data struct, as these accesses are no longer
1745 atomic. Call 'w32_get_timer_time' instead of 'clock'.
1746 Remove unused variable.
1747 (init_timers): Initialize s_pfn_Get_Thread_Times.
1748 (start_timer_thread): Don't assign itimer->caller_thread here.
1749 (getitimer): Assign itimer->caller_thread here.
1750 (setitimer): Always call getitimer to get the value of ticks_now.
1751 (sys_spawnve): Avoid compiler warning about format mismatch.
1753 2012-10-26 Eli Zaretskii <eliz@gnu.org>
1755 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
1756 mouse movement events if the menu bar is active. This avoids
1757 producing a busy "hour-glass" cursor by Windows if the mouse
1758 pointer is positioned over a tooltip shown for some menu item.
1760 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
1762 Don't assume process IDs fit in int.
1763 * emacs.c (shut_down_emacs) [!DOS_NT]:
1764 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
1765 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
1766 Use pid_t, not int, to store process IDs, as 'int'
1767 is not wide enough on a few platforms (e.g., AIX and IRIX).
1769 2012-10-23 Kenichi Handa <handa@gnu.org>
1771 The following change is to make face-font-rescale-alist work
1772 correctly for non-ASCII fonts.
1774 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
1775 (font_open_for_lface): Handle Vface_font_rescale_alist.
1777 2012-10-23 Chong Yidong <cyd@gnu.org>
1779 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
1781 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
1783 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
1785 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
1787 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
1790 2012-10-21 Glenn Morris <rgm@gnu.org>
1792 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
1794 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
1796 Port to OpenBSD 5.1.
1797 * frame.c (Fmouse_position, Fmouse_pixel_position):
1798 * xdisp.c (produce_stretch_glyph):
1799 Declare local vars only when they're needed.
1800 This is clearer and avoids a warning on OpenBSD about unused vars.
1801 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
1802 This is safer, and avoids OpenBSD warnings about unused vars.
1803 * keyboard.c (record_menu_key): Remove unnecessary decl.
1804 (poll_timer): Define only if POLL_FOR_INPUT is defined.
1805 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
1806 as our definition clashes with OpenBSD's.
1807 * xfaces.c (load_face_colors, check_lface_attrs)
1808 (get_lface_attributes_no_remap, get_lface_attributes)
1809 (lface_fully_specified_p, x_supports_face_attributes_p)
1810 (tty_supports_face_attributes_p, face_fontset, realize_face)
1811 (realize_x_face, realize_tty_face):
1812 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
1813 merely Lisp_Object *. This is more informative and avoids
1814 a warning on OpenBSD about accessing beyond an object's size.
1816 2012-10-20 Chong Yidong <cyd@gnu.org>
1818 * lread.c (Fload): Doc fix (Bug#12592).
1820 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
1822 * font.c (Ffont_at): Fix previous change.
1824 2012-10-19 Eli Zaretskii <eliz@gnu.org>
1826 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
1827 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
1830 * alloc.c (NSTATICS): Decrease to 0x800.
1832 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
1834 * fns.c (Fnreverse): Include the problem element when signaling an
1837 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
1839 * nsterm.m (ns_select): Check writefds before call to
1840 FD_ISSET (Bug#12668).
1842 2012-10-18 Daniel Colascione <dancol@dancol.org>
1844 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
1845 (staticpro): If we run out of staticpro slots, die with an
1846 informative error instead of just calling emacs_abort.
1848 2012-10-18 Martin Rudalics <rudalics@gmx.at>
1850 Fix two flaws reported by Dmitry Antipov.
1851 * window.c (Ftemp_output_buffer_show): Remove.
1852 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
1853 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
1855 2012-10-17 Eli Zaretskii <eliz@gnu.org>
1857 * makefile.w32-in ($(BLD)/w32.$(O)):
1858 ($(BLD)/vm-limit.$(O)):
1860 ($(BLD)/unexw32.$(O)):
1861 ($(BLD)/fileio.$(O)):
1862 ($(BLD)/dispnew.$(O)): Update dependencies.
1864 * w32term.h (w32_initialize_display_info, initialize_w32_display):
1867 * w32proc.c: Include ctype.h.
1869 * w32.h (init_environment, check_windows_init_file)
1870 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
1871 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
1872 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
1873 (sys_link): Add prototypes.
1875 * w32.c: Include w32select.h.
1876 (sys_access, e_malloc, sys_select): Add prototypes.
1877 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
1879 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
1881 * unexw32.c: Include lisp.h and w32.h.
1883 * term.c [WINDOWSNT]: Include w32term.h.
1885 * process.c [WINDOWSNT]: Add prototype of sys_select.
1887 * fileio.c [WINDOWSNT]: Include w32.h.
1889 * dispnew.c [WINDOWSNT]: Include w32.h.
1891 * cygw32.c (Fcygwin_convert_path_to_windows)
1892 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
1893 Lisp_Object values. (Bug#12661)
1895 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
1896 to Lisp_Object. (Bug#12661)
1898 2012-10-17 Kenichi Handa <handa@gnu.org>
1900 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
1903 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
1905 * buffer.c (Fkill_buffer): When unchaining the marker,
1906 reset its buffer pointer to NULL (Bug#12652).
1908 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
1910 Do not verify indirection counters of killed buffers (Bug#12579).
1911 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
1912 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
1914 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
1916 * alloc.c (Fmake_byte_code): Fix typo in comment.
1917 * print.c (print_interval): Define as static to match prototype.
1918 * indent.c (disptab_matches_widthtab, recompute_width_table):
1921 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
1923 * editfns.c (get_system_name): Remove.
1924 * lisp.h (get_system_name): Remove prototype.
1925 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
1926 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
1928 2012-10-15 Daniel Colascione <dancol@dancol.org>
1930 * dbusbind.c: Add comment explaining reason for previous change.
1932 2012-10-15 Martin Rudalics <rudalics@gmx.at>
1934 * window.c (Fwindow_end): Rewrite check whether cached position
1935 can be used (Bug#12600).
1936 (resize_frame_windows, grow_mini_window, shrink_mini_window):
1937 Set windows_or_buffers_changed.
1939 2012-10-15 Daniel Colascione <dancol@dancol.org>
1941 * dbusbind.c: Fix cygw32 build break when compiling with dbus
1942 enabled by undefining the symbol "interface", which the platform
1943 headers define to something incompatible.
1945 2012-10-14 Daniel Colascione <dancol@dancol.org>
1947 * image.c (init_tiff_functions, init_imagemagick_functions)
1948 (init_svg_functions): Fix cygw32 build break by using these
1949 functions only when WINDOWSNT _and_ HAVE_NTGUI.
1951 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
1953 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
1955 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
1957 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
1959 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
1961 * coding.c (detect_coding): Set coding->id before calling
1964 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
1966 * fileio.c: Formatting fixes.
1968 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
1970 Fix some stat-related races.
1971 * fileio.c (Fwrite_region): Avoid race condition if a file is
1972 removed or renamed by some other process immediately after Emacs
1973 writes it but before Emacs stats it. Do not assume that stat (or
1975 * image.c (slurp_file): Resolve the file name with fopen + fstat
1976 rather than stat + fopen.
1977 (pbm_read_file) [0]: Remove unused code with stat race.
1978 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
1979 Remove ineffective code with stat race.
1981 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
1983 * doc.c (get_doc_string): Don't signal an error if the file is missing.
1985 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
1987 * nsterm.m (hold_event_q): New static variable.
1988 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
1990 (hold_event): New function.
1991 (ns_read_socket): If hold_event_q have events, store them and
1993 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
1994 is zero (Bug#12384).
1996 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
1998 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
2000 2012-10-12 Eli Zaretskii <eliz@gnu.org>
2002 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
2004 * fileio.c (check_existing): New function.
2005 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
2006 instead of calling 'stat', when what's needed is to check whether
2007 a file exists. This avoids expensive system calls on MS-Windows.
2010 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
2012 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
2013 determine whether a file exists and is not a directory.
2015 * lisp.h (check_existing): Add prototype.
2017 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
2019 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
2021 2012-10-12 Glenn Morris <rgm@gnu.org>
2023 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
2025 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
2027 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
2029 * eval.c (Fautoload): Remember previous autoload status in load-history.
2031 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
2033 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
2034 * lread.c (load_each_byte, new_backquote_flag, readchar)
2035 (read_filtered_event, lisp_file_lexically_bound_p)
2036 (safe_to_load_version, Fload, complete_filename_p, openp)
2037 (build_load_history, readevalloop, read_escape, read1)
2038 (string_to_number, read_vector, read_list):
2039 * macros.c (Fstart_kbd_macro):
2040 * marker.c (CONSIDER):
2041 * menu.c (parse_single_submenu, digest_single_submenu)
2042 (find_and_return_menu_selection, Fx_popup_menu):
2043 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
2045 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
2047 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
2048 (xmenu_show, xdialog_show):
2049 Use bool for booleans.
2050 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
2051 as it's not a predicate. All uses changed. Omit unnecessary
2054 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
2056 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
2057 (save_excursion_restore): Do not restore mark if it was not saved.
2059 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
2061 * marker.c (cached_modiff): EMACS_INT, not int.
2063 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
2064 instead of having a wrong decl.
2065 * nsmenu.m (waiting_for_input): Remove wrong decl.
2067 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
2069 keyboard.c, keymap.c: Use bool for booleans.
2070 * dispnew.c (sit_for): Distinguish between 3-way display_option
2071 and boolean do_display.
2072 * keyboard.c (single_kboard, this_command_key_count_reset)
2073 (waiting_for_input, echoing, immediate_quit, input_pending)
2074 (interrupt_input, interrupts_deferred, pop_kboard)
2075 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
2076 (command_loop_1, adjust_point_for_property)
2077 (safe_run_hooks_error, input_polling_used, read_char):
2078 (help_char_p, readable_events, kbd_buffer_events_waiting)
2079 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
2080 (lucid_event_type_list_p, get_input_pending):
2081 (gobble_input, menu_separator_name_p, menu_bar_item)
2082 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
2083 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
2084 (keyremap_step, test_undefined, read_key_sequence)
2085 (detect_input_pending, detect_input_pending_ignore_squeezables)
2086 (detect_input_pending_run_timers, requeued_events_pending_p)
2087 (quit_throw_to_read_char, Fset_input_interrupt_mode):
2088 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
2089 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
2090 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
2091 (accessible_keymaps_1, Fkey_description, push_key_description):
2092 (shadow_lookup, struct where_is_internal_data)
2093 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
2094 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
2095 (describe_map, describe_vector):
2096 * menu.c (single_menu_item):
2097 * nsmenu.m (ns_update_menubar):
2098 * process.c (wait_reading_process_output):
2099 * search.c (scan_buffer, scan_newline):
2100 Use bool for boolean.
2101 * keyboard.c (timers_run, swallow_events)
2102 (detect_input_pending_run_timers):
2103 * process.c (wait_reading_process_output):
2104 Use unsigned for counter where wraparound-on-overflow is desired,
2105 since unsigned is guaranteed to have that behavior and signed is not.
2106 (read_char): Use ptrdiff_t for string length.
2107 (get_input_pending): Remove first argument, since it was always
2108 the same pointer-to-int (now pointer-to-boolean) &input_pending,
2109 and behave as if it had that value. Return new value of
2110 input_pending. All callers changed.
2111 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
2112 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
2114 * keymap.c (push_key_description): Omit last arg, which was always 1.
2115 All callers changed.
2117 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
2119 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
2121 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
2122 ($(BLD)/term.$(O)): Update dependencies.
2124 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
2126 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
2127 * lisp.h (enum pvec_type): Adjust comments and omit explicit
2128 initializer for PVEC_NORMAL_VECTOR.
2130 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
2132 Clean out old termopts cruft.
2133 * termopts.h (flow_control, meta_key): Remove unused decls.
2134 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
2135 Don't include termopts.h.
2137 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
2139 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
2141 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
2143 * commands.h (immediate_quit): Remove duplicate decl.
2145 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
2147 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
2149 (nsfont_open): Remove setting of Vfonts_in_cache.
2150 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
2152 2012-10-09 Eli Zaretskii <eliz@gnu.org>
2154 * w32fns.c (w32_last_error): Change the return value to DWORD, to
2155 match what GetLastError returns. Explain why the function is
2158 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
2159 'is_tooltip_frame', to avoid confusion with its global namesake.
2161 2012-10-08 Daniel Colascione <dancol@dancol.org>
2163 * xdisp.c (start_hourglass): Call w32_note_current_window when
2164 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
2165 build that caused Emacs to display the hourglass cursor forever.
2167 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
2168 which is broken under remote desktop, calculate the number of
2169 colors available for a display based on the display's number of
2170 planes and number of bits per pixel per plane. (bug#10397).
2172 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
2174 * nsfont.m (Vfonts_in_cache): New variable.
2175 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
2176 are used. Add cached fonts to Vfonts_in_cache.
2177 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
2179 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
2181 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
2183 (FONT_H): Define after FRAME_H.
2184 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
2185 Update dependencies.
2187 * w32term.c: Remove leftover declaration of keyboard_codepage.
2189 2012-10-08 Eli Zaretskii <eliz@gnu.org>
2191 * makefile.w32-in (FONT_H): Add $(FRAME_H).
2192 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
2193 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
2194 (GLOBAL_SOURCES): Add cygw32.c.
2195 ($(BLD)/unexw32.$(O)):
2197 ($(BLD)/w32console.$(O)):
2198 ($(BLD)/w32fns.$(O)):
2199 ($(BLD)/w32heap.$(O)):
2200 ($(BLD)/w32menu.$(O)):
2201 ($(BLD)/w32proc.$(O)): Add w32common.h.
2203 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
2205 (x_to_w32_color): Don't modify the argument, modify a copy instead.
2207 2012-10-08 Daniel Colascione <dancol@dancol.org>
2209 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
2210 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
2211 accidental message numbering hole. Change other messages to
2214 * w32select.h (HAVE_W32SELECT): Remove.
2216 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
2217 w32common.h instead of w32heap.h.
2219 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
2220 (get_allocation_unit, get_processor_type, get_w32_major_version)
2221 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
2222 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
2223 (OS_NT, os_subtype, cache_system_info): Move declarations to
2226 * w32heap.c: Include w32common.h.
2227 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
2228 (w32_minor_version, w32_build_number, w32_subtype):
2229 Remove duplicate definitions.
2231 * w32fns.c: Include w32common.h; include w32heap.h only in
2234 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
2235 Use `report_file_error' instead of `error' in order to better
2236 inform users of what went wrong. Increase NTGUI_UNICODE file
2237 dialog box file name length to 32k, the maximum allowed by the NT
2240 * w32common.h: New file.
2241 (ROUND_UP, ROUND_DOWN, get_page_size)
2242 (get_allocation_unit, get_processor_type, get_w32_major_version)
2243 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
2244 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
2245 (OS_NT, os_subtype, cache_system_info): Move here.
2247 * unexw32.c, unexcw.c: Include w32common.h.
2249 * emacs.c (main): Use (defined (WINDOWSNT) || defined
2250 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
2251 to call syms_of_w32select.
2253 * cygw32.h: Remove obsolete EXFUN declarations.
2255 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
2257 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
2258 of w32inevt.o from SOME_MACHINE_OBJECTS.
2260 2012-10-08 Daniel Colascione <dancol@dancol.org>
2262 * image.c: Permanent fix for JPEG compilation issue --- limit
2263 jpeglib `boolean' redefinition to Cygwin builds.
2265 2012-10-08 Eli Zaretskii <eliz@gnu.org>
2267 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
2269 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
2272 2012-10-08 Daniel Colascione <dancol@dancol.org>
2274 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
2275 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
2276 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
2277 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
2278 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
2279 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
2280 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
2281 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
2282 now a supported configuration.
2284 * Makefile.in: consolidate image variables into LIBIMAGE; add
2285 W32_OBJ and W32_LIBS. Compile new files.
2288 (_DebPrint) declare tracing facility for W32 debugging. We need
2289 to unify tracing later.
2291 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
2292 unconditional use of W32 Unicode functions. Cygwin runs only on
2293 100% Unicode operating systems.
2295 * cygw32.c: New file. Define Cygwin-specific facilities.
2296 (Fcygwin_convert_path_to_windows)
2297 (Fcygwin_convert_path_from_windows): New user functions for
2298 accessing Cygwin path-munging routines.
2300 * cygw32.h: New file.
2301 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
2302 UTF-16LE strings temporarily inside non-Lisp-visible string
2305 (w32_strerror): Just what it says on the tin.
2307 * emacs.c: Make the NS fork-then-exec code for daemon-launching
2308 also run for Cygwin; both systems have the same problem with using
2309 GUI facilities in a forked child. Also call syms_of_cygw32,
2310 syms_of_w32select in correct places.
2312 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
2313 needs fork-then-exec for daemon launching.
2315 * font.h: Include frame.h.
2317 * image.c: Use the image library cache machinery only when we're
2318 compiling for native WINDOWSNT; Cygwin can use shared libraries
2319 like any other Unixlike system.
2321 * keyboard.c: Clarify a comment regarding the input loop.
2323 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
2324 functions directly instead of trying to detect at runtime that our
2325 host operating system supports them. We make this change for two
2326 reasons: Cygwin lacks support for the multibyte character
2327 conversion functions used by the legacy menu code, and Cygwin
2328 never needs to rely on non-Unicode APIs.
2330 * unexw32.c (hinst): Declare extern.
2332 * w32.c: Change header order;
2333 (w32_strerror): Move to w32fns.c because we need it for
2334 non-WINDOWSNT builds.
2336 * w32.h: Add #error macro to make sure we don't include w32.h for
2337 Cygwin builds. Remove w32select declarations.
2339 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
2340 w32fns.c. w32console.c is WINDOWSNT-only.
2342 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
2343 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
2345 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
2346 (w32_major_version, w32_minor_version, w32_build_number)
2347 (os_subtype, sound_type): Define here
2348 (w32_defined_color): Make color parameter const for consistency
2349 with other _defined_color functions.
2350 (w32_createwindow): Unconditionally call w32_init_class instead of
2351 doing so only when hprevinst is non-NULL. Plumbing hprevinst
2352 through the code is complex and unnecessary because class
2353 registration is practically free.
2354 (w32_name_of_message): New EMACSDEBUG-only function.
2355 (Fset_message_beep): Move here
2356 (Fx_open_connection): Require that the display name for Windows be
2357 "w32" for consistency, emacsclient disambiguation, and maybe, one
2358 day, multi-window-system support.
2359 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
2360 Cygwin files for W32 GUI facilities, since these clearly don't
2361 expect Cygwin names.
2362 (_DebPrint): Define.
2363 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
2364 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
2365 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
2366 (w32_last_error): Remove.
2368 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
2370 * w32heap.c (syspage_mask): Declare here.
2371 (cache_system_info): Remove.
2373 * w32inevt.c (faked_key): Define globally, not statically.
2374 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
2375 (w32_console_toggle_lock_key): Move to w32fns.c.
2377 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
2379 * w32proc.c (_DebPrint): Move to w32fns.c.
2380 * w32select.c: Include string.h, stdio.h for Cygwin.
2381 * w32select.h: New File.
2383 * w32term.c: Include io.h for non-CYGWIN builds; needed for
2385 (w32_message_fd): New variable. Under Cygwin, holds the file
2386 descriptor the system used to tell us about pending thread
2389 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
2390 that prevented compilation under non-WINDOWSNT systems.
2392 (w32_initialize): Open /dev/windows and assign it to
2393 w32_message_fd. Provide w32 feature.
2395 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
2396 (WM_EMACS_INPUT_READY): add.
2397 (prepend_msg, w32_message_fd): Declare globally.
2400 (keyboard_handle): Use only when WINDOWSNT.
2401 (notify_msg_ready): New function. Posts a message to the main
2402 thread's message queue under CYGWIN, which wakes up the main
2403 thread from select(2) by making the /dev/windows file descriptor
2404 ready. Under WINDOWSNT, it sets an event the same way the old
2407 (post, prepend_msg): Actually call notify_msg_ready instead of
2408 setting the input event directly.
2410 2012-10-07 Eli Zaretskii <eliz@gnu.org>
2412 * ralloc.c (relinquish): If a heap is ready to be relinquished,
2413 but it still has blocs in it, don't return it to the system,
2414 instead of aborting. (Bug#12402)
2416 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
2418 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
2420 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
2421 MAC_OS_X_VERSION_10_6.
2422 (syms_of_nsterm): Remove comment about Panther and above for
2424 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
2425 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
2426 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
2428 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
2429 MAC_OS_X_VERSION_10_4.
2431 * nsmenu.m (fillWithWidgetValue:): Remove code for <
2432 MAC_OS_X_VERSION_10_2.
2434 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
2436 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
2437 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
2439 * nsterm.m (ns_in_resize): Remove (Bug#12479).
2440 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
2441 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
2442 Remove ns_in_resize check.
2443 (ns_clear_frame_area): Remove resize handle code.
2445 * nsfns.m (ns_in_resize): Remove.
2446 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
2447 Remove ns_in_resize check.
2449 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
2451 Improve sys_siglist detection.
2452 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
2453 defined as a macro, as is done in Solaris.
2454 (sys_siglist_entries): New macro.
2455 (save_strsignal): Use it.
2456 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
2457 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
2459 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
2461 * nsfns.m (Fx_create_frame): Call x_default_parameter with
2462 fullscreen/Fullscreen.
2464 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
2465 tobar_height is new.
2467 * nsterm.m (x_make_frame_visible): Check for fullscreen.
2468 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
2469 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
2470 (windowDidResize:): Check for correct window if old style fullscreen.
2471 Capitalize word in comment. Remove incorrect comment.
2472 (initFrameFromEmacs:): tbar_height renamed tibar_height.
2473 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
2474 error in drawing background.
2475 (toggleFullScreen:): Remove comment. Rearrange calls.
2476 Set toolbar values to zero, save old height in tobar_height.
2477 Restore tool bar height when leaving fullscreen.
2478 (canBecomeMainWindow): New function.
2480 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
2482 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
2484 2012-10-05 Eli Zaretskii <eliz@gnu.org>
2486 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
2488 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
2489 that time stamps of directories could also be changed.
2490 Don't request the too broad GENERIC_WRITE, only the more restrictive
2491 FILE_WRITE_ATTRIBUTES access rights.
2493 * fileio.c (Fset_file_times): Special-case ignoring errors for
2494 directories only on MSDOS, not on MS-Windows.
2496 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
2498 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
2500 2012-10-04 Eli Zaretskii <eliz@gnu.org>
2502 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
2503 see whether CreateFile failed.
2505 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
2507 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
2508 to avoid similar races.
2509 * keyboard.c (pending_signals): Now bool, not int.
2511 Port timers to OpenBSD, plus check for timer failures.
2512 OpenBSD problem reported by Han Boetes.
2513 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
2515 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
2516 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
2517 like OpenBSD, which has timer_settime but does not declare it.
2518 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
2519 whether to use itimerspec-related primitives. All uses of
2520 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
2522 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
2524 * profiler.c (handle_profiler_signal): Fix a malloc race
2525 that caused Emacs to hang on Fedora 17 when profiling Lisp.
2527 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
2529 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
2531 2012-10-02 Eli Zaretskii <eliz@gnu.org>
2533 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
2534 consistent with the change in return value of 'safe_strsignal'.
2536 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
2538 Prefer plain 'static' to 'static inline' (Bug#12541).
2539 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
2540 (bidi_set_sor_type, bidi_push_embedding_level)
2541 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
2542 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
2543 (bidi_cache_search, bidi_cache_ensure_space)
2544 (bidi_cache_iterator_state, bidi_cache_find)
2545 (bidi_peek_at_next_level, bidi_set_paragraph_end)
2546 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
2547 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
2548 Now 'static', not 'static inline'.
2550 Count overruns when profiling; change units to ns.
2551 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
2552 Give extra weight to samples after overruns, to attempt to count
2553 the time more accurately.
2554 (setup_cpu_timer): Change sampling interval units from ms to ns, since
2555 the underlying primitives nominally do ns.
2556 (Fprofiler_cpu_start): Document the change. Mention that
2557 the sampling intervals are only approximate.
2559 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
2561 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
2563 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
2564 case for the special 0 coding-system.
2566 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
2567 (Fmake_overlay): Remove redundant tests.
2568 (fix_start_end_in_overlays): Remove redundant recentering.
2570 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
2572 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
2573 Update dependencies.
2575 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
2577 Fix a malloc race condition involving strsignal.
2578 A signal can arrive in the middle of a malloc, and Emacs's signal
2579 handler can invoke strsignal, which can invoke malloc, which is
2580 not portable. This race condition bug makes Emacs hang on GNU/Linux.
2581 Fix it by altering the signal handler so that it does not invoke
2583 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
2584 * process.c (status_message): Use const pointer, in case strsignal
2585 is #defined to safe_strsignal.
2586 * sysdep.c (sys_siglist, init_signals): Always define and
2587 initialize a substitute sys_siglist if the system does not define
2588 one, even if HAVE_STRSIGNAL.
2589 (safe_strsignal): Rename from strsignal. Always define,
2590 using sys_siglist. Return a const pointer.
2591 * syssignal.h (safe_strsignal): New decl.
2592 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
2594 2012-10-01 Eli Zaretskii <eliz@gnu.org>
2596 * w32proc.c (timer_loop): Fix code that waits for timer
2597 expiration, to avoid high CPU usage.
2599 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
2601 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
2602 (sweep_weak_table): Remove redundant prototypes.
2604 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
2606 * emacs.c: Move the inclusion of TERM_HEADER after including
2607 windows.h on WINDOWSNT. This avoids compilation problems with
2610 2012-10-01 Eli Zaretskii <eliz@gnu.org>
2612 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
2613 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
2614 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
2615 as the previous version used 'void *'.
2617 * ralloc.c (ROUNDUP): Fix last change.
2618 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
2621 * w32proc.c <disable_itimers>: New static flag.
2622 (init_timers): Initialize it to zero, after creating the critical
2623 sections used by the timer threads.
2624 (term_timers): Set to 1 before deleting the critical sections.
2625 (getitimer, setitimer): If disable_itimers is non-zero, return an
2626 error indication without doing anything. Reported by Fabrice
2627 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
2628 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
2630 [!HAVE_SETITIMER]: Behave as the previous version that didn't
2633 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
2634 term_ntproc after all the other bookkeeping, to get timers working
2635 as long as possible.
2637 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
2639 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
2640 Suggested by Juri Linkov in
2641 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
2643 Prefer plain 'static' to 'static inline' (Bug#12541).
2644 With static functions, modern compilers inline pretty well by
2645 themselves; advice from programmers often hurts as much as it helps.
2646 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
2647 this change shrinks the text size of the Emacs executable by 1.1%
2648 without affecting CPU significantly in my benchmark.
2649 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
2650 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
2651 (mark_maybe_object, mark_maybe_pointer, bounded_number):
2652 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2653 (bset_auto_fill_function, bset_auto_save_file_format)
2654 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2655 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2656 (bset_cache_long_line_scans, bset_case_fold_search)
2657 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2658 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2659 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2660 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2661 (bset_header_line_format, bset_indicate_buffer_boundaries)
2662 (bset_indicate_empty_lines, bset_invisibility_spec)
2663 (bset_left_fringe_width, bset_major_mode, bset_mark)
2664 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2665 (bset_name, bset_overwrite_mode, bset_pt_marker)
2666 (bset_right_fringe_width, bset_save_length)
2667 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2668 (bset_scroll_up_aggressively, bset_selective_display)
2669 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2670 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
2671 (set_buffer_overlays_after):
2672 * category.c (bset_category_table):
2673 * charset.c (read_hex):
2674 * coding.c (produce_composition, produce_charset)
2675 (handle_composition_annotation, handle_charset_annotation)
2677 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
2678 (assign_row, set_frame_matrix_frame, make_current)
2680 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
2681 * fns.c (maybe_resize_hash_table):
2682 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
2683 * gmalloc.c (register_heapinfo):
2684 * image.c (lookup_image_type):
2685 * intervals.c (set_interval_object, set_interval_left)
2686 (set_interval_right, copy_interval_parent, rotate_right)
2687 (rotate_left, balance_possible_root_interval):
2688 * keyboard.c (kset_echo_string, kset_kbd_queue)
2689 (kset_keyboard_translate_table, kset_last_prefix_arg)
2690 (kset_last_repeatable_command, kset_local_function_key_map)
2691 (kset_overriding_terminal_local_map, kset_real_last_command)
2692 (kset_system_key_syms, clear_event, set_prop):
2693 * lread.c (digit_to_number):
2694 * marker.c (attach_marker, live_buffer, set_marker_internal):
2695 * nsterm.m (ns_compute_glyph_string_overhangs):
2696 * process.c (pset_buffer, pset_command)
2697 (pset_decode_coding_system, pset_decoding_buf)
2698 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
2699 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
2700 (pset_status, pset_tty_name, pset_type, pset_write_queue):
2701 * syntax.c (bset_syntax_table, dec_bytepos):
2702 * terminal.c (tset_param_alist):
2703 * textprop.c (interval_has_some_properties)
2704 (interval_has_some_properties_list):
2705 * window.c (wset_combination_limit, wset_dedicated)
2706 (wset_display_table, wset_hchild, wset_left_fringe_width)
2707 (wset_left_margin_cols, wset_new_normal, wset_new_total)
2708 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2709 (wset_right_fringe_width, wset_right_margin_cols)
2710 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
2711 (wset_vertical_scroll_bar_type, wset_window_parameters):
2712 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2713 (wset_column_number_displayed, wset_region_showing)
2714 (window_box_edges, run_window_scroll_functions)
2715 (append_glyph_string_lists, prepend_glyph_string_lists)
2716 (append_glyph_string, set_glyph_string_background_width)
2717 (append_glyph, append_composite_glyph)
2718 (take_vertical_position_into_account):
2719 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
2720 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
2721 (lface_hash, lface_same_font_attributes_p, lookup_face):
2722 * xml.c (libxml2_loaded_p):
2723 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
2724 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
2725 Now 'static', not 'static inline'.
2728 (bidi_copy_it): Do the whole copy with a single memcpy.
2729 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
2731 Revert the FOLLOW-SYMLINKS change for file-attributes.
2732 Doing it right would require several changes to Tramp, and there's
2733 not enough time to get that tested before the freeze today.
2734 * dired.c (directory_files_internal, Ffile_attributes):
2737 * frame.c (x_report_frame_params): Port better to wider ints.
2738 Do not assume that EMACS_UINT is the same width as uprintmax_t,
2739 or that pointers can be printed in 15 decimal digits.
2740 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
2742 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
2744 Support x64 build on MS-Windows.
2745 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
2746 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
2747 compatibility with x64.
2748 (x_get_focus_frame): Add prototype.
2750 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
2751 defining an XRectangle structure.
2753 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
2754 arithmetics for compatibility with x64.
2756 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
2757 compatibility with x64.
2759 * w32heap.h: Adjust prototypes and declarations.
2761 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
2762 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
2763 DWORD, long, and unsigned long, for compatibility with x64.
2764 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
2765 (sbrk): Argument is now of type ptrdiff_t.
2767 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
2769 (w32_msg_pump): Use WPARAM type for 'result'.
2771 * w32.c (init_environment, get_emacs_configuration): Support AMD64
2773 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
2774 compatibility with x64.
2776 * vm-limit.c (lim_data): Now size_t.
2777 (check_memory_limits): Adjust prototypes of real_morecore and
2778 __morecore to receive argument of type ptrdiff_t. Use size_t for
2779 five_percent and data_size.
2781 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
2782 variables, for compatibility with x64.
2783 (rva_to_section, offset_to_section, relocate_offset)
2784 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
2785 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
2786 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
2787 for compatibility with x64.
2789 * sysdep.c (STDERR_FILENO): Define if not already defined.
2791 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
2792 (__morecore): Argument type is now ptrdiff_t.
2793 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
2794 (relinquish): Use ptrdiff_t type for 'excess'.
2795 (r_alloc_sbrk): Argument type is now ptrdiff_t.
2797 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
2798 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
2799 instead of a literal number.
2801 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
2802 (min): Define only if not already defined.
2804 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
2805 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
2808 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
2809 'bitmaps' is a pointer.
2811 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
2813 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
2815 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2817 file-attributes has a new optional arg FOLLOW-SYMLINKS.
2818 * dired.c (directory_files_internal, Ffile_attributes):
2819 New arg follow_symlinks. All uses changed.
2821 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
2823 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
2825 2012-09-30 Eli Zaretskii <eliz@gnu.org>
2827 Support atimers and CPU profiler via profile.c on MS-Windows.
2828 * w32proc.c (sig_mask, crit_sig): New static variables.
2829 (sys_signal): Support SIGALRM and SIGPROF.
2830 (sigemptyset, sigaddset, sigfillset, sigprocmask)
2831 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
2832 sigfillset, and sigprocmask are no longer no-ops.
2833 (sigismember): New function.
2834 (struct itimer_data): New definition.
2835 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
2836 (crit_prof): New static variables.
2837 (MAX_SINGLE_SLEEP): New definition.
2838 (timer_loop, stop_timer_thread, term_timers, init_timers)
2839 (start_timer_thread, getitimer, setitimer): New functions.
2840 (alarm): No longer a no-op, calls setitimer.
2842 * w32.c (term_ntproc): Call term_timers.
2843 (init_ntproc): Make sure all signals are unblocked at startup, to
2844 erase any traces of dumping. Call init_timers.
2846 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
2847 Windows-specific code to display the hourglass mouse pointer is no
2849 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
2850 to hourglass timer expiration.
2851 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
2852 Remove, no longer used.
2853 (w32_note_current_window, show_hourglass, hide_hourglass):
2854 New functions, in support of hourglass cursor display similar to other
2856 (syms_of_w32fns): Don't initialize hourglass_timer.
2858 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
2860 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
2862 * w32.h (init_timers, term_timers): Add prototypes.
2864 2012-09-30 Kenichi Handa <handa@gnu.org>
2866 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
2867 to the buffer relocation which may be caused by ccl_driver.
2869 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
2871 * xfns.c (Fx_file_dialog): Update comment.
2873 * w32fns.c (Fx_file_dialog): Update comment.
2875 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
2876 Initialize panel name field if OSX >= 10.6.
2878 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
2880 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
2882 * nsterm.m (NEW_STYLE_FS): New define.
2883 (ns_fullscreen_hook, windowWillEnterFullScreen)
2884 (windowDidEnterFullScreen, windowWillExitFullScreen)
2885 (windowDidExitFullScreen, toggleFullScreen, handleFS)
2886 (setFSValue): New functions.
2887 (EmacsFSWindow): New implementation.
2888 (canBecomeKeyWindow): New function for EmacsFSWindow.
2889 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
2890 (dealloc): Release nonfs_window if in fullscreen.
2891 (updateFrameSize:): Call windowDidMove to update top/left.
2892 (windowWillResize:toSize:): Check if frame is still maximized.
2893 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
2894 next_maximized, maximized_width, maximized_height and nonfs_window.
2895 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
2897 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
2898 fullscreen. Set maximized_width/height. Act on next_maximized.
2900 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
2901 (EmacsView): Add variables for fullscreen.
2902 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
2903 (EmacsFSWindow): New interface for fullscreen.
2905 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
2907 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2909 2012-09-30 Chong Yidong <cyd@gnu.org>
2911 * fns.c (Frandom): Doc fix.
2913 2012-09-30 Martin Rudalics <rudalics@gmx.at>
2915 * window.c (Vwindow_combination_limit): New default value.
2916 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
2918 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2920 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
2921 Suggested by Eli Zaretskii in
2922 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
2924 2012-09-30 Eli Zaretskii <eliz@gnu.org>
2926 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
2927 HAVE_TIMER_SETTIME is defined.
2929 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2931 Profiler improvements: more-accurate timers, overflow checks.
2932 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
2933 signal.h, setjmp.h. Include systime.h instead.
2934 (saturated_add): New function.
2935 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
2936 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
2937 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
2939 (enum profiler_cpu_running): New enum.
2940 (profiler_cpu_running): Now of that enum type, not bool.
2941 All uses changed to store the new value.
2942 (handle_profiler_signal): Rename from sigprof_handler_1,
2943 for consistency with other handlers. Do not check whether
2944 cpu_log is a hash-table if garbage collecting, since it
2945 doesn't matter in that case.
2946 (deliver_profiler_signal): Rename from sigprof_handler,
2947 for consistency with other handlers.
2948 (setup_cpu_timer): New function, with much of what used to be in
2949 Fprofiler_cpu_start. Check for out-of-range argument.
2950 Prefer timer_settime if available, and prefer
2951 thread cputime clocks, then process cputime clocks, then
2952 monotonic clocks, to the old realtime clock. Use make_timeval
2953 to round more-correctly when falling back to setitimer.
2954 (Fprofiler_cpu_start): Use it.
2955 (Fprofiler_cpu_stop): Prefer timer_settime if available.
2956 Don't assume that passing NULL as the 2nd argument of setitimer
2957 is the same as passing a pointer to all-zero storage.
2958 Ignore SIGPROF afterwards.
2959 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
2960 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
2961 non-fatal signal handlers. Ignore SIGPROF on startup.
2962 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
2963 in profiler.c, since sysdep.c now uses it.
2965 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
2966 Suggested by Eli Zaretskii in
2967 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
2969 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
2971 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2973 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
2975 * lisp.h (struct backtrace): Remove indirection for `function' field.
2976 * xdisp.c (redisplay_internal):
2977 * profiler.c (record_backtrace, sigprof_handler_1):
2978 * alloc.c (Fgarbage_collect):
2979 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
2980 (Fbacktrace_frame): Adjust accordingly.
2982 2012-09-28 Glenn Morris <rgm@gnu.org>
2984 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
2985 (Frun_hook_with_args_until_failure): Doc fixes.
2987 2012-09-28 Eli Zaretskii <eliz@gnu.org>
2989 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
2990 Qautomatic_redisplay and change the symbol name. All users changed.
2992 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
2994 * profiler.c (sigprof_handler): Fix race condition.
2996 2012-09-28 Glenn Morris <rgm@gnu.org>
2998 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
3000 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
3002 Check more robustly for timer_settime.
3003 * Makefile.in (LIB_TIMER_TIME): New macro.
3005 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
3006 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
3009 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
3011 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
3013 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
3015 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
3017 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
3019 * character.h (MAYBE_UNIFY_CHAR): Remove.
3020 * charset.c, charset.h (maybe_unify_char): Now static.
3021 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
3022 Since this stuff is now private to charset.c, there's no need for
3023 a public macro and no need to inline by hand.
3025 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
3026 Stefan Monnier <monnier@iro.umontreal.ca>
3027 Juanma Barranquero <lekktu@gmail.com>
3029 * profiler.c: New file.
3030 * Makefile.in (base_obj): Add profiler.o.
3031 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
3032 ($(BLD)/profiler.$(O)): New target.
3033 * emacs.c (main): Call syms_of_profiler.
3034 * alloc.c (Qautomatic_gc): New constant.
3035 (MALLOC_PROBE): New macro.
3036 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
3037 (total_bytes_of_live_objects): New function.
3038 (Fgarbage_collect): Use it. Record itself in backtrace_list.
3039 Call malloc_probe for the memory profiler.
3040 (syms_of_alloc): Define Qautomatic_gc.
3041 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
3043 (struct backtrace): Move definition...
3044 * lisp.h (struct backtrace): ..here.
3045 (Qautomatic_gc, profiler_memory_running): Declare vars.
3046 (malloc_probe, syms_of_profiler): Declare functions.
3047 * xdisp.c (Qautomatic_redisplay): New constant.
3048 (redisplay_internal): Record itself in backtrace_list.
3049 (syms_of_xdisp): Define Qautomatic_redisplay.
3051 2012-09-25 Eli Zaretskii <eliz@gnu.org>
3052 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
3054 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
3056 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
3058 Prefer POSIX timers if available.
3059 They avoid a race if the timer is too close to the current time.
3060 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
3061 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
3062 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
3064 2012-09-25 Eli Zaretskii <eliz@gnu.org>
3066 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
3067 CHAR_STRING_ADVANCE.
3068 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
3069 STRING_CHAR_ADVANCE.
3071 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
3073 Move Vlibrary_cache to emacs.c and reset before dumping.
3075 * lisp.h (reset_image_types): Declare.
3076 [WINDOWSNT] (Vlibrary_cache): Declare.
3078 * image.c (reset_image_types): New function.
3080 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
3081 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
3082 (Fdump_emacs): Reset Vlibrary_cache and image_types.
3084 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
3085 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
3087 * w32.h (Vlibrary_cache): Do not declare.
3089 2012-09-25 Eli Zaretskii <eliz@gnu.org>
3091 * w32proc.c (sys_signal): Handle all signals defined by the
3092 MS-Windows runtime, not just SIGCHLD. Actually install the signal
3093 handlers for signals supported by Windows. Don't override
3094 term_ntproc as the handler for SIGABRT.
3095 (sigaction): Rewrite to call sys_signal instead of duplicating its
3097 (sys_kill): Improve commentary.
3099 * w32.c (term_ntproc): Accept (and ignore) one argument, for
3100 consistency with a signature of a signal handler. All callers
3102 (init_ntproc): Accept an argument DUMPING. If dumping, don't
3103 install term_ntproc as a signal handler for SIGABRT, as that
3104 should be done by the dumped Emacs.
3106 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
3108 * w32select.c (term_w32select): Protect against repeated
3109 invocation by setting clipboard_owner to NULL after calling
3112 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
3113 and term_ntproc to their modified signatures.
3115 * character.c (char_string, string_char): Remove calls to
3116 MAYBE_UNIFY_CHAR. See the discussion starting at
3117 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
3120 2012-09-25 Chong Yidong <cyd@gnu.org>
3122 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
3124 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
3126 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
3127 when encountering an unknown bytecode.
3129 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
3131 image.c, indent.c: Use bool for booleans.
3132 * dispextern.h (struct image_type): Members valid_p, load, init
3133 now return bool, not int. All uses changed.
3134 * image.c: Omit unnecessary static decls.
3135 (x_create_bitmap_mask, x_build_heuristic_mask):
3136 Return void, not int, since callers don't care about the return value.
3137 (x_create_bitmap_mask, define_image_type, valid_image_p)
3138 (struct image_keyword, parse_image_spec, image_spec_value)
3139 (check_image_size, image_background)
3140 (image_background_transparent, x_clear_image_1)
3141 (postprocess_image, lookup_image, x_check_image_size)
3142 (x_create_x_image_and_pixmap, xbm_image_p)
3143 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
3144 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
3145 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
3146 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
3147 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
3148 (png_image_p, init_png_functions, png_load_body, png_load)
3149 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
3150 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
3151 (init_gif_functions, gif_load, imagemagick_image_p)
3152 (imagemagick_load_image, imagemagick_load, svg_image_p)
3153 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
3155 * nsimage.m (ns_load_image):
3156 * nsterm.m (ns_defined_color):
3157 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
3158 * xfns.c (x_defined_color):
3159 * xterm.c (x_alloc_lighter_color_for_widget)
3160 (x_alloc_nearest_color_1, x_alloc_nearest_color)
3161 (x_alloc_lighter_color):
3162 * indent.c (disptab_matches_widthtab, current_column)
3163 (scan_for_column, string_display_width, indented_beyond_p)
3164 (compute_motion, vmotion, Fvertical_motion):
3165 Use bool for booleans.
3167 2012-09-24 Chong Yidong <cyd@gnu.org>
3169 * chartab.c (Fset_char_table_default): Obsolete function removed.
3171 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
3173 Move pid_t related decls out of lisp.h.
3174 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
3175 (interruptible_wait_for_termination):
3176 Move these decls from lisp.h to syswait.h, since they use pid_t.
3177 Needed on FreeBSD; see Herbert J. Skuhra in
3178 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
3179 * callproc.c: Include syswait.h.
3181 gnutls.c, gtkutil.c: Use bool for boolean.
3182 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
3183 (emacs_gnutls_handle_error):
3184 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
3185 (xg_hide_tooltip, xg_create_frame_widgets)
3186 (create_dialog, xg_uses_old_file_dialog)
3187 (xg_get_file_with_chooser, xg_get_file_with_selection)
3188 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
3189 (xg_item_label_same_p, xg_update_menubar)
3190 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
3191 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
3192 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
3193 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
3194 (update_frame_tool_bar, free_frame_tool_bar):
3195 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
3196 * nsmenu.m (ns_update_menubar):
3197 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
3198 * xfns.c (Fx_show_tip) [USE_GTK]:
3199 Use bool for boolean.
3200 * gtkutil.c (xg_update_frame_menubar):
3201 * xmenu.c (update_frame_menubar):
3202 Return void, not int, since caller ignores return value.
3203 * gtkutil.c (xg_change_toolbar_position):
3206 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
3208 * makefile.w32-in (BLOCKINPUT_H): Remove.
3209 (SYSSIGNAL_H): New macro.
3210 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
3211 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
3212 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
3213 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
3214 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
3215 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
3216 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
3217 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
3218 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
3219 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
3220 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
3221 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
3222 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
3223 ($(BLD)/w32xfns.$(O)): Update dependencies.
3225 2012-09-23 Eli Zaretskii <eliz@gnu.org>
3227 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
3228 fatal_error_backtrace.
3230 * w32proc.c (sys_kill): Undo last change: don't do anything when
3231 invoked to deliver SIGABRT to our own process. This is now
3232 handled by emacs_raise.
3234 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
3236 * w32term.c (w32_read_socket): Remove leftover reference to
3237 interrupt_input_pending.
3239 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
3241 Do not use SA_NODEFER.
3242 Problem reported by Dani Moncayo in
3243 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
3245 * sysdep.c (emacs_abort): Do not reset signal handler.
3246 * emacs.c (terminate_due_to_signal): Reset signal handler here.
3247 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
3248 wanted even on POSIXish hosts, and it doesn't work on Windows.
3250 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
3252 * xterm.c (x_term_init): Call fixup_locale before and after calling
3253 gtk_init (Bug#12392).
3255 2012-09-23 Chong Yidong <cyd@gnu.org>
3257 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
3258 Vdynamic_library_alist.
3260 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
3261 (Fgnutls_available_p): Caller changed.
3263 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
3264 (Flibxml_parse_xml_region): Likewise.
3266 * dispextern.h (struct image_type): Remove arg from init function.
3268 * image.c (Finit_image_library, lookup_image_type)
3269 (define_image_type): Remove now-unneeded second arg.
3270 (init_xpm_functions, init_png_functions, init_jpeg_functions)
3271 (init_tiff_functions, init_gif_functions, init_svg_functions):
3272 Arglist and w32_delayed_load calling convention changed.
3273 (gs_type): Remove init_gs_functions; there is no such function.
3274 (valid_image_p, make_image): Fix caller to lookup_image_type.
3276 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
3278 Simplify and avoid signal-handling races (Bug#12471).
3280 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
3281 Avoid recursive loop if there's a fatal error in the function itself.
3282 * atimer.c (pending_atimers):
3283 * blockinput.h: Don't include "atimer.h"; no longer needed.
3284 (interrupt_input_pending): Remove. All uses removed.
3285 pending_signals now counts both atimers and ordinary interrupts.
3286 This is less racy than having three separate pending-signal flags.
3287 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
3289 Rename from their upper-case counterparts BLOCK_INPUT,
3290 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
3291 INPUT_BLOCKED_P, and turn into functions. All uses changed.
3292 This makes it easier to access volatile variables more accurately.
3293 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
3294 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
3295 that's more reliable if the code is buggy and sets
3296 interrupt_input_blocked to a negative value. All uses changed.
3297 * atimer.c (deliver_alarm_signal):
3298 Remove. No need to deliver this to the parent; any thread can
3299 handle this signal now. All uses replaced by underlying handler.
3300 * atimer.c (turn_on_atimers):
3301 * dispnew.c (handle_window_change_signal):
3302 * emacs.c (handle_danger_signal):
3303 * keyboard.c (kbd_buffer_get_event):
3304 Don't reestablish signal handler; not needed with sigaction.
3305 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
3307 Rework to avoid unnecessary accesses to volatile variables.
3308 (UNBLOCK_INPUT_TO): Now a function.
3309 (totally_unblock_input, unblock_input): New decls.
3310 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
3311 (init_data): Remove. Necessary stuff now done in init_signal.
3312 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
3313 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
3314 (fatal_error_code): Remove; no longer needed.
3315 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
3316 it doesn't always backtrace. All uses changed. No need to reset
3317 signal to default, since sigaction and/or die does that for us now.
3318 Use emacs_raise (FOO), not kill (getpid (), FOO).
3319 (main): Check more-accurately whether we're dumping.
3320 Move fatal-error setup to sysdep.c
3321 * floatfns.c: Do not include "syssignal.h"; no longer needed.
3322 * gtkutil.c (xg_get_file_name, xg_get_font):
3323 Remove no-longer-needed signal-mask manipulation.
3324 * keyboard.c, process.c (POLL_FOR_INPUT):
3325 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
3326 * keyboard.c (read_avail_input): Remove.
3327 All uses replaced by gobble_input.
3328 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
3329 (kbd_buffer_store_event_hold, gobble_input):
3330 (record_asynch_buffer_change) [USABLE_SIGIO]:
3331 (store_user_signal_events):
3332 No need to mess with signal mask.
3333 (gobble_input): If blocking input and there are terminals, simply
3334 set pending_signals to 1 and return. All hooks changed to not
3335 worry about whether input is blocked.
3336 (process_pending_signals): Clear pending_signals before processing
3337 them, in case a signal comes in while we're processing.
3338 By convention callers now test pending_signals before calling us.
3339 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
3340 New functions, to support changes to blockinput.h.
3341 (handle_input_available_signal): Now extern.
3342 (reinvoke_input_signal): Remove. All uses replaced by
3344 (quit_count): Now volatile, since a signal handler uses it.
3345 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
3346 All callers changed. Block SIGINT only if not already blocked.
3347 Clear sigmask reliably, even if Fsignal returns, which it can.
3348 Omit unnecessary accesses to volatile var.
3349 (quit_throw_to_read_char): No need to restore sigmask.
3350 * keyboard.c (gobble_input, handle_user_signal):
3351 * process.c (wait_reading_process_output):
3352 Call signal-handling code rather than killing ourselves.
3353 * lisp.h: Include <float.h>, for...
3354 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
3355 (pending_signals): Now volatile.
3356 (syms_of_data): Now const if IEEE floating point.
3357 (handle_input_available_signal) [USABLE_SIGIO]:
3358 (terminate_due_to_signal, record_child_status_change): New decls.
3359 * process.c (create_process): Avoid disaster if memory is exhausted
3360 while we're processing a vfork, by tightening the critical section
3362 (send_process_frame, process_sent_to, handle_pipe_signal)
3363 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
3365 (send_process): No need for setjmp/longjmp any more, since the
3366 SIGPIPE stuff is now gone. Instead, report an error if errno
3368 (record_child_status_change): Now extern. PID and W are now args.
3369 Return void, not bool. All callers changed.
3370 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
3371 Remove. All uses removed. This bug should be fixed now in a
3373 (wait_for_termination_1): Use waitpid rather than sigsuspend,
3374 and record the child status change directly. This avoids the
3375 need to futz with the signal mask.
3376 (process_fatal_action): Move here from emacs.c.
3377 (emacs_sigaction_flags): New function, containing
3378 much of what used to be in emacs_sigaction_init.
3379 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
3380 caught by emacs, to make races less likely.
3381 (deliver_process_signal): Rename from handle_on_main_thread.
3383 (BACKTRACE_LIMIT_MAX): Now at top level.
3384 (thread_backtrace_buffer, threadback_backtrace_pointers):
3386 (deliver_thread_signal, deliver_fatal_thread_signal):
3387 New functions, for more-accurate delivery of thread-specific signals.
3388 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
3389 (deliver_arith_signal): Handle in this thread, not
3390 in the main thread, since it's triggered by this thread.
3391 (maybe_fatal_sig): New function.
3392 (init_signals): New arg DUMPING so that we can be more accurate
3393 about whether we're dumping. Caller changed.
3394 Treat thread-specific signals differently from process-general signals.
3395 Block all signals while handling fatal error; that's safer.
3396 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
3398 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
3399 Ignore SIGPIPE unless batch.
3400 (emacs_backtrace): Output backtrace for the appropriate thread,
3401 which is not necessarily the main thread.
3402 * syssignal.h: Include <stdbool.h>.
3403 (emacs_raise): New macro.
3404 * xterm.c (x_connection_signal): Remove; no longer needed
3405 now that we use sigaction.
3406 (x_connection_closed): No need to mess with sigmask now.
3407 (x_initialize): No need to reset SIGPIPE handler here, since
3408 init_signals does this for us now.
3410 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
3412 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
3413 background rect may be larger (Bug#12245).
3415 2012-09-23 Chong Yidong <cyd@gnu.org>
3417 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
3419 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
3421 * .gdbinit: Just stop at fatal_error_backtrace.
3422 See Stefan Monnier's request in
3423 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
3424 Remove no-longer-used query of system type.
3426 2012-09-22 Chong Yidong <cyd@gnu.org>
3428 * search.c (Freplace_match): Doc fix (Bug#12325).
3430 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
3432 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
3433 (Fline_end_position): Doc fix.
3435 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
3437 2012-09-22 Chong Yidong <cyd@gnu.org>
3439 * dispextern.h (struct image_type): Add new slot, storing a type
3440 initialization function.
3442 * image.c (define_image_type): Call the image initializer function
3443 if it is defined. Arguments and return value changed.
3444 (valid_image_p, make_image): Callers changed.
3445 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3446 (gif_type, imagemagick_type, svg_type, gs_type):
3447 Add initialization functions.
3448 (Finit_image_library): Call lookup_image_type.
3449 (CHECK_LIB_AVAILABLE): Macro deleted.
3450 (lookup_image_type): Call define_image_type here, rather than via
3451 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
3452 (syms_of_image): Move define_image_type calls for xbm_type and
3453 pbm_type to lookup_image_type.
3455 2012-09-22 Eli Zaretskii <eliz@gnu.org>
3457 * keyboard.c (timer_check_2): Move calculation of 'timers' and
3458 'idle_timers' from here ...
3459 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
3460 lists, to avoid infloops when the timer does something stupid,
3461 like reinvoke itself with the same or smaller time-out.
3464 2012-09-22 Martin Rudalics <rudalics@gmx.at>
3466 * window.c (Fsplit_window_internal): Handle only Qt value of
3467 Vwindow_combination_limit separately.
3468 (Qtemp_buffer_resize): New symbol.
3469 (Vwindow_combination_limit): New default value.
3472 2012-09-22 Eli Zaretskii <eliz@gnu.org>
3474 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
3475 the new overlay string. (Bug#10159)
3477 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
3479 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
3480 or that fprintf is async-signal-safe. POSIX doesn't require
3483 2012-09-22 Chong Yidong <cyd@gnu.org>
3485 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
3488 2012-09-22 Kenichi Handa <handa@gnu.org>
3490 * composite.c (composition_reseat_it): Handle the case that a
3491 grapheme cluster is not covered by a single font (Bug#12352).
3493 2012-09-21 Chong Yidong <cyd@gnu.org>
3495 * image.c (define_image_type): Avoid adding duplicate types to
3496 image_types (Bug#12463). Suggested by Jörg Walter.
3498 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3500 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
3501 (print_load_command_name): Add case LC_DATA_IN_CODE.
3502 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
3504 2012-09-21 Glenn Morris <rgm@gnu.org>
3506 * eval.c (Frun_hook_with_args_until_success)
3507 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
3509 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
3511 * fileio.c (Ffile_selinux_context): Only call freecon when
3512 lgetfilecon succeeded.
3513 (Fset_file_selinux_context): Likewise. (Bug#12444)
3515 2012-09-21 Eli Zaretskii <eliz@gnu.org>
3517 * xdisp.c (try_window_reusing_current_matrix): Under bidi
3518 reordering, locate the cursor by calling set_cursor_from_row; if
3519 that fails, clear the desired glyph matrix before returning a
3520 failure indication to the caller. Fixes leaving garbled display
3521 when fast scrolling with a down-key. (Bug#12403)
3522 (compute_stop_pos_backwards): Fix a typo that caused crashes while
3523 scrolling through multibyte text.
3525 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
3527 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
3528 calling mark_vectorlike since that's the one that marks the window.
3529 (mark_discard_killed_buffers): Mark the final cdr.
3530 * window.h (struct window): Move prev/next_buffers to the
3531 non-standard fields.
3532 * window.c (make_window): Initialize prev/next_buffers manually.
3534 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
3536 Omit unused arg EXPECTED from socket hooks.
3537 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
3538 * nsterm.m (ns_term_init):
3539 * termhooks.h (struct terminal.read_socket_hook):
3540 * w32inevt.c (w32_console_read_socket):
3541 * w32term.c (w32_read_socket):
3542 * xterm.c (XTread_socket):
3543 Omit unused arg EXPECTED. All callers changed.
3544 (store_user_signal_events): Return void, not int, since callers no
3545 longer care about the return value. All uses changed.
3547 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
3549 * w32gui.h (XParseGeometry): Do not declare.
3551 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
3553 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
3554 Ignore 'expected'. See Eli Zaretskii in
3555 <http://bugs.gnu.org/12471#8> (last line).
3557 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
3558 (XParseGeometry): Now static. Substitute extremal values for
3559 values that are out of range.
3561 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
3563 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
3565 * nsfns.m (XParseGeometry): Remove.
3566 (Fx_create_frame): Call x_set_offset to correctly interpret
3567 top_pos in geometry.
3569 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
3570 (Fx_parse_geometry): If there is a space in string, call
3571 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
3573 2012-09-17 Eli Zaretskii <eliz@gnu.org>
3575 * search.c (scan_buffer): Use character positions in calls to
3576 region_cache_forward and region_cache_backward, not byte
3577 positions. (Bug#12196)
3579 * w32term.c (w32_read_socket): Set pending_signals to 1, like
3580 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
3582 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
3583 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
3584 emacs_blocked_malloc, now deleted.
3586 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
3588 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
3589 The workaround was for improving performance on Solaris 2.4, but
3590 is getting in the way now. Emacs will still work if someone is
3591 still running Solaris 2.4 in a museum somewhere; Sun dropped
3592 support for Solaris 2.4 in 2003.
3593 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
3594 * process.c (create_process) [HAVE_WORKING_VFORK]:
3595 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
3596 since Emacs no longer uses vfork on that platform.
3598 2012-09-17 Glenn Morris <rgm@gnu.org>
3600 * emacs.c: Use COPYRIGHT.
3602 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
3604 Remove configure's --without-sync-input option (Bug#12450).
3605 When auditing signal-handling in preparation for cleaning it up,
3606 I found that SYNC_INPUT has race conditions and would be a real
3607 pain to fix. Since it's an undocumented and deprecated
3608 configure-time option, now seems like a good time to remove it.
3609 Also see <http://bugs.gnu.org/11080#16>.
3610 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
3611 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
3612 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
3613 (malloc_hysteresis):
3614 (check_depth) [XMALLOC_OVERRUN_CHECK]:
3615 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
3616 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
3617 (dont_register_blocks, bytes_used_when_reconsidered)
3618 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
3619 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
3620 [!SYSTEM_MALLOC && !SYNC_INPUT]:
3621 Remove. All uses removed.
3622 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
3623 implementation, one that depends on whether the new macro
3624 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
3626 * atimer.c (run_timers, handle_alarm_signal):
3627 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
3628 (handle_async_input, process_pending_signals)
3629 (handle_input_available_signal, init_keyboard):
3630 * nsterm.m (ns_read_socket):
3631 * process.c (wait_reading_process_output):
3632 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
3633 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
3635 * xterm.c (XTread_socket):
3637 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
3638 * eval.c (handling_signal): Remove. All uses removed.
3639 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
3640 All uses replaced with the SYNC_INPUT version.
3641 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
3643 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3646 * font.c (Ffont_shape_gstring): Remove unused local.
3648 2012-09-16 Glenn Morris <rgm@gnu.org>
3650 * Makefile.in (clean): No longer run nextstep's clean.
3652 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
3654 (ns-app): Move here from ns.mk, and simplify.
3655 (clean): Simplify nextstep entry.
3656 * ns.mk: Remove file.
3658 2012-09-17 Kenichi Handa <handa@gnu.org>
3660 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
3661 not covert the last few charactes.
3663 2012-09-16 Kenichi Handa <handa@gnu.org>
3665 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
3666 here, but just check the validity of glyphs in the glyph-string.
3668 2012-09-16 Martin Rudalics <rudalics@gmx.at>
3670 * window.c (Fwindow_parameter, Fset_window_parameter):
3671 Accept any window as argument (Bug#12452).
3673 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
3675 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
3676 to ns_term_init to avoid memory leak.
3678 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
3679 explicit retain/release.
3680 (ns_term_init): Only allow one display. Initialize outerpool and
3683 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
3685 Port _setjmp fix to POSIXish hosts as well as Microsoft.
3686 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
3687 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
3688 the Microsoft problem in a different way, by altering ../nt/config.nt.
3690 2012-09-15 Eli Zaretskii <eliz@gnu.org>
3705 * w16select.c: Remove inclusion of setjmp.h, as it is now included
3706 by lisp.h. This completes removal of setjmp.h inclusion
3707 erroneously announced in the previous commit. (Bug#12446)
3709 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
3712 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
3713 not defined as a macro. The latter happens on MS-Windows.
3716 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
3718 Port better to POSIX hosts lacking _setjmp (Bug#12446).
3719 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
3720 Some instances of '#include <setjmp.h>' removed, if the
3721 only reason for the instance was because "lisp.h" was included.
3722 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
3723 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
3724 and _longjmp with the new symbols. Emacs already uses _setjmp if
3725 available, so this change affects only POSIXish hosts that have
3726 sigsetjmp but not _setjmp, such as some versions of Solaris and
3727 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
3728 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
3729 (png_load_body) [HAVE_PNG]:
3730 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
3731 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
3732 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
3733 since PNG requires jmp_buf. This is the only exception to the
3734 general rule that we now use sys_setjmp and sys_longjmp.
3735 This exception is OK since this code does not change the signal
3736 mask or longjmp out of a signal handler.
3738 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
3740 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
3741 Include "syssignal.h", for 'main_thread'.
3743 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
3745 Avoid out-of-range marker position (Bug#12426).
3746 * insdel.c (replace_range, replace_range_2):
3747 Adjust markers before overlays, as suggested by comments.
3748 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
3749 Remove redundant check before calling offset_intervals.
3751 2012-09-14 Martin Rudalics <rudalics@gmx.at>
3753 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
3754 current buffer (Bug#12387).
3756 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
3758 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
3760 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
3762 Use a more backwards-compatible timer format (Bug#12430).
3763 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
3764 vector element, not from the 4th, since PSECS is now at the end.
3765 (Fcurrent_idle_time): Doc fix.
3767 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
3769 Function to mark objects and remove killed buffers at once.
3770 * alloc.c (discard_killed_buffers): Rename to ...
3771 (mark_discard_killed buffers) ... new name. Add marking
3772 of remaining objects. Fix comment. Adjust users.
3773 (mark_object): Do not touch frame buffer lists here.
3774 * frame.c (delete_frame): Reset frame buffer lists here.
3776 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
3778 Better workaround for GNOME bug when --enable-gcc-warnings.
3779 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
3780 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
3781 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
3783 Simplify SIGIO usage (Bug#12408).
3784 The code that dealt with SIGIO was crufty and confusing, e.g., it
3785 played tricks like "#undef SIGIO" but these tricks were not used
3786 consistently. Simplify mostly by not #undeffing standard symbols,
3787 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
3788 or not as we please) rather than "defined SIGIO" (standard symbol
3789 that we probably shouldn't #undef).
3790 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
3791 Modules that need it can include it.
3792 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
3793 * dispextern.h (ignore_sigio): New decl.
3794 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
3795 unconditionally, since it's now a no-op if !USABLE_SIGIO.
3796 * emacs.c (shut_down_emacs):
3797 * keyboard.c (kbd_buffer_store_event_hold):
3798 Use ignore_sigio rather than invoking 'signal' directly.
3799 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
3801 (FIONREAD, SIGIO): Do not #undef.
3802 (tty_read_avail_input): Use #error rather than a syntax error.
3803 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
3804 for I_PIPE, used by SETUP_SLAVE_PTY.
3805 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
3806 * sysdep.c (croak): Remove; no longer needed. This bit of
3807 temporary code, with Fred N. Fish's comment that it's temporary,
3808 has been in Emacs since at least 1992!
3809 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
3810 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
3811 * syssignal.h (croak): Remove decl.
3812 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
3813 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
3814 now that we're termios-only.
3815 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
3816 * term.c (dissociate_if_controlling_tty): Use #error rather than
3819 Work around GCC and GNOME bugs when --enable-gcc-warnings.
3820 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
3821 to work around GNOME bug 683906.
3822 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
3823 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
3824 This works around GCC bug 54561.
3826 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
3828 More fixes for 'volatile' and setjmp/longjmp.
3829 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
3830 * image.c (struct png_load_context) [HAVE_PNG]: New type.
3831 (png_load_body) [HAVE_PNG]:
3832 (jpeg_load_body) [HAVE_JPEG]:
3833 New function, with most of the old parent function's body.
3834 (png_load) [HAVE_PNG]:
3835 (jpeg_load) [HAVE_JPEG]:
3836 Invoke the new function, to avoid longjmp munging our locals.
3837 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
3838 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
3839 longjmp is passed 2, as the C standard doesn't guarantee this.
3840 Instead, store the failure code into mgr->failure_code.
3842 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
3844 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
3845 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
3846 (syms_of_keyboard): Remove support for unread-command-char.
3848 2012-09-12 Eli Zaretskii <eliz@gnu.org>
3850 * w32proc.c (sys_kill): If PID is our process ID and the signal is
3851 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
3852 violation. (Bug#12426)
3854 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
3856 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
3858 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
3860 * eval.c: Add `inhibit-debugger'.
3861 (Qinhibit_debugger): New symbol.
3862 (call_debugger): Bind it instead of Qdebug_on_error.
3863 (maybe_call_debugger): Test Vinhibit_debugger.
3864 (syms_of_eval): Define inhibit-debugger.
3865 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
3866 (syms_of_xdisp): Remove inhibit-debug-on-message.
3868 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
3870 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
3871 If a nonvolatile local variable is written before a _longjmp to
3872 the frame containing the variable, and is read after the _longjmp,
3873 the value read is indeterminate. Some local variables of type
3874 'struct handler' and 'struct catchtag' are used in this way, so
3875 mark each of their slots as volatile if the slot can be set before
3876 _longjmp and read afterwards.
3877 * lisp.h (struct handler): var and chosen_clause are now volatile.
3878 (struct catchtag): val, next, and pdlcount are now volatile.
3880 * bidi.c (bidi_push_it, bidi_pop_it):
3881 * fns.c (copy_hash_table):
3882 * image.c (define_image_type):
3883 * keyboard.c (kbd_buffer_store_event_hold):
3884 * process.c (Fprocess_send_eof):
3885 * xfaces.c (x_create_gc) [HAVE_NS]:
3886 * xgselect.c (xg_select):
3887 Prefer assignment to memcpy when either will do.
3889 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
3890 Use pointer-to-a-pointer to simplify and avoid a NILP check each
3891 time an item is removed. No need to mark this function 'inline';
3892 the compiler knows better than we do.
3894 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
3896 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
3897 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
3898 to change_frame_size (Bug#12388).
3899 (windowDidResize:): Pass YES to updateFrameSize.
3901 * nsterm.h: Add delay parameter to updateFrameSize.
3903 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
3905 Discard killed buffers from deleted window and frame objects.
3906 This reduces an amount of references to killed buffers and
3907 helps GC to reclaim them faster.
3908 * alloc.c (discard_killed_buffers): New function.
3909 (mark_object): Use it for deleted windows and frames.
3910 (mark_object): If symbol's value is set up for a killed buffer
3911 or deleted frame, restore its global binding.
3912 * data.c (swap_in_global_binding): Add GC notice.
3913 (swap_in_symval_forwarding): Use convenient set_blv_where.
3914 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
3915 * window.h: ... to here.
3917 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
3919 Convenient macro to check whether the buffer is live.
3920 * buffer.h (BUFFER_LIVE_P): New macro.
3921 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
3922 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
3924 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3926 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
3927 composition cases (Bug#12364).
3929 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
3930 overhang of succeeding glyphs overlapping box cursor.
3932 * w32term.c (x_draw_glyph_string): Likewise.
3934 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
3936 Simplify, document, and port floating-point (Bug#12381).
3937 The porting part of this patch fixes bugs on non-IEEE platforms
3938 with frexp, ldexp, logb.
3939 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
3941 * floatfns.c: Simplify discussion of functions that Emacs doesn't
3942 support, by removing commented-out code and briefly listing the
3943 C89 functions excluded. The commented-out stuff was confusing
3944 maintenance, e.g., we thought we needed cbrt but it was commented out.
3945 (logb): Remove decl; no longer needed.
3946 (isfinite): New macro, if not already supplied.
3947 (isnan): Don't replace any existing macro.
3948 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
3949 are present on all C89 platforms.
3950 (Ffrexp): Do not special-case zero, as frexp does the right thing
3952 (Flogb): Do not use logb, as it doesn't have the desired meaning
3953 on hosts that use non-base-2 floating point. Instead, stick with
3954 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
3955 frexp, to avoid getting an unspecified result.
3957 * xdisp.c (Qinhibit_debug_on_message): Now static.
3959 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
3961 * nsterm.m (ns_update_begin): Set clip path to whole view by using
3962 NSBezierPath (Bug#12131).
3964 2012-09-10 Chong Yidong <cyd@gnu.org>
3966 * fns.c (Fdelq, Fdelete): Doc fix.
3968 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
3970 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
3971 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
3973 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
3975 * lisp.h (make_lisp_ptr): New macro to replace XSET.
3976 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
3979 2012-09-09 Eli Zaretskii <eliz@gnu.org>
3981 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
3982 left fringe if the window has a left margin. This avoids leaving
3983 traces of the cursor because its leftmost pixel is not drawn over.
3985 * dispnew.c (update_window_line): When the left margin area of a
3986 screen line is updated, set the redraw_fringe_bitmaps_p flag of
3987 that screen line. (Bug#12277)
3989 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
3991 Assume C89 or later for math functions (Bug#12381).
3992 This simplifies the code, and makes it a bit smaller and faster,
3993 and (most important) makes it easier to clean up signal handling
3994 since we can stop worring about floating-point exceptions in
3995 library code. That was a problem before C89, but the problem
3996 went away many years ago on all practical Emacs targets.
3997 * data.c, image.c, lread.c, print.c:
3998 Don't include <math.h>; no longer needed.
3999 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
4000 might be autoconfigured, as that never happens.
4002 * doprnt.c (DBL_MAX_10_EXP):
4003 * print.c (DBL_DIG):
4004 Remove. C89 or later always defines these.
4005 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
4006 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
4007 (arith_error, domain_error, domain_error2):
4008 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
4009 no longer needed -- we simply return what C returns. All uses removed.
4010 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
4012 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
4013 Remove. All uses expanded, as these macros are no longer used
4014 more than once and are now more trouble than they're worth.
4015 (Ftan): Use tan, not sin / cos.
4016 (Flogb): Assume C89 frexp.
4017 (fmod_float): Assume C89 fmod.
4018 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
4019 (init_floatfns): Remove. All uses removed.
4021 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
4023 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
4024 compositeToPoint for OSX < 10.6 (Bug#12390).
4026 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
4028 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
4029 This produces more-accurate results.
4031 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
4033 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
4034 changes (Bug#12088).
4036 2012-09-08 Chong Yidong <cyd@gnu.org>
4038 * syntax.c (Fstring_to_syntax): Doc fix.
4040 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
4042 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
4043 in the internal border.
4044 (x_set_window_size): Remove static variables and their usage.
4045 (ns_redraw_scroll_bars): Fix NSTRACE arg.
4046 (ns_after_update_window_line, ns_draw_fringe_bitmap):
4047 Remove fringe/internal border adjustment (Bug#11052).
4048 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
4049 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
4050 (ns_fix_rect_ibw): Remove.
4051 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
4052 (ns_dumpglyphs_box_or_relief): Ditto.
4053 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
4055 (ns_dumpglyphs_image): Ditto.
4056 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
4058 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
4059 their usage. Add fringe_extended_p and its use as in other terms.
4060 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
4061 scroll bar was removed.
4062 (updateFrameSize): New function.
4063 (windowDidResize): Move code to updateFrameSize and call it.
4065 * nsterm.h (EmacsView): Add updateFrameSize.
4067 2012-09-07 Chong Yidong <cyd@gnu.org>
4069 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
4071 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
4073 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
4075 More signal-handler cleanup (Bug#12327).
4076 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
4077 Problem introduced when merging patches. Noted by Eli Zaretskii in
4078 <http://bugs.gnu.org/12327#67>.
4079 * floatfns.c: Comment fix.
4080 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
4081 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
4082 and anyway the declaration is harmless even if SIGDANGER is not defined.
4083 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
4084 defined BROKEN_FIONREAD). systty.h formerly did this, but other
4085 source files not surprisingly expected syssignal.h to define, or
4086 not define, SIGIO, and it's cleaner to do it that way, for consistency.
4087 Include <sys/ioctl.h>, for FIONREAD.
4088 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
4089 This eliminates a problem whereby other files mysteriously had
4090 to include "syssignal.h" before including "systty.h" if they
4091 wanted to use "#ifdef SIGIO".
4093 2012-09-07 Eli Zaretskii <eliz@gnu.org>
4095 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
4097 * w32.c (sigemptyset): Empty the set.
4098 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
4100 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
4102 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
4104 * alloc.c (mark_buffer): Revert unsafe marking optimization.
4105 (mark_object): Likewise for frame objects.
4107 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
4109 * syssignal.h (handle_on_main_thread): Always declare,
4110 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
4111 This ports to platforms without HAVE_PTHREAD.
4113 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
4115 Signal-handler cleanup (Bug#12327).
4116 Emacs's signal handlers were written in the old 4.2BSD style with
4117 sigblock and sigmask and so forth, and this led to some
4118 inefficiencies and confusion. Rewrite these to use
4119 pthread_sigmask etc. without copying signal sets around. Also,
4120 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
4121 'signal', and instead use functions that do not attempt to take
4122 over the system name space. This patch causes Emacs's text
4123 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
4124 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
4125 Do not include <signal.h> or "syssignal.h", as these
4126 modules do not use signals.
4127 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
4128 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
4129 Do not include <signal.h>, as "syssignal.h" does that for us now.
4130 * atimer.c (sigmask_atimers): New function.
4131 (block_atimers, unblock_atimers): New functions,
4132 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
4134 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
4135 no longer needed here.
4136 * emacs.c (main): Inspect existing signal handler with sigaction,
4137 so that there's no need to block and unblock SIGHUP.
4138 * sysdep.c (struct save_signal): New member 'action', replacing
4139 old member 'handler'.
4140 (save_signal_handlers, restore_signal_handlers):
4141 Use sigaction instead of 'signal' to save and restore.
4142 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
4143 New function. All users of 'signal' modified to use set_sighandler
4144 if they're writeonly, and to use sys_signal if they're read+write.
4145 (emacs_sigaction_init, forwarded_signal): New functions.
4146 (sys_signal): Remove. All uses replaced by calls to sigaction
4147 and emacs_sigaction_init, or by direct calls to 'signal'.
4148 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
4149 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
4150 all uses replaced by pthread_sigmask etc. calls.
4151 * syssignal.h: Include <signal.h>.
4152 (emacs_sigaction_init, forwarded_signal): New decls.
4153 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
4154 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
4155 (sigmask, sys_sigmask): Remove; no longer needed.
4156 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
4157 (sigblock, sigunblock, sigfree):
4158 (sigsetmask) [!defined sigsetmask]:
4159 Remove. All uses replaced by pthread_sigmask.
4160 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
4161 no longer need to be replaced, and its typical old uses
4162 are now done via emacs_sigaction_init and sigaction.
4163 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
4164 (sys_sigdel): Remove; unused.
4165 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
4167 2012-09-06 Eli Zaretskii <eliz@gnu.org>
4169 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
4170 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
4172 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
4174 Explicitly mark buffer_defaults and buffer_local_symbols.
4175 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
4176 mark_local_symbols here.
4177 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
4178 since special buffers aren't marked here any more.
4179 (allocate_buffer): Chain new buffer with all_buffers here...
4180 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
4182 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
4183 (syms_of_buffer): Remove staticpro of the above.
4184 (init_buffer_once): Set names for buffer_defaults and
4185 buffer_local_symbols.
4187 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
4189 Use bool for booleans in font-related modules.
4190 * font.c (font_intern_prop, font_style_to_value)
4191 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
4192 (generate_otf_features, font_check_otf_features, font_check_otf)
4193 (font_match_p, font_list_entities, font_at):
4194 * fontset.c (fontset_id_valid_p, reorder_font_vector
4195 (fontset_find_font, Fset_fontset_font)
4196 (face_suitable_for_char_p) [0]:
4197 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
4198 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
4199 (m17n_flt_initialized, ftfont_shape_by_flt):
4200 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
4201 * nsfont.m (nsfont_draw):
4202 * w32font.c (w32font_draw):
4203 * w32term.c (x_draw_glyphless_glyph_string_foreground):
4204 Use bool for booleans.
4205 * font.h: Adjust to above API changes.
4206 (struct font, struct font_driver, struct font_driver_list):
4207 Use bool for booleans.
4208 (struct font): Remove useless member encoding_type.
4210 * fontset.c, xftfont.c: Omit unnecessary static decls.
4212 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
4214 * alloc.c (mark_object): Revert window marking code
4215 since it's unsafe for the Fset_window_configuration.
4217 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
4219 Fix race conditions with signal handlers and errno (Bug#12327).
4220 Be more systematic about preserving errno whenever a signal
4221 handler returns, even if it's not in the main thread. Do this by
4222 renaming signal handlers to distinguish between signal delivery
4223 and signal handling. All uses changed.
4224 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
4225 * data.c (deliver_arith_signal): Rename from arith_error.
4226 * dispnew.c (deliver_window_change_signal): Rename from
4227 window_change_signal.
4228 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
4229 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
4230 * keyboard.c (deliver_input_available_signal): Rename from
4231 input_available_signal.
4232 (deliver_user_signal): Rename from handle_user_signal.
4233 (deliver_interrupt_signal): Rename from interrupt_signal.
4234 * process.c (deliver_pipe_signal): Rename from send_process_trap.
4235 (deliver_child_signal): Rename from sigchld_handler.
4236 * atimer.c (handle_alarm_signal):
4237 * data.c (handle_arith_signal):
4238 * dispnew.c (handle_window_change_signal):
4239 * emacs.c (handle_fatal_signal, handle_danger_signal):
4240 * keyboard.c (handle_input_available_signal):
4241 * keyboard.c (handle_user_signal, handle_interrupt_signal):
4242 * process.c (handle_pipe_signal, handle_child_signal):
4243 New functions, with the actual signal-handling code taken from the
4244 original respective signal handlers, sans the sporadic attempts to
4245 preserve errno, since that's now done by handle_on_main_thread.
4246 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
4247 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
4248 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
4250 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
4251 Move initialization of main_thread to sysdep.c's init_signals.
4252 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
4253 our usage, and simplifies the mainline code.
4254 (record_child_status_change): New static function, as a helper
4255 for handle_child_signal, and with most of the old child handler's
4257 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
4258 (handle_child_signal): Use the above.
4259 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
4260 Moved here from emacs.c.
4261 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
4262 code moved here from emacs.c's main function.
4263 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
4264 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
4265 This lets callers save and restore errno properly.
4267 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
4269 Remove redundant or unused things here and there.
4270 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
4271 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
4272 * editfns.c (Fcompare_buffer_substrings): Likewise.
4273 * frame.h (struct terminal, struct font_driver_list):
4274 Remove redundant declarations.
4275 * window.h (Qleft, Qright): Likewise.
4277 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
4279 Do not mark objects from deleted buffers, windows and frames.
4280 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
4281 (mark_object): Likewise for windows and frames.
4283 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
4285 * alloc.c (valid_lisp_object_p): Treat killed buffers,
4286 buffer_defaults and buffer_local_symbols as valid objects.
4287 Return special value to denote them.
4289 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
4291 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
4292 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
4293 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
4294 (file_name_absolute_p, Fsubstitute_in_file_name):
4295 (check_executable, check_writable, Ffile_accessible_directory_p)
4296 (Fset_file_selinux_context, Fdefault_file_modes)
4297 (Finsert_file_contents, choose_write_coding_system)
4298 (Fwrite_region, build_annotations, a_write, e_write)
4300 * filelock.c (boot_time_initialized, get_boot_time)
4301 (get_boot_time_1, lock_file_1, within_one_second):
4302 * floatfns.c (in_float):
4303 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
4304 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
4305 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
4306 * lisp.h (struct Lisp_Hash_Table.cmpfn):
4307 * window.c (compare_window_configurations):
4308 Use bool for booleans.
4309 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
4310 (Fdefault_file_modes): Now mode_t, not int, for modes.
4311 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
4312 (internal_delete_file): Now returns void, not a (boolean) int,
4313 since nobody was looking at the return value.
4314 * lisp.h, window.h: Adjust to above API changes.
4316 * xdisp.c (set_message): Simplify and reindent last change.
4318 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
4320 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
4322 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
4324 * eval.c (call_debugger): Make the function non-static so that we
4325 can call it from set_message.
4327 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
4328 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
4330 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
4332 Give more-useful info on a fatal error (Bug#12328).
4333 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
4334 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
4335 of doing the work ourselves.
4336 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
4337 do most of the work.
4338 (fatal_error_backtrace): New function, taken from the guts
4339 of the old fatal_error_signal, but with a new option to output
4341 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
4342 info about the signal than just its number.
4343 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
4344 * sysdep.c: Include <execinfo.h>
4345 (emacs_backtrace): New function, taken partly from the previous
4346 code of the 'die' function.
4347 (emacs_abort): Call fatal_error_backtrace rather than abort.
4349 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
4351 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
4352 eager (load-time) macro-expansion.
4353 * lisp.mk (lisp): Add macroexp.
4355 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
4357 Simplify redefinition of 'abort' (Bug#12316).
4358 Do not try to redefine the 'abort' function. Instead, redo
4359 the code so that it calls 'emacs_abort' rather than 'abort'.
4360 This removes the need for the NO_ABORT configure-time macro
4361 and makes it easier to change the abort code to do a backtrace.
4362 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
4363 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
4364 Remove; sysdep.c's emacs_abort now takes its place.
4365 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
4366 'abort' changed to use 'emacs_abort'.
4367 * msdos.c (dos_abort) [defined abort]: Remove; not used.
4368 (abort) [!defined abort]: Rename to ...
4369 (emacs_abort): ... new name.
4370 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
4371 the place of the old 'abort' in emacs.c.
4372 * w32.c, w32fns.c (abort): Do not #undef.
4373 * w32.c (emacs_abort): Rename from w32_abort.
4375 2012-09-04 Eli Zaretskii <eliz@gnu.org>
4377 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
4378 offsets[j].dv, since the y axis of the screen coordinates points
4379 down, while the y axis of the font definition coordinates points
4380 up. This fixes display of Arabic diacritics such as KASRA and
4381 KASRATAN. (Bug#11860)
4383 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
4385 Be more systematic about _setjmp vs setjmp.
4386 * alloc.c (test_setjmp, mark_stack):
4387 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
4388 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
4389 (png_load, my_error_exit, jpeg_load):
4390 * process.c (send_process_trap, send_process):
4391 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
4392 The underscored versions are up to 30x faster on some hosts.
4393 Formerly, the code used setjmp+longjmp sometimes and
4394 _setjmp+_longjmp at other times, with no particular reason to
4395 prefer setjmp+longjmp.
4397 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
4399 Fix minor problem found by static checking.
4400 * buffer.c (Fdelete_all_overlays): Return nil.
4402 2012-09-03 Martin Rudalics <rudalics@gmx.at>
4404 * buffer.c (Fdelete_all_overlays): New function.
4406 2012-09-03 Chong Yidong <cyd@gnu.org>
4408 * gtkutil.c: Add extern decl for Qxft.
4410 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
4412 * emacs.c, eval.c: Use bool for boolean.
4413 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
4414 (malloc_using_checking) [DOUG_LEA_MALLOC]:
4415 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
4416 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
4417 (main, decode_env_path, Fdaemon_initialized):
4418 * eval.c (call_debugger, Finteractive_p, interactive_p):
4419 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
4420 (maybe_call_debugger, Fbacktrace):
4421 * process.c (read_process_output, exec_sentinel):
4422 Use bool for booleans.
4423 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
4424 All callers changed.
4425 * eval.c (interactive_p): Omit always-true boolean argument
4426 EXCLUDE_SUBRS_P. All callers changed.
4427 * dispextern.h, lisp.h: Reflect above API changes.
4428 * firstfile.c (dummy): Use the address of 'main', whose signature
4429 won't change, instead of the address of 'initialize', whose
4430 signature just changed from int to bool.
4431 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
4432 * msdos.c (fatal_error_in_progress): ... from here.
4433 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
4435 (redisplay_internal, unwind_redisplay): Simply clear
4436 REDISPLAYING_P when unwinding, instead of saving its previous,
4437 always-false value and then restoring it.
4439 Clean up some extern decls.
4440 Mostly, this hoists extern decls out of .c files and into .h files.
4441 That way, we're more likely to catch errors if the interfaces change.
4442 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
4443 declare xg_mark_data.
4444 * dispextern.h (x_frame_parm_handlers):
4446 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
4447 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
4448 (Qultra_bold, Qoblique, Qitalic):
4449 Move extern decl here from .c file.
4450 * alloc.c (xg_mark_data) [USE_GTK]:
4452 * eval.c (Qlexical_binding):
4453 * fns.c (time) [!HAVE_UNISTD_H]:
4454 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
4455 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
4456 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
4457 * lread.c (Qinternal_interpreter_environment):
4458 * minibuf.c (Qbuffer):
4459 * process.c (QCfamily, QCfilter):
4460 * widget.c (free_frame_faces):
4461 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
4462 * xfont.c (x_clear_errors):
4463 * xterm.c (x_frame_parm_handlers):
4464 Remove now-redundant extern decls.
4465 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
4466 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
4468 * xfaces.c: Remove unnecessary static decls.
4469 * xterm.c (updating_frame): Remove decl of nonexistent object.
4471 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
4472 when building globals.h, as the objects that are not built on
4473 this host are not needed to compile C files on this host.
4475 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
4477 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
4479 * frame.h: Add missing prototype for x_wm_set_size_hint.
4481 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
4483 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
4484 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
4485 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
4486 (Fsubstitute_command_keys):
4487 * editfns.c (region_limit, find_field, Fconstrain_to_field)
4488 (save_excursion_save, save_excursion_restore)
4489 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
4490 (format_time_string, general_insert_function)
4491 (make_buffer_string, make_buffer_string_both)
4492 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
4493 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
4494 (copy_text, insert_1, insert_1_both, insert_from_string)
4495 (insert_from_string_before_markers, insert_from_string_1)
4496 (insert_from_buffer, insert_from_buffer_1, replace_range)
4497 (replace_range_2, del_range_1, del_range_byte, del_range_both)
4498 (del_range_2, modify_region):
4499 * intervals.c (intervals_equal, balance_possible_root_interval)
4500 (adjust_intervals_for_insertion, merge_properties_sticky)
4501 (graft_intervals_into_buffer, lookup_char_property)
4502 (adjust_for_invis_intang, set_point_both)
4503 (get_property_and_range, compare_string_intervals)
4504 (set_intervals_multibyte_1, set_intervals_multibyte):
4505 * keyboard.c (decode_timer):
4506 Use bool for boolean.
4507 * intervals.h, lisp.h, systime.h: Reflect above API changes.
4508 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
4510 2012-09-02 Chong Yidong <cyd@gnu.org>
4512 * keymap.c (push_key_description): Print M-TAB as C-M-i
4515 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
4517 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
4518 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
4519 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
4520 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
4521 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
4522 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
4523 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
4525 2012-09-01 Eli Zaretskii <eliz@gnu.org>
4527 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
4528 more than one grapheme cluster passed to the shaper: compute the
4529 offset adjustment values separately for each cluster. (Bug#11860)
4531 * image.c: Restore mistakenly removed inclusion of w32.h. Without
4532 it, GCC doesn't see prototypes of w32_delayed_load, and complains
4533 about implicit conversions from integer to pointer.
4535 2012-09-01 Daniel Colascione <dancol@dancol.org>
4537 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
4538 system used too early.
4540 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
4542 Better seed support for (random).
4543 * emacs.c (main): Call init_random.
4544 * fns.c (Frandom): Set the seed from a string argument, if given.
4545 Remove long-obsolete Gentzel cruft.
4546 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
4547 (init_random): New function.
4549 2012-09-01 Daniel Colascione <dancol@dancol.org>
4551 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
4552 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
4553 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
4554 x_wm_set_size_hint, x_query_colors, x_real_positions,
4555 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
4556 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
4557 all of which have been moved to common code.
4559 * xfaces.c: Include TERM_HEADER instead of listing all possible
4560 window-system headers.
4562 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
4565 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
4566 directly accessing frame internals.
4568 * w32font.h: Include font.h. Define syms_of_w32font and
4571 * process.c: Include TERM_HEADER instead of listing all possible
4572 window-system headers.
4574 * nsterm.h: Remove declarations now in frame.h.
4575 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
4577 * menu.c: Include TERM_HEADER instead of listing all possible
4578 window-system headers.
4580 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
4583 * keyboard.c: Include TERM_HEADER instead of listing all possible
4584 window-system headers.
4586 * image.c: Include TERM_HEADER instead of listing all possible
4587 window-system headers. Declare Vlibrary_cache when compiling for
4590 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
4591 window system declarations.
4593 * frame.h: Move common functions here: set_frame_menubar,
4594 x_set_window_size, x_sync, x_get_focus_frame,
4595 x_set_mouse_position, x_set_mouse_pixel_position,
4596 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
4597 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
4598 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
4599 x_activate_menubar, x_real_positions, x_bitmap_icon,
4600 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
4603 * frame.c: Include TERM_HEADER instead of listing all possible
4604 window-system headers.
4606 * font.c: Include TERM_HEADER instead of listing all possible
4607 window-system headers.
4609 * emacs.c: Include TERM_HEADER.
4611 * dispnew.c: Include TERM_HEADER instead of listing all possible
4612 window-system headers.
4614 * ccl.h: Include character.h.
4616 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
4617 the current window system; include in list of objects to link into
4620 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4622 Remove mark_ttys function and fix tty_display_info initialization.
4623 * lisp.h (mark_ttys): Remove prototype.
4624 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
4625 to mark_ttys because all possible values of 'top_frame' slot are
4626 the frames which are reachable from Vframe_list.
4627 * term.c (mark_ttys): Remove.
4628 (init_tty): Safely initialize 'top_frame' slot with Qnil.
4630 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4632 Change struct frame bitfields from unsigned char to unsigned.
4633 * frame.h (struct frame): Change type of 'display_preempted',
4634 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
4635 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
4636 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
4637 bitfields from unsigned char to unsigned.
4639 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4641 Remove unused member of struct x_output and struct w32_output.
4642 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
4643 * w32term.h (struct w32_output): Likewise.
4645 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
4647 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
4648 does not become zero (Bug#12234).
4650 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
4652 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
4653 for GCC 4.7.1 x86-64.
4655 2012-08-30 Glenn Morris <rgm@gnu.org>
4657 * lread.c (init_lread): For out-of-tree builds, only add the
4658 source directory's site-lisp dir to the load-path if it exists,
4659 consistent with in-tree builds. (Bug#12302)
4661 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
4663 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
4664 button_values to NULL. Call setStykeMask so dialogs get a close button.
4665 (windowShouldClose:): Set window_closed.
4666 (dealloc): New member, free button_values.
4667 (process_dialog:): Make member function. Remove window argument,
4668 replace window with self. Count buttons and allocate and store values
4670 (addButton:value:row:): value is int with the name tag. Call setTag
4671 with tag. Remove return self, declare return value as void.
4672 (addString:row:): Remove return self, declare return value as void.
4673 (addSplit): Remove return self, declare return value as void.
4674 (clicked:): Remove return self, declare return value as void.
4675 Set dialog_return to button_values[seltag]. Code formatting change.
4676 (initFromContents:isQuestion:): Adjust call to process_dialog.
4677 Code formatting change.
4678 (timeout_handler:): Set timer_fired to YES.
4679 (runDialogAt:): Set timer_fired to NO.
4680 Handle click on close button as quit.
4682 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
4683 Add window_closed and button_values. Add void as return value for
4684 add(Button|String|Split). addButton takes int instead of Lisp_Object.
4685 Add process_dialog as new member.
4687 2012-08-28 Eli Zaretskii <eliz@gnu.org>
4689 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
4690 is not one of the heaps we manage. (Bug#12242)
4692 2012-08-28 Glenn Morris <rgm@gnu.org>
4694 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
4696 2012-08-28 Martin Rudalics <rudalics@gmx.at>
4698 * window.c (Fset_window_configuration): Remove handling of
4699 auto-buffer-name window parameter. Install revision of reverted
4702 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4704 Do not allow to set major mode for a dead buffer.
4705 * buffer.c (Fset_buffer_major_mode): Signal an error
4706 if the buffer is dead.
4707 (Fother_buffer, other_buffer_safely): Remove redundant
4710 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4712 Always use set_buffer_if_live to restore original buffer at unwind.
4713 * buffer.h (record_unwind_current_buffer): New function.
4714 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
4715 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
4716 * undo.c, window.c: Adjust users.
4717 * buffer.c (set_buffer_if_live): Fix comment.
4719 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4721 Fix usage of set_buffer_internal.
4722 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
4723 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
4724 * coding.c (decode_coding): Omit redundant test.
4725 * fileio.c (decide_coding_unwind): Likewise.
4726 * fns.c (secure_hash): Likewise.
4727 * insdel.c (modify_region): Likewise.
4728 * keyboard.c (command_loop_1): Likewise.
4729 * print.c (PRINTFINISH): Likewise.
4730 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
4732 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
4734 * dispnew.c: Use bool for boolean.
4735 (frame_garbaged, display_completed, delayed_size_change)
4736 (fonts_changed_p, add_window_display_history)
4737 (add_frame_display_history, verify_row_hash)
4738 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
4739 (row_equal_p, realloc_glyph_pool)
4740 (allocate_matrices_for_frame_redisplay)
4741 (showing_window_margins_p)
4742 (adjust_frame_glyphs_for_frame_redisplay)
4743 (build_frame_matrix_from_leaf_window, make_current)
4744 (mirrored_line_dance, mirror_line_dance, update_frame)
4745 (update_window_tree, update_single_window)
4746 (check_current_matrix_flags, update_window, update_text_area)
4747 (update_window_line, set_window_update_flags, scrolling_window)
4748 (update_frame_1, scrolling, buffer_posn_from_coords)
4749 (do_pending_window_change, change_frame_size)
4750 (change_frame_size_1, sit_for):
4751 Use bool for boolean.
4752 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
4753 and remove last int (actually boolean) argument, which was always 0.
4754 All callers changed.
4755 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
4756 * dispextern.h (struct composition_it): Use bool for boolean.
4757 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
4758 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
4759 * dired.c (file_name_completion):
4760 Use bool for boolean. (This was missed in an earlier change.)
4762 2012-08-27 Martin Rudalics <rudalics@gmx.at>
4764 * window.c (Fset_window_configuration): Revert first part of
4767 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
4769 * nsterm.h (NSPanel): New class variable dialog_return.
4771 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
4772 Initialize dialog_return.
4773 (windowShouldClose:): Use stop instead of stopModalWithCode.
4774 (clicked:): Ditto, and also set dialog_return (Bug#12258).
4775 (timeout_handler:): Use stop instead of abortModal. Send a dummy
4777 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
4780 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
4782 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
4783 * composite.c (find_composition, composition_gstring_p)
4784 (composition_reseat_it, find_automatic_composition):
4785 * data.c (let_shadows_buffer_binding_p)
4786 (let_shadows_global_binding_p, set_internal, make_blv)
4787 (Fmake_variable_buffer_local, Fmake_local_variable)
4788 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
4789 (cons_to_signed, arith_driver):
4790 * dbusbind.c (xd_in_read_queued_messages):
4791 * dired.c (directory_files_internal, file_name_completion):
4792 Use bool for booleans.
4793 * dired.c (file_name_completion):
4794 * process.h (fd_callback):
4795 Omit int (actually boolean) argument. It wasn't being used.
4797 * composite.h, lisp.h: Reflect above API changes.
4799 * cmds.c, coding.c: Use bool for booleans.
4800 * cmds.c (move_point, Fself_insert_command):
4801 * coding.h (struct composition status, struct coding_system):
4802 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
4803 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
4804 (emacs_mule_char, decode_coding_emacs_mule)
4805 (encode_coding_emacs_mule, detect_coding_iso_2022)
4806 (decode_coding_iso_2022, encode_invocation_designation)
4807 (encode_designation_at_bol, encode_coding_iso_2022)
4808 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
4809 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
4810 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
4811 (encode_coding_raw_text, detect_coding_charset)
4812 (decode_coding_charset, encode_coding_charset, detect_eol)
4813 (detect_coding, get_translation_table, produce_chars)
4814 (consume_chars, reused_workbuf_in_use)
4815 (make_conversion_work_buffer, code_conversion_save)
4816 (decode_coding_object, encode_coding_object)
4817 (detect_coding_system, char_encodable_p)
4818 (Funencodable_char_position, code_convert_region)
4819 (code_convert_string, code_convert_string_norecord)
4820 (Fset_coding_system_priority):
4821 * fileio.c (Finsert_file_contents):
4822 Use bool for booleans.
4823 * coding.h, lisp.h: Reflect above API changes.
4824 * coding.c: Remove unnecessary static function decls.
4825 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
4826 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
4827 not a boolean 'int', since callers never look at the return value.
4828 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
4829 * coding.h (decoding_buffer_size, encoding_buffer_size)
4830 (emacs_mule_string_char): Remove unused extern decls.
4831 (struct iso_2022_spec, struct coding_system):
4832 Use 'unsigned int : 1' for boolean fields, since there's more than one.
4833 (struct emacs_mule_spec): Remove unused field 'full_support'.
4834 All initializations removed.
4835 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
4837 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
4839 Fix spare memory change (Bug#12286).
4840 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
4841 (valid_lisp_object_p): Likewise.
4843 2012-08-27 Martin Rudalics <rudalics@gmx.at>
4845 * window.c (Fset_window_configuration): Record any window's old
4846 buffer if it's replaced (see Bug#8789). If the new current
4847 buffer doesn't appear in the selected window, go to its old
4850 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
4852 Special MEM_TYPE_SPARE to denote reserved memory.
4853 * alloc.c (enum mem_type): New memory type.
4854 (refill_memory_reserve): Use new type for spare memory.
4855 This prevents live_cons_p and live_string_p from incorrect
4856 detection of uninitialized objects from spare memory as live.
4858 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
4861 * Makefile.in (.PHONY): versioclean -> versionclean.
4863 Remove unused external symbols.
4864 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
4865 * window.c (Qwindow_valid_p, decode_valid_window):
4866 Now static, not extern.
4867 * data.c (Qinterval): Remove; unused.
4868 (syms_of_data): Do not define 'interval'.
4869 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
4870 * window.h (decode_valid_window):
4873 * character.c, charset.c, chartab.c: Use bool for booleans.
4874 * character.c (lisp_string_width, string_count_byte8)
4875 (string_escape_byte8):
4876 * charset.c (charset_map_loaded, load_charset_map, read_hex):
4877 (load_charset_map_from_file, map_charset_chars)
4878 (Fdefine_charset_internal, define_charset_internal)
4879 (Fdeclare_equiv_charset, find_charsets_in_text)
4880 (Ffind_charset_region, char_charset, Fiso_charset):
4881 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
4882 (sub_char_table_set, sub_char_table_set_range)
4883 (char_table_set_range, optimize_sub_char_table)
4884 (map_sub_char_table):
4885 Use bool for boolean.
4886 * character.c (str_to_unibyte): Omit last boolean argument; it was
4887 always 0. All callers changed.
4888 * character.h, charset.h: Adjust to match previous changes.
4889 * character.h (char_printable_p): Remove decl of nonexistent function.
4890 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
4891 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
4892 are all boolean, so make them single-bit bitfields.
4894 * lisp.h (ASET): Remove attempt to detect side effects.
4895 It was meant to be temporary and it often doesn't work,
4896 because when IDX has side effects the behavior of IDX==IDX
4897 is undefined. See Stefan Monnier in
4898 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
4900 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
4902 * lisp.h (functionp): New function (extracted from Ffunctionp).
4903 (FUNCTIONP): Use it.
4904 * eval.c (Ffunctionp): Use it.
4906 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
4908 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
4909 as that's faster and simpler than static storage. Don't bother
4910 with the g_main_context_query overhead if g_main_context_pending
4911 says no events are pending.
4912 (gfds, gfds_size): Remove these static vars.
4913 (xgselect_initialize): Remove; no longer needed.
4914 All uses and decls removed.
4916 * emacs.c (fatal_error_signal_hook): Remove.
4917 All uses removed. This leftover from old code was always 0.
4919 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
4920 * casefiddle.c (casify_object, casify_region):
4921 * casetab.c (set_case_table):
4922 * category.c, category.h (word_boundary_p):
4923 * category.h (CHAR_HAS_CATEGORY):
4924 Use bool for booleans, instead of int.
4926 2012-08-25 Eli Zaretskii <eliz@gnu.org>
4928 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
4930 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
4932 On assertion failure, print backtrace if available.
4933 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
4934 (die) [ENABLE_CHECKING]: Print a backtrace if available.
4935 * Makefile.in (LIB_EXECINFO): New macro.
4938 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
4939 * bytecode.c (exec_byte_code):
4940 * callint.c (check_mark, Fcall_interactively):
4941 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
4942 (getenv_internal, sync_process_alive, call_process_exited):
4943 * lisp.h (USE_SAFE_ALLOCA):
4944 Use bool for booleans, instead of int.
4945 * lisp.h, process.h: Adjust prototypes to match above changes.
4946 * callint.c (Fcall_interactively): Don't assume the mark's
4947 offset fits in 'int'.
4949 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
4951 * buffer.c, buffer.h: Use bool for boolean.
4952 * buffer.c (reset_buffer_local_variables)
4953 (buffer_lisp_local_variables, Fset_buffer_modified_p)
4954 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
4955 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
4956 (overlay_touches_p, overlay_strings, Foverlay_put)
4957 (report_overlay_modification, call_overlay_mod_hooks):
4958 (mmap_enlarge, mmap_set_vars):
4959 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
4960 Use bool for booleans, instead of int.
4961 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
4962 since the 1-or-0 return value is always ignored anyway.
4963 (mmap_initialized_p):
4964 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
4965 * buffer.h, lisp.h: Adjust prototypes to match above changes.
4967 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
4969 * bidi.c: Use bool for boolean.
4970 This is a bit more readable, and makes the text segment of bidi.o
4971 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
4972 Presumably it's faster too.
4973 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
4975 (bidi_cache_find_level_change, bidi_cache_iterator_state)
4976 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
4977 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
4978 (bidi_explicit_dir_char, bidi_level_of_next_char)
4979 (bidi_find_other_level_edge, bidi_move_to_visually_next):
4980 Use bool for booleans, instead of int.
4981 * dispextern.h (bidi_init_it, bidi_paragraph_init)
4982 (bidi_unshelve_cache): Adjust decls to match code.
4984 2012-08-23 Martin Rudalics <rudalics@gmx.at>
4986 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
4989 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
4991 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
4992 * atimer.h: Include <stdbool.h>.
4994 2012-08-22 Dan Nicolaescu <dann@gnu.org>
4996 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
4997 compile time tests instead of run time tests on systems that do
4999 (FRAME_MAC_P): Remove leftover from deleted code.
5000 * frame.c (syms_of_frame): Remove leftover from deleted code.
5002 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
5004 * nsterm.m (insertText:): Don't clear modifiers if code is space.
5006 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
5008 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
5009 Otherwise, the compiler complains about (A?B:C) where B is void
5010 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
5011 (fontset_add): Return void, for FONTSET_ADD.
5013 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
5015 * alloc.c: Use bool for booleans.
5016 (gc_in_progress, abort_on_gc)
5017 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
5018 (dont_register_blocks) [GC_MALLOC_CHECK]:
5019 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
5020 (check_string_bytes, make_specified_string, memory_full)
5021 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
5022 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
5023 (mark_stack, valid_pointer_p, make_pure_string)
5024 (Fgarbage_collect, survives_gc_p, gc_sweep):
5025 Use bool for booleans, instead of int.
5026 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
5027 Remove unused local.
5028 * alloc.c (PURE_POINTER_P):
5029 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
5030 * editfns.c (Fformat):
5031 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
5033 * fns.c (sweep_weak_table):
5034 * lisp.h (suppress_checking, push_message, survives_gc_p)
5035 (make_pure_string, gc_in_progress, abort_on_gc):
5036 * lread.c (readchar, read1):
5037 * print.c (Fprin1_to_string):
5038 * xdisp.c (push_message):
5039 Use bool for booleans affected directly or indirectly by
5042 Make recently-introduced setters macros.
5043 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
5044 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
5045 (set_fontset_default, set_fontset_fallback): Rename from their
5046 upper-case counterparts, and make them functions rather than macros.
5047 This is more consistent with the other recently-introduced setters.
5048 These don't need to be inline, since they're local.
5050 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
5052 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
5053 the loop (Bug#12247).
5055 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
5057 * lisp.h (vcopy): Use memcpy rather than our own loop.
5058 This fixes a performance regression introduced by the recent
5059 addition of vcopy. This means 'vcopy' will need to be modified
5060 for a copying collector, but that's OK. Also, tighten the
5061 checking in the assertion.
5063 2012-08-21 Eli Zaretskii <eliz@gnu.org>
5065 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
5066 components for RTL text (Bug#11860). Adjust X-OFFSET of each
5067 non-base glyph for the width of the base character, according to
5068 what x_draw_composite_glyph_string_foreground expects.
5069 Generate WADJUST value according to composition_gstring_width's
5070 expectations, to produce correct width of the composed character.
5071 Reverse the sign of the DU offset produced by ScriptPlace.
5073 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
5075 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
5077 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
5079 Avoid direct writes to contents member of struct Lisp_Vector.
5080 * lisp.h (vcopy): New function to copy data into vector.
5081 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
5082 * fns.c (Ffillarray): Use ASET.
5083 * keyboard.c (timer_check_2): Use AREF and ASET.
5084 (append_tool_bar_item, Frecent_keys): Use vcopy.
5085 * lread.c (read_vector): Use ASET.
5086 * msdos.c (Frecent_doskeys): Use vcopy.
5087 * xface.c (Finternal_copy_lisp_face): Use vcopy.
5088 (Finternal_merge_in_global_face): Use ASET and vcopy.
5089 * xfont.c (xfont_list_pattern): Likewise.
5091 2012-08-21 Martin Rudalics <rudalics@gmx.at>
5093 * window.c (Fwindow_point): For the selected window always return
5094 the position of its buffer's point.
5095 (Fset_window_point): For the selected window always go in its
5096 buffer to the specified position.
5098 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
5100 Setter macros for fontsets.
5101 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
5102 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
5103 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
5106 2012-08-20 Glenn Morris <rgm@gnu.org>
5108 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
5109 Don't assume that `ln -f' works.
5111 2012-08-20 Eli Zaretskii <eliz@gnu.org>
5113 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
5114 and later about non-assignments with no effect. See discussion at
5115 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
5118 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5120 Inline setter functions for Lisp_Objects slots of struct specbinding.
5121 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
5124 2012-08-20 Martin Rudalics <rudalics@gmx.at>
5126 * window.c (select_window): Always make selected window's buffer
5129 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5131 Use AREF and ASET for docstrings of category tables.
5132 * category.h (CATEGORY_DOCSTRING): Use AREF.
5133 (SET_CATEGORY_DOCSTRING): Use ASET.
5134 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
5136 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5138 Inline setter functions for hash table members.
5139 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
5140 (set_hash_hash, set_hash_index): Rename with _slot suffix.
5141 (set_hash_key_and_value, set_hash_index, set_hash_next)
5142 (set_hash_hash): New functions.
5143 * charset.c, fns.c: Adjust users.
5145 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5147 Inline getter and setter functions for per-buffer values.
5148 * buffer.h (per_buffer_default, set_per_buffer_default)
5149 (per_buffer_value, set_per_buffer_value): New functions.
5150 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
5151 * buffer.c, data.c: Adjust users.
5153 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
5155 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
5157 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
5159 Rely on <config.h> + <unistd.h> to declare 'environ',
5160 as gnulib does this if the system doesn't.
5161 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
5162 Remove declaration. MS-Windows declares it on stdlib.h which is
5163 included by conf_post.h.
5164 * emacs.c (environ) [DOUG_LEA_MALLOC]:
5165 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
5166 * vm-limit.c: Include <unistd.h>, for 'environ'.
5168 * unexaix.c, unexcoff.c: Include "mem-limits.h".
5169 (start_of_data): Remove decl; mem-limits.h provides it.
5171 * xdisp.c (handle_invisible_prop): Make it a bit faster
5172 and avoid a gcc -Wmaybe-uninitialized diagnostic.
5174 2012-08-19 Chong Yidong <cyd@gnu.org>
5176 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
5179 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
5181 * .gdbinit: Use call instead of set when calling a function in the
5184 * data.c (set_internal): Don't use set_blv_found.
5185 (Fkill_local_variable): Likewise.
5187 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
5189 * nsfont.m (ns_ascii_average_width): Ensure the string
5190 ascii_printable is initialized with a null-terminated character
5191 array. Otherwise, it can contain undesired extra characters.
5193 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
5195 port new setting code to Sun C 5.8 2005/10/13
5196 * chartab.c, lisp.h (char_table_set, char_table_set_range):
5197 Return void, not Lisp_Object. Otherwise, the compiler
5198 complains about (A?B:C) where B is void and C is Lisp_Object
5199 when compiling CHAR_TABLE_SET, due to the recent change to
5200 the API of sub_char_table_set_contents.
5202 2012-08-18 Chong Yidong <cyd@gnu.org>
5204 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
5205 for the string case (Bug#3874).
5207 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
5209 * buffer.h (BSET): Remove (Bug#12215).
5210 Replace all uses with calls to new setter functions.
5211 (bset_bidi_paragraph_direction, bset_case_canon_table)
5212 (bset_case_eqv_table, bset_directory, bset_display_count)
5213 (bset_display_time, bset_downcase_table)
5214 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
5215 (bset_last_selected_window, bset_local_var_alist)
5216 (bset_mark_active, bset_point_before_scroll, bset_read_only)
5217 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
5219 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
5220 (bset_auto_fill_function, bset_auto_save_file_format)
5221 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
5222 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
5223 (bset_cache_long_line_scans, bset_case_fold_search)
5224 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
5225 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
5226 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
5227 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
5228 (bset_header_line_format, bset_indicate_buffer_boundaries)
5229 (bset_indicate_empty_lines, bset_invisibility_spec)
5230 (bset_left_fringe_width, bset_major_mode, bset_mark)
5231 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
5232 (bset_name, bset_overwrite_mode, bset_pt_marker)
5233 (bset_right_fringe_width, bset_save_length)
5234 (bset_scroll_bar_width, bset_scroll_down_aggressively)
5235 (bset_scroll_up_aggressively, bset_selective_display)
5236 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
5237 (bset_word_wrap, bset_zv_marker):
5238 * category.c (bset_category_table):
5239 * syntax.c (bset_syntax_table):
5240 New setter functions.
5242 * process.h (PSET): Remove (Bug#12215).
5243 Replace all uses with calls to new setter functions.
5244 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5245 (PROCESS_INLINE): New macro.
5246 (pset_childp): New setter function.
5247 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
5248 * process.c (PROCESS_INLINE):
5249 Define to EXTERN_INLINE, so that the corresponding functions
5250 are compiled into code.
5251 (pset_buffer, pset_command, pset_decode_coding_system)
5252 (pset_decoding_buf, pset_encode_coding_system)
5253 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
5254 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
5255 (pset_type, pset_write_queue): New setter functions.
5257 * window.h (WSET): Remove (Bug#12215).
5258 Replace all uses with calls to new setter functions.
5259 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5260 (WINDOW_INLINE): New macro.
5261 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
5262 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
5263 (wset_total_lines, wset_vertical_scroll_bar)
5264 (wset_window_end_pos, wset_window_end_valid)
5265 (wset_window_end_vpos): New setter functions.
5266 * window.c (WINDOW_INLINE):
5267 Define to EXTERN_INLINE, so that the corresponding functions
5268 are compiled into code.
5269 (wset_combination_limit, wset_dedicated, wset_display_table)
5270 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
5271 (wset_new_normal, wset_new_total, wset_next_buffers)
5272 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
5273 (wset_prev_buffers, wset_right_fringe_width)
5274 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
5275 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
5276 (wset_window_parameters):
5277 * xdisp.c (wset_base_line_number, wset_base_line_pos)
5278 (wset_column_number_displayed, wset_region_showing):
5279 New setter functions.
5281 * termhooks.h (TSET): Remove (Bug#12215).
5282 Replace all uses with calls to new setter functions.
5283 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5284 (TERMHOOKS_INLINE): New macro.
5285 (tset_charset_list, tset_selection_alist): New setter functions.
5286 * terminal.c (TERMHOOKS_INLINE):
5287 Define to EXTERN_INLINE, so that the corresponding functions
5288 are compiled into code.
5289 (tset_param_alist): New setter function.
5291 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
5293 * keyboard.h (KSET): Remove (Bug#12215).
5294 Replace all uses with calls to new setter functions.
5295 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5296 (KEYBOARD_INLINE): New macro.
5297 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
5298 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
5299 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
5300 New setter functions.
5301 * keyboard.c (KEYBOARD_INLINE):
5302 Define to EXTERN_INLINE, so that the corresponding functions
5303 are compiled into code.
5304 (kset_echo_string, kset_kbd_queue)
5305 (kset_keyboard_translate_table, kset_last_prefix_arg)
5306 (kset_last_repeatable_command, kset_local_function_key_map)
5307 (kset_overriding_terminal_local_map, kset_real_last_command)
5308 (kset_system_key_syms): New setter functions.
5310 * frame.h (FSET): Remove (Bug#12215).
5311 Replace all uses with calls to new setter functions.
5312 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5313 (FRAME_INLINE): New macro.
5314 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
5315 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
5316 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
5317 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
5318 (fset_param_alist, fset_root_window, fset_scroll_bars)
5319 (fset_selected_window, fset_title, fset_tool_bar_items)
5320 (fset_tool_bar_position, fset_tool_bar_window): New functions.
5321 * frame.c (FRAME_INLINE):
5322 Define to EXTERN_INLINE, so that the corresponding functions
5323 are compiled into code.
5324 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
5326 A few more naming-convention fixes for getters and setters.
5327 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
5328 and rename from buffer_overlays_set_before.
5329 (set_buffer_overlays_after): Move here from buffer.h, and rename
5330 from buffer_overlays_set_after.
5331 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
5333 (set_buffer_intervals): Rename from buffer_set_intervals.
5334 * intervals.c (set_interval_object): Move here from intervals.h,
5335 and rename from interval_set_object.
5336 (set_interval_left): Move here from intervals.h, and rename from
5338 (set_interval_right): Move here from intervals.h, and rename from
5340 (copy_interval_parent): Move here from intervals.h, and rename from
5341 interval_copy_parent.
5342 * intervals.h (set_interval_parent): Rename from interval_set_parent.
5343 (set_interval_plist): Rename from interval_set_plist.
5344 Return void, not Lisp_Object, since no caller uses the result.
5345 * lisp.h (string_intervals): Rename from string_get_intervals.
5346 (set_string_intervals): Rename from string_set_intervals.
5348 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
5349 (set_char_table_contents): Rename from char_table_set_contents.
5350 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
5351 All uses changed. See the end of
5352 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
5354 * lisp.h (CSET): Remove (Bug#12215).
5355 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
5356 (set_char_table_purpose): New functions,
5357 replacing CSET. All uses changed. For example, replace
5358 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
5359 "set_char_table_parent (char_table, parent);".
5360 The old version was confusing because it used the same name
5361 'parent' for two different things.
5363 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
5365 Functions to get and set Lisp_Object fields of buffer-local variables.
5366 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
5367 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
5368 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
5369 * data.c, eval.c, frame.c: Adjust users.
5371 2012-08-17 Chong Yidong <cyd@gnu.org>
5373 * xfaces.c (merge_face_vectors): If the target font specfies a
5374 font spec, make the font's attributes take precedence over
5375 directly-specified attributes.
5376 (merge_face_ref): Recognize :font.
5378 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
5380 Do not use memcpy for copying intervals.
5381 * intervals.c (reproduce_interval): New function.
5382 (reproduce_tree, reproduce_tree_obj): Use it.
5383 (reproduce_tree_obj): Remove prototype.
5385 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
5387 * lisp.h (duration_to_sec_usec): Remove unused decl.
5389 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
5391 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
5392 to an allocated instance of NSString, not to the class itself.
5394 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
5396 * makefile.w32-in (C_CTYPE_H): New macro.
5397 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
5398 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
5399 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
5401 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
5403 Use ASCII tests for character types.
5404 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
5406 Don't include <ctype.h>; was not needed.
5407 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
5408 * sysdep.c, xfaces.c:
5409 Include <c-ctype.h> instead of <ctype.h>.
5410 * nsterm.m: Include <c-ctype.h>.
5411 * charset.c (read_hex):
5412 * doc.c (Fsnarf_documentation):
5413 * fileio.c (IS_DRIVE) [WINDOWSNT]:
5414 (DRIVE_LETTER) [DOS_NT]:
5415 (Ffile_name_directory, Fexpand_file_name)
5416 (Fsubstitute_in_file_name):
5417 * font.c (font_parse_xlfd, font_parse_fcname):
5418 * frame.c (x_set_font_backend):
5419 * gtkutil.c (xg_get_font):
5420 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
5421 * nsimage.m (hexchar):
5422 * nsterm.m (ns_xlfd_to_fontname):
5423 * sysdep.c (system_process_attributes):
5424 * xfaces.c (hash_string_case_insensitive):
5425 Use C-locale tests instead of locale-specific tests for character
5426 types, since we want the ASCII interpretation here, not the
5427 interpretation suitable for whatever happens to be the current locale.
5429 2012-08-16 Martin Rudalics <rudalics@gmx.at>
5431 Consistently check windows for validity/liveness
5432 (Bug#11984, Bug#12025, Bug#12026).
5433 * lisp.h (CHECK_VALID_WINDOW): New macro.
5434 * window.c (decode_window): Rename to decode_live_window.
5435 (decode_valid_window, Fwindow_valid_p): New functions.
5436 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
5437 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
5438 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
5439 (Fwindow_prev_sibling, Fwindow_combination_limit)
5440 (Fset_window_combination_limit, Fwindow_use_time)
5441 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
5442 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
5443 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
5444 (Fwindow_hscroll, Fset_window_hscroll)
5445 (Fwindow_redisplay_end_trigger)
5446 (Fset_window_redisplay_end_trigger, Fwindow_edges)
5447 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
5448 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
5449 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
5450 (Fwindow_end, Fset_window_point, Fset_window_start)
5451 (Fpos_visible_in_window_p, Fwindow_line_height)
5452 (Fwindow_dedicated_p, Fset_window_dedicated_p)
5453 (Fwindow_prev_buffers, Fset_window_prev_buffers)
5454 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
5455 (Fset_window_parameter, Fwindow_display_table)
5456 (Fset_window_display_table, Fdelete_other_windows_internal)
5457 (Fset_window_buffer, Fset_window_new_total)
5458 (Fset_window_new_normal, Fdelete_window_internal)
5459 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
5460 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
5461 (Fwindow_scroll_bars): Check whether argument window is a valid or
5462 live window. Update doc-strings.
5463 (syms_of_window): New symbol Qwindow_valid_p.
5464 * keyboard.c (Fposn_at_x_y): Check whether argument
5465 frame_or_window denotes a valid window.
5467 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
5469 Fix previous char table change.
5470 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
5471 * chartab.c (optimize_sub_char_table): Likewise.
5473 2012-08-16 Chong Yidong <cyd@gnu.org>
5475 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
5477 * xfont.c (xfont_open):
5478 * xftfont.c (xftfont_open): Set the font's max_width field.
5480 * nsfont.m (nsfont_open): Similar to the Xft backend, set
5481 min_width to space_width and average_width to the average over
5482 printable ASCII characters.
5483 (ns_char_width): Code cleanup.
5484 (ns_ascii_average_width): New utility function.
5486 * font.h (struct font): Update comments.
5488 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
5490 Simple interface to set Lisp_Object fields of character tables.
5491 * lisp.h (CSET): New macro.
5492 (char_table_set_extras, char_table_set_contents)
5493 (sub_char_table_set_contents): New function.
5494 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
5495 * syntax.c: Adjust users.
5497 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
5499 * eval.c (eval_sub): Bind lexical-binding.
5500 * lread.c (Qlexical_binding): Make non-static.
5502 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
5504 * nsmenu.m (popupSession): Remove.
5505 (pop_down_menu): Remove endModalSession.
5506 (timeout_handler:): New method.
5507 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
5508 Call runModalForWindow. Check timer_fired when it returns.
5509 If not set, cancel timer and break out of loop.
5510 Otherwise loop again, with a new timeout.
5512 * nsterm.m: Include fcntl.h if present.
5513 (fd_entry, t_readfds, inNsSelect): Remove.
5514 (select_writefds, select_valid, select_timeout, selfds)
5515 (select_mutex, apploopnr): Add.
5516 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
5517 Otherwise call kbd_buffer_store_event.
5518 (ns_send_appdefined): Remove release of fd_entry.
5519 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
5520 Increment and decrement apploopnr.
5521 (ns_select): If no file descriptors, just do a NSTimer.
5522 Otherwise copy read/write masks and start select thread (fd_handler).
5523 Start main loop and wait for application defined event.
5524 Inform select thread to stop selecting after main loop is exited.
5525 (ns_term_init): Create selfds pipe and set non-blocking.
5526 Initialize select_mutex. Start the select thread (fd_handler).
5527 (fd_handler:): Loop forever, wait for info from the main thread
5528 to either start or stop selecting. When select returns, send
5529 and appdefined event.
5530 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
5531 If not call kbd_buffer_store_event.
5533 * nsterm.h (EmacsApp): fd_handler takes id argument.
5534 (EmacsDialogPanel): Add timer_fired and timeout_handler.
5536 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
5538 2012-08-15 Eli Zaretskii <eliz@gnu.org>
5540 * region-cache.c (move_cache_gap): Update gap_len using the actual
5541 growth of the boundaries array. Do not change cache_len.
5544 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
5546 Generalize and cleanup font subsystem checks.
5547 * font.h (FONT_DEBUG, font_assert): Remove.
5548 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
5549 Change font_assert to eassert. Use eassert where appropriate.
5551 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
5553 * gtkutil.c (xg_get_font): Use pango_units_to_double.
5555 2012-08-15 Chong Yidong <cyd@gnu.org>
5557 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
5558 When using the new font chooser, use gtk_font_chooser_get_font_desc to
5559 extract the font descriptor instead of just the font name.
5560 In that case, return a font spec instead of a string.
5561 (x_last_font_name): Move to this file from xfns.c.
5563 * xfns.c (Fx_select_font): The return value can also be a font
5564 spec. Move x_last_font_name management to gtkutil.c.
5566 * xfaces.c: Make font weight and style symbols non-static.
5568 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
5570 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
5573 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
5575 * alloc.c (Fgarbage_collect): Use plural form consistently.
5577 2012-08-14 Eli Zaretskii <eliz@gnu.org>
5579 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
5580 iteration through the command loop. Fixes a problem whereby mouse
5581 movements are ignored until the first mouse click.
5583 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5585 Use bool, not int, for Lisp booleans.
5586 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
5587 makes Emacs a bit smaller and presumably a bit faster.
5588 * lisp.h: Include <stdbool.h>.
5589 (struct Lisp_Boolfwd, defvar_bool):
5590 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
5591 * regex.c [!emacs]: Include <stdbool.h>.
5592 (false, true): Remove; <stdbool.h> does this for us now.
5594 2012-08-14 Chong Yidong <cyd@gnu.org>
5596 * character.c (Fcharacterp): Doc fix (Bug#12076).
5598 * data.c (Findirect_variable): Doc fix (Bug#11040).
5600 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
5602 * editfns.c (Fformat): Doc fix (Bug#12059).
5603 (Fsave_current_buffer): Doc fix (Bug#11542).
5605 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
5607 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
5610 2012-08-14 Martin Rudalics <rudalics@gmx.at>
5612 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
5613 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
5614 * minibuf.c (choose_minibuf_frame, read_minibuf):
5615 * w32fns.c (x_create_tip_frame):
5616 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
5617 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
5619 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5621 * intervals.c (offset_intervals): Remove obsolete comment.
5623 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
5625 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
5627 2012-08-14 Gergely Risko <gergely@risko.hu>
5629 * coding.c (decode_coding): Record buffer modification before
5630 disabling undo_list (Bug#11773).
5632 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
5634 Revert and cleanup some recent overlay changes.
5635 * buffer.h (enum overlay_type): Remove.
5636 (buffer_get_overlays, buffer_set_overlays): Likewise.
5637 (buffer_set_overlays_before, buffer_set_overlays_after):
5638 New function. Adjust users.
5639 (unchain_both): Add eassert.
5641 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
5643 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
5645 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5647 * gtkutil.c (xg_mark_data): Don't assume C99.
5649 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
5651 * gtkutil.c (xg_frame_tb_info): New struct.
5652 (TB_INFO_KEY): New define.
5653 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
5654 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
5655 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
5657 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
5658 is up to date. Otherwise store new data.
5659 (free_frame_tool_bar): Free xg_frame_tb_info if present.
5661 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
5663 Use KSET for write access to Lisp_Object members of struct kboard.
5664 * keyboard.h (KSET): New macro.
5665 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
5666 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
5667 * xterm.c: Adjust users.
5669 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
5671 Use BSET for write access to Lisp_Object members of struct buffer.
5672 * buffer.h (BSET): New macro.
5673 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
5674 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
5675 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
5676 * window.c, xdisp.c, xfns.c: Adjust users.
5678 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
5680 * lread.c (syms_of_lread): Initialize Vlexical_binding.
5682 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
5684 * nsterm.m (not_in_argv): New function.
5685 (application:openFile, application:openTempFile:):
5686 (application:openFileWithoutUI:, application:openFiles:): Open file
5687 if not_in_argv returns non-zero (bug#12171).
5689 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
5690 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
5691 Define for Gtk+ versions less than 3.2.
5692 (xg_get_font_name): Use those functions/macros here.
5693 Reported by Frans Oilinki <moilinki@gmail.com>.
5695 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5697 * unexmacosx.c (copy_data_segment): Copy initialized data in
5698 statically linked libraries from input file rather than memory.
5700 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
5701 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
5702 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
5704 2012-08-10 Glenn Morris <rgm@gnu.org>
5706 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
5707 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
5709 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5711 Fix last change to allow compilation with low optimization levels.
5712 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
5713 Reported by Jan Djärv <jan.h.d@swipnet.se>.
5715 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5717 Use common inline syntax in intervals.h.
5718 * intervals.h (INTERVALS_INLINE): New macro.
5719 Change all users from LISP_INLINE.
5721 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5723 Define Qnone once for all platforms.
5724 * frame.c (Qnone): Define here.
5725 (syms_of_frame): DEFSYM it.
5726 * lisp.h (Qnone): New declaration.
5727 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
5728 * xfns.c: Remove duplication. Adjust users.
5730 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5732 Remove unused macros from intervals.h.
5733 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
5734 * intervals.c: Adjust comment.
5736 2012-08-10 Eli Zaretskii <eliz@gnu.org>
5738 * w32fns.c <w32_unicode_gui>: New static variable.
5739 (globals_of_w32fns): Initialize it according to os_subtype.
5740 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
5743 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
5744 Eli Zaretskii <eliz@gnu.org>
5746 Fix bug #10299 with Unicode characters sent by customized
5747 keyboards created by MSKLC.
5748 * w32fns.c (INIT_WINDOW_CLASS): New macro.
5749 (w32_init_class): Use it to initialize the Emacs class with either
5750 ANSI or Unicode API calls.
5751 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
5753 (w32_wnd_proc): If the character code sent by WM_CHAR or
5754 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
5755 original message. Call DefWindowProcW on NT and later.
5757 2012-08-10 Glenn Morris <rgm@gnu.org>
5759 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
5761 * lisp.h (DIRECTORY_SEP): Let configure set it.
5763 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
5765 Use TSET for write access to Lisp_Object slots of struct terminal.
5766 * termhooks.h (TSET): New macro.
5767 * coding.c, terminal.c, xselect.c: Adjust users.
5769 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
5771 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
5772 the failing expression, include them in the error message.
5773 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
5774 * lisp.h (internal_condition_case_n): Update declaration.
5776 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5778 Inline functions to examine and change buffer overlays.
5779 * buffer.c (unchain_both): New function.
5780 * buffer.h (buffer_get_overlays, buffer_set_overlays):
5781 (buffer_has_overlays): New function.
5782 (enum overlay_type): New enum.
5783 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
5784 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
5786 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5788 Inline functions to examine and change buffer intervals.
5789 * alloc.c (mark_interval_tree): Remove.
5790 (MARK_INTERVAL_TREE): Simplify.
5791 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
5792 * intervals.c (buffer_balance_intervals): New function.
5793 (graft_intervals_into_buffer): Adjust indentation.
5794 (set_intervals_multibyte): Simplify.
5795 * buffer.h (BUF_INTERVALS): Remove.
5796 (buffer_get_intervals, buffer_set_intervals): New function.
5797 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
5798 * intervals.c, textprop.c: Adjust users.
5800 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5802 Inline functions to examine and change string intervals.
5803 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
5804 (string_get_intervals, string_set_intervals): New function.
5805 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
5806 * lread.c, print.c, textprop.c: Adjust users.
5808 2012-08-08 Glenn Morris <rgm@gnu.org>
5810 * lisp.mk (lisp): Remove language/persian.elc.
5812 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5815 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
5816 (NULL_INTERVAL_P): Likewise. Adjust users.
5817 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
5818 Adjust comment. Move under #if 0.
5819 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
5820 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
5822 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5824 Check total length of intervals with eassert.
5825 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
5826 * intervals.c: Change all users to eassert.
5828 2012-08-07 Eli Zaretskii <eliz@gnu.org>
5830 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
5831 Rename fields to match removal of FGET and WGET and disuse of
5832 INTERNAL_FIELD in Lisp_Cons.
5834 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5836 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
5837 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
5838 name since all xname users are fixed long time ago. Do not
5840 (set_symbol_name, set_symbol_function, set_symbol_plist):
5841 (set_symbol_next, set_overlay_plist): New function.
5842 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
5843 (struct Lisp_Overlay): Likewise.
5844 (CVAR, MVAR, SVAR): Remove.
5845 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
5846 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
5847 * xterm.c: Adjust users.
5848 * .gdbinit: Change to use name field of struct Lisp_Symbol
5851 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5853 Basic functions to set Lisp_Object and pointer slots of intervals.
5854 * intervals.h (interval_set_parent, interval_set_object):
5855 (interval_set_left, interval_set_right, interval_set_plist):
5856 (interval_copy_parent): New function.
5857 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
5858 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
5860 (INTERVAL_SIZE): Remove. Adjust users.
5861 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
5863 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5865 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
5866 * process.h (PGET): Remove.
5867 (struct Lisp_Process): Do not use INTERNAL_FIELD.
5868 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
5870 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5872 Drop WGET and revert read access to Lisp_Objects slots of struct window.
5873 * window.h (WGET): Remove.
5874 (struct window): Do not use INTERNAL_FIELD.
5875 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5876 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5877 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
5878 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
5879 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
5882 2012-08-07 Chong Yidong <cyd@gnu.org>
5884 * window.c (Fwindow_edges, Fwindow_pixel_edges)
5885 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
5886 (Fdelete_window_internal): Signal an error if the window is not on
5887 a live frame (Bug#12025).
5889 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5891 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
5892 * frame.h (FGET): Remove.
5893 (struct frame): Do not use INTERNAL_FIELD.
5894 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
5895 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
5896 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5897 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
5899 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
5901 * w32.c: Silence compiler warnings.
5902 (map_w32_filename): Remove unused variable `is_fat'.
5903 (chase_symlinks): Add parentheses around expression.
5905 2012-08-06 Glenn Morris <rgm@gnu.org>
5907 * sysdep.c: Respect BROKEN_GETWD.
5909 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
5910 Let configure handle it.
5911 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
5913 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5915 Use GCALIGNMENT where appropriate.
5916 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
5917 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
5918 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
5920 2012-08-06 Eli Zaretskii <eliz@gnu.org>
5922 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
5923 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5925 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
5927 * buffer.h (struct buffer): Revert `indirections' to a simple int;
5928 that should be sufficient for everyone.
5930 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
5932 * keyboard.c (timer_check_2): Add break so timer_check returns next
5935 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5937 Fix Windows build errors introduced after converting to WGET and WSET.
5938 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
5939 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
5941 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
5943 * nsterm.m (ns_frame_rehighlight): Use FSET.
5945 * nsmenu.m (ns_update_menubar): Use FSET.
5947 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5949 Separate read and write access to Lisp_Object slots of Lisp_Process.
5950 * process.h (PGET, PSET): New macros similar to AREF and ASET.
5951 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
5953 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5955 Separate read and write access to Lisp_Object slots of struct window.
5956 * window.h (WGET, WSET): New macros similar to AREF and ASET.
5957 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5958 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5959 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
5960 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
5961 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
5964 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5966 Fix Windows build errors introduced after converting to FGET and FSET.
5967 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
5968 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
5969 (w32_judge_scroll_bars): Change to use FSET.
5970 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
5972 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5974 Fix replacement typo.
5975 * window.c (replace_window): Set root_window instead of
5976 selected_window. This fixes a total window subsystem
5977 malfunction reported by Bastien Guerry <bzg@gnu.org>.
5979 2012-08-06 Glenn Morris <rgm@gnu.org>
5981 * lisp.mk (lisp): Add language/persian.elc.
5983 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5985 Separate read and write access to Lisp_Object slots of struct frame.
5986 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
5987 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
5988 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
5989 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5990 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
5992 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
5994 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
5996 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
5998 Generalize common compile-time constants.
5999 * lisp.h (header_size, bool_header_size, word_size): Now here.
6000 (struct Lisp_Vector): Add comment.
6001 (struct Lisp_Bool_Vector): Move up to define handy constants.
6002 (VECSIZE, PSEUDOVECSIZE): Simplify.
6003 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
6004 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
6005 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
6006 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
6007 * xfont.c, xmenu.c: Use word_size where appropriate.
6009 2012-08-05 Lawrence Mitchell <wence@gmx.li>
6011 * search.c (Freplace_match): Treat \? in the replacement text
6012 literally (Bug#8161).
6014 2012-08-05 Chong Yidong <cyd@gnu.org>
6016 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
6017 * frame.c (Vdelete_frame_functions):
6018 * emacs.c (Vkill_emacs_hook): Doc fix.
6020 2012-08-04 Eli Zaretskii <eliz@gnu.org>
6022 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
6023 --with-x-toolkit=no builds.
6024 Reported by Carsten Mattner <carstenmattner@gmail.com>.
6026 2012-08-04 Chong Yidong <cyd@gnu.org>
6028 * syntax.c (Fmodify_syntax_entry): Doc fix.
6030 2012-08-04 Eli Zaretskii <eliz@gnu.org>
6032 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
6033 * w32.c (init_environment): Change the default values of many
6034 environment variables in dflt_envvars[] to NULL, to avoid pushing
6035 them into environment when they were not already defined.
6036 Remove the code that deletes site-lisp subdirectories from the default
6037 value of EMACSLOADPATH, as it is no longer needed.
6038 (check_windows_init_file): Now external, not static.
6039 Use Vload_path as is, without adding anything, as this function is now
6040 called when Vload_path is already set up.
6042 * w32.h (check_windows_init_file): Add prototype.
6044 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
6045 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
6046 compatibility with Posix platforms.
6047 (main): Move the call to check_windows_init_file to here from
6049 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
6050 any, in the DEFALT argument into the root of the Emacs build or
6051 installation tree, as appropriate.
6053 * callproc.c (init_callproc_1): Call decode_env_path instead of
6054 doing its equivalent by hand.
6055 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
6056 the code that sets Vexec_path run on MS-Windows.
6058 * lread.c (init_lread): Add comments to #ifdef's.
6060 * msdos.c (dos_set_window_size, IT_update_begin)
6061 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
6062 instead of direct references.
6064 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
6066 Export DEFAULT_REHASH_* to GDB.
6067 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
6068 Now constants, not macros.
6070 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
6072 Remove unnecessary casts involving pointers.
6073 These casts are no longer needed now that we assume C89 or later,
6074 since they involve casting to or from void *.
6075 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
6076 (make_pure_float, make_pure_vector):
6077 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
6078 * macros.c (Fstart_kbd_macro):
6079 * menu.c (find_and_return_menu_selection):
6080 * minibuf.c (read_minibuf_noninteractive):
6081 * sysdep.c (closedir):
6082 * xdisp.c (x_produce_glyphs):
6083 * xfaces.c (compare_fonts_by_sort_order):
6084 * xfns.c (x_real_positions, select_visual):
6085 * xselect.c (x_stop_queuing_selection_requests)
6086 (x_get_window_property, x_get_window_property_as_lisp_data):
6087 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
6088 Remove unnecessary pointer casts.
6089 * alloc.c (record_xmalloc): New function.
6090 * lisp.h (record_xmalloc): New decl.
6091 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
6092 more like a function. This is because the pointer cast is not
6093 needed. All uses changed.
6094 * print.c (print_string, print_error_message): Avoid length recalc.
6096 Improve fix for macroexp crash with debugging (Bug#12118).
6097 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
6098 ARRAY_MARK_FLAG when checking subscripts, because ASET is
6099 not supposed to be invoked from the garbage collector.
6100 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
6101 (gc_aset): New function, which is like ASET but can be
6102 used in the garbage collector.
6103 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
6104 (set_hash_index): Use it instead of ASET.
6106 2012-08-03 Eli Zaretskii <eliz@gnu.org>
6108 Support symlinks on latest versions of MS-Windows.
6109 * w32.c: Include winioctl.h and aclapi.h.
6110 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
6111 (revert_to_self): Forward declarations of static functions.
6112 <static BOOL g_b_init_get_security_info>:
6113 <g_b_init_create_symbolic_link>: New static flags.
6114 (globals_of_w32): Initialize them to zero.
6115 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
6116 (map_w32_filename): Improve commentary. Simplify switch.
6117 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
6118 headers (most versions of MinGW w32api don't).
6119 (get_security_info, create_symbolic_link)
6120 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
6122 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
6123 in the argument file name.
6124 (sys_access): Call unc_volume_file_attributes only if
6125 GetFileAttributes fails with network-related error codes.
6126 (sys_rename): Diagnose renaming of a symlink when the user doesn't
6127 have the required privileges.
6128 (get_file_security_desc_by_name): Rename from
6129 get_file_security_desc.
6130 (stat_worker): New function, with most of the guts of 'stat', and
6131 with addition of handling of symlinks and support for 'lstat'.
6132 If possible, get file's attributes and security information by
6133 handle, not by name. Produce S_IFLNK bit for symlinks, when
6134 called from 'lstat'.
6135 (stat, lstat): New functions, call 'stat_worker'.
6136 (symlink, readlink, careadlinkat): Rewritten to create and resolve
6137 symlinks when the underlying filesystem supports them.
6139 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
6141 Fix macroexp crash on Windows with debugging (Bug#12118).
6142 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
6143 checking subscripts; problem introduced with the recent
6144 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
6145 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
6146 since it's used in non-static inline functions now.
6148 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
6149 Don't assume buffer size fits in 'int'. Remove unused local.
6151 Use C99-style 'extern inline' if available.
6152 * buffer.h (BUFFER_INLINE):
6153 * category.h (CATEGORY_INLINE):
6154 * character.h (CHARACTER_INLINE):
6155 * charset.h (CHARSET_INLINE):
6156 * composite.h (COMPOSITE_INLINE):
6157 * dispextern.h (DISPEXTERN_INLINE):
6158 * lisp.h (LISP_INLINE):
6159 * systime.h (SYSTIME_INLINE):
6160 New macro, replacing 'static inline' in this header.
6161 * buffer.h, category.h, character.h, charset.h, composite.h:
6162 * dispextern.h, lisp.h, systime.h:
6163 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6164 * alloc.c (LISP_INLINE):
6165 * buffer.c (BUFFER_INLINE):
6166 * category.c (CATEGORY_INLINE):
6167 * character.c (CHARACTER_INLINE):
6168 * charset.c (CHARSET_INLINE):
6169 * composite.c (COMPOSITE_INLINE):
6170 * dispnew.c (DISPEXTERN_INLINE):
6171 * sysdep.c (SYSTIME_INLINE):
6172 Define to EXTERN_INLINE, so that the corresponding functions
6173 are compiled into code.
6174 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
6175 (INLINE_HEADER_END): New macros.
6176 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
6177 since it's used in non-static inline functions now.
6178 (VALMASK) [!USE_LSB_TAG]: Likewise.
6180 2012-08-02 Glenn Morris <rgm@gnu.org>
6182 * s/: Remove empty directory.
6184 * s/ms-w32.h: Move to ../nt/inc.
6185 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
6186 Update for new ms-w32.h location.
6188 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
6191 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
6193 2012-08-02 Glenn Morris <rgm@gnu.org>
6195 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
6196 hard-coding the path separator.
6198 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
6200 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
6201 This how ASET and AREF are supposed to work, and makes
6202 it easier to think about future improvements. See
6203 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
6204 * charset.h (set_charset_attr): New function.
6205 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
6206 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
6207 (aref_addr): New function. All uses of &AREF(...) changed.
6208 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
6209 (set_hash_index): New functions. All lvalue-style uses of
6210 HASH_KEY etc. changed.
6211 * keyboard.c (set_prop): New function. All lvalue-style uses
6214 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
6216 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
6217 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
6218 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
6219 * nsfns.m (ns_set_name_as_filename): Likewise.
6220 * nsmenu.m (ns_update_menubar): Likewise.
6221 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
6223 2012-08-01 Eli Zaretskii <eliz@gnu.org>
6225 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
6226 Adapt to latest changes in field names of the corresponding Lisp
6229 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
6231 2012-08-01 Glenn Morris <rgm@gnu.org>
6233 * s/msdos.h: Remove file.
6234 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
6235 * Makefile.in (S_FILE): Remove.
6236 (config_h): Remove S_FILE.
6238 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
6240 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
6241 Remove; moved to nt/config.nt.
6243 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6245 Use INTERNAL_FIELD for conses and overlays.
6246 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
6247 Remove obsolete comment.
6249 (struct Lisp_Overlay): Use INTERNAL_FIELD.
6250 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
6252 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6254 Use INTERNAL_FIELD for symbols.
6255 * lisp.h (SVAR): New macro. Adjust users.
6256 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
6257 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
6259 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6261 Use INTERNAL_FIELD for processes.
6262 * process.h (PVAR): New macro. Adjust style.
6263 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
6264 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
6266 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6268 Use INTERNAL_FIELD for windows.
6269 * window.h (WVAR): New macro.
6270 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
6271 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
6272 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
6273 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
6274 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
6275 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
6277 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
6279 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
6281 2012-08-01 Glenn Morris <rgm@gnu.org>
6283 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
6284 Move to configure.ac.
6286 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
6288 * makefile.w32-in (CONFIG_H): Update dependencies.
6289 (CONF_POST_H): New macro.
6291 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
6293 2012-07-31 Glenn Morris <rgm@gnu.org>
6295 * Makefile.in (S_FILE): No longer set by configure.
6297 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
6299 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
6301 * process.h (NULL_DEVICE):
6302 * emacs.c (SEPCHAR):
6303 * editfns.c (USER_FULL_NAME): Let configure set them.
6305 * s/README, s/template.h: Remove files.
6307 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
6309 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
6310 Move to configure.ac.
6312 2012-07-31 Eli Zaretskii <eliz@gnu.org>
6314 * .gdbinit (xframe): Adapt to introduction of FVAR and the
6315 resulting renaming of 'struct frame' members.
6317 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
6319 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
6320 after introduction of FVAR.
6322 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
6324 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
6326 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
6327 instead of compositeToPoint.
6328 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
6330 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
6332 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
6334 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
6335 * lisp.h (INTERNAL_FIELD): New macro.
6336 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
6337 (BVAR): Change to use INTERNAL_FIELD.
6338 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
6339 (KVAR): Change to use INTERNAL_FIELD.
6340 * frame.h (FVAR): New macro.
6341 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
6342 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
6343 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
6344 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
6345 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
6347 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
6349 Miscellaneous fixes for non-default X toolkits.
6350 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
6351 * xterm.c (x_frame_of_widget): Remove redundant prototype.
6352 Move under #ifdef USE_LUCID.
6353 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
6354 definition and usage to avoid warnings.
6356 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
6358 * nsterm.m (openFiles): Fix previous checkin.
6360 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
6362 * indent.c (compute_motion): Remove unused local.
6364 2012-07-31 Glenn Morris <rgm@gnu.org>
6366 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
6368 * conf_post.h [USG5_4]:
6369 Move remaining contents of s/usg5-4-common.h here.
6370 * s/usg5-4-common.h: Remove file.
6372 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
6373 * s/irix6-5.h: Remove file.
6375 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
6376 * s/darwin.h: Remove file.
6378 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
6379 * s/hpux10-20.h: Remove file, which is now empty.
6381 2012-07-30 Glenn Morris <rgm@gnu.org>
6383 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
6384 * Makefile.in (config_h): Add conf_post.h.
6385 * makefile.w32-in (CONFIG_H): Add conf_post.h.
6387 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
6389 * nsterm.m (ns_do_open_file): New variable.
6390 (ns_term_init): Set ns_do_open_file to YES after run returns.
6391 (openFile, openTempFile, openFileWithoutUI, openFiles):
6392 Open files only if ns_do_open_file.
6394 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6396 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
6397 This no-op macro hasn't been needed for many years.
6398 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
6400 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
6401 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
6402 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
6403 gdb_make_enums_visible.
6404 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
6405 (DIRECTORY_SEP): Now a constant, not a macro.
6407 2012-07-30 Eli Zaretskii <eliz@gnu.org>
6409 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
6410 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
6412 * w32term.c <w32_keyboard_codepage>: Renamed from
6413 keyboard_codepage and now external. All users changed.
6415 * w32term.h: Add declaration of w32_keyboard_codepage.
6417 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
6418 the codepage to translate keys to Unicode. If this argument is
6419 -1, use the value returned by GetConsoleCP. All callers changed.
6421 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6423 Update .PHONY listings in makefiles.
6424 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
6425 bootstrap-clean, distclean, maintainer-clean, versioclean,
6428 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
6429 This is a bit clearer. Fix some commentary typos.
6431 2012-07-30 Glenn Morris <rgm@gnu.org>
6433 * s/netbsd.h: Let configure include signal.h if needed.
6434 Remove file, which is now empty.
6436 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
6437 Let configure set them.
6438 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
6439 No more need to undefine.
6441 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
6443 * keymap.c (Fkey_description): Don't remove 0x80 bit from
6444 non-single-byte char when adding meta modifier. (Bug#12090)
6446 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
6448 Convert safe_call to use variable number of arguments.
6449 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
6450 (safe_call2): Fix comment.
6451 * lisp.h (safe_call): Adjust prototype.
6452 * coding.c (encode_coding_object): Change to use safe_call2.
6453 * xfaces.c (merge_face_heights): Change to use safe_call1.
6455 2012-07-30 Glenn Morris <rgm@gnu.org>
6457 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
6458 does that unconditionally. Remove file, which is now empty.
6460 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
6463 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6465 Export to GDB most of lisp.h's remaining object-like macros.
6466 * lisp.h (min, max): Move earlier, because they're used earlier now.
6467 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
6468 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
6469 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
6470 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
6471 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
6472 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
6473 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
6474 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
6475 Now constants, for GDB. They need not be macros.
6476 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
6477 Now constants, for GDB, as well as macros, for static initializers.
6478 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
6479 Move to after the definition of struct Lisp_Char_Table,
6480 since the former now needs that type defined.
6481 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
6482 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
6483 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
6484 New enums, for gdb_make_enums_visible.
6485 (GLYPH_MODE_LINE_FACE): Remove; unused.
6486 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
6487 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
6488 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
6489 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
6490 enum maxargs, enum MAX_ALLOCA.
6491 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
6492 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
6493 no longer needed, now that they are done in lisp.h.
6495 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
6497 Cleanup string bytes checking.
6498 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
6499 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
6500 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
6501 (check_sblock, compact_small_strings): Simplify.
6503 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6505 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
6506 These macros are confusing and no longer need to be defined, as
6507 the enum values now suffice. All uses replaced with definiens.
6508 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
6510 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
6512 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
6513 ($(BLD)/w32console.$(O)): Update dependencies.
6515 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6517 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
6518 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
6520 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
6522 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
6524 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
6525 setting sitelisp (Bug#12010).
6527 2012-07-29 Eli Zaretskii <eliz@gnu.org>
6529 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
6531 * w32heap.c (cache_system_info):
6532 * w32.c (sys_rename):
6533 * w32proc.c (find_child_console, sys_kill): All users changed.
6535 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6537 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
6539 2012-07-29 Eli Zaretskii <eliz@gnu.org>
6541 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
6543 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6545 Cleanup statistics calculation in Fgarbage_collect.
6546 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
6547 Fix zombies percentage calculation. Simplify elapsed time calculation.
6549 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6551 Generalize marker debugging code under MARKER_DEBUG and use eassert.
6552 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
6553 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
6554 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
6555 (replace_range, replace_range_2, del_range_2): Change to eassert.
6556 * marker.c (byte_char_debug_check): Adjust style.
6558 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6560 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
6561 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
6562 long-ago-commented-out code that talks about "WIN32".
6563 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
6566 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
6568 Use Gnulib stdalign module (Bug#9772, Bug#9960).
6569 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
6570 Simplify by using alignof.
6571 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
6572 * lisp.h: Include <stdalign.h>.
6573 (GCALIGNMENT): New macro and constant.
6574 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
6575 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
6576 (stdalign): New macro, if not already defined.
6578 2012-07-28 Eli Zaretskii <eliz@gnu.org>
6580 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
6581 * w32inevt.c: Include w32inevt.h.
6582 (w32_read_console_input): New inline function, calls either
6583 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
6584 w32_console_unicode_input.
6585 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
6586 (w32_kbd_patch_key, key_event): Use the codepage returned by
6587 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
6588 (key_event): use uChar.UnicodeChar only if
6589 w32_console_unicode_input is non-zero.
6591 * w32console.c: Include w32heap.h.
6592 <w32_console_unicode_input>: New global variable.
6593 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
6594 family of Windows, zero otherwise.
6596 * w32inevt.h: Declare w32_console_unicode_input.
6598 * xdisp.c (init_iterator): Don't reference tip_frame in a build
6599 --without-x. (Bug#11742)
6601 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
6603 Adjust GDB to reflect pvec_type changes (Bug#12036).
6604 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
6605 2012-07-04 changes to pseudovector representation.
6606 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
6608 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
6610 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
6612 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
6614 2012-07-27 Eli Zaretskii <eliz@gnu.org>
6616 * alloc.c (listn): Fix the order the arguments are consed onto the
6619 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
6620 enumeration constants, as PURE and HEAP are too general, and clash
6621 with other headers and sources, such as gmalloc.c and the
6622 MS-Windows system headers. All users changed.
6624 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6626 Revert last save_excursion_save and save_excursion_restore changes.
6627 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
6628 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
6630 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6632 Fix recently-introduced typos in Windows port.
6633 Reported by Martin Rudalics <rudalics@gmx.at>.
6634 * w32.c (init_environment): Replace comma with semicolon.
6635 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
6637 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
6639 Improve GDB symbol export (Bug#12036).
6640 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
6641 arms of an 'if', not using conditional expressions; otherwise GDB
6642 complains about the types in the unevaluated arm when the argument
6643 is an integer literal.
6644 (xgetint): Simplify expression.
6645 * alloc.c (gdb_make_enums_visible): New constant. This ports to
6646 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
6647 Zaretskii in <http://bugs.gnu.org/12036#13>.
6648 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
6649 needed now that we have gdb_make_enums_visible.
6650 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
6651 (enum enum_USE_LSB_TAG):
6652 New enum types, packaging up enums that need to be exported to GDB.
6654 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6656 Utility function to make a list from specified amount of objects.
6657 * lisp.h (enum constype): New datatype.
6658 (listn): New prototype.
6659 * alloc.c (listn): New function.
6660 (Fmemory_use_count, syms_of_alloc): Use it.
6661 * buffer.c (syms_of_buffer): Likewise.
6662 * callint.c (syms_of_callint): Likewise.
6663 * charset.c (define_charset_internal): Likewise.
6664 * coding.c (syms_of_coding): Likewise.
6665 * keymap.c (syms_of_keymap): Likewise.
6666 * search.c (syms_of_search): Likewise.
6667 * syntax.c (syms_of_syntax): Likewise.
6668 * w32.c (init_environment): Likewise.
6669 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
6670 * xdisp.c (syms_of_xdisp): Likewise.
6671 * xfns.c (syms_of_xfns): Likewise.
6673 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6675 Fast save_excursion_save and save_excursion_restore.
6676 * lisp.h (struct Lisp_Excursion): New data type.
6677 (PVEC_EXCURSION): New pseudovector type.
6678 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
6679 to deal with it. Adjust comments.
6680 (init_marker, attach_marker): New prototype.
6681 (unchain_marker): Adjust prototype.
6682 * marker.c (attach_marker): Change to global.
6683 (init_marker): New function.
6684 * alloc.c (Fmake_marker, build_marker): Use it.
6685 (build_marker): More easserts.
6686 (mark_object): Handle struct Lisp_Excursion.
6687 * editfns.c (save_excursion_save, save_excursion_restore):
6688 Reimplement to use struct Lisp_Excursion. Add comments.
6690 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
6692 Fix export of symbols to GDB (Bug#12036).
6693 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
6694 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
6695 emacs.c, as this is a more-suitable home. Had this been done earlier
6696 the fix for 12036 would have avoided some of the problems noted in
6697 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
6698 would have been more obvious.
6699 * emacs.c: Do not include <verify.h>; no longer needed.
6700 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
6701 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
6702 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
6703 Remove; now done in lisp.h.
6704 * lisp.h (PUBLISH_TO_GDB): New macro.
6705 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
6706 (DATA_SEG_BITS): Use it.
6707 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
6708 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
6709 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
6710 not be usable in #if. This simplifies things.
6712 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
6714 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
6716 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
6718 Simplify export of symbols to GDB (Bug#12036).
6719 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
6720 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
6721 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
6722 Adjust to changes in lisp.h and emacs.c, by using
6723 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
6724 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
6725 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
6726 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
6727 instead of gdb_valbits.
6728 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
6729 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
6730 instead of gdb_array_mark_flag.
6731 (xboolvector): Get size from $->size, not $->header.size.
6732 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
6733 (xreload, hook-run, hookpost-run): Remove.
6734 * emacs.c: Include <verify.h>.
6735 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
6736 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
6738 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
6739 (gdb_USE_LSB_TAG): New enum constants.
6740 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
6741 Also define these as enum constants, so they're visible to GDB.
6742 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
6743 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
6744 as constants, so they're visible to GDB.
6745 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
6746 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
6747 Now enum constants, not macros, so they're visible to GDB.
6748 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
6749 more convenient now. All uses changed.
6750 (VALMASK) [USE_LSB_TAG]: Also define in this case.
6751 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
6753 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
6755 Explicitly free restriction data that are not needed anymore.
6756 * editfns.c (save_restriction_restore): Free restriction data.
6758 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
6760 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
6761 add argument, tune behavior, and adjust all callers.
6763 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
6765 Use typedef for EMACS_INT, EMACS_UINT.
6766 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
6767 than macros. This simplifies debugging in the usual case, since
6768 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
6769 and it allows expressions involving EMACS_INT casts.
6770 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
6772 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
6774 * nsterm.m (ns_read_socket): Return early if there is a modal
6777 2012-07-25 Martin Rudalics <rudalics@gmx.at>
6779 * frame.c (Fredirect_frame_focus): In doc-string don't mention
6780 that FOCUS-FRAME can be omitted.
6782 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
6784 Adjust buffer text indirection counters at the end of Fkill_buffer.
6785 * buffer.c (Fkill_buffer): Adjust indirection counters when the
6786 buffer is definitely dead. This should really fix an issue reported
6787 by Christoph Scholtes again. (Bug#12007).
6788 (init_buffer_once): Initialize indirection counters of
6789 buffer_defaults and buffer_local_symbols (for sanity and safety).
6791 2012-07-24 Eli Zaretskii <eliz@gnu.org>
6793 * xdisp.c (init_iterator): Don't compute dimensions of truncation
6794 and continuation glyphs on tooltip frames, leave them at zero.
6795 Avoids continued lines in tooltips. (Bug#11832)
6797 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
6799 Simplify copy_overlay.
6800 * buffer.c (copy_overlay): Simplify. Use build_marker.
6801 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
6803 2012-07-23 Eli Zaretskii <eliz@gnu.org>
6805 * print.c (print_object): Don't crash when a frame's name is nil
6806 or invalid. (Bug#12025)
6808 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
6809 it signals an error when a tooltip frame is being created.
6811 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
6813 Cleanup miscellaneous objects allocation and initialization.
6814 * alloc.c (allocate_misc): Change to static. Add argument to
6815 specify the subtype. Adjust comment and users.
6816 (build_overlay): New function.
6817 * buffer.c (copy_overlays, Fmake_overlay): Use it.
6818 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
6819 (allocate_misc): Remove prototype.
6820 (build_overlay): Add prototype.
6822 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
6824 Swap buffer text indirection counters in Fbuffer_swap_text.
6825 * buffer.c (Fbuffer_swap_text): Swap indirections too.
6826 This avoids crash reported by Christoph Scholtes at
6827 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
6829 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
6831 * nsmenu.m (Popdown_data): New struct.
6832 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
6834 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
6835 (initWithContentRect): Make imgView and contentView non-static
6836 and autorelease them. Also autorelease img and matrix (Bug#12005).
6837 (dealloc): Remove (Bug#12005).
6839 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
6841 Adjust consing_since_gc when objects are explicitly freed.
6842 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
6843 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
6844 (free_cons, free_misc): Subtract object size from consing_since_gc.
6846 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
6848 Simplify and cleanup markers positioning code.
6849 * marker.c (attach_marker): More useful eassert.
6850 (live_buffer, set_marker_internal): New function.
6851 (Fset_marker, set_marker_restricted): Use set_marker_internal.
6852 (set_marker_both, set_marker_restricted_both): Use live_buffer.
6854 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
6856 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
6857 as it's limited by the amount of memory, not by INT_MAX.
6859 2012-07-21 Eli Zaretskii <eliz@gnu.org>
6861 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
6862 in special-event-map. See the discussion at
6863 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
6866 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
6867 info.dwItemData. Fixes crashes on 64-bit Windows.
6868 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
6870 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
6872 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
6873 (conversationIdentifier): Return value is NSInteger.
6874 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
6876 2012-07-21 Chong Yidong <cyd@gnu.org>
6878 * window.c (decode_any_window): Signal an error if the window is
6879 on a dead frame (Bug#11984).
6881 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6883 Add indirection counting to speed up Fkill_buffer.
6884 * buffer.h (struct buffer): New member.
6885 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
6886 (Fmake_indirect_buffer): Set indirection counter to -1, increment
6887 base buffer indirection counter.
6888 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
6889 (Fkill_buffer): Adjust indirection counters as needed, don't walk
6890 through buffer list if indirection counter is 0.
6892 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6894 Extend the value returned by Fgarbage_collect with heap statistics.
6895 * alloc.c (Qheap): New symbol.
6896 (syms_of_alloc): DEFSYM it.
6897 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
6898 (Fmemory_free): Remove.
6899 (syms_of_alloc): Don't defsubr it.
6900 * buffer.c (Fcompact_buffer): Remove.
6901 (syms_of_buffer): Don't defsubr it.
6903 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6905 Make maybe_gc inline.
6906 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
6907 * lisp.h (consing_since_gc, gc_relative_threshold)
6908 (memory_full_cons_threshold): Revert declaration.
6909 (maybe_gc): Remove prototype, define as inline.
6910 * alloc.c: Remove old commented-out code.
6911 (consing_since_gc, gc_relative_threshold)
6912 (memory_full_cons_threshold): Revert to global.
6915 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6917 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
6918 * lisp.h (build_unibyte_string): New function.
6919 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
6920 * sysdep.c, w32fns.c, xfns.c: Use it.
6921 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
6922 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
6923 Adjust users accordingly.
6924 * font.h (font_open_by_name): Adjust prototype.
6926 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6928 Cleanup calls to Fgarbage_collect.
6929 * lisp.h (maybe_gc): New prototype.
6930 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
6931 Remove declarations.
6932 * alloc.c (maybe_gc): New function.
6933 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
6935 * bytecode.c (MAYBE_GC): Use maybe_gc.
6936 * eval.c (eval_sub, Ffuncall): Likewise.
6937 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
6938 to avoid dependency from auto-save feature.
6940 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
6942 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
6943 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
6944 'for_each_per_buffer_object_at'.
6945 All uses changed. It's better to use upper-case for macros that
6946 cannot be implemented as functions, to give the reader a clue
6947 that they're special.
6949 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
6951 * alloc.c (Fgarbage_collect): Tweak docstring.
6953 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6955 Tweak the value returned from Fgarbage_collect again.
6956 * alloc.c (Fgarbage_collect): New return value, as confirmed in
6957 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
6958 Adjust documentation.
6959 (total_vector_bytes): Rename to total_vector_slots, adjust
6961 (total_free_vector_bytes): Rename to total_free_vector_slots,
6963 (Qstring_bytes, Qvector_slots): New symbols.
6964 (syms_of_alloc): DEFSYM them.
6966 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6968 Buffer compaction primitive which may be used from Lisp.
6969 * buffer.c (compact_buffer, Fcompact_buffer): New function.
6970 (syms_of_buffer): Register Fcompact_buffer.
6971 * alloc.c (Fgarbage_collect): Use compact_buffer.
6972 * buffer.h (compact_buffer): New prototype.
6973 (struct buffer_text): New member.
6975 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6977 New macro to iterate over all buffers, miscellaneous cleanups.
6978 * lisp.h (all_buffers): Remove declaration.
6979 * buffer.h (all_buffers): Add declaration, with comment.
6980 (for_each_buffer): New macro.
6981 * alloc.c (Fgarbage_collect, mark_object): Use it.
6982 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
6983 (init_buffer): Likewise.
6984 * data.c (Fset_default): Likewise.
6985 * coding.c (code_conversion_restore): Remove redundant check
6987 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
6989 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
6991 Fix bug that created negative-length intervals.
6992 * intervals.c (merge_interval_right, merge_interval_left):
6993 Do not zero out this interval if it is absorbed by its children,
6994 as this interval's total length doesn't change in that case. See
6995 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
6997 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
6999 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
7000 when invoking (make-bool-vector N t) and N is a positive
7001 multiple of 8 -- the last 8 bits were mistakenly cleared.
7003 Remove some struct layout assumptions in bool vectors.
7004 * alloc.c (bool_header_size): New constant.
7005 (header_size, word_size): Move earlier, as they're now used earlier.
7006 Use 'word_size' in a few more places, where it's appropriate.
7007 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
7008 padding before the data member of a bool vector.
7009 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
7010 than doing the check by hand with an abort ().
7012 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
7014 * eval.c (Fdefvar): Don't check constants since we only set the var if
7015 it's not yet defined anyway (bug#11904).
7017 * lisp.h (last_undo_boundary): Declare new var.
7018 * keyboard.c (command_loop_1): Set it.
7019 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
7020 were auto-added by the command loop (bug#11774).
7022 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
7024 * w32font.c (Qsymbol): Remove local definition.
7025 (syms_of_w32font): Don't DEFSYM it.
7027 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
7029 Fix sweep_vectors to handle large bool vectors correctly.
7030 * alloc.c (sweep_vectors): Account total_vector_bytes for
7031 bool vectors larger than VBLOCK_BYTES_MAX.
7033 2012-07-18 Chong Yidong <cyd@gnu.org>
7035 * frame.c (x_set_frame_parameters): Revert bogus change introduced
7036 in 2012-05-25 commit by Paul Eggert (Bug#11738).
7038 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
7040 Return more descriptive data from Fgarbage_collect.
7041 Suggested by Stefan Monnier in
7042 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
7043 * alloc.c (bounded_number): New function.
7044 (total_buffers, total_vectors): New variable.
7045 (total_string_size): Rename to total_string_bytes, adjust users.
7046 (total_vector_size): Rename to total_vector_bytes, adjust users.
7047 (sweep_vectors): Account total_vectors and total_vector_bytes.
7048 (Fgarbage_collect): New return value. Adjust documentation.
7049 (gc_sweep): Account total_buffers.
7050 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
7051 (VECTOR_SIZE): Remove.
7052 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
7053 (Qinterval, Qmisc): New symbols.
7054 (syms_of_data): Initialize them.
7055 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
7056 (Qcons, Qbuffer): New declarations.
7058 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
7060 * alloc.c (Fmemory_free): Account for memory-free's own storage.
7061 Round up, not down. Improve doc.
7063 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7065 Restore old code in allocate_string_data to avoid Faset breakage.
7066 Reported by Julien Danjou <julien@danjou.info> in
7067 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
7068 * alloc.c (allocate_string_data): Restore old code with minor
7069 adjustments, fix comment to explain this subtle issue.
7071 2012-07-17 Eli Zaretskii <eliz@gnu.org>
7073 Remove FILE_SYSTEM_CASE.
7074 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
7076 * fileio.c (FILE_SYSTEM_CASE): Don't define.
7077 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
7078 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
7079 call-process-region passes it through expand-file-name.
7081 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
7083 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
7085 Fix crash when creating indirect buffer (Bug#11917)
7086 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
7087 Don't handle unbound variables specially if non-zero.
7088 (Fbuffer_local_variables): Pass zero.
7089 (clone_per_buffer_values): Pass non-zero.
7091 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
7093 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
7094 to make the loop interruptible.
7096 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
7098 * gnutls.c (emacs_gnutls_handshake): Only retry if
7099 GNUTLS_E_INTERRUPTED.
7101 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7103 Cleanup and convert miscellaneous checks to eassert.
7104 * alloc.c (mark_interval): Fix comment, partially rephrase
7105 old comment from intervals.h (see below).
7106 * intervals.c (find_interval, adjust_intervals_for_insertion)
7107 (delete_interval, adjust_intervals_for_deletion)
7108 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
7110 (adjust_intervals_for_insertion, make_new_interval):
7111 Remove obsolete and unused code.
7112 * intervals.h (struct interval): Remove obsolete comment.
7113 * textprotp.c (erase_properties): Remove unused code.
7114 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
7115 (Fremove_list_of_text_properties): Convert to eassert.
7117 2012-07-17 Chong Yidong <cyd@gnu.org>
7119 * editfns.c (Finsert_char): Doc fix.
7121 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7123 Fix previous change to make Fmemory_free always accurate.
7124 * alloc.c (make_interval): Update total_free_intervals.
7125 (make_float): Likewise for total_free_floats.
7126 (free_cons, Fcons): Likewise for total_free_conses.
7127 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
7128 Likewise for total_free_vector_bytes.
7129 (Fmake_symbol): Likewise for total_free_symbols.
7130 (bytes_free): Remove.
7132 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7134 Simple free memory accounting feature.
7135 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
7136 (sweep_vectors): Accumulate size of free vectors.
7137 (Fgarbage_collect): Setup bytes_free.
7138 (Fmemory_free): New function.
7139 (syms_of_alloc): Register it.
7141 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7143 Cleanup overlays checking.
7144 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
7145 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
7146 eassert and OVERLAYP.
7147 (sort_overlays): Change to use OVERLAYP.
7149 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
7151 * editfns.c (Finsert_char): Make it interactive, and make the
7152 second arg optional. Copy interactive spec and docstring from
7155 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
7157 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
7158 Unlike the other wrapped functions, fabs has an unspecified
7161 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
7163 * nsterm.m (keyDown): Interpret flags without left/right bits
7164 as the left key (Bug#11670).
7166 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
7168 Remove empty and useless init functions.
7169 * lisp.h (init_character_once, init_fns, init_image)
7170 (init_filelock, init_sound): Remove prototype.
7171 * character.c (init_character_once): Remove.
7172 * filelock.c (init_filelock): Likewise.
7173 * fns.c (init_fns): Likewise.
7174 * image.c (init_image): Likewise.
7175 * sound.c (init_sound): Likewise.
7176 * emacs.c (main): Adjust accordingly.
7178 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
7180 * gtkutil.h: Tiny cleanups.
7181 (use_old_gtk_file_dialog): Remove useless declaration.
7182 (xg_uses_old_file_dialog): Add suggested const attribute.
7184 2012-07-15 Eli Zaretskii <eliz@gnu.org>
7186 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
7187 (bidi_paragraph_init): Use it to limit search forward for a strong
7188 directional character in abnormally large paragraphs full of
7189 neutral or weak characters. (Bug#11943)
7191 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
7193 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
7194 the toolbar (Bug#9451).
7195 (xg_make_tool_item): Give the widget event box a transparent
7198 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
7200 Cleanup basic allocation variables and functions.
7201 * alloc.c (ignore_warnings, init_intervals, init_float)
7202 (init_cons, init_symbol, init_marker): Remove.
7203 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
7204 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
7205 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
7206 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
7207 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
7208 (staticidx, init_alloc_once, init_strings, free_ablock):
7209 Remove redundant initialization.
7210 * fns.c (init_weak_hash_tables): Remove.
7211 * lisp.h (init_weak_hash_tables): Remove prototype.
7213 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
7215 Use zero_vector where appropriate.
7216 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
7218 * lisp.h (zero_vector): New declaration.
7219 * font.c (null_vector): Remove.
7220 (syms_of_font): Remove initialization and staticpro.
7221 (font_list_entities, font_find_for_lface): Change to use zero_vector.
7222 * keymap.c (Faccessible_keymaps): Likewise.
7224 2012-07-15 Leo Liu <sdl.web@gmail.com>
7226 * fringe.c: Fix typo in comments.
7228 2012-07-14 Leo Liu <sdl.web@gmail.com>
7230 * fringe.c: Add a new bitmap exclamation-mark.
7232 2012-07-14 Eli Zaretskii <eliz@gnu.org>
7234 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
7236 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
7237 (HAVE_MENUS): Don't define, defined by editing config.in with
7239 (GMALLOC_INHIBIT_VALLOC): Don't define.
7240 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
7242 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
7244 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
7246 2012-07-14 Glenn Morris <rgm@gnu.org>
7248 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
7249 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
7250 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
7252 2012-07-13 Glenn Morris <rgm@gnu.org>
7254 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
7256 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
7257 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
7259 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
7261 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
7262 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
7263 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
7264 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
7266 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
7267 as boolean expression.
7268 (x_set_window_size): Remove unused variable toolbar.
7269 (ns_get_color_default, ns_mod_to_lisp): Remove.
7270 (ns_mouse_position): Remove unused variables xchar and ychar.
7271 (ns_compute_glyph_string_overhangs): Remove unused variable face.
7272 (ns_set_vertical_scroll_bar): Remove unused variable count.
7273 (ns_delete_terminal): Remove unused variable i.
7274 (ns_term_init): Remove unused variables r, g and b.
7275 (mouseDown): Remove unused variable window.
7276 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
7277 (initFrameFromEmacs): Remove unused variable vbextra.
7278 (mouseEntered): Remove unused variables p and dpyinfo.
7279 (mouseExited): Remove unused variables p and r.
7280 (ns_define_frame_cursor, ns_clear_frame_area)
7281 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
7282 (menuDown): Assign [sender tag] to variable and cast the variable.
7284 * nsterm.h (menuDown): Add id as type to argument sender.
7285 (ns_display_info_for_name): Add Lisp_Object argument.
7286 (ns_term_init): Add Lisp_Object argument.
7287 (ns_map_event_to_object): Add void argument.
7288 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
7289 prototype with arguments and only declare if __OBJC__.
7290 (nxatoms_of_nsselect): Add void argument.
7291 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
7292 (ns_alloc_autorelease_pool): Add void argument.
7293 (ns_release_autorelease_pool): Add void* argument.
7294 (ns_get_defaults_value): Add const char* argument.
7296 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
7297 (initFromContents): Use SSDATA where appropriate.
7298 (ns_update_menubar): Add braces to ambigous if-else.
7299 (initWithTitle): Put () around assignment in if statement.
7300 (ns_menu_show): Remove unused variables window and keymap.
7301 (update_frame_tool_bar): Remove unused variable selected_p.
7302 (initWithContentRect): Remove unused variable this_cmd_name.
7304 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
7306 (setXBMColor): Remove unused variable len.
7307 (setPixmapData): Put () around assignment in loop statement.
7309 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
7310 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
7312 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
7313 around assignment in loop statement.
7314 (nsfont_open): Remove unused variable i.
7315 (nsfont_open): Remove unused variable len.
7316 (nsfont_draw): Remove unused variable cs.
7318 * nsfns.m (x_set_icon_name, ns_set_name_internal)
7319 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
7320 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
7321 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
7322 (Fns_font_name, Fns_perform_service)
7323 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
7324 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
7325 (ns_set_name): Remove unused variable view.
7326 (x_set_menu_bar_lines): Remove unused variable olines.
7327 (x_set_tool_bar_lines): Remove unused variable root_window.
7328 (Fns_list_colors): Put () around assignment in while statement.
7329 (Fns_perform_service): Remove unused variable len.
7330 (Fns_display_usable_bounds): Remove unused variable top.
7331 (syms_of_nsfns): Remove unused variable i.
7333 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
7336 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
7338 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
7339 and free it with DestroyExceptionInfo (Bug#11558).
7341 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
7343 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
7344 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
7345 Set here, not in nt/config.nt.
7347 2012-07-13 Eli Zaretskii <eliz@gnu.org>
7349 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
7350 cursor overflow into the last glyph on display line when the right
7351 fringe is off. (Bug#11832)
7353 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
7355 * xdisp.c (produce_special_glyphs): Now static.
7356 * dispextern.h (produce_special_glyphs): Remove decl.
7358 2012-07-13 Glenn Morris <rgm@gnu.org>
7360 * s/bsd-common.h, s/cygwin.h: Remove empty files.
7361 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
7363 * s/usg5-4-common.h (USG, USG5):
7364 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
7365 * s/sol2-6.h (SOLARIS2):
7366 * s/irix6-5.h (IRIX6_5):
7367 * s/hpux10-20.h (USG, USG5, HPUX):
7368 * s/gnu-linux.h (USG, GNU_LINUX):
7369 * s/freebsd.h (BSD_SYSTEM):
7370 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
7371 * s/cygwin.h (CYGWIN):
7372 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
7373 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
7375 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
7377 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
7379 2012-07-13 Glenn Morris <rgm@gnu.org>
7381 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
7383 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
7385 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
7386 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
7388 2012-07-12 Glenn Morris <rgm@gnu.org>
7390 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
7392 * process.c (init_process_emacs): Rename from init_process.
7393 The old name is also the name of a Mach system call.
7394 * lisp.h, emacs.c: Update for this name change.
7395 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
7398 2012-07-12 Eli Zaretskii <eliz@gnu.org>
7400 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
7401 memmove call that removes glyphs covered by the left truncation
7402 glyph. Improve commentary.
7403 (display_line): Fix display of continuation glyphs on GUI frames
7404 when the right fringe is turned off and variable-size fonts are
7405 used in the window. Move the code that appends a stretch glyph to
7406 produce_special_glyphs, so that it could be used for truncation
7407 and continuation glyphs alike.
7408 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
7409 glyph of a suitably computed width, to align the special glyphs at
7410 the window margin. Code moved from display_line. (Bug#11832)
7412 2012-07-12 Glenn Morris <rgm@gnu.org>
7414 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
7416 * s/gnu-linux.h, s/hpux10-20.h:
7417 Do not unconditionally define HAVE_XRMSETDATABASE.
7419 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
7421 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
7423 Fix typos that broke OS X build.
7424 Reported by Randal L. Schwartz in
7425 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
7426 * nsterm.m (ns_timeout): Add missing local decl.
7427 (ns_get_color): snprintf -> sprintf, to fix typo.
7429 2012-07-12 Glenn Morris <rgm@gnu.org>
7431 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
7432 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
7433 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
7434 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
7436 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
7437 Move PTY_OPEN to configure.
7439 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7440 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
7441 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
7443 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
7445 Use empty_unibyte_string where applicable.
7446 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
7447 * lread.c (read1): Likewise.
7448 * xsettings.c (syms_of_xsettings): Likewise.
7450 2012-07-12 Glenn Morris <rgm@gnu.org>
7452 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
7453 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7454 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
7455 * s/hpux10-20.h (RUN_TIME_REMAP):
7456 * s/bsd-common.h (TABDLY): Move to configure.
7458 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
7460 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
7462 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7463 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
7465 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
7467 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
7468 * s/template.h: Move NARROWPROTO to configure.
7470 2012-07-11 Glenn Morris <rgm@gnu.org>
7472 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
7473 unused since 2011-01-17 change to systty.h.
7475 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
7476 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
7477 Move HAVE_PTYS and HAVE_SOCKETS to configure.
7479 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
7481 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
7483 2012-07-11 Glenn Morris <rgm@gnu.org>
7485 * s/darwin.h, s/gnu-linux.h, s/template.h:
7486 Move INTERRUPT_INPUT to configure.
7488 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7490 Minor adjustments to interning code.
7491 * lisp.h (intern, intern_c_string): Redefine as static inline
7492 wrappers for intern_1 and intern_c_string_1, respectively.
7493 (intern_1, intern_c_string_1): Rename prototypes.
7494 * lread.c (intern_1, intern_c_string_1, oblookup):
7495 Simplify Vobarray checking.
7496 * font.c (font_intern_prop): Likewise. Adjust comment.
7497 * w32font.c (intern_font_name): Likewise.
7499 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
7501 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
7503 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
7504 of Fcar/Fcdr if possible.
7505 * font.c (check_otf_features): Likewise.
7506 * fontset.c (Fnew_fontset): Likewise.
7507 * gnutls.c (Fgnutls_boot): Likewise.
7508 * minibuf.c (read_minibuf): Likewise.
7509 * msdos.c (IT_set_frame_parameters): Likewise.
7510 * xmenu.c (Fx_popup_dialog): Likewise.
7511 * w32menu.c (Fx_popup_dialog): Likewise.
7513 2012-07-11 Glenn Morris <rgm@gnu.org>
7515 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
7516 since nothing has defined it on these platforms.
7518 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
7519 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
7521 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7522 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
7523 Move CLASH_DETECTION to configure.
7525 * s/gnu.h: Remove file, which is now empty.
7527 * s/gnu.h, s/gnu-linux.h:
7528 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
7530 2012-07-11 John Wiegley <johnw@newartisans.com>
7532 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
7533 function attribute, so we only use it if it exists in the
7536 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7538 Avoid call to strlen in fast_c_string_match_ignore_case.
7539 * search.c (fast_c_string_match_ignore_case): Change to use
7540 length argument. Adjust users accordingly.
7541 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
7543 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
7545 Assume mkdir, rmdir.
7546 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
7547 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
7550 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
7553 * s/hpux10-20.h (HAVE_PERROR): Remove.
7554 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
7555 Remove dummy definition, as this problem was obsolete long ago.
7558 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
7560 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7562 Avoid calls to strlen in font processing functions.
7563 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
7564 (font_open_by_name): Change to use length argument.
7565 Adjust users accordingly.
7566 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
7568 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
7569 Change to return ptrdiff_t.
7570 (xfont_list_pattern, xfont_match): Use length returned by
7571 xfont_decode_coding_xlfd.
7572 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
7574 2012-07-11 Glenn Morris <rgm@gnu.org>
7576 * s/darwin.h, s/freebsd.h, s/netbsd.h:
7577 Move DONT_REOPEN_PTY to configure.
7579 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
7580 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
7582 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
7584 Remove "#define unix" that is no longer needed (Bug#11905).
7585 * s/aix4-2.h (unix): Remove; no longer needed.
7587 EMACS_TIME simplification (Bug#11875).
7588 This replaces macros (which typically do not work in GDB)
7589 with functions, typedefs and enums, making the code easier to debug.
7590 The functional style also makes code easier to read and maintain.
7591 * systime.h: Include <sys/time.h> on all hosts, not just if
7592 WINDOWSNT, since 'struct timeval' is needed in general.
7593 (EMACS_TIME): Now a typedef, not a macro.
7594 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
7596 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
7597 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
7598 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
7599 (EMACS_TIME_LE): Now functions, not macros.
7600 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
7601 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
7602 which are not functions. All uses rewritten to use:
7603 (make_emacs_time): New function.
7604 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
7605 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
7606 not functions. All uses rewritten to use the following, respectively:
7607 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
7608 (add_emacs_time, sub_emacs_time): New functions.
7609 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
7610 * fileio.c (Fcopy_file):
7611 * xterm.c (XTflash): Get the current time closer to when it's used.
7612 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
7614 * bytecode.c (targets): Suppress -Woverride-init warnings.
7616 Simplify by avoiding confusing use of strncpy etc.
7617 * doc.c (Fsnarf_documentation):
7618 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
7619 * frame.c (Fmake_terminal_frame):
7620 * gtkutil.c (get_utf8_string):
7622 * nsmenu.m (ns_update_menubar):
7623 * regex.c (regerror):
7624 Prefer memcpy to strncpy and strncat when either will do.
7625 * fileio.c (Fsubstitute_in_file_name):
7626 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
7627 (menu_separator_name_p):
7628 * nsmenu.m (ns_update_menubar):
7629 Prefer memcmp to strncmp when either will do.
7630 * nsterm.m: Include <ftoastr.h>.
7632 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
7633 Prefer snprintf to strncpy.
7634 * nsterm.m (ns_term_init):
7635 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
7636 * nsterm.m (ns_term_init):
7637 Avoid the need for strncpy, by using build_string or
7638 make_unibyte_string directly. Use dtoastr, not snprintf.
7639 * process.c (Fmake_network_process): Diagnose service names that
7640 are too long, rather than silently truncating them or creating
7641 non-null-terminated names.
7642 (Fnetwork_interface_info): Likewise, for interface names.
7643 * sysdep.c (system_process_attributes) [GNU_LINUX]:
7644 Prefer sprintf to strncat.
7645 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
7646 Prefer vsnprintf to vsprintf + strncpy.
7648 2012-07-10 Glenn Morris <rgm@gnu.org>
7650 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
7651 Clarify fallback case.
7653 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7655 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
7656 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
7657 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
7658 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7659 where argument type is known to be a Lisp_Cons.
7661 2012-07-10 Tom Tromey <tromey@redhat.com>
7663 * bytecode.c (BYTE_CODE_THREADED): New macro.
7664 (BYTE_CODES): New macro. Replaces all old byte-code defines.
7665 (enum byte_code_op): New type.
7666 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
7667 (exec_byte_code): Use them. Use token threading when applicable.
7669 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7671 Optimize pure C strings initialization.
7672 * lisp.h (make_pure_string): Fix prototype.
7673 (build_pure_c_string): New function, defined as static inline. This
7674 provides a better opportunity to optimize away calls to strlen when
7675 the function is called with compile-time constant argument.
7676 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
7677 argument, adjust users accordingly. Use build_pure_c_string where
7679 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
7680 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
7681 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
7683 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7685 Avoid calls to strlen in miscellaneous functions.
7686 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
7687 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
7688 * lread.c (openp): Likewise.
7690 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7692 Avoid calls to strlen in path processing functions.
7693 * fileio.c (file_name_as_directory): Add comment. Change to add
7694 srclen argument and return the length of result. Adjust users
7696 (directory_file_name): Fix comment. Change to add srclen argument,
7697 swap 1st and 2nd arguments to obey the common convention.
7698 Adjust users accordingly.
7699 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
7701 2012-07-10 Glenn Morris <rgm@gnu.org>
7703 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
7704 Move PENDING_OUTPUT_COUNT definition to configure.
7706 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
7707 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
7708 * s/gnu.h (DATA_START): Move definitions to configure.
7710 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
7711 We include usg5-4-common.h, which defines them both.
7713 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
7714 O_RDONLY already includes it).
7716 Stop ns builds setting the EMACSLOADPATH environment variable.
7717 * nsterm.m (ns_load_path): Rename from ns_init_paths.
7718 Now it does not set EMACSLOADPATH, just returns the load-path string.
7719 * nsterm.h: Update accordingly.
7720 * lread.c [HAVE_NS]: Include nsterm.h.
7721 (init_lread) [HAVE_NS]: Use ns_load_path.
7722 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
7724 2012-07-09 Glenn Morris <rgm@gnu.org>
7726 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
7727 since the included bsd-common.h does so.
7729 Stop ns builds setting the EMACSPATH environment variable.
7730 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
7731 (ns_init_paths): Do not set EMACSPATH.
7732 * nsterm.h (ns_exec_path): Add it.
7733 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
7736 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
7738 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
7740 * process.c (wait_reading_process_output): 'waitchannels' was unset
7741 when read_kbd || !NILP (wait_for_cell); fix this.
7743 Add GCC-style 'const' attribute to functions that can use it.
7744 * character.h (char_resolve_modifier_mask):
7745 * keyboard.h (make_ctrl_char):
7746 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
7747 (init_character_once, next_almost_prime, init_fns, init_image)
7748 (flush_pending_output, init_sound):
7749 * mem-limits.h (start_of_data):
7750 * menu.h (finish_menu_items):
7751 Add ATTRIBUTE_CONST.
7752 * emacs.c (DEFINE_DUMMY_FUNCTION):
7753 Declare the dummy function with ATTRIBUTE_CONST.
7754 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
7755 Add decls with ATTRIBUTE_CONST.
7757 Minor improvements to make_formatted_string.
7758 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
7759 where int is good enough, as vsprintf returns an int.
7760 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
7762 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
7764 Use make_formatted_string to avoid double length calculation.
7765 * lisp.h (make_formatted_string): New prototype.
7766 * alloc.c (make_formatted_string): New function.
7767 * buffer.c (Fgenerate_new_buffer_name): Use it.
7768 * dbusbind.c (syms_of_dbusbind): Likewise.
7769 * editfns.c (Fcurrent_time_zone): Likewise.
7770 * filelock.c (get_boot_time): Likewise.
7771 * frame.c (make_terminal_frame, set_term_frame_name)
7772 (x_report_frame_params): Likewise.
7773 * image.c (gs_load): Likewise.
7774 * minibuf.c (get_minibuffer): Likewise.
7775 * msdos.c (dos_set_window_size): Likewise.
7776 * process.c (make_process): Likewise.
7777 * xdisp.c (ensure_echo_area_buffers): Likewise.
7778 * xsettings.c (apply_xft_settings): Likewise.
7780 2012-07-09 Glenn Morris <rgm@gnu.org>
7782 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
7783 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
7784 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
7785 * nsterm.h (ns_etc_directory): Add it.
7786 * callproc.c [HAVE_NS]: Include nsterm.h.
7787 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
7789 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
7791 Move marker debugging code under MARKER_DEBUG.
7792 * marker.c (MARKER_DEBUG): Move marker debugging code under
7793 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
7794 for bootstrap with --enable-checking (~3x slowdown reported
7795 by Juanma Barranquero <lekktu@gmail.com>).
7796 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
7798 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
7800 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
7801 See <http://bugs.gnu.org/11825#29>.
7803 2012-07-08 Eli Zaretskii <eliz@gnu.org>
7805 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
7806 has no font, use the frame's font. (Bug#11813)
7807 (display_line): Add commentary about displaying truncation glyphs
7809 (produce_special_glyphs): Move here from term.c.
7811 * term.c (produce_special_glyphs): Move to xdisp.c.
7813 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
7816 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
7818 * xdisp.c (display_line): Avoid warning about implicit declaration
7821 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
7823 * lisp.h: Remove empty conditional.
7825 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
7827 * lread.c (load_path_check): Now static.
7829 Fix some minor --with-ns problems found by static checking.
7830 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
7831 (x_set_font) [!HAVE_X_WINDOWS]:
7832 * image.c (xpm_load_image) [HAVE_NS]:
7833 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
7834 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
7835 Remove unused local.
7836 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
7837 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
7838 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
7839 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
7840 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
7841 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
7842 Fix pointer signedness problem.
7843 * xfaces.c (FRAME_X_FONT_TABLE):
7844 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
7846 2012-07-07 Glenn Morris <rgm@gnu.org>
7848 * lread.c (load_path_check): New function, split from init_lread.
7849 (init_lread): Reorganize. Motivation:
7850 If EMACSLOADPATH is set, check/warn about that rather than the
7851 defaults, which we are not going to use. Hence we can remove
7852 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
7853 Don't warn if site-lisp directories are missing.
7854 If not installed, start from a blank load-path, since
7855 PATH_LOADSEARCH refers to the eventual installation directories.
7857 2012-07-07 Eli Zaretskii <eliz@gnu.org>
7859 Support truncation and continuation glyphs on GUI frames, when
7860 fringes are disabled. (Bug#11832)
7861 * xdisp.c (init_iterator): Get dimensions of truncation and
7862 continuation glyphs even if on GUI frames.
7863 Adjust it->last_visible_x on GUI frames when the left or right fringes,
7864 or both, are absent.
7865 (start_display, move_it_in_display_line_to): Handle the case of a
7866 GUI frame without a fringe to display continuation or truncation
7868 (insert_left_trunc_glyphs): Support GUI frames: make sure
7869 truncation glyphs overwrite enough glyphs from the current line to
7870 have sufficient space in pixels.
7871 (display_line): Support truncation and continuation glyphs on GUI
7872 frames. If some spare pixels are left on the line after inserting
7873 the truncation glyphs, fill that space with a stretch glyph of a
7874 suitably computed width.
7876 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
7877 produce_glyphs, to support GUI sessions.
7879 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
7881 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
7883 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
7885 Do not require float-time's arg to fit in time_t (Bug#11825).
7886 This works better on hosts where time_t is unsigned, and where
7887 float-time is applied to the (negative) difference between two times.
7888 * editfns.c (decode_time_components): Last arg is now double *,
7889 not int *, and means to store all the result as a double, without
7890 worrying about whether the seconds part fits in time_t.
7891 All callers changed.
7892 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
7893 All callers changed.
7894 (Ffloat_time): Do not fail merely because the specified time falls
7895 outside of time_t range.
7897 2012-07-07 Glenn Morris <rgm@gnu.org>
7899 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
7900 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
7901 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
7903 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
7905 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
7906 Update dependencies.
7908 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
7910 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7912 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
7913 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
7914 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
7915 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
7916 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
7917 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
7919 * xfont.c (compare_font_names): Redo to omit the need for casts.
7921 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
7923 * xfns.c (Fx_change_window_property): Doc fix.
7924 * w32fns.c (Fx_change_window_property): Doc fix.
7926 * w32fns.c (Fx_window_property): Accept the same arguments as the
7927 X Windows version. Doc fix.
7928 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
7930 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
7931 Eli Zaretskii <eliz@gnu.org>
7933 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
7934 Windows-specific code from nt/config.nt moved here.
7935 Obsolete settings removed.
7937 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7939 * process.c: Avoid unnecessary calls to gettime.
7940 (wait_reading_process_output): Don't get the time of day
7941 when gobbling data immediately and not waiting, as there's no need
7942 for it in that case. This removes a FIXME.
7944 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
7946 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
7947 is defined (Bug#11768).
7949 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7951 Fix marker debugging code.
7952 * marker.c (byte_char_debug_check): Do not perform the check
7953 if buffer is not multibyte.
7954 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
7955 Call byte_char_debug_check with correct arguments.
7957 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7959 Compile marker debugging code only if ENABLE_CHECKING is defined.
7960 * marker.c (byte_char_debug_check, count_markers):
7961 Use only if ENABLE_CHECKING is defined.
7962 (byte_debug_flag): Remove.
7963 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
7964 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
7966 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7968 Avoid code repetition in marker-related functions.
7969 * marker.c (attach_marker): New function.
7970 (Fset_marker, set_marker_restricted, set_marker_both)
7971 (set_marker_restricted_both): Use it.
7972 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
7973 Consistently rename charno to charpos.
7974 (marker_position): Add eassert.
7975 (marker_byte_position): Convert to eassert.
7977 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7979 Simplify list operations in unchain_overlay and unchain_marker.
7980 * buffer.c (unchain_overlay): Simplify. Add comment.
7981 * marker.c (unchain_marker): Simplify. Fix comments.
7983 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7985 Introduce fast path for the widely used marker operation.
7986 * alloc.c (build_marker): New function.
7987 * lisp.h (build_marker): New prototype.
7988 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
7989 * composite.c (autocmp_chars): Likewise.
7990 * editfns.c (buildmark): Remove.
7991 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
7992 (save_restriction_save): Use build_marker.
7993 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
7994 * window.c (save_window_save): Likewise.
7996 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7998 Do not use Fdelete_overlay in delete_all_overlays
7999 to avoid redundant calls to unchain_overlay.
8000 * buffer.c (drop_overlay): New function.
8001 (delete_all_overlays, Fdelete_overlay): Use it.
8002 * minibuf.c (get_minibuffer): Fix comment.
8004 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
8006 Port to OpenBSD 5.1 amd64.
8007 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
8008 This is needed for OpenBSD, and should be harmless on all BSD systems.
8009 Also, include <sys/sysctl.h>, as it should be available on all
8010 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
8011 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
8012 use p_pid member, not kp_proc.pid.
8014 2012-07-06 Glenn Morris <rgm@gnu.org>
8016 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
8018 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
8020 More xmalloc and related cleanup.
8021 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
8022 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
8023 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
8024 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
8025 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
8026 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
8027 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
8028 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
8029 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
8031 Omit needless casts involving void * pointers and allocation.
8032 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
8033 as the former is more robust if P's type is changed.
8034 Prefer xzalloc to xmalloc + memset 0.
8035 Simplify malloc-or-realloc to realloc.
8036 Don't worry about xmalloc returning a null pointer.
8037 Prefer xstrdup to xmalloc + strcpy.
8038 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
8040 * keyboard.c (apply_modifiers_uncached): Prefer local array to
8041 alloca of a constant.
8043 2012-07-05 Eli Zaretskii <eliz@gnu.org>
8045 * xdisp.c (display_line): Fix horizontal pixel coordinates when
8046 hscroll is larger than the line width. Fixes long and futile
8047 looping inside extend_face_to_end_of_line (on a TTY) producing
8048 glyphs that are not needed and thrown away.
8050 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
8052 * marker.c (set_marker_restricted_both): Simplify by using
8055 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
8057 * editfns.c (region_limit): Simplify by using clip_to_bounds.
8059 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
8061 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
8062 not defined (Bug#11768).
8063 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
8064 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
8065 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
8066 followed by gtk_box_set_homogeneous (Bug#11768).
8067 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
8068 (update_theme_scrollbar_width, xg_create_scroll_bar):
8069 Use gtk_scrollbar_new (Bug#11768).
8070 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
8071 (is_box_type): New function (Bug#11768).
8072 (xg_tool_item_stale_p): Call is_box_type.
8073 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
8074 with default display (Bug#11768).
8076 2012-07-05 Eli Zaretskii <eliz@gnu.org>
8078 * xdisp.c (window_hscroll_limited): New function.
8079 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
8080 coordinates when window's hscroll is set to insanely large
8083 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
8085 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
8086 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
8088 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
8091 * lisp.h (xzalloc): New prototype. Omit needless casts.
8092 * alloc.c (xzalloc): New function. Omit needless casts.
8093 * charset.c: Omit needless casts. Convert all calls to
8094 xmalloc with following memset to xzalloc.
8095 * dispnew.c: Likewise.
8096 * fringe.c: Likewise.
8097 * image.c: Likewise.
8098 * sound.c: Likewise.
8100 * w32fns.c: Likewise.
8101 * w32font.c: Likewise.
8102 * w32term.c: Likewise.
8103 * xfaces.c: Likewise.
8105 * xterm.c: Likewise.
8106 * atimer.c: Omit needless casts.
8107 * buffer.c: Likewise.
8108 * callproc.c: Likewise.
8110 * coding.c: Likewise.
8111 * composite.c: Likewise.
8113 * doprnt.c: Likewise.
8114 * editfns.c: Likewise.
8115 * emacs.c: Likewise.
8117 * filelock.c: Likewise.
8119 * gtkutil.c: Likewise.
8120 * keyboard.c: Likewise.
8122 * lread.c: Likewise.
8123 * minibuf.c: Likewise.
8124 * msdos.c: Likewise.
8125 * print.c: Likewise.
8126 * process.c: Likewise.
8127 * region-cache.c: Likewise.
8128 * search.c: Likewise.
8129 * sysdep.c: Likewise.
8130 * termcap.c: Likewise.
8131 * terminal.c: Likewise.
8132 * tparam.c: Likewise.
8133 * w16select.c: Likewise.
8135 * w32reg.c: Likewise.
8136 * w32select.c: Likewise.
8137 * w32uniscribe.c: Likewise.
8138 * widget.c: Likewise.
8139 * xdisp.c: Likewise.
8140 * xmenu.c: Likewise.
8142 * xselect.c: Likewise.
8144 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
8146 * fileio.c (time_error_value): Check the right error number.
8147 Problem reported by Troels Nielsen in
8148 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
8150 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8152 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
8153 This should be fixed in a better way; see Eli Zaretskii in
8154 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
8155 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
8157 * fileio.c (time_error_value): Rename from special_mtime.
8158 The old name's problems were noted by Eli Zaretskii in
8159 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
8161 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
8162 This variable's comment says Emacs needs at least one GDB-visible
8163 symbol of type enum pvec_type, to work around GDB problems.
8164 The symbol's value doesn't matter.
8166 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
8167 that causes compilation to fail on pre-C99 compilers.
8169 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
8171 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
8172 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
8174 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
8176 * buffer.c (init_buffer_once): Fix initialization of
8177 headers for buffer_defaults and buffer_local_symbols.
8178 Reported by Juanma Barranquero <lekktu@gmail.com>.
8180 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
8182 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
8183 * lisp.h (enum pvec_type): Use fewer bits.
8184 (PSEUDOVECTOR_SIZE_BITS): New constant.
8185 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
8186 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
8187 change in pvec_type.
8188 (PSEUDOVECTOR_TYPEP): New macro.
8189 (TYPED_PSEUDOVECTORP): Use it.
8190 * fns.c (internal_equal): Adapt code to extract pvectype.
8191 * emacs.c (gdb_pvec_type): Update type.
8192 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
8193 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
8194 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
8195 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
8196 (sweep_vectors): Use it. Use local var `total_bytes' instead of
8197 abusing vector->header.next.nbytes.
8198 (live_vector_p): Use PVEC_TYPE.
8199 (mark_object): Adapt code to extract pvectype. Use switch.
8201 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8203 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
8204 Tighten new eassert a bit.
8206 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
8208 Fix compilation with --enable-gcc-warnings and -O1
8210 * doprnt.c (doprnt): Change type of tem to int, initialize
8211 to avoid compiler warning. Add eassert.
8212 * search.c (simple_search): Initialize match_byte to avoid
8213 compiler warning. Add eassert.
8215 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8217 Avoid weird behavior with large horizontal scrolls.
8218 Without this change, for example, large hscroll values would
8219 mess up Emacs's display on Fedora 15 x86, presumably due to
8220 overflows in int calculations in the display code.
8221 Also, if buffers had long lines, Emacs would freeze.
8222 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
8223 (set_window_hscroll): New function, containing the old guts of
8224 Fset_window_hscroll. Return the clipped value.
8225 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
8226 This avoids the need to check against PTRDIFF_MAX.
8228 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
8230 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
8232 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
8234 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8236 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
8237 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
8238 since GCC 4.4.6 issues a bogus warning for them.
8240 Fix bugs in file timestamp newness comparisons.
8241 * fileio.c (Ffile_newer_than_file_p):
8242 * lread.c (Fload): Use full timestamp resolution of files,
8243 not just the 1-second resolution, so that files that are only
8244 slightly newer still count as newer.
8245 * fileio.c (Ffile_newer_than_file_p): Don't assume file
8246 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
8248 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
8250 * fileio.c: Improve handling of file time marker. (Bug#11852)
8251 (special_mtime): New function.
8252 (Finsert_file_contents, Fverify_visited_file_modtime):
8253 Use it to set special mtime values consistently.
8255 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
8257 * fileio.c (Finsert_file_contents): Properly handle st_mtime
8258 marker for non-existing file. (Bug#11852)
8260 2012-07-03 Glenn Morris <rgm@gnu.org>
8262 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
8263 and did not make it into globals.h).
8265 2012-07-03 Tom Tromey <tromey@redhat.com>
8267 * window.c (Fset_window_margins, Fset_window_fringes)
8268 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
8269 * textprop.c (Fprevious_property_change): No longer static.
8270 * syntax.c (Fsyntax_table_p): No longer static.
8271 * process.c (Fget_process, Fprocess_datagram_address): No longer
8273 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
8274 * keyboard.c (Fcommand_execute): No longer static.
8276 * insdel.c (Fcombine_after_change_execute): No longer static.
8277 * image.c (Finit_image_library): No longer static.
8278 * fileio.c (Fmake_symbolic_link): No longer static.
8279 * eval.c (Ffetch_bytecode): No longer static.
8280 * editfns.c (Fuser_full_name): No longer static.
8281 * doc.c (Fdocumentation_property, Fsnarf_documentation):
8283 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
8285 * dired.c (Ffile_attributes): No longer static.
8286 * composite.c (Fcomposition_get_gstring): No longer static.
8287 * callproc.c (Fgetenv_internal): No longer static.
8289 * ccl.h: Remove EXFUNs.
8290 * buffer.h: Remove EXFUNs.
8291 * dispextern.h: Remove EXFUNs.
8292 * intervals.h: Remove EXFUNs.
8293 * fontset.h: Remove EXFUN.
8294 * font.h: Remove EXFUNs.
8295 * dosfns.c (system_process_attributes): Remove EXFUN.
8296 * keymap.h: Remove EXFUNs.
8297 * lisp.h: Remove EXFUNs.
8298 * w32term.h: Remove EXFUNs.
8299 * window.h: Remove EXFUNs.
8300 * xsettings.h: Remove EXFUN.
8301 * xterm.h: Remove EXFUN.
8303 2012-07-03 Glenn Morris <rgm@gnu.org>
8305 * lisp.h (Frandom): Make it visible to C.
8306 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
8307 buffer for invisible buffers. (Bug#1229)
8309 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8311 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
8312 values which aren't power of 2.
8313 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
8314 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
8317 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
8319 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
8321 * alloc.c (mark_object): Revert part of last patch to use `switch'.
8323 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8325 * alloc.c (allocate_vector_block): Remove redundant
8326 calls to mallopt if DOUG_LEA_MALLOC is defined.
8327 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
8328 avoid calls to mallopt if zero_vector is returned.
8330 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8332 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
8333 is enabled, avoid dereferencing NULL current_sblock if
8336 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8338 Cleanup basic buffer management.
8339 * buffer.h (struct buffer): Change layout to use generic vector
8340 marking code. Fix some comments. Change type of 'clip_changed'
8341 to bitfield. Remove unused #ifndef old.
8342 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
8343 (GET_OVERLAYS_AT): Fix indentation.
8344 (for_each_per_buffer_object_at): New macro.
8345 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
8346 (Fbuffer_local_variables): Use it.
8347 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
8348 * alloc.c (allocate_buffer): Adjust to match new layout of
8349 struct buffer. Fix comment.
8350 (mark_overlay): New function.
8351 (mark_buffer): Use it. Use mark_vectorlike to mark normal
8352 Lisp area of struct buffer.
8353 (mark_object): Use it. Adjust marking of misc objects
8354 and related comments.
8356 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
8358 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
8359 wrapper that is not needed because the wrapped code is a no-op (zero
8360 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
8361 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
8363 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
8365 * alloc.c (mark_buffer): Simplify. Remove prototype.
8366 (mark_object): Add comment. Reorganize marking of vector-like
8367 objects. Use CHECK_LIVE for all vector-like objects except buffers
8368 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
8369 Avoid redundant calls to mark_vectorlike for bool vectors.
8371 2012-06-30 Glenn Morris <rgm@gnu.org>
8373 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
8375 * epaths.in (PATH_SITELOADSEARCH): New.
8376 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
8377 This is rather than relying on --enable-locallisppath elements
8378 having "site-lisp" in their names. (Bug#10208#25, 11658)
8380 2012-06-30 Eli Zaretskii <eliz@gnu.org>
8382 * w32proc.c (sys_select): Accept and ignore one more argument.
8384 * w32.c (emacs_gnutls_pull): Call select with one more argument.
8386 * sysselect.h [DOS_NT]: Don't include sys/select.h.
8387 (pselect) [!MS_DOS]: Redirect to sys_select.
8389 * sysdep.c: Don't include dos.h and dosfns.h.
8391 * process.c (sys_select):
8392 * msdos.c (sys_select): Accept one more argument and ignore it.
8394 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
8395 adapt data types and code to that.
8398 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
8399 which clashes with the gnulib function of the same name.
8401 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
8403 * font.c (font_style_to_value, font_style_symbolic)
8404 (font_prop_validate_style): Add type checks for values in
8407 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
8409 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
8412 2012-06-29 Eli Zaretskii <eliz@gnu.org>
8414 * xdisp.c (try_window_id): Undo last change.
8416 * w32.c (getwd): Adjust commentary about startup_dir.
8417 (init_environment): Always call sys_access, even in non-MSVC
8418 builds. Don't chdir to the directory of the Emacs executable.
8419 This undoes code from 1997 which was justified by the need to
8420 "avoid conflicts when removing and renaming directories". But its
8421 downside was that every relative file name was being interpreted
8422 relative to the directory of the Emacs executable, which can never
8423 be TRT. In particular, it broke sys_access when called with
8424 relative file names.
8425 (sys_access): Map GetLastError to errno.
8427 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8429 * window.h (struct window): Change type of 'fringes_outside_margins'
8430 to bitfield. Fix comment. Adjust users accordingly.
8431 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
8433 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
8436 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
8438 * gnutls.c (emacs_gnutls_handshake):
8439 Add QUIT to make the loop interruptible.
8441 2012-06-29 Glenn Morris <rgm@gnu.org>
8443 * charset.c (init_charset): Make lack of etc/charsets fatal.
8445 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8447 * editfns.c (region_limit): Fix type mismatch.
8449 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8451 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
8452 undefined. Convert from xassert to eassert.
8453 * nsmenu.m: Convert from xassert to eassert.
8454 * nsterm.m: Likewise.
8456 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
8458 * editfns.c (region_limit): Clip to narrowing (bug#11770).
8460 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
8462 Avoid integer overflow on scroll-left and scroll-right.
8463 * window.c (HSCROLL_MAX): New macro.
8464 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
8465 overflow when requested scroll falls outside ptrdiff_t range.
8467 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8469 * window.h (struct window): Change type of 'hscroll',
8470 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
8471 'last_modified' and 'last_overlay_modified' to EMACS_INT.
8472 Adjust users accordingly.
8473 * xdisp.c (try_cursor_movement): Replace type check with eassert.
8474 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
8475 from EMACS_INT to ptrdiff_t.
8476 (make_window): Omit redundant initialization.
8478 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
8480 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
8482 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8484 * window.h (struct window): Change type of 'use_time' and
8485 'sequence_number' from Lisp_Object to int.
8486 * frame.c (make_frame): Adjust users accordingly.
8487 * print.c (print_object): Likewise.
8488 * window.c (select_window, Fwindow_use_time, make_parent_window)
8489 (make_window): Likewise.
8491 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8493 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
8494 enabled with --enable-checking=[all,glyphs] configure option.
8495 Fix GLYPH_DEBUG usage assuming that it may be undefined,
8496 adjust comments accordingly.
8497 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
8498 undefined, adjust comments accordingly.
8499 * image.c: Likewise.
8500 * scroll.c: Likewise.
8501 * w32fns.c: Likewise.
8502 * w32term.c: Likewise.
8503 * xdisp.c: Likewise.
8504 * xfaces.c: Likewise.
8506 * xterm.c: Likewise.
8508 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8510 Generalize run-time debugging checks.
8511 * dispextern.h (XASSERTS): Remove.
8512 * fontset.c (xassert): Remove.
8513 Convert from xassert to eassert.
8514 * alloc.c: Convert from xassert to eassert.
8516 * dispnew.c: Likewise.
8518 * fringe.c: Likewise.
8519 * ftfont.c: Likewise.
8520 * gtkutil.c: Likewise.
8521 * image.c: Likewise.
8522 * keyboard.c: Likewise.
8524 * process.c: Likewise.
8525 * scroll.c: Likewise.
8526 * sound.c: Likewise.
8528 * w32console.c: Likewise.
8529 * w32fns.c: Likewise.
8530 * w32term.c: Likewise.
8531 * window.c: Likewise.
8532 * xdisp.c: Likewise.
8533 * xfaces.c: Likewise.
8535 * xselect.c: Likewise.
8536 * xterm.c: Likewise.
8538 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
8540 * fns.c (maybe_resize_hash_table): Output message when growing the
8543 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8545 * alloc.c (allocate_string_data): Remove dead code.
8546 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
8547 avoid GCC warning about unused macro.
8549 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8551 * alloc.c (allocate_string): Omit intervals initialization.
8552 * alloc.c (make_uninit_multibyte_string): Initialize intervals
8553 as in make_pure_string and make_pure_c_string.
8555 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8557 * alloc.c (allocate_string): Fix last change.
8559 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8561 * alloc.c (allocate_string): Remove two redundant calls
8562 to memset, add explicit initialization where appropriate.
8564 2012-06-27 Glenn Morris <rgm@gnu.org>
8566 * lisp.mk (lisp): Remove paths.elc.
8568 2012-06-27 Chong Yidong <cyd@gnu.org>
8570 * doc.c (Fsubstitute_command_keys): Fix punctuation.
8572 2012-06-26 John Wiegley <johnw@newartisans.com>
8574 * unexmacosx.c (copy_data_segment): Add two section names used
8575 on Mac OS X Lion: __mod_init_func and __mod_term_func.
8577 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
8578 when building with Clang.
8580 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
8582 * eval.c (Fapply): Allow calling it with a single argument.
8584 2012-06-26 Eli Zaretskii <eliz@gnu.org>
8586 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
8587 _stricmp and _strnicmp.
8588 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
8590 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8592 * alloc.c (allocate_window): Zero out non-Lisp part of newly
8594 (allocate_process): Likewise for new process.
8595 (allocate_terminal): Change to use offsetof.
8596 (allocate_frame): Likewise.
8597 * frame.c (make_frame): Omit redundant initialization.
8598 * window.c (make_parent_window): Use memset.
8599 (make_window): Omit redundant initialization.
8600 * process.c (make_process): Omit redundant initialization.
8601 * terminal.c (create_terminal): Likewise.
8603 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8605 * term.c (delete_tty): Remove redundant call to memset.
8607 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8609 * alloc.c: Remove build_string.
8610 * lisp.h: Define build_string as static inline. This provides
8611 a better opportunity to optimize away calls to strlen when the
8612 function is called with compile-time constant argument.
8613 * image.c (imagemagick_error): Convert to build_string.
8614 * w32proc.c (sys_spawnve): Likewise.
8615 * xterm.c (x_term_init): Likewise.
8617 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
8619 Use sprintf return value instead of invoking strlen on result.
8620 In the old days this wasn't portable, since some sprintf
8621 implementations returned char *. But they died out years ago and
8622 Emacs already assumes sprintf returns int.
8623 Similarly for float_to_string.
8624 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
8625 * ccl.c (ccl_driver):
8626 * character.c (string_escape_byte8):
8627 * data.c (Fnumber_to_string):
8628 * doprnt.c (doprnt):
8629 * print.c (print_object):
8630 * xdisp.c (message_dolog):
8631 * xfns.c (syms_of_xfns):
8632 Use sprintf or float_to_string result to avoid need to call strlen.
8633 * data.c (Fnumber_to_string):
8634 Use make_unibyte_string, since the string must be ASCII.
8635 * lisp.h, print.c (float_to_string): Now returns int length.
8636 * term.c (produce_glyphless_glyph):
8637 Use sprintf result rather than recomputing it.
8639 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
8640 * Makefile.in (ALL_CFLAGS):
8641 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
8642 * gmalloc.c, regex.c: Include <config.h> unconditionally.
8644 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8646 * dispextern.h (xstrcasecmp): Define to library function
8647 strcasecmp if available.
8648 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
8650 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
8652 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
8653 Avoid comma operator.
8654 * menu.c (push_submenu_start, push_submenu_end)
8655 (push_left_right_boundary, push_menu_pane): Likewise.
8656 * msdos.c (dos_rawgetc): Likewise.
8658 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8660 * xfns.c (xic_create_fontsetname): Remove redundant calls
8663 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
8665 * gtkutil.c (get_utf8_string): Remove redundant assignment.
8666 sprintf already null-terminates its output.
8668 * xfns.c (x_window): Remove redundant cast.
8670 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8672 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
8673 `const char *' to `char *' to avoid compiler warning.
8675 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8677 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
8678 instead of truncating it to 63 (admittedly a generous limit).
8680 * process.c: Fix spelling and caps in comments.
8682 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
8684 * emacs.c (setpgrp): Remove definition, unused.
8685 * sysdep.c (setpgrp): Remove definition, not used in this file.
8687 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
8689 * makefile.w32-in: Update dependencies.
8691 2012-06-24 Eli Zaretskii <eliz@gnu.org>
8693 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
8694 (SYSTIME_H): Add nt/inc/sys/time.h.
8696 * systime.h [WINDOWSNT]: Include sys/time.h.
8698 * s/ms-w32.h (struct timespec): Definition moved from
8699 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
8701 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8703 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
8704 * buffer.h (buffer_slot_type_mismatch):
8705 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
8706 * eval.c (unwind_to_catch):
8707 * image.c (my_png_error, my_error_exit):
8708 * keyboard.c (quit_throw_to_read_char, user_error)
8709 (Fexit_recursive_edit, Fabort_recursive_edit):
8710 * lisp.h (die, args_out_of_range, args_out_of_range_3)
8711 (wrong_type_argument, buffer_overflow, __executable_start)
8712 (memory_full, buffer_memory_full, string_overflow, Fthrow)
8713 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
8714 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
8716 (child_setup) [!DOS_NT]:
8717 * lread.c (end_of_file_error, invalid_syntax):
8718 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
8719 * puresize.h (pure_write_error):
8720 * search.c (matcher_overflow):
8721 * sound.c (sound_perror, alsa_sound_perror):
8722 * sysdep.c, syssignal.h (croak):
8723 * term.c (maybe_fatal, vfatal):
8724 * textprop.c (text_read_only):
8725 * undo.c (user_error):
8726 * unexmacosx.c (unexec_error):
8727 * xterm.c (x_ins_del_lines, x_delete_glyphs):
8728 Use _Noreturn rather than NO_RETURN.
8729 No need for separate decl merely because of _Noreturn.
8730 * sound.c (sound_warning, parse_sound):
8731 Remove unnecessary forward decls.
8733 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8735 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
8736 * lisp.h (WAIT_READING_MAX): New macro.
8737 * dispnew.c (Fsleep_for, sit_for):
8738 * keyboard.c (kbd_buffer_get_event):
8739 * process.c (Faccept_process_output):
8740 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
8741 This improves on the previous patch, which introduced a bug
8742 when time_t is unsigned and as wide as intmax_t.
8743 See <http://bugs.gnu.org/9000#51>.
8745 2012-06-23 Eli Zaretskii <eliz@gnu.org>
8747 * dispnew.c (sit_for, Fsleep_for):
8748 * keyboard.c (kbd_buffer_get_event):
8749 * process.c (Faccept_process_output): Avoid compiler warnings when
8750 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
8752 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
8754 * makefile.w32-in: Update dependencies.
8756 * w32.c (ltime): Add return type and declare static.
8757 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
8759 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
8761 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
8762 Privately reported by Herbert J. Skuhra.
8763 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
8765 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
8766 not make_lisp_timeval, when the argument is of type EMACS_TIME.
8768 2012-06-23 Eli Zaretskii <eliz@gnu.org>
8770 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
8771 last argument of make_unibyte_string.
8773 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
8774 language ID in the event parameters.
8776 * w32term.c (w32_read_socket): Put the new keyboard codepage into
8777 event.code, not the obscure "character set ID".
8779 2012-06-23 Chong Yidong <cyd@gnu.org>
8781 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
8783 2012-06-23 Eli Zaretskii <eliz@gnu.org>
8785 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
8786 * w32.c (fdutimens): New function.
8788 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
8790 * s/ms-w32.h (pselect): Redirect to sys_select.
8792 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
8794 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
8795 in the logic of incrementing and decrementing the value of
8796 use_relocatable_buffers.
8798 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
8800 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
8801 Privately reported by Herbert J. Skuhra.
8802 [__FreeBSD__]: Remove "*/" typo after "#include".
8803 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
8804 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
8805 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
8806 Don't assume EMACS_TIME and struct timeval are the same type.
8808 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
8810 Support higher-resolution time stamps (Bug#9000).
8811 The time stamps are only nanosecond-resolution at the C level,
8812 since that's the best that any real-world system supports now.
8813 But they are picosecond-resolution at the Lisp level, as that's
8814 easy, and leaves room for future OS improvements.
8816 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
8819 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
8820 Don't get current time unless it's needed.
8822 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
8823 now provides it if it's absent.
8824 (start_atimer): Port to higher-res time stamps.
8825 Check for time stamp overflow. Don't get current time more
8826 often than is needed.
8828 * buffer.h (struct buffer): Buffer modtime now has high resolution.
8829 Include systime.h, not time.h.
8830 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
8832 * dired.c: Include stat-time.h.
8833 (Ffile-attributes): File times now have higher resolution.
8835 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
8836 (struct image): Timestamp now has higher resolution.
8838 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
8839 has at least microseconds now. All uses removed.
8840 (update_frame, update_single_window, update_window, update_frame_1)
8841 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
8842 (duration_to_sec_usec): Remove; no longer needed.
8844 * editfns.c (time_overflow): Now extern.
8845 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
8846 (float-time, Fformat_time_string, Fcurrent_time_string)
8847 (Fcurrent_time_zone): Accept and generate higher-resolution
8849 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
8850 (decode_time_components, lisp_seconds_argument): New functions.
8851 (make_time): Now static.
8852 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
8853 Report an error if the time is invalid, rather than having the caller
8856 * fileio.c: Include <stat-time.h>
8857 (Fcopy_file): Copy higher-resolution time stamps.
8858 Prefer to set the time stamp via a file descriptor if that works.
8859 (Fset_file_times, Finsert_file_contents, Fwrite_region)
8860 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
8861 (Fvisited_file_modtime, Fset_visited_file_modtime):
8862 Support higher-resolution time stamps.
8864 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
8866 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
8868 * image.c (prepare_image_for_display, clear_image_cache)
8869 (lookup_image): Port to higer-resolution time stamps.
8871 * keyboard.c (start_polling, bind_polling_period):
8872 Check for time stamp overflow.
8873 (read_char, kbd_buffer_get_event, timer_start_idle)
8874 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
8875 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
8876 Port to higher-resolution time stamps. Do not assume time_t is signed.
8877 (decode_timer): New function. Timers are now vectors of length 9,
8878 not 8, to accommodate the picosecond component.
8879 (timer_check_2): Use it.
8881 * nsterm.m (select_timeout, timeval_subtract): Remove.
8882 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
8883 as they're a bit more accurate and handle overflow better.
8884 (ns_select): Change prototype to be compatible with pselect.
8885 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
8886 * nsterm.h (ns_select): Adjust prototype.
8888 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
8889 us-resolution time stamps.
8890 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
8892 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
8894 * lisp.h (time_overflow): New decl.
8895 (wait_reading_process_output): First arg is now intmax_t, not int,
8896 to accommodate larger waits.
8898 * process.h (struct Lisp_Process.read_output_delay):
8899 Now counts nanoseconds, not microseconds.
8900 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
8902 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
8903 (wait_reading_process_output):
8904 Port to ns-resolution time stamps.
8905 (Faccept_process_output, wait_reading_process_output):
8906 Check for time stamp overflow. Do not assume time_t is signed.
8907 (select_wrapper): Remove; we now use pselect.
8908 (Fprocess_attributes): Now generates ns-resolution time stamps.
8910 * sysdep.c: Include utimens.h. Don't include utime.h
8911 or worry about struct utimbuf; gnulib does that for us now.
8912 (gettimeofday): Remove; gnulib provides a substitute.
8913 (make_timeval): New function.
8914 (set_file_times): Now sets ns-resolution time stamps.
8915 New arg FD; all uses changed.
8916 (time_from_jiffies, ltime_from_jiffies, get_up_time)
8917 (system_process_attributes):
8918 Now returns ns-resolution time stamp. All uses changed.
8919 Check for time stamp overflow.
8921 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
8922 provides a substitute now.
8924 * systime.h: Include timespec.h rather than sys/time.h and time.h,
8925 since it guarantees struct timespec.
8926 (EMACS_TIME): Now struct timespec, so that we can support
8927 ns-resolution time stamps.
8928 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
8929 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
8930 (EMACS_USECS): Remove.
8931 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
8932 so multiply the arg by 1000 before storing it.
8933 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
8935 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
8936 Port to ns-resolution time stamps.
8937 (EMACS_TIME_NEG_P): Remove; replaced by....
8938 (EMACS_TIME_SIGN): New macro.
8939 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
8940 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
8941 (set_file_times, make_time, lisp_time_argument): Adjust signature.
8942 (make_timeval, make_lisp_time, decode_time_components): New decls.
8943 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
8944 that it mishandled time_t overflow. You can't compare by subtracting!
8945 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
8946 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
8948 * term.c: Include <sys/time.h>.
8949 (timeval_to_Time): New function, for proper overflow wraparound.
8950 (term_mouse_position, term_mouse_click): Use it.
8952 * undo.c (record_first_change): Support higher-resolution time stamps
8954 (Fprimitive_undo): Use them when restoring time stamps.
8956 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
8957 (w32_get_internal_run_time):
8958 Port to higher-resolution Emacs time stamps.
8959 (ltime): Now accepts single 64-bit integer, as that's more convenient
8962 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
8964 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
8965 for compatibility with pselect. Support ns-resolution time stamps.
8967 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
8969 * xselect.c (wait_for_property_change, x_get_foreign_selection):
8970 Check for time stamp overflow, and support ns-resolution time stamps.
8972 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
8973 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
8974 (timeval_subtract): Remove; no longer needed.
8975 (XTflash, XTring_bell, x_wait_for_event):
8976 Port to ns-resolution time stamps. Don't assume time_t is signed.
8978 2012-06-22 Chong Yidong <cyd@gnu.org>
8980 * xdisp.c (x_consider_frame_title): Revert last change.
8982 2012-06-22 Eli Zaretskii <eliz@gnu.org>
8984 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
8985 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
8986 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
8987 staticidx goes up to 1597 out of 1600 = 0x640.)
8989 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
8991 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
8992 Otherwise, the umask might be mistakenly 0 while handling input signals.
8994 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
8996 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
8998 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
9000 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
9001 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
9002 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
9003 access to `contents' member of Lisp_Vector objects with AREF and ASET
9006 2012-06-19 Chong Yidong <cyd@gnu.org>
9008 * frame.c (delete_frame): When selecting a frame on a different
9009 text terminal, do not alter the terminal's top-frame.
9011 * xdisp.c (format_mode_line_unwind_data): Record the target
9012 frame's selected window and its terminal's top-frame.
9013 (unwind_format_mode_line): Restore them.
9014 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
9016 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
9017 since tty frames can be explicitly named.
9018 (prepare_menu_bars): Likewise.
9020 * term.c (Ftty_top_frame): New function.
9022 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
9024 Port byte-code-meter to modern targets.
9025 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
9026 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
9027 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
9028 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
9029 (METER_1, METER_2): Simplify.
9031 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
9033 * data.c (Fdefalias): Return `symbol' (bug#11686).
9035 2012-06-18 Martin Rudalics <rudalics@gmx.at>
9037 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
9038 gets killed during executing of this function (Bug#11665).
9039 Try to always return Qt when the buffer has been actually killed.
9040 (Vkill_buffer_query_functions): In doc-string say that functions
9041 run by this hook should not change the current buffer.
9043 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
9045 Fix recently-introduced process.c problems found by static checking.
9046 * process.c (write_queue_push, write_queue_pop, send_process):
9047 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
9048 (write_queue_pop): Fix pointer signedness problem.
9049 (send_process): Remove unused local.
9051 2012-06-17 Chong Yidong <cyd@gnu.org>
9053 * xdisp.c (redisplay_internal): No need to redisplay terminal
9054 frames that are not on top.
9056 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
9058 * process.c (make_process): Initialize write_queue.
9059 (write_queue_push, write_queue_pop): New functions.
9060 (send_process): Use them to maintain correct ordering of process
9063 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
9065 * lisp.h (eassert): Assume C89 or later.
9066 This removes the need for CHECK.
9067 (CHECK): Remove. Its comments about always evaluating its
9068 argument were confusing, as 'eassert' typically does not evaluate
9071 * coding.c (produce_chars): Use ptrdiff_t, not int.
9073 * xterm.c (x_draw_underwave): Check for integer overflow.
9074 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
9076 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
9078 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
9079 referenced (Bug#11583).
9081 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
9083 Implement wave-style variant of underlining.
9084 * dispextern.h (face_underline_type): New enum.
9085 (face): Add field for underline type.
9086 * nsterm.m (ns_draw_underwave): New function.
9087 (ns_draw_text_decoration): Use it.
9088 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
9090 (x_draw_glyph_string): Use them.
9091 * xfaces.c (Qline, Qwave): New Lisp objects.
9092 (check_lface_attrs, merge_face_ref)
9093 (Finternal_set_lisp_face_attribute, realize_x_face):
9094 Handle wave-style underline face attributes.
9095 * xterm.c (x_draw_underwave): New function.
9096 (x_draw_glyph_string): Use it.
9098 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
9100 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
9101 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
9102 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
9103 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
9104 ($(BLD)/w32select.$(O)): Update dependencies.
9106 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
9108 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
9109 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
9110 * character.c (_fetch_multibyte_char_p): Remove.
9111 * alloc.c: Include "character.h" before "buffer.h".
9113 * buffer.c: Likewise.
9114 * bytecode.c: Likewise.
9115 * callint.c: Likewise.
9116 * callproc.c: Likewise.
9117 * casefiddle.c: Likewise.
9118 * casetab.c: Likewise.
9119 * category.c: Likewise.
9121 * coding.c: Likewise.
9122 * composite.c: Likewise.
9123 * dired.c: Likewise.
9124 * dispnew.c: Likewise.
9126 * dosfns.c: Likewise.
9127 * editfns.c: Likewise.
9128 * emacs.c: Likewise.
9129 * fileio.c: Likewise.
9130 * filelock.c: Likewise.
9132 * fontset.c: Likewise.
9133 * fringe.c: Likewise.
9134 * indent.c: Likewise.
9135 * insdel.c: Likewise.
9136 * intervals.c: Likewise.
9137 * keyboard.c: Likewise.
9138 * keymap.c: Likewise.
9139 * lread.c: Likewise.
9140 * macros.c: Likewise.
9141 * marker.c: Likewise.
9142 * minibuf.c: Likewise.
9143 * nsfns.m: Likewise.
9144 * nsmenu.m: Likewise.
9145 * print.c: Likewise.
9146 * process.c: Likewise.
9147 * regex.c: Likewise.
9148 * region-cache.c: Likewise.
9149 * search.c: Likewise.
9150 * syntax.c: Likewise.
9152 * textprop.c: Likewise.
9154 * unexsol.c: Likewise.
9155 * w16select.c: Likewise.
9156 * w32fns.c: Likewise.
9157 * w32menu.c: Likewise.
9158 * window.c: Likewise.
9159 * xdisp.c: Likewise.
9161 * xmenu.c: Likewise.
9163 * xselect.c: Likewise.
9165 2012-06-16 Eli Zaretskii <eliz@gnu.org>
9167 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
9168 If all the glyphs of the glyph row came from strings, and we have no
9169 cursor positioning clues, put the cursor on the first glyph of the
9171 (handle_face_prop): Use chunk-relative overlay string index when
9172 indexing into it->string_overlays array. (Bug#11653)
9173 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
9174 the rightmost. (Bug#11720)
9176 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
9178 * category.h (CHAR_HAS_CATEGORY): Define as inline.
9179 (CATEGORY_MEMBER): Enforce 1/0 value.
9180 * category.c (_temp_category_set): Remove.
9182 2012-06-16 Eli Zaretskii <eliz@gnu.org>
9184 * window.c (Fdelete_other_windows_internal)
9185 (Fdelete_window_internal): Don't access frame's mouse highlight
9186 info of the initial frame. (Bug#11677)
9188 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
9190 * .gdbinit (xgetint): Fix recently-introduced paren typo.
9191 Assume USE_2_TAGS_FOR_INTS.
9192 (xreload): Adjust $tagmask width to match recent lisp.h change.
9194 Simplify lisp.h in minor ways that should not affect code.
9195 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
9196 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
9197 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
9198 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
9199 (INTTYPEBITS): New macro, for clarity.
9200 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
9201 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
9202 Simplify now that USE_LSB_TAG is always defined.
9203 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
9204 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
9206 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
9208 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
9210 2012-06-13 Glenn Morris <rgm@gnu.org>
9212 * s/bsd-common.h (BSD4_3):
9213 * s/usg5-4-common.h (USG5_4): No longer define; unused.
9215 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
9217 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
9220 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
9222 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
9223 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
9224 * alloc.c (widen_to_Lisp_Object): Remove.
9225 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
9226 * frame.c (delete_frame): Remove outdated comment.
9227 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
9228 USE_LISP_UNION_TYPE.
9229 (Fw32_unregister_hot_key): Likewise.
9230 (Fw32_toggle_lock_key): Likewise.
9231 * w32menu.c (add_menu_item): Likewise.
9232 (w32_menu_display_help): Use XIL instead of checking
9233 USE_LISP_UNION_TYPE.
9234 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
9235 (init_heap): Likewise.
9236 * w32term.c (w32_read_socket): Update comment.
9238 2012-06-13 Glenn Morris <rgm@gnu.org>
9240 * s/usg5-4-common.h, src/s/unixware.h:
9241 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
9243 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
9245 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
9247 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
9248 * alloc.c (make_number) [!defined make_number]:
9249 Remove, as lisp.h always defines this now.
9250 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
9251 (roundup_size): Verify that it is a power of 2.
9252 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
9253 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
9254 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
9255 -DUSE_LSB_TAG=0, to override the automatically-selected default.
9256 USE_LSB_TAG now is always defined to be either 0 or 1.
9258 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
9259 code works fine either way, and efficiency is not a concern here,
9260 as the union type is for debugging, not for production.
9261 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
9262 Use an inline function on all platforms when using the union type,
9263 since this is simpler and 'static inline' can be used portably
9265 (LISP_INITIALLY_ZERO): New macro.
9266 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
9267 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
9269 2012-06-12 Glenn Morris <rgm@gnu.org>
9271 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
9273 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
9275 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
9276 Move BROKEN_SIGIO to configure.
9278 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
9279 Move NO_TERMIO to configure.
9281 2012-06-12 Chong Yidong <cyd@gnu.org>
9283 * image.c (imagemagick_load_image): Use MagickFlattenImage if
9284 MagickMergeImageLayers is undefined. Use pixel pusher loop if
9285 MagickExportImagePixels is undefined.
9287 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
9289 * image.c (imagemagick_load_image): Remove unused label.
9291 2012-06-11 Glenn Morris <rgm@gnu.org>
9293 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9294 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
9295 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
9296 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
9298 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
9300 * alloc.c (make_byte_code): New function.
9301 (Fmake_byte_code): Use it. Don't purify here.
9302 * lread.c (read1): Use it as well to avoid extra allocation.
9304 2012-06-11 Chong Yidong <cyd@gnu.org>
9306 * image.c (imagemagick_load_image): Implement transparency.
9308 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
9310 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
9311 account for preceding backslashes. (Bug#11663)
9313 2012-06-09 Chong Yidong <cyd@gnu.org>
9315 * term.c: Support italics in capable terminals (Bug#9652).
9316 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
9317 (turn_on_face): Output using TS_enter_italic_mode if available.
9318 Don't handle unused blinking and alt-charset cases.
9319 (turn_off_face): Handle italic case; discard unused tty_blinking_p
9320 and tty_alt_charset_p cases.
9321 (tty_capable_p, init_tty): Support italics.
9323 * termchar.h (struct tty_display_info): Add field for italics.
9324 Remove unused blink field.
9326 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
9329 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
9330 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
9331 tty_alt_charset_p. Add tty_italic_p.
9333 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
9335 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
9336 dbus_type_is_basic if available.
9337 (xd_extract_signed, xd_extract_unsigned): Rename from
9338 extract_signed and extract_unsigned, respectively. Adapt callers.
9340 2012-06-09 Chong Yidong <cyd@gnu.org>
9342 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
9344 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
9347 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
9349 * xdisp.c (vmessage): Treat frame message as multibyte.
9350 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
9351 would generate the diagnostic "Making \302\247 buffer-local while
9354 2012-06-08 Eli Zaretskii <eliz@gnu.org>
9356 * dispnew.c (showing_window_margins_p): Undo last change, which
9357 was done due to an inadvertent commit.
9358 (adjust_frame_glyphs_for_frame_redisplay): Do call
9359 showing_window_margins_p.
9361 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
9363 * eval.c (Fmake_var_non_special): New primitive.
9364 (syms_of_eval): Defsubr it.
9365 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
9367 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
9369 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
9370 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
9372 2012-06-08 Eli Zaretskii <eliz@gnu.org>
9374 * alloc.c (allocate_vectorlike): Fix last change.
9376 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
9378 Block-based vector allocation of small vectors.
9379 * lisp.h (struct vectorlike_header): New field `nbytes',
9380 adjust comment accordingly.
9381 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
9382 to denote vector blocks. Adjust users (live_vector_p,
9383 mark_maybe_pointer, valid_lisp_object_p) accordingly.
9384 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
9385 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
9386 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
9387 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
9388 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
9389 (roundup_size): New constant.
9390 (struct vector_block): New data type.
9391 (vector_blocks, vector_free_lists, zero_vector): New variables.
9392 (all_vectors): Rename to `large_vectors'.
9393 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
9394 (sweep_vectors): New functions.
9395 (allocate_vectorlike): Return `zero_vector' as the only vector of
9396 0 items. Allocate new vector from block if vector size is less than
9397 or equal to VBLOCK_BYTES_MAX.
9398 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
9399 (init_alloc_once): Add call to init_vectors.
9401 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
9403 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
9405 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
9407 * doprnt.c (doprnt): Truncate multibyte char correctly.
9408 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
9409 would mishandle a string argument "Xc" if X was a multibyte
9410 character of length 2: it would truncate after X's first byte
9411 rather than including all of X.
9413 2012-06-06 Chong Yidong <cyd@gnu.org>
9415 * buffer.c (word_wrap): Doc fix.
9417 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
9419 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
9421 2012-06-03 Glenn Morris <rgm@gnu.org>
9423 * xdisp.c (tool-bar-style): Doc fix.
9425 2012-06-03 Ulrich Müller <ulm@gentoo.org>
9427 * Makefile.in (PAXCTL): Define.
9428 (temacs$(EXEEXT)): Disable memory randomization for the temacs
9429 binary via PaX flags if the paxctl utility is available.
9430 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
9431 Restore PaX flags to their default. (Bug#11398)
9433 2012-06-03 Chong Yidong <cyd@gnu.org>
9435 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
9438 2012-06-03 Chong Yidong <cyd@gnu.org>
9440 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
9441 (note_mode_line_or_margin_highlight): If there is no help echo,
9442 use mode-line-default-help-echo. Handle the case where the mouse
9443 position is past the end of the mode line string.
9445 * buffer.c (buffer_local_value_1): New function, split from
9446 Fbuffer_local_value; can return Qunbound.
9447 (Fbuffer_local_value): Use it.
9448 (Vmode_line_format): Docstring tweaks.
9450 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
9452 * sysdep.c (system_process_attributes): Improve comment.
9454 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
9456 * keyboard.c: Export real-this-command to Elisp.
9457 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
9458 and DEFVAR it. Update all users.
9460 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
9462 * minibuf.c (Fassoc_string): Remove duplicate declaration.
9464 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
9465 Convert pctcpu and pctmem to Lisp float properly.
9466 Let the compiler fold better, as 100.0/0x8000 is exact.
9468 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
9470 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
9473 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
9475 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
9477 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
9479 For a 'struct window', replace some Lisp_Object fields to
9480 bitfields where appropriate, remove unused fields.
9481 * window.h (struct window): Remove unused 'last_mark_x' and
9482 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
9483 change its type from Lisp_Object to bitfield.
9484 Change type of 'force_start', 'optional_new_start',
9485 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
9486 fields from Lisp_Object to bitfield. Adjust users accordingly.
9488 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
9490 Pacify gcc -Wdouble-precision when using Xaw.
9491 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
9492 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
9493 Use 'float' consistently, rather than 'float' in most places
9494 and 'double' in a couple of places.
9496 2012-05-31 Eli Zaretskii <eliz@gnu.org>
9498 * xdisp.c (handle_stop): Detect whether we have overlay strings
9499 loaded by testing it->current.overlay_string_index to be
9500 non-negative, instead of checking whether n_overlay_strings is
9501 positive. (Bug#11587)
9503 2012-05-31 Chong Yidong <cyd@gnu.org>
9505 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
9507 * doc.c (Fsubstitute_command_keys): Doc fix.
9509 2012-05-31 Eli Zaretskii <eliz@gnu.org>
9511 * search.c (search_buffer): Remove calls to
9512 r_alloc_inhibit_buffer_relocation, as it is now called by
9513 maybe_unify_char, which was the cause of relocation of buffer text
9516 2012-05-31 Eli Zaretskii <eliz@gnu.org>
9518 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
9519 for the duration of call to load_charset, to avoid problems with
9520 callers of maybe_unify_char that access buffer text through C
9523 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
9524 decrement the inhibition flag, instead of just setting or
9527 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
9529 Remove obsolete '#define static' cruft.
9530 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
9531 This #undef was "temporary" in 2000; it is no longer needed
9532 now that '#define static' has gone away.
9533 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
9534 (gray_bitmap_bits): Remove; no longer needed.
9535 All uses replaced with definiens.
9536 * xterm.c: Include "bitmaps/gray.xbm".
9538 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
9540 Clean up __executable_start, monstartup when --enable-profiling.
9541 The following changes affect the code only when profiling.
9542 * dispnew.c (__executable_start): Rename from safe_bcopy.
9543 Define only on platforms that need it.
9544 * emacs.c: Include <sys/gmon.h> when profiling.
9545 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
9546 (__executable_start): Remove decl, since lisp.h does it now.
9547 (safe_bcopy): Remove decl; no longer has that name.
9548 (main): Coalesce #if into single bit of code, for simplicity.
9549 Cast pointers to uintptr_t, since standard libraries want integers
9551 * lisp.h (__executable_start): New decl.
9553 2012-05-31 Glenn Morris <rgm@gnu.org>
9555 * image.c (Fimagemagick_types): Doc fix.
9557 2012-05-30 Jim Meyering <meyering@redhat.com>
9559 * callproc.c (Fcall_process_region): Include directory component
9560 in mkstemp error message (Bug#11586).
9562 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
9564 * alloc.c, lisp.h (make_pure_vector): Now static.
9566 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
9568 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
9569 Move to byte-run.el.
9570 (Fautoload): Do the hash-doc more carefully.
9571 * data.c (Fdefalias): Purify definition, except for keymaps.
9572 (Qdefun): Move from eval.c.
9573 * lisp.h (Qdefun): Remove.
9574 * lread.c (read1): Tiny simplification.
9576 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
9578 Do not create empty overlays with the evaporate property (Bug#9642).
9579 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
9580 Bug#9642, but explicitly check that the buffer the overlay would
9581 be moved to is live and rearrange lines to make sure that errors
9582 will not put the overlay in an inconsistent state.
9583 (Fdelete_overlay): Cosmetics.
9585 2012-05-28 Eli Zaretskii <eliz@gnu.org>
9587 * w32term.c (my_bring_window_to_top): New function.
9588 (x_raise_frame): Use handle returned by DeferWindowPos, which
9589 could be different from the original one.
9590 Call my_bring_window_to_top instead of my_set_foreground_window.
9593 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
9594 by calling BringWindowToTop.
9596 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
9597 (WM_EMACS_END): Increase by one.
9599 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
9601 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
9602 This avoids undefined behavior that might cause the eassert
9603 to not catch an out-of-range value.
9605 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
9607 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
9608 Update dependencies.
9610 2012-05-27 Eli Zaretskii <eliz@gnu.org>
9612 * bidi.c (bidi_mirror_char): Fix last change.
9614 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
9616 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
9617 when referring to sectname field in printf format.
9619 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
9621 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
9622 Only r_alloc_inhibit_buffer_relocation needed to be added;
9623 the others were already declared.
9625 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
9626 before checking whether it's out of range. Put the check inside
9628 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
9630 2012-05-27 Ken Brown <kbrown@cornell.edu>
9632 * callproc.c (Fcall_process): Restore a line that was accidentally
9633 commented out in the 2011-02-13 change (bug#11547).
9635 2012-05-27 Eli Zaretskii <eliz@gnu.org>
9637 * lisp.h [REL_ALLOC]: Add prototypes for external functions
9638 defined on ralloc.c.
9640 * buffer.c [REL_ALLOC]: Remove prototypes of
9641 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
9642 they are now on lisp.h.
9644 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
9646 * search.c (search_buffer): Use it to inhibit relocation of buffer
9647 text while re_search_2 is doing its job, because re_search_2 is
9648 passed C pointers to buffer text. (Bug#11519)
9650 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
9653 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
9654 state after an additional call to move_it_in_display_line_to, keep
9655 the values of it->max_ascent and it->max_descent found for the
9657 (pos_visible_p): Revert the comparison against bottom_y to what it
9658 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
9661 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
9663 Fix coding-related core dumps with gcc -ftrapv.
9664 The code was computing A - B, where A and B are pointers, and B is
9665 random garbage. This can lead to core dumps on platforms that
9666 have special pointer registers, and it also leads to core dumps on
9667 x86-64 when compiled with gcc -ftrapv. The fix is to compute
9668 A - B only when B is initialized properly.
9669 * coding.c (coding_set_source, coding_set_destination): Return void.
9670 (coding_change_source, coding_change_destinations): New functions,
9671 with the old behaviors of coding_set_source and coding_set_destination.
9672 All callers that need an offset changed to use these new functions.
9674 2012-05-26 Glenn Morris <rgm@gnu.org>
9676 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
9678 2012-05-26 Eli Zaretskii <eliz@gnu.org>
9680 Extend mouse support on W32 text-mode console.
9681 * xdisp.c (draw_row_with_mouse_face):
9682 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
9684 * w32console.c: Include window.h.
9685 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
9687 (initialize_w32_display): Initialize mouse-highlight data.
9689 * w32inevt.c: Include termchar.h and window.h.
9690 (do_mouse_event): Support mouse-autoselect-window. When the mouse
9691 moves, call note_mouse_highlight. If help_echo changed, call
9692 gen_help_event to produce help-echo message in the echo area.
9693 Call clear_mouse_face if mouse_face_hidden is set in the mouse
9696 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
9698 * lread.c (read1): Simplify slightly to avoid an overflow warning
9699 with GCC 4.7.0 on x86-64.
9701 2012-05-26 Eli Zaretskii <eliz@gnu.org>
9703 * bidi.c (bidi_mirror_char): Revert last change: an int is
9704 definitely wide enough here.
9706 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
9708 Fix integer width and related bugs (Bug#9874).
9709 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
9710 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
9711 (string_bytes, check_sblock, allocate_string_data):
9712 (compact_small_strings, Fmake_bool_vector, make_string)
9713 (make_unibyte_string, make_multibyte_string)
9714 (make_string_from_bytes, make_specified_string)
9715 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
9716 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
9718 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9719 (allocate_pseudovector):
9720 Use int, not EMACS_INT, where int is wide enough.
9721 (inhibit_garbage_collection, Fgarbage_collect):
9722 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9723 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
9724 int might not be wide enough.
9725 (bidi_cache_search, bidi_cache_find, bidi_init_it)
9726 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
9727 (bidi_at_paragraph_end, bidi_find_paragraph_start)
9728 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
9729 (bidi_level_of_next_char, bidi_move_to_visually_next):
9730 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9731 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
9732 (Fkill_buffer, Fset_buffer_major_mode)
9733 (advance_to_char_boundary, Fbuffer_swap_text)
9734 (Fset_buffer_multibyte, overlays_at, overlays_in)
9735 (overlay_touches_p, struct sortvec, record_overlay_string)
9736 (overlay_strings, recenter_overlay_lists)
9737 (adjust_overlays_for_insert, adjust_overlays_for_delete)
9738 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
9739 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
9740 (Foverlay_recenter, last_overlay_modification_hooks_used)
9741 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
9742 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9743 (validate_region): Omit unnecessary test for b <= e,
9744 since that's guaranteed by the previous test.
9745 (adjust_overlays_for_delete): Avoid pos + length overflow.
9746 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
9747 (report_overlay_modification):
9748 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9749 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
9750 Omit pointer cast, which isn't needed anyway, and doesn't work
9751 after the EMACS_INT -> ptrdiff_t change.
9752 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
9753 * buffer.h: Adjust decls to match defn changes elsewhere.
9754 (struct buffer_text, struct buffer):
9755 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9756 Use EMACS_INT, not int, where int might not be wide enough.
9757 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
9758 not int, to avoid needless 32-bit limit on 64-bit hosts.
9759 (exec_byte_code): Use tighter memory-full test, one that checks
9760 for alloca overflow. Don't compute the address of the object just
9761 before an array, as that's not portable. Use EMACS_INT, not
9762 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
9763 * callint.c (Fcall_interactively):
9764 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9765 * callproc.c (call_process_kill, Fcall_process):
9766 Don't assume pid_t fits into an Emacs fixnum.
9767 (call_process_cleanup, Fcall_process, child_setup):
9768 Don't assume pid_t fits into int.
9769 (call_process_cleanup, Fcall_process, delete_temp_file)
9770 (Fcall_process_region):
9771 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9772 (Fcall_process): Simplify handling of volatile integers.
9773 Use int, not EMACS_INT, where int will do.
9774 * casefiddle.c (casify_object, casify_region, operate_on_word)
9775 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
9776 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9777 (casify_object): Avoid integer overflow when overallocating buffer.
9778 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
9779 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
9780 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
9781 * category.h (CATEGORYP): Don't assume arg is nonnegative.
9782 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
9783 integers are now checked earlier. All uses replaced with XINT.
9785 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9786 For CCL_MapSingle, check that content and value are in int range.
9787 (ccl_driver, Fregister_code_conversion_map):
9788 Check that Vcode_version_map_vector is a vector.
9789 (resolve_symbol_ccl_program): Check that vector header is in range.
9790 Always copy the vector, so that we can check its contents reliably
9791 now rather than having to recheck each instruction as it's being
9792 executed. Check that vector words fit in 'int'.
9793 (ccl_get_compiled_code, Fregister_ccl_program)
9794 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
9795 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
9796 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
9797 contents are in range.
9798 (Fccl_execute_on_string): Check that status is in range.
9799 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
9800 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
9801 Accept and return EMACS_INT, not int, because callers can pass values
9803 (c_string_width, strwidth, lisp_string_width, chars_in_text)
9804 (multibyte_chars_in_text, parse_str_as_multibyte)
9805 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
9806 (str_as_unibyte, str_to_unibyte, string_count_byte8)
9807 (string_escape_byte8, Fget_byte):
9808 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9809 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
9810 avoid mishandling large integers.
9811 * character.h: Adjust decls to match defn changes elsewhere.
9812 * charset.c (load_charset_map_from_file, find_charsets_in_text)
9813 (Ffind_charset_region):
9814 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9815 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
9816 (load_charset_map_from_vector, Fdefine_charset_internal):
9817 Don't assume fixnum fits in int.
9818 (load_charset_map_from_vector, Fmap_charset_chars):
9819 Remove now-unnecessary CHECK_NATNUMs.
9820 (Fdefine_charset_internal): Check ranges here, more carefully.
9821 Don't rely on undefined behavior with signed left shift overflow.
9822 Don't assume unsigned int fits into fixnum, or that fixnum fits
9823 into unsigned int. Don't require max_code to be a valid fixnum;
9824 that's not true for gb10830 4-byte on a 32-bit host. Allow
9825 invalid_code to be a cons, for the same reason. Require code_offset
9826 to be a character. Avoid int overflow if max_char is close
9828 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
9829 this is intended anyway and avoids some undefined behavior.
9830 (load_charset_map): Pass unsigned, not int, as 2nd arg of
9831 INDEX_TO_CODE_POINT, as that's what it expects.
9832 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
9833 * charset.h (DECODE_CHAR): Return int, not unsigned;
9834 this is what was intended anyway, and it avoids undefined behavior.
9835 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
9836 integer-overflow issues.
9837 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
9838 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
9839 where the argument is EMACS_INT, and this behavior is not intended.
9840 * chartab.c (Fmake_char_table, Fset_char_table_range)
9841 (uniprop_get_decoder, uniprop_get_encoder):
9842 Don't assume fixnum fits in int.
9843 * cmds.c (move_point): New function, that does the gist of
9844 Fforward_char and Fbackward_char, but does so while checking
9845 for integer overflow more accurately.
9846 (Fforward_char, Fbackward_char): Use it.
9847 (Fforward_line, Fend_of_line, internal_self_insert)
9848 (internal_self_insert):
9849 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9850 Fix a FIXME, by checking for integer overflow when calculating
9851 target_clm and actual_clm.
9852 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
9853 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
9854 (ASSURE_DESTINATION, coding_alloc_by_realloc)
9855 (coding_alloc_by_making_gap, alloc_destination)
9856 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
9857 (encode_coding_utf_16, detect_coding_emacs_mule)
9858 (decode_coding_emacs_mule, encode_coding_emacs_mule)
9859 (detect_coding_iso_2022, decode_coding_iso_2022)
9860 (encode_invocation_designation, encode_designation_at_bol)
9861 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
9862 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
9863 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
9864 (encode_coding_ccl, encode_coding_raw_text)
9865 (detect_coding_charset, decode_coding_charset)
9866 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
9867 (produce_composition, produce_charset, produce_annotation)
9868 (decode_coding, handle_composition_annotation)
9869 (handle_charset_annotation, consume_chars, decode_coding_gap)
9870 (decode_coding_object, encode_coding_object, detect_coding_system)
9871 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
9872 (code_convert_region, code_convert_string)
9873 (Fdefine_coding_system_internal)
9874 (coding_set_source, coding_set_destination):
9875 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9876 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
9877 (Fdefine_coding_system_internal):
9878 Don't assume fixnums fit in int.
9879 (decode_coding_gap, decode_coding_object, encode_coding_object)
9880 (Fread_coding_system, Fdetect_coding_region)
9881 (Funencodable_char_position, Fcheck_coding_systems_region)
9882 (get_translation, handle_composition_annotation, consume_chars):
9883 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9884 (consume_chars): Rewrite to not calculate an address outside buffer.
9885 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
9886 Don't access memory outside of the args array.
9887 (Fdefine_coding_system_internal): Check for charset-id overflow.
9888 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
9889 result of ENCODE_CHAR.
9890 * coding.h: Adjust decls to match defn changes elsewhere.
9891 (struct coding_system):
9892 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9893 * composite.c (get_composition_id, find_composition)
9894 (run_composition_function, update_compositions)
9895 (compose_text, composition_gstring_put_cache)
9896 (composition_gstring_p, composition_gstring_width)
9897 (fill_gstring_header, fill_gstring_body, autocmp_chars)
9898 (composition_compute_stop_pos, composition_reseat_it)
9899 (composition_update_it, struct position_record)
9900 (find_automatic_composition, composition_adjust_point)
9901 (Fcomposition_get_gstring, Ffind_composition_internal):
9902 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9903 (update_compositions):
9904 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9905 * composite.h: Adjust decls to match defn changes elsewhere.
9906 (struct composition):
9907 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9908 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
9909 Do not attempt to compute the address of the object just before a
9910 buffer; this is not portable.
9912 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9913 (Faset): Use int, not EMACS_INT, where int is wide enough.
9914 (Fstring_to_number): Don't assume fixnums fit in int.
9915 (Frem): Don't assume arg is nonnegative.
9916 * dbusbind.c (xd_append_arg): Check for integers out of range.
9917 (Fdbus_call_method): Don't overflow the timeout int.
9918 (extract_signed, extract_unsigned): New functions.
9919 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
9920 (xd_get_connection_references): Return ptrdiff_t, not int.
9922 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
9923 (xd_read_message_1):
9924 Use int, not unsigned, where the dbus API uses int.
9925 (Fdbus_message_internal): Don't overflow mtype.
9926 (syms_of_dbusbind): Allocate right-sized buffer for integers.
9927 * dired.c (directory_files_internal, file_name_completion, scmp)
9928 (file_name_completion_stat):
9929 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9930 (file_name_completion): Don't overflow matchcount.
9931 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
9932 * dispextern.h: Adjust decls to match defn changes elsewhere.
9933 (struct text_pos, struct glyph, struct bidi_saved_info)
9934 (struct bidi_string_data, struct bidi_it, struct composition_it)
9936 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9937 (struct display_pos, struct composition_it, struct it):
9938 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9939 * dispnew.c (increment_matrix_positions)
9940 (increment_row_positions, mode_line_string)
9941 (marginal_area_string):
9942 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9943 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
9944 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9945 (duration_to_sec_usec): New function, to check for overflow better.
9946 (Fsleep_for, sit_for): Use it.
9947 * doc.c (get_doc_string, store_function_docstring):
9948 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9949 (get_doc_string, Fsnarf_documentation):
9950 Use int, not EMACS_INT, where int is wide enough.
9952 Use SAFE_ALLOCA, not alloca.
9953 Check for overflow when converting EMACS_INT to off_t.
9954 * doprnt.c (doprnt):
9955 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9956 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
9957 Don't assume uid_t fits into fixnum.
9958 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
9959 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
9960 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
9961 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
9962 (general_insert_function)
9963 (Finsert_char, make_buffer_string, make_buffer_string_both)
9964 (update_buffer_properties, Fbuffer_substring)
9965 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
9966 (Fsubst_char_in_region, check_translation)
9967 (Ftranslate_region_internal, save_restriction_restore, Fformat)
9968 (transpose_markers, Ftranspose_regions):
9969 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9970 (clip_to_bounds): Move to lisp.h as an inline function).
9971 (Fconstrain_to_field): Don't assume integers are nonnegative.
9972 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
9973 (Fsubst_char_in_region, Fsave_restriction):
9974 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9975 (Femacs_pid): Don't assume pid_t fits into fixnum.
9976 (lo_time): Use int, not EMACS_INT, when int suffices.
9977 (lisp_time_argument): Check for usec out of range.
9978 (Fencode_time): Don't assume fixnum fits in int.
9979 (Fuser_login_name, Fuser_full_name): Signal an error
9980 if a uid argument is out of range, rather than relying on
9982 (Fformat_time_string): Remove now-unnecessary check.
9983 lisp_time_argument checks for out-of-range usec now.
9984 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
9985 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
9986 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
9987 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
9988 (init_cmdargs, Fdump_emacs):
9989 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9990 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
9991 the bottom (typically) 32 bits of the fixnum.
9992 * eval.c (specpdl_size, call_debugger):
9993 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9994 (when_entered_debugger, Fbacktrace_debug):
9995 Don't assume fixnum can fit in int.
9996 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
9997 the object just before a buffer; this is not portable.
9998 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
9999 (grow_specpdl, unbind_to):
10000 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10001 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
10002 (grow_specpdl): Simplify allocation by using xpalloc.
10003 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
10004 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
10005 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
10006 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10007 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
10008 (a_write, e_write):
10009 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10010 (Fcopy_file, non_regular_nbytes, read_non_regular)
10011 (Finsert_file_contents):
10012 Use int, not EMACS_INT, where int is wide enough.
10013 (READ_BUF_SIZE): Verify that it fits in int.
10014 (Finsert_file_contents): Check that counts are in proper range,
10015 rather than assuming fixnums fit into ptrdiff_t etc.
10016 Don't assume fixnums fit into int.
10017 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
10018 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
10019 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
10020 (string_char_to_byte, string_byte_to_char)
10021 (string_make_multibyte, string_to_multibyte)
10022 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
10023 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
10024 (substring_both, Fdelete, internal_equal, Ffillarray)
10025 (Fclear_string, mapcar1)
10026 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
10027 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
10028 (larger_vector, make_hash_table, maybe_resize_hash_table)
10029 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
10030 (Fmaphash, secure_hash):
10031 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10032 (concat): Check for string index and length overflow.
10033 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
10035 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10036 (larger_vector): New API (vec, incr_min, size_max) replaces old
10037 one (vec, new_size, init). This catches size overflow.
10038 INIT was removed because it was always Qnil.
10039 All callers changed.
10040 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
10041 the upper bound on a hash table index size.
10042 (make_hash_table, maybe_resize_hash_table): Use it.
10043 (secure_hash): Computer start_byte and end_byte only after
10044 they're known to be in ptrdiff_t range.
10045 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
10046 (Ffont_get_glyphs, Ffont_at):
10047 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10048 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
10049 (Flist_fonts, Fopen_font):
10050 Don't assume fixnum can fit in int.
10051 (check_gstring): Don't assume index can fit in int.
10052 (font_match_p): Check that fixnum is a character, not a nonnegative
10053 fixnum, since the later code needs to stuff it into an int.
10054 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
10055 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
10056 conversion overflow issues.
10057 (Fopen_font): Check for integer out of range.
10058 (Ffont_get_glyphs): Don't assume index can fit in int.
10059 * font.h: Adjust decls to match defn changes elsewhere.
10060 * fontset.c (reorder_font_vector): Redo score calculation to avoid
10062 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
10063 printmax_t, where ptrdiff_t is wide enough.
10064 (Finternal_char_font):
10065 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10066 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
10067 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
10068 (Fset_frame_position, x_set_frame_parameters)
10069 (x_set_line_spacing, x_set_border_width)
10070 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
10071 Check that fixnums are in proper range for system types.
10072 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
10073 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10074 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
10075 Use SAFE_ALLOCA_LISP, not alloca.
10076 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
10077 intptr_t is wide enough.
10078 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
10079 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
10080 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
10081 Check for fixnum out of range.
10082 * ftfont.c (ftfont_list): Don't assume index fits in int.
10083 Check that fixnums are in proper range for system types.
10084 (ftfont_shape_by_flt):
10085 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10086 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
10087 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10088 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
10089 Check that fixnums are in proper range for system types.
10090 * gnutls.h: Adjust decls to match defn changes elsewhere.
10091 * gtkutil.c (xg_dialog_run):
10092 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10093 (update_frame_tool_bar):
10094 Check that fixnums are in proper range for system types.
10095 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
10096 (lookup_image): Check that fixnums are in range for system types.
10097 * indent.c (last_known_column, last_known_column_point):
10098 (current_column_bol_cache):
10099 (skip_invisible, current_column, check_display_width):
10100 (check_display_width, scan_for_column, current_column_1)
10101 (Findent_to, Fcurrent_indentation, position_indentation)
10102 (indented_beyond_p, Fmove_to_column, compute_motion):
10103 (Fcompute_motion, Fvertical_motion):
10104 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10105 (last_known_column_modified): Use EMACS_INT, not int.
10106 (check_display_width):
10108 Check that fixnums and floats are in proper range for system types.
10109 (compute_motion): Don't assume index or fixnum fits in int.
10110 (compute_motion, Fcompute_motion):
10111 Use int, not EMACS_INT, when it is wide enough.
10112 (vmotion): Omit local var start_hpos that is always 0; that way
10113 we don't need to worry about overflow in expressions involving it.
10114 * indent.h: Adjust decls to match defn changes elsewhere.
10116 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10117 Use int, not EMACS_INT, where int is wide enough.
10118 Remove unused members ovstring_chars_done and tab_offset;
10120 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
10121 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
10122 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
10123 (make_gap, copy_text, insert, insert_and_inherit)
10124 (insert_before_markers, insert_before_markers_and_inherit)
10125 (insert_1, count_combining_before, count_combining_after)
10126 (insert_1_both, insert_from_string)
10127 (insert_from_string_before_markers, insert_from_string_1)
10128 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
10129 (adjust_after_replace, adjust_after_insert, replace_range)
10130 (replace_range_2, del_range, del_range_1, del_range_byte)
10131 (del_range_both, del_range_2, modify_region)
10132 (prepare_to_modify_buffer, signal_before_change)
10133 (signal_after_change, Fcombine_after_change_execute):
10134 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10135 * intervals.c (traverse_intervals, rotate_right, rotate_left)
10136 (balance_an_interval, split_interval_right, split_interval_left)
10137 (find_interval, next_interval, update_interval)
10138 (adjust_intervals_for_insertion, delete_node, delete_interval)
10139 (interval_deletion_adjustment, adjust_intervals_for_deletion)
10140 (static_offset_intervals, offset_intervals)
10141 (merge_interval_right, merge_interval_left, make_new_interval)
10142 (graft_intervals_into_buffer, temp_set_point_both)
10143 (temp_set_point, set_point, adjust_for_invis_intang)
10144 (set_point_both, move_if_not_intangible, get_property_and_range)
10145 (get_local_map, copy_intervals, copy_intervals_to_string)
10146 (compare_string_intervals, set_intervals_multibyte_1):
10147 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10148 * intervals.h: Adjust decls to match defn changes elsewhere.
10150 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10151 * keyboard.c (this_command_key_count, this_single_command_key_start)
10152 (before_command_key_count, before_command_echo_length, echo_now)
10153 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
10154 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
10155 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
10156 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
10157 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10158 (last_non_minibuf_size, last_point_position, echo_truncate)
10159 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
10160 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
10161 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
10162 (stuff_buffered_input):
10163 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10164 (last_auto_save, command_loop_1, read_char):
10165 Use EMACS_INT, not int, to avoid integer overflow.
10166 (record_char): Avoid overflow in total_keys computation.
10167 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
10168 * keyboard.h: Adjust decls to match defn changes elsewhere.
10169 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
10170 (Fkey_description, Fdescribe_vector, Flookup_key):
10171 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10172 (click_position): New function, to check that positions are in range.
10173 (Fcurrent_active_maps):
10174 (describe_command):
10175 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10176 (Faccessible_keymaps, Fkey_description):
10177 (preferred_sequence_p):
10178 Don't assume fixnum can fit into int.
10179 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
10180 Check for integer overflow in size calculations.
10181 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
10182 avoid mishandling large integers.
10183 * lisp.h: Adjust decls to match defn changes elsewhere.
10184 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
10185 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
10186 (struct Lisp_Marker):
10187 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10188 (clip_to_bounds): Now an inline function, moved here from editfns.c.
10189 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
10190 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
10191 All callers changed.
10192 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
10193 Assume the arg has valid form, since it always does.
10194 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
10195 unsigned integer system type.
10196 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
10197 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
10198 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10199 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
10200 (duration_to_sec_usec): New decl.
10201 * lread.c (read_from_string_index, read_from_string_index_byte)
10202 (read_from_string_limit, readchar, unreadchar, openp)
10203 (read_internal_start, read1, oblookup):
10204 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10205 (Fload, readevalloop, Feval_buffer, Feval_region):
10206 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10207 (openp): Check for out-of-range argument to 'access'.
10208 (read1): Use int, not EMACS_INT, where int is wide enough.
10209 Don't assume fixnum fits into int.
10210 Fix off-by-one error that can read outside a buffer.
10211 (read_filtered_event): Use duration_to_sec_usec
10212 to do proper overflow checking on durations.
10213 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
10214 in size calculation.
10215 (Fexecute_kbd_macro):
10216 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10217 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
10218 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
10219 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
10220 (set_marker_both, set_marker_restricted_both, marker_position)
10221 (marker_byte_position, Fbuffer_has_markers_at):
10222 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10223 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
10224 * menu.c (ensure_menu_items): Rename from grow_menu_items.
10225 It now merely ensures that the menu is large enough, without
10226 necessarily growing it, as this avoids some integer overflow issues.
10227 All callers changed.
10228 (keymap_panes, parse_single_submenu, Fx_popup_menu):
10229 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10230 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
10231 Use SAFE_ALLOCA_LISP, not alloca.
10232 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
10233 to EMACS_INT. Check that fixnums are in proper range for system types.
10234 * minibuf.c (minibuf_prompt_width, string_to_object)
10235 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
10236 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
10237 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10238 (get_minibuffer, read_minibuf_unwind):
10239 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10240 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
10241 this simplifies overflow checking. All callers changed.
10242 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
10243 (Ftest_completion):
10244 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10245 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
10246 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
10247 Check that fixnums are in proper range for system types.
10248 (Fx_create_frame, Fx_show_tip):
10249 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10250 * nsfont.m (ns_findfonts, nsfont_list_family):
10251 Don't assume fixnum fits in long.
10252 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
10253 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10254 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
10256 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
10257 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10258 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
10259 (PRINTDECLARE, PRINTPREPARE):
10260 (strout, print_string):
10261 (print, print_preprocess, print_check_string_charset_prop)
10263 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10265 (temp_output_buffer_setup, Fprin1_to_string, print_object):
10266 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10267 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
10268 (printchar, strout): Use xpalloc to catch size calculation overflow.
10269 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
10270 (print_error_message): Use SAFE_ALLOCA, not alloca.
10271 (print_object): Use int, not EMACS_INT, where int is wide enough.
10272 (print_depth, new_backquote_output, print_number_index):
10273 Use ptrdiff_t, not int, where int might not be wide enough.
10274 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
10275 (Fset_process_window_size, Fformat_network_address)
10276 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
10278 Check that fixnums are in proper range for system types.
10279 (Fsignal_process): Simplify by avoiding a goto.
10280 Check for process-ids out of pid_t range rather than relying on
10281 undefined behavior.
10282 (process_tick, update_tick): Use EMACS_INT, not int.
10283 (Fformat_network_address, read_process_output, send_process)
10284 (Fprocess_send_region, status_notify):
10285 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10286 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
10287 (wait_reading_process_output, read_process_output, exec_sentinel):
10288 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10289 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
10290 (Faccept_process_output): Use duration_to_sec_usec to do proper
10291 overflow checking on durations.
10292 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
10293 Don't assume pid_t fits in int.
10294 * process.h (struct Lisp_Process): Members tick and update_tick
10295 are now of type EMACS_INT, not int.
10296 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
10297 configured --with-wide-int.
10298 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
10299 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
10300 * search.c (looking_at_1, string_match_1):
10301 (fast_string_match, fast_c_string_match_ignore_case)
10302 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
10303 (scan_newline, find_before_next_newline, search_command)
10304 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
10305 (set_search_regs, wordify):
10308 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10309 (string_match_1, search_buffer, set_search_regs):
10311 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10312 (wordify): Check for overflow in size calculation.
10313 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
10314 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
10315 Check that fixnums are in proper range for system types.
10316 * sound.c (struct sound_device)
10317 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
10318 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10319 (Fplay_sound_internal):
10320 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10321 * syntax.c (struct lisp_parse_state, find_start_modiff)
10322 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
10323 (Fparse_partial_sexp):
10324 Don't assume fixnums can fit in int.
10325 (struct lisp_parse_state, find_start_pos, find_start_value)
10326 (find_start_value_byte, find_start_begv)
10327 (update_syntax_table, char_quoted, dec_bytepos)
10328 (find_defun_start, prev_char_comend_first, back_comment):
10329 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
10330 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
10331 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10332 (Finternal_describe_syntax_value): Check that match_lisp is a
10333 character, not an integer, since the code stuffs it into int.
10334 (scan_words, scan_sexps_forward):
10335 Check that fixnums are in proper range for system types.
10337 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10338 (scan_sexps_forward):
10339 Use CHARACTERP, not INTEGERP, since the value must fit into int.
10340 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
10341 * syntax.h: Adjust decls to match defn changes elsewhere.
10342 (struct gl_state_s):
10343 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10344 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
10345 MOST_POSITIVE_FIXNUM.
10346 * sysdep.c (wait_for_termination_1, wait_for_termination)
10347 (interruptible_wait_for_termination, mkdir):
10348 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
10349 (emacs_read, emacs_write):
10350 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10351 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
10352 and double all fit in int.
10353 * term.c (set_tty_color_mode):
10354 Check that fixnums are in proper range for system types.
10355 * termhooks.h (struct input_event):
10356 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10357 * textprop.c (validate_interval_range, interval_of)
10358 (Fadd_text_properties, set_text_properties_1)
10359 (Fremove_text_properties, Fremove_list_of_text_properties)
10360 (Ftext_property_any, Ftext_property_not_all)
10361 (copy_text_properties, text_property_list, extend_property_ranges)
10362 (verify_interval_modification):
10363 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10364 (Fnext_single_char_property_change)
10365 (Fprevious_single_char_property_change):
10366 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10367 (copy_text_properties):
10368 Check for integer overflow in index calculation.
10369 * undo.c (last_boundary_position, record_point, record_insert)
10370 (record_delete, record_marker_adjustment, record_change)
10371 (record_property_change):
10372 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10373 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
10374 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10375 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
10376 (Fx_hide_tip, Fx_file_dialog):
10377 * w32menu.c (set_frame_menubar):
10378 Use ptrdiff_t, not int, for consistency with rest of code.
10379 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
10380 (select_window, Fdelete_other_windows_internal)
10381 (window_scroll_pixel_based, window_scroll_line_based)
10382 (Frecenter, Fset_window_configuration):
10383 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10384 (Fset_window_hscroll, run_window_configuration_change_hook)
10385 (set_window_buffer, temp_output_buffer_show, scroll_command)
10386 (Fscroll_other_window, Frecenter):
10387 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10388 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
10389 Don't assume fixnum fits in int.
10390 (Fset_window_scroll_bars):
10391 Check that fixnums are in proper range for system types.
10392 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
10393 (string_pos, c_string_pos, number_of_chars, init_iterator)
10394 (in_ellipses_for_invisible_text_p, init_from_display_pos)
10395 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
10396 (compute_display_string_end, handle_face_prop)
10397 (face_before_or_after_it_pos, handle_invisible_prop)
10398 (handle_display_prop, handle_display_spec, handle_single_display_spec)
10399 (display_prop_intangible_p, string_buffer_position_lim)
10400 (string_buffer_position, handle_composition_prop, load_overlay_strings)
10401 (get_overlay_strings_1, get_overlay_strings)
10402 (iterate_out_of_display_property, forward_to_next_line_start)
10403 (back_to_previous_visible_line_start, reseat, reseat_to_string)
10404 (get_next_display_element, set_iterator_to_next)
10405 (get_visually_first_element, compute_stop_pos_backwards)
10406 (handle_stop_backwards, next_element_from_buffer)
10407 (move_it_in_display_line_to, move_it_in_display_line)
10408 (move_it_to, move_it_vertically_backward, move_it_by_lines)
10409 (add_to_log, message_dolog, message_log_check_duplicate)
10410 (message2, message2_nolog, message3, message3_nolog
10411 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
10412 (current_message_1, truncate_echo_area, truncate_message_1)
10413 (set_message, set_message_1, store_mode_line_noprop)
10414 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
10415 (text_outside_line_unchanged_p, check_point_in_composition)
10416 (reconsider_clip_changes)
10417 (redisplay_internal, set_cursor_from_row, try_scrolling)
10418 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
10419 (redisplay_window, find_last_unchanged_at_beg_row)
10420 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
10421 (trailing_whitespace_p, find_row_edges, display_line)
10422 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
10423 (display_mode_element, store_mode_line_string)
10424 (pint2str, pint2hrstr, decode_mode_spec)
10425 (display_count_lines, display_string, draw_glyphs)
10426 (x_produce_glyphs, x_insert_glyphs)
10427 (rows_from_pos_range, mouse_face_from_buffer_pos)
10428 (fast_find_string_pos, mouse_face_from_string_pos)
10429 (note_mode_line_or_margin_highlight, note_mouse_highlight):
10430 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10431 (safe_call, init_from_display_pos, handle_fontified_prop)
10432 (handle_single_display_spec, load_overlay_strings)
10433 (with_echo_area_buffer, setup_echo_area_for_printing)
10434 (display_echo_area, echo_area_display)
10435 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
10436 (update_tool_bar, hscroll_window_tree, redisplay_internal)
10437 (redisplay_window, dump_glyph_row, display_mode_line)
10438 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
10439 (handle_display_spec, display_prop_string_p):
10440 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10441 (handle_single_display_spec, build_desired_tool_bar_string)
10442 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
10443 (get_specified_cursor_type):
10444 Check that fixnums are in proper range for system types.
10445 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
10446 (Flookup_image_map):
10447 Don't assume fixnums fit in int.
10448 (compare_overlay_entries):
10449 Avoid mishandling comparisons due to subtraction overflow.
10450 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
10451 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
10452 (handle_tool_bar_click):
10453 Use int, not unsigned, since we prefer signed and the signedness
10454 doesn't matter here.
10455 (get_next_display_element, next_element_from_display_vector):
10456 Use int, not EMACS_INT, when int is wide enough.
10457 (start_hourglass): Use duration_to_sec_usec to do proper
10458 overflow checking on durations.
10459 * xfaces.c (Fbitmap_spec_p):
10460 Check that fixnums are in proper range for system types.
10461 (compare_fonts_by_sort_order):
10462 Avoid mishandling comparisons due to subtraction overflow.
10463 (Fx_family_fonts, realize_basic_faces):
10464 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10466 Don't assume fixnum fits in int.
10467 Use SAFE_ALLOCA_LISP, not alloca.
10468 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
10469 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
10470 (face_at_buffer_position, face_for_overlay_string)
10471 (face_at_string_position):
10472 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10473 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
10474 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
10476 Check that fixnums are in proper range for system types.
10477 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
10478 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
10479 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10480 (Fx_change_window_property): Don't assume fixnums fit in int.
10481 * xfont.c (xfont_chars_supported):
10482 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10483 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
10484 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
10485 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10486 * xml.c (parse_region):
10487 * xrdb.c (magic_file_p):
10488 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10489 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
10490 (x_get_local_selection, x_reply_selection_request)
10491 (x_handle_selection_request, wait_for_property_change):
10492 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10493 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
10494 short is wide enough.
10495 (x_send_client_event): Don't assume fixnum fits in int.
10496 * xterm.c (x_x_to_emacs_modifiers):
10497 Don't assume EMACS_INT overflows nicely into int.
10498 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
10499 may come from Lisp.
10500 (handle_one_xevent): NATNUMP can eval its arg twice.
10501 (x_connection_closed):
10502 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10503 * xterm.h: Adjust decls to match defn changes elsewhere.
10504 (struct scroll_bar): Use struct vectorlike_header
10505 rather than rolling our own approximation.
10506 (SCROLL_BAR_VEC_SIZE): Remove; not used.
10508 2012-05-25 Glenn Morris <rgm@gnu.org>
10510 * lisp.mk (lisp): Update for more files being compiled now.
10512 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
10514 * lread.c: Remove `read_pure' which makes no difference.
10515 (read_pure): Remove var.
10516 (unreadpure): Remove function.
10517 (readevalloop): Don't call read_list with -1 flag.
10518 (read1, read_vector): Don't test read_pure any more.
10519 (read_list): Simplify.
10521 * fileio.c, character.h: Minor style tweaks.
10523 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
10525 * window.h (clip_changed): Remove useless declaration.
10527 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
10529 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
10530 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
10532 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
10535 This directory predates autoconf and is no longer needed nowadays.
10536 Move its few remaining bits of functionality to where they're needed.
10537 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
10538 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
10539 * m/template.h: Remove.
10540 * Makefile.in (M_FILE): Remove. All uses removed.
10541 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
10542 * lisp.h (USE_LSB_TAG):
10543 * mem-limits.h (EXCEEDS_LISP_PTR):
10544 Use VAL_MAX, not VALBITS, in #if.
10545 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
10546 (EMACS_UINT): Define unconditionally now.
10547 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
10548 (BITS_PER_EMACS_INT): New constants, replacing
10549 what used to be in config.h, but not useful in #if.
10550 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
10551 define them any more.
10552 (VAL_MAX): New macro.
10554 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
10555 BITS_PER_EMACS_INT, in #if.
10556 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
10557 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
10558 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
10559 * s/ms-w32.h (DATA_START):
10560 Move here from removed file m/intel386.h.
10561 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
10562 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
10564 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
10566 Assume C89 or later.
10567 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
10568 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
10570 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
10571 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
10572 * textprop.c, tparam.c (NULL): Remove.
10573 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
10574 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
10575 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
10576 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
10577 * xterm.c (input_signal_count): Assume volatile works.
10579 2012-05-21 Ken Brown <kbrown@cornell.edu>
10581 * xgselect.c (xg_select): Fix first argument in call to 'select'
10584 2012-05-20 Ken Brown <kbrown@cornell.edu>
10586 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
10587 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
10589 2012-05-19 Ken Brown <kbrown@cornell.edu>
10591 * xfns.c (x_in_use): Remove `static' qualifier.
10592 * xterm.h (x_in_use): Declare.
10593 * xgselect.c: Include xterm.h.
10594 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
10595 and `display_arg' (bug#9754).
10597 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
10599 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
10601 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
10602 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
10604 2012-05-18 Eli Zaretskii <eliz@gnu.org>
10606 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
10608 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
10609 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
10611 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
10612 reference to image_cache->refcount.
10613 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
10615 2012-05-17 Juri Linkov <juri@jurta.org>
10617 * search.c (Fword_search_regexp, Fword_search_backward)
10618 (Fword_search_forward, Fword_search_backward_lax)
10619 (Fword_search_forward_lax): Move functions to isearch.el
10620 (bug#10145, bug#11381).
10622 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
10624 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
10626 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
10628 * lread.c (init_obarray): Declare Qt and Qnil as special.
10630 2012-05-14 Glenn Morris <rgm@gnu.org>
10632 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
10633 Put "libexec" before "bin", for the sake of init_callproc_1.
10635 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
10637 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
10639 * unexaix.c: Port to more-recent AIX compilers.
10640 (report_error, report_error_1, make_hdr, copy_sym)
10641 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
10642 Make arguments const char *, not char *, to avoid violations of C
10643 standard and to fix some AIX warnings reported by Gilles Pion.
10645 2012-05-14 Eli Zaretskii <eliz@gnu.org>
10647 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
10648 already have overlays loaded.
10649 (handle_single_display_spec): Before returning without displaying
10650 fringe bitmap, synchronize the bidi iterator with the main display
10651 iterator, by calling iterate_out_of_display_property.
10652 (iterate_out_of_display_property): Detect buffer iteration by
10653 testing that it->string is a Lisp string.
10654 (get_next_display_element): When the current object is exhausted,
10655 and there's something on it->stack, call set_iterator_to_next to
10656 proceed with what's on the stack, instead of returning zero.
10657 (set_iterator_to_next): If called at the end of a Lisp string,
10658 proceed to consider_string_end without incrementing string
10659 position. Don't increment display vector index past the end of
10660 the display vector. (Bug#11417)
10661 (pos_visible_p): Don't report a position visible when move_it_to
10662 stopped at the last line of window, which happens to be scanned
10663 backwards by the bidi iteration. (Bug#11464)
10665 2012-05-14 Eli Zaretskii <eliz@gnu.org>
10667 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
10668 and right-margin display specs even if the spec is invalid or we
10669 are on a TTY, and thus unable to display on the fringes.
10670 That's because the text with the property will not be displayed anyway,
10671 so we need to signal to the caller that this is a "replacing"
10672 display spec. This fixes display when the spec is invalid or we
10675 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
10677 * unexaix.c (make_hdr): Fix typo in prototype.
10678 This bug broke the build on AIX. Problem reported by Gilles Pion.
10680 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
10682 * keyboard.c (kbd_buffer_get_event): Read special events also in
10683 batch mode. (Bug#11415)
10685 2012-05-12 Glenn Morris <rgm@gnu.org>
10687 * ns.mk: Update for ns_appbindir no longer having trailing "/".
10689 2012-05-12 Eli Zaretskii <eliz@gnu.org>
10691 * lisp.mk (lisp): Add newcomment.elc.
10693 2012-05-12 Glenn Morris <rgm@gnu.org>
10695 * Makefile.in (MKDIR_P): New, set by configure.
10696 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
10698 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
10700 Remove unused function hourglass_started.
10701 * dispextern.h (hourglass_started):
10702 * w32fns.c (hourglass_started):
10703 * xdisp.c (hourglass_started): Remove.
10705 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
10707 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
10708 Update dependencies.
10710 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
10712 * xgselect.c (xg_select): Put maxfds+1 into a var.
10713 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
10715 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
10717 2012-05-10 Dave Abrahams <dave@boostpro.com>
10719 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
10720 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
10722 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
10724 * dbusbind.c (xd_registered_buses): New internal Lisp object.
10725 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
10726 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
10727 Initialize xd_registered_buses.
10729 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
10731 Untag more efficiently if USE_LSB_TAG.
10732 This is based on a proposal by YAMAMOTO Mitsuharu in
10733 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
10734 For an admittedly artificial (nth 8000 longlist) benchmark on
10735 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
10736 Emacs's overall text size by 1%.
10737 * lisp.h (XUNTAG): New macro.
10738 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
10739 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
10740 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
10741 * eval.c (Fautoload):
10742 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
10743 * frame.h (XFRAME): Use XUNTAG.
10745 Port recent dbusbind.c changes to 32-bit --with-wide-int.
10746 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
10747 Remove unportable assumptions about print widths of types like
10749 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
10750 intptr_t when converting between pointer and integer, to avoid GCC
10751 warnings about wrong width.
10753 2012-05-09 Eli Zaretskii <eliz@gnu.org>
10755 * w32proc.c (new_child): Force Windows to reserve only 64KB of
10756 stack for each reader_thread, instead of defaulting to 8MB
10757 determined by the linker. This avoids failures in creating
10758 subprocesses on Windows 7, see the discussion in this thread:
10759 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
10761 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
10763 Fix up display of the *Minibuf-0* buffer in the mini window.
10764 * keyboard.c (read_char): Don't clear the echo area if there's no
10766 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
10767 contents of *Minibuf-0*) if there's no message displayed in its stead.
10769 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
10771 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
10774 2012-05-06 Chong Yidong <cyd@gnu.org>
10776 * lisp.mk (lisp): Update.
10778 2012-05-05 Jim Meyering <meyering@redhat.com>
10780 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
10782 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
10784 * data.c (PUT_ERROR): New macro.
10785 (syms_of_data): Use it. Add new error type `user-error'.
10786 * undo.c (user_error): New function.
10787 (Fprimitive_undo): Use it.
10788 * print.c (print_error_message): Adjust print style for `user-error'.
10789 * keyboard.c (user_error): New function.
10790 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
10792 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
10794 Do not limit current-time-string to years 1000..9999.
10795 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
10796 (Fcurrent_time_string): Support any year that is supported by the
10797 underlying localtime representation. Don't use asctime, as it
10798 has undefined behavior for years outside the range -999..9999.
10800 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
10802 Fix race conditions involving setenv, gmtime, localtime, asctime.
10803 Without this fix, interrupts could mess up code that uses these
10804 nonreentrant functions, since setting TZ invalidates existing
10805 tm_zone or tzname values, and since most of these functions return
10806 pointers to static storage.
10807 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
10808 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
10809 Grow the critical sections to include not just invoking
10810 localtime/gmtime, but also accessing these functions' results
10811 including their tm_zone values if any, and any related TZ setting.
10812 (format_time_string): Last arg is now struct tm *, not struct tm **,
10813 so that the struct tm is saved in the critical section.
10814 All callers changed. Simplify allocation of initial buffer, partly
10815 motivated by the fact that memory allocation needs to be outside
10816 the critical section.
10818 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
10820 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
10821 with RESET_INTERVAL.
10823 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
10824 Remove duplicated buffer name initialization.
10826 2012-05-02 Jim Meyering <jim@meyering.net>
10828 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
10830 * xfns.c (x_window): Use xstrdup (Bug#11375).
10832 2012-05-02 Eli Zaretskii <eliz@gnu.org>
10834 * xdisp.c (pos_visible_p): If already at a newline from the
10835 display string before the 'while' loop, don't walk back the glyphs
10836 from it3.glyph_row. Solves assertion violation when the display
10837 string begins with a newline (egg.el). (Bug#11367)
10839 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
10841 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
10844 2012-05-01 Glenn Morris <rgm@gnu.org>
10846 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
10847 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
10848 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
10849 All were removed before 23.1.
10851 * dispnew.c: Remove HAVE_LIBNCURSES test;
10852 it is always true on relevant platforms.
10854 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
10855 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
10857 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
10859 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
10861 * .gdbinit (xpr): Remove checks for no longer existing misc types.
10862 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
10865 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
10867 Do not avoid creating empty evaporating overlays (Bug#9642).
10868 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
10869 That is, do not delete an evaporating overlay if it becomes
10870 empty after its bounds are adjusted to fit within its buffer.
10871 This fix caused other problems, and I'm reverting it until we get
10872 to the bottom of them.
10874 2012-04-27 Chong Yidong <cyd@gnu.org>
10876 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
10878 2012-04-27 Eli Zaretskii <eliz@gnu.org>
10880 * xdisp.c (pos_visible_p): If the window start position is beyond
10881 ZV, start the display from buffer beginning. Prevents assertion
10882 violation in init_iterator when the minibuffer window is scrolled
10883 via the scroll bar.
10885 * window.c (window_scroll_pixel_based): Likewise.
10887 2012-04-27 Chong Yidong <cyd@gnu.org>
10889 * keymap.c (where_is_internal): Doc fix (Bug#10872).
10891 2012-04-27 Glenn Morris <rgm@gnu.org>
10893 * fileio.c (Fcopy_file, Fset_file_selinux_context):
10894 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
10896 2012-04-27 Eli Zaretskii <eliz@gnu.org>
10898 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
10899 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
10901 2012-04-26 Eli Zaretskii <eliz@gnu.org>
10903 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
10904 display element, check also the underlying string or buffer
10905 character. (Bug#11341)
10907 * w32menu.c: Include w32heap.h.
10908 (add_menu_item): If the call to AppendMenuW (via
10909 unicode_append_menu) fails, disable Unicode menus only if we are
10910 running on Windows 9X/Me.
10912 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
10914 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
10915 (xgetint): Add missing shift for LSB tags.
10917 2012-04-24 Martin Rudalics <rudalics@gmx.at>
10919 * keyboard.c (read_char): Don't wipe echo area for select window
10920 events: These might get delayed via `mouse-autoselect-window'
10923 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
10925 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
10926 manipulation of :loaded-from data.
10928 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
10930 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
10931 now a cons (bug#11311).
10933 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
10935 Do not create empty overlays with the evaporate property (Bug#9642).
10936 * buffer.c (Fmove_overlay): Delete an evaporating overlay
10937 if it becomes empty after its bounds are adjusted to fit within
10938 its buffer. Without this fix, in a nonempty buffer (let ((o
10939 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
10940 yields an empty overlay that has the evaporate property, which is
10941 not supposed to happen.
10943 Fix minor GTK3 problems found by static checking.
10944 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
10945 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
10946 (struct _EmacsFixedClass, emacs_fixed_get_type):
10947 Move decls here from emacsgtkfixed.h, since they needn't be public.
10948 (emacs_fixed_get_type): Now static.
10949 (emacs_fixed_class_init): Omit unused local.
10950 (emacs_fixed_child_type): Remove; unused.
10951 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
10952 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
10953 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
10954 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
10955 (EMACS_FIXED_GET_CLASS): Remove; unused.
10956 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
10958 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
10959 Problem reported by Juanma Barranquero for Windows -Wunused-function.
10961 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
10963 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
10964 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
10965 (__malloc_size_t, __malloc_ptrdiff_t):
10966 Remove. All uses removed, replaced by the definiens if needed,
10967 since we can assume C89 or better now.
10968 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
10969 (protect_malloc_state, align, get_contiguous_space)
10970 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
10971 (malloc_atfork_handler_child, malloc_enable_thread)
10972 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
10973 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
10974 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
10975 (special_realloc, _realloc_internal_nolock, _realloc_internal)
10976 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
10977 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
10978 Define using prototypes, not old style.
10979 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
10980 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
10981 (align): Don't assume that signed integer overflow wraps around.
10982 Omit unused local var.
10983 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
10984 (_free_internal_nolock, memalign, mallochook, reallochook):
10985 Omit no-longer-needed casts.
10986 (valloc): Use getpagesize, not __getpagesize.
10987 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
10988 (struct hdr): The 'magic' member is now size_t, not unsigned long.
10990 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
10992 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
10994 Move functions from C to Lisp. Make non-blocking method calls
10995 the default. Implement further D-Bus standard interfaces.
10997 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
10998 (QCdbus_request_name_allow_replacement)
10999 (QCdbus_request_name_replace_existing)
11000 (QCdbus_request_name_do_not_queue)
11001 (QCdbus_request_name_reply_primary_owner)
11002 (QCdbus_request_name_reply_in_queue)
11003 (QCdbus_request_name_reply_exists)
11004 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
11005 (QCdbus_registered_serial, QCdbus_registered_method)
11006 (QCdbus_registered_signal): New Lisp objects.
11007 (XD_DEBUG_MESSAGE): Use sizeof.
11008 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
11009 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
11010 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
11011 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
11012 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
11013 (xd_signature, xd_append_arg): Allow float for integer types.
11014 (xd_get_connection_references): New function.
11015 (xd_get_connection_address): Rename from xd_initialize.
11016 Return cached address.
11017 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
11018 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
11020 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
11021 Return number of refcounts.
11022 (Fdbus_get_unique_name): Make stronger parameter check.
11023 (Fdbus_message_internal): New defun.
11024 (Fdbus_call_method, Fdbus_call_method_asynchronously)
11025 (Fdbus_method_return_internal, Fdbus_method_error_internal)
11026 (Fdbus_send_signal, Fdbus_register_service)
11027 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
11028 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
11029 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
11030 (Vdbus_compiled_version, Vdbus_runtime_version)
11031 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
11032 (Vdbus_message_type_method_return, Vdbus_message_type_error)
11033 (Vdbus_message_type_signal): New defvars.
11034 (Vdbus_registered_buses, Vdbus_registered_objects_table):
11037 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
11039 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
11040 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
11041 Do not assume ptrdiff_t is the same width as 'int'.
11043 * alloc.c: Handle unusual debugging option combinations.
11044 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
11045 since the two debugging options are incompatible.
11046 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
11048 (mem_init, mem_insert, mem_insert_fixup):
11049 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
11050 (NEED_MEM_INSERT): Remove; no longer needed.
11052 2012-04-22 Leo Liu <sdl.web@gmail.com>
11054 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
11056 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
11058 * sysdep.c [__FreeBSD__]: Minor cleanups.
11059 (list_system_processes, system_process_attributes) [__FreeBSD__]:
11060 Use Emacs indenting style more consistently. Avoid some casts.
11061 Use 'double' consistently rather than mixing 'float' and 'double'.
11063 2012-04-21 Eduard Wiebe <usenet@pusto.de>
11065 * sysdep.c (list_system_processes, system_process_attributes):
11066 Add implementation for FreeBSD (Bug#5243).
11068 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
11070 * lisp.mk (lisp): Update.
11072 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
11074 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
11075 It is never used otherwise.
11077 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
11079 * print.c (print_preprocess): Only check print_depth if print-circle
11081 (print_object): Check for cycles even when print-circle is nil and
11082 print-gensym is t, but only check print_depth if print-circle is nil.
11084 2012-04-20 Chong Yidong <cyd@gnu.org>
11086 * process.c (wait_reading_process_output): If EIO occurs on a pty,
11087 set the status to "failed" and ensure that sentinel is run.
11089 2012-04-20 Glenn Morris <rgm@gnu.org>
11091 * process.c (Fset_process_inherit_coding_system_flag)
11092 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
11093 (Fmake_network_process, Fmake_serial_process): Doc fix.
11095 2012-04-20 Eli Zaretskii <eliz@gnu.org>
11097 * xdisp.c (string_buffer_position_lim): Limit starting position to
11099 (set_cursor_from_row): If called for a mode-line or header-line
11100 row, return zero immediately.
11101 (try_cursor_movement): If inside continuation line, don't back up
11102 farther than the first row after the header line, if any.
11103 Don't consider the header-line row as "partially visible", even if
11104 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
11106 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
11108 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
11111 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
11112 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
11114 configure: new option --enable-gcc-warnings (Bug#11207)
11115 * Makefile.in (C_WARNINGS_SWITCH): Remove.
11116 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
11117 (ALL_CFLAGS): Use new macros rather than old.
11118 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
11119 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
11120 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
11121 -Wunused-result, -Wunused-variable. This should go away once
11122 the Emacs and Gnulib regex code is merged.
11123 (xmalloc, xrealloc): Now static.
11125 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
11127 * dired.c (Fsystem_groups): Remove unused local.
11129 2012-04-17 Glenn Morris <rgm@gnu.org>
11131 * dired.c (Fsystem_users): Doc fix.
11133 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
11135 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
11136 (syms_of_dired): Add them.
11138 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
11140 Fix minor alloc.c problems found by static checking.
11141 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
11142 New extern decls, to avoid calling undeclared functions.
11143 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
11144 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
11145 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
11146 (NEED_MEM_INSERT): New macro.
11147 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
11148 Remove one incorrect comment and fix another.
11150 Fix minor ralloc.c problems found by static checking.
11151 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
11152 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
11153 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
11154 (r_alloc_sbrk): Now static.
11156 Improve ralloc.c interface checking.
11157 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
11158 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
11159 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
11160 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
11161 [REL_ALLOC]: ... to here, to check interface.
11162 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
11163 Remove decls. This fixes an "It stinks!".
11165 * alloc.c (which_symbols): Fix alignment issue / type clash.
11167 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
11169 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
11170 (struct Lisp_Misc_Any): Likewise.
11171 (struct Lisp_Free): Likewise.
11172 * alloc.c (union aligned_Lisp_Symbol): Define.
11173 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
11174 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
11175 (union aligned_Lisp_Misc): Define.
11176 (MARKER_BLOCK_SIZE, struct marker_block): Use union
11177 aligned_Lisp_Misc instead of union Lisp_Misc.
11178 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
11180 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
11182 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
11183 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
11184 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
11185 * s/netbsd.h, s/sol2-6.h:
11186 Remove definition of GC_MARK_STACK, since the default now works.
11187 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
11188 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
11189 no longer the default.
11190 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
11192 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
11194 * lread.c (lisp_file_lexically_bound_p):
11195 Fix hang at ";-*-\n" (bug#11238).
11197 2012-04-14 Eli Zaretskii <eliz@gnu.org>
11199 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
11200 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
11202 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
11204 * nsterm.m (constrainFrameRect): Always constrain when there is only
11205 one screen (Bug#10962).
11207 2012-04-13 Ken Brown <kbrown@cornell.edu>
11209 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
11211 2012-04-13 Reuben Thomas <rrt@sc3d.org>
11213 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
11215 2012-04-11 Daniel Colascione <dancol@dancol.org>
11217 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
11218 against is gone. It's better to use vfork now so that when Cygwin
11219 gains a new, working vfork, we use it automatically (bug#10398).
11221 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
11223 * window.c (save_window_save): Obey window-point-insertion-type.
11225 2012-04-11 Glenn Morris <rgm@gnu.org>
11227 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
11229 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
11231 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
11233 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
11235 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
11236 (force_quit_count): New var.
11237 (handle_interrupt): Use it.
11239 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
11241 * w32.c (w32_delayed_load): Record the full path of the library
11242 being loaded (bug#10424).
11244 2012-04-09 Glenn Morris <rgm@gnu.org>
11246 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
11247 not just in the obarray, before snarfing them. (Bug#11036)
11249 * Makefile.in ($(leimdir)/leim-list.el):
11250 Pass EMACS rather than BUILT_EMACS.
11252 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
11254 * process.c (make_process):
11255 * process.h: Add integer `gnutls_handshakes_tried' member to
11258 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
11259 Add convenience `GNUTLS_LOG2i' macro.
11261 * gnutls.c (gnutls_log_function2i): Convenience log function.
11262 (emacs_gnutls_read): Use new log functions,
11263 `gnutls_handshakes_tried' process member, and
11264 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
11265 attempts per process (connection).
11267 2012-04-09 Chong Yidong <cyd@gnu.org>
11269 * eval.c (Fuser_variable_p, user_variable_p_eh)
11270 (lisp_indirect_variable): Functions deleted.
11271 (Fdefvar): Caller changed.
11273 * callint.c (Finteractive, Fcall_interactively):
11274 * minibuf.c (Fread_variable): Callers changed.
11276 2012-04-09 Eli Zaretskii <eliz@gnu.org>
11278 * xdisp.c (set_cursor_from_row): If the display string appears in
11279 the buffer at position that is closer to point than the position
11280 after the display string, display the cursor on the first glyph of
11281 the display string. Fixes cursor display when a 'display' text
11282 property immediately follows invisible text. (Bug#11094)
11284 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
11286 composite.c: use 'double' consistently
11287 * composite.c (get_composition_id): Use 'double' consistently
11288 instead of converting 'float' to 'double' and vice versa; this is
11289 easier to understand and avoids a GCC warning.
11291 2012-04-09 Glenn Morris <rgm@gnu.org>
11293 * Makefile.in: Generate leim-list with bootstrap-emacs, in
11294 preparation for dumping it with emacs. (Bug#4789)
11295 (leimdir): New variable.
11296 ($(leimdir)/leim-list.el): New rule.
11297 (emacs$(EXEEXT)): Depend on leim-list.el.
11299 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
11300 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
11301 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
11303 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
11305 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
11308 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
11310 * xml.c (init_libxml2_functions) [WINDOWSNT]:
11311 Remove unused local variable.
11313 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
11315 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
11316 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
11317 (mark_memory): Mark Lisp_Objects only if pointers might hide in
11318 objects, as mark_maybe_pointer will catch them otherwise.
11319 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
11320 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
11322 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
11324 Fix typo that broke non-Windows builds.
11325 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
11327 2012-04-07 Eli Zaretskii <eliz@gnu.org>
11329 Support building on MS-Windows with libxml2.
11331 * makefile.w32-in (OBJ2): Add xml.$(O).
11332 (GLOBAL_SOURCES): Add xml.c.
11333 ($(BLD)/xml.$(O)): New dependency list.
11335 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
11336 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
11337 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
11338 [!WINDOWSNT]: New macros.
11339 (init_libxml2_functions, libxml2_loaded_p): New functions.
11340 (parse_region): Call fn_xmlCheckVersion instead of using the macro
11341 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
11342 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
11343 Calls xmlCleanupParser only if libxml2 was loaded (or statically
11345 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
11346 Call init_libxml2_functions before calling libxml2 functions.
11347 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
11349 * emacs.c: Don't include libxml/parser.h.
11350 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
11351 xmlCleanupParser directly.
11353 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
11355 2012-04-07 Eli Zaretskii <eliz@gnu.org>
11357 * indent.c (Fvertical_motion): If there is a display string at
11358 point, use it.vpos to compute how many lines to backtrack after
11359 move_it_to point. (Bug#11133)
11361 2012-04-06 Eli Zaretskii <eliz@gnu.org>
11363 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
11364 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
11365 about subtle differences between FETCH_CHAR* and STRING_CHAR*
11366 macros related to unification of CJK characters. For the details,
11367 see the discussion following the message here:
11368 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
11370 2012-04-04 Chong Yidong <cyd@gnu.org>
11372 * keyboard.c (Vdelayed_warnings_list): Doc fix.
11374 2012-04-01 Eli Zaretskii <eliz@gnu.org>
11376 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
11377 instead of alloca. (Bug#11138)
11379 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
11381 * w32menu.c (is_simple_dialog): Properly check lisp types.
11384 2012-03-31 Eli Zaretskii <eliz@gnu.org>
11386 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
11387 position we get to after a call to move_it_to fails the
11388 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
11389 only if we wind up in a string from display property. (Bug#11063)
11391 * window.c (Fdelete_other_windows_internal): Invalidate the row
11392 and column information about mouse highlight, so that redisplay
11393 restores it after reallocating the glyph matrices. (Bug#7464)
11395 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
11396 string comes from a `display' text property, use the buffer
11397 position of that property as if we actually saw that position in
11399 (move_it_by_lines): Remove the assertion that
11400 "it->current_x == 0 && it->hpos == 0" which can be legitimately
11401 violated when there's a before-string at the beginning of a line.
11404 2012-03-30 Eli Zaretskii <eliz@gnu.org>
11406 * xdisp.c (append_space_for_newline): If the default face was
11407 remapped, use the remapped face for the appended newline.
11408 (extend_face_to_end_of_line): Use the remapped default face for
11409 extending the face to the end of the line.
11410 (display_line): Call extend_face_to_end_of_line when the default
11411 face was remapped. (Bug#11068)
11413 2012-03-29 Eli Zaretskii <eliz@gnu.org>
11415 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
11417 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
11419 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
11421 2012-03-27 Glenn Morris <rgm@gnu.org>
11423 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
11426 2012-03-26 Kenichi Handa <handa@m17n.org>
11428 * dispextern.h (struct glyph): Fix previous change. Change the
11429 bit length of glyphless.ch to 25 (Bug#11082).
11431 2012-03-26 Chong Yidong <cyd@gnu.org>
11433 * keyboard.c (Vselection_inhibit_update_commands): New variable.
11434 (command_loop_1): Use it; inhibit selection update for
11435 handle-select-window too (Bug#8996).
11437 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
11439 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
11441 2012-03-25 Kenichi Handa <handa@m17n.org>
11443 * dispextern.h (struct glyph): Change the bit length of
11444 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
11446 2012-03-24 Eli Zaretskii <eliz@gnu.org>
11448 * s/ms-w32.h (tzname): Include time.h before redirecting to
11449 _tzname. Fixes the MSVC build. (Bug#9960)
11451 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
11453 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
11456 * xterm.c (XTread_socket): Only modify handling_signal if
11457 !SYNC_INPUT. (Bug#11080)
11459 2012-03-23 Eli Zaretskii <eliz@gnu.org>
11461 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
11462 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
11463 when fetching a multibyte character consumes more bytes than
11464 CHAR_BYTES returns, due to unification of CJK characters in
11465 string_char. (Bug#11073)
11467 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
11469 * process.c (wait_reading_process_output): Handle pty disconnect
11470 by refraining from sending oneself a SIGCHLD (bug#10933).
11472 2012-03-22 Chong Yidong <cyd@gnu.org>
11474 * dispextern.h (struct it): New member string_from_prefix_prop_p.
11476 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
11477 Mark string as coming from a prefix property.
11478 (handle_face_prop): Use default face for prefix strings (Bug#4281).
11479 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
11481 2012-03-21 Chong Yidong <cyd@gnu.org>
11483 * xfaces.c (Vface_remapping_alist): Doc fix.
11485 2012-03-20 Eli Zaretskii <eliz@gnu.org>
11487 * w32proc.c (Fw32_set_console_codepage)
11488 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
11491 2012-03-20 Chong Yidong <cyd@gnu.org>
11493 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
11494 to reflect default non-nil value of redisplay-dont-pause.
11496 2012-03-19 Kenichi Handa <handa@m17n.org>
11498 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
11499 it fit in a valid range (Bug#11003).
11501 2012-03-18 Eli Zaretskii <eliz@gnu.org>
11503 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
11504 that is not from display property, accept the row as a "cursor
11505 row" if one of the string's character has a non-nil `cursor'
11506 property. Fixes cursor positioning when there are newlines in
11507 overlay strings, e.g. in icomplete.el. (Bug#11035)
11509 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
11511 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
11513 2012-03-12 Chong Yidong <cyd@gnu.org>
11515 * eval.c (inhibit_lisp_code): Rename from
11516 inhibit_window_configuration_change_hook; move from window.c.
11518 * xfns.c (unwind_create_frame_1, Fx_create_frame):
11519 * window.c (run_window_configuration_change_hook)
11520 (syms_of_window): Callers changed.
11522 2012-03-11 Chong Yidong <cyd@gnu.org>
11524 * keymap.c (Fkey_description): Doc fix (Bug#9700).
11526 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
11528 2012-03-10 Chong Yidong <cyd@gnu.org>
11530 * frame.c (other_visible_frames): Don't assume the selected frame
11531 is visible (Bug#10955).
11533 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
11535 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
11537 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
11539 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
11540 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
11543 2012-03-03 Glenn Morris <rgm@gnu.org>
11545 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
11547 2012-03-02 Eli Zaretskii <eliz@gnu.org>
11549 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
11550 position past the first glyph_row that ends at ZV. (Bug#10902)
11551 (redisplay_window, next_element_from_string): Fix typos in
11553 (redisplay_window): Pass to move_it_vertically the margin in
11554 pixels, not in screen lines.
11556 2012-03-02 Glenn Morris <rgm@gnu.org>
11558 * buffer.c (buffer-list-update-hook): Doc fix.
11560 2012-02-29 Eli Zaretskii <eliz@gnu.org>
11562 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
11563 push_it before setting up the iterator for the first overlay
11564 string, even if we have an empty string loaded.
11565 (next_overlay_string): If there's an empty string on the iterator
11566 stack, pop the stack. (Bug#10903)
11568 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
11570 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
11571 Suggested by Stefan Monnier in
11572 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
11573 * alloc.c (widen_to_Lisp_Object): New static function.
11574 (mark_memory): Also mark Lisp_Objects by fetching pointer words
11575 and widening them to Lisp_Objects. This would work even if
11576 USE_LSB_TAG is defined and wide integers are used, which might
11577 happen in a future version of Emacs.
11579 2012-02-25 Chong Yidong <cyd@gnu.org>
11581 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
11584 * xselect.c (Fx_selection_exists_p): Doc fix.
11585 (x_clipboard_manager_save_all): Print an informative message
11586 before saving to clipboard manager.
11588 2012-02-24 Chong Yidong <cyd@gnu.org>
11590 * keyboard.c (process_special_events): Handle all X selection
11591 requests in kbd_buffer, not just the next one (Bug#8869).
11593 2012-02-23 Chong Yidong <cyd@gnu.org>
11595 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
11596 call when setting menu-bar-lines and tool-bar-lines parameters.
11597 (unwind_create_frame_1): New helper function.
11599 * window.c (inhibit_window_configuration_change_hook): New var.
11600 (run_window_configuration_change_hook): Obey it.
11601 (syms_of_window): Initialize it.
11603 2012-02-22 Chong Yidong <cyd@gnu.org>
11605 * xterm.c (x_draw_image_relief): Add missing type check for
11606 Vtool_bar_button_margin (Bug#10743).
11608 2012-02-21 Chong Yidong <cyd@gnu.org>
11610 * fileio.c (Vfile_name_handler_alist): Doc fix.
11612 * buffer.c (Fget_file_buffer): Protect against invalid file
11613 handler return value.
11615 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
11617 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
11618 when computing $valmask.
11620 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
11621 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
11622 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
11623 It's useless in that case, and it can cause problems on hosts
11624 that allocate halves of EMACS_INT values separately.
11625 Reported by Dan Horák. Diagnosed by Andreas Schwab in
11626 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
11627 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
11628 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
11629 it avoids undefined behavior on hosts where shifting right by more
11630 than the word width has undefined behavior.
11632 2012-02-19 Chong Yidong <cyd@gnu.org>
11634 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
11635 (Funhandled_file_name_directory, Ffile_name_as_directory)
11636 (Fdirectory_file_name, Fexpand_file_name)
11637 (Fsubstitute_in_file_name): Protect against invalid file handler
11638 return values (Bug#10845).
11640 2012-02-18 Eli Zaretskii <eliz@gnu.org>
11642 * .gdbinit (pitx): Fix incorrect references to fields of the
11645 2012-02-17 Chong Yidong <cyd@gnu.org>
11647 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
11649 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
11651 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
11652 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
11654 2012-02-15 Chong Yidong <cyd@gnu.org>
11656 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
11657 marked as special. Also, starting docstrings with * is obsolete.
11659 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
11661 * gnutls.c (emacs_gnutls_write): Fix last change.
11663 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
11665 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
11668 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
11670 * keymap.c (Fsingle_key_description): Handle char ranges.
11672 2012-02-12 Chong Yidong <cyd@gnu.org>
11674 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
11675 as that creates a dangerous corner case.
11677 * window.c (Fdelete_window_internal): Invalidate the mouse
11678 highlight (Bug#9904).
11680 2012-02-12 Glenn Morris <rgm@gnu.org>
11682 * xselect.c (Fx_own_selection_internal)
11683 (Fx_get_selection_internal, Fx_disown_selection_internal)
11684 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
11685 * nsselect.m (Fx_own_selection_internal)
11686 (Fx_disown_selection_internal, Fx_selection_exists_p)
11687 (Fx_selection_owner_p, Fx_get_selection_internal):
11688 Sync docs and argument specs with the xselect.c versions.
11690 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
11692 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
11694 2012-02-11 Eli Zaretskii <eliz@gnu.org>
11696 * w32select.c (Fx_selection_exists_p): Sync doc string and
11697 argument list with xselect.c. (Bug#10783)
11699 * w16select.c (Fx_selection_exists_p): Sync doc string and
11700 argument list with xselect.c. (Bug#10783)
11702 2012-02-10 Glenn Morris <rgm@gnu.org>
11704 * fns.c (Fsecure_hash): Doc fix.
11706 2012-02-09 Kenichi Handa <handa@m17n.org>
11708 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
11710 2012-02-07 Chong Yidong <cyd@gnu.org>
11712 * buffer.c (Fbuffer_local_variables)
11713 (buffer_lisp_local_variables): Handle unbound vars correctly;
11714 don't let Qunbound leak into Lisp.
11716 2012-02-07 Glenn Morris <rgm@gnu.org>
11718 * image.c (Fimagemagick_types): Doc fix.
11720 * image.c (imagemagick-render-type): Change it from a lisp object
11721 to an integer. Move the doc here from the lisp manual.
11722 Treat all values not equal to 0 the same.
11724 2012-02-06 Chong Yidong <cyd@gnu.org>
11726 * doc.c (store_function_docstring): Avoid applying docstring of
11727 alias to base function (Bug#2603).
11729 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
11731 * .gdbinit (pp1, pv1): Remove redundant defines.
11734 2012-02-04 Chong Yidong <cyd@gnu.org>
11736 * nsterm.m: Declare a global (Bug#10694).
11738 2012-02-04 Eli Zaretskii <eliz@gnu.org>
11740 * w32.c (get_emacs_configuration_options):
11741 Include --enable-checking, if specified, in the return value.
11743 2012-02-04 Martin Rudalics <rudalics@gmx.at>
11745 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
11746 after rounding frame sizes. (Bug#9723)
11748 2012-02-04 Eli Zaretskii <eliz@gnu.org>
11750 * keyboard.c (adjust_point_for_property): Don't position point
11751 before BEGV. (Bug#10696)
11753 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
11755 Handle overflow when computing char display width (Bug#9496).
11756 * character.c (char_width): Return EMACS_INT, not int.
11757 (char_width, c_string_width): Check for overflow when
11758 computing the width; this is possible now that individual
11759 characters can have unbounded width. Problem introduced
11760 by merge from Emacs 23 on 2012-01-19.
11762 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
11764 * dbusbind.c (Fdbus_register_method): Mention the return value
11765 :ignore in the docstring.
11767 2012-02-02 Glenn Morris <rgm@gnu.org>
11769 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
11771 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11772 Unconditionally set to t. (Bug#10673)
11773 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11774 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
11775 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
11777 2012-02-02 Kenichi Handa <handa@m17n.org>
11779 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
11780 0, do not call append_composite_glyph.
11782 2012-02-02 Kenichi Handa <handa@m17n.org>
11784 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
11786 (x_produce_glyphs): If the component of a composition is a null
11787 string, set it->pixel_width to 1 to avoid zero-width glyph.
11789 2012-02-01 Eli Zaretskii <eliz@gnu.org>
11791 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
11792 first 2 arguments are identical. This makes inserting large
11793 output from a subprocess an order of magnitude faster on
11794 MS-Windows, where all sbrk'ed memory is always contiguous.
11796 2012-01-31 Glenn Morris <rgm@gnu.org>
11798 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11799 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
11800 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
11802 2012-01-29 Glenn Morris <rgm@gnu.org>
11804 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
11806 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
11808 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
11810 2012-01-28 Chong Yidong <cyd@gnu.org>
11812 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
11814 2012-01-26 Chong Yidong <cyd@gnu.org>
11816 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
11818 * search.c (Fsearch_forward, Fsearch_backward): Document negative
11819 repeat counts (Bug#10507).
11821 2012-01-26 Glenn Morris <rgm@gnu.org>
11823 * lread.c (syms_of_lread): Doc fix.
11825 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
11827 * coding.c (encode_designation_at_bol): Change return value to
11830 2012-01-25 Chong Yidong <cyd@gnu.org>
11832 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
11834 2012-01-21 Chong Yidong <cyd@gnu.org>
11836 * floatfns.c (Fcopysign): Make the second argument non-optional,
11837 since nil is not allowed anyway.
11839 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
11841 * process.c (read_process_output): Use p instead of XPROCESS (proc).
11842 (send_process): Likewise.
11844 2012-01-19 Martin Rudalics <rudalics@gmx.at>
11846 * window.c (save_window_save, Fcurrent_window_configuration)
11847 (Vwindow_persistent_parameters): Do not use Qstate.
11848 Rewrite doc-strings.
11850 2012-01-19 Kenichi Handa <handa@m17n.org>
11852 * character.c (char_width): New function.
11853 (Fchar_width, c_string_width, lisp_string_width):
11854 Use char_width (Bug#9496).
11856 2012-01-16 Martin Rudalics <rudalics@gmx.at>
11858 * window.c (Vwindow_persistent_parameters): New variable.
11859 (Fset_window_configuration, save_window_save): Handle persistent
11862 2012-01-14 Eli Zaretskii <eliz@gnu.org>
11864 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
11865 thrashing the stack of the thread. (Bug#9087)
11867 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
11869 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
11871 2012-01-11 Eli Zaretskii <eliz@gnu.org>
11873 * xdisp.c (rows_from_pos_range): Handle the case where the
11874 highlight ends on a newline. (Bug#10464)
11875 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
11876 he end column for display of highlight that ends on a newline
11879 2012-01-11 Glenn Morris <rgm@gnu.org>
11881 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
11882 from load-path also when installation-directory is nil. (Bug#10208)
11884 2012-01-10 Glenn Morris <rgm@gnu.org>
11886 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
11888 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
11889 Update template values to be closer to their typical values these days.
11891 2012-01-09 Eli Zaretskii <eliz@gnu.org>
11893 * xdisp.c (rows_from_pos_range): Accept additional argument
11894 DISP_STRING, and accept any glyph in a row whose object is that
11895 string as eligible for mouse highlight. Fixes mouse highlight of
11896 display strings from overlays. (Bug#10464)
11898 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
11900 emacs: fix an auto-save permissions race condition (Bug#10400)
11901 * fileio.c (auto_saving_dir_umask): New static var.
11902 (Fmake_directory_internal): Use it.
11903 (do_auto_save_make_dir): Set it, instead of invoking chmod after
11904 creating the directory. The old code temporarily assigns
11905 too-generous permissions to the directory.
11906 (do_auto_save_eh): Clear it.
11907 (Fdo_auto_save): Catch all errors, not just file errors, so
11908 that the var is always cleared.
11910 2012-01-07 Eli Zaretskii <eliz@gnu.org>
11912 * search.c (scan_buffer): Pass character positions to
11913 know_region_cache, not byte positions. (Bug#6540)
11915 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
11917 * w32.c (sys_rename): Report EXDEV when rename of a directory
11918 fails because the target is on another logical disk. (Bug#10284)
11920 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
11922 * xterm.c (x_embed_request_focus): New function.
11924 * xterm.h: Add prototype.
11926 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
11928 2012-01-05 Glenn Morris <rgm@gnu.org>
11930 * emacs.c (emacs_copyright): Update short copyright year to 2012.
11932 2012-01-01 Eli Zaretskii <eliz@gnu.org>
11934 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
11935 Load gnutls_transport_set_lowat only if GnuTLS version is below
11937 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
11938 GnuTLS versions below 2.11.1.
11940 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
11942 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
11943 to the doc string advising against its use for altering the way
11944 windows are scrolled.
11946 2011-12-28 Kenichi Handa <handa@m17n.org>
11948 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
11949 coding-system ASCII compatible only when it does not produce BOM
11950 on encoding (Bug#10383).
11952 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
11954 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
11956 (create_and_show_popup_menu): Always use menu_position_func for
11959 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
11961 * callint.c (Fcall_interactively): Don't truncate prompt string.
11963 2011-12-23 Eli Zaretskii <eliz@gnu.org>
11965 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
11966 property that ends at ZV, so that the bidi iteration could be
11967 resumed from there (after widening). (Bug#10360)
11969 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
11971 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
11973 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
11975 * nsterm.m (x_free_frame_resources):
11976 Release f->output_data.ns->miniimage.
11977 (ns_index_color): Fix indentation. Do not retain
11978 color_table->colors[i].
11980 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
11983 * nsfns.m (x_set_background_color): Assign return value from
11984 ns_index_color to face-background instead of NSColor*.
11985 (ns_implicitly_set_icon_type): Fix indentation.
11986 Change assignment in for loop to comparison.
11988 * emacs.c (ns_pool): New variable.
11989 (main): Assign ns_pool.
11990 (Fkill_emacs): Call ns_release_autorelease_pool.
11992 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
11993 autorelease fdesc, release fdAttrs and tdict.
11994 (ns_get_covering_families): Release charset.
11995 (ns_findfonts): Release NSFontDescriptor created with new.
11996 (ns_uni_to_glyphs): Fix indentation.
11997 (setString): Release attrStr before assigning new value.
11999 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
12001 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
12003 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
12004 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
12006 2011-12-18 David Reitter <reitter@cmu.edu>
12008 * nsterm.m (ns_term_init): Subscribe for notifications
12009 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
12010 to method trackingNotification in EmacsMenu.
12012 * nsmenu.m (trackingMenu): New variable.
12013 (trackingNotification): New method (from Aquamacs).
12014 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
12015 from Aquamacs (Bug#7030).
12017 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
12019 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
12020 (symbol_to_nsstring): Fix indentation.
12021 (ns_symbol_to_pb): New function.
12022 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
12023 (Fns_rotate_cut_buffers_internal): Remove.
12024 (Fns_store_selection_internal): Rename from
12025 Fns_store_cut_buffer_internal.
12026 (ns_get_foreign_selection, Fx_own_selection_internal)
12027 (Fx_disown_selection_internal, Fx_selection_exists_p)
12028 (Fns_get_selection_internal, Fns_store_selection_internal):
12029 Use ns_symbol_to_pb and check if return value is nil.
12030 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
12031 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
12032 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
12033 renamed to Sns_store_selection_internal.
12034 (ns_handle_selection_request): Move code to Fx_own_selection_internal
12035 and remove this function.
12036 (ns_handle_selection_clear): Remove, never used.
12037 (Fx_own_selection_internal): Move code from ns_handle_selection_request
12040 2011-12-17 Ken Brown <kbrown@cornell.edu>
12042 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
12043 GID is unknown (Bug#10257).
12045 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
12047 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
12048 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
12049 which caused a build failure on GNU/Linux IA-64. This problem was
12050 introduced by my 2011-10-07 patch.
12052 2011-12-15 Juri Linkov <juri@jurta.org>
12054 * image.c (imagemagick_error): New function. (Bug#10112)
12055 (imagemagick_load_image): Comment out `MagickSetResolution' call.
12056 Use `imagemagick_error' where ImageMagick functions return
12058 (Fimagemagick_types): Add `Fnreverse' to return the list in the
12061 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12063 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
12064 fill background (Bug#8992).
12066 2011-12-13 Martin Rudalics <rudalics@gmx.at>
12068 * window.c (Vwindow_combination_resize)
12069 (Vwindow_combination_limit): Use t instead of non-nil in
12071 (Vrecenter_redisplay): Add first sentence of doc-string on
12073 (Frecenter): Fix doc-string typo.
12075 2011-12-11 Kenichi Handa <handa@m17n.org>
12077 * coding.c (Funencodable_char_position): Pay attention to the
12078 buffer text relocation (Bug#9389).
12080 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
12082 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
12083 gtk_init (Bug#10100).
12085 2011-12-10 Eli Zaretskii <eliz@gnu.org>
12087 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
12088 IT->string is nil. (Bug#10263)
12090 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
12092 * nsterm.h (x_free_frame_resources): Declare.
12094 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
12095 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
12097 * nsterm.h (ns_get_defaults_value): Declare.
12099 * nsterm.m (ns_default): Call ns_get_defaults_value.
12101 2011-12-09 Eli Zaretskii <eliz@gnu.org>
12103 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
12106 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12108 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
12109 that where the value of an _OBJC_* symbol points to is in the .bss
12110 section (Bug#10240).
12112 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12114 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
12115 after the loop to call ccl_driver at least once (Bug#8619).
12117 2011-12-08 Kenichi Handa <handa@m17n.org>
12119 * ftfont.c (get_adstyle_property): Fix previous change
12122 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
12124 * w32.c (init_environment): If no_site_lisp, remove site-lisp
12125 dirs from the default value of EMACSLOADPATH (bug#10208).
12127 2011-12-07 Glenn Morris <rgm@gnu.org>
12129 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
12130 installation and source directories as well. (Bug#10208)
12132 2011-12-06 Chong Yidong <cyd@gnu.org>
12134 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
12136 2011-12-06 Glenn Morris <rgm@gnu.org>
12138 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
12139 as an error, not just -1. (Bug#10217)
12141 2011-12-05 Chong Yidong <cyd@gnu.org>
12143 * keyboard.c (process_special_events): New function.
12144 (swallow_events, Finput_pending_p): Use it (Bug#10195).
12146 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
12148 * coding.c (encode_designation_at_bol): Don't use uninitialized
12149 local variable (Bug#9318).
12151 2011-12-05 Kenichi Handa <handa@m17n.org>
12153 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
12154 return Qnil (Bug#8046, Bug#10193).
12156 2011-12-05 Kenichi Handa <handa@m17n.org>
12158 * coding.c (encode_designation_at_bol): New args charbuf_end and
12159 dst. Return the number of produced bytes. Callers changed.
12160 (coding_set_source): Return how many bytes coding->source was
12162 (coding_set_destination): Return how many bytes
12163 coding->destination was relocated.
12164 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
12165 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
12167 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12169 * coding.c (CODING_CHAR_CHARSET_P): New macro.
12170 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
12173 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
12175 The following changes are to fix Bug#9318.
12177 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
12178 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
12179 (encode_coding_iso_2022, encode_coding_sjis)
12180 (encode_coding_big5, encode_coding_charset): Use the above macros.
12182 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
12184 * lisp.h (process_quit_flag): Fix external declaration.
12186 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
12188 Don't macro-inline non-performance-critical code.
12189 * eval.c (process_quit_flag): New function.
12190 * lisp.h (QUIT): Use it.
12192 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
12194 * nsfns.m (get_geometry_from_preferences): New function.
12195 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
12197 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
12199 * emacs.c (Qkill_emacs): Define.
12200 (syms_of_emacs): Initialize it.
12201 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
12202 Qquit_flag to `kill-emacs' instead.
12203 (quit_throw_to_read_char): Add parameter `from_signal'.
12204 All callers changed. Call Fkill_emacs if requested and safe.
12205 * lisp.h (QUIT): Call Fkill_emacs if requested.
12207 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
12209 * widget.c (update_wm_hints): Return if wmshell is null.
12210 (widget_update_wm_size_hints): New function.
12212 * widget.h (widget_update_wm_size_hints): Declare.
12214 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
12215 widget_update_wm_size_hints (Bug#10104).
12217 2011-12-03 Eli Zaretskii <eliz@gnu.org>
12219 * xdisp.c (handle_invisible_prop): If the invisible text ends just
12220 before a newline, prepare the bidi iterator for consuming the
12221 newline, and keep the current paragraph direction. (Bug#10183)
12222 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
12224 2011-12-02 Juri Linkov <juri@jurta.org>
12226 * search.c (Fword_search_regexp): New Lisp function created from
12227 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
12228 (Fword_search_backward, Fword_search_forward)
12229 (Fword_search_backward_lax, Fword_search_forward_lax):
12230 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
12231 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
12233 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
12235 * fileio.c (Finsert_file_contents): Move after-change-function call
12236 to before the "handled:" label, since all "goto handled" appear in
12237 cases where the *-change-functions have already been properly called
12240 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
12242 * keyboard.c (interrupt_signal): Don't call kill-emacs when
12243 waiting for input. (Bug#10169)
12245 2011-11-30 Eli Zaretskii <eliz@gnu.org>
12247 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
12248 verifies glyph row's hash code--we have just reallocated the
12249 glyphs, so their contents can be complete garbage. (Bug#10164)
12251 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
12253 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
12255 2011-11-30 Eli Zaretskii <eliz@gnu.org>
12257 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
12258 attributes are tested _before_ calling verify_row_hash, to protect
12259 against GCC re-ordering of the tests. (Bug#10164)
12261 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
12263 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
12265 * xterm.c (handle_one_xevent): Only set async_visible and friends
12266 if net_wm_state_hidden_seen is non-zero (Bug#10002)
12267 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
12268 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
12270 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
12272 Remove GCPRO-related macros that exist only to avoid shadowing locals.
12273 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
12274 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
12275 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
12276 All uses changed to use GCPRO1 etc.
12277 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
12278 Revert to old implementation (i.e., before 2011-03-11).
12280 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12282 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
12283 of scroll runs so as to avoid assigning disabled bogus rows and
12284 unnecessary graphics copy operations.
12286 2011-11-27 Eli Zaretskii <eliz@gnu.org>
12288 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
12289 (snprintf) [_MSC_VER]: Redirect to _snprintf.
12290 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
12291 (malloc, free, realloc, calloc): Redirect to e_* only when
12294 * lisp.h (GCTYPEBITS): Move before first use.
12295 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
12296 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
12297 this macro definition.
12299 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
12302 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
12304 * gtkutil.c (xg_create_frame_widgets):
12305 Call gtk_window_set_has_resize_grip (FALSE) if that function is
12306 present with Gtk+ 2.0.
12308 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
12310 * fileio.c (Finsert_file_contents): Undo previous change; see
12311 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
12313 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
12315 Rename locals to avoid shadowing.
12316 * fileio.c (Finsert_file_contents):
12317 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
12318 * process.c (wait_reading_process_output):
12319 Rename inner 'proc' to 'p' to avoid shadowing.
12320 Indent for consistency with usual Emacs style.
12322 2011-11-25 Eli Zaretskii <eliz@gnu.org>
12324 * xdisp.c (redisplay_window): If cursor row is not fully visible
12325 after recentering, and scroll-conservatively is set to a large
12326 number, scroll window by a few more lines to make the cursor fully
12327 visible and out of scroll-margin. (Bug#10105)
12328 (start_display): Don't move to the next line if the display should
12329 start at a newline that is part of a display vector or an overlay
12330 string. (Bug#10119)
12332 2011-11-24 Juri Linkov <juri@jurta.org>
12334 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
12335 after the `MagickPingImage' call. (Bug#10112)
12337 2011-11-23 Chong Yidong <cyd@gnu.org>
12339 * window.c (Fcoordinates_in_window_p): Accept only live windows.
12341 2011-11-23 Martin Rudalics <rudalics@gmx.at>
12343 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
12344 making another buffer current. (Bug#10114)
12346 2011-11-23 Glenn Morris <rgm@gnu.org>
12348 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
12350 2011-11-23 Chong Yidong <cyd@gnu.org>
12352 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
12353 using it (Bug#5984).
12355 2011-11-22 Eli Zaretskii <eliz@gnu.org>
12357 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
12358 and header-lines, as they don't have one computed for them.
12361 * .gdbinit (prow): Make displayed values more self-explaining.
12362 Add row's hash code.
12364 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
12366 * process.c (wait_reading_process_output): Fix asynchrounous
12367 GnuTLS socket handling on some versions of the GnuTLS library.
12368 (wait_reading_process_output): Add comment and URL.
12370 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
12372 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
12374 2011-11-21 Chong Yidong <cyd@gnu.org>
12376 * window.c (Fnext_window, Fprevious_window): Doc fix.
12378 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
12380 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
12382 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
12384 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
12386 2011-11-20 Martin Rudalics <rudalics@gmx.at>
12388 * window.c (Fset_window_combination_limit): Rename argument
12390 (Vwindow_combination_limit): Remove "status" from doc-string.
12392 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
12394 * m/ibms390.h: Remove.
12395 * m/ibms390x.h: Don't include "ibms390.h".
12397 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
12399 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
12400 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
12402 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
12404 * casetab.c (Fset_case_table):
12405 * charset.c (Fcharset_after): Fix typos.
12407 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
12409 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
12410 Otherwise, valgrind does not work on some platforms.
12411 Problem reported by Andreas Schwab in
12412 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
12413 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
12414 is set, removing the need for VIRT_ADDRESS_VARIES.
12415 (PURE_P): Use a more-efficient implementation that needs just one
12416 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
12417 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
12418 to 4 (xorl, subq, cmpq, setbe).
12419 * alloc.c (pure): Always extern now, since that's the
12420 VIRT_ADDR_VARIES behavior.
12421 (PURE_POINTER_P): Use a single comparison, not two, for
12422 consistency with the new puresize.h.
12423 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
12424 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
12425 Remove VIRT_ADDR_VARIES no longer needed.
12427 2011-11-19 Eli Zaretskii <eliz@gnu.org>
12429 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
12430 (erase_phys_cursor, update_window_cursor, show_mouse_face)
12431 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
12432 behave as if the cursor position were at the window margin.
12434 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
12435 and the cursor position is out of bounds, behave as if the cursor
12436 position were at the window margin. (Bug#10075)
12438 2011-11-18 Chong Yidong <cyd@gnu.org>
12440 * window.c (Fwindow_combination_limit): Make first argument
12441 non-optional, since it is meaningless for live windows like the
12444 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
12446 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
12448 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
12450 * intervals.c: Fix grafting over the whole buffer (bug#10071).
12451 (graft_intervals_into_buffer): Simplify.
12453 2011-11-18 Eli Zaretskii <eliz@gnu.org>
12455 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
12456 hash values of the two rows.
12457 (copy_row_except_pointers): Preserve the used[] arrays and the
12458 hash values of the two rows. (Bug#10035)
12459 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
12461 * xdisp.c (row_hash): New function, body extracted from
12462 compute_line_metrics.
12463 (compute_line_metrics): Call row_hash, instead of computing the
12466 * dispnew.c (verify_row_hash): Call row_hash for computing the
12467 hash code of a row, instead of duplicating code from xdisp.c.
12469 * dispextern.h (row_hash): Add prototype.
12471 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
12473 * frame.c (delete_frame): Don't delete the terminal when the last
12474 X frame is closed if emacs is built with GTK toolkit.
12476 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
12478 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
12480 2011-11-17 Martin Rudalics <rudalics@gmx.at>
12482 * window.c (Vwindow_splits): Rename to
12483 Vwindow_combination_resize. Suggested by Juri Linkov.
12484 (Fsplit_window_internal): Use Vwindow_combination_resize instead
12487 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
12489 * nsfns.m (Fns_font_name):
12490 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
12492 2011-11-16 Martin Rudalics <rudalics@gmx.at>
12494 * window.h (window): Rename slot "nest" to "combination_limit".
12495 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
12496 (Fset_window_nest): Rename to Fset_window_combination_limit.
12497 (Vwindow_nest): Rename to Vwindow_combination_limit.
12498 (recombine_windows, make_parent_window, make_window)
12499 (Fsplit_window_internal, saved_window)
12500 (Fset_window_configuration, save_window_save): Rename all
12501 occurrences of window_nest to window_combination_limit.
12503 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
12505 * image.c (imagemagick_load_image): Fix typo.
12507 2011-11-14 Eli Zaretskii <eliz@gnu.org>
12509 * xdisp.c (display_line): Move the call to
12510 highlight_trailing_whitespace before the call to
12511 compute_line_metrics, since the latter needs to see the final
12512 faces of all the glyphs to compute ROW's hash value.
12513 Fixes assertion violations in row_equal_p. (Bug#10035)
12515 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
12517 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
12518 just return (bug#10044).
12520 2011-11-12 Eli Zaretskii <eliz@gnu.org>
12522 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
12523 with user-defined heap size. Bump the default size of the temacs
12524 heap to 27MB, to avoid memory warning when running temacs.
12525 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
12527 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
12528 current_matrix and desired_matrix. (Bug#9990)
12529 (verify_row_hash) [XASSERTS]: New function.
12530 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
12531 that the hash value of glyph rows is correct.
12533 2011-11-12 Martin Rudalics <rudalics@gmx.at>
12535 * window.h (window): Remove splits slot.
12536 * window.c (Fwindow_splits, Fset_window_splits): Remove.
12537 (Fdelete_other_windows_internal, make_parent_window)
12538 (make_window, Fsplit_window_internal, Fdelete_window_internal)
12539 (Fset_window_configuration, save_window_save): Don't deal with
12540 split status of windows.
12541 (saved_window): Remove splits slot.
12542 (Vwindow_splits): Rewrite doc-string.
12544 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
12546 * xfns.c (unwind_create_frame):
12547 * nsfns.m (unwind_create_frame):
12548 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
12549 Vframe_list (Bug#9999).
12551 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
12553 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
12555 2011-11-11 Kenichi Handa <handa@m17n.org>
12557 * callproc.c (Fcall_process): Set the member dst_multibyte of
12560 2011-11-11 Johan Bockgård <bojohan@gnu.org>
12562 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
12563 avoid a crash (bug#9496).
12565 2011-11-09 Chong Yidong <cyd@gnu.org>
12567 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
12568 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
12570 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
12572 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
12574 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
12576 Avoid some portability problems by eschewing 'extern inline' functions.
12577 The trivial performance wins aren't worth the portability hassles; see
12578 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
12580 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
12581 (window_box_width, window_box_left, window_box_left_offset)
12582 (window_box_right, window_box_right_offset): Undo previous change,
12583 by removing the "extern"s.
12584 * intervals.c (adjust_intervals_for_insertion)
12585 (adjust_intervals_for_deletion): Undo previous change,
12586 making these static again.
12587 (offset_intervals, temp_set_point_both, temp_set_point)
12588 (copy_intervals_to_string): No longer inline.
12589 * xdisp.c (window_text_bottom_y, window_box_width)
12590 (window_box_height, window_box_left_offset)
12591 (window_box_right_offset, window_box_left, window_box_right)
12592 (window_box): No longer inline.
12594 2011-11-08 Chong Yidong <cyd@gnu.org>
12596 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
12597 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
12598 Signal an error if not a live window.
12599 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
12600 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
12602 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
12604 * lisp.h (syms_of_abbrev): Remove declaration.
12605 Reported by CHENG Gao <chenggao@royau.me>.
12607 2011-11-07 Eli Zaretskii <eliz@gnu.org>
12609 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
12610 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
12611 of temacs in GUI mode.
12613 2011-11-07 Martin Rudalics <rudalics@gmx.at>
12615 * window.h: Declare delete_all_child_windows instead of
12616 delete_all_subwindows.
12617 * window.c (Fwindow_nest, Fset_window_nest)
12618 (Fset_window_new_total, Fset_window_new_normal)
12619 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
12620 (delete_all_subwindows): Rename to delete_all_child_windows.
12621 (Fdelete_other_windows_internal, Fset_window_configuration):
12622 Call delete_all_child_windows instead of delete_all_subwindows.
12623 * frame.c (delete_frame): Call delete_all_child_windows instead
12624 of delete_all_subwindows.
12626 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
12628 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
12629 This is also needed for porting to any host where GC_MARK_STACK is
12630 not GC_MAKE_GCPROS_NOOPS.
12631 (which_symbols): Use it.
12633 2011-11-07 Kenichi Handa <handa@m17n.org>
12635 * coding.c (coding_set_destination): Check coding->src_pos only
12636 when coding->src_object is a buffer (bug#9910).
12638 * process.c (send_process): Set the member src_multibyte of coding
12639 to 0 (bug#9911) when sending a unibyte text.
12641 * callproc.c (Fcall_process): Set the member src_multibyte of
12642 process_coding to 0 (bug#9912).
12644 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12646 * xmenu.c (cleanup_widget_value_tree): New function.
12647 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
12648 calling free_menubar_widget_value_tree directly (Bug#9830).
12650 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
12652 Fix some portability problems with 'inline'.
12653 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
12654 (window_box_width, window_box_left, window_box_left_offset)
12655 (window_box_right, window_box_right_offset): Declare extern.
12656 Otherwise, these inline functions do not conform to C99 and
12657 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
12658 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
12659 * intervals.c (adjust_intervals_for_insertion)
12660 (adjust_intervals_for_deletion): Now extern, because otherwise the
12661 extern inline functions 'offset_intervals' couldn't refer to it.
12662 (static_offset_intervals): Remove.
12663 (offset_intervals): Rewrite using the old contents of
12664 static_offset_intervals. The old version didn't conform to C99
12665 because an extern inline function contained a reference to an
12666 identifier with static linkage.
12668 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
12670 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
12673 2011-11-06 Eli Zaretskii <eliz@gnu.org>
12675 * xdisp.c (init_iterator, reseat_to_string): Don't set the
12676 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
12677 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
12678 return Qleft_to_right.
12680 2011-11-06 Chong Yidong <cyd@gnu.org>
12682 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
12683 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
12684 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
12685 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
12686 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
12687 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
12688 (Fwindow_vscroll): Doc fix.
12689 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
12690 argument, since it makes no sense to pass a live window and for
12691 consistency with window-child.
12693 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
12695 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
12698 2011-11-05 Jason Rumney <jasonr@gnu.org>
12700 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
12701 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
12703 (add_font_entity_to_list): Fix logic errors in mixed boolean and
12704 bitwise arithmetic preventing use of unicode-sip and non-truetype
12707 2011-11-05 Eli Zaretskii <eliz@gnu.org>
12709 * s/ms-w32.h (fstat, stat, utime): Move redirections to
12712 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
12713 initialization code to keep similarity to xfns.c after changes
12716 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
12718 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
12719 (unwind_create_frame): New function (Bug#9943).
12720 (Fx_create_frame): Restructure code to be more similar to the one in
12721 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
12722 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
12723 Move terminal->reference_count++ just before making the frame official
12726 * nsterm.m (x_free_frame_resources): New function.
12727 (x_destroy_window): Move code to x_free_frame_resources.
12729 * xfns.c (unwind_create_frame): Fix comment.
12730 (Fx_create_frame, x_create_tip_frame):
12731 Move terminal->reference_count++ just before making the frame
12732 official. Move initialization of image_cache_refcount and
12733 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
12735 2011-11-05 Eli Zaretskii <eliz@gnu.org>
12737 Support MSVC build with newer versions of Visual Studio.
12738 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
12739 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
12742 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
12743 which are not supported by MSVC.
12744 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
12745 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
12747 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
12748 types in bitfields.
12749 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
12751 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
12753 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
12755 Support MSVC build with newer versions of Visual Studio.
12756 * w32.c: Don't include w32api.h for MSVC.
12757 (init_environment) [_MSC_VER]: Call sys_access, not _access.
12759 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
12760 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
12761 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
12762 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
12764 (alloca) [_MSC_VER]: Define to _alloca.
12766 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
12768 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
12770 2011-11-04 Eli Zaretskii <eliz@gnu.org>
12772 * xdisp.c (note_mouse_highlight): If either of
12773 previous/next-single-property-change returns nil, treat that as
12774 the beginning or the end of the buffer. (Bug#9955)
12776 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
12778 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
12779 label is not null (Bug#9951).
12780 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
12783 2011-11-04 Eli Zaretskii <eliz@gnu.org>
12785 * window.c (Fwindow_body_size): Mention in the doc string that the
12786 return value is in frame's canonical units. (Bug#9949)
12788 2011-11-03 Eli Zaretskii <eliz@gnu.org>
12790 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
12792 * w32fns.c (unwind_create_frame): If needed, free the glyph
12793 matrices of the partially constructed frame. (Bug#9943)
12794 * xfns.c (unwind_create_frame): Likewise.
12796 2011-11-01 Eli Zaretskii <eliz@gnu.org>
12798 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
12799 Don't stop backward scan on the continuation glyph, even though
12800 its CHARPOS is positive.
12801 (mouse_face_from_buffer_pos, note_mouse_highlight):
12802 Rename cover_string to disp_string.
12804 2011-11-01 Martin Rudalics <rudalics@gmx.at>
12806 * window.c (temp_output_buffer_show): Don't use
12807 Vtemp_buffer_show_specifiers.
12808 (Vtemp_buffer_show_specifiers): Remove unused variable.
12810 2011-10-30 Eli Zaretskii <eliz@gnu.org>
12812 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
12813 past the beginning of the current glyph matrix.
12815 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
12817 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
12818 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
12819 HAVE_GTK3 (Bug#9869).
12821 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
12822 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
12824 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
12826 * xterm.c: Declare x_handle_net_wm_state to return int.
12827 (handle_one_xevent): Check if we are iconified but don't have
12828 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
12829 (get_current_wm_state): Return non-zero if not hidden,
12830 check for _NET_WM_STATE_HIDDEN (Bug#9893).
12831 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
12832 (x_handle_net_wm_state): Return what get_current_wm_state returns.
12833 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
12835 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
12837 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
12838 so that this new function doesn't get optimized away by a
12839 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
12841 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
12843 * frame.h (MOUSE_HL_INFO): Remove excess parens.
12845 2011-10-29 Eli Zaretskii <eliz@gnu.org>
12847 Fix the `xbytecode' command.
12848 * .gdbinit (xprintbytestr): New command.
12849 (xwhichsymbols): Rename from `which'; all callers changed.
12850 (xbytecode): Print the byte-code string as well.
12852 2011-10-29 Kim Storm <storm@cua.dk>
12854 * alloc.c (which_symbols): New function.
12856 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
12858 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
12861 2011-10-29 Glenn Morris <rgm@gnu.org>
12863 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
12864 Not clear what it was for, and it causes various bugs. (Bug#9839)
12866 2011-10-28 Eli Zaretskii <eliz@gnu.org>
12868 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
12869 possible random value that matches one of those tested as
12870 condition to clear the mouse face.
12872 2011-10-28 Chong Yidong <cyd@gnu.org>
12874 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
12876 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
12878 * window.c (make_window): Initialize phys_cursor_on_p.
12880 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
12882 * lisp.h (struct Lisp_Symbol): Update comments.
12884 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
12886 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
12888 2011-10-28 Eli Zaretskii <eliz@gnu.org>
12890 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
12891 <oslsachem@gmail.com> for helping to debug this.
12893 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
12894 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
12895 (g_b_init_get_glyph_outline_w): New static variables.
12896 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
12897 (GetGlyphOutlineW_Proc): New typedefs.
12898 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
12899 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
12901 (w32font_open_internal, compute_metrics):
12902 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
12903 instead of calling the "wide" APIs directly.
12905 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
12907 * w32.h (syms_of_w32font): Add prototype.
12909 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
12911 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
12912 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
12913 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
12914 (Fmove_to_window_line): Doc fix.
12916 2011-10-27 Chong Yidong <cyd@gnu.org>
12918 * process.c (make_process): Set gnutls_state to NULL.
12920 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
12921 non-NULL, regardless of GNUTLS_INITSTAGE.
12922 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
12923 an error. Set process slots as soon as we allocate them.
12925 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
12927 2011-10-27 Chong Yidong <cyd@gnu.org>
12929 * gnutls.c (emacs_gnutls_deinit): New function.
12930 Deallocate credentials structures as well as calling gnutls_deinit.
12931 (Fgnutls_deinit, Fgnutls_boot): Use it.
12933 * process.c (make_process): Initialize GnuTLS credentials to NULL.
12934 (deactivate_process): Call emacs_gnutls_deinit.
12936 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
12938 * image.c (x_create_x_image_and_pixmap):
12939 * w32.c (sys_rename, w32_delayed_load):
12940 * w32font.c (fill_in_logfont):
12941 * w32reg.c (x_get_string_resource): Silence compiler warnings.
12943 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
12945 * w32fns.c (w32_default_color_map): New function,
12946 extracted from Fw32_default_color_map.
12947 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
12949 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
12951 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
12953 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
12955 * keyboard.c (test_undefined): New function (bug#9751).
12956 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
12958 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
12960 * sysdep.c (init_sys_modes): Fix the check for the controlling
12961 terminal (Bug#6649).
12963 2011-10-20 Eli Zaretskii <eliz@gnu.org>
12965 * dispextern.h (struct bidi_it): New member next_en_type.
12967 * bidi.c (bidi_line_init): Initialize the next_en_type member.
12968 (bidi_resolve_explicit_1): When next_en_pos is valid for the
12969 current character, check also for next_en_type being WEAK_EN.
12970 (bidi_resolve_weak): Don't enter the expensive loop if the current
12971 position is before next_en_pos. Record the bidi type of the first
12972 non-ET, non-BN character we find, in addition to its position.
12973 (bidi_level_of_next_char): Invalidate next_en_type when
12974 next_en_pos is over-stepped.
12976 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
12978 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
12979 * editfns.c: Rewrite current-time-zone so that it invokes
12980 the equivalent of (format-time-string "%Z") to get the time zone name.
12981 This fixes a bug when the time zone name contains characters that
12982 need converting from the system time locale to Emacs internal format.
12983 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
12984 that patch fixed format-time-string to do the conversion, but
12985 I forgot to fix current-time-zone.
12986 (format_time_string): New function, containing most of
12987 what Fformat_time_string used to contain.
12988 (Fformat_time_string): Rewrite in terms of format_time_string.
12989 This doesn't change this function's behavior.
12990 (current-time-zone): Rewrite to use format_time_string.
12991 This fixes the bug reported by Michael Schierl in
12992 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
12993 Jason Rumney's 2007-06-07 change worked around this bug, but
12995 * systime.h (tzname, timezone): Remove no-longer-used declarations.
12997 2011-10-19 Eli Zaretskii <eliz@gnu.org>
12999 * xdisp.c (start_display): If the character at POS is displayed
13000 via a display vector, reset IT->current.dpvec_index to zero.
13001 (try_window_reusing_current_matrix): If a line ends in a display
13002 vector or the next line starts in a display vector, continue
13003 redrawing the window even though the character position of
13004 start_row was reached.
13007 2011-10-18 Chong Yidong <cyd@gnu.org>
13009 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
13010 with nobreak-char-display too.
13012 2011-10-18 Eli Zaretskii <eliz@gnu.org>
13014 Fix part 3 of bug#9771.
13015 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
13016 (bidi_resolve_neutral): Don't enter the expensive loop looking for
13017 non-neutral characters if the current character is a paragraph
13018 separator (a.k.a. Newline). This avoids running the same
13019 expensive loop twice, once when we consume the preceding newline
13020 and the other time when the line actually needs to be displayed.
13021 Avoid the loop when we see neutrals on the base embedding level
13022 following a character whose directionality is the same as the
13023 paragraph's. This avoids running the expensive loop when a line
13024 ends in a long sequence of neutrals, like control characters.
13025 Add assertion against STRONG_AL type. Slightly rearrange code
13026 that determines the type of a neutral given the first non-neutral
13028 (bidi_level_of_next_char): Set next_en_pos to zero when
13029 invalidating its info.
13031 2011-10-17 Eli Zaretskii <eliz@gnu.org>
13033 * xdisp.c (push_display_prop): Determine whether to record string
13034 or buffer position by IT->string, not by IT->method. Allow
13035 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
13036 (move_it_vertically_backward): Don't look for character position
13037 immediately after the newline when in a continuation line.
13040 2011-10-15 Martin Rudalics <rudalics@gmx.at>
13042 * window.c (coordinates_in_window): Rewrite and delabelize
13043 vertical border check. (Bug#5357) (Bug#9618)
13045 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
13047 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
13048 errors in XSetWindowBorder (bug#9310).
13050 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
13052 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
13053 avoid crash when xmalloc overrun checking is enabled.
13055 2011-10-13 Eli Zaretskii <eliz@gnu.org>
13057 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
13058 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
13059 cursor motion with <left> and <right> arrow keys.
13061 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
13062 some callers set that themselves.
13064 2011-10-12 Eli Zaretskii <eliz@gnu.org>
13066 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
13067 display string and the previous row comes from the same string and
13068 is empty. (Bug#9739) (Bug#9738)
13070 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
13072 * doc.c (get_doc_string): Encode file name (bug#9735).
13074 2011-10-12 Eli Zaretskii <eliz@gnu.org>
13076 * bidi.c (bidi_level_of_next_char):
13077 * xdisp.c (get_visually_first_element): Remove old incorrect
13078 comments regarding the Unicode Line Separator character.
13080 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
13082 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
13084 * alloc.c (Fgc_status): Do not access beyond zombies array
13085 boundary if nzombies > MAX_ZOMBIES.
13086 * alloc.c (dump_zombies): Add missing format specifier.
13088 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
13090 * xdisp.c (set_cursor_from_row): Simplify conditionals,
13091 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
13093 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
13094 Some packages use them to denote characters with modifiers.
13096 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
13098 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
13099 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
13100 matching a pp-number. Rename parameter var to var1.
13102 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
13104 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
13106 2011-10-08 Glenn Morris <rgm@gnu.org>
13108 * callint.c (Fcall_interactively): Give a more explicit error for the
13109 'c' case with a non-character input. (Bug#8479)
13111 2011-10-08 Eli Zaretskii <eliz@gnu.org>
13113 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
13115 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
13116 lines that are hscrolled on the left.
13118 * dispnew.c (buffer_posn_from_coords): Account for a possible
13119 presence of header-line. (Bug#4426)
13121 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
13123 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
13124 Don't advertise functionality which we discourage or doesn't work.
13126 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
13128 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
13129 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
13130 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
13131 this makes Emacs dump core during garbage collection on rare
13132 occasions. sizeof is obviously inferior to offsetof here, so
13133 stick with offsetof.
13134 (GC_POINTER_ALIGNMENT): New macro.
13135 (mark_memory): Omit 3rd (offset) arg; caller changed.
13136 Don't assume EMACS_INT alignment is the same as pointer alignment.
13138 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
13140 * keyboard.c (read_key_sequence_remapped): New var.
13141 (read_key_sequence): Compute remapping in the right buffer.
13142 (command_loop_1): Use read_key_sequence's remapping directly.
13144 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
13146 * dired.c (file_name_completion): Don't expand file name.
13147 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
13148 before checking file name handler.
13150 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
13151 they've been requested explicitly (bug#9591).
13153 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
13155 * keymap.c (Fsingle_key_description): Use make_specified_string
13156 instead of build_string to build string from push_key_description.
13159 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
13161 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
13162 This fixes a Y2038 bug on 64-bit hosts.
13163 * buffer.c (reset_buffer):
13164 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
13165 (Fclear_buffer_auto_save_failure):
13166 Use 0, not -1, to represent an unset failure time, since time_t
13167 might not be signed.
13169 Remove dependency on glibc malloc internals.
13170 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13171 Move back here from lisp.h, but with their new implementations.
13172 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
13173 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
13174 * charset.c (charset_table_init): New static var.
13175 (syms_of_charset): Use it instead of xmalloc. This removes a
13176 dependency on glibc malloc internals. See Eli Zaretskii's comment in
13177 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
13178 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13179 Move back to alloc.c.
13180 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
13181 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
13183 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
13185 * nsterm.m (windowDidResize): Call x_set_window_size only when
13186 ns_in_resize is true. Otherwise set pixelwidth/height and
13187 call change_frame_size (Bug#9628).
13189 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
13191 Port --enable-checking=all to Fedora 14 x86-64.
13192 * charset.c (syms_of_charset): Also account for glibc malloc's
13193 internal overhead when calculating the initial malloc maximum.
13195 Port --enable-checking=all to Fedora 14 x86.
13196 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13198 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
13199 (overrun_check_realloc, overrun_check_free):
13200 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
13201 That way, xmalloc returns a properly-aligned pointer even if
13202 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
13203 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
13204 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
13205 into account when calculating the initial malloc maximum.
13206 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13207 Move here from alloc.c, so that charset.c can use it too.
13208 Properly align; the old code wasn't right for common 32-bit hosts
13209 when configured with --enable-checking=all.
13210 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
13211 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
13213 2011-09-29 Eli Zaretskii <eliz@gnu.org>
13215 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
13218 2011-09-28 Eli Zaretskii <eliz@gnu.org>
13220 * xdisp.c (compute_display_string_end): If there's no display
13221 string at CHARPOS, return -1.
13223 * bidi.c (bidi_fetch_char): When compute_display_string_end
13224 returns a negative value, treat the character as a normal
13225 character not covered by a display string. (Bug#9624)
13227 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
13229 * lread.c (Fread_from_string): Fix typo in docstring.
13231 2011-09-27 Eli Zaretskii <eliz@gnu.org>
13233 * xdisp.c (handle_invisible_prop): If invisible text ends on a
13234 newline, reseat the iterator instead of bidi-iterating there one
13235 character at a time. (Bug#9610)
13236 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
13237 TO_CHARPOS if the bidi iterator is at base embedding level.
13239 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
13241 * lread.c (readevalloop): Use correct code for NBSP.
13242 (read1): Likewise. (Bug#9608)
13244 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
13246 * dbusbind.c (Fdbus_register_signal): When service is not
13247 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
13249 2011-09-25 Glenn Morris <rgm@gnu.org>
13251 * buffer.c (truncate-lines): Doc fix.
13253 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
13255 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
13256 (Fset_window_next_buffers): Doc fix.
13258 2011-09-24 Glenn Morris <rgm@gnu.org>
13260 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
13262 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
13264 Fix minor problems found by static checking.
13265 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
13266 * indent.c (Fvertical_motion): Fix == vs = typo.
13268 2011-09-24 Eli Zaretskii <eliz@gnu.org>
13270 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
13271 Default value is now t. Doc fix.
13273 * indent.c (Fvertical_motion): Compute and apply the overshoot
13274 logic when moving up, not only when moving down. Fix the
13275 confusing name and values of the it_overshoot_expected variable;
13276 logic changes accordingly. (Bug#9254) (Bug#9549)
13278 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
13279 CHARPOS is covered by a display string which includes newlines.
13280 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
13281 is covered by a display string with embedded newlines.
13283 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
13285 * dbusbind.c (Fdbus_register_signal): Add match rule to
13286 Vdbus_registered_objects_table. (Bug#9581)
13287 (Fdbus_register_method, Vdbus_registered_objects_table):
13290 2011-09-24 Jim Meyering <meyering@redhat.com>
13292 do not ignore write error for any output size
13293 The previous change was incomplete.
13294 While it makes emacs --batch detect the vast majority of stdout
13295 write failures, errors were still ignored whenever the output size is
13296 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
13297 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
13298 && echo FAIL: ignored write error
13299 FAIL: ignored write error
13300 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
13301 && echo FAIL: ignored write error
13302 FAIL: ignored write error
13303 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
13305 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
13307 * emacs.c (Fkill_emacs): In noninteractive mode exit
13308 non-successfully if a write error occurred on stdout. (Bug#9574)
13310 2011-09-21 Eli Zaretskii <eliz@gnu.org>
13312 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
13315 * dispextern.h (struct it): Update the comment documenting what
13318 2011-09-20 Eli Zaretskii <eliz@gnu.org>
13320 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
13321 a display string, extend search for cursor position to end of row.
13322 (find_row_edges): If the row ends in a newline from a display
13323 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
13324 Handle the case of a display string with multiple newlines.
13325 (Fcurrent_bidi_paragraph_direction): Fix search for previous
13326 non-empty line. Fixes confusing cursor motion with arrow keys at
13327 the beginning of a line that starts with whitespace.
13329 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13331 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
13334 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
13336 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
13337 boolean (Bug#9154).
13339 2011-09-18 Eli Zaretskii <eliz@gnu.org>
13341 * xdisp.c (display_line): Record maximum and minimum buffer
13342 positions even if no glyphs were produced (e.g., by a zero-width
13343 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
13344 buffer positions that will be removed from the glyph row because
13346 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
13347 column is beyond frame width: don't subtract 1 "pixel" when
13348 computing width of the stretch.
13349 (reseat_at_next_visible_line_start): Undo the change made on
13350 2011-09-17 that saved paragraph information and restored it after
13351 the call to `reseat'. (Bug#9545)
13353 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13355 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
13356 and turn window cursor on if cleared (Bug#9415).
13358 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
13360 * search.c (boyer_moore): Take unibyte characters from pattern
13361 literally. (Bug#9458)
13363 2011-09-18 Eli Zaretskii <eliz@gnu.org>
13365 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
13367 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
13369 Fix minor problem found by static checking.
13370 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
13371 initialized, to pacify gcc -Wuninitialized.
13373 * fileio.c: Report proper errno when syscall falls.
13374 (Finsert_file_contents): Save and restore errno,
13375 so that report_file_error outputs the correct diagnostic.
13376 (Fwrite_region) [CLASH_DETECTION]: Likewise.
13378 2011-09-18 Eli Zaretskii <eliz@gnu.org>
13380 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
13382 2011-09-17 Eli Zaretskii <eliz@gnu.org>
13384 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
13385 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
13387 2011-09-17 Eli Zaretskii <eliz@gnu.org>
13389 * xdisp.c (reseat_at_next_visible_line_start): Keep information
13390 about the current paragraph and restore it after the call to reseat.
13392 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
13393 (bidi_find_paragraph_start): Search back for paragraph beginning
13394 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
13395 (bidi_move_to_visually_next): Only trigger paragraph-related
13396 computations when the last character is a newline or at EOB, not
13397 just any NEUTRAL_B. (Bug#9470)
13399 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
13400 truncated lines if point is covered by a display string. (Bug#9524)
13402 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
13404 * xselect.c: Relax test for outgoing X longs (Bug#9498).
13405 (cons_to_x_long): New function.
13406 (lisp_data_to_selection_data): Use it. Correct the test for
13407 short-versus-long data; it was negated. Break out of vector
13408 loop, for efficiency, when a long datum is discovered.
13410 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
13412 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
13414 2011-09-16 Eli Zaretskii <eliz@gnu.org>
13416 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
13417 GCC PR/17406) by declaring this function with external scope.
13419 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
13421 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
13422 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
13424 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
13426 * editfns.c (Fformat): Correctly handle text properties on "%%".
13428 2011-09-15 Eli Zaretskii <eliz@gnu.org>
13430 * xterm.c (x_draw_composite_glyph_string_foreground):
13431 * w32term.c (x_draw_composite_glyph_string_foreground):
13432 * term.c (encode_terminal_code):
13433 * composite.c (composition_update_it, get_composition_id):
13434 * xdisp.c (get_next_display_element)
13435 (fill_composite_glyph_string): Add comments about special meaning
13436 of TAB characters in a composition.
13438 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
13440 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
13441 This occurs when processing a multibyte format.
13442 Problem reported by Wolfgang Jenker.
13444 2011-09-15 Johan Bockgård <bojohan@gnu.org>
13446 * xdisp.c (try_cursor_movement): Only check for exact match if
13447 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
13449 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
13451 Remove unused external symbols.
13452 * dispextern.h (calc_pixel_width_or_height): Remove decl.
13453 * xdisp.c (calc_pixel_width_or_height): Now static.
13454 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
13455 * indent.c (check_display_width):
13456 * w32term.c: Fix comment to match code.
13457 * xterm.c, xterm.h (x_catching_errors): Remove.
13459 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
13461 * xselect.c: Use signed conversions more consistently (Bug#9498).
13462 (selection_data_to_lisp_data): Assume incoming selection data are
13463 signed integers, not unsigned. This is to be consistent with
13464 outgoing selection data, which was modified to use signed integers
13465 in as part of the fix to Bug#9196 in response to Jan D.'s comment
13466 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
13467 expects long, not unsigned long.
13469 2011-09-14 Eli Zaretskii <eliz@gnu.org>
13471 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
13472 computation of loop end. Reported by Johan Bockgård
13475 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
13477 * frame.c (Fother_visible_frames_p): Function deleted.
13479 2011-09-12 Eli Zaretskii <eliz@gnu.org>
13481 * indent.c (compute_motion): Process display vector front to back
13482 rather than the other way around. (Bug#2496)
13484 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
13486 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
13488 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
13490 * minibuf.c (Fread_from_minibuffer): Doc fix.
13492 2011-09-11 Eli Zaretskii <eliz@gnu.org>
13494 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
13495 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
13497 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13499 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
13500 value for non-existent files.
13502 2011-09-11 Eli Zaretskii <eliz@gnu.org>
13504 * fileio.c (Finsert_file_contents): If the file cannot be opened,
13505 set its "size" to -1. This will set the modtime_size field of
13506 the corresponding buffer to -1, which is what
13507 verify-visited-file-modtime expects for files that do not exist.
13510 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
13512 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
13514 * lisp.h: ... from here. push_key_description is no longer
13515 defined in keyboard.c, so its declaration should not be in
13516 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
13517 logically belongs with push_key_description.
13519 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
13521 * buffer.h: Include <sys/types.h> instead of <time.h>.
13522 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
13523 Problem reported by Herbert J. Skuhra.
13525 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
13527 * xml.c (parse_region): Make the parsing work for
13528 non-comment-starting XML files again (bug#9144).
13530 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
13532 * image.c (gif_load): Fix calculation of bottom and right corner.
13535 2011-09-10 Eli Zaretskii <eliz@gnu.org>
13537 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
13538 redisplay in small windows.
13540 2011-09-09 Eli Zaretskii <eliz@gnu.org>
13542 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
13544 2011-09-08 Martin Rudalics <rudalics@gmx.at>
13546 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
13547 Operate on live windows only.
13549 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
13551 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
13553 2011-09-07 Eli Zaretskii <eliz@gnu.org>
13555 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
13556 only under bidi iteration.
13558 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
13560 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
13562 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
13564 isnan: Fix porting problem to Solaris 10 with bundled gcc.
13565 Without this fix, the command to link temacs failed due to an
13566 undefined symbol __builtin_isnan. This is because
13567 /usr/include/iso/math_c99.h #defines isnan(x) to
13568 __builtin_isnan(x), but the bundled gcc, which identifies itself
13569 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
13571 * floatfns.c (isnan): #undef, and then #define to a clone of
13573 (Fisnan): Always define, since it's always available now.
13574 (syms_of_floatfns): Always define isnan at the Lisp level.
13576 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
13578 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
13580 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
13582 * fileio.c: Fix bugs with large file offsets (Bug#9428).
13583 The previous code assumed that file offsets (off_t values) fit in
13584 EMACS_INT variables, which is not true on typical 32-bit hosts.
13585 The code messed up by falsely reporting buffer overflow in cases
13586 such as (insert-file-contents "big" nil 1 2) into an empty buffer
13587 when "big" contains more than 2**29 bytes, even though this
13588 inserts just one byte and does not overflow the buffer.
13589 (Finsert_file_contents): Store file offsets as off_t
13590 values, not as EMACS_INT values. Check for overflow when
13591 converting between EMACS_INT and off_t. When checking for
13592 buffer overflow or for overlap, take the offsets into account.
13593 Don't use EMACS_INT for small values where int suffices.
13594 When checking for overlap, fix a typo: ZV was used where
13595 ZV_BYTE was intended.
13596 (Fwrite_region): Don't assume off_t fits into 'long'.
13597 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
13599 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
13601 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
13603 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
13605 sprintf-related integer and memory overflow issues (Bug#9412).
13607 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
13608 (esprintf, exprintf, evxprintf): New functions.
13609 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
13610 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
13611 (modify_event_symbol): Do not assume that the length of
13612 name_alist_or_stem is safe to alloca and fits in int.
13613 (Fexecute_extended_command): Likewise for function name and binding.
13614 (Frecursion_depth): Wrap around reliably on integer overflow.
13615 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
13616 since some callers pass EMACS_INT values.
13617 (Fsingle_key_description): Don't crash if symbol name contains more
13618 than MAX_ALLOCA bytes.
13619 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
13620 (get_minibuffer): Arg is now EMACS_INT, not int.
13621 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
13622 (esprintf, exprintf, evxprintf): New decls.
13623 * window.h (command_loop_level, minibuf_level): Reflect API changes.
13625 * dbusbind.c (signature_cat): New function.
13626 (xd_signature, Fdbus_register_signal):
13627 Do not overrun buffer; instead, report string overflow.
13629 * dispnew.c (add_window_display_history): Don't overrun buffer.
13630 Truncate instead; this is OK since it's just a log.
13632 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
13633 even if the time zone offset is outlandishly large.
13634 Don't mishandle offset == INT_MIN.
13636 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
13637 when creating daemon; the previous buffer-overflow check was incorrect.
13639 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
13640 which has the guts of the old verror function.
13642 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
13643 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
13645 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
13646 (font_unparse_xlfd): Don't blindly alloca long strings.
13647 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
13648 fits in int, when using sprintf. Use single snprintf to count
13649 length of string rather than counting it via multiple sprintfs;
13650 that's simpler and more reliable.
13651 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
13652 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
13653 sprintf, in case result does not fit in int.
13655 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
13656 (fontset_from_font): Print it.
13658 * frame.c (tty_frame_count): Now printmax_t, not int.
13659 (make_terminal_frame, set_term_frame_name): Print it.
13660 (x_report_frame_params): In X, window IDs are unsigned long,
13661 not signed long, so print them as unsigned.
13662 (validate_x_resource_name): Check for implausibly long names,
13663 and don't assume name length fits in 'int'.
13664 (x_get_resource_string): Don't blindly alloca invocation name;
13665 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
13668 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
13669 (xg_check_special_colors, xg_set_geometry):
13670 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
13672 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
13673 Use esprintf, not sprintf, in case result does not fit in int.
13675 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
13676 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
13677 it as a large positive number.
13678 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
13679 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
13681 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
13682 in case result does not fit in int.
13684 * print.c (float_to_string): Detect width overflow more reliably.
13685 (print_object): Make sprintf buffer a bit bigger, to avoid potential
13686 buffer overrun. Don't assume list length fits in 'int'. Treat
13687 print length of 0 as 0, not as infinity; to be consistent with other
13688 uses of print length in this function. Don't overflow print length
13689 index. Don't assume hash table size fits in 'long', or that
13690 vectorlike size fits in 'unsigned long'.
13692 * process.c (make_process): Use printmax_t, not int, to format
13693 process-name gensyms.
13695 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
13697 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
13698 to avoid potential buffer overrun.
13700 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
13701 if X resource line is longer than 512 bytes.
13703 * xfns.c (x_window): Make sprintf buffer a bit bigger
13704 to avoid potential buffer overrun.
13706 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
13708 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
13710 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
13712 Integer overflow fixes for scrolling, etc.
13713 Without these, Emacs silently mishandles large integers sometimes.
13714 For example, "C-u 4294967297 M-x recenter" was treated as if
13715 it were "C-u 1 M-x recenter" on a typical 64-bit host.
13717 * xdisp.c (try_window_id): Check Emacs fixnum range before
13718 converting to 'int'.
13720 * window.c (window_scroll_line_based, Frecenter):
13721 Check that an Emacs fixnum is in range before assigning it to 'int'.
13722 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
13723 values converted from Emacs fixnums.
13724 (Frecenter): Don't wrap around a line count if it is out of 'int'
13725 range; instead, treat it as an extreme value.
13726 (Fset_window_configuration, compare_window_configurations):
13727 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
13729 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
13730 that can exceed INT_MAX. Check that EMACS_INT value is in range
13731 before assigning it to the (possibly-narrower) index.
13732 (match_limit): Don't assume that a fixnum can fit in 'int'.
13734 * print.c (print_object): Use ptrdiff_t, not int, for index that can
13737 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
13738 (Fvertical_motion): Don't wrap around LINES values that don't fit
13739 in 'int'. Instead, treat them as extreme values. This is good
13740 enough for windows, which can't have more than INT_MAX lines anyway.
13742 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13744 * Require libxml/parser.h to avoid compilation warning.
13746 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
13748 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
13749 since this reportedly can destroy thread storage.
13751 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
13753 * syntax.c (find_defun_start): Update all cache variables if
13754 exiting early (Bug#9401).
13756 2011-08-30 Eli Zaretskii <eliz@gnu.org>
13758 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
13760 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
13761 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
13762 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
13764 * term.c (tty_append_glyph): New function.
13765 (produce_stretch_glyph): Static function and its prototype deleted.
13767 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
13770 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
13772 * image.c (parse_image_spec): Check for nonnegative, not for positive,
13773 when checking :margin (Bug#9390).
13774 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
13775 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
13776 so that the name doesn't mislead. All uses changed.
13778 2011-08-28 Johan Bockgård <bojohan@gnu.org>
13780 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
13783 2011-08-27 Eli Zaretskii <eliz@gnu.org>
13785 * xdisp.c (move_it_to): Don't bail out early when reaching
13786 position beyond to_charpos, if we are scanning backwards.
13787 (move_it_vertically_backward): When DY == 0, make sure we get to
13788 the first character in the line after the newline.
13790 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
13792 * ccl.c: Improve and simplify overflow checking (Bug#9196).
13793 (ccl_driver): Do not generate an out-of-range pointer.
13794 (Fccl_execute_on_string): Remove unnecessary check for
13795 integer overflow, noted by Stefan Monnier in
13796 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
13797 Remove a FIXME that didn't need fixing.
13798 Simplify the newly-introduced buffer reallocation code.
13800 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
13802 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
13804 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
13806 Integer and memory overflow issues (Bug#9196).
13808 * doc.c (get_doc_string): Rework so that
13809 get_doc_string_buffer_size is the actual buffer size, rather than
13810 being 1 less than the actual buffer size; this makes xpalloc more
13813 * image.c (x_allocate_bitmap_record, cache_image):
13814 * xselect.c (Fx_register_dnd_atom):
13815 Simplify previous changes by using xpalloc.
13817 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
13818 since either will do and ptrdiff_t is convenient with xpalloc.
13820 * charset.c (charset_table_size)
13821 (struct charset_sort_data.priority): Now ptrdiff_t.
13822 (charset_compare): Don't overflow if priorities differ greatly.
13823 (Fsort_charsets): Don't assume list length fits in int.
13824 Check for size-calculation overflow when allocating sort data.
13825 (syms_of_charset): Allocate an initial charset table that is
13826 just under 64 KiB, to avoid problems with glibc malloc and mmap.
13828 * cmds.c (internal_self_insert): Check for size-calculation overflow.
13830 * composite.h (struct composition.glyph_len): Now int, not unsigned.
13831 The actual value is always <= INT_MAX, and leaving it unsigned made
13832 overflow checking harder.
13834 * dispextern.h (struct glyph_matrix.rows_allocated)
13835 (struct face_cache.size): Now ptrdiff_t, for convenience in use
13836 with xpalloc. The values are still always <= INT_MAX.
13838 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
13840 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
13841 (SAFE_NALLOCA): New macro.
13843 * region-cache.c (struct boundary.pos, find_cache_boundary)
13844 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
13845 (set_cache_region, invalidate_region_cache)
13846 (revalidate_region_cache, know_region_cache, region_cache_forward)
13847 (region_cache_backward, pp_cache):
13848 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
13849 so that ptrdiff_t * can be passed to xpalloc.
13850 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
13851 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
13852 (pp_cache): Don't assume cache_len fits in int.
13853 * region-cache.h: Adjust extern decls to match.
13855 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
13856 EMACS_INT, since either will do, for xpalloc.
13858 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
13859 (xnmalloc, xnrealloc, xpalloc): New functions.
13861 * bidi.c (bidi_shelve_header_size): New constant.
13862 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
13863 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
13865 * bidi.c (bidi_cache_shrink):
13866 * buffer.c (overlays_at, overlays_in, record_overlay_string)
13868 Don't update size of array until after memory allocation succeeds,
13869 because xmalloc/xrealloc may not return.
13870 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
13871 now that we have proper integer overflow checking.
13872 (record_overlay_string, overlay_strings): Catch overflows when
13873 calculating size of overlay_str_buf.
13875 * callproc.c (Fcall_process): Check for size overflow when
13876 calculating size of args2.
13877 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
13878 Normally we prefer signed values, but sticking with ptrdiff_t would
13879 require adding more-complicated checks.
13881 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
13882 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
13883 Redo buffer-overflow calculations to avoid integer overflow.
13884 Add a FIXME comment where memory seems to be over-allocated.
13886 * character.c (Fstring): Check for size-calculation overflow.
13888 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
13889 unnecessary integer overflow. Check for size overflow.
13890 (encode_coding_object): Don't update size until xmalloc succeeds.
13892 * composite.c (get_composition_id): Check for overflow in glyph
13893 length calculations.
13895 Integer and memory overflow fixes for display code.
13896 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
13897 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
13898 (scrolling_window): Check for overflow in size calculations.
13899 (line_draw_cost, realloc_glyph_pool, add_row_entry):
13900 Don't assume glyph table len fits in int.
13901 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
13902 (row_table_size): Now ptrdiff_t, not int.
13903 (scrolling_window): Avoid overflow in size calculations.
13904 Don't update size until allocation succeeds.
13905 * fns.c (concat): Check for overflow in size calculations.
13906 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
13907 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
13908 (NEXT_ALMOST_PRIME_LIMIT): New constant.
13910 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
13911 (get_doc_string): Check for size calculation overflow.
13912 Don't update size until allocation succeeds.
13913 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
13914 EMACS_INT, where ptrdiff_t will do.
13915 (Fsubstitute_command_keys): Check for string overflow.
13917 * editfns.c (set_time_zone_rule): Don't assume environment length
13919 (message_length): Now ptrdiff_t, not int.
13920 (Fmessage_box): Don't update size until allocation succeeds.
13921 Don't assume message length fits in int.
13922 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
13924 * emacs.c (main): Do not reallocate argv, since there is a null at
13925 the end that can be overwritten, and this way there's no need to
13926 worry about size-calculation overflow.
13927 (sort_args): Check for size-calculation overflow.
13929 * eval.c (init_eval_once, grow_specpdl): Don't update size until
13931 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
13933 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
13934 (x_set_scroll_bar_width, x_figure_window_size):
13935 Check for integer overflow.
13936 (x_set_alpha): Do not assume XINT fits in int.
13938 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
13939 This is for the members text_lines, text_cols, total_lines, total_cols,
13940 where the system imposes an 'int' limit.
13942 * fringe.c (Fdefine_fringe_bitmap):
13943 Don't update size until alloc works.
13945 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
13946 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
13948 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
13949 Check for size-calculation overflow.
13950 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
13951 do, as we prefer signed integers.
13952 (id_to_widget.max_size, id_to_widget.used)
13953 (xg_store_widget_in_map, xg_remove_widget_from_map)
13954 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
13955 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
13956 Use and return ptrdiff_t, not int.
13957 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
13958 * gtkutil.h: Change prototypes to match the above.
13960 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
13961 are duplicate now that they've been promoted to lisp.h.
13962 (x_allocate_bitmap_record, x_alloc_image_color)
13963 (make_image_cache, cache_image, xpm_load):
13964 Don't update size until alloc is done.
13965 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
13967 Check for size calculation overflow.
13968 (ct_colors_allocated_max): New constant.
13969 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
13972 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
13973 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
13974 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
13975 Use ptrdiff_t, not int, to count maps.
13976 (read_char_minibuf_menu_prompt): Check for overflow in size
13977 calculations. Don't update size until allocation succeeds.
13978 Redo calculations to avoid overflow.
13979 * keyboard.h: Change prototypes to match the above.
13981 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
13983 (current_minor_maps): Check for size calculation overflow.
13984 * keymap.h: Change prototypes to match the above.
13986 * lread.c (read1, init_obarray): Don't update size until alloc done.
13988 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
13989 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
13991 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
13992 Now ptrdiff_t, not int.
13993 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
13994 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
13996 * process.c (Fnetwork_interface_list): Check for overflow
13997 in size calculation.
13999 * region-cache.c (move_cache_gap): Check for size calculation overflow.
14001 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
14002 overflow. Don't bother calling xmalloc when xrealloc will do.
14004 * search.c (Freplace_match): Check for size calculation overflow.
14005 (Fset_match_data): Don't assume list lengths fit in 'int'.
14007 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
14008 for command line length. Do not attempt to address one before the
14009 beginning of an array, as that's not portable.
14011 * term.c (max_frame_lines): Remove; unused.
14012 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
14014 (encode_terminal_code, calculate_costs): Check for size
14015 calculation overflow.
14016 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
14017 table lengths and related sizes. Don't update size until alloc
14018 done. Redo calculations to avoid overflow.
14019 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
14021 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
14022 subtracting pointers.
14023 (gobble_line): Check for overflow more carefully. Don't update size
14026 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
14027 Don't update size until alloc done.
14028 Redo size calculations to avoid overflow.
14029 Check for size calculation overflow.
14030 (main) [DEBUG]: Fix typo in invoking tparam1.
14032 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
14033 Use ptrdiff_t, not int, for sizes.
14034 (store_mode_line_noprop_char): Don't update size until alloc done.
14036 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
14037 Use ptrdiff_t, not int, for sizes.
14038 (Finternal_make_lisp_face, cache_face):
14039 Check for size calculation overflow.
14040 (cache_face): Treat size calculation overflows as if they were
14041 memory exhaustion (the usual treatment), rather than aborting.
14043 * xfns.c (x_encode_text, x_set_name_internal)
14044 (Fx_change_window_property): Use ptrdiff_t, not int, to count
14045 sizes, since they can exceed INT_MAX in size. Check for size
14046 calculation overflow.
14048 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
14049 (xg_select): Check for size calculation overflow.
14050 Don't update size until alloc done.
14052 * xrdb.c (get_environ_db): Don't assume path length fits in int,
14053 as sprintf is limited to int lengths.
14055 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
14056 (X_LONG_MIN): New macros.
14057 Use them to make the following changes clearer.
14058 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
14059 This change doesn't affect the value now, but it may help remind
14060 future maintainers not to raise the value too much later.
14061 (SELECTION_QUANTUM): Remove, replacing with ...
14062 (selection_quantum): ... new function, which avoids overflow.
14064 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
14065 assumption that selection length fits in 'int'.
14066 (x_reply_selection_request, x_handle_selection_request)
14067 (x_get_window_property, receive_incremental_selection)
14068 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
14069 (lisp_data_to_selection_data, clean_local_selection_data):
14070 Use ptrdiff_t, not int, to record length of selection.
14071 (x_reply_selection_request, x_get_window_property)
14072 (receive_incremental_selection, x_property_data_to_lisp):
14073 Redo calculations to avoid overflow.
14074 (x_reply_selection_request): When sending hint, ceiling it at
14075 X_LONG_MAX rather than relying on wraparound overflow to send
14077 (x_get_window_property, receive_incremental_selection)
14078 (lisp_data_to_selection_data, x_property_data_to_lisp):
14079 Check for size-calculation overflow.
14080 (x_get_window_property, receive_incremental_selection)
14081 (lisp_data_to_selection_data, Fx_register_dnd_atom):
14082 Don't store size until memory allocation succeeds.
14083 (x_get_window_property): Plug memory leak on memory exhaustion.
14084 Don't double-block input; malloc is safe here. Don't assume 2**34
14085 - 4 fits in unsigned long. Add an xassert to check
14086 XGetWindowProperty overflow. Be more careful about overflow
14087 calculations, and distinguish size from memory overflow better.
14088 (receive_incremental_selection): When tracing, don't assume
14089 unsigned int is less than INT_MAX.
14090 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
14091 harmful) conversions of unsigned short to int.
14092 (lisp_data_to_selection_data): Don't assume that integers
14093 in the range -65535 through -1 fit in an X unsigned short.
14094 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
14095 result parameters unless successful. Rely on cons_to_unsigned
14096 to report problems with elements; the old code wasn't right anyway.
14097 (x_check_property_data): Check for int overflow; we cannot use
14098 a wider type due to X limits.
14099 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
14101 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
14103 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
14104 (x_term_init): Check for size calculation overflow.
14105 (x_color_cells): Don't store size until memory allocation succeeds.
14106 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
14107 Don't assume alloca size is less than MAX_ALLOCA.
14108 (x_term_init): Don't assume length fits in int (sprintf is limited
14111 Use ptrdiff_t for composition IDs.
14112 * character.c (lisp_string_width):
14113 * composite.c (composition_table_size, n_compositions)
14114 (get_composition_id, composition_gstring_from_id):
14115 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
14116 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
14117 * window.c (Frecenter):
14118 Use ptrdiff_t, not int, for composition IDs.
14119 * composite.c (get_composition_id): Check for integer overflow.
14120 * composite.h: Adjust prototypes to match the above changes.
14122 Use ptrdiff_t for hash table indexes.
14123 * category.c (hash_get_category_set):
14124 * ccl.c (ccl_driver):
14125 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
14126 * coding.c (coding_system_charset_list, detect_coding_system):
14127 * coding.h (struct coding_system.id):
14128 * composite.c (get_composition_id, gstring_lookup_cache):
14129 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
14130 * image.c (xpm_get_color_table_h):
14131 * lisp.h (hash_lookup, hash_put):
14132 * minibuf.c (Ftest_completion):
14133 Use ptrdiff_t for hash table indexes, not int (which is too
14134 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
14135 32-bit --with-wide-int hosts).
14137 * charset.c (Fdefine_charset_internal): Check for integer overflow.
14138 Add a FIXME comment about memory leaks.
14139 (syms_of_charset): Don't assume xmalloc returns.
14141 Don't assume that stated character widths fit in int.
14142 * character.c (Fchar_width, c_string_width, lisp_string_width):
14143 * character.h (CHAR_WIDTH):
14144 * indent.c (MULTIBYTE_BYTES_WIDTH):
14145 Use sanitize_char_width to avoid undefined and/or bad behavior
14146 with outlandish widths.
14147 * character.h (sanitize_tab_width): Rename from sanitize_width,
14148 now that we have two such functions. All uses changed.
14149 (sanitize_char_width): New inline function.
14151 Don't assume that tab-width fits in int.
14152 * character.h (sanitize_width): New inline function.
14153 (SANE_TAB_WIDTH): New macro.
14154 (ASCII_CHAR_WIDTH): Use it.
14155 * indent.c (sane_tab_width): Remove. All uses replaced by
14156 SANE_TAB_WIDTH (current_buffer).
14157 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
14159 * fileio.c: Integer overflow issues with file modes.
14160 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
14162 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
14163 Remove unreachable code.
14164 (read_hex, load_charset_map_from_file): Check for integer overflow.
14166 * xterm.c: Don't go over XClientMessageEvent limit.
14167 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
14168 (x_send_scroll_bar_event): Likewise. Check that the size does not
14169 exceed limits imposed by XClientMessageEvent, as well as the usual
14170 ptrdiff_t and size_t limits.
14172 * keyboard.c: Overflow, signedness and related fixes.
14173 (make_lispy_movement): Use same integer type in forward decl
14174 that is used in the definition.
14175 (read_key_sequence, keyremap_step):
14176 Change bufsize argument back to int, undoing my 2011-03-30 change.
14177 We prefer signed types, and int is wide enough here.
14178 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
14179 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
14180 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
14181 length, not size_t. Use ptrdiff_t for index, not int.
14182 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
14183 possibility of integer overflow.
14185 Overflow, signedness and related fixes for images.
14187 * dispextern.h (struct it.stack[0].u.image.image_id)
14188 (struct_it.image_id, struct image.id, struct image_cache.size)
14189 (struct image_cache.used, struct image_cache.ref_count):
14190 * gtkutil.c (update_frame_tool_bar):
14191 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
14192 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
14193 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
14194 * nsmenu.m (update_frame_tool_bar):
14195 * xdisp.c (calc_pixel_width_or_height):
14196 * xfns.c (image_cache_refcount):
14197 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
14198 on typical 64-bit hosts.
14200 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
14201 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
14202 Omit unnecessary casts to int.
14203 (parse_image_spec): Check that integers fall into 'int' range
14204 when the callers expect that.
14205 (image_ascent): Redo ascent calculation to avoid int overflow.
14206 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
14207 (lookup_image): Remove unnecessary tests.
14208 (xbm_image_p): Locals are now of int, not EMACS_INT,
14209 since parse_image_check makes sure they fit into int.
14210 (png_load, gif_load, svg_load_image):
14211 Prefer int to unsigned where either will do.
14212 (tiff_handler): New function, combining the cores of the
14213 old tiff_error_handler and tiff_warning_handler.
14214 This function is rewritten to use vsnprintf and thereby avoid
14215 stack buffer overflows. It uses only the features of vsnprintf
14216 that are common to both POSIX and native Microsoft.
14217 (tiff_error_handler, tiff_warning_handler): Use it.
14218 (tiff_load, gif_load, imagemagick_load_image):
14219 Don't assume :index value fits in 'int'.
14220 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
14221 (imagemagick_load_image): Check that crop parameters fit into
14222 the integer types that MagickCropImage accepts. Don't assume
14223 Vimagemagick_render_type has a nonnegative value. Don't assume
14224 size_t fits in 'long'.
14225 (gs_load): Use printmax_t to print the widest integers possible.
14226 Check for integer overflow when computing image height and width.
14228 2011-08-26 Eli Zaretskii <eliz@gnu.org>
14230 * xdisp.c (redisplay_window): Don't force window start if point
14231 will be invisible in the resulting window. (Bug#9324)
14233 2011-08-25 Eli Zaretskii <eliz@gnu.org>
14235 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
14236 the display spec is of the form `(space ...)'.
14237 (handle_display_spec): Return the value returned by
14238 handle_single_display_spec, not just 1 or zero.
14239 (handle_single_display_spec): If the display spec is of the form
14240 `(space ...)', and specifies display in the text area, return 2
14242 (try_cursor_movement): Check for the need to scroll more
14243 accurately, and prefer exact match for point under bidi.
14244 Don't advance `row' beyond the last row of the window.
14246 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
14247 into disp_prop; all users changed.
14249 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
14250 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
14251 for the text covered by the display property.
14253 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
14255 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
14256 Change return value to nil.
14257 (Frecord_buffer): Delete unused function.
14259 2011-08-24 Eli Zaretskii <eliz@gnu.org>
14261 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
14262 buffers, return left-to-right.
14263 (set_cursor_from_row): Consider candidate row a win if its glyph
14264 represents a newline and point is on that newline. Fixes cursor
14265 positioning on the newline at EOL of R2L text within L2R
14266 paragraph, and vice versa.
14267 (try_cursor_movement): Check continued rows, in addition to
14268 continuation rows. Fixes unwarranted scroll when point enters a
14269 continued line of R2L text within an L2R paragraph, or vice versa.
14270 (cursor_row_p): Consider the case of point being equal to
14271 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
14272 from the end of a short line to the beginning of a continued line
14273 of R2L text within L2R paragraph.
14274 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
14275 composed characters.
14277 * bidi.c (bidi_check_type): Use xassert.
14278 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
14281 2011-08-23 Eli Zaretskii <eliz@gnu.org>
14283 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
14286 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
14288 * nsfont.m (ns_otf_to_script): Fix typo.
14290 2011-08-22 Kenichi Handa <handa@m17n.org>
14292 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
14293 extra slot even if the purpose is char-code-property-table.
14295 2011-08-23 Eli Zaretskii <eliz@gnu.org>
14297 * xdisp.c (redisplay_window): When computing centering_position,
14298 account for the height of the header line. (Bug#8874)
14300 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
14301 instead of CHAR_TO_BYTE. Fixes a crash when a completion
14302 candidate is selected by the mouse, and that candidate has a
14303 composed character under the mouse.
14305 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
14306 coordinates reported by pos-visible-in-window-p for a composed
14307 character in column zero.
14309 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
14311 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
14313 2011-08-22 Eli Zaretskii <eliz@gnu.org>
14315 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
14316 consider it a hit if to_charpos is anywhere in the range of the
14317 composed buffer positions.
14319 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
14321 * image.c (gif_load): Don't assume that each subimage has the same
14322 dimensions as the base image. Handle disposal method that is
14323 "undefined" by the gif spec (Bug#9335).
14325 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
14327 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
14328 (Fcondition_case): Document `debug' symbol in error handler.
14330 2011-08-19 Eli Zaretskii <eliz@gnu.org>
14332 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
14333 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
14334 from an Org mode buffer to a Speedbar frame.
14336 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
14337 a composition, take its buffer position from IT->cmp_it.charpos.
14338 Fixes cursor positioning at the beginning of a line that begins
14339 with a composed character.
14341 2011-08-18 Eli Zaretskii <eliz@gnu.org>
14343 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
14344 character bidirectional type, use STRONG_L instead. Fixes crashes
14345 in a buffer produced by `describe-categories'.
14347 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
14348 members before the level stack, so they would be saved and
14349 restored when copying iterator state. Fixes incorrect reordering
14350 around TABs covered by display properties.
14352 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
14354 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
14356 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
14358 * eval.c (internal_condition_case, internal_condition_case_1)
14359 (internal_condition_case_2, internal_condition_case_n):
14360 Remove unnecessary aborts (Bug#9081).
14362 2011-08-17 Eli Zaretskii <eliz@gnu.org>
14364 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
14365 has no `load' handler, try opening the file locally. (Bug#9311)
14367 2011-08-16 Ken Brown <kbrown@cornell.edu>
14369 * gmalloc.c: Expand comment.
14371 2011-08-16 Eli Zaretskii <eliz@gnu.org>
14373 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
14374 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
14376 2011-08-16 Ken Brown <kbrown@cornell.edu>
14378 Fix memory allocation problems in Cygwin build (Bug#9273).
14380 * unexcw.c ( __malloc_initialized): Declare external variable.
14381 (fixup_executable): Force the dumped emacs to reinitialize malloc.
14383 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
14385 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
14387 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
14388 in the static heap.
14389 [CYGWIN] (special_realloc): New function.
14390 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
14391 requests to realloc storage in the static heap.
14393 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
14395 * bidi.c (bidi_initialize): Remove unused local.
14397 2011-08-15 Eli Zaretskii <eliz@gnu.org>
14400 * biditype.h: Remove file.
14401 * makefile.w32-in ($(BLD)/bidi.$(O)):
14402 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
14404 * dispextern.h: Fix a typo in the comment to bidi_type_t.
14406 * chartab.c: Improve commentary for the uniprop_table API.
14408 * bidi.c (bidi_paragraph_init): Support zero value of
14409 bidi_ignore_explicit_marks_for_paragraph_level.
14410 (bidi_initialize): Use uniprop_table instead of including
14411 biditype.h and bidimirror.h.
14413 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
14414 coordinates of the iterator when restoring from ppos_it.
14417 2011-08-14 Kenichi Handa <handa@m17n.org>
14419 * process.c (create_process): Call setup_process_coding_systems
14420 after the pid of the process is set to -1 (Bug#8162).
14422 2011-08-14 Eli Zaretskii <eliz@gnu.org>
14424 * xdisp.c (move_it_in_display_line_to): Don't invoke
14425 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
14426 ppos_it. Fixes vertical cursor motion when line beginning is
14427 covered by an image. (Bug#9296)
14429 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
14431 * nsterm.h (ns_run_ascript): Declare.
14432 (NSAPP_DATA2_RUNASSCRIPT): Define.
14434 * nsfns.m (as_script, as_result, as_status): New static variables.
14435 (ns_run_ascript): New function.
14436 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
14437 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
14438 the event loop. Get status from as_status (Bug#7276).
14440 * nsterm.m (sendEvent): If event is NSApplicationDefined and
14441 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
14442 the event loop (Bug#7276).
14444 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
14446 * gnutls.c (QCgnutls_bootprop_priority)
14447 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
14448 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
14449 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
14450 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
14451 (QCgnutls_bootprop_verify_hostname_error)
14452 (QCgnutls_bootprop_callbacks_verify): Rename from
14453 Qgnutls_bootprop_..., all uses changed.
14455 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
14458 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
14460 * xfaces.c (Qframe_set_background_mode): Now static.
14461 * dispextern.h (Qframe_set_background_mode): Remove decl.
14463 * process.c (Fnetwork_interface_info): Declare local only if needed.
14465 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
14467 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
14468 (Fnetwork_interface_list): Allocate in increments of bytes instead
14469 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
14470 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
14472 (struct ifflag_def): notrailers is smart on OSX.
14473 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
14474 Get hardware address with getifaddrs if available.
14476 2011-08-12 Eli Zaretskii <eliz@gnu.org>
14478 * xdisp.c (iterate_out_of_display_property): xassert that
14479 IT->position is set to within IT->object's boundaries. Break from
14480 the loop as soon as EOB is reached; avoids infloops in redisplay
14481 when IT->position is set up wrongly due to some bug.
14482 Set IT->current to match the bidi iterator unconditionally.
14483 (push_display_prop): Allow GET_FROM_STRING as IT->method on
14484 entry. Force push_it to save on the stack the current
14485 buffer/string position, to be restored by pop_it. Fix flags in
14486 the iterator structure wrt the object coming from a display
14487 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
14488 properties. (Bug#9284)
14490 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
14492 * fontset.c (fontset_get_font_group): Add proper type checks.
14495 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14497 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
14498 and LC_VERSION_MIN_MACOSX.
14499 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
14500 (dump_it) [LC_FUNCTION_STARTS]: Use it.
14502 2011-08-08 Eli Zaretskii <eliz@gnu.org>
14504 * xdisp.c (forward_to_next_line_start): Allow to use the
14505 no-display-properties-and-no-overlays under bidi display.
14506 Set disp_pos in the bidi iterator to avoid searches for display
14507 properties and overlays.
14509 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
14511 * editfns.c (Fset_time_zone_rule): Document relationship with the
14514 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
14515 the font entity extracted from the cache (Bug#8109).
14517 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
14519 * composite.c (autocmp_chars): Don't reset point. That is done by
14520 restore_point_unwind (Bug#5984).
14522 2011-08-07 Juri Linkov <juri@jurta.org>
14524 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
14525 to show the arg `TIME' instead of `TIMEVAL'.
14527 2011-08-06 Eli Zaretskii <eliz@gnu.org>
14529 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
14530 display property strides EOL and includes a newline, as in
14531 longlines-mode. (Bug#9254)
14532 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
14533 word-wrap under bidirectional display. (Bug#9224)
14535 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
14536 is non-zero, even if the data buffer is NULL. Fixes a crash in
14537 vertical-motion with longlines-mode. (Bug#9254)
14539 2011-08-05 Eli Zaretskii <eliz@gnu.org>
14541 * bidi.c <bidi_cache_total_alloc>: Now static.
14542 (bidi_initialize): Initialize bidi_cache_total_alloc.
14544 * xdisp.c (display_line): Release buffer allocated for shelved bidi
14547 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
14548 amount allocated this far in `bidi_cache_total_alloc'.
14549 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
14550 non-zero, only free the data buffer without restoring the cache
14551 contents. All callers changed.
14553 * dispextern.h (bidi_unshelve_cache): Update prototype.
14555 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
14556 (move_it_in_display_line, move_it_to)
14557 (move_it_vertically_backward, move_it_by_lines): Replace the call
14558 to xfree to an equivalent call to bidi_unshelve_cache.
14559 (move_it_in_display_line_to): Fix logic of returning
14560 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
14562 2011-08-05 Eli Zaretskii <eliz@gnu.org>
14564 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
14565 came from a string character with a `cursor' property. (Bug#9229)
14567 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
14569 * Makefile.in (LIB_PTHREAD): New variable.
14570 (LIBES): Add LIB_PTHREAD (Bug#9216).
14572 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
14573 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
14575 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
14577 * regex.c (re_iswctype): Remove some redundant boolean conversions.
14579 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
14581 * xterm.c (x_find_topmost_parent): New function.
14582 (x_set_frame_alpha): Find topmost parent window with
14583 x_find_topmost_parent and set the property there also (bug#9181).
14584 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
14586 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
14588 * callproc.c (Fcall_process): Avoid vfork clobbering
14589 the local vars buffer, coding_systems, current_dir.
14591 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
14593 * keymap.c (Fmake_composed_keymap): Move to subr.el.
14595 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
14597 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
14598 so that it is not optimized away.
14600 * xdisp.c (compute_display_string_pos): Remove unused local.
14602 2011-08-02 Eli Zaretskii <eliz@gnu.org>
14604 Fix slow cursor motion and scrolling in large buffers with
14605 selective display, like Org Mode buffers. (Bug#9218)
14607 * dispextern.h (struct bidi_it): New member disp_prop_p.
14609 * xdisp.c: Remove one-slot cache of display string positions.
14610 (compute_display_string_pos): Accept an additional argument
14611 DISP_PROP_P; callers changed. Scan at most 5K characters forward
14612 for a display string or property. If found, set DISP_PROP_P
14615 * bidi.c (bidi_fetch_char): Accept an additional argument
14616 DISP_PROP_P, and pass it to compute_display_string_pos.
14617 Only handle text covered by a display string if DISP_PROP_P is returned
14618 non-zero. All callers of bidi_fetch_char changed.
14620 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
14622 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
14624 2010-12-03 Don March <don@ohspite.net>
14626 * keymap.c (Fdefine_key): Fix non-prefix key error message when
14627 last character M-[char] is translated to ESC [char] (bug#7541).
14629 2011-08-02 Kenichi Handa <handa@m17n.org>
14631 * lisp.h (uniprop_table): Extern it.
14633 * chartab.c (uniprop_table): Make it non-static.
14635 2011-08-01 Eli Zaretskii <eliz@gnu.org>
14637 * xdisp.c (forward_to_next_line_start): Accept additional argument
14638 BIDI_IT_PREV, and store into it the state of the bidi iterator had
14640 (reseat_at_next_visible_line_start): Use the bidi iterator state
14641 returned by forward_to_next_line_start to restore the state of
14642 it->bidi_it after backing up to previous newline. (Bug#9212)
14644 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
14646 * regex.c (re_comp): Protoize.
14647 (re_exec): Fix return type.
14648 (regexec): Fix type of `ret'. (Bug#9203)
14650 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14652 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
14653 This is needed if max-image-size is a floating-point number.
14655 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
14657 * print.c (print_object): Print empty symbol as ##.
14659 * lread.c (read1): Read ## as empty symbol.
14661 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
14663 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
14664 setting frame foreground color (Bug#9175).
14665 (x_set_background_color): Likewise.
14667 * nsmenu.m (-setText): Size tooltip dimensions precisely to
14668 contents (Bug#9176).
14669 (EmacsTooltip -init): Remove bezels and add shadows to
14672 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
14673 or scroll bar (Bug#8470).
14675 * nsfont.m (nsfont_open): Remove assignment to voffset and
14676 unnecessary vars hshink, expand, hd, full_height, min_height.
14677 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
14679 * nsterm.h (nsfont_info): Remove voffset field.
14681 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
14683 Implement strike-through and overline on NextStep (Bug#8863).
14685 * nsfont.m (nsfont_open): Use underline position provided by font,
14686 instead of hard-coded value of 2.
14687 (nsfont_draw): Call ns_draw_text_decoration instead.
14689 * nsterm.h: Add declaration for ns_draw_text_decoration.
14691 * nsterm.m (ns_draw_text_decoration): New function for drawing
14692 underline, overline, and strike-through.
14693 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
14694 ns_draw_text_decoration. Change treatment of cursor drawing to
14695 accommodate underlining, etc.
14697 2011-07-28 Eli Zaretskii <eliz@gnu.org>
14699 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
14702 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14704 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
14705 Without this fix, if a signal arrives just after memory fills up,
14706 'malloc' might be invoked reentrantly.
14708 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
14709 In other words, assume that every image size is allowed, on non-X
14710 hosts. This assumption is probably wrong, but it lets Emacs compile.
14712 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
14714 * regex.c (re_iswctype): Convert return values to boolean.
14716 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
14718 * xdisp.c (compute_display_string_pos): Don't use cached display
14719 string position if the buffer had its restriction changed.
14722 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14724 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14726 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14728 Integer signedness and overflow and related fixes. (Bug#9079)
14730 * bidi.c: Integer size and overflow fixes.
14731 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
14732 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
14733 (bidi_cache_find_level_change, bidi_cache_ensure_space)
14734 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
14735 (bidi_find_other_level_edge):
14736 Use ptrdiff_t instead of EMACS_INT where either will do.
14737 This works better on 32-bit hosts configured --with-wide-int.
14738 (bidi_cache_ensure_space): Check for size-calculation overflow.
14739 Use % rather than repeated addition, for better worst-case speed.
14740 Don't set bidi_cache_size until after xrealloc returns, because it
14742 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
14743 (bidi_cache_ensure_space): Also check that the bidi cache size
14744 does not exceed that of the largest Lisp string or buffer. See Eli
14745 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
14747 * alloc.c (__malloc_size_t): Remove.
14748 All uses replaced by size_t. See Andreas Schwab's note
14749 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
14751 * image.c: Improve checking for integer overflow.
14752 (check_image_size): Assume that f is nonnull, since
14753 it is always nonnull in practice. This is one less thing to
14754 worry about when checking for integer overflow later.
14755 (x_check_image_size): New function, which checks for integer
14756 overflow issues inside X.
14757 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
14758 This removes the need for a memory_full check.
14759 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
14760 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
14761 (xbm_read_bitmap_data): Change locals back to 'int', since
14762 their values must fit in 'int'.
14763 (xpm_load_image, png_load, tiff_load):
14764 Invoke x_create_x_image_and_pixmap earlier,
14765 to avoid much needless work if the image is too large.
14766 (tiff_load): Treat overly large images as if
14767 x_create_x_image_and_pixmap failed, not as malloc failures.
14768 (gs_load): Use x_check_image_size.
14770 * gtkutil.c: Omit integer casts.
14771 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
14772 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
14774 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
14776 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
14777 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
14778 would wrongly return t on a 64-bit host.
14780 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
14781 The plain *_OVERFLOW macros run afoul of GCC bug 49705
14782 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
14783 and therefore cause GCC to emit a bogus diagnostic in some cases.
14785 * image.c: Integer signedness and overflow and related fixes.
14786 This is not an exhaustive set of fixes, but it's time to
14787 record what I've got.
14788 (lookup_pixel_color, check_image_size): Remove redundant decls.
14789 (check_image_size): Don't assume that arbitrary EMACS_INT values
14790 fit in 'int', or that arbitrary 'double' values fit in 'int'.
14791 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
14792 (tiff_load, imagemagick_load_image):
14793 Check for overflow in size calculations.
14794 (x_create_x_image_and_pixmap): Remove unnecessary test for
14795 xmalloc returning NULL; that can't happen.
14796 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
14797 (xpm_color_bucket): Use better integer hashing function.
14798 (xpm_cache_color): Don't possibly over-allocate memory.
14799 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
14800 (gif_memory_source):
14801 Use ptrdiff_t, not int or size_t, to record sizes.
14802 (png_load): Don't assume values greater than 2**31 fit in 'int'.
14803 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
14804 either works, as we prefer signed integers.
14805 (tiff_read_from_memory, tiff_write_from_memory):
14806 Return tsize_t, not size_t, since that's what the TIFF API wants.
14807 (tiff_read_from_memory): Don't fail simply because the read would
14808 go past EOF; instead, return a short read.
14809 (tiff_load): Omit no-longer-needed casts.
14810 (Fimagemagick_types): Don't assume size fits into 'int'.
14812 Improve hashing quality when configured --with-wide-int.
14813 * fns.c (hash_string): New function, taken from sxhash_string.
14814 Do not discard information about ASCII character case; this
14815 discarding is no longer needed.
14816 (sxhash-string): Use it. Change sig to match it. Caller changed.
14817 * lisp.h: Declare it.
14818 * lread.c (hash_string): Remove, since we now use fns.c's version.
14819 The fns.c version returns a wider integer if --with-wide-int is
14820 specified, so this should help the quality of the hashing a bit.
14822 * emacs.c: Integer overflow minor fix.
14823 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
14824 Define only if GNU_LINUX.
14825 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
14827 * dispnew.c: Integer signedness and overflow fixes.
14828 Remove unnecessary forward decls, that were a maintenance hassle.
14829 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
14831 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
14832 (scrolling_window): Use ptrdiff_t, not int, for byte count.
14833 (prepare_desired_row, line_draw_cost):
14834 Use int, not unsigned, where either works.
14835 (save_current_matrix, restore_current_matrix):
14836 Use ptrdiff_t, not size_t, where either works.
14837 (init_display): Check for overflow more accurately, and without
14838 relying on undefined behavior.
14840 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
14841 Remove, replacing with the new symbols in lisp.h. All uses changed.
14842 * fileio.c (make_temp_name):
14843 * filelock.c (lock_file_1, lock_file):
14844 * xdisp.c (message_dolog):
14845 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
14846 Use pMd etc. instead.
14847 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
14848 replacing the pWIDE etc. symbols removed from editfns.c.
14850 * keyboard.h (num_input_events): Now uintmax_t.
14851 This is (very slightly) less likely to mess up due to wraparound.
14854 * buffer.c: Integer signedness fixes.
14855 (alloc_buffer_text, enlarge_buffer_text):
14856 Use ptrdiff_t rather than size_t when either will do, as we prefer
14859 * alloc.c: Integer signedness and overflow fixes.
14860 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
14861 (__malloc_size_t): Default to size_t, not to int.
14862 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
14863 (Fgarbage_collect, mark_object_loop_halt, mark_object):
14864 Prefer ptrdiff_t to size_t when either would do, as we prefer
14866 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
14867 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
14868 Now const. Initialize with values that are in range even if char
14870 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
14871 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
14872 These functions do the right thing with sizes > 2**32.
14873 (check_depth): Now ptrdiff_t, not int.
14874 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
14875 Adjust to new way of storing sizes. Check for size overflow bugs
14877 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
14878 slightly wrong anyway, as it missed one instance of
14879 XMALLOC_OVERRUN_CHECK_OVERHEAD.
14880 (refill_memory_reserve): Omit needless cast to size_t.
14881 (mark_object_loop_halt): Mark as externally visible.
14883 * xselect.c: Integer signedness and overflow fixes.
14884 (Fx_register_dnd_atom, x_handle_dnd_message):
14885 Use ptrdiff_t, not size_t, since we prefer signed.
14886 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
14887 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
14888 x_dnd_atoms_size and x_dnd_atoms_length.
14890 * doprnt.c: Prefer signed to unsigned when either works.
14892 * doprnt.c (doprnt):
14894 * xdisp.c (vmessage):
14895 Use ptrdiff_t, not size_t, when using or implementing doprnt,
14896 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
14897 prefer signed arithmetic to avoid comparison confusion.
14898 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
14899 but is a bit tricky.
14901 Assume freestanding C89 headers, string.h, stdlib.h.
14902 * data.c, doprnt.c, floatfns.c, print.c:
14903 Include float.h unconditionally.
14904 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
14905 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
14906 * regex.c: Likewise for stddef.h, string.h.
14907 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
14908 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
14909 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
14910 (STDC_HEADERS): Remove obsolete defines.
14911 * sysdep.c: Include limits.h unconditionally.
14913 Assume support for memcmp, memcpy, memmove, memset.
14914 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
14915 * regex.c (memcmp, memcpy):
14916 Remove; we assume C89 now.
14918 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
14919 (__malloc_safe_bcopy): Remove; no longer needed.
14921 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
14922 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
14923 well either way, and we prefer signed to unsigned.
14925 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
14927 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
14928 closes the connection while we're reading (bug#9182).
14930 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
14932 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
14933 are specified (Bug#9168).
14935 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
14937 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
14938 Found by GCC static checking and --with-wide-int on a 32-bit host.
14940 2011-07-25 Eli Zaretskii <eliz@gnu.org>
14942 * xdisp.c (compute_display_string_pos): Fix logic of caching
14943 previous display string position. Initialize cached_prev_pos to
14944 -1. Fixes slow-down at the beginning of a buffer.
14946 2011-07-24 Eli Zaretskii <eliz@gnu.org>
14948 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
14949 for attrs[LFACE_FONTSET_INDEX].
14951 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
14953 * xml.c (parse_region): Remove unused local
14954 that was recently introduced.
14956 2011-07-23 Eli Zaretskii <eliz@gnu.org>
14958 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
14959 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
14961 * xdisp.c (move_it_in_display_line_to): Record the best matching
14962 position for TO_CHARPOS while scanning the line, and restore it on
14963 exit if none of the characters scanned was an exact match.
14964 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
14965 when exact match is impossible due to invisible text, and the
14966 lines are truncated.
14968 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
14970 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
14973 2011-07-22 Eli Zaretskii <eliz@gnu.org>
14975 Fix a significant slow-down of cursor motion with C-n, C-p,
14976 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
14977 auto-repeat under bidi redisplay in fontified buffers.
14978 * xdisp.c (compute_stop_pos_backwards): New function.
14979 (next_element_from_buffer): Call compute_stop_pos_backwards to
14980 find a suitable prev_stop when we find ourselves before
14982 (reseat): Don't look for prev_stop, as that could mean a very long
14984 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
14985 <cached_disp_overlay_modiff>: Cache for last found display string
14987 (compute_display_string_pos): Return the cached position if asked
14988 about the same buffer in the same area of character positions, and
14989 the buffer wasn't changed since the time the display string
14990 position was cached.
14992 2011-07-22 Eli Zaretskii <eliz@gnu.org>
14994 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
14995 is an integer, which is important for empty lines. (Bug#9149)
14997 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
14999 * frame.c (Fmodify_frame_parameters): In tty case, update the
15000 default face if necessary (Bug#4238).
15002 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
15004 * editfns.c (Fstring_to_char): No need to explain what a character
15005 is in the docstring (Bug#6576).
15007 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
15009 * xml.c (parse_region): Make sure we always return a tree.
15011 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
15013 * xml.c (parse_region): If a document contains only comments,
15016 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
15018 * xml.c (make_dom): Return comments, too.
15020 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
15023 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
15024 and the surrounding thread.
15025 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
15026 rather than fgets, and retry after EINTR. Otherwise, 'emacs
15027 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
15029 * s/openbsd.h (BROKEN_SIGIO): Define.
15030 * unexelf.c (unexec) [__OpenBSD__]:
15031 Don't update the .mdebug section of the Alpha COFF symbol table.
15033 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
15035 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
15038 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
15040 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
15041 This fixes some race conditions on the permissions of any newly
15044 * alloc.c (valid_pointer_p): Use pipe, not open.
15045 This fixes some permissions issues when debugging.
15047 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
15048 If fchown fails to set both uid and gid, try to set just gid,
15049 as that is sometimes allowed. Adjust the file's mode to eliminate
15050 setuid or setgid bits that are inappropriate if fchown fails.
15052 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
15054 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
15055 to compare Lisp_Objects.
15056 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
15057 global_gnutls_log_level, don't mistake it for a Lisp_Object.
15058 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
15060 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
15062 * lread.c (read_integer): Unread even EOF character.
15063 (read1): Likewise. Properly record start position of symbol.
15065 * lread.c (read1): Read `#:' as empty uninterned symbol if no
15066 symbol character follows.
15068 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
15070 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
15071 This works around a problem with the previous change to Fcopy_file.
15072 Recent glibc declares fchown with __attribute__((warn_unused_result)),
15073 and without this change, GCC might complain about discarding
15074 fchown's return value.
15076 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
15078 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
15080 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
15082 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
15084 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
15086 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
15087 it's used from the C level.
15089 * process.c: Use the same condition for POLL_FOR_INPUT in both
15090 keyboard.c and process.c (bug#1858).
15092 2011-07-09 Lawrence Mitchell <wence@gmx.li>
15094 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
15095 (Fgnutls_boot): Use it.
15097 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
15099 * doc.c (Fsubstitute_command_keys): Revert last change.
15101 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
15103 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
15104 quotes the next character, and doesn't affect other longer
15105 sequences (bug#8935).
15107 * lread.c (syms_of_lread): Clarify that is isn't only
15108 `eval-buffer' and `eval-defun' that's affected by
15109 `lexical-binding' (bug#8460).
15111 2011-07-15 Eli Zaretskii <eliz@gnu.org>
15113 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
15114 bidi redisplay when a line includes both an image and is truncated.
15116 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
15118 Fix minor problems found by static checking.
15119 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
15120 (elsz): Now a signed constant, not a size_t var. We prefer signed
15121 types to unsigned, to avoid integer comparison confusion. Without
15122 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
15123 "cannot optimize loop, the loop counter may overflow", a symptom
15125 * indent.c (Fvertical_motion): Mark locals as initialized.
15126 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
15128 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
15130 * search.c (Fre_search_backward): Mention `case-fold-search' in
15131 all the re_search_* functions (bug#8138).
15133 * keyboard.c (Fopen_dribble_file): Document when the file is
15136 2011-07-14 Eli Zaretskii <eliz@gnu.org>
15138 * bidi.c (bidi_dump_cached_states): Fix format of displaying
15141 Support bidi reordering of display and overlay strings.
15142 * xdisp.c (compute_display_string_pos)
15143 (compute_display_string_end): Accept additional argument STRING.
15144 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
15145 (reseat_to_string): Initialize bidi_it->string.s and
15146 bidi_it->string.schars.
15147 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
15148 NULL (avoids a crash in bidi_paragraph_init).
15149 Initialize itb.string.lstring.
15150 (init_iterator): Call bidi_init_it only of a valid
15151 buffer position was specified. Initialize paragraph_embedding to
15153 (reseat_to_string): Initialize the bidi iterator.
15154 (display_string): If we need to ignore text properties of
15155 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
15156 original value of -1 will not work with bidi.)
15157 (compute_display_string_pos): First arg is now struct
15158 `text_pos *'; all callers changed. Support display properties on
15160 (compute_display_string_end): Support display properties on Lisp
15162 (init_iterator, reseat_1, reseat_to_string): Initialize the
15163 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
15164 when iterating on a string not from display properties).
15165 (compute_display_string_pos, compute_display_string_end):
15166 Fix calculation of the object to scan. Fixes an error when using
15168 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
15169 base_level_stop; instead, set base_level_stop to BEGV.
15170 Fixes crashes in vertical-motion.
15171 (next_element_from_buffer): Improve commentary for when
15172 the iterator is before prev_stop.
15173 (init_iterator): Initialize bidi_p from the default value of
15174 bidi-display-reordering, not from buffer-local value. Use the
15175 buffer-local value only if initializing for buffer iteration.
15176 (handle_invisible_prop): Support invisible properties on strings
15177 that are being bidi-reordered.
15178 (set_iterator_to_next): Support bidi reordering of C strings and
15180 (next_element_from_string): Support bidi reordering of Lisp
15182 (handle_stop_backwards): Support Lisp strings as well.
15183 (display_string): Support display of R2L glyph rows.
15184 Use IT_STRING_CHARPOS when displaying from a Lisp string.
15185 (init_iterator): Don't initialize it->bidi_p for strings
15187 (reseat_to_string): Initialize it->bidi_p for strings here.
15188 (next_element_from_string, next_element_from_c_string)
15189 (next_element_from_buffer): Add xassert's for correspondence
15190 between IT's object being iterated and it->bidi_it.string
15192 (face_before_or_after_it_pos): Support bidi iteration.
15193 (next_element_from_c_string): Handle the case of the first string
15194 character that is not the first one in the visual order.
15195 (get_visually_first_element): New function, refactored from common
15196 parts of next_element_from_buffer, next_element_from_string, and
15197 next_element_from_c_string.
15198 (tool_bar_lines_needed, redisplay_tool_bar)
15199 (display_menu_bar): Force left-to-right direction. Add a FIXME
15200 comment for making that be controlled by a user option.
15201 (push_it, pop_it): Save and restore the state of the
15202 bidi iterator. Save and restore the bidi_p flag.
15203 (pop_it): Iterate out of display property for string iteration as
15205 (iterate_out_of_display_property): Support iteration over strings.
15206 (handle_single_display_spec): Set up it->bidi_it for iteration
15207 over a display string, and call bidi_init_it.
15208 (handle_single_display_spec, next_overlay_string)
15209 (get_overlay_strings_1, push_display_prop): Set up the bidi
15210 iterator for displaying display or overlay strings.
15211 (forward_to_next_line_start): Don't use the shortcut if
15213 (back_to_previous_visible_line_start): If handle_display_prop
15214 pushed the iterator stack, restore the internal state of the bidi
15215 iterator by calling bidi_pop_it same number of times.
15216 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
15217 and we are bidi-iterating, don't decrement the iterator position;
15218 instead, set the first_elt flag in the bidi iterator, to produce
15220 (reseat_1): Remove redundant setting of string_from_display_prop_p.
15221 (push_display_prop): xassert that we are iterating a buffer.
15222 (push_it, pop_it): Save and restore paragraph_embedding member.
15223 (handle_single_display_spec, next_overlay_string)
15224 (get_overlay_strings_1, reseat_1, reseat_to_string)
15225 (push_display_prop): Set up the `unibyte' member of bidi_it.string
15226 correctly. Don't assume unibyte strings are not bidi-reordered.
15227 (compute_display_string_pos)
15228 (compute_display_string_end): Fix handling the case of C string.
15229 (push_it, pop_it): Save and restore from_disp_prop_p.
15230 (handle_single_display_spec, push_display_prop): Set the
15231 from_disp_prop_p flag.
15232 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
15233 (pop_it): Call iterate_out_of_display_property only if we are
15234 popping after iteration over a string that came from a display
15235 property. Fix a typo in popping stretch info. Add an assertion
15236 for verifying that the iterator position is in sync with the bidi
15238 (handle_single_display_spec, get_overlay_strings_1)
15239 (push_display_prop): Fix initialization of paragraph direction for
15240 string when that of the parent object is not yet determined.
15241 (reseat_1): Call bidi_init_it to resync the bidi
15242 iterator with IT's position. (Bug#7616)
15243 (find_row_edges): If ROW->start.pos gives position
15244 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
15245 (handle_stop, back_to_previous_visible_line_start, reseat_1):
15246 Reset the from_disp_prop_p flag.
15247 (SAVE_IT, RESTORE_IT): New macros.
15248 (pos_visible_p, face_before_or_after_it_pos)
15249 (back_to_previous_visible_line_start)
15250 (move_it_in_display_line_to, move_it_in_display_line)
15251 (move_it_to, move_it_vertically_backward, move_it_by_lines)
15252 (try_scrolling, redisplay_window, display_line): Use them when
15253 saving a temporary copy of the iterator and restoring it back.
15254 (back_to_previous_visible_line_start, reseat_1)
15255 (init_iterator): Empty the bidi cache "stack".
15256 (move_it_in_display_line_to): If iterator ended up at
15257 EOL, but we never saw any buffer positions smaller than
15258 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
15259 motion in bidi-reordered lines.
15260 (move_it_in_display_line_to): Record prev_method and prev_pos
15261 immediately before the call to set_iterator_to_next. Fixes cursor
15262 motion in bidi-reordered lines with stretch glyphs and strings
15263 displayed in margins. (Bug#8133) (Bug#8867)
15264 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
15266 (pos_visible_p): Support positions in bidi-reordered lines.
15267 Save and restore bidi cache.
15269 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
15270 (bidi_paragraph_info): Delete unused struct.
15271 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
15272 (bidi_cache_start): New variable.
15273 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
15275 (bidi_cache_fetch_state, bidi_cache_search)
15276 (bidi_cache_find_level_change, bidi_cache_iterator_state)
15277 (bidi_cache_find, bidi_peek_at_next_level)
15278 (bidi_level_of_next_char, bidi_find_other_level_edge)
15279 (bidi_move_to_visually_next): Compare cache index with
15280 bidi_cache_start rather than with zero.
15281 (bidi_fetch_char): Accept new argument STRING; all callers
15282 changed. Support iteration over a string. Support strings with
15283 display properties. Support unibyte strings. Fix the type of
15284 `len' according to what STRING_CHAR_AND_LENGTH expects.
15285 (bidi_paragraph_init, bidi_resolve_explicit_1)
15286 (bidi_resolve_explicit, bidi_resolve_weak)
15287 (bidi_level_of_next_char, bidi_move_to_visually_next):
15288 Support iteration over a string.
15289 (bidi_set_sor_type, bidi_resolve_explicit_1)
15290 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
15291 can now be zero (for strings); special values 0 and -1 were
15292 changed to -1 and -2, respectively.
15293 (bidi_char_at_pos): New function.
15294 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
15295 Call it instead of FETCH_MULTIBYTE_CHAR.
15296 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
15297 initialized to valid values.
15298 (bidi_init_it): Don't initialize charpos and bytepos with invalid
15300 (bidi_level_of_next_char): Allow the sentinel "position" to pass
15301 the test for valid cached positions. Fix the logic for looking up
15302 the sentinel state in the cache. GCPRO the Lisp string we are
15304 (bidi_push_it, bidi_pop_it): New functions.
15305 (bidi_initialize): Initialize the bidi cache start stack pointer.
15306 (bidi_cache_ensure_space): New function, refactored from part of
15307 bidi_cache_iterator_state. Don't assume the required size is just
15308 one BIDI_CACHE_CHUNK away.
15309 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
15310 (bidi_count_bytes, bidi_char_at_pos): New functions.
15311 (bidi_cache_search): Don't assume bidi_cache_last_idx is
15312 always valid if bidi_cache_idx is valid.
15313 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
15314 is valid if it's going to be used.
15315 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
15316 (bidi_cache_fetch_state, bidi_cache_search)
15317 (bidi_cache_find_level_change, bidi_cache_ensure_space)
15318 (bidi_cache_iterator_state, bidi_cache_find)
15319 (bidi_find_other_level_edge, bidi_cache_start_stack):
15320 All variables related to cache indices are now EMACS_INT.
15322 * dispextern.h (struct bidi_string_data): New structure.
15323 (struct bidi_it): New member `string'. Make flag members be 1-bit
15324 fields, and put them last in the struct.
15325 (compute_display_string_pos, compute_display_string_end):
15327 (bidi_push_it, bidi_pop_it): Add prototypes.
15328 (struct iterator_stack_entry): New members bidi_p,
15329 paragraph_embedding, and from_disp_prop_p.
15330 (struct it): Member bidi_p is now a bit field 1 bit wide.
15331 (bidi_shelve_cache, bidi_unshelve_cache):
15332 Declare prototypes.
15334 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
15335 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
15336 and vector-like objects.
15338 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
15339 cache around display iteration.
15341 * window.c (Fwindow_end, window_scroll_pixel_based)
15342 (displayed_window_lines, Frecenter): Save and restore the bidi
15343 cache around display iteration.
15345 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
15347 * editfns.c (Fdelete_region): Clarify the use of the named
15348 parameters (bug#6788).
15350 2011-07-14 Martin Rudalics <rudalics@gmx.at>
15352 * indent.c (Fvertical_motion): Set and restore w->pointm when
15353 saving and restoring the window's buffer (Bug#9006).
15355 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
15357 * editfns.c (Fstring_to_char): Clarify just what is returned
15358 (bug#6576). Text by Eli Zaretskii.
15360 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
15362 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
15364 2011-07-13 Eli Zaretskii <eliz@gnu.org>
15366 * buffer.c (mmap_find): Fix a typo.
15368 2011-07-13 Johan Bockgård <bojohan@gnu.org>
15370 Fix execution of x selection hooks.
15371 * xselect.c (Qx_lost_selection_functions)
15372 (Qx_sent_selection_functions): New vars.
15373 (syms_of_xselect): DEFSYM them.
15374 (x_handle_selection_request): Pass Qx_sent_selection_functions
15375 rather than Vx_sent_selection_functions to Frun_hook_with_args.
15376 (x_handle_selection_clear,x_clear_frame_selections):
15377 Pass Qx_lost_selection_functions rather than
15378 Vx_lost_selection_functions to Frun_hook_with_args.
15380 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
15382 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
15383 The old code sometimes used this field without initializing it.
15385 * alloc.c (gc_sweep): Don't read past end of array.
15386 In theory, the old code could also have corrupted Emacs internals,
15387 though it'd be very unlikely.
15389 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
15391 * character.c (Fcharacterp): Don't advertise optional ignored
15392 argument. (Bug#4026)
15394 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
15396 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
15399 * window.c (Fset_window_start): Doc fix (bug#4199).
15400 (Fset_window_hscroll): Ditto.
15402 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
15404 Fix minor new problems caught by GCC 4.6.1.
15405 * term.c (init_tty): Remove unused local.
15406 * xsettings.c (store_monospaced_changed): Define this function only
15407 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
15408 not used otherwise.
15410 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
15412 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
15414 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
15416 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
15417 are the mini-buffer and the echo area (bug#3320).
15419 * term.c (init_tty): Remove support for supdup, c10 and perq
15420 terminals, which are no longer supported (bug#1482).
15422 2011-07-10 Johan Bockgård <bojohan@gnu.org>
15424 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
15426 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
15428 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
15429 for non-popups (Bug#3642).
15431 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
15433 * alloc.c (reset_malloc_hooks): Protoize.
15434 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
15435 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
15436 * cm.c (losecursor): Likewise.
15437 * data.c (fmod): Likewise.
15438 * dispnew.c (swap_glyphs_in_rows): Likewise.
15439 * emacs.c (memory_warning_signal): Likewise.
15440 * floatfns.c (float_error): Likewise.
15441 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
15442 (otf_open, font_otf_capability, generate_otf_features)
15443 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
15445 * image.c (pbm_read_file): Likewise.
15446 * indent.c (string_display_width): Likewise.
15447 * intervals.c (check_for_interval, search_for_interval)
15448 (inc_interval_count, count_intervals, root_interval)
15449 (adjust_intervals_for_insertion, make_new_interval): Likewise.
15450 * lread.c (defalias): Likewise.
15451 * ralloc.c (r_alloc_check): Likewise.
15452 * regex.c (set_image_of_range_1, set_image_of_range)
15453 (regex_grow_registers): Likewise.
15454 * sysdep.c (strerror): Likewise.
15455 * termcap.c (valid_filename_p, tprint, main): Likewise.
15456 * tparam.c (main): Likewise.
15457 * unexhp9k800.c (run_time_remap, save_data_space)
15458 (update_file_ptrs, read_header, write_header, calculate_checksum)
15459 (copy_file, copy_rest, display_header): Likewise.
15460 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
15462 * xdisp.c (check_it): Likewise.
15463 * xfaces.c (register_color, unregister_color, unregister_colors):
15465 * xfns.c (print_fontset_result): Likewise.
15466 * xrdb.c (member, fatal, main): Likewise.
15468 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
15470 Fix minor problems found by static checking (Bug#9031).
15471 * chartab.c (char_table_set_range, map_sub_char_table):
15472 Remove unused locals.
15473 (uniprop_table): Now static.
15474 * composite.c (_work_char): Remove unused static var.
15476 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
15478 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
15480 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
15482 * gtkutil.c (qttip_cb): Remove code without function.
15484 2011-07-09 Eli Zaretskii <eliz@gnu.org>
15486 * w32.c (pthread_sigmask): New stub.
15488 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
15490 Use pthread_sigmask, not sigprocmask (Bug#9010).
15491 sigprocmask is portable only for single-threaded applications, and
15492 Emacs can be multi-threaded when it uses GTK.
15493 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
15495 * callproc.c (Fcall_process):
15496 * process.c (create_process):
15497 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
15498 Use pthread_sigmask, not sigprocmask.
15500 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15502 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
15503 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
15506 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15508 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
15509 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
15510 (xg_hide_tooltip): Fix comment.
15512 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
15513 in registerServicesMenuSendTypes.
15514 (validRequestorForSendType): Don't check ns_return_types.
15516 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
15519 2011-07-08 Jason Rumney <jasonr@gnu.org>
15521 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
15522 SH_SHOW for hidden windows (Bug#5482).
15524 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
15525 frame struct members of non-existent frames (Bug#6284).
15527 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15529 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
15530 variable firstTime not needed on OSX >= 10.6.
15531 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
15532 >= 10.5. Use setKnobProportion, setDoubleValue.
15534 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
15535 (MAC_OS_X_VERSION_10_5): Define if not defined.
15536 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
15537 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
15538 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
15540 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
15541 cString and lossyCString on OSX >= 10.4.
15543 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
15544 sizeToFit on OSX >= 10.2.
15546 * nsimage.m (allocInitFromFile): Don't use deprecated method
15547 bestRepresentationForDevice on OSX >= 10.6.
15549 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
15552 * emacs.c: Declare unexec_init_emacs_zone.
15554 * nsgui.h: Fix compiler warning about gnulib redefining verify.
15556 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
15558 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
15559 on svcsMenu (Bug#8842).
15561 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
15563 (Fns_list_services): Just return Qnil on 10.6, code not working there.
15565 * nsterm.m (QUTF8_STRING): Declare.
15566 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
15567 (validRequestorForSendType): Return type is (id).
15568 Change indexOfObjectIdenticalTo to indexOfObject.
15569 Check if we have local selection before returning self (Bug#8842).
15570 (writeSelectionToPasteboard): Put local selection into paste board
15571 if we have a local selection (Bug#8842).
15572 (syms_of_nsterm): DEFSYM QUTF8_STRING.
15574 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
15575 (ns_get_local_selection): Declare.
15577 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
15579 * keymap.c (describe_map_tree): Don't insert a double newline at
15580 the end of the buffer (bug#1169) and return whether we inserted
15583 * callint.c (Fcall_interactively): Change "reading args" to
15584 "providing args" to try to clarify what it does (bug#1010).
15586 2011-07-07 Kenichi Handa <handa@m17n.org>
15588 * composite.c (composition_compute_stop_pos): Ignore a static
15589 composition starting before CHARPOS (Bug#8915).
15591 * xdisp.c (handle_composition_prop): Likewise.
15593 2011-07-07 Eli Zaretskii <eliz@gnu.org>
15595 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
15598 2011-07-07 Kenichi Handa <handa@m17n.org>
15600 * character.h (unicode_category_t): New enum type.
15602 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
15603 (Qchar_code_property_table): New variable.
15604 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
15605 (UNIPROP_COMPRESSED_FORM_P): New macros.
15606 (char_table_ascii): Uncompress the compressed values.
15607 (sub_char_table_ref): New arg is_uniprop. Callers changed.
15608 Uncompress the compressed values.
15609 (sub_char_table_ref_and_range): Likewise.
15610 (char_table_ref_and_range): Uncompress the compressed values.
15611 (sub_char_table_set): New arg is_uniprop. Callers changed.
15612 Uncompress the compressed values.
15613 (sub_char_table_set_range): Args changed. Callers changed.
15614 (char_table_set_range): Adjuted for the above change.
15615 (map_sub_char_table): Delete args default_val and parent. Add arg
15616 top. Give decoded values to a Lisp function.
15617 (map_char_table): Adjust for the above change. Give decoded
15618 values to a Lisp function. Gcpro more variables.
15619 (uniprop_table_uncompress)
15620 (uniprop_decode_value_run_length): New functions.
15621 (uniprop_decoder, uniprop_decoder_count): New variables.
15622 (uniprop_get_decoder, uniprop_encode_value_character)
15623 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
15625 (uniprop_encoder, uniprop_encoder_count): New variables.
15626 (uniprop_get_encoder, uniprop_table)
15627 (Funicode_property_table_internal, Fget_unicode_property_internal)
15628 (Fput_unicode_property_internal): New functions.
15629 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
15630 Sunicode_property_table_internal, Sget_unicode_property_internal,
15631 and Sput_unicode_property_internal. Defvar_lisp
15632 char-code-property-alist.
15634 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
15635 Vunicode_category_table.
15637 * font.c (font_range): Adjust for the change of
15638 Vunicode_category_table.
15640 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
15642 * m/iris4d.h: Remove file, move contents ...
15643 * s/irix6-5.h: ... here.
15645 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
15647 Remove unportable assumption about struct layout (Bug#8884).
15648 * alloc.c (mark_buffer):
15649 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
15650 (clone_per_buffer_values): Don't assume that
15651 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
15652 This isn't true in general, and it's particularly not true
15653 if Emacs is configured with --with-wide-int.
15654 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
15655 New macros, used in the buffer.c change.
15657 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
15659 * xsettings.c: Use both GConf and GSettings if both are available.
15660 (store_config_changed_event): Add comment.
15661 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
15662 (store_tool_bar_style_changed): New functions.
15663 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
15664 (struct xsettings): Move font inside HAVE_XFT.
15665 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
15666 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
15667 Move inside HAVE_XFT.
15668 (something_changed_gsettingsCB): Rename from something_changedCB.
15669 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
15671 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
15672 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
15673 (something_changed_gconfCB): Rename from something_changedCB.
15674 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
15675 (parse_settings): Move check for font inside HAVE_XFT.
15676 (read_settings, apply_xft_settings): Add comment.
15677 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
15678 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
15679 call store_font_name_changed.
15680 (xft_settings_event): Add comment.
15681 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
15682 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
15683 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
15684 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
15685 (xsettings_initialize): Call init_gsettings last.
15686 (xsettings_get_system_font, xsettings_get_system_normal_font):
15689 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
15691 Random fixes. E.g., (random) never returned negative values.
15692 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
15693 subseconds part to the entropy, as that's a bit more random.
15694 Prefer signed to unsigned, since the signedness doesn't matter and
15695 in general we prefer signed. When given a limit, use a
15696 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
15697 latter isn't right if USE_2_TAGS_FOR_INTS.
15698 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
15699 not 0..VALMASK. Don't discard "excess" bits that random () returns.
15701 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
15703 * textprop.c (text_property_stickiness):
15704 Obey Vtext_property_default_nonsticky.
15705 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
15706 * w32fns.c (syms_of_w32fns):
15707 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
15709 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
15711 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
15712 This is more efficient than Ffile_directory_p and avoids a minor race.
15714 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
15716 * buffer.c (Foverlay_put): Say what the return value is
15719 * fileio.c (barf_or_query_if_file_exists): Check first if the file
15720 is a directory before asking whether to use the file name
15722 (barf_or_query_if_file_exists): Make the "File is a directory"
15723 error be more correct.
15725 * fns.c (Frequire): Remove the mention of the .gz files, since
15726 that's installation-specific, but keep the mention of
15727 `get-load-suffixes'.
15729 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
15731 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
15732 Report string overflow if the output is too long.
15734 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
15736 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
15737 (syms_of_gnutls): Remove duplicate DEFSYM for
15738 Qgnutls_bootprop_verify_hostname_error, an error for
15739 Qgnutls_bootprop_verify_error (which is no longer used).
15741 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
15742 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
15743 Also (re)move comments that are misplaced or no longer relevant.
15745 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15747 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
15749 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
15751 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
15752 and background color parameters if they have been changed.
15754 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15756 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
15758 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
15760 * xsettings.c (SYSTEM_FONT): Define only when used.
15761 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
15763 * keymap.c (access_keymap_1): Now static.
15765 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
15767 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
15768 leave any prefix arg for the up event (Bug#1586).
15770 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
15772 * lread.c (syms_of_lread): Mention single symbols defined by
15773 `defvar' or `defconst' (bug#7154).
15775 * fns.c (Frequire): Mention .el.gz files (bug#7314).
15776 (Frequire): Mention get-load-suffixes.
15778 2011-07-02 Martin Rudalics <rudalics@gmx.at>
15780 * window.h (window): Remove clone_number slot.
15781 * window.c (Fwindow_clone_number, Fset_window_clone_number):
15783 (make_parent_window, make_window, saved_window)
15784 (Fset_window_configuration, save_window_save): Don't deal with
15786 * buffer.c (Qclone_number): Remove declaration.
15787 (sort_overlays, overlay_strings): Don't deal with clone numbers.
15789 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
15791 Add multiple inheritance to keymaps.
15792 * keymap.c (Fmake_composed_keymap): New function.
15793 (Fset_keymap_parent): Simplify.
15794 (fix_submap_inheritance): Remove.
15795 (access_keymap_1): New function extracted from access_keymap to handle
15796 embedded parents and handle lists of maps.
15797 (access_keymap): Use it.
15798 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
15799 (Fcopy_keymap): Handle embedded parents.
15800 (Fcommand_remapping, define_as_prefix): Simplify.
15801 (Fkey_binding): Simplify.
15802 (syms_of_keymap): Move minibuffer-local-completion-map,
15803 minibuffer-local-filename-completion-map,
15804 minibuffer-local-must-match-map, and
15805 minibuffer-local-filename-must-match-map to Elisp.
15806 (syms_of_keymap): Defsubr make-composed-keymap.
15807 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
15808 (parse_menu_item): Trivial simplification.
15810 2011-07-01 Glenn Morris <rgm@gnu.org>
15812 * Makefile.in (SETTINGS_LIBS): Fix typo.
15814 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15816 * coding.c (Fencode_coding_string): Record the last coding system
15817 used, as the function doc string says (bug#8738).
15819 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
15821 * xsettings.c (store_monospaced_changed): Take new font as arg and
15822 check for change against current_mono_font.
15823 (EMACS_TYPE_SETTINGS): Remove this and related defines.
15824 (emacs_settings_constructor, emacs_settings_get_property)
15825 (emacs_settings_set_property, emacs_settings_class_init)
15826 (emacs_settings_init, gsettings_obj): Remove.
15827 (something_changedCB): New function for HAVE_GSETTINGS.
15828 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
15829 with value as argument.
15830 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
15831 g_settings_new (Bug#8967). Do not create gsettings_obj.
15832 Remove calls to g_settings_bind. Connect something_changedCB to
15835 * xgselect.c: Add defined (HAVE_GSETTINGS).
15836 (xgselect_initialize): Ditto.
15838 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
15839 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
15842 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
15844 * eval.c (struct backtrace): Simplify and port the data structure.
15845 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
15846 signed bit field, as this assumption is not portable and it makes
15847 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
15848 "char debug_on_exit : 1" as this is not portable either; instead,
15849 use the portable "unsigned int debug_on_exit : 1". Remove unused
15850 member evalargs. Remove obsolete comments about cc bombing out.
15852 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
15854 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
15855 Let HAVE_GSETTINGS override HAVE_GCONF.
15856 (store_monospaced_changed): New function.
15857 (EMACS_SETTINGS): A new type derived from GObject to handle
15858 GSettings notifications.
15859 (emacs_settings_constructor, emacs_settings_get_property)
15860 (emacs_settings_set_property, emacs_settings_class_init):
15862 (gsettings_client, gsettings_obj): New variables.
15863 (GSETTINGS_SCHEMA): New define.
15864 (something_changedCB): Call store_monospaced_changed.
15865 (init_gsettings): New function.
15866 (xsettings_initialize): Call init_gsettings.
15867 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
15870 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
15873 2011-06-29 Martin Rudalics <rudalics@gmx.at>
15875 * window.c (resize_root_window, grow_mini_window)
15876 (shrink_mini_window): Rename Qresize_root_window to
15877 Qwindow_resize_root_window and Qresize_root_window_vertically to
15878 Qwindow_resize_root_window_vertically.
15880 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
15882 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
15884 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
15886 * makefile.w32-in: Redesign dependencies so they reflect more
15887 clearly which files are directly included by each source file,
15888 and not through other includes.
15890 2011-06-27 Martin Rudalics <rudalics@gmx.at>
15892 * buffer.c (Qclone_number): Declare static and DEFSYM it.
15893 (sort_overlays, overlay_strings): When an overlay's clone number
15894 matches the window's clone number process the overlay even if
15895 the overlay's window property doesn't match the current window.
15897 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
15898 (Fwindow_hchild): Rename to Fwindow_left_child.
15899 (Fwindow_next): Rename to Fwindow_next_sibling.
15900 (Fwindow_prev): Rename to Fwindow_prev_sibling.
15901 (resize_window_check): Rename to window_resize_check.
15902 (resize_window_apply): Rename to window_resize_apply.
15903 (Fresize_window_apply): Rename to Fwindow_resize_apply.
15904 (Fdelete_other_windows_internal, resize_frame_windows)
15905 (Fsplit_window_internal, Fdelete_window_internal)
15906 (grow_mini_window, shrink_mini_window)
15907 (Fresize_mini_window_internal): Fix callers accordingly.
15909 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
15911 * emacsgtkfixed.h: State that this is only used with Gtk+3.
15912 (emacs_fixed_set_min_size): Remove.
15913 (emacs_fixed_new): Take frame as argument.
15915 * emacsgtkfixed.c: State that this is only used with Gtk+3.
15916 (_EmacsFixedPrivate): Remove minwidth/height.
15917 Add struct frame *f.
15918 (emacs_fixed_init): Initialize priv->f.
15919 (get_parent_class, emacs_fixed_set_min_size): Remove.
15920 (emacs_fixed_new): Set priv->f to argument.
15921 (emacs_fixed_get_preferred_width)
15922 (emacs_fixed_get_preferred_height): Use min_width/height from
15923 frames size_hint to set minimum and natural (Bug#8919).
15924 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
15925 and use min_width/height from frames size_hint to set
15926 min_width/height (Bug#8919).
15928 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
15929 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
15932 2011-06-26 Eli Zaretskii <eliz@gnu.org>
15934 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
15935 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
15938 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
15940 * process.c (wait_reading_process_output): Bypass select if
15941 waiting for a cell while ignoring keyboard input, and input is
15942 pending. Suggested by Jan Djärv (Bug#8869).
15944 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
15946 Use gnulib's dup2 module instead of rolling our own.
15947 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
15949 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15951 * dispnew.c (scrolling_window): Before scrolling, turn off a
15952 mouse-highlight in the window being scrolled.
15954 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
15956 Move DEFSYM to lisp.h and use everywhere.
15958 * character.h (DEFSYM): Move declaration...
15959 * lisp.h (DEFSYM): ...here.
15965 * w32select.c: Don't include character.h.
15967 * alloc.c (syms_of_alloc):
15968 * buffer.c (syms_of_buffer):
15969 * bytecode.c (syms_of_bytecode):
15970 * callint.c (syms_of_callint):
15971 * casefiddle.c (syms_of_casefiddle):
15972 * casetab.c (init_casetab_once):
15973 * category.c (init_category_once, syms_of_category):
15974 * ccl.c (syms_of_ccl):
15975 * cmds.c (syms_of_cmds):
15976 * composite.c (syms_of_composite):
15977 * dbusbind.c (syms_of_dbusbind):
15978 * dired.c (syms_of_dired):
15979 * dispnew.c (syms_of_display):
15980 * doc.c (syms_of_doc):
15981 * editfns.c (syms_of_editfns):
15982 * emacs.c (syms_of_emacs):
15983 * eval.c (syms_of_eval):
15984 * fileio.c (syms_of_fileio):
15985 * fns.c (syms_of_fns):
15986 * frame.c (syms_of_frame):
15987 * fringe.c (syms_of_fringe):
15988 * insdel.c (syms_of_insdel):
15989 * keymap.c (syms_of_keymap):
15990 * lread.c (init_obarray, syms_of_lread):
15991 * macros.c (syms_of_macros):
15992 * msdos.c (syms_of_msdos):
15993 * print.c (syms_of_print):
15994 * process.c (syms_of_process):
15995 * search.c (syms_of_search):
15996 * sound.c (syms_of_sound):
15997 * syntax.c (init_syntax_once, syms_of_syntax):
15998 * terminal.c (syms_of_terminal):
15999 * textprop.c (syms_of_textprop):
16000 * undo.c (syms_of_undo):
16001 * w32.c (globals_of_w32):
16002 * window.c (syms_of_window):
16003 * xdisp.c (syms_of_xdisp):
16004 * xfaces.c (syms_of_xfaces):
16005 * xfns.c (syms_of_xfns):
16006 * xmenu.c (syms_of_xmenu):
16007 * xsettings.c (syms_of_xsettings):
16008 * xterm.c (syms_of_xterm): Use DEFSYM.
16010 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
16012 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
16014 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
16016 Integer and buffer overflow fixes (Bug#8873).
16018 * print.c (printchar, strout): Check for string overflow.
16019 (PRINTPREPARE, printchar, strout):
16020 Don't set size unless allocation succeeds.
16022 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
16023 for sizes. Check for string overflow more accurately.
16024 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
16026 * macros.c: Integer and buffer overflow fixes.
16027 * keyboard.h (struct keyboard.kbd_macro_bufsize):
16028 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
16029 Use ptrdiff_t, not int, for sizes.
16030 Don't increment bufsize until after realloc succeeds.
16031 Check for size-calculation overflow.
16032 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
16034 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
16036 * lread.c: Integer overflow fixes.
16037 (read_integer): Radix is now EMACS_INT, not int,
16038 to improve quality of diagnostics for out-of-range radices.
16039 Calculate buffer size correctly for out-of-range radices.
16040 (read1): Check for integer overflow in radices, and in
16041 read-circle numbers.
16042 (read_escape): Avoid int overflow.
16043 (Fload, openp, read_buffer_size, read1)
16044 (substitute_object_recurse, read_vector, read_list, map_obarray):
16045 Use ptrdiff_t, not int, for sizes.
16046 (read1): Use EMACS_INT, not int, for sizes.
16047 Check for size overflow.
16049 * image.c (cache_image): Check for size arithmetic overflow.
16051 * lread.c: Integer overflow issues.
16052 (saved_doc_string_size, saved_doc_string_length)
16053 (prev_saved_doc_string_size, prev_saved_doc_string_length):
16054 Now ptrdiff_t, not int.
16055 (read1): Don't assume doc string length fits in int. Check for
16056 out-of-range doc string lengths.
16057 (read_list): Don't assume file position fits in int.
16058 (read_escape): Check for hex character overflow.
16060 2011-06-22 Leo Liu <sdl.web@gmail.com>
16062 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
16063 Move to minibuffer.el.
16065 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
16067 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
16068 The following patches are for when GLYPH_DEBUG && !XASSERT.
16069 * dispextern.h (trace_redisplay_p, dump_glyph_string):
16070 * dispnew.c (flush_stdout):
16071 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
16072 Mark as externally visible.
16073 * dispnew.c (check_window_matrix_pointers): Now static.
16074 * dispnew.c (window_to_frame_vpos):
16075 * xfns.c (unwind_create_frame):
16076 * xterm.c (x_check_font): Remove unused local.
16077 * scroll.c (CHECK_BOUNDS):
16078 * xfaces.c (cache_fache): Rename local to avoid shadowing.
16079 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
16080 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
16081 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
16082 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
16084 (debug_method_add): Use va_list and vsprintf rather than relying
16085 on undefined behavior with wrong number of arguments.
16086 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
16087 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
16088 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
16089 since we're not interested in debugging glyphs with old libraries.
16090 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
16091 GCC 4.6.0's static checking.
16093 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
16095 Integer overflow and signedness fixes (Bug#8873).
16096 A few related buffer overrun fixes, too.
16098 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
16100 * dispextern.h (struct face.stipple):
16101 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
16102 (x_bitmap_mask, x_allocate_bitmap_record)
16103 (x_create_bitmap_from_data, x_create_bitmap_from_file)
16104 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
16105 (x_create_bitmap_from_xpm_data):
16106 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
16107 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
16109 * xfaces.c (load_pixmap):
16110 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
16111 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
16112 (.bitmaps_last, struct x_output.icon_bitmap):
16113 Use ptrdiff_t, not int, for bitmap indexes.
16114 (x_allocate_bitmap_record): Check for size overflow.
16115 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
16117 Use ptrdiff_t, not int, for overlay counts.
16118 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
16119 * editfns.c (overlays_around, get_pos_property):
16120 * textprop.c (get_char_property_and_overlay):
16121 * xdisp.c (next_overlay_change, note_mouse_highlight):
16122 * xfaces.c (face_at_buffer_position):
16123 * buffer.c (OVERLAY_COUNT_MAX): New macro.
16124 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
16125 (Fnext_overlay_change, Fprevious_overlay_change)
16126 (mouse_face_overlay_overlaps, Foverlays_in):
16127 Use ptrdiff_t, not int, for sizes.
16128 (overlays_at, overlays_in): Check for size-calculation overflow.
16130 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
16132 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
16133 (x_session_initialize): Do not assume string length fits in int.
16135 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
16136 This is unlikely, but can occur if DPI is outlandish.
16138 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
16139 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
16141 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
16142 * xrdb.c (magic_file_p, search_magic_path):
16143 Omit last arg SUFFIX; it was always 0. All callers changed.
16144 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
16146 * xfont.c (xfont_match): Avoid need for strlen.
16148 * xfns.c: Don't assume strlen fits in int.
16149 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
16151 * xdisp.c (message_log_check_duplicate): Return intmax_t,
16152 not unsigned long, as we prefer signed integers. All callers changed.
16153 Detect integer overflow in repeat count.
16154 (message_dolog): Don't assume print length fits in 39 bytes.
16155 (display_mode_element): Don't assume strlen fits in int.
16157 * termcap.c: Don't assume sizes fit in int and never overflow.
16158 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
16159 (gobble_line): Check for size-calculation overflow.
16161 * minibuf.c (Fread_buffer):
16162 * lread.c (intern, intern_c_string):
16163 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
16164 Don't assume string length fits in int.
16166 * keyboard.c (parse_tool_bar_item):
16167 * gtkutil.c (style_changed_cb): Avoid need for strlen.
16169 * font.c: Don't assume string length fits in int.
16170 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
16171 Use ptrdiff_t, not int.
16172 (font_intern_prop): Don't assume string length fits in int.
16173 Don't assume integer property fits in fixnum.
16174 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
16176 * filelock.c: Fix some buffer overrun and integer overflow issues.
16177 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
16178 Reformulate so as not to need the command string.
16179 Invoke gzip -cd rather than gunzip, as it's more portable.
16180 (lock_info_type, lock_file_1, lock_file):
16181 Don't assume pid_t and time_t fit in unsigned long.
16182 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
16183 (current_lock_owner): Prefer signed type for sizes.
16184 Use memcpy, not strncpy, where memcpy is what is really wanted.
16185 Don't assume (via atoi) that time_t and pid_t fit in int.
16186 Check for time_t and/or pid_t out of range, e.g., via a network share.
16187 Don't alloca where an auto var works fine.
16189 * fileio.c: Fix some integer overflow issues.
16190 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
16191 Don't assume string length fits in int.
16192 (directory_file_name): Don't assume string length fits in long.
16193 (make_temp_name): Don't assume pid fits in int, or that its print
16194 length is less than 20.
16196 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
16198 * coding.c (make_subsidiaries): Don't assume string length fits in int.
16200 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
16202 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
16203 We prefer signed integers, even for size calculations.
16205 * emacs.c: Don't assume string length fits in 'int'.
16206 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
16207 (main): Don't invoke strlen when not needed.
16209 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
16210 (XD_DEBUG_MESSAGE): Don't waste a byte.
16212 * callproc.c (getenv_internal_1, getenv_internal)
16213 (Fgetenv_internal):
16214 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
16216 * lread.c (invalid_syntax): Omit length argument.
16217 All uses changed. This doesn't fix a bug, but it simplifies the
16218 code away from its former Hollerith-constant appearance, and it's
16219 one less 'int' to worry about when looking at integer-overflow issues.
16220 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
16222 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
16223 This didn't break anything, but it didn't help either.
16224 It's confusing to put a bogus integer in a place where the actual
16225 value does not matter.
16226 (LIST_END_P): Remove unused macro and its bogus comment.
16227 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
16229 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
16230 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
16232 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
16233 We prefer signed types, and the value cannot exceed the EMACS_INT
16234 range anyway (because otherwise the length would not be representable).
16235 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
16236 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
16237 This avoids a GCC warning when WIDE_EMACS_INT.
16239 * indent.c (sane_tab_width): New function.
16240 (current_column, scan_for_column, Findent_to, position_indentation)
16241 (compute_motion): Use it. This is just for clarity.
16242 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
16244 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
16246 * lisp.h (lint_assume): New macro.
16247 * composite.c (composition_gstring_put_cache):
16248 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
16250 * editfns.c, insdel.c:
16251 Omit unnecessary forward decls, to simplify future changes.
16253 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
16255 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
16257 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
16258 Use much-faster test for byte-length change.
16259 Don't assume string byte-length fits in 'int'.
16260 Check that character arg fits in 'int'.
16261 (mapcar1): Declare byte as byte, for clarity.
16263 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
16265 * fns.c (concat): Catch string overflow earlier.
16266 Do not rely on integer wraparound.
16268 * dispextern.h (struct it.overlay_strings_charpos)
16269 (struct it.selective): Now EMACS_INT, not int.
16270 * xdisp.c (forward_to_next_line_start)
16271 (back_to_previous_visible_line_start)
16272 (reseat_at_next_visible_line_start, next_element_from_buffer):
16273 Don't arbitrarily truncate the value of 'selective' to int.
16275 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
16277 * composite.c: Don't truncate sizes to 'int'.
16278 (composition_gstring_p, composition_reseat_it)
16279 (composition_adjust_point): Use EMACS_INT, not int.
16280 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
16281 not EMACS_UINT, for indexes.
16283 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
16285 * buffer.c: Include <verify.h>.
16286 (struct sortvec.priority, struct sortstr.priority):
16287 Now EMACS_INT, not int.
16288 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
16289 (struct sortstr.size, record_overlay_string)
16290 (struct sortstrlist.size, struct sortlist.used):
16291 Don't truncate size to int.
16292 (record_overlay_string): Check for size-calculation overflow.
16293 (init_buffer_once): Check at compile-time, not run-time.
16295 2011-06-22 Jim Meyering <meyering@redhat.com>
16297 Don't leak an XBM-image-sized buffer
16298 * image.c (xbm_load): Free the image buffer after using it.
16300 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
16303 * composite.c (find_automatic_composition): Omit needless 'return 0;'
16304 that Sun C diagnosed.
16305 * fns.c (secure_hash): Fix pointer signedness issue.
16306 * intervals.c (static_offset_intervals): New function.
16307 (offset_intervals): Use it.
16309 2011-06-21 Leo Liu <sdl.web@gmail.com>
16312 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
16315 * fns.c (secure_hash): Rename from crypto_hash_function and change
16316 the first arg to accept symbols.
16317 (Fsecure_hash): New primitive.
16318 (syms_of_fns): New symbols.
16320 2011-06-20 Deniz Dogan <deniz@dogan.se>
16322 * process.c (Fset_process_buffer): Clarify return value in
16325 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
16327 * dispnew.c (add_window_display_history): Use BVAR.
16329 * xdisp.c (debug_method_add): Use BVAR.
16330 (check_window_end, dump_glyph_matrix, dump_glyph)
16331 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
16333 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
16336 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
16337 check till after the cache is created in init_frame_faces.
16339 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
16341 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
16343 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
16345 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
16346 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
16347 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
16349 Improve buffer-overflow checking (Bug#8873).
16350 * fileio.c (Finsert_file_contents):
16351 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
16352 Remove the old (too-loose) buffer overflow checks.
16353 They weren't needed, since make_gap checks for buffer overflow.
16354 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
16355 The old code merely checked for Emacs fixnum overflow, and relied
16356 on undefined (wraparound) behavior. The new code avoids undefined
16357 behavior, and also checks for ptrdiff_t and/or size_t overflow.
16359 * editfns.c (Finsert_char): Don't dump core with very negative counts.
16360 Tune. Don't use wider integers than needed. Don't use alloca.
16361 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
16363 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
16365 * insdel.c, lisp.h (buffer_overflow): New function.
16366 (insert_from_buffer_1, replace_range, replace_range_2):
16367 * insdel.c (make_gap_larger):
16368 * editfns.c (Finsert_char):
16369 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
16371 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
16373 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
16375 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
16377 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
16378 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
16380 * fileio.c: Don't assume EMACS_INT fits in off_t.
16381 (emacs_lseek): New static function.
16382 (Finsert_file_contents, Fwrite_region): Use it.
16383 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
16385 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
16387 * fns.c: Don't overflow int when computing a list length.
16388 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
16389 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
16390 truncation on 64-bit hosts. Check for QUIT every
16391 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
16392 faster and is responsive enough.
16393 (Flength): Report an error instead of overflowing an integer.
16394 (Fsafe_length): Return a float if the value is not representable
16395 as a fixnum. This shouldn't happen except in contrived situations.
16396 (Fnthcdr, Fsort): Don't assume list length fits in int.
16397 (Fcopy_sequence): Don't assume vector length fits in int.
16399 * alloc.c: Check that resized vectors' lengths fit in fixnums.
16400 (header_size, word_size): New constants.
16401 (allocate_vectorlike): Don't check size overflow here.
16402 (allocate_vector): Check it here instead, since this is the only
16403 caller of allocate_vectorlike that could cause overflow.
16404 Check that the new vector's length is representable as a fixnum.
16406 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
16407 The previous code was bogus. For example, next_almost_prime (32)
16408 returned 39, which is undesirable as it is a multiple of 3; and
16409 next_almost_prime (24) returned 25, which is a multiple of 5 so
16410 why was the code bothering to check for multiples of 7?
16412 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
16414 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
16416 Variadic C functions now count arguments with ptrdiff_t.
16417 This partly undoes my 2011-03-30 change, which replaced int with size_t.
16418 Back then I didn't know that the Emacs coding style prefers signed int.
16419 Also, in the meantime I found a few more instances where arguments
16420 were being counted with int, which may truncate counts on 64-bit
16421 machines, or EMACS_INT, which may be unnecessarily wide.
16422 * lisp.h (struct Lisp_Subr.function.aMANY)
16423 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
16424 Arg counts are now ptrdiff_t, not size_t.
16425 All variadic functions and their callers changed accordingly.
16426 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
16427 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
16428 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
16429 * callint.c (Fcall_interactively): Check arg count for overflow,
16430 to avoid potential buffer overrun. Use signed char, not 'int',
16431 for 'varies' array, so that we needn't bother to check its size
16432 calculation for overflow.
16433 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
16434 * eval.c (apply_lambda):
16435 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
16436 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
16437 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
16439 * callint.c (Fcall_interactively): Don't use index var as event count.
16441 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
16442 * mem-limits.h (SIZE): Remove; no longer used.
16444 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
16446 Remove unnecessary casts.
16447 * xterm.c (x_term_init):
16448 * xfns.c (x_set_border_pixel):
16449 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
16450 These aren't needed now that we assume ANSI C.
16452 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
16453 It's more likely to cause problems (due to unsigned overflow)
16456 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
16458 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
16460 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
16462 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
16464 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
16466 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
16468 GLYPH_CODE_FACE returns EMACS_INT, not int.
16469 * dispextern.h (merge_faces):
16470 * xfaces.c (merge_faces):
16471 * xdisp.c (get_next_display_element, next_element_from_display_vector):
16472 Don't assume EMACS_INT fits in int.
16474 * character.h (CHAR_VALID_P): Remove unused parameter.
16475 * fontset.c, lisp.h, xdisp.c: All uses changed.
16477 * editfns.c (Ftranslate_region_internal): Omit redundant test.
16479 * fns.c (concat): Minor tuning based on overflow analysis.
16480 This doesn't fix any bugs. Use int to hold character, instead
16481 of constantly refetching from Emacs object. Use XFASTINT, not
16482 XINT, for value known to be a character. Don't bother comparing
16483 a single byte to 0400, as it's always less.
16485 * floatfns.c (Fexpt):
16486 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
16488 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
16491 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
16493 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
16494 Without this fix, on a 64-bit host (aset S 0 4294967386) would
16495 incorrectly succeed when S was a string, because 4294967386 was
16496 truncated before it was used.
16498 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
16499 Otherwise, an out-of-range integer could cause undefined behavior
16502 * composite.c: Use int, not EMACS_INT, for characters.
16503 (fill_gstring_body, composition_compute_stop_pos): Use int, not
16504 EMACS_INT, for values that are known to be in character range.
16505 This doesn't fix any bugs but is the usual style inside Emacs and
16506 may generate better code on 32-bit machines.
16508 Make sure a 64-bit char is never passed to ENCODE_CHAR.
16509 This is for reasons similar to the recent CHAR_STRING fix.
16510 * charset.c (Fencode_char): Check that character arg is actually
16511 a character. Pass an int to ENCODE_CHAR.
16512 * charset.h (ENCODE_CHAR): Verify that the character argument is no
16513 wider than 'int', as a compile-time check to prevent future regressions
16516 * character.c (char_string): Remove unnecessary casts.
16518 Make sure a 64-bit char is never passed to CHAR_STRING.
16519 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
16520 by silently ignoring the top 32 bits, allowing some values
16521 that were far too large to be valid characters.
16522 * character.h: Include <verify.h>.
16523 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
16524 arguments are no wider than unsigned, as a compile-time check
16525 to prevent future regressions in this area.
16527 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
16528 (Fsubst_char_in_region):
16530 * xdisp.c (decode_mode_spec_coding):
16531 Adjust to CHAR_STRING's new requirement.
16532 * editfns.c (Finsert_char, Fsubst_char_in_region):
16533 * fns.c (concat): Check that character args are actually
16534 characters. Without this test, these functions did the wrong
16535 thing with wildly out-of-range values on 64-bit hosts.
16537 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
16538 These casts should not be needed on 32-bit hosts, either.
16539 * keyboard.c (read_char):
16540 * lread.c (Fload): Remove casts to unsigned.
16542 * lisp.h (UNSIGNED_CMP): New macro.
16543 This fixes comparison bugs on 64-bit hosts.
16544 (ASCII_CHAR_P): Use it.
16545 * casefiddle.c (casify_object):
16546 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
16547 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
16548 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
16549 * dispextern.h (FACE_FROM_ID):
16550 * keyboard.c (read_char): Use UNSIGNED_CMP.
16552 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
16553 not to EMACS_INT, to avoid GCC warning.
16555 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
16557 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
16558 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
16559 isn't needed on 32-bit machines.
16561 * buffer.c (Fgenerate_new_buffer_name):
16562 Use EMACS_INT for count, not int.
16563 (advance_to_char_boundary): Return EMACS_INT, not int.
16565 * data.c (Qcompiled_function): Now static.
16567 * window.c (window_body_lines): Now static.
16569 * image.c (gif_load): Rename local to avoid shadowing.
16571 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
16572 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
16573 * alloc.c (make_save_value): Integer argument is now of type
16574 ptrdiff_t, not int.
16575 (mark_object): Use ptrdiff_t, not int.
16576 * lisp.h (pD): New macro.
16577 * print.c (print_object): Use it.
16579 * alloc.c: Use EMACS_INT, not int, to count objects.
16580 (total_conses, total_markers, total_symbols, total_vector_size)
16581 (total_free_conses, total_free_markers, total_free_symbols)
16582 (total_free_floats, total_floats, total_free_intervals)
16583 (total_intervals, total_strings, total_free_strings):
16584 Now EMACS_INT, not int. All uses changed.
16585 (Fgarbage_collect): Compute overall total using a double, so that
16586 integer overflow is less likely to be a problem. Check for overflow
16587 when converting back to an integer.
16588 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
16589 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
16590 These were 'int' variables that could overflow on 64-bit hosts;
16591 they were never used, so remove them instead of repairing them.
16592 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
16593 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
16594 Previously, this ceilinged at INT_MAX, but that doesn't work on
16596 (allocate_pseudovector): Don't use EMACS_INT when int would do.
16598 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
16599 (allocate_vectorlike): Check for ptrdiff_t overflow.
16600 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
16601 when a (possibly-narrower) signed value would do just as well.
16602 We prefer using signed arithmetic, to avoid comparison confusion.
16604 * alloc.c: Catch some string size overflows that we were missing.
16605 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
16606 for convenience in STRING_BYTES_MAX.
16607 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
16608 The definition here is exact; the one in lisp.h was approximate.
16609 (allocate_string_data): Check for string overflow. This catches
16610 some instances we weren't catching before. Also, it catches
16611 size_t overflow on (unusual) hosts where SIZE_MAX <= min
16612 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
16613 and ptrdiff_t and EMACS_INT are both 64 bits.
16615 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
16616 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
16617 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
16619 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
16621 * alloc.c (Fmake_string): Check for out-of-range init.
16623 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
16625 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
16627 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
16629 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
16630 xg_get_default_scrollbar_width.
16632 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
16633 (int_gtk_range_get_value): Move to the scroll bar part of the file.
16634 (style_changed_cb): Call update_theme_scrollbar_width and call
16635 x_set_scroll_bar_default_width and xg_frame_set_char_size for
16636 all frames (Bug#8505).
16637 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
16638 Call gtk_window_set_resizable if HAVE_GTK3.
16639 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
16640 and height if HAVE_GTK3 (Bug#8505).
16641 (scroll_bar_width_for_theme): New variable.
16642 (update_theme_scrollbar_width): New function.
16643 (xg_get_default_scrollbar_width): Move code to
16644 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
16645 (xg_initialize): Call update_theme_scrollbar_width.
16647 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
16649 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
16651 2011-06-12 Martin Rudalics <rudalics@gmx.at>
16653 * frame.c (make_frame): Call other_buffer_safely instead of
16656 * window.c (temp_output_buffer_show): Call display_buffer with
16657 second argument Vtemp_buffer_show_specifiers and reset latter
16658 immediately after the call.
16659 (Vtemp_buffer_show_specifiers): New variable.
16660 (auto_window_vscroll_p, next_screen_context_lines)
16661 (Vscroll_preserve_screen_position): Remove leading asterisks from
16664 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
16666 Fix minor problems found by GCC 4.6.0 static checking.
16667 * buffer.c (Qclone_number): Remove for now, as it's unused.
16668 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
16669 (record_buffer): Remove unused local.
16670 * frame.c (other_visible_frames, frame_buffer_list): Now static.
16671 (set_frame_buffer_list): Remove; unused.
16672 * frame.h (other_visible_frames): Remove decl.
16673 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
16674 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
16675 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
16677 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
16678 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
16679 Define only if HAVE_GPM.
16680 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
16681 (update_hints_inhibit): Remove; never set. All uses removed.
16682 * widgetprv.h (emacsFrameClassRec): Remove decl.
16683 * window.c (delete_deletable_window): Now returns void, since it
16684 wasn't returning anything.
16685 (compare_window_configurations): Remove unused locals.
16686 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
16687 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
16688 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
16689 the same widths as pointers. This follows up on the 2011-05-06 patch.
16690 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
16691 * xterm.h: Likewise.
16692 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
16694 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
16696 * makefile.w32-in: Update dependencies.
16697 (LISP_H): Add lib/intprops.h.
16699 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
16701 * image.c (gif_load): Add animation frame delay to the metadata.
16702 (syms_of_image): Use DEFSYM. New symbol `delay'.
16704 2011-06-11 Martin Rudalics <rudalics@gmx.at>
16706 * window.c (delete_deletable_window): Re-add.
16707 (Fset_window_configuration): Rewrite to handle dead buffers and
16708 consequently deletable windows.
16709 (window_tree, Fwindow_tree): Remove. Supply functionality in
16711 (compare_window_configurations): Simplify code.
16713 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
16715 * image.c (imagemagick_load_image): Fix type mismatch.
16716 (Fimagemagick_types): Likewise.
16718 * window.h (replace_buffer_in_windows): Declare.
16720 2011-06-11 Martin Rudalics <rudalics@gmx.at>
16722 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
16723 Qclone_number. Remove external declaration of Qdelete_window.
16724 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
16726 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
16727 Run Qbuffer_list_update_hook if allowed.
16728 (Fother_buffer): Rewrite doc-string. Major rewrite for new
16729 buffer list implementation.
16730 (other_buffer_safely): New function.
16731 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
16732 calls to replace_buffer_in_windows and
16733 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
16735 (record_buffer): Inhibit quitting and rewrite using quittable
16736 functions. Run Qbuffer_list_update_hook if allowed.
16737 (Frecord_buffer, Funrecord_buffer): New functions.
16738 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
16739 Move switch-to-buffer to window.el.
16740 (bury-buffer): Move to window.el.
16741 (Vbuffer_list_update_hook): New variable.
16743 * lisp.h (other_buffer_safely): Add prototype in buffer.c
16746 * window.h (resize_frame_windows): Move up in code.
16747 (Fwindow_frame): Remove EXFUN.
16748 (replace_buffer_in_all_windows): Remove prototype.
16749 (replace_buffer_in_windows_safely): Add prototype.
16751 * window.c: Declare Qdelete_window static again. Move down
16752 declaration of select_count.
16753 (Fnext_window, Fprevious_window): Rewrite doc-strings.
16754 (Fother_window): Move to window.el.
16755 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
16756 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
16757 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
16759 (replace_buffer_in_windows): Implement by calling
16760 Qreplace_buffer_in_windows.
16761 (replace_buffer_in_all_windows): Remove with some functionality
16762 moved into replace_buffer_in_windows_safely.
16763 (replace_buffer_in_windows_safely): New function.
16764 (select_window_norecord, select_frame_norecord): Move in front
16765 of run_window_configuration_change_hook. Remove now obsolete
16767 (Fset_window_buffer): Rewrite doc-string.
16768 Call Qrecord_window_buffer.
16769 (keys_of_window): Move binding for other-window to window.el.
16771 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
16773 * dispextern.h (struct image): Replace data member, whose int_val
16774 and ptr_val fields were not used by anything, with a single
16777 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
16778 (gif_clear_image, gif_load, imagemagick_load_image)
16779 (gs_clear_image, gs_load): Callers changed.
16781 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
16783 * buffer.h: Include <time.h>, for time_t.
16784 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
16786 Fix minor problems found by static checking.
16788 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
16790 Make identifiers static if they are not used in other modules.
16791 * data.c (Qcompiled_function, Qframe, Qvector):
16792 * image.c (QimageMagick, Qsvg):
16793 * minibuf.c (Qmetadata):
16794 * window.c (resize_window_check, resize_root_window): Now static.
16795 * window.h (resize_window_check, resize_root_window): Remove decls.
16797 * window.c (window_deletion_count, delete_deletable_window):
16799 (window_body_lines): Now static.
16800 (Fdelete_other_windows_internal): Mark vars as initialized.
16801 Make sure 'resize_failed' is initialized.
16802 (run_window_configuration_change_hook): Rename local to avoid shadowing.
16803 (resize_window_apply): Remove unused local.
16804 * window.h (delete_deletable_window): Remove decl.
16806 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
16807 (imagemagick_load_image): Fix pointer signedness problem by changing
16808 last arg from unsigned char * to char *. All uses changed.
16809 Also, fix a local for similar reasons.
16810 Remove unused locals. Remove locals to avoid shadowing.
16811 (fn_rsvg_handle_free): Remove; unused.
16812 (svg_load, svg_load_image): Fix pointer signedness problem.
16813 (imagemagick_load_image): Don't use garbage pointer image_wand.
16815 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
16817 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
16819 * image.c (gif_load): Fix omitted cast error introduced by
16822 2011-06-10 Martin Rudalics <rudalics@gmx.at>
16824 * window.h (resize_proportionally, orig_total_lines)
16825 (orig_top_line): Remove from window structure.
16826 (set_window_height, set_window_width, change_window_heights)
16827 (Fdelete_window): Remove prototypes.
16828 (resize_frame_windows): Remove duplicate declaration.
16830 2011-06-10 Eli Zaretskii <eliz@gnu.org>
16832 * window.h (resize_frame_windows, resize_window_check)
16833 (delete_deletable_window, resize_root_window)
16834 (resize_frame_windows): Declare prototypes.
16836 * window.c (resize_window_apply): Make definition be "static" to
16837 match the prototype.
16839 2011-06-10 Martin Rudalics <rudalics@gmx.at>
16841 * window.c: Remove declarations of Qwindow_size_fixed,
16842 window_min_size_1, window_min_size_2, window_min_size,
16843 size_window, window_fixed_size_p, enlarge_window, delete_window.
16844 Remove static from declaration of Qdelete_window, it's
16845 temporarily needed by Fbury_buffer.
16846 (replace_window): Don't assign orig_top_line and
16848 (Fdelete_window, delete_window): Remove. Window deletion is
16849 handled by window.el.
16850 (window_loop): Remove DELETE_OTHER_WINDOWS case.
16851 Replace Fdelete_window calls with calls to Qdelete_window.
16852 (Fdelete_other_windows): Remove. Deleting other windows is
16853 handled by window.el.
16854 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
16855 handled in window.el.
16856 (window_min_size_2, window_min_size_1, window_min_size): Remove.
16857 Window minimum sizes are handled in window.el.
16858 (shrink_windows, size_window, set_window_height)
16859 (set_window_width, change_window_heights, window_height)
16860 (window_width, CURBEG, CURSIZE, enlarge_window)
16861 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
16862 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
16863 handled in window.el.
16864 (make_dummy_parent): Rename to make_parent_window and give it a
16865 second argument horflag.
16866 (make_window): Don't set resize_proportionally any more.
16867 (Fsplit_window): Remove. Windows are split in window.el.
16868 (save_restore_action, save_restore_orig_size)
16869 (shrink_window_lowest_first, save_restore_orig_size): Remove.
16870 Resize mini windows in window.el.
16871 (grow_mini_window, shrink_mini_window): Implement by calling
16872 Qresize_root_window_vertically, resize_window_check and
16873 resize_window_apply.
16874 (saved_window, Fset_window_configuration, save_window_save):
16875 Do not handle orig_top_line, orig_total_lines, and
16876 resize_proportionally.
16877 (window_min_height, window_min_width): Move to window.el.
16878 (keys_of_window): Move bindings for delete-other-windows,
16879 split-window, delete-window and enlarge-window to window.el.
16881 * buffer.c: Temporarily extern Qdelete_window.
16882 (Fbury_buffer): Temporarily call Qdelete_window instead of
16883 Fdelete_window (Fbury_buffer will move to window.el soon).
16885 * frame.c (set_menu_bar_lines_1): Remove code handling
16886 orig_top_line and orig_total_lines.
16888 * dispnew.c (adjust_frame_glyphs_initially): Don't use
16889 set_window_height but set heights directly.
16890 (change_frame_size_1): Use resize_frame_windows.
16892 * xdisp.c (init_xdisp): Don't use set_window_height but set
16895 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
16896 Use resize_frame_windows instead of change_window_heights and run
16897 run_window_configuration_change_hook.
16899 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
16900 instead of change_window_heights and run
16901 run_window_configuration_change_hook.
16903 2011-06-09 Martin Rudalics <rudalics@gmx.at>
16905 * window.c (replace_window): Rename second argument REPLACEMENT to
16906 NEW. New third argument SETFLAG. Rewrite.
16907 (delete_window, make_dummy_parent): Call replace_window with
16909 (window_list_1): Move down in code.
16910 (run_window_configuration_change_hook): Move set_buffer part
16911 before select_frame_norecord part in order to unwind correctly.
16912 Rename count1 to count.
16913 (recombine_windows, delete_deletable_window, resize_root_window)
16914 (Fdelete_other_windows_internal)
16915 (Frun_window_configuration_change_hook, make_parent_window)
16916 (resize_window_check, resize_window_apply, Fresize_window_apply)
16917 (resize_frame_windows, Fsplit_window_internal)
16918 (Fdelete_window_internal, Fresize_mini_window_internal):
16920 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
16922 2011-06-08 Martin Rudalics <rudalics@gmx.at>
16924 * window.h (window): Add some new members to window structure -
16925 normal_lines, normal_cols, new_total, new_normal, clone_number,
16926 splits, nest, prev_buffers, next_buffers.
16927 (WINDOW_TOTAL_SIZE): Move here from window.c.
16928 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
16930 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
16932 (make_dummy_parent): Set new members of windows structure.
16933 (make_window): Move down in code. Handle new members of window
16935 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
16936 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
16937 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
16938 (Fset_window_prev_buffers, Fwindow_next_buffers)
16939 (Fset_window_next_buffers, Fset_window_clone_number):
16941 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
16942 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
16944 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
16945 Argument WINDOW can be now internal window too.
16946 (Fwindow_use_time): Move up in code.
16947 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
16948 Rewrite doc-string.
16949 (Fset_window_configuration, saved_window)
16950 (Fcurrent_window_configuration, save_window_save): Handle new
16951 members of window structure.
16952 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
16953 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
16954 (syms_of_window): New Lisp objects Qrecord_window_buffer,
16955 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
16956 Qget_mru_window, Qresize_root_window,
16957 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
16958 Qauto_buffer_name; staticpro them.
16960 2011-06-07 Martin Rudalics <rudalics@gmx.at>
16962 * window.c (Fwindow_total_size, Fwindow_left_column)
16963 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
16964 (Fwindow_list_1): New functions.
16965 (window_box_text_cols): Replace with window_body_cols.
16966 (Fwindow_width, Fscroll_left, Fscroll_right):
16967 Use window_body_cols instead of window_box_text_cols.
16968 (delete_window, Fset_window_configuration):
16969 Call delete_all_subwindows with window as argument.
16970 (delete_all_subwindows): Take a window as argument and not a
16971 structure. Rewrite.
16972 (window_loop): Remove handling of GET_LRU_WINDOW and
16973 GET_LARGEST_WINDOW.
16974 (Fget_lru_window, Fget_largest_window): Move to window.el.
16976 * window.h: Extern window_body_cols instead of
16977 window_box_text_cols. delete_all_subwindows now takes a
16978 Lisp_Object as argument.
16980 * indent.c (compute_motion, Fcompute_motion):
16981 Use window_body_cols instead of window_box_text_cols.
16983 * frame.c (delete_frame): Call delete_all_subwindows with root
16984 window as argument.
16986 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
16988 * fns.c (Fputhash): Document return value.
16990 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
16992 * image.c (gif_load): Implement gif89a spec "no disposal" method.
16994 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
16996 Cons<->int and similar integer overflow fixes (Bug#8794).
16998 Check for overflow when converting integer to cons and back.
16999 * charset.c (Fdefine_charset_internal, Fdecode_char):
17000 Use cons_to_unsigned to catch overflow.
17001 (Fencode_char): Use INTEGER_TO_CONS.
17002 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
17003 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
17004 * data.c (long_to_cons, cons_to_long): Remove.
17005 (cons_to_unsigned, cons_to_signed): New functions.
17006 These signal an error for invalid or out-of-range values.
17007 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
17008 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
17009 * font.c (Ffont_variation_glyphs):
17010 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
17011 * lisp.h: Include <intprops.h>.
17012 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
17013 (cons_to_signed, cons_to_unsigned): New decls.
17014 (long_to_cons, cons_to_long): Remove decls.
17015 * undo.c (record_first_change): Use INTEGER_TO_CONS.
17016 (Fprimitive_undo): Use CONS_TO_INTEGER.
17017 * xfns.c (Fx_window_property): Likewise.
17018 * xselect.c: Include <limits.h>.
17019 (x_own_selection, selection_data_to_lisp_data):
17020 Use INTEGER_TO_CONS.
17021 (x_handle_selection_request, x_handle_selection_clear)
17022 (x_get_foreign_selection, Fx_disown_selection_internal)
17023 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
17024 (lisp_data_to_selection_data): Use cons_to_unsigned.
17025 (x_fill_property_data): Use cons_to_signed.
17026 Report values out of range.
17028 Check for buffer and string overflow more precisely.
17029 * buffer.h (BUF_BYTES_MAX): New macro.
17030 * lisp.h (STRING_BYTES_MAX): New macro.
17031 * alloc.c (Fmake_string):
17032 * character.c (string_escape_byte8):
17033 * coding.c (coding_alloc_by_realloc):
17034 * doprnt.c (doprnt):
17035 * editfns.c (Fformat):
17037 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
17038 since they may not be the same number.
17039 * editfns.c (Finsert_char):
17040 * fileio.c (Finsert_file_contents):
17041 Likewise for BUF_BYTES_MAX.
17043 * image.c: Use ptrdiff_t, not int, for sizes.
17044 (slurp_file): Switch from int to ptrdiff_t.
17046 (slurp_file): Check that file size fits in both size_t (for
17047 malloc) and ptrdiff_t (for sanity and safety).
17049 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
17050 if b->modtime has its maximal value.
17052 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
17054 Don't assume time_t can fit into int.
17055 * buffer.h (struct buffer.modtime): Now time_t, not int.
17056 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
17057 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
17059 Minor fixes for signed vs unsigned integers.
17060 * character.h (MAYBE_UNIFY_CHAR):
17061 * charset.c (maybe_unify_char):
17062 * keyboard.c (read_char, reorder_modifiers):
17063 XINT -> XFASTINT, since the integer must be nonnegative.
17064 * ftfont.c (ftfont_spec_pattern):
17065 * keymap.c (access_keymap, silly_event_symbol_error):
17066 XUINT -> XFASTINT, since the integer must be nonnegative.
17067 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
17068 since it makes no difference and we prefer signed.
17069 * keyboard.c (record_char): Use XUINT when all the neighbors do.
17070 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
17073 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
17075 * window.h (Fwindow_frame): Declare.
17077 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
17079 * alloc.c: Simplify handling of large-request failures (Bug#8800).
17080 (SPARE_MEMORY): Always define.
17081 (LARGE_REQUEST): Remove.
17082 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
17084 2011-06-06 Martin Rudalics <rudalics@gmx.at>
17086 * lisp.h: Move EXFUNS for Fframe_root_window,
17087 Fframe_first_window and Fset_frame_selected_window to window.h.
17089 * window.h: Move EXFUNS for Fframe_root_window,
17090 Fframe_first_window and Fset_frame_selected_window here from
17093 * frame.c (Fwindow_frame, Fframe_first_window)
17094 (Fframe_root_window, Fframe_selected_window)
17095 (Fset_frame_selected_window): Move to window.c.
17096 (Factive_minibuffer_window): Move to minibuf.c.
17097 (Fother_visible_frames_p): New function.
17099 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
17101 * window.c (decode_window, decode_any_window): Move up in code.
17102 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
17103 (inhibit_frame_unsplittable): Remove unused variable.
17104 (Fwindow_buffer): Move up and rewrite doc-string.
17105 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
17106 (Fwindow_prev): New functions.
17107 (Fwindow_frame): Move here from frame.c. Accept any window as
17109 (Fframe_root_window, Fframe_first_window)
17110 (Fframe_selected_window): Move here from frame.c. Accept frame
17111 or arbitrary window as argument. Update doc-strings.
17112 (Fminibuffer_window): Move up in code.
17113 (Fwindow_minibuffer_p): Move up in code and simplify.
17114 (Fset_frame_selected_window): Move here from frame.c.
17116 (Fselected_window, select_window, Fselect_window): Move up in
17117 code. Minor doc-string fixes.
17119 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
17121 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
17122 Do not assume that spare memory exists; that assumption is valid
17123 only if SYSTEM_MALLOC.
17124 (LARGE_REQUEST): New macro, so that the issue of large requests
17125 is separated from the issue of spare memory.
17127 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
17129 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
17132 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
17134 * xfns.c (x_set_scroll_bar_default_width): Move declarations
17137 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
17139 * gtkutil.c (xg_get_default_scrollbar_width): New function.
17141 * gtkutil.h: Declare xg_get_default_scrollbar_width.
17143 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
17144 min width by calling x_set_scroll_bar_default_width (Bug#8505).
17146 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
17148 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
17150 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
17152 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
17153 (x_clipboard_manager_save): Add return value.
17154 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
17155 New error handlers.
17156 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
17157 Obey Vx_select_enable_clipboard_manager. Catch errors in
17158 x_clipboard_manager_save (Bug#8779).
17159 (Vx_select_enable_clipboard_manager): New variable.
17160 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
17162 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
17164 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
17166 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17168 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
17169 in the current matrix if keep_current_p is non-zero.
17171 2011-06-04 Eli Zaretskii <eliz@gnu.org>
17173 * bidi.c (bidi_level_of_next_char): Fix last change.
17175 2011-06-03 Eli Zaretskii <eliz@gnu.org>
17177 Support bidi reordering of text covered by display properties.
17179 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
17180 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
17181 (bidi_cache_search, bidi_cache_iterator_state)
17182 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
17183 (bidi_level_of_next_char, bidi_move_to_visually_next):
17184 Support character positions inside a run of characters covered by a
17186 (bidi_paragraph_init, bidi_resolve_explicit_1)
17187 (bidi_level_of_next_char): Call bidi_fetch_char and
17188 bidi_fetch_char_advance instead of FETCH_CHAR and
17189 FETCH_CHAR_ADVANCE.
17190 (bidi_init_it): Initialize new members.
17191 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
17193 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
17194 instead of using explicit *_CHAR codes.
17195 (bidi_resolve_explicit, bidi_resolve_weak):
17196 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
17197 bidirectional text is supported only in multibyte buffers.
17198 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
17199 it to initialize the frame_window_p member of struct bidi_it.
17200 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
17201 (bidi_resolve_explicit, bidi_resolve_weak)
17202 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
17203 bidi_it->nchars is non-positive.
17204 (bidi_level_of_next_char): Don't try to lookup the cache for the
17205 next/previous character if nothing is cached there yet, or if we
17206 were just reseat()'ed to a new position.
17208 * xdisp.c (set_cursor_from_row): Set start and stop points
17209 according to the row's direction when priming the loop that looks
17210 for the glyph on which to display cursor.
17211 (single_display_spec_intangible_p): Function deleted.
17212 (display_prop_intangible_p): Reimplement to call
17213 handle_display_spec instead of single_display_spec_intangible_p.
17214 Accept 3 additional arguments needed by handle_display_spec.
17215 This fixes incorrect cursor motion across display property with complex
17216 values: lists, `(when COND...)' forms, etc.
17217 (single_display_spec_string_p): Support property values that are
17218 lists with the argument STRING its top-level element.
17219 (display_prop_string_p): Fix the condition for processing a
17220 property that is a list to be consistent with handle_display_spec.
17221 (handle_display_spec): New function, refactored from the
17222 last portion of handle_display_prop.
17223 (compute_display_string_pos): Accept additional argument
17224 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
17225 value of a `display' property is a "replacing spec".
17226 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
17227 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
17228 the display property, but just return a value indicating whether
17229 the display property will replace the characters it covers.
17230 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
17231 frame_window_p members of struct bidi_it.
17232 (compute_display_string_pos, compute_display_string_end):
17234 (push_it): Accept second argument POSITION, where pop_it should
17235 jump to continue iteration.
17236 (reseat_1): Initialize bidi_it.disp_pos.
17238 * keyboard.c (adjust_point_for_property): Adjust the call to
17239 display_prop_intangible_p to its new signature.
17241 * dispextern.h (struct bidi_it): New member frame_window_p.
17242 (bidi_init_it): Update prototypes.
17243 (display_prop_intangible_p): Update prototype.
17244 (compute_display_string_pos, compute_display_string_end):
17245 Declare prototypes.
17246 (struct bidi_it): New members nchars and disp_pos. ch_len is now
17249 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
17251 Malloc failure behavior now depends on size of allocation.
17252 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
17253 * lisp.h: Change signatures accordingly.
17254 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
17255 All callers changed. (Bug#8762)
17257 * gnutls.c: Use Emacs's memory allocators.
17258 Without this change, the gnutls library would invoke malloc etc.
17259 directly, which causes problems on non-SYNC_INPUT hosts, and which
17260 runs afoul of improving memory_full behavior. (Bug#8761)
17261 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
17262 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
17263 xfree instead of the default malloc, realloc, free.
17264 (Fgnutls_boot): No need to check for memory allocation failure,
17265 since xmalloc does that for us.
17267 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
17268 * category.c (hash_get_category_set):
17269 * ccl.c (ccl_driver):
17270 * charset.c (Fdefine_charset_internal):
17271 * charset.h (struct charset.hash_index):
17272 * composite.c (get_composition_id, gstring_lookup_cache)
17273 (composition_gstring_put_cache):
17274 * composite.h (struct composition.hash_index):
17275 * dispextern.h (struct image.hash):
17276 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
17277 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
17278 (hashfn_equal, hashfn_user_defined, make_hash_table)
17279 (maybe_resize_hash_table, hash_lookup, hash_put)
17280 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
17281 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
17282 (Fsxhash, Fgethash, Fputhash, Fmaphash):
17283 * image.c (make_image, search_image_cache, lookup_image)
17284 (xpm_put_color_table_h):
17285 * lisp.h (struct Lisp_Hash_Table):
17286 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
17287 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
17288 for hashes and hash indexes, instead of 'unsigned' and 'int'.
17289 * alloc.c (allocate_vectorlike):
17290 Check for overflow in vector size calculations.
17291 * ccl.c (ccl_driver):
17292 Check for overflow when converting EMACS_INT to int.
17293 * fns.c, image.c: Remove unnecessary static decls that would otherwise
17294 need to be updated by these changes.
17295 * fns.c (make_hash_table, maybe_resize_hash_table):
17296 Check for integer overflow with large hash tables.
17297 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
17298 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
17299 (SXHASH_REDUCE): New macro.
17300 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
17301 Use it instead of discarding useful hash info with large hash values.
17302 (sxhash_float): New function.
17303 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
17304 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
17305 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
17306 Rewrite to use FIXNUM_BITS, as this simplifies things.
17307 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
17308 Adjust signatures to match updated version of code.
17309 (consing_since_gc): Now EMACS_INT, since a single hash table can
17310 use more than INT_MAX bytes.
17312 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
17314 Make it possible to build with GCC-4.6+ -O2 -flto.
17316 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
17318 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
17320 * minibuf.c (get_minibuffer, read_minibuf_unwind):
17321 Call minibuffer-inactive-mode.
17323 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
17325 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
17326 Update dependencies.
17328 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17330 * data.c (init_data): Remove code for UTS, this system is not
17333 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17335 Don't force ./temacs to start in terminal mode.
17337 * frame.c (make_initial_frame): Initialize faces in all cases, not
17338 only when CANNOT_DUMP is defined.
17339 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
17341 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17343 * dispnew.c (add_window_display_history): Use const for the string
17344 pointer. Remove declaration, not needed.
17346 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
17348 Use 'inline', not 'INLINE'.
17349 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
17350 * alloc.c, fontset.c (INLINE): Remove.
17351 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
17352 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
17353 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
17354 * gmalloc.c (register_heapinfo): Use inline unconditionally.
17355 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
17357 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17359 Make it possible to run ./temacs.
17361 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
17362 syms_of_callproc does the same thing. Remove test for
17363 "initialized", do it in the caller.
17364 * emacs.c (main): Avoid calling set_initial_environment when dumping.
17366 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
17368 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
17369 (read_minibuf): Use get_minibuffer.
17370 (syms_of_minibuf): Use DEFSYM.
17371 (Qmetadata): New var.
17372 * data.c (Qbuffer): Don't make it static.
17373 (syms_of_data): Use DEFSYM.
17375 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
17377 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
17378 (CCL_CODE_MIN): New macro.
17380 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
17382 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
17384 * eval.c (Qdebug): Now static.
17385 * lisp.h (Qdebug): Remove decl. This reverts a part of the
17386 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
17387 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
17389 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
17391 * image.c: Various fixes to ImageMagick code comments.
17392 (Fimagemagick_types): Doc fix.
17394 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
17396 Minor fixes prompted by GCC 4.6.0 warnings.
17398 * xselect.c (converted_selections, conversion_fail_tag): Now static.
17400 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
17401 (x_clipboard_manager_save_all): Move extern decl to ...
17402 * xterm.h: ... here, so that it can be checked for consistency.
17404 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
17406 * xselect.c (x_clipboard_manager_save_frame)
17407 (x_clipboard_manager_save_all): New functions.
17408 (Fx_clipboard_manager_save): Lisp function deleted.
17410 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
17411 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
17413 * xterm.h: Update prototype.
17415 2011-05-28 William Xu <william.xwl@gmail.com>
17417 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
17418 exiting (Bug#8239).
17420 2011-05-28 Jim Meyering <meyering@redhat.com>
17422 Avoid a sign-extension bug in crypto_hash_function.
17423 * fns.c (to_uchar): Define.
17424 (crypto_hash_function): Use it to convert some newly-signed
17425 variables to unsigned, to avoid sign-extension bugs. For example,
17426 without this change, (md5 "truc") would evaluate to
17427 45723a2aff78ff4fff7fff1114760e62 rather than the expected
17428 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
17429 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
17431 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
17433 Integer overflow fixes.
17435 * dbusbind.c: Serial number integer overflow fixes.
17436 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
17437 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
17438 to hold a serial number that is too large for a fixnum.
17439 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17440 Check for serial numbers out of range. Decode any serial number
17441 that was so large that it became a float. (Bug#8722)
17443 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
17444 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17445 Use XFASTINT rather than XUINT when numbers are nonnegative.
17446 (xd_append_arg, Fdbus_method_return_internal):
17447 (Fdbus_method_error_internal): Likewise. Also, for unsigned
17448 arguments, check that Lisp number is nonnegative, rather than
17449 silently wrapping negative numbers around. (Bug#8722)
17450 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
17453 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
17455 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
17457 ccl: Add integer overflow checks.
17458 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
17459 (IN_INT_RANGE): New macros.
17460 (ccl_driver): Use them to check for integer overflow when
17461 decoding a CCL program. Many of the new checks are whether XINT (x)
17462 fits in int; it doesn't always, on 64-bit hosts. The new version
17463 doesn't catch all possible integer overflows, but it's an
17464 improvement. (Bug#8719)
17466 * alloc.c (make_event_array): Use XINT, not XUINT.
17467 There's no need for unsigned here.
17469 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
17470 This follows up to the 2011-05-06 change that substituted uintptr_t
17471 for EMACS_INT. This case wasn't caught back then.
17473 Rework Fformat to avoid integer overflow issues.
17474 * editfns.c: Include <float.h> unconditionally, as it's everywhere
17475 now (part of C89). Include <verify.h>.
17476 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
17477 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
17478 (Fformat): Avoid the prepass trying to compute sizes; it was only
17479 approximate and thus did not catch overflow reliably. Instead, walk
17480 through the format just once, formatting and computing sizes as we go,
17481 checking for integer overflow at every step, and allocating a larger
17482 buffer as needed. Keep track separately whether the format is
17483 multibyte. Keep only the most-recently calculated precision, rather
17484 than them all. Record whether each argument has been converted to
17485 string. Use EMACS_INT, not int, for byte and char and arg counts.
17486 Support field widths and precisions larger than INT_MAX. Avoid
17487 sprintf's undefined behavior with conversion specifications such as %#d
17488 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
17489 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
17490 formatting out-of-range floating point numbers with int
17491 formats. (Bug#8668)
17493 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
17495 * data.c: Avoid integer truncation in expressions involving floats.
17496 * data.c: Include <intprops.h>.
17497 (arith_driver): When there's an integer overflow in an expression
17498 involving floating point, convert the integers to floating point
17499 so that the resulting value does not suffer from catastrophic
17500 integer truncation. For example, on a 64-bit host (* 4
17501 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
17502 Do not rely on undefined behavior after integer overflow.
17504 merge count_size_as_multibyte, parse_str_to_multibyte
17505 * character.c, character.h (count_size_as_multibyte):
17506 Rename from parse_str_to_multibyte; all uses changed.
17507 Check for integer overflow.
17508 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
17509 since it's now a duplicate of the other. This is more of
17510 a character than a buffer op, so better that it's in character.c.
17511 * fns.c, print.c: Adjust to above changes.
17513 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
17515 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
17517 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
17519 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
17520 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
17521 (x_clipboard_manager_save): Now static.
17522 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
17524 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
17525 (crypto_hash_function): Now static.
17526 Fix pointer signedness problems. Avoid unnecessary initializations.
17528 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
17530 * termhooks.h (Vselection_alist): Make it terminal-local.
17532 * terminal.c (create_terminal): Initialize it.
17534 * xselect.c: Support for clipboard managers.
17535 (Vselection_alist): Move to termhooks.h as terminal-local var.
17536 (LOCAL_SELECTION): New macro.
17537 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
17538 (symbol_to_x_atom): Remove gratuitous arg.
17539 (x_handle_selection_request, lisp_data_to_selection_data)
17540 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
17541 (x_own_selection, x_get_local_selection, x_convert_selection):
17542 New arg, specifying work frame. Use terminal-local Vselection_alist.
17543 (some_frame_on_display): Delete unused function.
17544 (Fx_own_selection_internal, Fx_get_selection_internal)
17545 (Fx_disown_selection_internal, Fx_selection_owner_p)
17546 (Fx_selection_exists_p): New optional frame arg.
17547 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
17548 (x_handle_selection_clear): Don't treat other terminals with the
17549 same keyboard specially. Use the terminal-local Vselection_alist.
17550 (x_clear_frame_selections): Use Frun_hook_with_args.
17552 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
17554 * xterm.h: Add support for those atoms.
17556 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
17558 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
17559 (converted_selections, conversion_fail_tag): New global variables.
17560 (x_selection_request_lisp_error): Free the above.
17561 (x_get_local_selection): Remove unnecessary code.
17562 (x_reply_selection_request): Args changed; handle arbitrary array
17563 of converted selections stored in converted_selections.
17564 Separate the XChangeProperty and SelectionNotify steps.
17565 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
17566 (x_convert_selection): New function.
17567 (x_handle_selection_event): Simplify.
17568 (x_get_foreign_selection): Don't ignore incoming requests while
17569 waiting for an answer; this will fail when we implement
17570 SAVE_TARGETS, and seems unnecessary anyway.
17571 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
17572 (Vx_sent_selection_functions): Doc fix.
17574 2011-05-26 Leo Liu <sdl.web@gmail.com>
17576 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
17578 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17580 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
17582 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
17583 for fringe update if it has periodic bitmap.
17584 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
17585 and fringe_bitmap_periodic_p.
17587 * fringe.c (get_fringe_bitmap_data): New function.
17588 (draw_fringe_bitmap_1, update_window_fringes): Use it.
17589 (update_window_fringes): Record periodicity of fringe bitmap in glyph
17590 row. Mark glyph row for fringe update if periodicity changed.
17592 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
17593 for fringe update unless it has periodic bitmap.
17595 2011-05-25 Kenichi Handa <handa@m17n.org>
17597 * xdisp.c (get_next_display_element): Set correct it->face_id for
17598 a static composition.
17600 2011-05-24 Leo Liu <sdl.web@gmail.com>
17603 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
17605 * fns.c (crypto_hash_function, Fsha1): New function.
17606 (Fmd5): Use crypto_hash_function.
17607 (syms_of_fns): Add Ssha1.
17609 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
17611 * gnutls.c: Remove unused macros.
17612 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
17613 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
17614 Remove macros that are defined and never used.
17615 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
17617 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
17619 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
17620 (Fx_get_selection_internal): Minor cleanup.
17621 (Fx_own_selection_internal): Rename arguments for consistency with
17624 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
17626 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
17628 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
17630 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
17632 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17634 * dispnew.c (scrolling_window): Don't exclude the case that the
17635 last enabled row in the desired matrix touches the bottom boundary.
17637 2011-05-21 Glenn Morris <rgm@gnu.org>
17639 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
17640 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
17641 and add some more files.
17643 2011-05-20 Eli Zaretskii <eliz@gnu.org>
17645 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
17646 report_file_error introduced by the change from 2011-05-07.
17648 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
17650 * systime.h (Time): Define only if emacs is defined.
17651 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
17652 where the include path doesn't have X11/X.h by default. See
17653 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
17655 2011-05-20 Kenichi Handa <handa@m17n.org>
17657 * composite.c (find_automatic_composition): Fix previous change.
17659 2011-05-20 Glenn Morris <rgm@gnu.org>
17661 * lisp.mk: New file, split from Makefile.in.
17662 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
17663 (shortlisp): Remove.
17664 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
17666 2011-05-19 Glenn Morris <rgm@gnu.org>
17668 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
17669 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
17670 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
17671 (lisp): Set the order to that of loadup.el.
17672 (shortlisp): Make it a copy of $lisp.
17673 (SOME_MACHINE_LISP): Remove.
17674 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
17675 Use just $shortlisp, not $SOME_MACHINE_LISP too.
17677 2011-05-18 Kenichi Handa <handa@m17n.org>
17679 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
17680 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
17681 (find_automatic_composition): Mostly rewrite for efficiency.
17683 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
17685 * makefile.w32-in: Update dependencies.
17687 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
17689 * menu.c: Include limits.h (fixes the MS-Windows build broken by
17690 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
17692 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
17694 Fix some integer overflow issues, such as string length overflow.
17696 * insdel.c (count_size_as_multibyte): Check for string overflow.
17698 * character.c (lisp_string_width): Check for string overflow.
17699 Use EMACS_INT, not int, for string indexes and lengths; in
17700 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
17701 the resulting string length overflows an EMACS_INT; instead,
17702 report a string overflow if no precision given. When checking for
17703 precision exhaustion, use a check that cannot possibly have
17704 integer overflow. (Bug#8675)
17705 * character.h (lisp_string_width): Adjust to new signature.
17707 * alloc.c (string_overflow): New function.
17708 (Fmake_string): Use it. This doesn't change behavior, but saves
17709 a few bytes and will simplify future changes.
17710 * character.c (string_escape_byte8): Likewise.
17711 * lisp.h (string_overflow): New decl.
17713 Fixups, following up to the user-interface timestamp change.
17714 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
17715 for UI timestamps, instead of unsigned long.
17716 * msdos.c (mouse_get_pos): Likewise.
17717 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
17718 * w32gui.h (Time): Define by including "systime.h" rather than by
17719 declaring it ourselves. (Bug#8664)
17721 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
17722 * image.c (clear_image_cache): Likewise.
17724 * term.c (term_mouse_position): Don't assume time_t wraparound.
17726 Be more systematic about user-interface timestamps.
17727 Before, the code sometimes used 'Time', sometimes 'unsigned long',
17728 and sometimes 'EMACS_UINT', to represent these timestamps.
17729 This change causes it to use 'Time' uniformly, as that's what X uses.
17730 This makes the code easier to follow, and makes it easier to catch
17731 integer overflow bugs such as Bug#8664.
17732 * frame.c (Fmouse_position, Fmouse_pixel_position):
17733 Use Time, not unsigned long, for user-interface timestamps.
17734 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
17735 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
17736 * keyboard.h (last_event_timestamp): Likewise.
17737 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
17738 * menu.h (xmenu_show): Likewise.
17739 * term.c (term_mouse_position): Likewise.
17740 * termhooks.h (struct input_event.timestamp): Likewise.
17741 (struct terminal.mouse_position_hook): Likewise.
17742 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
17743 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
17744 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
17745 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
17746 what it was before.
17747 * menu.h, termhooks.h: Include "systime.h", for Time.
17749 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
17750 Don't assume that the difference between two unsigned long values
17751 can fit into an integer. At this point, we know button_down_time
17752 <= event->timestamp, so the difference must be nonnegative, so
17753 there's no need to cast the result if double-click-time is
17754 nonnegative, as it should be; check that it's nonnegative, just in
17755 case. This bug is triggered when events are more than 2**31 ms
17756 apart (about 25 days). (Bug#8664)
17758 * xselect.c (last_event_timestamp): Remove duplicate decl.
17759 (x_own_selection): Remove needless cast to unsigned long.
17761 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
17762 that always fit in int. Use a sentinel instead of a counter, to
17763 avoid a temp and to allay GCC's concerns about possible int overflow.
17764 * frame.h (struct frame): Use int for menu_bar_items_used
17765 instead of EMACS_INT, since it always fits in int.
17767 * menu.c (grow_menu_items): Check for int overflow.
17769 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
17771 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
17772 Before, the code was not consistent. These values cannot exceed
17773 2**31 - 1 so there's no need to make them unsigned.
17774 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
17775 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
17776 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
17778 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
17780 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
17781 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
17782 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
17783 presumably because the widths might not match.
17785 * window.c (size_window): Avoid needless test at loop start.
17787 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
17789 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
17791 2011-05-12 Drew Adams <drew.adams@oracle.com>
17793 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
17795 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17797 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
17798 `width' to `bar_area_x' and `bar_area_width', respectively.
17799 (x_scroll_run): Take account of fringe background extension.
17801 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
17802 Rename local vars `left' and `width' to `bar_area_x' and
17803 `bar_area_width', respectively.
17804 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
17805 background extension.
17807 2011-05-10 Jim Meyering <meyering@redhat.com>
17809 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
17811 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
17813 * image.c (Finit_image_library): Return t for built-in image types,
17814 like pbm and xbm. (Bug#8640)
17816 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
17818 * w32menu.c (set_frame_menubar): Fix submenu allocation.
17820 2011-05-07 Eli Zaretskii <eliz@gnu.org>
17822 * w32console.c (Fset_screen_color): Doc fix.
17823 (Fget_screen_color): New function.
17824 (syms_of_ntterm): Defsubr it.
17826 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
17827 unlink the temporary file if Fcall_process didn't create it in the
17829 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
17830 child process will be redirected to a file specified with `:file'.
17831 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
17832 cue to call_process_cleanup not to close that handle.
17834 2011-05-07 Ben Key <bkey76@gmail.com>
17836 * makefile.w32-in: The bootstrap-temacs rule now makes use of
17837 one of two shell specific rules, either bootstrap-temacs-CMD or
17838 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
17839 to the previous implementation of the bootstrap-temacs rule.
17840 The bootstrap-temacs-CMD rule is similar to the previous
17841 implementation of the bootstrap-temacs rule except that it
17842 makes use of the ESC_CFLAGS variable instead of the CFLAGS
17845 These changes, along with some changes to nt/configure.bat,
17846 nt/gmake.defs, and nt/nmake.defs, are required to extend my
17847 earlier fix to add support for --cflags and --ldflags options
17848 that include quotes so that it works whether make uses cmd or
17851 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
17853 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
17854 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
17856 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
17857 a string. Handle both cases.
17858 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
17859 (Fdbus_register_method): Use Qinvalid_function.
17861 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
17863 * makefile.w32-in: Update dependencies.
17864 (LISP_H): Add inttypes.h and stdin.h.
17865 (PROCESS_H): Add unistd.h.
17867 2011-05-06 Eli Zaretskii <eliz@gnu.org>
17869 * lread.c: Include limits.h (fixes the MS-Windows build broken by
17870 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
17872 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
17874 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
17876 * term.c (vfatal): Remove stray call to va_end.
17877 It's not needed and the C Standard doesn't allow it here anyway.
17879 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
17880 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
17882 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
17885 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
17887 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
17889 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
17891 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
17893 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
17895 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
17896 * charset.c (Fdefine_charset_internal): Don't initialize
17897 charset.code_space[15]. The value was garbage, on hosts with
17898 32-bit int (Bug#8600).
17900 * lread.c (read_integer): Be more consistent with string-to-number.
17901 Use string_to_number to do the actual conversion; this avoids
17902 rounding errors and fixes some other screwups. Without this fix,
17903 for example, #x1fffffffffffffff was misread as -2305843009213693952.
17904 (digit_to_number): Move earlier, for benefit of read_integer.
17905 Return -1 if the digit is out of range for the base, -2 if it is
17906 not a digit in any supported base. (Bug#8602)
17908 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
17910 * dispnew.c (scrolling_window): Return 1 if we scrolled,
17911 to match comment at start of function. This also removes a
17912 GCC warning about overflow in a 32+64-bit port.
17914 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
17916 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
17917 Reported by Stefan Monnier in
17918 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
17919 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
17920 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
17922 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
17923 (EMACS_UINTPTR): Likewise, with uintptr_t.
17925 * lisp.h: Prefer 64-bit EMACS_INT if available.
17926 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
17927 on 32-bit hosts that have 64-bit int, so that they can access
17929 However, temporarily disable this change unless the temporary
17930 symbol WIDE_EMACS_INT is defined.
17932 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
17934 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
17935 This removes an assumption that EMACS_INT and long are the same
17936 width as pointers. The assumption is true for Emacs porting targets
17937 now, but we want to make other targets possible.
17938 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
17939 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
17940 In the rest of the code, change types of integers that hold casted
17941 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
17942 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
17943 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
17944 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
17945 No need to cast type when ORing.
17946 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
17947 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
17948 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
17949 assume EMACS_INT is the same width as char *.
17950 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
17951 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
17952 Remove no-longer-needed casts.
17953 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
17954 (xg_tool_bar_help_callback, xg_make_tool_item):
17955 Use EMACS_INTPTR to hold an integer
17956 that will be cast to void *; this can avoid a GCC warning
17957 if EMACS_INT is not the same width as void *.
17958 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
17959 * xdisp.c (display_echo_area_1, resize_mini_window_1):
17960 (current_message_1, set_message_1):
17961 Use a local to convert to proper width without a cast.
17962 * xmenu.c (dialog_selection_callback): Likewise.
17964 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
17965 Also, don't assume VALBITS / RAND_BITS is less than 5,
17966 and don't rely on undefined behavior when shifting a 1 left into
17968 * lisp.h (get_random): Change signature to match.
17970 * lread.c (hash_string): Use size_t, not int, for hash computation.
17971 Normally we prefer signed values; but hashing is special, because
17972 it's better to use unsigned division on hash table sizes so that
17973 the remainder is nonnegative. Also, size_t is the natural width
17974 for hashing into memory. The previous code used 'int', which doesn't
17975 retain enough info to hash well into very large tables.
17976 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
17978 * dbusbind.c: Don't possibly lose pointer info when converting.
17979 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
17980 Use XPNTR rather than XHASH, so that the high-order bits of
17981 the pointer aren't lost when converting through void *.
17983 * eval.c (Fautoload): Don't double-shift a pointer.
17985 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
17987 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
17989 * gnutls.c (DEF_GNUTLS_FN):
17990 * image.c (DEF_IMGLIB_FN): Make function pointers static.
17992 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
17994 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
17997 2011-05-05 Eli Zaretskii <eliz@gnu.org>
17999 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
18000 New version that can reserve upto 2GB of heap space.
18002 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
18004 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
18006 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
18008 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
18009 `gnutls_certificate_set_x509_key_file'.
18011 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
18013 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
18014 Update dependencies.
18016 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
18018 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
18019 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
18020 Remove unused parameter `fildes'.
18021 * process.c (read_process_output, send_process): Don't pass it.
18023 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
18025 Fix previous change: the library cache is defined in w32.c.
18026 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
18027 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
18029 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
18031 Implement dynamic loading of GnuTLS on Windows.
18033 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
18034 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
18035 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
18038 * gnutls.c (Qgnutls_dll): Define.
18039 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
18040 (gnutls_*): Declare function pointers.
18041 (init_gnutls_functions): New function to initialize function pointers.
18042 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
18043 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
18044 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
18045 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
18046 (emacs_gnutls_write, emacs_gnutls_read)
18047 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
18048 (Fgnutls_available_p): New function.
18049 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
18050 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
18051 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
18053 * image.c: Include w32.h.
18054 (Vimage_type_cache): Delete.
18055 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
18056 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
18057 (w32_delayed_load): Move to w32.c.
18059 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
18061 * w32.c (QCloaded_from, Vlibrary_cache): Define.
18062 (w32_delayed_load): Move from image.c. When loading a library, record
18063 its filename in the :loaded-from property of the library id.
18064 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
18065 Initialize and staticpro them.
18066 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
18068 * process.c: Include lisp.h before w32.h, not after.
18069 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
18070 instead of gnutls_record_check_pending.
18072 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
18074 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
18076 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
18077 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
18080 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
18082 * xterm.c (x_set_frame_alpha): Do not set property on anything
18083 else than FRAME_X_OUTER_WINDOW (Bug#8608).
18085 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
18087 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
18089 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
18091 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
18092 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
18093 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
18094 (gnutls_global_initialized, Qgnutls_bootprop_priority)
18095 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
18096 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
18097 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
18098 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
18099 (Qgnutls_bootprop_callbacks_verify): Make static.
18101 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
18103 * callproc.c: Indentation fixup.
18105 * sysdep.c (wait_for_termination_1): Make static.
18106 (wait_for_termination, interruptible_wait_for_termination):
18107 Move after wait_for_termination_1.
18109 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
18111 * sysdep.c (interruptible_wait_for_termination): New function
18112 which is like wait_for_termination, but allows keyboard
18115 * callproc.c (Fcall_process): Add (:file "file") as an option for
18117 (Fcall_process_region): Ditto.
18119 2011-04-30 Eli Zaretskii <eliz@gnu.org>
18121 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
18122 rather than `XVECTOR (FOO)->size'.
18124 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
18125 inttypes.h, as a gnulib replacement is used if it not available in
18128 2011-04-21 Eli Zaretskii <eliz@gnu.org>
18130 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
18131 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
18132 of MOST_POSITIVE_FIXNUM. (Bug#8528)
18134 * coding.c (coding_alloc_by_realloc): Error out if destination
18135 will grow beyond MOST_POSITIVE_FIXNUM.
18136 (decode_coding_emacs_mule): Abort if there isn't enough place in
18137 charbuf for the composition carryover bytes. Reserve an extra
18138 space for up to 2 characters produced in a loop.
18139 (decode_coding_iso_2022): Abort if there isn't enough place in
18140 charbuf for the composition carryover bytes.
18142 2011-04-21 Eli Zaretskii <eliz@gnu.org>
18144 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
18145 aborting when %lld or %lll format is passed.
18146 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
18147 %llo or %llx format is passed. (Bug#8545)
18149 * window.c (window_scroll_line_based): Use a marker instead of
18150 simple variables to record original value of point. (Bug#7952)
18152 * doprnt.c (doprnt): Fix the case where a multibyte sequence
18153 produced by %s or %c overflows available buffer space. (Bug#8545)
18155 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
18157 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
18158 (SIZE_MAX): Move defn after all includes, as they might #define it.
18160 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
18162 * w32.c (init_environment): Warn about defaulting HOME to C:\.
18164 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
18166 * keyboard.c (Qdelayed_warnings_hook): Define.
18167 (command_loop_1): Run `delayed-warnings-hook'
18168 if Vdelayed_warnings_list is non-nil.
18169 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
18170 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
18172 2011-04-28 Eli Zaretskii <eliz@gnu.org>
18174 * doprnt.c (doprnt): Don't return value smaller than the buffer
18175 size if the message was truncated. (Bug#8545).
18177 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
18179 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
18180 (Fx_window_property): #if-0 the whole functions, not just the bodies.
18182 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
18184 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
18186 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
18188 * makefile.w32-in: Update dependencies.
18190 2011-04-27 Eli Zaretskii <eliz@gnu.org>
18192 Improve `doprnt' and its usage. (Bug#8545)
18193 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
18194 `format_end'. Remove support for %l as a conversion specifier.
18195 Don't use xrealloc. Improve diagnostics when the %l size modifier
18196 is used. Update the commentary.
18198 * eval.c (verror): Simplify calculation of size_t.
18200 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
18203 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
18205 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
18208 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
18210 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
18211 This makes this file independent of the recent pseudovector change.
18213 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
18215 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
18217 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
18218 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
18219 Remove unused local.
18220 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
18222 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
18223 GCC 4.6.0 optimizes based on type-based alias analysis.
18224 For example, if b is of type struct buffer * and v of type struct
18225 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
18226 != &v->size, and therefore "v->size = 1; b->size = 2; return
18227 v->size;" must therefore return 1. This assumption is incorrect
18228 for Emacs, since it type-puns struct Lisp_Vector * with many other
18229 types. To fix this problem, this patch adds a new type struct
18230 vectorlike_header that documents the constraints on layout of vectors
18231 and pseudovectors, and helps optimizing compilers not get fooled
18232 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
18233 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
18234 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
18236 (XSETPVECTYPE): Rewrite in terms of new macro.
18237 (XSETPVECTYPESIZE): New macro, specifying both type and size.
18238 This is a bit clearer, and further avoids the possibility of
18239 undesirable aliasing.
18240 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
18241 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
18242 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
18243 since Lisp_Subr is a special case (no "next" field).
18244 (ASIZE): Now uses header.size rather than size.
18245 All previous uses of XVECTOR (foo)->size replaced to use this macro,
18246 to avoid the hassle of writing XVECTOR (foo)->header.size.
18247 (struct vectorlike_header): New type.
18248 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
18249 object, to help avoid aliasing.
18250 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
18251 (SUBRP): Likewise, since Lisp_Subr is a special case.
18252 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
18253 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
18254 (struct Lisp_Hash_Table): Combine first two members into a single
18255 struct vectorlike_header member. All uses of "size" and "next" members
18256 changed to be "header.size" and "header.next".
18257 * buffer.h (struct buffer): Likewise.
18258 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
18259 * frame.h (struct frame): Likewise.
18260 * process.h (struct Lisp_Process): Likewise.
18261 * termhooks.h (struct terminal): Likewise.
18262 * window.c (struct save_window_data, struct saved_window): Likewise.
18263 * window.h (struct window): Likewise.
18264 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
18265 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
18266 * buffer.c (init_buffer_once): Likewise.
18267 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
18269 * process.c (Fformat_network_address): Use local var for size,
18272 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
18274 Make the Lisp reader and string-to-float more consistent (Bug#8525)
18275 * data.c (atof): Remove decl; no longer used or needed.
18276 (digit_to_number): Move to lread.c.
18277 (Fstring_to_number): Use new string_to_number function, to be
18278 consistent with how the Lisp reader treats infinities and NaNs.
18279 Do not assume that floating-point numbers represent EMACS_INT
18280 without losing information; this is not true on most 64-bit hosts.
18281 Avoid double-rounding errors, by insisting on integers when
18282 parsing non-base-10 numbers, as the documentation specifies.
18283 * lisp.h (string_to_number): New decl, replacing ...
18284 (isfloat_string): Remove.
18285 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
18286 (read1): Do not accept +. and -. as integers; this
18287 appears to have been a coding error. Similarly, do not accept
18288 strings like +-1e0 as floating point numbers. Do not report
18289 overflow for integer overflows unless the base is not 10 which
18290 means we have no simple and reliable way to continue.
18291 Break out the floating-point parsing into a new
18292 function string_to_number, so that Fstring_to_number parses
18293 floating point numbers consistently with the Lisp reader.
18294 (digit_to_number): Move here from data.c. Make it static inline.
18295 (E_CHAR, EXP_INT): Remove, replacing with ...
18296 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
18297 (string_to_number): New function, replacing isfloat_string.
18298 This function checks for valid syntax and produces the resulting
18299 Lisp float number too. Rework it so that string-to-number
18300 no longer mishandles examples like "1.0e+". Use strtoumax,
18301 so that overflow for non-base-10 numbers is reported only when
18302 there's no portable and simple way to convert to floating point.
18304 * textprop.c (set_text_properties_1): Rewrite for clarity,
18305 and to avoid GCC warning about integer overflow.
18307 * intervals.h (struct interval): Use EMACS_INT for members
18308 where EMACS_UINT might cause problems. See
18309 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
18310 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
18311 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
18313 (offset_intervals): Tell GCC not to worry about length overflow
18314 when negating a negative length.
18316 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
18317 (overrun_check_free): Likewise.
18319 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
18320 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
18323 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
18324 (gnutls_make_error): Rename local to avoid shadowing.
18325 (gnutls_emacs_global_deinit): ifdef out; not used.
18326 (Fgnutls_boot): Use const for pointer to readonly storage.
18327 Comment out unused local. Fix pointer signedness problems.
18329 * lread.c (openp): Don't stuff size_t into an 'int'.
18330 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
18331 about possible signed overflow.
18333 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
18334 (GDK_KEY_g): Don't define if already defined.
18335 (xg_prepare_tooltip): Avoid pointer signedness problem.
18336 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
18338 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
18339 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
18341 * xfns.c (Fx_window_property): Simplify a bit,
18342 to make a bit faster and to avoid GCC 4.6.0 warning.
18343 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
18345 * fns.c (internal_equal): Don't assume size_t fits in int.
18347 * alloc.c (compact_small_strings): Tighten assertion a little.
18349 Replace pEd with more-general pI, and fix some printf arg casts.
18350 * lisp.h (pI): New macro, generalizing old pEd macro to other
18351 conversion specifiers. For example, use "...%"pI"d..." rather
18352 than "...%"pEd"...".
18353 (pEd): Remove. All uses replaced with similar uses of pI.
18354 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
18355 * alloc.c (check_pure_size): Don't overflow by converting size to int.
18356 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
18357 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
18358 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
18359 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
18360 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
18362 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
18363 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
18364 * print.c (safe_debug_print, print_object): Likewise.
18365 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
18367 Use pI instead of if-then-else-abort. Use %p to avoid casts,
18368 avoiding the 0 flag, which is not portable.
18369 * process.c (Fmake_network_process): Use pI to avoid cast.
18370 * region-cache.c (pp_cache): Likewise.
18371 * xdisp.c (decode_mode_spec): Likewise.
18372 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
18373 behavior on 64-bit hosts with printf arg.
18374 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
18375 (x_stop_queuing_selection_requests): Likewise.
18376 (x_get_window_property): Don't truncate byte count to an 'int'
18379 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
18380 here, since it parses constructs like leading '-' and spaces,
18381 which are not wanted; and it overflows with large numbers.
18382 Instead, simply match F[0-9]+, which is what is wanted anyway.
18384 * alloc.c: Remove unportable assumptions about struct layout.
18385 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
18386 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
18387 (allocate_vectorlike, make_pure_vector): Use the new macros,
18388 plus offsetof, to remove unportable assumptions about struct layout.
18389 These assumptions hold on all porting targets that I know of, but
18390 they are not guaranteed, they're easy to remove, and removing them
18391 makes further changes easier.
18393 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
18394 This doesn't fix a bug but makes the code clearer.
18395 (string_overrun_cookie): Now const. Use initializers that
18396 don't formally overflow signed char, to avoid warnings.
18397 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
18398 can cause Emacs to crash when string overrun checking is enabled.
18399 (allocate_buffer): Don't assume sizeof (struct buffer) is a
18400 multiple of sizeof (EMACS_INT); it need not be, if
18401 alignof(EMACS_INT) < sizeof (EMACS_INT).
18402 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
18404 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
18406 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
18408 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
18410 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
18411 supposed to be handshaking. (Bug#8556)
18412 Reported by Paul Eggert <eggert@cs.ucla.edu>.
18414 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
18416 * lisp.h (Qdebug): List symbol.
18417 * eval.c (Qdebug): Restore global linkage.
18418 * keyboard.c (debug-on-event): New variable.
18419 (handle_user_signal): Break into debugger when debug-on-event
18420 matches the current signal symbol.
18422 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
18424 * alloc.c (check_sblock, check_string_bytes)
18425 (check_string_free_list): Convert to standard C.
18427 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
18429 * w32.c (emacs_gnutls_push): Fix typo.
18431 2011-04-25 Eli Zaretskii <eliz@gnu.org>
18433 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
18434 "cast to pointer from integer of different size".
18436 Improve doprnt and its use in verror. (Bug#8545)
18437 * doprnt.c (doprnt): Document the set of format control sequences
18438 supported by the function. Use SAFE_ALLOCA instead of always
18441 * eval.c (verror): Don't limit the buffer size at size_max-1, that
18442 is one byte too soon. Don't use xrealloc; instead xfree and
18445 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
18447 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
18450 * gnutls.c: Renamed global_initialized to
18451 gnutls_global_initialized. Added internals for the
18452 :verify-hostname-error, :verify-error, and :verify-flags
18453 parameters of `gnutls-boot' and documented those parameters in the
18454 docstring. Start callback support.
18455 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
18456 unless a fatal error occurred. Call gnutls_alert_send_appropriate
18457 on error. Return error code.
18458 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
18459 (emacs_gnutls_read): Likewise.
18460 (Fgnutls_boot): Return handshake error code.
18461 (emacs_gnutls_handle_error): New function.
18462 (wsaerror_to_errno): Likewise.
18464 * w32.h (emacs_gnutls_pull): Add prototype.
18465 (emacs_gnutls_push): Likewise.
18467 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
18468 (emacs_gnutls_push): Likewise.
18470 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
18472 * process.c (wait_reading_process_output): Check if GnuTLS
18473 buffered some data internally if no FDs are set for TLS
18476 * makefile.w32-in (OBJ2): Add gnutls.$(O).
18477 (LIBS): Link to USER_LIBS.
18478 ($(BLD)/gnutls.$(0)): New target.
18480 2011-04-24 Eli Zaretskii <eliz@gnu.org>
18482 * xdisp.c (handle_single_display_spec): Rename the
18483 display_replaced_before_p argument into display_replaced_p, to
18484 make it consistent with the commentary. Fix typos in the
18487 * textprop.c (syms_of_textprop): Remove dead code.
18488 (copy_text_properties): Delete obsolete commentary about an
18489 interface that was deleted long ago. Fix typos in the description
18492 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
18493 to changes in oldXMenu/XMenu.h from 2011-04-16.
18494 <menu_help_message, prev_menu_help_message>: Constify.
18495 (IT_menu_make_room): menu->help_text is now `const char **';
18498 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
18499 to changes in oldXMenu/XMenu.h from 2011-04-16.
18500 (struct XMenu): Declare `help_text' `const char **'.
18502 * xfaces.c <Qunspecified>: Make extern again.
18504 * syntax.c: Include sys/types.h before including regex.h, as
18507 * doc.c (get_doc_string): Improve the format passed to `error'.
18509 * doprnt.c (doprnt): Improve commentary.
18511 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
18513 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
18516 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
18517 changes in globals.h immediately force recompilation.
18518 (TAGS): Depend on $(CURDIR)/m/intel386.h and
18519 $(CURDIR)/s/ms-w32.h.
18520 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
18522 * character.c (Fchar_direction): Function deleted.
18523 (syms_of_character): Don't defsubr it.
18524 <char-direction-table>: Deleted.
18526 2011-04-23 Eli Zaretskii <eliz@gnu.org>
18528 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
18529 * doprnt.c: Include limits.h.
18530 (SIZE_MAX): New macro.
18531 (doprnt): Return a size_t value. 2nd arg is now size_t.
18532 Many local variables are now size_t instead of int or unsigned.
18533 Improve overflow protection. Support `l' modifier for integer
18534 conversions. Support %l conversion. Don't assume an EMACS_INT
18535 argument for integer conversions and for %c.
18537 * lisp.h (doprnt): Restore prototype.
18539 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
18540 $(SRC)/character.h.
18542 * Makefile.in (base_obj): Add back doprnt.o.
18544 * deps.mk (doprnt.o): Add back prerequisites.
18545 (callint.o): Depend on character.h.
18547 * eval.c (internal_lisp_condition_case): Include the handler
18548 representation in the error message.
18549 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
18550 when breaking from the loop.
18552 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
18554 * callint.c (Fcall_interactively): When displaying error message
18555 about invalid control letter, pass the character's codepoint, not
18556 a pointer to its multibyte form. Improve display of the character
18557 in octal and display also its hex code.
18559 * character.c (char_string): Use %x to display the (unsigned)
18560 codepoint of an invalid character, to avoid displaying a bogus
18563 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
18564 `error', not SYMBOL_NAME itself.
18566 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
18567 character arguments to `error'.
18569 * charset.c (check_iso_charset_parameter): Fix incorrect argument
18570 to `error' in error message about FINAL_CHAR argument. Make sure
18571 FINAL_CHAR is a character, and use %c when it is passed as
18572 argument to `error'.
18574 2011-04-23 Eli Zaretskii <eliz@gnu.org>
18576 * s/ms-w32.h (localtime): Redirect to sys_localtime.
18578 * w32.c: Include <time.h>.
18579 (sys_localtime): New function.
18581 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
18583 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
18585 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
18587 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
18589 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
18590 zombies (Bug#8467).
18592 2011-04-19 Eli Zaretskii <eliz@gnu.org>
18594 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
18595 gl_state.e_property when gl_state.object is Qt.
18597 * insdel.c (make_gap_larger): Remove limitation of buffer size
18600 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
18602 * xdisp.c (lookup_glyphless_char_display)
18603 (produce_glyphless_glyph): Handle cons cell entry in
18604 glyphless-char-display.
18605 (Vglyphless_char_display): Document it.
18607 * term.c (produce_glyphless_glyph): Handle cons cell entry in
18608 glyphless-char-display.
18610 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
18612 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
18614 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
18616 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
18617 definition for no-X builds.
18619 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
18621 Static checks with GCC 4.6.0 and non-default toolkits.
18623 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
18625 * process.c (keyboard_bit_set): Define only if SIGIO.
18626 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
18627 (send_process): Repair possible setjmp clobbering.
18629 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
18631 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
18633 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
18635 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
18636 Define only if needed.
18638 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
18639 by pacifying GCC about it. Maybe it's time to retire it?
18640 * xfaces.c (USG, __TIMEVAL__): Likewise.
18642 * dispextern.h (struct redisplay_interface): Rename param
18643 to avoid shadowing.
18644 * termhooks.h (struct terminal): Likewise.
18645 * xterm.c (xembed_send_message): Likewise.
18647 * insdel.c (make_gap_smaller): Define only if
18648 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
18650 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
18653 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
18654 so that we aren't warned about unused symbols.
18656 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
18658 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
18660 * xfns.c (x_real_positions): Mark locals as initialized.
18662 * xmenu.c (xmenu_show): Don't use uninitialized vars.
18664 * xterm.c: Fix problems found by static analysis with other toolkits.
18665 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
18666 (x_dispatch_event): Declare static if USE_GTK, and
18667 define if USE_GTK || USE_X_TOOLKIT.
18668 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
18669 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
18670 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
18671 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
18673 * xmenu.c (menu_help_callback): Pointer type fixes.
18674 Use const pointers when pointing at readonly data. Avoid pointer
18675 signedness clashes.
18676 (FALSE): Remove unused macro.
18677 (update_frame_menubar): Remove unused decl.
18679 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
18681 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
18682 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
18683 (single_menu_item): Rename local to avoid shadowing.
18685 * keyboard.c (make_lispy_event): Remove unused local var.
18687 * frame.c, frame.h (x_get_resource_string): Bring this back, but
18688 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
18690 * bitmaps: Change bitmaps from unsigned char back to the X11
18691 compatible char. Avoid the old compiler warnings about
18692 out-of-range initializers by using, for example, '\xab' rather
18695 * xgselect.c (xgselect_initialize): Check vs interface
18696 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
18698 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
18700 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
18701 to read-only memory.
18703 * fns.c (vector): Remove; this old hack is no longer needed.
18705 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
18707 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
18709 * xrdb.c (x_load_resources): Omit unused local.
18711 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
18712 (x_window): Rename locals to avoid shadowing.
18713 (USG): Use the kludged USG macro, to pacify gcc.
18715 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
18716 (x_term_init): Remove local to avoid shadowing.
18718 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
18720 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
18721 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
18723 2011-04-16 Eli Zaretskii <eliz@gnu.org>
18725 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
18727 Fix regex.c, syntax.c and friends for buffers > 2GB.
18728 * syntax.h (struct gl_state_s): Declare character position members
18731 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
18733 * textprop.c (verify_interval_modification, interval_of):
18734 Declare arguments EMACS_INT.
18736 * intervals.c (adjust_intervals_for_insertion): Declare arguments
18739 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
18741 * indent.c (Fvertical_motion): Local variable it_start is now
18744 * regex.c (re_match, re_match_2, re_match_2_internal)
18745 (bcmp_translate, regcomp, regexec, print_double_string)
18746 (group_in_compile_stack, re_search, re_search_2, regex_compile)
18747 (re_compile_pattern, re_exec): Declare arguments and local
18748 variables `size_t' and `ssize_t' and return values `regoff_t', as
18750 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
18751 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
18752 <compile_stack_type>: `size' and `avail' are now `size_t'.
18754 * regex.h <regoff_t>: Use ssize_t, not int.
18755 (re_search, re_search_2, re_match, re_match_2): Arguments that
18756 specify buffer/string position and length are now ssize_t and
18757 size_t. Return type is regoff_t.
18759 2011-04-16 Ben Key <bkey76@gmail.com>
18761 * nsfont.m: Fixed bugs in ns_get_family and
18762 ns_descriptor_to_entity that were caused by using free to
18763 deallocate memory blocks that were allocated by xmalloc (via
18764 xstrdup). This caused Emacs to crash when compiled with
18765 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
18766 --enable-checking=xmallocoverrun). xfree is now used to
18767 deallocate these memory blocks.
18769 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
18771 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
18773 emacs_write: Accept and return EMACS_INT for sizes.
18774 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
18776 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
18777 Accept and return EMACS_INT.
18778 (emacs_gnutls_write): Return the number of bytes written on
18780 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
18781 (emacs_read, emacs_write): Remove check for negative size, as the
18782 Emacs source code has been audited now.
18783 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
18784 (emacs_read, emacs_write): Use it.
18785 * process.c (send_process): Adjust to the new signatures of
18786 emacs_write and emacs_gnutls_write. Do not attempt to store
18787 a byte offset into an 'int'; it might overflow.
18788 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
18790 * sound.c: Don't assume sizes fit in 'int'.
18791 (struct sound_device.period_size, alsa_period_size):
18792 Return EMACS_INT, not int.
18793 (struct sound_device.write, vox_write, alsa_write):
18794 Accept EMACS_INT, not int.
18795 (wav_play, au_play): Use EMACS_INT to store sizes and to
18796 record read return values.
18798 2011-04-15 Ben Key <bkey76@gmail.com>
18800 * keyboard.c (Qundefined): Don't declare static since it is used
18802 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
18803 static since they are used in nsfont.m.
18805 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
18807 * process.c (Qprocessp): Don't declare static.
18808 * lisp.h (Qprocessp): Declare again.
18810 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
18812 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
18814 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
18816 Improve C-level modularity by making more things 'static'.
18818 Don't publish debugger-only interfaces to other modules.
18819 * lisp.h (safe_debug_print, debug_output_compilation_hack):
18820 (verify_bytepos, count_markers): Move decls to the only modules
18822 * region-cache.h (pp_cache): Likewise.
18823 * window.h (check_all_windows): Likewise.
18824 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
18826 * sysdep.c (croak): Now static, if
18827 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
18828 * syssignal.h (croak): Declare only if not static.
18830 * alloc.c (refill_memory_reserve): Now static if
18831 !defined REL_ALLOC || defined SYSTEM_MALLOC.
18832 * lisp.h (refill_memory_reserve): Declare only if not static.
18834 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
18835 Define only if USE_LUCID.
18837 * xrdb.c (x_customization_string, x_rm_string): Now static.
18839 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
18840 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
18842 * xdisp.c (draw_row_with_mouse_face): Now static.
18843 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
18845 * window.h (check_all_windows): Mark externally visible.
18847 * window.c (window_deletion_count): Now static.
18849 * undo.c: Make symbols static if they're not exported.
18850 (last_undo_buffer, last_boundary_position, pending_boundary):
18853 * textprop.c (interval_insert_behind_hooks): Now static.
18854 (interval_insert_in_front_hooks): Likewise.
18856 * term.c: Make symbols static if they're not exported.
18857 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
18858 (max_frame_lines, tty_set_terminal_modes):
18859 (tty_reset_terminal_modes, tty_turn_off_highlight):
18860 (get_tty_terminal): Now static.
18861 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
18862 * termhooks.h (term_mouse_moveto): Do not declare if
18863 HAVE_WINDOW_SYSTEM.
18864 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
18865 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
18867 * sysdep.c: Make symbols static if they're not exported.
18868 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
18870 (sigprocmask_set, full_mask): Remove; unused.
18871 (wait_debugging): Mark as visible.
18872 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
18873 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
18875 * syntax.c (syntax_temp): Define only if !__GNUC__.
18877 * sound.c (current_sound_device, current_sound): Now static.
18879 * search.c (searchbufs, searchbuf_head): Now static.
18881 * scroll.c (scroll_cost): Remove; unused.
18882 * dispextern.h (scroll_cost): Remove decl.
18884 * region-cache.h (pp_cache): Mark as externally visible.
18886 * process.c: Make symbols static if they're not exported.
18887 (process_tick, update_tick, create_process, chan_process):
18888 (Vprocess_alist, proc_buffered_char, datagram_access):
18889 (fd_callback_data, send_process_frame, process_sent_to): Now static.
18890 (deactivate_process): Mark defn as static, as well as decl.
18891 * lisp.h (create_process): Remove decl.
18892 * process.h (chan_process, Vprocess_alist): Remove decls.
18894 * print.c: Make symbols static if they're not exported.
18895 (print_depth, new_backquote_output, being_printed, print_buffer):
18896 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
18897 (print_interval, print_number_index, initial_stderr_stream):
18899 * lisp.h (Fprinc): Remove decl.
18900 (debug_output_compilation_hack): Mark as externally visible.
18902 * sysdep.c (croak): Move decl from here to syssignal.h.
18903 * syssignal.h (croak): Put it here, so the API can be checked when
18904 'croak' is called from dissociate_if_controlling_tty.
18906 * minibuf.c: Make symbols static if they're not exported.
18907 (minibuf_save_list, choose_minibuf_frame): Now static.
18908 * lisp.h (choose_minibuf_frame): Remove decl.
18910 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
18912 * lread.c: Make symbols static if they're not exported.
18913 (read_objects, initial_obarray, oblookup_last_bucket_number):
18915 (make_symbol): Remove; unused.
18916 * lisp.h (initial_obarray, make_symbol): Remove decls.
18918 * keyboard.c: Make symbols static if they're not exported.
18919 (single_kboard, recent_keys_index, total_keys, recent_keys):
18920 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
18921 (this_single_command_key_start, echoing, last_auto_save):
18922 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
18923 (command_loop, echo_now, keyboard_init_hook, help_char_p):
18924 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
18925 (Vlispy_mouse_stem, double_click_count):
18927 (force_auto_save_soon): Define only if SIGDANGER.
18928 (ignore_mouse_drag_p): Now static if
18929 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
18930 (print_help): Remove; unused.
18931 (stop_character, last_timer_event): Mark as externally visible.
18932 * keyboard.h (ignore_mouse_drag_p): Declare only if
18933 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
18934 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
18935 * lisp.h (echoing): Remove decl.
18936 (force_auto_save_soon): Declare only if SIGDANGER.
18937 * xdisp.c (redisplay_window): Simplify code, to make it more
18938 obvious that ignore_mouse_drag_p is not accessed if !defined
18939 USE_GTK && !defined HAVE_NS.
18941 * intervals.c: Make symbols static if they're not exported.
18942 (merge_properties_sticky, merge_interval_right, delete_interval):
18944 * intervals.h (merge_interval_right, delete_interval): Remove decls.
18946 * insdel.c: Make symbols static if they're not exported.
18947 However, leave prepare_to_modify_buffer alone. It's never
18948 called from outside this function, but that appears to be a bug.
18949 (combine_after_change_list, combine_after_change_buffer):
18950 (adjust_after_replace, signal_before_change): Now static.
18951 (adjust_after_replace_noundo): Remove; unused.
18952 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
18953 (signal_before_change): Remove decls.
18955 * indent.c (val_compute_motion, val_vmotion): Now static.
18957 * image.c: Make symbols static if they're not exported.
18958 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
18960 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
18961 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
18963 * fringe.c (standard_bitmaps): Now static.
18964 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
18966 * frame.c: Make symbols static if they're not exported.
18967 (x_report_frame_params, make_terminal_frame): Now static.
18968 (get_frame_param): Now static, unless HAVE_NS.
18969 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
18970 (x_get_resource_string): Remove; not used.
18971 * frame.h (make_terminal_frame, x_report_frame_params):
18972 (x_get_resource_string); Remove decls.
18973 (x_fullscreen_adjust): Declare only if WINDOWSNT.
18974 * lisp.h (get_frame_param): Declare only if HAVE_NS.
18976 * font.c, fontset.c: Make symbols static if they're not exported.
18977 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
18978 (FACE_SUITABLE_FOR_CHAR_P): Use it.
18979 * font.c (font_close_object): Now static.
18980 * font.h (font_close_object): Remove.
18981 * fontset.c (FONTSET_OBJLIST): Remove.
18982 (free_realized_fontset) #if-0 the body, which does nothing.
18983 (face_suitable_for_char_p): #if-0, as it's never called.
18984 * fontset.h (face_suitable_for_char_p): Remove decl.
18985 * xfaces.c (face_at_string_position):
18986 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
18987 since 0 is always ASCII.
18989 * fns.c (weak_hash_tables): Now static.
18991 * fileio.c: Make symbols static if they're not exported.
18992 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
18993 (Vwrite_region_annotation_buffers): Now static.
18995 * eval.c: Make symbols static if they're not exported.
18996 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
18997 * lisp.h (backtrace_list): Remove decl.
18999 * emacs.c: Make symbols static if they're not exported.
19000 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
19001 (fatal_error_code, fatal_error_signal_hook, standard_args):
19003 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
19004 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
19005 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
19006 * lisp.h (fatal_error_signal_hook): Remove decl.
19007 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
19009 * editfns.c: Move a (normally-unused) function to its only use.
19010 * editfns.c, lisp.h (get_operating_system_release): Remove.
19011 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
19012 worth the hassle of breaking this out.
19014 * xterm.c: Make symbols static if they're not exported.
19015 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
19016 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
19017 (x_destroy_window, x_delete_display):
19019 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
19020 (x_mouse_leave): Remove; unused.
19021 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
19022 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
19023 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
19025 (x_mouse_leave): Declare only if WINDOWSNT.
19026 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
19027 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
19030 * ftxfont.c: Make symbols static if they're not exported.
19031 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
19033 * font.h (ftxfont_driver): Likewise.
19035 * xfns.c: Make symbols static if they're not exported.
19036 (x_last_font_name, x_display_info_for_name):
19037 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
19038 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
19039 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
19040 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
19041 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
19042 (last_show_tip_args): Now static.
19043 (xic_defaut_fontset, xic_create_fontsetname): Define only if
19044 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
19045 (x_screen_planes): Remove; unused.
19046 * dispextern.h (x_screen_planes): Remove decl.
19048 * dispnew.c: Make symbols static if they're not exported.
19049 * dispextern.h (redraw_garbaged_frames, scrolling):
19050 (increment_row_positions): Remove.
19051 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
19052 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
19054 (redraw_garbaged_frames): Remove; unused.
19056 * xfaces.c: Make symbols static if they're not exported.
19057 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
19059 * xterm.h (defined_color): Remove decls.
19060 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
19061 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
19062 (menu_face_changed_default, defined_color, free_realized_face):
19063 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
19064 (ascii_face_of_lisp_face): Remove; unused.
19066 * xdisp.c: Make symbols static if they're not exported.
19067 * dispextern.h (scratch_glyph_row, window_box_edges):
19068 (glyph_to_pixel_coords, set_cursor_from_row):
19069 (get_next_display_element, set_iterator_to_next):
19070 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
19071 (show_mouse_face): Remove decls
19072 * frame.h (message_buf_print): Likewise.
19073 * lisp.h (pop_message, set_message, check_point_in_composition):
19075 * xterm.h (set_vertical_scroll_bar): Likewise.
19076 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
19077 (message_buf_print, scratch_glyph_row, displayed_buffer):
19078 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
19079 (get_next_display_element, show_mouse_face, window_box_edges):
19080 (frame_to_window_pixel_xy, check_point_in_composition):
19081 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
19082 (glyph_to_pixel_coords): Remove; unused.
19084 * dired.c (file_name_completion): Now static.
19086 * dbusbind.c (xd_in_read_queued_messages): Now static.
19088 * lisp.h (circular_list_error, FOREACH): Remove; unused.
19089 * data.c (circular_list_error): Remove.
19091 * commands.h (last_point_position, last_point_position_buffer):
19092 (last_point_position_window): Remove decls.
19093 * keyboard.c: Make these variables static.
19095 * coding.h (coding, code_convert_region, encode_coding_gap):
19097 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
19098 (iso_code_class, detect_coding, code_convert_region): Now static.
19099 (encode_coding_gap): Remove; unused.
19101 * chartab.c (chartab_chars, chartab_bits): Now static.
19103 * charset.h (charset_iso_8859_1): Remove decl.
19104 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
19107 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
19108 * ccl.c (Vccl_program_table): Now static.
19109 (check_ccl_update): Remove; unused.
19111 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
19112 * category.h: ... from here.
19113 * category.c (check_category_table, set_category_set): Now static.
19115 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
19116 * lisp.h: Remove these decls.
19118 * buffer.c (buffer_count): Remove unused var.
19120 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
19121 so that it's not optimized away.
19122 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
19123 * dispextern.h (bidi_dump_cached_states): Remove, since it's
19124 exported only to the debugger.
19126 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
19127 * atimer.h (run_all_atimers): Remove; not exported.
19129 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
19130 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
19131 was inaccessible from Lisp.
19132 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
19133 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
19135 alloc.c: Import and export fewer symbols, and remove unused items.
19136 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
19138 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
19139 it's not optimized away by whole-program optimization.
19140 (message_enable_multibyte, free_misc): Remove.
19141 (catchlist, handlerlist, mark_backtrace):
19142 Declare only if BYTE_MARK_STACK.
19143 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
19144 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
19145 (message_enable_multibyte): Remove decl.
19146 (free_misc, interval_free_list, float_block, float_block_index):
19147 (n_float_blocks, float_free_list, cons_block, cons_block_index):
19148 (cons_free_list, last_marked_index):
19150 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
19151 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
19152 (mark_backtrace): Define only if BYTE_MARK_STACK.
19153 * xdisp.c (message_enable_multibyte): Now static.
19155 Declare Lisp_Object Q* variables to be 'static' if not exported.
19156 This makes it easier for human readers (and static analyzers)
19157 to see whether these variables are used from other modules.
19158 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
19159 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
19160 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
19161 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
19162 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
19163 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
19164 * xmenu.c, xselect.c:
19165 Declare Q* vars static if they are not used in other modules.
19166 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
19167 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
19168 Remove decls of unexported vars.
19169 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
19171 * lisp.h (DEFINE_FUNC): Make sname 'static'.
19173 Make Emacs functions such as Fatom 'static' by default.
19174 This makes it easier for human readers (and static analyzers)
19175 to see whether these functions can be called from other modules.
19176 DEFUN now defines a static function. To make the function external
19177 so that it can be used in other C modules, use the new macro DEFUE.
19178 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
19179 (Finit_image_library):
19180 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
19181 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
19182 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
19183 Remove decls, since these functions are now static.
19184 (Funintern, Fget_internal_run_time): New decls, since these functions
19185 were already external.
19187 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
19188 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
19189 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
19190 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
19191 * keyboard.c, keymap.c, lread.c:
19192 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
19193 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
19194 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
19195 Mark functions with DEFUE instead of DEFUN,
19196 if they are used in other modules.
19197 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
19198 decls for now-static functions.
19199 * buffer.h (Fdelete_overlay): Remove decl.
19200 * callproc.c (Fgetenv_internal): Mark as internal.
19201 * composite.c (Fremove_list_of_text_properties): Remove decl.
19202 (Fcomposition_get_gstring): New forward static decl.
19203 * composite.h (Fcomposite_get_gstring): Remove decl.
19204 * dired.c (Ffile_attributes): New forward static decl.
19205 * doc.c (Fdocumntation_property): New forward static decl.
19206 * eval.c (Ffetch_bytecode): New forward static decl.
19207 (Funintern): Remove extern decl; now in .h file where it belongs.
19208 * fileio.c (Fmake_symbolic_link): New forward static decl.
19209 * image.c (Finit_image_library): New forward static decl.
19210 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
19211 * intervals.h (Fprevious_property_change):
19212 (Fremove_list_of_text_properties): Remove decls.
19213 * keyboard.c (Fthis_command_keys): Remove decl.
19214 (Fcommand_execute): New forward static decl.
19215 * keymap.c (Flookup_key): New forward static decl.
19216 (Fcopy_keymap): Now static.
19217 * keymap.h (Flookup_key): Remove decl.
19218 * process.c (Fget_process): New forward static decl.
19219 (Fprocess_datagram_address): Mark as internal.
19220 * syntax.c (Fsyntax_table_p): New forward static decl.
19221 (skip_chars): Remove duplicate decl.
19222 * textprop.c (Fprevious_property_change): New forward static decl.
19223 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
19225 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
19226 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
19228 * editfns.c (Fformat): Remove unreachable code.
19230 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
19232 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
19235 2011-04-13 Eli Zaretskii <eliz@gnu.org>
19237 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
19238 when at ZV. (Bug#8487)
19240 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
19242 * charset.c (Fclear_charset_maps): Use xfree instead of free.
19244 * keyboard.c (parse_tool_bar_item): Likewise.
19245 * sound.c (sound_cleanup, alsa_close): Likewise.
19246 * termcap.c (tgetent): Likewise.
19247 * xfns.c (x_default_font_parameter): Likewise.
19248 * xsettings.c (read_and_apply_settings): Likewise.
19250 * alloc.c (overrun_check_malloc, overrun_check_realloc)
19251 (overrun_check_free): Protoize.
19253 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
19255 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
19256 since callers should never pass a negative size.
19257 Change the signature to match that of plain 'read' and 'write'; see
19258 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
19259 * lisp.h: Update prototypes of emacs_write and emacs_read.
19261 2011-04-11 Eli Zaretskii <eliz@gnu.org>
19263 * xdisp.c (redisplay_window): Don't try to determine the character
19264 position of the scroll margin if the window start point w->startp
19265 is outside the buffer's accessible region. (Bug#8468)
19267 2011-04-10 Eli Zaretskii <eliz@gnu.org>
19269 Fix write-region and its subroutines for buffers > 2GB.
19270 * fileio.c (a_write, e_write): Modify declaration of arguments and
19271 local variables to support buffers larger than 2GB.
19272 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
19274 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
19275 argument, local variables, and return value.
19277 * lisp.h: Update prototypes of emacs_write and emacs_read.
19279 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
19281 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
19283 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
19285 Fix more problems found by GCC 4.6.0's static checks.
19287 * xdisp.c (vmessage): Use a better test for character truncation.
19289 * charset.c (load_charset_map): <, not <=, for optimization,
19290 and to avoid potential problems with integer overflow.
19291 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
19292 * casetab.c (set_identity, shuffle): Likewise.
19293 * editfns.c (Fformat): Likewise.
19294 * syntax.c (skip_chars): Likewise.
19296 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
19297 This also lets GCC 4.6.0 generate slightly better loop code.
19299 * callint.c (Fcall_interactively): <, not <=, for optimization.
19300 (Fcall_interactively): Count the number of arguments produced,
19301 not the number of arguments given. This is simpler and lets GCC
19302 4.6.0 generate slightly better code.
19304 * ftfont.c: Distingish more carefully between FcChar8 and char.
19305 The previous code passed unsigned char * to a functions like
19306 strlen and xstrcasecmp that expect char *, which does not
19307 conform to the C standard.
19308 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
19309 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
19310 char * when the C standard requires it.
19312 * keyboard.c (read_char): Remove unused var.
19314 * eval.c: Port to Windows vsnprintf (Bug#8435).
19315 Include <limits.h>.
19316 (SIZE_MAX): Define if the headers do not.
19317 (verror): Do not give up if vsnprintf returns a negative count.
19318 Instead, grow the buffer. This ports to Windows vsnprintf, which
19319 does not conform to C99. Problem reported by Eli Zaretskii.
19320 Also, simplify the allocation scheme, by avoiding the need for
19321 calling realloc, and removing the ALLOCATED variable.
19323 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
19325 Remove invocations of doprnt, as Emacs now uses vsnprintf.
19326 But keep the doprint source code for now, as we might revamp it
19327 and use it again (Bug#8435).
19328 * lisp.h (doprnt): Remove.
19329 * Makefile.in (base_obj): Remove doprnt.o.
19330 * deps.mk (doprnt.o): Remove.
19332 error: Print 32- and 64-bit integers portably (Bug#8435).
19333 Without this change, on typical 64-bit hosts error ("...%d...", N)
19334 was used to print both 32- and 64-bit integers N, which relied on
19335 undefined behavior.
19336 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
19337 * lisp.h (error, verror): Mark as printf-like functions.
19338 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
19339 Report overflow in size calculations when allocating printf buffer.
19340 Do not truncate output string at its first null byte.
19341 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
19342 Truncate the output at a character boundary, since vsnprintf does not
19344 * charset.c (check_iso_charset_parameter): Convert internal
19345 character to string before calling 'error', since %c now has the
19347 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
19348 overflow when computing char to be passed to 'error'. Do not
19349 pass Lisp_Object to 'error'; pass the integer instead.
19350 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
19351 formatted with plain %d.
19353 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
19355 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
19357 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
19359 * xterm.c (x_catch_errors): Remove duplicate declaration.
19361 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
19363 * xdisp.c, lisp.h (message_nolog): Remove; unused.
19365 2011-04-10 Jim Meyering <meyering@redhat.com>
19367 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
19368 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
19369 return ssize_t not "int", and use size_t as the buffer length.
19370 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
19371 * gnutls.h: Update declarations.
19372 * process.c (read_process_output): Use ssize_t, to match.
19373 (send_process): Likewise.
19375 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
19377 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
19379 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
19381 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
19382 Use unsigned char, to match FcChar8 type definition.
19384 * xterm.c (handle_one_xevent):
19385 * xmenu.c (create_and_show_popup_menu):
19386 * xselect.c (x_decline_selection_request)
19387 (x_reply_selection_request): Avoid type-punned deref of X events.
19389 2011-04-09 Eli Zaretskii <eliz@gnu.org>
19391 Fix some uses of `int' instead of EMACS_INT.
19392 * search.c (string_match_1, fast_string_match)
19393 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
19394 (scan_buffer, find_next_newline_no_quit)
19395 (find_before_next_newline, search_command, Freplace_match)
19396 (Fmatch_data): Make some `int' variables be EMACS_INT.
19398 * xdisp.c (display_count_lines): 3rd argument and return value now
19399 EMACS_INT. All callers changed.
19400 (pint2hrstr): Last argument is now EMACS_INT.
19402 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
19403 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
19404 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
19405 (decode_coding_utf_16, decode_coding_emacs_mule)
19406 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
19407 (decode_coding_ccl, decode_coding_charset)
19408 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
19409 (decode_coding_iso_2022, decode_coding_emacs_mule)
19410 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
19411 <char_offset, last_offset>: Declare EMACS_INT.
19412 (encode_coding_utf_8, encode_coding_utf_16)
19413 (encode_coding_emacs_mule, encode_invocation_designation)
19414 (encode_designation_at_bol, encode_coding_iso_2022)
19415 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
19416 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
19418 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
19419 (encode_invocation_designation): Last argument P_NCHARS is now
19421 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
19422 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
19424 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
19427 * ccl.c (Fccl_execute_on_string): Declare some variables
19430 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
19432 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
19434 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
19436 * process.c (Fformat_network_address): Doc fix.
19438 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
19440 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
19442 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
19444 * keyboard.c (read_char): Call Lisp function help-form-show,
19445 instead of using internal_with_output_to_temp_buffer.
19446 (Qhelp_form_show): New var.
19447 (syms_of_keyboard): Use DEFSYM macro.
19449 * print.c (internal_with_output_to_temp_buffer): Function deleted.
19451 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
19453 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
19455 * process.c (Flist_processes): Remove to Lisp.
19456 (list_processes_1): Delete.
19458 2011-04-06 Eli Zaretskii <eliz@gnu.org>
19460 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
19462 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
19464 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
19466 Fix more problems found by GCC 4.6.0's static checks.
19468 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
19470 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
19472 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
19474 * xdisp.c (vmessage): Mark as a printf-like function.
19476 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
19478 * sound.c (sound_warning): Don't crash if arg contains a printf format.
19480 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
19481 printf-like functions.
19482 (tiff_load): Add casts to remove these marks before passing them
19483 to system-supplied API.
19485 * eval.c (Fsignal): Remove excess argument to 'fatal'.
19487 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
19488 This avoids several warnings with gcc -Wstrict-overflow.
19489 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
19490 directly, rather than having caller test rule sign. This avoids
19491 some unnecessary tests.
19492 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
19493 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
19494 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
19496 * xfont.c (xfont_text_extents): Remove var that was set but not used.
19497 (xfont_open): Avoid unnecessary tests.
19499 * composite.c (composition_gstring_put_cache): Use unsigned integer.
19501 * composite.h, composite.c (composition_gstring_put_cache):
19502 Use EMACS_INT, not int, for length.
19504 * composite.h (COMPOSITION_DECODE_REFS): New macro,
19505 breaking out part of COMPOSITION_DECODE_RULE.
19506 (COMPOSITION_DECODE_RULE): Use it.
19507 * composite.c (get_composition_id): Remove unused local vars,
19508 by using the new macro.
19510 * textprop.c (set_text_properties_1): Change while to do-while,
19511 since the condition is always true at first.
19513 * intervals.c (graft_intervals_into_buffer): Mark var as used.
19514 (interval_deletion_adjustment): Return unsigned value.
19517 * process.c (list_processes_1, create_pty, read_process_output):
19518 (exec_sentinel): Remove vars that were set but not used.
19519 (create_pty): Remove unnecessary "volatile"s.
19520 (Fnetwork_interface_info): Avoid possibility of int overflow.
19521 (read_process_output): Do adaptive read buffering even if carryover.
19522 (read_process_output): Simplify nbytes computation if buffered.
19524 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
19526 * syntax.c (scan_words): Remove var that was set but not used.
19527 (update_syntax_table): Use unsigned instead of int.
19529 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
19530 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
19531 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
19533 * print.c (print_error_message): Avoid int overflow.
19535 * font.c (font_list_entities): Redo for clarity,
19536 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
19538 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
19539 (font_score): Avoid potential overflow in diff calculation.
19541 * fns.c (substring_both): Remove var that is set but not used.
19542 (sxhash): Redo loop for clarity and to avoid wraparound warning.
19544 * eval.c (funcall_lambda): Rename local to avoid shadowing.
19546 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
19547 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
19548 can always succeed if overflow has undefined behavior.
19550 * search.c (boyer_moore, wordify): Remove vars set but not used.
19551 (wordify): Omit three unnecessary tests.
19553 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
19554 All callers changed. This avoids the need for an unused var.
19556 * casefiddle.c (casify_region): Remove var that is set but not used.
19558 * dired.c (file_name_completion): Remove var that is set but not used.
19560 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
19562 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
19563 (Finsert_file_contents): Remove unnecessary code checking fd.
19565 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
19566 Check for integer overflow on size calculations.
19568 * buffer.c (Fprevious_overlay_change): Remove var that is set
19571 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
19572 Remove vars that are set but not used.
19573 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
19574 (timer_check_2): Mark vars as initialized.
19576 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
19578 * image.c (lookup_image): Remove var that is set but not used.
19579 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
19581 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
19582 that are set but not used.
19584 * xfns.c (make_invisible_cursor): Don't return garbage
19585 if XCreateBitmapFromData fails (Bug#8410).
19587 * xselect.c (x_get_local_selection, x_handle_property_notify):
19588 Remove vars that are set but not used.
19590 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
19591 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
19593 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
19594 Remove var that is set but not used.
19595 (scroll_bar_windows_size): Now size_t, not int.
19596 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
19597 Check for overflow.
19599 * xfaces.c (realize_named_face): Remove vars that are set but not used.
19600 (map_tty_color) [!defined MSDOS]: Likewise.
19602 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
19604 * coding.c: Remove vars that are set but not used.
19605 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
19606 All callers changed.
19607 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
19608 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
19609 (decode_coding_charset): Remove vars that are set but not used.
19611 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
19612 that is set but not used.
19614 * print.c (print_object): Remove var that is set but not used.
19616 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
19617 The gnulib version avoids calling malloc in the usual case,
19618 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
19619 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
19620 * filelock.c (current_lock_owner): Likewise.
19621 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
19622 * sysdep.c: Include allocator.h, careadlinkat.h.
19623 (emacs_no_realloc_allocator): New static constant.
19624 (emacs_readlink): New function.
19625 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
19626 ../lib/careadlinkat.h.
19628 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
19630 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
19631 first non-nil return value).
19633 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
19635 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
19636 if not defined (Bug#8403).
19638 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
19640 * xdisp.c (display_count_lines): Remove parameter `start',
19641 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
19642 (get_char_face_and_encoding): Remove parameter `multibyte_p',
19643 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
19644 (fill_stretch_glyph_string): Remove parameters `row' and `area',
19645 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
19646 and thereabouts. All callers changed.
19647 (get_per_char_metric): Remove parameter `f', unused since
19648 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
19650 2011-04-02 Jim Meyering <meyering@redhat.com>
19652 do not dereference NULL upon failed strdup
19653 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
19654 (ns_get_family): Likewise.
19656 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
19658 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
19660 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
19662 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
19665 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
19667 Add lexical binding.
19669 * window.c (Ftemp_output_buffer_show): New fun.
19670 (Fsave_window_excursion):
19671 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
19673 * lread.c (lisp_file_lexically_bound_p): New function.
19674 (Fload): Bind Qlexical_binding.
19675 (readevalloop): Remove `evalfun' arg.
19676 Bind Qinternal_interpreter_environment.
19677 (Feval_buffer): Bind Qlexical_binding.
19678 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
19680 (syms_of_lread): Declare `lexical-binding'.
19682 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
19684 * keyboard.c (eval_dyn): New fun.
19685 (menu_item_eval_property): Use it.
19687 * image.c (parse_image_spec): Use Ffunctionp.
19689 * fns.c (concat, mapcar1): Accept byte-code-functions.
19691 * eval.c (Fsetq): Handle lexical vars.
19692 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
19693 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
19694 (FletX, Flet): Obey lexical binding.
19695 (Fcommandp): Handle closures.
19696 (Feval): New `lexical' arg.
19697 (eval_sub): New function extracted from Feval. Use it almost
19698 everywhere where Feval was used. Look up vars in lexical env.
19700 (Ffunctionp): Move from subr.el.
19701 (Ffuncall): Handle closures.
19702 (apply_lambda): Remove `eval_flags'.
19703 (funcall_lambda): Handle closures and new byte-code-functions.
19704 (Fspecial_variable_p): New function.
19705 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
19706 but without exporting it to Lisp.
19708 * doc.c (Fdocumentation, store_function_docstring):
19709 * data.c (Finteractive_form): Handle closures.
19711 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
19714 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
19716 (exec_byte_code): New function extracted from Fbyte_code to handle new
19717 calling convention for byte-code-functions. Add new byte-codes.
19719 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
19721 * alloc.c (Fmake_symbol): Init new `declared_special' field.
19723 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
19725 * xdisp.c (redisplay_internal): Fix prototype.
19727 2011-03-31 Eli Zaretskii <eliz@gnu.org>
19729 * xdisp.c (SCROLL_LIMIT): New macro.
19730 (try_scrolling): Use it when setting scroll_limit.
19731 Limit scrolling to 100 screen lines.
19732 (redisplay_window): Even when falling back on "recentering",
19733 position point in the window according to scroll-conservatively,
19734 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
19736 (try_scrolling): When point is above the window, allow searching
19737 as far as scroll_max, or one screenful, to compute vertical
19738 distance from PT to the scroll margin position. This prevents
19739 try_scrolling from unnecessarily failing when
19740 scroll-conservatively is set to a value slightly larger than the
19741 window height. Clean up the case of PT below the margin at bottom
19742 of window: scroll_max can no longer be INT_MAX. When aggressive
19743 scrolling is in use, don't let point enter the opposite scroll
19744 margin as result of the scroll.
19745 (syms_of_xdisp) <scroll-conservatively>: Document the
19746 threshold of 100 lines for never-recentering scrolling.
19748 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
19750 * dispextern.h (move_it_by_lines):
19751 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
19752 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
19753 (message_log_check_duplicate): Remove parameters `prev_bol' and
19754 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
19755 (redisplay_internal): Remove parameter `preserve_echo_area',
19756 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
19758 * indent.c (Fvertical_motion):
19759 * window.c (window_scroll_pixel_based, Frecenter):
19760 Don't pass `need_y_p' to `move_it_by_lines'.
19762 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
19764 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
19765 steal a few bits to be more compact.
19766 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
19767 Remove unneeded casts.
19769 * bytecode.c (Fbyte_code): CAR and CDR can GC.
19771 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
19773 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
19774 binding" message (bug#7967).
19776 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
19778 Fix more problems found by GCC 4.6.0's static checks.
19780 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
19781 Remove unused local var.
19783 * editfns.c (Fmessage_box): Remove unused local var.
19785 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
19786 (note_mode_line_or_margin_highlight, note_mouse_highlight):
19787 Omit unused local vars.
19788 * window.c (shrink_windows): Omit unused local var.
19789 * menu.c (digest_single_submenu): Omit unused local var.
19790 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
19791 Omit unused local var.
19793 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
19794 Don't assume string length fits in int.
19795 (keyremap_step, read_key_sequence): Use size_t for sizes.
19796 (read_key_sequence): Don't check last_real_key_start redundantly.
19798 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
19799 instead of alloca (Bug#8344).
19801 * eval.c (Fbacktrace): Don't assume nargs fits in int.
19802 (Fbacktrace_frame): Don't assume nframes fits in int.
19804 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
19806 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
19809 * term.c (produce_glyphless_glyph): Remove unnecessary test.
19811 * cm.c (calccost): Turn while-do into do-while, for clarity.
19813 * keyboard.c (syms_of_keyboard): Use the same style as later
19814 in this function when indexing through an array. This also
19815 works around GCC bug 48267.
19817 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
19819 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
19821 * chartab.c (sub_char_table_ref_and_range): Redo for slight
19822 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
19824 * keyboard.c, keyboard.h (num_input_events): Now size_t.
19825 This avoids undefined behavior on integer overflow, and is a bit
19826 more convenient anyway since it is compared to a size_t variable.
19828 Variadic C functions now count arguments with size_t, not int.
19829 This avoids an unnecessary limitation on 64-bit machines, which
19830 caused (substring ...) to crash on large vectors (Bug#8344).
19831 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
19832 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
19833 All variadic functions and their callers changed accordingly.
19834 (struct gcpro.nvars): Now size_t, not int. All uses changed.
19835 * data.c (arith_driver, float_arith_driver): Likewise.
19836 * editfns.c (general_insert_function): Likewise.
19837 * eval.c (struct backtrace.nargs, interactive_p)
19838 (internal_condition_case_n, run_hook_with_args, apply_lambda)
19839 (funcall_lambda, mark_backtrace): Likewise.
19840 * fns.c (concat): Likewise.
19841 * frame.c (x_set_frame_parameters): Likewise.
19842 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
19843 0 if not found, not -1. All callers changed.
19845 * alloc.c (garbage_collect): Don't assume stack size fits in int.
19846 (stack_copy_size): Now size_t, not int.
19847 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
19849 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
19851 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
19852 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
19853 All callers changed.
19855 * lisp.h (multibyte_char_to_unibyte):
19856 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
19857 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
19858 * character.h (CHAR_TO_BYTE8):
19859 * cmds.c (internal_self_insert):
19860 * editfns.c (general_insert_function):
19861 * keymap.c (push_key_description):
19862 * search.c (Freplace_match):
19863 * xdisp.c (message_dolog, set_message_1): All callers changed.
19865 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
19867 * keyboard.c (safe_run_hook_funcall): New function.
19868 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
19869 don't set the hook to nil, but remove the offending function instead.
19870 (Qcommand_hook_internal): Remove, unused.
19871 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
19872 Vcommand_hook_internal.
19874 * eval.c (enum run_hooks_condition): Remove.
19875 (funcall_nil, funcall_not): New functions.
19876 (run_hook_with_args): Call each function through a `funcall' argument.
19877 Remove `cond' argument, now redundant.
19878 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
19879 (Frun_hook_with_args_until_failure): Adjust accordingly.
19880 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
19882 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
19884 * dispextern.h (string_buffer_position): Remove declaration.
19886 * print.c (strout): Remove parameter `multibyte', unused since
19887 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
19889 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
19890 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
19891 All callers changed.
19893 * w32.c (_wsa_errlist): Use braces for struct initializers.
19895 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
19896 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
19897 All callers changed.
19898 (string_buffer_position): Likewise. Also, make static (it's never
19899 used outside xdisp.c).
19900 (cursor_row_p): Remove parameter `w', unused since
19901 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
19902 (decode_mode_spec): Remove parameter `precision', introduced during
19903 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
19904 All callers changed.
19906 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
19908 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
19910 2011-03-27 Anders Lindgren <andlind@gmail.com>
19912 * nsterm.m (ns_menu_bar_is_hidden): New variable.
19913 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
19914 (ns_update_auto_hide_menu_bar): New functions.
19915 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
19916 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
19917 ns_constrain_all_frames.
19918 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
19919 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
19921 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
19923 * nsmenu.m (runDialogAt): Remove argument to timer_check.
19925 2011-03-27 Glenn Morris <rgm@gnu.org>
19927 * syssignal.h: Replace RETSIGTYPE with void.
19928 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
19929 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
19930 Replace SIGTYPE with void everywhere.
19931 * s/usg5-4-common.h (SIGTYPE): Remove definition.
19932 * s/template.h (SIGTYPE): Remove commented out definition.
19934 2011-03-26 Eli Zaretskii <eliz@gnu.org>
19936 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
19937 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
19939 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
19941 * w32.c (read_unc_volume): Use parameter `henum', instead of
19942 global variable `wget_enum_handle'.
19944 * keymap.c (describe_vector): Remove parameters `indices' and
19945 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
19946 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
19948 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
19950 * keyboard.c (timer_check): Remove parameter `do_it_now',
19951 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
19952 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
19953 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
19955 * keyboard.c (read_char):
19956 * w32menu.c (w32_menu_display_help):
19957 * xmenu.c (show_help_event, menu_help_callback):
19958 Adjust calls to `show_help_echo'.
19960 * gtkutil.c (xg_maybe_add_timer):
19961 * keyboard.c (readable_events):
19962 * process.c (wait_reading_process_output):
19963 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
19965 * insdel.c (adjust_markers_gap_motion):
19966 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
19967 (gap_left, gap_right): Don't call it.
19969 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
19971 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
19972 incurred during fontification.
19974 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
19976 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
19977 (DEFVAR_PER_BUFFER): Don't pass it.
19979 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
19980 (scrolling_window): Don't pass it.
19982 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
19984 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
19986 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
19988 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
19989 of variables specific to SELinux and computation of `encoded_absname'.
19991 * image.c (XPutPixel): Remove unused variable `height'.
19993 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
19995 * unexw32.c (get_section_info): Remove unused variable `section'.
19997 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
19998 (system_process_attributes): Remove unused variable `sess'.
19999 (sys_read): Remove unused variable `err'.
20001 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
20002 (w32_wnd_proc): Remove unused variable `isdead'.
20003 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
20004 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
20005 (x_create_tip_frame): Remove unused variable `tem'.
20007 * w32inevt.c (w32_console_read_socket):
20008 Remove unused variable `no_events'.
20010 * w32term.c (x_draw_composite_glyph_string_foreground):
20011 Remove unused variable `width'.
20013 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
20015 * w32term.c (x_set_glyph_string_clipping):
20016 Don't pass uninitialized region to CombineRgn.
20018 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
20020 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
20021 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
20022 (Fx_close_connection): Remove unused variable `i'.
20024 * w32font.c (w32font_draw): Return number of glyphs.
20025 (w32font_open_internal): Remove unused variable `i'.
20026 (w32font_driver): Add missing initializer.
20028 * w32menu.c (utf8to16): Remove unused variable `utf16'.
20029 (fill_in_menu): Remove unused variable `items_added'.
20031 * w32term.c (last_mouse_press_frame): Remove static global variable.
20032 (w32_clip_to_row): Remove unused variable `f'.
20033 (x_delete_terminal): Remove unused variable `i'.
20035 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
20036 (NOTHING): Remove unused static global variable.
20037 (uniscribe_check_otf): Remove unused variable `table'.
20038 (uniscribe_font_driver): Add missing initializers.
20040 2011-03-23 Julien Danjou <julien@danjou.info>
20042 * term.c (Fsuspend_tty, Fresume_tty):
20043 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
20044 * window.c (temp_output_buffer_show):
20045 * insdel.c (signal_before_change):
20046 * frame.c (Fhandle_switch_frame):
20047 * fileio.c (Fdo_auto_save):
20048 * emacs.c (Fkill_emacs):
20049 * editfns.c (save_excursion_restore):
20050 * cmds.c (internal_self_insert):
20051 * callint.c (Fcall_interactively):
20052 * buffer.c (Fkill_all_local_variables):
20053 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
20055 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
20056 unconditionally since it does the check itself.
20058 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
20060 Fix more problems found by GCC 4.5.2's static checks.
20062 * coding.c (encode_coding_raw_text): Avoid unnecessary test
20063 the first time through the loop, since we know p0 < p1 then.
20064 This also avoids a gcc -Wstrict-overflow warning.
20066 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
20067 leading to a memory leak, possible in functions like
20068 load_charset_map_from_file that can allocate an unbounded number
20069 of objects (Bug#8318).
20071 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
20072 that could (at least in theory) be that large.
20074 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
20075 This is less likely to overflow, and avoids undefined behavior if
20076 overflow does occur. All callers changed. Use strtoul to scan
20077 for the unsigned long integer.
20078 (pint2hrstr): Simplify and tune code slightly.
20079 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
20081 * scroll.c (do_scrolling): Work around GCC bug 48228.
20082 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
20084 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
20085 This also avoids a warning with gcc -Wstrict-overflow.
20086 (validate_x_resource_name): Simplify count usage.
20087 This also avoids a warning with gcc -Wstrict-overflow.
20089 * fileio.c (Fcopy_file): Report error if fchown or fchmod
20092 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
20094 * process.c (Fmake_network_process): Use socklen_t, not int,
20095 where POSIX says socklen_t is required in portable programs.
20096 This fixes a porting bug on hosts like 64-bit HP-UX, where
20097 socklen_t is wider than int (Bug#8277).
20098 (Fmake_network_process, server_accept_connection):
20099 (wait_reading_process_output, read_process_output):
20102 * process.c: Rename or move locals to avoid shadowing.
20103 (list_processes_1, Fmake_network_process):
20104 (read_process_output_error_handler, exec_sentinel_error_handler):
20105 Rename or move locals.
20106 (Fmake_network_process): Define label "retry_connect" only if needed.
20107 (Fnetwork_interface_info): Fix pointer signedness.
20108 (process_send_signal): Add cast to avoid pointer signedness problem.
20109 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
20110 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
20112 Make tparam.h and terminfo.c consistent.
20113 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
20114 Include tparam.h instead, since it declares them.
20115 * cm.h (PC): Remove extern decl; tparam.h now does this.
20116 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
20117 * terminfo.c: Include tparam.h, to check interfaces.
20118 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
20119 (tparam): Adjust signature to match interface in tparam.h;
20120 this removes some undefined behavior. Check that outstring and len
20121 are zero, which they always are with Emacs.
20122 * tparam.h (PC, BC, UP): New extern decls.
20124 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
20125 (xftfont_open): Rename locals to avoid shadowing.
20127 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
20128 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
20129 (OTF_TAG_SYM): Omit macro if not needed.
20130 (ftfont_list): Remove unused local.
20131 (get_adstyle_property, ftfont_pattern_entity):
20132 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
20133 Rename locals to avoid shadowing.
20135 * xfont.c (xfont_list_family): Mark var as initialized.
20137 * xml.c (make_dom): Now static.
20139 * composite.c (composition_compute_stop_pos): Rename local to
20141 (composition_reseat_it): Remove unused locals.
20142 (find_automatic_composition, composition_adjust_point): Likewise.
20143 (composition_update_it): Mark var as initialized.
20144 (find_automatic_composition): Mark vars as initialized,
20145 with a FIXME (Bug#8290).
20147 character.h: Rename locals to avoid shadowing.
20148 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
20149 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
20150 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
20151 (BUF_DEC_POS): Be more systematic about renaming local temporaries
20152 to avoid shadowing.
20154 * textprop.c (property_change_between_p): Remove; unused.
20156 * intervals.c (interval_start_pos): Now static.
20158 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
20160 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
20161 Rename locals to avoid shadowing.
20163 * sound.c (wav_play, au_play, Fplay_sound_internal):
20164 Fix pointer signedness.
20165 (alsa_choose_format): Remove unused local var.
20166 (wav_play): Initialize a variable to 0, to prevent undefined
20167 behavior (Bug#8278).
20169 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
20171 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
20173 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
20174 clobbering (Bug#8298).
20175 * sysdep.c (sys_subshell): Likewise.
20176 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
20178 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
20179 This should get cleaned up, so that child_setup has the
20180 same signature on all platforms.
20182 * callproc.c (call_process_cleanup): Now static.
20183 (relocate_fd): Rename locals to avoid shadowing.
20185 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
20187 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
20188 not to be necessary, and produces flickering.
20190 2011-03-20 Glenn Morris <rgm@gnu.org>
20192 * config.in: Remove file.
20194 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
20196 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
20197 are now in src/globals.h.
20198 (syms_of_minibuf): Remove spurious & from previous change.
20200 2011-03-20 Leo Liu <sdl.web@gmail.com>
20202 * minibuf.c (completing-read-function): New variable.
20203 (completing-read-default): Rename from completing-read.
20204 (completing-read): Call completing-read-function.
20206 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
20208 * xfaces.c (Fx_load_color_file):
20209 Read color file from absolute filename (bug#8250).
20211 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
20213 * makefile.w32-in: Update dependencies.
20215 2011-03-17 Eli Zaretskii <eliz@gnu.org>
20217 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
20219 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
20221 Fix more problems found by GCC 4.5.2's static checks.
20223 * process.c (make_serial_process_unwind, send_process_trap):
20224 (sigchld_handler): Now static.
20226 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
20227 That way, the code declares only the vars that it needs.
20228 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
20229 * s/cygwin.h (PTY_ITERATION): Likewise.
20230 * s/darwin.h (PTY_ITERATION): Likewise.
20231 * s/gnu-linux.h (PTY_ITERATION): Likewise.
20233 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
20234 * process.c (allocate_pty): Don't declare stb unless it's needed.
20236 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
20237 (CONSTANTLIM): Remove; unused.
20238 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
20239 Define only if needed.
20241 * unexelf.c (unexec): Name an expression,
20242 to avoid gcc -Wbad-function-cast warning.
20243 Use a different way to cause a compilation error if anyone uses
20244 n rather than nn, a way that does not involve shadowing.
20245 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
20247 * deps.mk (unexalpha.o): Remove; unused.
20249 New file unexec.h, the (simple) interface for unexec (Bug#8267).
20250 * unexec.h: New file.
20251 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
20252 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
20253 Depend on unexec.h.
20254 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
20255 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
20256 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
20257 Change as necessary to match prototype in unexec.h.
20259 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
20261 (back_comment, skip_chars): Mark vars as initialized.
20263 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
20264 Rename locals to avoid shadowing.
20266 * lread.c (read1): Rewrite so as not to use empty "else".
20267 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
20269 * print.c (Fredirect_debugging_output): Fix pointer signedess.
20271 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
20272 warning when compiling print.c.
20274 * font.c (font_unparse_fcname): Abort in an "impossible" situation
20275 instead of using an uninitialized var.
20276 (font_sort_entities): Mark var as initialized.
20278 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
20280 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
20281 pointers to constants.
20282 (font_parse_fcname): Remove unused vars.
20283 (font_delete_unmatched): Now static.
20284 (font_get_spec): Remove; unused.
20285 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
20286 (font_update_drivers, Ffont_get_glyphs, font_add_log):
20287 Rename or move locals to avoid shadowing.
20289 * fns.c (require_nesting_list, require_unwind): Now static.
20290 (Ffillarray): Rename locals to avoid shadowing.
20292 * floatfns.c (domain_error2): Define only if needed.
20293 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
20295 * alloc.c (mark_backtrace): Move decl from here ...
20296 * lisp.h: ... to here, so that it can be checked.
20298 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
20299 (Fdefvar): Rewrite so as not to use empty "else".
20300 (lisp_indirect_variable): Name an expression,
20301 to avoid gcc -Wbad-function-cast warning.
20302 (Fdefvar): Rename locals to avoid shadowing.
20304 * callint.c (quotify_arg, quotify_args): Now static.
20305 (Fcall_interactively): Rename locals to avoid shadowing.
20306 Use const pointer when appropriate.
20308 * lisp.h (get_system_name, get_operating_system_release):
20309 Move decls here, to check interfaces.
20310 * process.c (get_operating_system_release): Move decl to lisp.h.
20311 * xrdb.c (get_system_name): Likewise.
20312 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
20313 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
20314 some of which prompt warnings from gcc -Wbad-function-cast.
20315 (Fformat_time_string, Fencode_time, Finsert_char):
20316 (Ftranslate_region_internal, Fformat):
20317 Rename or remove local vars to avoid shadowing.
20318 (Ftranslate_region_internal): Mark var as initialized.
20320 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
20323 * lisp.h (eassert): Check that the argument compiles, even if
20324 ENABLE_CHECKING is not defined.
20326 * data.c (Findirect_variable): Name an expression, to avoid
20327 gcc -Wbad-function-cast warning.
20328 (default_value, arithcompare, arith_driver, arith_error): Now static.
20329 (store_symval_forwarding): Rename local to avoid shadowing.
20330 (Fmake_variable_buffer_local, Fmake_local_variable):
20331 Mark variables as initialized.
20332 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
20334 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
20335 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
20336 Rename locals to avoid shadowing.
20337 (mark_stack): Move local variables into the #ifdef region where
20339 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
20340 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
20342 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
20343 (GC_STRING_CHARS): Remove; not used.
20344 (Fmemory_limit): Cast sbrk's returned value to char *.
20346 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
20347 avoids undefined behavior in theory.
20349 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
20351 Use functions, not macros, for up- and down-casing (Bug#8254).
20352 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
20353 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
20354 to use the following functions instead of these macros.
20355 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
20356 EMACS_INT, since callers assume the returned value fits in int.
20357 (upcase1): Likewise, for UPCASE_TABLE.
20358 (uppercasep, lowercasep, upcase): New static inline functions.
20359 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
20360 the race-condition problem in the old DOWNCASE.
20362 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
20363 Rename locals to avoid shadowing.
20364 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
20365 (regex_compile, re_search_2, re_match_2_internal):
20366 Remove unused local vars.
20367 (FREE_VAR): Rewrite so as not to use empty "else",
20368 which gcc can warn about.
20369 (regex_compile, re_match_2_internal): Mark locals as initialized.
20370 (RETALLOC_IF): Define only if needed.
20371 (WORDCHAR_P): Likewise. This one is never needed, but is used
20372 only in a comment talking about a compiler bug, so put inside
20373 the #if 0 of that comment.
20374 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
20375 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
20378 * search.c (boyer_moore): Rename locals to avoid shadowing.
20379 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
20380 (PREV_CHAR_BOUNDARY): Likewise.
20382 * search.c (simple_search): Remove unused var.
20384 * dired.c (compile_pattern): Move decl from here ...
20385 * lisp.h: ... to here, so that it can be checked.
20386 (struct re_registers): New forward decl.
20388 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
20390 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
20392 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
20393 Rename locals to avoid shadowing.
20394 (Fvertical_motion): Mark locals as initialized.
20396 * casefiddle.c (casify_object, casify_region): Now static.
20397 (casify_region): Mark local as initialized.
20399 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
20401 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
20402 New macros, so that the caller can use some names other than
20403 gcpro1, gcpro2, etc.
20404 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
20406 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
20407 argument, for consistency with GCPRO2_VAR, etc: it is now the
20408 prefix of the variable, not the variable itself. All uses
20410 * dired.c (directory_files_internal, file_name_completion):
20411 Rename locals to avoid shadowing.
20413 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
20414 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
20415 dired.c's scmp function, had undefined behavior.
20416 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
20417 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
20418 * buffer.h: ... to here, because these macros use current_buffer,
20419 and the new implementation with inline functions needs to have
20420 current_buffer in scope now, rather than later when the macros
20422 (downcase, upcase1): New static inline functions.
20423 (DOWNCASE, UPCASE1): Reimplement using these functions.
20424 This avoids undefined behavior in expressions like
20425 DOWNCASE (x) == DOWNCASE (y), which previously suffered
20426 from race conditions in accessing the global variables
20427 case_temp1 and case_temp2.
20428 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
20429 * lisp.h (case_temp1, case_temp2): Remove their decls.
20430 * character.h (ASCII_CHAR_P): Move from here ...
20431 * lisp.h: ... to here, so that the inline functions mentioned
20432 above can use them.
20434 * dired.c (directory_files_internal_unwind): Now static.
20436 * fileio.c (file_name_as_directory, directory_file_name):
20437 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
20439 (file_name_as_directory): Use const pointers when appropriate.
20440 (Fexpand_file_name): Likewise. In particular, newdir might
20441 point at constant storage, so make it a const pointer.
20442 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
20443 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
20445 (Fset_file_times, Finsert_file_contents, auto_save_error):
20446 Rename locals to avoid shadowing.
20448 * minibuf.c (choose_minibuf_frame_1): Now static.
20449 (Ftry_completion, Fall_completions): Rename or remove locals
20450 to avoid shadowing.
20452 * marker.c (bytepos_to_charpos): Remove; unused.
20454 * lisp.h (verify_bytepos, count_markers): New decls,
20455 so that gcc does not warn that these functions aren't declared.
20457 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
20458 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
20459 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
20460 (copy_text): Remove unused local var.
20462 * filelock.c (within_one_second): Now static.
20463 (lock_file_1): Rename local to avoid shadowing.
20465 * buffer.c (fix_overlays_before): Mark locals as initialized.
20466 (fix_start_end_in_overlays): Likewise. This function should be
20467 simplified by using pointers-to-pointers, but that's a different
20469 (switch_to_buffer_1): Now static.
20470 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
20471 (report_overlay_modification): Rename locals to avoid shadowing.
20473 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
20474 Fix pointer signedness issue.
20475 (sys_subshell): Mark local as volatile if checking for lint,
20476 to suppress a gcc -Wclobbered warning that does not seem to be right.
20477 (MAXPATHLEN): Define only if needed.
20479 * process.c (serial_open, serial_configure): Move decls from here ...
20480 * systty.h: ... to here, so that they can be checked.
20482 * fns.c (get_random, seed_random): Move extern decls from here ...
20483 * lisp.h: ... to here, so that they can be checked.
20485 * sysdep.c (reset_io): Now static.
20486 (wait_for_termination_signal): Remove; unused.
20488 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
20489 (copy_keymap_item, append_key, push_text_char_description):
20491 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
20492 (DENSE_TABLE_SIZE): Remove; unused.
20493 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
20494 (describe_map_tree):
20495 Rename locals to avoid shadowing.
20497 * keyboard.c: Declare functions static if they are not used elsewhere.
20498 (echo_char, echo_dash, cmd_error, top_level_2):
20499 (poll_for_input, handle_async_input): Now static.
20500 (read_char, kbd_buffer_get_event, make_lispy_position):
20501 (make_lispy_event, make_lispy_movement, apply_modifiers):
20502 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
20503 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
20504 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
20505 (read_key_sequence, read_char): Mark locals as initialized.
20506 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
20508 * keyboard.h (make_ctrl_char): New decl.
20509 (mark_kboards): Move decl here ...
20510 * alloc.c (mark_kboards): ... from here.
20512 * lisp.h (force_auto_save_soon): New decl.
20514 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
20515 (DEFINE_DUMMY_FUNCTION): New macro.
20516 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
20518 (main): Add casts to avoid warnings
20519 if GCC considers string literals to be constants.
20521 * lisp.h (fatal_error_signal): Add decl, since it's exported.
20523 * dbusbind.c: Pointer signedness fixes.
20524 (xd_signature, xd_append_arg, xd_initialize):
20525 (Fdbus_call_method, Fdbus_call_method_asynchronously):
20526 (Fdbus_method_return_internal, Fdbus_method_error_internal):
20527 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
20528 (Fdbus_register_signal): Use SSDATA when the context wants char *.
20530 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
20531 if GCC considers string literals to be constants.
20532 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
20534 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
20536 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
20537 (print_preprocess, print_object): New macro to fix last change.
20539 * print.c (print_preprocess): Don't forget font objects.
20541 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
20543 * emacs.c (USAGE3): Doc fixes.
20545 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
20547 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
20550 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
20552 * lisp.h (VWindow_system, Qfile_name_history):
20553 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
20554 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
20555 (w32_system_caret_x, w32_system_caret_y): Declare extern.
20557 * w32select.c: Don't #include "keyboard.h".
20558 (run_protected): Add extern declaration for waiting_for_input.
20560 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
20561 * w32console.c (detect_input_pending, read_input_pending)
20562 (encode_terminal_code):
20563 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
20564 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
20565 (w32_system_caret_y, Qfile_name_history):
20566 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
20567 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
20568 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
20569 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
20570 * w32proc.c (Qlocal, report_file_error):
20571 * w32term.c (Vwindow_system, updating_frame):
20572 * w32uniscribe.c (initialized, uniscribe_font_driver):
20573 Remove unneeded extern declarations.
20575 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
20577 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
20579 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
20581 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
20582 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
20583 These macros can no longer be used for assignment.
20585 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
20586 Assign struct members directly, instead of using BUF_BEGV etc.
20587 (record_buffer_markers, fetch_buffer_markers): New functions for
20588 recording and fetching special buffer markers.
20589 (set_buffer_internal_1, set_buffer_temp): Use them.
20591 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
20593 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
20595 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
20596 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
20598 * xdisp.c (hscroll_window_tree):
20599 (reconsider_clip_changes): Use PT instead of BUF_PT.
20601 2011-03-13 Eli Zaretskii <eliz@gnu.org>
20603 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
20604 $(EMACS_ROOT)/lib/intprops.h.
20606 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
20608 Fix more problems found by GCC 4.5.2's static checks.
20610 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
20611 to unsigned char * to avoid compiler diagnostic.
20612 (xg_free_frame_widgets): Make it clear that a local variable is
20613 needed only if USE_GTK_TOOLTIP.
20614 (gdk_window_get_screen): Make it clear that this macro is needed
20615 only if USE_GTK_TOOLTIP.
20616 (int_gtk_range_get_value): New function, which avoids a diagnostic
20617 from gcc -Wbad-function-cast.
20618 (xg_set_toolkit_scroll_bar_thumb): Use it.
20619 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
20620 diagnostic from gcc -Wbad-function-cast.
20621 (get_utf8_string, xg_get_file_with_chooser):
20622 Rename locals to avoid shadowing.
20623 (create_dialog): Move locals to avoid shadowing.
20625 * xgselect.c (xg_select): Remove unused var.
20627 * image.c (four_corners_best): Mark locals as initialized.
20628 (gif_load): Initialize transparent_p to zero (Bug#8238).
20629 Mark another local as initialized.
20630 (my_png_error, my_error_exit): Mark with NO_RETURN.
20632 * image.c (clear_image_cache): Now static.
20633 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
20634 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
20635 (x_edge_detection): Remove unnecessary cast that
20636 gcc -Wbad-function-cast diagnoses.
20637 (gif_load): Fix pointer signedness.
20638 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
20639 (jpeg_load, gif_load): Rename locals to avoid shadowing.
20641 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
20643 Improve quality of tests for time stamp overflow.
20644 For example, without this patch (encode-time 0 0 0 1 1
20645 1152921504606846976) returns the obviously-bogus value (-948597
20646 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
20647 reports time overflow. See
20648 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
20649 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
20650 * editfns.c: Include limits.h and intprops.h.
20651 (TIME_T_MIN, TIME_T_MAX): New macros.
20652 (time_overflow): Move earlier, to before first use.
20653 (hi_time, lo_time): New functions, for an accurate test for
20654 out-of-range times.
20655 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
20656 (Fget_internal_run_time): Don't assume time_t fits in int.
20657 (make_time): Use list2 instead of Fcons twice.
20658 (Fdecode_time): More accurate test for out-of-range times.
20659 (check_tm_member): New function.
20660 (Fencode_time): Use it, to test for out-of-range times.
20661 (lisp_time_argument): Don't rely on undefined left-shift and
20662 right-shift behavior when checking for time stamp overflow.
20664 * editfns.c (time_overflow): New function, refactoring common code.
20665 (Fformat_time_string, Fdecode_time, Fencode_time):
20666 (Fcurrent_time_string): Use it.
20668 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
20669 * dired.c (make_time): Move to ...
20670 * editfns.c (make_time): ... here.
20671 * systime.h: Note the move.
20673 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20675 * fringe.c (update_window_fringes): Remove unused variables.
20677 * unexmacosx.c (copy_data_segment): Also copy __got section.
20680 2011-03-12 Eli Zaretskii <eliz@gnu.org>
20682 * termcap.c [MSDOS]: Include "msdos.h".
20683 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
20684 Constify `char *' arguments and their references according to
20685 prototypes in tparam.h.
20687 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
20689 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
20690 Adapt all references accordingly.
20692 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
20694 2011-03-11 Tom Tromey <tromey@redhat.com>
20696 * buffer.c (syms_of_buffer): Remove obsolete comment.
20698 2011-03-11 Eli Zaretskii <eliz@gnu.org>
20700 * termhooks.h (encode_terminal_code): Declare prototype.
20702 * msdos.c (encode_terminal_code): Don't declare prototype.
20704 * term.c (encode_terminal_code): Now external again, used by
20705 w32console.c and msdos.c.
20707 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
20708 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
20710 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
20712 Fix some minor problems found by GCC 4.5.2's static checks.
20714 * fringe.c (update_window_fringes): Mark locals as initialized
20716 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
20718 * alloc.c (mark_fringe_data): Move decl from here ...
20719 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
20720 to check its interface.
20721 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
20723 * fontset.c (free_realized_fontset): Now static.
20724 (Fset_fontset_font): Rename local to avoid shadowing.
20725 (fontset_font): Mark local as initialized.
20726 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
20728 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
20730 * xselect.c (x_disown_buffer_selections): Remove; not used.
20731 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
20732 (x_own_selection, Fx_disown_selection_internal): Rename locals
20733 to avoid shadowing.
20734 (x_handle_dnd_message): Remove local to avoid shadowing.
20736 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
20737 so that the caller can use some name other than gcpro1.
20738 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
20739 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
20740 (Fx_backspace_delete_keys_p):
20741 Use them to avoid shadowing, and rename vars to avoid shadowing.
20742 (x_decode_color, x_set_name, x_window): Now static.
20743 (Fx_create_frame): Add braces to silence GCC warning.
20744 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
20745 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
20746 Remove unused locals.
20747 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
20748 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
20749 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
20752 * xterm.h (x_mouse_leave): New decl.
20754 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
20755 Remove unused functions.
20756 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
20757 (x_calc_absolute_position): Now static.
20758 (XTread_socket): Don't define label "out" unless it's used.
20759 Don't declare local "event" unless it's used.
20760 (x_iconify_frame, x_free_frame_resources): Don't declare locals
20761 unless they are used.
20762 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
20763 (x_fatal_error_signal): Remove; not used.
20764 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
20765 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
20766 (x_error_catcher, x_connection_closed, x_error_handler):
20767 (x_error_quitter, xembed_send_message, x_iconify_frame):
20768 (my_log_handler): Rename locals to avoid shadowing.
20769 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
20770 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
20772 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
20773 Rename or move locals to avoid shadowing.
20774 (tty_defined_color, merge_face_heights): Now static.
20775 (free_realized_faces_for_fontset): Remove; not used.
20776 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
20777 does not deduce is never used uninitialized.
20778 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
20779 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
20781 * terminal.c (store_terminal_param): Now static.
20783 * xmenu.c (menu_highlight_callback): Now static.
20784 (set_frame_menubar): Remove unused local.
20785 (xmenu_show): Rename parameter to avoid shadowing.
20786 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
20787 since they might point to immutable storage.
20788 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
20789 since it's unused otherwise.
20791 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
20792 Add a FIXME, since the code still doesn't look right. (Bug#8215)
20793 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
20794 avoids a gcc -Wuninitialized diagnostic.
20795 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
20796 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
20797 does not deduce are never used uninitialized.
20799 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
20801 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
20802 * window.c (window_loop, size_window):
20803 (run_window_configuration_change_hook, enlarge_window): Likewise.
20805 * window.c (display_buffer): Now static.
20806 (size_window): Mark variables that gcc -Wuninitialized
20807 does not deduce are never used uninitialized.
20808 * window.h (check_all_windows): New decl, to forestall
20809 gcc -Wmissing-prototypes diagnostic.
20810 * dispextern.h (bidi_dump_cached_states): Likewise.
20812 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
20814 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
20815 Include <limits.h>.
20816 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
20817 and to avoid gcc -Wuninitialized warning.
20818 (load_charset_map): Mark variables that gcc -Wuninitialized
20819 does not deduce are never used uninitialized.
20820 (load_charset): Abort instead of using uninitialized var (Bug#8229).
20822 * coding.c (coding_set_source, coding_set_destination):
20823 Use "else { /* comment */ }" rather than "else /* comment */;"
20824 for clarity, and to avoid gcc -Wempty-body warning.
20825 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
20826 a block, when the outer 'i' will do.
20827 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
20828 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
20829 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
20830 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
20831 (Fdecode_sjis_char, Fdefine_coding_system_internal):
20832 Rename locals to avoid shadowing.
20833 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
20834 * coding.c (emacs_mule_char, encode_invocation_designation):
20835 Now static, since they're not used elsewhere.
20836 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
20837 (decode_coding_object, encode_coding_object, detect_coding_system):
20838 (decode_coding_emacs_mule): Mark variables that gcc
20839 -Wuninitialized does not deduce are never used uninitialized.
20840 (detect_coding_iso_2022): Initialize a local variable that might
20841 be used uninitialized. Leave a FIXME because it's not clear that
20842 this initialization is needed. (Bug#8211)
20843 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
20844 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
20845 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
20846 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
20847 Remove unused macros.
20849 * category.c (hash_get_category_set): Remove unused local var.
20850 (copy_category_table): Now static, since it's not used elsewhere.
20851 * character.c (string_count_byte8): Likewise.
20853 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
20854 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
20856 * chartab.c (copy_sub_char_table): Now static, since it's not used
20858 (sub_char_table_ref_and_range, char_table_ref_and_range):
20859 Rename locals to avoid shadowing.
20860 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
20862 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
20863 (BIDI_BOB): Remove unused macro.
20865 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
20866 deduce are never used uninitialized.
20867 * term.c (encode_terminal_code): Likewise.
20869 * term.c (encode_terminal_code): Now static. Remove unused local.
20871 * tparam.h: New file.
20872 * term.c, tparam.h: Include it.
20873 * deps.mk (term.o, tparam.o): Depend on tparam.h.
20874 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
20875 Move these decls to tparam.h, and make them agree with what
20876 is actually in tparam.c. The previous trick of using incompatible
20877 decls in different modules does not conform to the C standard.
20878 All callers of tparam changed to use tparam's actual API.
20879 * tparam.c (tparam1, tparam, tgoto):
20880 Use const pointers where appropriate.
20882 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
20883 * cm.h (struct cm): Likewise.
20884 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
20885 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
20886 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
20887 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
20888 (turn_on_face, init_tty): Likewise.
20889 * termchar.h (struct tty_display_info): Likewise.
20891 * term.c (term_mouse_position): Rename local to avoid shadowing.
20893 * alloc.c (mark_ttys): Move decl from here ...
20894 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
20896 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
20898 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
20900 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
20902 * search.c (compile_pattern_1): Remove argument regp, unused since
20903 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
20904 (compile_pattern): Don't pass it.
20906 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
20908 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
20909 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
20911 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
20913 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
20915 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
20916 gdk_window_get_screen, gdk_window_get_geometry,
20917 gdk_x11_window_lookup_for_display and GDK_KEY_g.
20918 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
20919 (xg_get_pixbuf_from_pixmap): New function.
20920 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
20921 to Pixmap, take frame as parameter, remove GdkColormap parameter.
20922 Call xg_get_pixbuf_from_pixmap instead of
20923 gdk_pixbuf_get_from_drawable.
20924 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
20925 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
20926 (xg_check_special_colors): Use GtkStyleContext and its functions
20928 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
20929 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
20930 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
20931 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
20932 Call gtk_widget_get_preferred_size.
20933 (xg_frame_resized): gdk_window_get_geometry only takes 5
20935 (xg_win_to_widget, xg_event_is_for_menubar):
20936 Call gdk_x11_window_lookup_for_display.
20937 (xg_set_widget_bg): New function.
20938 (delete_cb): New function.
20939 (xg_create_frame_widgets): Connect delete-event to delete_cb.
20940 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
20941 (xg_set_background_color): Call xg_set_widget_bg.
20942 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
20943 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
20944 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
20945 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
20947 (update_frame_tool_bar): Call gtk_widget_hide.
20948 (xg_initialize): Use GDK_KEY_g.
20950 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
20952 (x_session_initialize): Call gdk_x11_set_sm_client_id.
20954 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
20955 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
20956 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
20958 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
20960 * w32xfns.c (select_palette): Check success of RealizePalette against
20961 GDI_ERROR, not zero.
20963 See ChangeLog.11 for earlier changes.
20965 ;; Local Variables:
20969 Copyright (C) 2011-2012 Free Software Foundation, Inc.
20971 This file is part of GNU Emacs.
20973 GNU Emacs is free software: you can redistribute it and/or modify
20974 it under the terms of the GNU General Public License as published by
20975 the Free Software Foundation, either version 3 of the License, or
20976 (at your option) any later version.
20978 GNU Emacs is distributed in the hope that it will be useful,
20979 but WITHOUT ANY WARRANTY; without even the implied warranty of
20980 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20981 GNU General Public License for more details.
20983 You should have received a copy of the GNU General Public License
20984 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.