ChangeLog 816 KB
Newer Older
1 2 3 4 5 6
2012-12-12  Daniel Colascione  <dancol@dancol.org>

	* unexcw.c (fixup_executable): use posix_fallocate to ensure that
	the dumped Emacs is not a sparse file, greatly improving Cygwin
	"make bootstrap" performance.

7 8 9 10 11
2012-12-11  Michael Albinus  <michael.albinus@gmx.de>

	* inotify.c (inotify_callback): Generate an Emacs event for every
	incoming inotify event.

12 13 14 15 16 17 18 19 20 21 22 23 24
2012-12-11  Eli Zaretskii  <eliz@gnu.org>

	* xdisp.c (handle_face_prop): Fix logic of computing
	it->start_of_box_run_p.
	(append_space_for_newline): If the glyph row is R2L, reset the
	iterator's end_of_box_run_p flag before prepending the space glyph.
	(extend_face_to_end_of_line): If the glyph row is R2L, reset the
	iterator's start_of_box_run_p flag before prepending the stretch.
	(append_glyph, produce_image_glyph, append_composite_glyph)
	(append_stretch_glyph, append_glyphless_glyph): Reverse the
	left_box_line_p and right_box_line_p flags of the glyph for R2L
	glyph rows.  (Bug#13011)

25 26 27 28 29 30 31 32 33 34
2012-12-11  Dmitry Antipov  <dmantipov@yandex.ru>

	* buffer.c (Fset_buffer_multibyte): Do not force redisplay
	if changed buffer is not shown in a window.
	* insdel.c (prepare_to_modify_buffer): Likewise.
	* window.c (replace_buffer_in_windows_safely): Do nothing
	if buffer is not shown in a window.
	(Fforce_window_update): Likewise if string or buffer argument
	is passed.

35 36 37 38 39
2012-12-11  Eli Zaretskii  <eliz@gnu.org>

	* inotify.c (Finotify_add_watch): Rename decoded_file_name to
	encoded_file_name, which is what it is.

40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
2012-12-11  Dmitry Antipov  <dmantipov@yandex.ru>

	Consistently use marker_position and marker_byte_position.
	* fringe.c (Ffringe_bitmaps_at_pos):
	* indent.c (Fvertical_motion):
	* insdel.c (prepare_to_modify_buffer):
	* keyboard.c (make_lispy_position):
	* window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
	(window_scroll_pixel_based, displayed_window_lines)
	(Fset_window_configuration):
	* xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
	(mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
	Replace direct access to marker fields with calls
	to marker_position and/or marker_byte_position.

55 56 57 58 59 60
2012-12-11  Juanma Barranquero  <lekktu@gmail.com>

	* makefile.w32-in (SIG2STR_H): New macro.
	(SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
	($(BLD)/w32notify.$(O)): Update dependencies.

61 62
2012-12-10  Daniel Colascione  <dancol@dancol.org>

Daniel Colascione's avatar
Daniel Colascione committed
63 64 65
	* w32term.c, keyboard.c: Fix build break in cygw32 by omitting
	Windows file notification functionality unless WINDOWSNT.

66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
	* w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
	declarations.

	* w32fns.c (cache_system_info): Initialize the global hinst
	variable here so various initialization calls DTRT.

	* unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused
	variables.
	(hinst): Remove unneeded extern declaration.
	(_start): Remove initialization of above variables; remove
	initialization of hinst, as cache_system_info now does that.

	* emacs.c (main): Call cache_system_info early in startup; we
	previously weren't calling it in Cygwin builds.

	* Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK): Teach
	the autoconf build system how to compile a Windows resource file
	and link it to Emacs.

Dmitry Antipov's avatar
Dmitry Antipov committed
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
2012-12-10  Dmitry Antipov  <dmantipov@yandex.ru>

	Per-buffer window counters.
	* buffer.h (struct buffer): New member window_count.
	(buffer_window_count): New function.
	* buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
	Initialize window_count.
	(Fkill_buffer): Verify window_count for the buffer being killed.
	(modify_overlay): Do not force redisplay if buffer is not shown
	in any window.
	(init_buffer_once): Initialize window_count for buffer_defaults
	and buffer_local_symbols.
	* window.h (buffer_shared): Remove declaration.
	(wset_buffer): Convert from inline ...
	* window.c (wset_buffer): ... to an ordinary function.
	(adjust_window_count): New function.
	(make_parent_window): Use it.
	* xdisp.c (buffer_shared): Remove.
	(redisplay_internal, redisplay_window): Adjust users.
	(buffer_shared_and_changed): Use per-buffer window counter.

106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
2012-12-10  Eli Zaretskii  <eliz@gnu.org>

	Support for filesystem notifications on MS-Windows.
	* w32proc.c (sys_select): If drain_message_queue returns non-zero,
	and this is a TTY frame, signal the caller that keyboard input is
	available.

	* w32xfns.c (drain_message_queue): Now returns an int: an
	indication whether any WM_EMACS_FILENOTIFY messages were found in
	the queue.

	* w32inevt.c (handle_file_notifications): New function.
	(w32_console_read_socket): Call it to process file notifications.

	* w32console.c (initialize_w32_display): Record the main thread ID
	in dwMainThreadId.

	* deps.mk (inotify.o): New dependency list.

	* Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.

	* w32term.h (WM_EMACS_FILENOTIFY): New custom message.
	(WM_EMACS_END): Bump value by 1.
	(notification_buffer_in_use, file_notifications)
	(notifications_size, notifications_desc): Declare.
	(w32_get_watch_object, lispy_file_action, globals_of_w32notify):
	Add prototypes.

	* w32term.c (lispy_file_action, queue_notifications): New functions.
	(syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
	<Qrenamed_to>: New symbols.
	(w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.

	* w32notify.c: New file, implements file event notifications for
	MS-Windows.

	* w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
	by posting it to the w32_read_socket queue.

	* termhooks.h (enum event_kind) [HAVE_NTGUI]: Support
	FILE_NOTIFY_EVENT.

	* makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
	(GLOBAL_SOURCES): Add w32notify.c
	($(BLD)/w32notify.$(O)): New set of dependencies.

	* lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.

	* keyboard.c (kbd_buffer_get_event) [WINDOWSNT]: Handle
	FILE_NOTIFY_EVENT.
	(syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
	(keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
	w32notify-handle-event by default.

	* emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
	syms_of_w32notify.

163 164
2012-12-10  Rüdiger Sonderfeld  <ruediger@c-plusplus.de>

165
	Support for filesystem notifications on GNU/Linux via inotify.
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184
	* termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add
	FILE_NOTIFY_EVENT.

	* lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.

	* keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
	(syms_of_keyboard): DEFSYM it.
	(kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
	(make_lispy_event): Support FILE_NOTIFY_EVENT by generating
	Qfile_inotify events.
	(keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
	special-event-map to inotify-handle-event.

	* emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.

	* Makefile.in (base_obj): Add inotify.o.

	* inotify.c: New file.

185
2012-12-10  Jan Djärv  <jan.h.d@swipnet.se>
186 187 188

	* nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).

189
2012-12-10  Fabrice Popineau  <fabrice.popineau@gmail.com>
190 191 192 193

	* w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
	DWORD_PTR, for compatibility with 64-bit builds.

194
	* w32.c (_PROCESS_MEMORY_COUNTERS_EX):
195 196 197 198
	(GetProcessWorkingSetSize_Proc, get_process_working_set_size)
	(system_process_attributes): Use SIZE_T rather than DWORD, for
	compatibility with 64-bit builds.

199
2012-12-10  Christopher Schmidt  <christopher@ch.ristopher.com>
200 201 202

	* lread.c (Vload_source_file_function): Doc fix (Bug#11647).

203
2012-12-10  Eli Zaretskii  <eliz@gnu.org>
204 205 206 207 208

	* indent.c (Fvertical_motion): If a display string will be
	displayed on the left or the right margin, don't consider it as a
	factor in cursor positioning.  (Bug#13108)

209
2012-12-10  Martin Rudalics  <rudalics@gmx.at>
210 211 212

	* editfns.c (Fcompare_buffer_substrings): Reword doc-string.

213 214 215 216 217
2012-12-10  Paul Eggert  <eggert@cs.ucla.edu>

	* fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
	for string length.

218 219 220 221
2012-12-08  Eli Zaretskii  <eliz@gnu.org>

	* w32.c (unsetenv): Return 0 if the input string is too long.

222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247
2012-12-08  Paul Eggert  <eggert@cs.ucla.edu>

	Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
	* alloc.c (xputenv): New function.
	* dbusbind.c (Fdbus_init_bus):
	* emacs.c (main):
	* xterm.c (x_term_init):
	Use xputenv instead of setenv or putenv, to detect memory exhaustion.
	* editfns.c (initial_tz): Move static var decl up.
	(tzvalbuf_in_environ): New static var.
	(init_editfns):	Initialize these two static vars.
	(Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
	Save old TZ value on stack, if it's small.
	(Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
	instead, use xputenv+unsetenv to set and restore TZ.
	(environbuf): Remove static var.  All uses removed.
	(Fset_time_zone_rule): Do not save TZ and environ;
	no longer needed here.
	(set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
	Move to inside set_time_zone_rule; they don't need file scope any more.
	(set_time_zone_rule): Maintain the TZ=value string separately.
	(syms_of_editfns): Don't initialize initial_tz;
	init_editfns now does it.
	* emacs.c (dump_tz) [HAVE_TZSET]: Now const.
	* lisp.h (xputenv): New decl.

248 249 250 251
2012-12-08  Fabrice Popineau  <fabrice.popineau@gmail.com>

	* w32fns.c (emacs_abort): Don't do arithmetics on void pointers.

252 253 254 255
2012-12-08  Eli Zaretskii  <eliz@gnu.org>

	* w32.c (unsetenv, sys_putenv): New functions.

256 257 258 259 260
2012-12-08  Chong Yidong  <cyd@gnu.org>

	* editfns.c (Finsert_char): Make the error message more
	informative (Bug#12992).

261 262
2012-12-08  Paul Eggert  <eggert@cs.ucla.edu>

Paul Eggert's avatar
Paul Eggert committed
263 264 265 266 267
	Simplify get_lim_data.
	* vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
	Remove USG and vlimit methods; no longer used these days.
	Add #error catchall just in case.

268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288
	Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
	Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
	SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
	* process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
	(deleted_pid_list, Fdelete_process, create_process)
	(record_child_status_change, handle_child_signal, deliver_child_signal)
	(init_process_emacs, syms_of_process):
	Assume SIGCHLD is defined.
	(parse_signal): Remove.  All uses removed.
	(abbr_to_signal): New static function.
	(Fsignal_process): Use it to convert signal names to ints.
	* sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
	kill (getpgrp (), ...).
	(emacs_sigaction_init): Assume SIGCHLD is defined.
	(init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
	SIGPIPE, and SIGQUIT are defined.  Do not worry about SIGCLD any more.
	* syssignal.h (EMACS_KILLPG): Remove.
	All uses replaced by 'kill' with a negative pid.
	(SIGCHLD): Remove definition, as we now assume SIGCHLD.
	* w32proc.c (sys_kill): Support negative pids compatibly with POSIX.

289 290 291 292 293 294
2012-12-07  Paul Eggert  <eggert@cs.ucla.edu>

	* sysdep.c (get_child_status): Abort on internal error (Bug#13086).
	This will cause a production Emacs to dump core instead of
	infinite-looping.

295 296 297 298 299 300 301 302
2012-12-07  Dmitry Antipov  <dmantipov@yandex.ru>

	* frame.c (make_frame): Do not set window's buffer to t.
	* window.c (Fsplit_window_internal): Likewise.  Previously it was
	used to indicate that the window is being set up.  Now we use
	set_window_buffer for all new windows, so the condition in ...
	(Fset_window_buffer): ... is always true and can be removed.

303 304 305 306 307 308 309 310
2012-12-07  Dmitry Antipov  <dmantipov@yandex.ru>

	Convenient macro to check whether the buffer is hidden.
	* buffer.h (BUFFER_HIDDEN_P): New macro.
	* frame.c (make_frame): Use it.  Adjust comment.
	* buffer.c (candidate_buffer): New function.
	(Fother_buffer, other_buffer_safely): Use it.

311 312 313 314 315 316
2012-12-06  Eli Zaretskii  <eliz@gnu.org>

	* w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
	if the child process is still running.  Instead, exit the wait
	loop and return zero.  (Bug#13086)

317 318 319 320 321 322 323 324 325 326 327 328 329
2012-12-06  Dmitry Antipov  <dmantipov@yandex.ru>

	* frame.h (x_char_width, x_char_height): Remove prototypes.
	* w32term.h (x_char_width, x_char_height): Likewise.
	* xfns.c (x_char_width, x_char_height): Remove.
	* w32fns.c (x_char_width, x_char_height): Likewise.
	* nsfns.c (x_char_width, x_char_height): Likewise.
	* frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
	all window frames.
	(Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
	* keyboard.c (command_loop_1): Remove prototype.
	(command_loop_2, top_level_1): Add static to match prototype.

330 331 332 333 334 335 336 337 338 339
2012-12-06  Paul Eggert  <eggert@cs.ucla.edu>

	Fix a recently-introduced delete-process race condition.
	* callproc.c, process.h (record_kill_process):
	New function, containing part of the old call_process_kill.
	(call_process_kill): Use it.
	This does not change call_process_kill's behavior.
	* process.c (Fdelete_process): Use record_kill_process to fix a
	race condition that could cause Emacs to lose track of a child.

340 341 342 343 344 345
2012-12-06  Dmitry Antipov  <dmantipov@yandex.ru>

	Avoid code duplication between prev_frame and next_frame.
	* frame.c (candidate_frame): New function.  Add comment.
	(prev_frame, next_frame): Use it.  Adjust comment.

346
2012-12-06  Eli Zaretskii  <eliz@gnu.org>
347 348 349 350

	* callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
	fails, signal an error instead of continuing with an empty
	string.  (Bug#13079)
351 352
	Encode expanded temp file pattern before passing it to mkstemp or
	mktemp.
353

354 355 356 357 358
	* fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
	Encode the file name before passing it to dostounix_filename, in
	case it will downcase it (under w32-downcase-file-names).
	(Bug#12933)

Paul Eggert's avatar
Paul Eggert committed
359 360 361 362 363 364 365 366
2012-12-05  Paul Eggert  <eggert@cs.ucla.edu>

	Minor call-process cleanups.
	* callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
	at the same time as other platforms, to simplify analysis.
	No need for fd0_volatile since we have synch_process_fd.
	Avoid needless emacs_close; arg is always negative.

367 368 369 370 371
2012-12-04  Andreas Schwab  <schwab@linux-m68k.org>

	* callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
	processes.

372 373 374 375 376 377 378 379 380 381 382 383 384
2012-12-04  Dmitry Antipov  <dmantipov@yandex.ru>

	* lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
	member.  Adjust users.  Convert mouse_face_past_end, mouse_face_defer
	and mouse_face_hidden members to a bitfields.
	* frame.h (struct frame): Remove set-but-not-used space_width member.
	(FRAME_SPACE_WIDTH): Remove.
	* nsterm.m, w32term.c, xterm.c: Adjust users.
	* termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
	member.  Adjust users.  Convert term_initted, delete_in_insert_mode,
	costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
	members to a bitfields.

385 386
2012-12-03  Paul Eggert  <eggert@cs.ucla.edu>

387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443
	Don't let call-process be a zombie factory (Bug#12980).
	Fixing this bug required some cleanup of the signal-handling code.
	As a side effect, this change also fixes a longstanding rare race
	condition whereby Emacs could mistakenly kill unrelated processes,
	and it fixes a bug where a second C-g does not kill a recalcitrant
	synchronous process in GNU/Linux and similar platforms.
	The patch should also fix the last vestiges of Bug#9488,
	a bug which has mostly been fixed on the trunk by other changes.
	* callproc.c, process.h (synch_process_alive, synch_process_death)
	(synch_process_termsig, sync_process_retcode):
	Remove.  All uses removed, to simplify analysis and so that
	less consing is done inside critical sections.
	* callproc.c (call_process_exited): Remove.  All uses replaced
	with !synch_process_pid.
	* callproc.c (synch_process_pid, synch_process_fd): New static vars.
	These take the role of what used to be in unwind-protect arg.
	All uses changed.
	(block_child_signal, unblock_child_signal):
	New functions, to avoid races that could kill innocent-victim processes.
	(call_process_kill, call_process_cleanup, Fcall_process): Use them.
	(call_process_kill): Record killed processes as deleted, so that
	zombies do not clutter up the system.  Do this inside a critical
	section, to avoid a race that would allow the clutter.
	(call_process_cleanup): Fix code so that the second C-g works again
	on common platforms such as GNU/Linux.
	(Fcall_process): Create the child process in a critical section,
	to fix a race condition.  If creating an asynchronous process,
	record it as deleted so that zombies do not clutter up the system.
	Do unwind-protect for WINDOWSNT too, as that's simpler in the
	light of these changes.  Omit unnecessary call to emacs_close
	before failure, as the unwind-protect code does that.
	* callproc.c (call_process_cleanup):
	* w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
	* process.c (record_deleted_pid): New function, containing
	code refactored out of Fdelete_process.
	(Fdelete_process): Use it.
	(process_status_retrieved): Remove.  All callers changed to use
	child_status_change.
	(record_child_status_change): Remove, folding its contents into ...
	(handle_child_signal): ... this signal handler.  Now, this
	function is purely a handler for SIGCHLD, and is not called after
	a synchronous waitpid returns; the synchronous code is moved to
	wait_for_termination.  There is no need to worry about reaping
	more than one child now.
	* sysdep.c (get_child_status, child_status_changed): New functions.
	(wait_for_termination): Now takes int * status and bool
	interruptible arguments, too.  Do not record child status change;
	that's now the caller's responsibility.  All callers changed.
	Reimplement in terms of get_child_status.
	(wait_for_termination_1, interruptible_wait_for_termination):
	Remove.  All callers changed to use wait_for_termination.
	* syswait.h: Include <stdbool.h>, for bool.
	(record_child_status_change, interruptible_wait_for_termination):
	Remove decls.
	(record_deleted_pid, child_status_changed): New decls.
	(wait_for_termination): Adjust to API changes noted above.

444 445 446
	* bytecode.c, lisp.h (Qbytecode): Remove.
	No longer needed after 2012-11-20 interactive-p changes.

447 448 449 450 451
2012-12-03  Eli Zaretskii  <eliz@gnu.org>

	* xdisp.c (redisplay_window): If the cursor is visible, but inside
	the scroll margin, move point outside the margin.  (Bug#13055)

452 453 454 455 456
2012-12-03  Jan Djärv  <jan.h.d@swipnet.se>

	* gtkutil.c (my_log_handler): New function.
	(xg_set_geometry): Set log handler to my_log_handler (Bug#11177).

457 458 459 460 461 462 463 464 465
2012-12-03  Dmitry Antipov  <dmantipov@yandex.ru>

	* lisp.h (modify_region): Rename to...
	(modify_region_1): ...new prototype.
	* textprop.c (modify_region): Now static.  Adjust users.
	* insdel.c (modify_region): Rename to...
	(modify_region_1): ...new function to work with current buffer.
	Adjust comment and users.  Use true and false for booleans.

466 467 468 469 470 471 472 473 474 475 476
2012-12-03  Dmitry Antipov  <dmantipov@yandex.ru>

	* alloc.c (free_save_value): New function.
	(safe_alloca_unwind): Use it.
	* lisp.h (free_save_value): New prototype.
	* editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
	Add comment.
	(save_excursion_restore): Adjust to match saved data structure.
	Use free_save_value to offload some work from GC.  Drop obsolete
	#if 0 code.

477
2012-12-03  Chong Yidong  <cyd@gnu.org>
478 479 480

	* fileio.c (Vauto_save_list_file_name): Doc fix.

481
2012-12-03  Fabrice Popineau  <fabrice.popineau@gmail.com>
482 483 484 485 486 487 488 489 490 491 492 493 494

	* w32fns.c: Remove prototype of atof.
	(syspage_mask): Declared DWORD_PTR, for compatibility with 64-bit
	builds.
	(file_dialog_callback): Declared UINT_PTR.

	* w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
	with 64-bit builds.

	* w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
	(FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
	defined.

495
2012-12-03  Glenn Morris  <rgm@gnu.org>
496

497
	* data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
498

499 500
2012-12-02  Paul Eggert  <eggert@cs.ucla.edu>

501 502 503 504 505 506 507
	Fix xpalloc confusion after memory is exhausted.
	* alloc.c (xpalloc): Comment fix.
	* charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
	and signals an error, do not clear charset_table_size, as
	charset_table is still valid.
	* doprnt.c (evxprintf): Clear *BUF after freeing it.

508 509 510 511 512 513 514
	Use execve to avoid need to munge environ (Bug#13054).
	* callproc.c (Fcall_process):
	* process.c (create_process):
	Don't save and restore environ;	no longer needed.
	* callproc.c (child_setup):
	Use execve, not execvp, to preserve environ.

515 516 517 518
2012-12-01  Paul Eggert  <eggert@cs.ucla.edu>

	* xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).

519 520 521 522 523 524 525
2012-12-01  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
	display for sliced images (Bug#10500).

	* w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.

Juanma Barranquero's avatar
Juanma Barranquero committed
526 527 528 529 530
2012-11-30  Juanma Barranquero  <lekktu@gmail.com>

	* doc.c (Fdocumentation): Re-add handling of function-documentation,
	accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).

531 532 533 534 535 536 537 538 539 540 541
2012-11-29  Dmitry Antipov  <dmantipov@yandex.ru>

	* xdisp.c (window_outdated): Remove eassert since it hits
	some suspicious corner cases (see Bug#13007 and Bug#13012).
	(mode_line_update_needed): New function.
	(redisplay_internal, redisplay_window): Use it.
	(ensure_selected_frame): New function.
	(redisplay_internal, unwind_redisplay): Use it.
	(redisplay_internal): Move comment about buffer_shared...
	(buffer_shared_and_changed): ...near to its real use.

542 543 544 545
2012-11-29  Paul Eggert  <eggert@cs.ucla.edu>

	* callproc.c (Fcall_process): Don't misreport vfork failure.

546 547 548 549 550 551 552 553 554 555 556
2012-11-28  Paul Eggert  <eggert@cs.ucla.edu>

	* callproc.c (Fcall_process): Fix vfork portability problems.
	Do not assume that fd[0], count, filefd, and save_environ survive
	vfork.  Fix bug whereby wrong errno value could be reported for
	pipe failure.  Some minor cleanups, too, as follows.  Move buf and
	bufsize to the context where they're needed.  Change new_argv to
	be of type char **, as this is more convenient and avoids casts.
	(CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
	Now local constants, not macros.

557 558 559 560 561
2012-11-18  Kenichi Handa  <handa@gnu.org>

	* font.c (font_unparse_xlfd): Fix previous change.  Keep "const"
	for the variable "f".

562 563 564 565 566
2012-11-13  Kenichi Handa  <handa@gnu.org>

	* font.c (font_unparse_xlfd): Exclude special characters from the
	generating XLFD name.

567 568
2012-11-27  Paul Eggert  <eggert@cs.ucla.edu>

569 570 571 572
	Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
	* dired.c (stat_uname, stat_gname):
	* fileio.c (Fexpand_file_name): Remove no-longer-needed casts.

573 574 575
	Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
	* dired.c (directory_files_internal, file_name_completion):
	Assume EAGAIN and EINTR are defined.
576

577 578 579 580 581 582 583 584
	* fileio.c (Fcopy_file): Assume EISDIR is defined.
	* gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
	* gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
	* lread.c (readbyte_from_file): Assume EINTR is defined.
	* process.c (wait_reading_process_output, send_process) [subprocesses]:
	Assume EIO and EAGAIN are defined.
	* unexcoff.c (write_segment): Assume EFAULT is defined.

585
2012-11-27  Eli Zaretskii  <eliz@gnu.org>
586 587 588 589

	* fontset.c (Finternal_char_font): Return nil on non-GUI frames.
	(Bug#11964)

590 591 592 593 594
	* xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
	highlighting on the frame was cleared.  Prevents assertion
	violations when repeatedly clicking on the "Top" link of the
	"bread-crumbs" in Info buffers.

595 596 597 598
2012-11-25  Paul Eggert  <eggert@cs.ucla.edu>

	* sysdep.c (sys_subshell): Don't assume pid_t fits in int.

599 600 601 602 603 604
2012-11-24  Ken Brown  <kbrown@cornell.edu>

	* keyboard.c (HAVE_MOUSE):
	* frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
	were always defined.

605
2012-11-24  Eli Zaretskii  <eliz@gnu.org>
606

607 608 609 610
	* xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
	between bpos_covered and bpos_max.  This fixes cursor display when
	several display strings follow each other.

611 612 613 614
	* .gdbinit (pgx): If the glyph's object is a string, display the
	pointer to string data, rather than the value of the string object
	itself (which barfs under CHECK_LISP_OBJECT_TYPE).

615 616 617 618
	* indent.c (Fvertical_motion): If the starting position is covered
	by a display string, return to one position before that, to avoid
	overshooting it inside move_it_to.  (Bug#12930)

619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634
2012-11-23  Dmitry Antipov  <dmantipov@yandex.ru>

	* frame.h (struct frame): Remove display_preempted member
	since all users are dead long ago.
	* nsterm.h (struct x_output): Use the only dummy member.
	* w32menu.c (pending_menu_activation): Remove since not
	really used.
	(set_frame_menubar): Adjust user.
	* w32term.h (struct x_output): Drop outdated #if 0 code.
	(struct w32_output): Use bitfields for explicit_parent,
	asked_for_visible and menubar_active members.  Drop
	unused pending_menu_activation member.
	* xterm.h (struct x_output): Drop outdated #if 0 code.
	Use bitfields for explicit_parent, asked_for_visible,
	has_been_visible and net_wm_state_hidden_seen members.

635 636 637 638 639 640
2012-11-23  Eli Zaretskii  <eliz@gnu.org>

	* makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
	of a literal "/".  (Bug#12955)
	(gl-stamp): Invoke fc.exe directly, not through cmd.

641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657
2012-11-23  Paul Eggert  <eggert@cs.ucla.edu>

	Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
	* dired.c: Assume HAVE_DIRENT_H.
	(NAMLEN): Remove, replacing with ...
	(dirent_namelen): New function.  All uses changed.  Use the GNU macro
	_D_EXACT_NAMELEN if available, as it's faster than strlen.
	(DIRENTRY): Remove, replacing all uses with 'struct dirent'.
	(DIRENTRY_NONEMPTY): Remove.  All callers now assume it's nonzero.
	* makefile.w32-in (DIR_H): Remove.  All uses replaced with
	$(NT_INC)/dirent.h.
	($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
	* ndir.h: Rename to ../nt/inc/dirent.h.
	* sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
	Do not include <dirent.h>; no longer needed.
	* w32.c: Include <dirent.h> rather than "ndir.h".

658 659 660 661
2012-11-23  Chong Yidong  <cyd@gnu.org>

	* xftfont.c (xftfont_open): Remove duplicate assignment.

662 663 664 665 666 667 668 669 670 671 672 673 674 675
2012-11-22  Dmitry Antipov  <dmantipov@yandex.ru>

	* alloc.c (Fgarbage_collect): Unblock input after clearing
	gc_in_progress to avoid note_mouse_highlight glitch with GC.
	* frame.h (FRAME_MOUSE_UPDATE): New macro.
	* msdos.c (IT_frame_up_to_date): Use it here...
	* w32term.c (w32_frame_up_to_date): ...here...
	* xterm.c (XTframe_up_to_date): ...and here...
	* nsterm.m (ns_frame_up_to_date): ...but not here.
	* lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
	Adjust users.
	* xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
	Do not check whether GC is in progress.

676 677 678 679 680 681 682 683
2012-11-22  Dmitry Antipov  <dmantipov@yandex.ru>

	* xdisp.c (window_buffer_changed): New function.
	(update_menu_bar, update_tool_bar): Use it to
	simplify large 'if' statements.
	(redisplay_internal): Generalize commonly used
	'tail' and 'frame' local variables.

684 685 686 687 688
2012-11-22  Eli Zaretskii  <eliz@gnu.org>

	* w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
	with Windows system header.

689 690 691 692 693 694 695 696 697 698 699
2012-11-21  Paul Eggert  <eggert@cs.ucla.edu>

	Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
	* alloc.c: Assume unistd.h exists.
	* fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
	* sysdep.c (get_current_dir_name): Assume getcwd exists.
	(getwd) [USG]: Remove; no longer needed.
	(sys_subshell) [DOS_NT]: Use getcwd, not getwd.
	* w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
	* w32.h (getcwd): Remove decl.

700 701 702 703 704 705
2012-11-21  Stefan Monnier  <monnier@iro.umontreal.ca>

	* xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
	Make it set selected_window as well.
	(update_tool_bar): Use it.

706
2012-11-21  Ken Brown  <kbrown@cornell.edu>
Ken Brown's avatar
Ken Brown committed
707 708 709 710 711

	* emacs.c (main): Set the G_SLICE environment variable for all
	Cygwin builds, not just GTK builds.  See
	https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.

712
2012-11-21  Eli Zaretskii  <eliz@gnu.org>
713 714 715 716 717

	* w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
	(FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
	Define for the MSVC compiler.

718
	* w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
719 720 721 722 723 724 725 726

	* fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
	(Fexpand_file_name) [DOS_NT]: Pass encoded file name to
	dostounix_filename.  Prevents crashes down the road, because
	dostounix_filename assumes it gets a unibyte string.  Reported by
	Michel de Ruiter <michel@sentient.nl>, see
	http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html

727 728 729 730 731 732 733 734 735 736 737 738 739
2012-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>

	Conflate Qnil and Qunbound for `symbol-function'.
	* alloc.c (Fmake_symbol): Initialize `function' to Qnil.
	* lread.c (init_obarray): Set `function' fields to Qnil.
	* eval.c (Fcommandp): Ignore Qunbound.
	(Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
	* data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
	Test NILP rather than Qunbound.
	(Ffmakunbound): Set to Qnil.
	(Fsymbol_function): Never signal an error.
	(Finteractive_form): Ignore Qunbound.

740 741 742 743
2012-11-20  Paul Eggert  <eggert@cs.ucla.edu>

	* eval.c (interactive_p): Remove no-longer-used decl.

744 745 746 747 748 749
2012-11-20  Dmitry Antipov  <dmantipov@yandex.ru>

	* xdisp.c (buffer_shared): Adjust comment.
	(buffer_shared_and_changed): New function.
	(prepare_menu_bars, redisplay_internal): Use it to
	decide whether all windows or frames should be updated.
750 751 752
	(window_outdated): New function.
	(text_outside_line_unchanged_p, redisplay_window): Use it.
	(redisplay_internal): Likewise.  Fix indentation.
753

754 755 756 757 758 759
2012-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>

	* eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
	(syms_of_eval): Remove corresponding defsubr.
	* bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.

760 761 762 763 764 765 766 767 768
2012-11-19  Daniel Colascione  <dancol@dancol.org>

	* w32fns.c (Fx_file_dialog):
	(Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
	cygwin_convert_file_name*.

	* cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
	Rename cygwin_convert_path* to cygwin_convert_file_name*.

769 770 771 772
2012-11-18  Paul Eggert  <eggert@cs.ucla.edu>

	* nsterm.m (ns_select): Send SIGIO only to self, not to process group.

773
2012-11-18  Eli Zaretskii  <eliz@gnu.org>
774 775 776 777 778

	* w32select.c: Include w32common.h before w32term.h, so that
	windows.h gets included before w32term.h uses some of its
	features, see below.

779 780 781 782
	* w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
	New typedefs.
	(EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
	New prototypes.
783 784
	(EnumSystemLocales) [_MSC_VER]: Define if undefined.  (Bug#12878)

785
2012-11-18  Jan Djärv  <jan.h.d@swipnet.se>
786 787 788 789

	* nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
	(ns_select): Return at once if events are held (Bug#12834).

790
2012-11-18  enami tsugutomo  <tsugutomo.enami@jp.sony.com>
791 792 793 794

	* unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
	Needed following 2012-10-20 change.  (Bug#12902)

795 796 797 798
2012-11-18  Juanma Barranquero  <lekktu@gmail.com>

	* w32proc.c (waitpid): Remove unused label get_result.

799 800 801 802 803 804
2012-11-17  Juanma Barranquero  <lekktu@gmail.com>

	* makefile.w32-in (SYSWAIT_H): New macro.
	($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
	($(BLD)/sysdep.$(O)): Update dependencies.

805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831
2012-11-17  Paul Eggert  <eggert@cs.ucla.edu>

	Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
	* callproc.c (relocate_fd): Assume F_DUPFD.
	* emacs.c, term.c (O_RDWR): Remove.
	* keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
	O_NDELAY, since O_NONBLOCK is the standard name for this flag.
	* nsterm.m: Assume <fcntl.h> exists.
	* process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
	(create_pty, Fmake_network_process, server_accept_connection)
	(wait_reading_process_output, init_process_emacs):
	Assume O_NONBLOCK.
	(wait_reading_process_output): Put in a special case for WINDOWSNT
	to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
	It's not clear this is needed, but it's a more-conservative change.
	(create_process): Assume FD_CLOEXEC.
	(create_process, create_pty): Assume O_NOCTTY.
	* sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
	(reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
	Omit if not DOS_NT, since F_GETFL is not defined there.
	(serial_open): Assume O_NONBLOCK and O_NOCTTY.
	* term.c: Include <fcntl.h>, for flags like O_NOCTTY.
	(O_NOCTTY): Remove.
	(init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
	lack it, since gnulib guarantees this.
	* w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.

832 833
2012-11-17  Eli Zaretskii  <eliz@gnu.org>

834 835 836
	* w32.c (faccessat): Pretend that directories have the execute bit
	set.  Emacs expects that, e.g., in files.el:cd-absolute.

837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854
	* w32proc.c (create_child): Don't clip the PID of the child
	process to fit into an Emacs integer, as this is no longer a
	restriction.
	(waitpid): Rename from sys_wait.  Emulate a Posix 'waitpid' by
	reaping only the process specified by PID argument, if that is
	positive.  Use PID instead of dead_child to know which process to
	reap.  Wait for the child to die only if WNOHANG is not in
	OPTIONS.
	(sys_select): Don't set dead_child.

	* sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
	as it is no longer needed.

	* process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
	no longer needed.
	(record_child_status_change): Remove the setting of
	record_at_most_one_child for the !WNOHANG case.

855 856 857 858 859 860 861 862 863 864
2012-11-17  Paul Eggert  <eggert@cs.ucla.edu>

	Fix problems in ns port found by static checking.
	* nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
	(hold_event, setPosition:portion:whole:): Send SIGIO only to self,
	not to process group.
	(ns_select): Use emacs_write, not write, as that's more robust
	in the presence of signals.
	(fd_handler:): Check for read errors.

865 866 867 868
2012-11-16  Glenn Morris  <rgm@gnu.org>

	* editfns.c (Fmessage): Mention message-log-max.  (Bug#12849)

869
2012-11-16  Stefan Monnier  <monnier@iro.umontreal.ca>
870 871 872

	* eval.c (Finteractive_p): Revert lexbind-merge mishap.

873
2012-11-16  Eli Zaretskii  <eliz@gnu.org>
874 875 876 877 878 879 880 881 882 883 884

	* w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
	use the same value of thread handle.
	(start_timer_thread): If the timer thread exited (due to error),
	clean up by closing the two handles it used.  Duplicate the caller
	thread's handle here, so it gets duplicated only once, when
	launching the timer thread.  Set priority of the timer thread, not
	the caller thread.
	(getitimer): Don't duplicate the caller thread's handle here.
	(Bug#12832)

885
2012-11-16  Jan Djärv  <jan.h.d@swipnet.se>
886 887 888 889

	* nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
	called (Bug#12834).

890 891 892 893 894 895
2012-11-16  Paul Eggert  <eggert@cs.ucla.edu>

	Remove no-longer-used pty_max_bytes variable.
	* process.c (pty_max_bytes): Remove; unused.
	(send_process): Do not set it.

896 897 898 899 900
2012-11-15  Juanma Barranquero  <lekktu@gmail.com>

	* makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
	Update dependencies.

901 902 903 904 905 906 907
2012-11-15  Paul Eggert  <eggert@cs.ucla.edu>

	* eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
	This follows up on the 2012-09-29 patch that removed indirection
	for the 'function' field.  Reported by Sergey Vinokurov in
	<http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.

908 909 910 911 912 913 914 915 916
2012-11-14  Eli Zaretskii  <eliz@gnu.org>

	* w32.c (faccessat): Rename from sys_faccessat.  (No need to use a
	different name, as the MS runtime does not have such a function,
	and probably never will.)  All callers changed.  Ignore DIRFD
	value if PATH is an absolute file name, to match Posix spec
	better.  If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
	symlinks.

917 918 919 920 921
2012-11-14  Dmitry Antipov  <dmantipov@yandex.ru>

	* xdisp.c (echo_area_display, redisplay_internal):
	Omit redundant check whether frame_garbaged is set.

922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988
2012-11-14  Paul Eggert  <eggert@cs.ucla.edu>

	Use faccessat, not access, when checking file permissions (Bug#12632).
	This fixes a bug that has been present in Emacs since its creation.
	It was reported by Chris Torek in 1983 even before GNU Emacs existed,
	which must set some sort of record.  (Torek's bug report was against
	a predecessor of GNU Emacs, but GNU Emacs happened to have the
	same common flaw.)  See Torek's Usenet posting
	"setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
	Posted: Fri Apr  8 14:18:56 1983.
	* Makefile.in (LIB_EACCESS): New macro.
	(LIBES): Use it.
	* callproc.c (init_callproc):
	* charset.c (init_charset):
	* fileio.c (check_existing, check_executable, check_writable)
	(Ffile_readable_p):
	* lread.c (openp, load_path_check):
	* process.c (allocate_pty):
	* xrdb.c (file_p):
	Use effective UID when checking permissions, not real UID.
	* callproc.c (init_callproc):
	* charset.c (init_charset):
	* lread.c (load_path_check, init_lread):
	Test whether directories are accessible, not merely whether they exist.
	* conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
	* fileio.c (check_existing, check_executable, check_writable)
	(Ffile_readable_p):
	Use symbolic names instead of integers for the flags, as they're
	portable now.
	(check_writable): New arg AMODE.  All uses changed.
	Set errno on failure.
	(Ffile_readable_p): Use faccessat, not stat + open + close.
	(Ffile_writable_p): No need to call check_existing + check_writable.
	Just call check_writable and then look at errno.  This saves a syscall.
	dir should never be nil; replace an unnecessary runtime check
	with an eassert.  When checking the parent directory of a nonexistent
	file, check that the directory is searchable as well as writable, as
	we can't create files in unsearchable directories.
	(file_directory_p): New function, which uses 'stat' on most platforms
	but faccessat with D_OK (for efficiency) if WINDOWSNT.
	(Ffile_directory_p, Fset_file_times): Use it.
	(file_accessible_directory_p): New function, which uses a single
	syscall for efficiency.
	(Ffile_accessible_directory_p): Use it.
	* xrdb.c (file_p): Use file_directory_p.
	* lisp.h (file_directory_p, file_accessible_directory_p): New decls.
	* lread.c (openp): When opening a file, use fstat rather than
	stat, as that avoids a permissions race.  When not opening a file,
	use file_directory_p rather than stat.
	(dir_warning): First arg is now a usage string, not a format.
	Use errno.  All uses changed.
	* nsterm.m (ns_term_init): Remove unnecessary call to file-readable
	that merely introduced a race.
	* process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
	changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
	and similarly for the other O_* flags.
	* w32.c (sys_faccessat): Rename from sys_access and switch to
	faccessat's API.  All uses changed.
	* xrdb.c: Do not include <sys/stat.h>; no longer needed.
	(magic_db): Rename from magic_file_p.
	(magic_db, search_magic_path): Return an XrmDatabase rather than a
	char *, so that we don't have to test for file existence
	separately from opening the file for reading.  This removes a race
	fixes a permission-checking problem, and simplifies the code.
	All uses changed.
	(file_p): Remove; no longer needed.

989 990 991 992 993 994
2012-11-13  Dmitry Antipov  <dmantipov@yandex.ru>

	Omit glyphs initialization at startup.
	* dispnew.c (glyphs_initialized_initially_p): Remove.
	(adjust_frame_glyphs_initially): Likewise.  Adjust users.
	(Fredraw_frame): Move actual code from here...
Eli Zaretskii's avatar
Eli Zaretskii committed
995
	(redraw_frame): ...to here.  Add eassert.  Adjust comment.
996 997 998
	(Fredraw_display): Use redraw_frame.
	* xdisp.c (clear_garbaged_frames): Likewise.

999
2012-11-13  Eli Zaretskii  <eliz@gnu.org>
1000 1001 1002 1003 1004 1005 1006

	* xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
	passed to pint2str and pint2hrstr to be at most the size of the
	frame's decode_mode_spec_buffer.  This avoids crashes with very
	large values of FIELD_WIDTH argument to decode_mode_spec.
	(Bug#12867)

1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017
2012-11-13  Paul Eggert  <eggert@cs.ucla.edu>

	Fix a race with verify-visited-file-modtime (Bug#12863).
	Since at least 1991 Emacs has ignored an mtime difference of no
	more than one second, but my guess is that this was to work around
	file system bugs that were fixed long ago.  Since the race is
	causing problems now, let's remove that code.
	* fileio.c (Fverify_visited_file_modtime): Do not accept a file
	whose time stamp is off by no more than a second.  Insist that the
	file time stamps match exactly.

1018 1019 1020 1021 1022 1023 1024
2012-11-12  Dmitry Antipov  <dmantipov@yandex.ru>

	* frame.h (struct frame): Convert external_tool_bar member to
	1-bit unsigned bitfield.
	* termhooks.h (struct terminal): Remove mouse_moved member since
	all users are long dead.  Adjust comment on mouse_position_hook.

1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041
2012-11-12  Dmitry Antipov  <dmantipov@yandex.ru>

	Simplify by using FOR_EACH_FRAME here and there.
	* frame.c (next_frame, prev_frame, other_visible_frames)
	(delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
	* w32term.c (x_window_to_scroll_bar): Likewise.
	* window.c (window_list): Likewise.
	* xdisp.c (x_consider_frame_title): Likewise.
	* xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
	* xfns.c (x_window_to_frame, x_any_window_to_frame)
	(x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
	* xmenu.c (menubar_id_to_frame): Likewise.
	* xselect.c (frame_for_x_selection): Likewise.
	* xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
	(x_window_to_menu_bar): Likewise.
	* w32fns.c (x_window_to_frame): Likewise.  Adjust comment.

1042 1043
2012-11-12  Paul Eggert  <eggert@cs.ucla.edu>

1044 1045
	* data.c (Qdefalias_fset_function): Now static.

1046 1047 1048 1049 1050 1051
	Another tweak to vectorlike_header change.
	* alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
	Remove, and replace all uses with ...
	(next_in_free_list, set_next_in_free_list):
	New functions, which respect C's aliasing rules better.

1052 1053 1054 1055 1056
2012-11-11  Paul Eggert  <eggert@cs.ucla.edu>

	* window.c (list4i): Rename from 'quad'.  All uses changed.
	Needed because <sys/types.h> defines 'quad' on Solaris 10.

1057 1058 1059 1060 1061
2012-11-11  Juanma Barranquero  <lekktu@gmail.com>

	* xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
	warning about mixing declarations and code in ISO C90.

1062
2012-11-10  Martin Rudalics  <rudalics@gmx.at>
1063 1064 1065 1066

	* window.c (Fsplit_window_internal): Set combination limit of
	new parent window to t iff Vwindow_combination_limit is t;
	fixing a regression introduced with the change from 2012-09-22.
1067
	(Fset_window_combination_limit): Fix doc-string.
1068

1069
2012-11-10  Eli Zaretskii  <eliz@gnu.org>
1070 1071 1072 1073

	* xdisp.c (try_scrolling): Fix correction of aggressive-scroll
	amount when the scroll margins are too large.  When scrolling
	backwards in the buffer, give up if cannot reach point or the
1074 1075
	scroll margin within a reasonable number of screen lines.
	Fixes point position in window under scroll-up/down-aggressively when
1076 1077 1078
	point is positioned many lines beyond the window top/bottom.
	(Bug#12811)

1079 1080 1081 1082
	* ralloc.c (relinquish): If real_morecore fails to return memory
	to the system, don't crash; instead, leave the last heap
	unchanged and return.  (Bug#12774)

1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093
2012-11-09  Stefan Monnier  <monnier@iro.umontreal.ca>

	* lisp.h (AUTOLOADP): New macro.
	* eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
	* data.c (Ffset): Remove special ad-advice-info handling.
	(Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
	(Fsubr_arity): CSE.
	(Finteractive_form): Simplify.
	(Fquo): Don't insist on having at least 2 arguments.
	(Qdefalias_fset_function): New var.

1094 1095
2012-11-09  Jan Djärv  <jan.h.d@swipnet.se>

1096 1097
	* image.c (xpm_make_color_table_h): Change to hashtest_equal.

1098 1099 1100 1101
	* nsfont.m (Qcondensed, Qexpanded): New variables.
	(ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
	(syms_of_nsfont): Defsym Qcondensed, Qexpanded.

1102 1103 1104 1105 1106 1107 1108
2012-11-09  Dmitry Antipov  <dmantipov@yandex.ru>

	Fix recently introduced crash on MS-Windows (Bug#12839).
	* w32term.h (struct scroll_bar): Use convenient header.
	(SCROLL_BAR_VEC_SIZE): Remove.
	* w32term.c (x_scroll_bar_create): Use VECSIZE.

1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119
2012-11-09  Dmitry Antipov  <dmantipov@yandex.ru>

	Tweak last vectorlike_header change.
	* alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
	vectorlike object on the free list.  This is introduced to avoid
	some (but not all) pointer casting and aliasing problems, see
	http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
	* .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
	objects.
	(xvectype, xvecsize): Use them to examine Lisp_Object values.

1120 1121
2012-11-09  Jan Djärv  <jan.h.d@swipnet.se>

1122
	* nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
1123 1124
	been removed, so remove them here also.

1125 1126 1127 1128 1129
2012-11-09  Stefan Monnier  <monnier@iro.umontreal.ca>

	* doc.c (Fdocumentation): Handle new property
	dynamic-docstring-function to replace the old ad-advice-info.

1130 1131 1132 1133
2012-11-09  Paul Eggert  <eggert@cs.ucla.edu>

	* fns.c (Qeql, hashtest_eq): Now static.

1134 1135 1136 1137 1138 1139 1140
2012-11-08  Stefan Monnier  <monnier@iro.umontreal.ca>

	* lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
	* fns.c (hashfn_eq, hashfn_eql, sxhash):
	* profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
	* buffer.c (compare_overlays): Use XLI rather than XHASH.

1141 1142 1143 1144 1145 1146 1147 1148 1149
2012-11-08  Paul Eggert  <eggert@cs.ucla.edu>

	Use same hash function for hashfn_profiler as for hash_string etc.
	* fns.c (SXHASH_COMBINE): Remove.  All uses replaced by sxhash_combine.
	* lisp.h (sxhash_combine): New inline function, with the contents
	of the old SXHASH_COMBINE.
	* profiler.c (hashfn_profiler): Use it, instead of having a
	special hash function containing a comparison that always yields 1.

1150 1151 1152 1153 1154 1155 1156
2012-11-08  Stefan Monnier  <monnier@iro.umontreal.ca>

	* xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
	(Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
	(Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
	Remove unused vars.

1157 1158 1159 1160 1161
2012-11-08  Jan Djärv  <jan.h.d@swipnet.se>

	* image.c (xpm_make_color_table_h): Fix compiler error because
	make_hash_table changed.

1162 1163 1164 1165
2012-11-08  Thomas Kappler <tkappler@gmail.com> (tiny change)

	* nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).

1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192
2012-11-08  Stefan Monnier  <monnier@iro.umontreal.ca>

	Use ad-hoc comparison function for the profiler's hash-tables.
	* profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
	(make_log): Use them.
	(handle_profiler_signal): Don't inhibit quit any longer since we don't
	call Fequal any more.
	(Ffunction_equal): New function.
	(cmpfn_profiler, hashfn_profiler): New functions.
	(syms_of_profiler): Initialize them.
	* lisp.h (struct hash_table_test): New struct.
	(struct Lisp_Hash_Table): Use it.
	* alloc.c (mark_object): Mark hash_table_test fields of hash tables.
	* fns.c (make_hash_table): Take a struct to describe the test.
	(cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
	(hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
	(hash_lookup, hash_remove_from_table): Move assertion checking of
	hashfn result here.  Check hash-equality before calling cmpfn.
	(Fmake_hash_table): Adjust call to make_hash_table.
	(hashtest_eq, hashtest_eql, hashtest_equal): New structs.
	(syms_of_fns): Initialize them.
	* emacs.c (main): Move syms_of_fns earlier.
	* xterm.c (syms_of_xterm):
	* category.c (hash_get_category_set): Adjust call to make_hash_table.
	* print.c (print_object): Adjust to new hash-table struct.
	* composite.c (composition_gstring_put_cache): Adjust to new hashfn.

Eli Zaretskii's avatar
Eli Zaretskii committed
1193 1194 1195 1196 1197 1198
2012-11-08  Eli Zaretskii  <eliz@gnu.org>

	* w32fns.c (modifier_set): Fix handling of Scroll Lock when the
	value of w32-scroll-lock-modifier is neither nil nor one of the
	known key modifiers.  (Bug#12806)

1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245
2012-11-08  Dmitry Antipov  <dmantipov@yandex.ru>

	Shrink struct vectorlike_header to the only size field.
	* lisp.h (enum pvec_type): Avoid explicit enum member values.
	Adjust comment.
	(enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
	PVEC_TYPE_MASK to arrange new bitfield in the vector header.
	(PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
	(PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
	information from the vector header.  Adjust comment.
	(XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
	(PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
	layout.
	(XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
	(struct vectorlike_header): Remove next member.  Adjust comment.
	(struct Lisp_Subr): Add convenient header.  Adjust comment.
	(allocate_pseudovector): Adjust prototype.
	* alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
	(sweep_string, lisp_malloc): Remove useless prototypes.
	(enum mem_type): Adjust comment.
	(NEXT_IN_FREE_LIST): New macro.
	(SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
	(Fmake_bool_vector): Likewise.
	(struct large_vector): New type to represent allocation unit for
	the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
	(large_vectors): Change type to struct large_vector.
	(allocate_vector_from_block): Simplify.
	(PSEUDOVECTOR_NBYTES): Replace with...
	(vector_nbytes): ...new function.  Adjust users.
	(sweep_vectors): Adjust processing of large vectors.
	(allocate_vectorlike): Likewise.
	(allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
	Add easserts.  Adjust XSETPVECTYPESIZE usage.
	(allocate_buffer): Use BUFFER_PVEC_INIT.
	(live_vector_p): Adjust to match large vector.
	* buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
	* buffer.h (struct buffer): Add next member.
	(BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
	New macros.
	(FOR_EACH_BUFFER): Adjust to match struct buffer change.
	* fns.c (internal_equal): Adjust to match enum pvec_type change.
	(copy_hash_table): Adjust to match vector header change.
	* lread.c (defsubr): Use XSETPVECTYPE.
	* .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
	(xvectype): Likewise.  Print PVEC_NORMAL_VECTOR for regular vectors.
	(xvecsize): New command.

1246 1247 1248 1249 1250 1251 1252
2012-11-08  Dmitry Antipov  <dmantipov@yandex.ru>

	* keyboard.c (event_to_kboard): Do not dereference
	frame_or_window field of SELECTION_REQUEST_EVENT
	and SELECTION_CLEAR_EVENT events (Bug#12814).
	* xterm.h (struct selection_input_event): Adjust comment.

1253 1254
2012-11-07  Eli Zaretskii  <eliz@gnu.org>

1255 1256 1257
	* w32fns.c (modifier_set): Don't report modifiers from toggle key,
	such as Scroll Lock, if the respective keys are treated as
	function keys, not as modifiers.  This avoids destroying non-ASCII
1258
	keyboard input when Scroll Lock is toggled ON.  (Bug#12806)
1259

1260 1261 1262 1263
2012-11-07  Dmitry Antipov  <dmantipov@yandex.ru>

	* xfns.c (Fx_wm_set_size_hint): Use check_x_frame.  Adjust docstring.

1264 1265 1266 1267 1268 1269 1270 1271 1272
2012-11-06  Paul Eggert  <eggert@cs.ucla.edu>

	Restore some duplicate definitions (Bug#12814).
	This undoes part of the 2012-11-03 changes.  Some people build
	with plain -g rather than with -g3, and they need the duplicate
	definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
	* lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
	Define as macros, as well as as enums or as constants.

1273 1274 1275 1276 1277
2012-11-06  Jan Djärv  <jan.h.d@swipnet.se>

	* nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
	to keypad keys (Bug#12816).

1278 1279 1280 1281 1282 1283 1284 1285 1286
2012-11-06  Paul Eggert  <eggert@cs.ucla.edu>

	Minor adjustments of recently-changed frame functions.
	* buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
	known to be a frame (we're in the FRAMEP branch).
	* lisp.h (Qframep): Remove decl.  frame.h declares this.
	* window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
	since they're meant for Lisp fixnum values.

1287 1288 1289 1290 1291 1292 1293
2012-11-06  Dmitry Antipov  <dmantipov@yandex.ru>

	* window.c (Fwindow_combination_limit): Revert to the only
	required argument and adjust docstring as suggested in
	http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
	by Martin Rudalics <rudalics@gmx.at>.

1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328
2012-11-06  Dmitry Antipov  <dmantipov@yandex.ru>

	Widely used frame validity and checking functions.
	* frame.h (decode_live_frame, decode_any_frame): Add prototypes.
	* frame.c (decode_live_frame, decode_any_frame): New functions.
	(delete_frame, Fredirect_frame_focus, Fframe_parameters)
	(Fframe_parameter, Fframe_char_height, Fframe_char_width)
	(Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
	(Fframe_pointer_visible_p): Use decode_any_frame.
	(Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
	(Fraise_frame, Flower_frame, Fmodify_frame_parameters)
	(Fset_frame_height, Fset_frame_width): Use decode_live_frame.
	(Fframe_focus): Likewise.  Allow zero number of arguments.
	Adjust docstring.
	(frame_buffer_list, frame_buffer_predicate): Remove.
	* lisp.h (frame_buffer_predicate): Remove prototype.
	* buffer.c (Fother_buffer): Use decode_any_frame.
	* xdisp.c (Ftool_bar_lines_needed): Likewise.
	* xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
	* font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
	(Fclose_font, Ffont_info): Use decode_live_frame.
	* fontset.c (check_fontset_name): Likewise.
	* terminal.c (Fframe_terminal): Likewise.
	* w32fns.c (check_x_frame): Likewise.
	* window.c (Fminibuffer_window, Fwindow_at)
	(Fcurrent_window_configuration): Likewise.
	(Frun_window_configuration_change_hook, Fwindow_resize_apply):
	Likewise.  Allow zero number of arguments.  Adjust docstring.
	* dispnew.c (Fredraw_frame): Likewise.
	* xfaces.c (frame_or_selected_frame): Remove.
	(Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
	(Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
	(Fframe_face_alist): Use decode_live_frame.
	* xfns.c (check_x_frame): Likewise.

1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340
2012-11-06  Dmitry Antipov  <dmantipov@yandex.ru>

	* window.c (quad): New function.
	(Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
	(Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
	(Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
	(Fwindow_line_height): Use it.
	(Fwindow_fringes): Use list3.
	(Fwindow_scroll_bars): Use list4.
	(Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
	(Fwindow_combination_limit): Allow zero number of arguments.

1341 1342 1343 1344
2012-11-05  Eli Zaretskii  <eliz@gnu.org>

	* makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.

Juanma Barranquero's avatar
Juanma Barranquero committed
1345
	* w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
1346
	(emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
1347
	file descriptor 2 for standard error.  (Bug#12805)
1348

1349 1350 1351 1352
2012-11-05  Chong Yidong  <cyd@gnu.org>

	* process.c (wait_reading_process_output): Revert previous change.

Paul Eggert's avatar
Paul Eggert committed
1353 1354
2012-11-05  Paul Eggert  <eggert@cs.ucla.edu>

1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374
	Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
	This removes code that has been obsolete since around 1990.
	* callproc.c (Fcall_process):
	* emacs.c (main):
	* process.c (create_process):
	* term.c (dissociate_if_controlling_tty):
	Assume setsid exists.
	* callproc.c (child_setup): Assume setpgid exists and behaves as
	per POSIX.1-1988 or later.
	* conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
	* emacs.c (shut_down_emacs):
	* sysdep.c (sys_suspend, init_foreground_group):
	Assume getpgrp behaves as per POSIX.1-1998 or later.
	* msdos.c (setpgrp): Remove.
	(tcgetpgrp, setpgid, setsid): New functions.
	* systty.h (EMACS_GETPGRP): Remove.  All callers now use getpgrp.
	* term.c (no_controlling_tty): Remove; unused.
	* w32proc.c (setpgrp): Remove.
	(setsid, tcgetpgrp): New functions.

Paul Eggert's avatar
Paul Eggert committed
1375 1376 1377 1378 1379
	Simplify by assuming __fpending.
	* dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
	(update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
	Do not assume that __fpending's result fits in int.

Paul Eggert's avatar
Paul Eggert committed
1380 1381
2012-11-04  Paul Eggert  <eggert@cs.ucla.edu>

1382 1383
	Remove EMACS_OUTQSIZE+sleep hack.
	* dispnew.c (update_frame_1): Remove hack for terminals slower
1384 1385
	than 2400 bps, which throttled Emacs by having it sleep.
	This code hasn't worked since at least 2007, when the multi-tty stuff
1386 1387 1388 1389
	was added, and anyway those old terminals are long dead.
	* systty.h (EMACS_OUTQSIZE): Remove; unused.  The macro isn't used even
	without the dispnew.c change, as dispnew.c doesn't include systty.h.

Paul Eggert's avatar
Paul Eggert committed
1390 1391 1392 1393 1394 1395 1396
	Fix data-loss with --version (Bug#9574).
	* emacs.c (close_output_streams): Use strerror, not emacs_strerror,
	as we can't assume that emacs_strerror is initialized, and strerror
	is good enough here.
	(main): Invoke atexit earlier, to catch earlier instances of
	sending data to stdout and exiting, e.g., "emacs --version >/dev/full".

1397 1398 1399 1400 1401
2012-11-04  Michael Marchionna  <tralfaz@pacbell.net>

	* nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
	(keyDown): Remap keypad keys to X11 virtual key codes.

1402 1403
2012-11-03  Paul Eggert  <eggert@cs.ucla.edu>

Paul Eggert's avatar
Paul Eggert committed
1404 1405 1406 1407 1408 1409 1410 1411
	Fix data-loss with --batch (Bug#9574).
	* emacs.c: Include <close-stream.h>.
	(close_output_streams): New function.
	(main): Pass it to atexit, so that Emacs closes stdout and stderr
	and handles errors appropriately.
	(Fkill_emacs): Don't worry about flushing, as close_output_stream
	does that now.

1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423
	Fix a race condition that causes Emacs to mess up glib (Bug#8855).
	The symptom is a diagnostic "GLib-WARNING **: In call to
	g_spawn_sync(), exit status of a child process was requested but
	SIGCHLD action was set to SIG_IGN and ECHILD was received by
	waitpid(), so exit status can't be returned."  The diagnostic
	is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
	The real bug is a race condition between Emacs and glib: Emacs
	does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
	so that glib can't find it.  Work around the bug by invoking
	waitpid only on subprocesses that Emacs itself creates.
	* process.c (create_process, record_child_status_change):
	Don't use special value -1 in pid field, as the caller now must
1424 1425
	know the pid rather than having the callee infer it.
	The inference was sometimes incorrect anyway, due to another race.
1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440
	(create_process): Set new 'alive' member if child is created.
	(process_status_retrieved): New function.
	(record_child_status_change): Use it.
	Accept negative 1st argument, which means to wait for the
	processes that Emacs already knows about.  Move special-case code
	for DOS_NT (which lacks WNOHANG) here, from caller.  Keep track of
	processes that have already been waited for, by testing and
	clearing new 'alive' member.
	(CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
	now does this internally.
	(handle_child_signal): Let record_child_status_change do all
	the work, since we do not want to reap all exited child processes,
	only the child processes that Emacs itself created.
	* process.h (Lisp_Process): New boolean member 'alive'.

1441 1442 1443 1444 1445 1446 1447
	Omit duplicate definitions no longer needed with gcc -g3.
	* lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
	(VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
	Define only as macros.  There's no longer any need to also define
	these symbols as enums or as constants, since we now assume
	gcc -g3 when debugging.

1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465
2012-11-03  Eli Zaretskii  <eliz@gnu.org>

	* lisp.mk: Adjust comments to the fact that term/internal is now
	loaded from loadup.el.

	* msdos.c (msdos_abort): Rename from emacs_abort, and make static.
	(msdos_fatal_signal): New function.
	(XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
	its argument list.

	* conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
	for GCC versions before 4.
	(emacs_raise): Define to call msdos_fatal_signal.

	* xdisp.c (init_from_display_pos): Fix initialization of the bidi
	iterator when starting in the middle of a display or overlay
	string.  (Bug#12745)

1466 1467 1468 1469 1470
2012-11-03  Chong Yidong  <cyd@gnu.org>

	* process.c (wait_reading_process_output): Clean up the last
	change.

1471 1472 1473 1474 1475
2012-11-03  Jim Paris  <jim@jtan.com>  (tiny change)

	* process.c (wait_reading_process_output): Avoid a race condition
	with SIGIO delivery (Bug#11536).

1476 1477 1478 1479
2012-11-03  Chong Yidong  <cyd@gnu.org>

	* buffer.c (cursor_type): Untabify docstring.

1480 1481 1482 1483 1484 1485 1486
2012-11-03  Dmitry Antipov  <dmantipov@yandex.ru>

	* frame.h (struct frame): Drop can_have_scroll_bars member
	which is meaningless for a long time.  Adjust comments.
	(FRAME_CAN_HAVE_SCROLL_BARS): Remove.
	* frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.

1487 1488 1489 1490 1491 1492 1493 1494 1495
2012-11-03  Dmitry Antipov  <dmantipov@yandex.ru>

	* window.c (decode_next_window_args): Update window arg after
	calling decode_live_window and so fix crash reported at
	http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
	by Juanma Barranquero <lekktu@gmail.com>.
	(Fwindow_body_width, Fwindow_body_height): Simplify a bit.
	* font.c (Ffont_at): Likewise.

1496 1497 1498 1499 1500 1501 1502
2012-11-01  Jan Djärv  <jan.h.d@swipnet.se>

	* widget.c (resize_cb): New function.
	(EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
	(EmacsFrameResize): Check if all is up to date before changing frame
	size.

1503 1504 1505 1506 1507 1508 1509 1510 1511
2012-11-02  Eli Zaretskii  <eliz@gnu.org>

	Implement backtrace output for fatal errors on MS-Windows.
	* w32fns.c (CaptureStackBackTrace_proc): New typedef.
	(BACKTRACE_LIMIT_MAX): New macro.
	(w32_backtrace): New function.
	(emacs_abort): Use w32_backtrace when the user chooses not to
	attach a debugger.  Update the text of the abort dialog.

1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527
2012-11-02  Dmitry Antipov  <dmantipov@yandex.ru>

	Window-related stuff cleanup here and there.
	* dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
	Use decode_any_window.
	* fringe.c (Ffringe_bitmaps_at_pos): Likewise.
	* xdisp.c (Fformat_mode_line): Likewise.
	* font.c (Ffont_at): Use decode_live_window.
	* indent.c (Fcompute_motion, Fvertical_motion): Likewise.
	* window.c (decode_next_window_args): Likewise.
	(decode_any_window): Remove static.
	* window.h (decode_any_window): Add prototype.
	* lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
	* window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
	respectively.

1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539
2012-11-02  Dmitry Antipov  <dmantipov@yandex.ru>

	Remove pad from struct input_event.
	* termhooks.h (struct input_event): Remove padding field.
	Adjust comment.
	* keyboard.c (event_to_kboard): Simplify because frame_or_window
	member is never cons for a long time.  Adjust comment.
	(mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
	SELECTION_CLEAR_EVENT has no Lisp_Objects to mark.  Add comment.
	* xterm.c (handle_one_xevent): Do not initialize frame_or_window
	field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.

1540 1541 1542 1543
2012-11-01  Eli Zaretskii  <eliz@gnu.org>

	* w32proc.c (getpgrp, setpgid): New functions.  (Bug#12776)

1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564
2012-10-31  Paul Eggert  <eggert@cs.ucla.edu>

	Fix crash when using Emacs as commit editor for git (Bug#12697).
	* callproc.c (setpgrp): Remove macro, as we now use setpgid
	and it is configured in conf_post.h.
	(Fcall_process): Don't invoke both setsid and setpgid; the former
	is enough, if it exists.
	* callproc.c (Fcall_process, child_setup):
	* process.c (create_process): Use setpgid.
	* conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
	for the real thing.
	* dispnew.c (init_display): Initialize the foreground group
	if we are running a tty display.
	* emacs.c (main): Do not worry about setpgrp; init_display does it now.
	* lisp.h (init_foreground_group): New decl.
	* sysdep.c (inherited_pgroup): New static var.
	(init_foreground_group, tcsetpgrp_without_stopping)
	(narrow_foreground_group, widen_foreground_group): New functions.
	(init_sys_modes): Narrow foreground group.
	(reset_sys_modes): Widen foreground group.

1565 1566 1567 1568
2012-10-31  Michael Albinus  <michael.albinus@gmx.de>

	* dbusbind.c: Fix cut'n'waste error.  Use HAVE_DBUS_VALIDATE_INTERFACE.

1569 1570 1571 1572 1573 1574
2012-10-31  Martin Rudalics  <rudalics@gmx.at>

	* minibuf.c (read_minibuf): Restore current buffer since
	choose_minibuf_frame calling Fset_frame_selected_window may
	change it (Bug#12766).

1575 1576 1577 1578
2012-10-30  Jan Djärv  <jan.h.d@swipnet.se>

	* frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).

1579 1580 1581 1582 1583
2012-10-30  Kenichi Handa  <handa@gnu.org>

	* font.c (Ffont_at): If WINDOW is specified and it is not
	displaying the current buffer, signal an error.

1584 1585
2012-10-29  Daniel Colascione  <dancol@dancol.org>

1586 1587
	* cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
	In preparation for fixing bug#12739, move these functions from
1588 1589 1590
	here...

	* coding.h, coding.c: ... to here, and compile them only when
1591 1592
	WINDOWSNT or CYGWIN.  Moving these functions out of cygw32 proper
	lets us write cygw32-agnostic code for the HAVE_NTGUI case.
1593

1594 1595 1596 1597 1598 1599 1600 1601 1602
2012-10-28  Eli Zaretskii  <eliz@gnu.org>

	* w32proc.c (TIMER_TICKS_PER_SEC): New macro.
	(timer_loop, getitimer, setitimer): Use it instead of
	CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
	'clock'.
	(w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
	literal 10000.

1603 1604 1605 1606 1607 1608 1609 1610 1611 1612
2012-10-28  Jan Djärv  <jan.h.d@swipnet.se>

	* nsterm.m (NO_APPDEFINED_DATA): New define.
	(last_appdefined_event_data): New variable
	(last_appdefined_event): Remove.
	(ns_select): Initialize t from last_appdefined_event_data instead
	of [last_appdefined_event data1].
	(sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
	remove last_appdefined_event (Bug#12698).

1613 1614 1615 1616
2012-10-28  Stefan Monnier  <monnier@iro.umontreal.ca>

	* frame.c (x_set_font): Catch internal error.

1617 1618
2012-10-27  Eli Zaretskii  <eliz@gnu.org>

1619 1620
	Avoid overflow in w32 implementation of interval timers.
	When possible, for ITIMER_PROF count only times the main thread
1621 1622
	actually executes.
	* w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
1623 1624
	'volatile ULONGLONG' types.  All the other data which was
	previously clock_t is now ULONGLONG.  'terminate' is 'volatile int'.
1625 1626 1627 1628 1629
	(GetThreadTimes_Proc): New typedef.
	(w32_get_timer_time): New function, returns a suitable time value
	for the timer.
	(timer_loop): Enter critical section when accessing ULONGLONG
	values of the itimer_data struct, as these accesses are no longer
1630 1631
	atomic.  Call 'w32_get_timer_time' instead of 'clock'.
	Remove unused variable.
1632 1633 1634 1635
	(init_timers): Initialize s_pfn_Get_Thread_Times.
	(start_timer_thread): Don't assign itimer->caller_thread here.
	(getitimer): Assign itimer->caller_thread here.
	(setitimer): Always call getitimer to get the value of ticks_now.
1636
	(sys_spawnve): Avoid compiler warning about format mismatch.