1. 04 Nov, 2012 2 commits
    • Paul Eggert's avatar
      Fix data-loss with --version. · 76abf5e5
      Paul Eggert authored
      * 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".
      Fixes: debbugs:9574
    • Michael Marchionna's avatar
      * nsterm.m: Add NSClearLineFunctionKey and keypad keys. · 8f31e74b
      Michael Marchionna authored
      (keyDown): Remap keypad keys to X11 virtual key codes.
      Fixes: debbugs:8680
  2. 03 Nov, 2012 13 commits
    • Eli Zaretskii's avatar
      Fix order of entries in ChangeLog files. · 3478f4b5
      Eli Zaretskii authored
    • Paul Eggert's avatar
      Fix data-loss with --batch. · 7ccfb720
      Paul Eggert authored
      * admin/merge-gnulib (GNULIB_MODULES): Add close-stream.
      * lib/close-stream.c, lib/close-stream.h, lib/fpending.c
      * lib/fpending.h, m4/close-stream.m4, m4/fpending.m4:
      New files, from gnulib.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * src/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.
      Fixes: debbugs:9574
    • Paul Eggert's avatar
      Fix a race condition that causes Emacs to mess up glib. · 0b3d4a47
      Paul Eggert authored
      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
      know the pid rather than having the callee infer it.  The
      inference was sometimes incorrect anyway, due to another race.
      (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'.
      Fixes: debbugs:8855
    • Paul Eggert's avatar
      Omit duplicate definitions no longer needed with gcc -g3. · 0d879dca
      Paul Eggert authored
      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.
    • Chong Yidong's avatar
    • Chong Yidong's avatar
      Fix a race condition in wait_reading_process_output (tiny change). · 893cc455
      Chong Yidong authored
      * src/process.c (wait_reading_process_output): Avoid a race condition
      with SIGIO delivery.
      Fixes: debbugs:11536
    • Chong Yidong's avatar
      * lisp/cus-start.el: Make cursor-type customizable. · 0f7b074f
      Chong Yidong authored
      * src/buffer.c (cursor_type): Untabify docstring.
      Fixes: debbugs:11633
    • Eli Zaretskii's avatar
      Load term/internal from loadup.el. · 1d4341f9
      Eli Zaretskii authored
    • Eli Zaretskii's avatar
    • Jan Djärv's avatar
      Backport from trunk. · ad10696b
      Jan Djärv authored
      * widget.c (resize_cb): New function.
      (EmacsFrameRealize): Add resize_cb as event handler.
      (EmacsFrameResize): Check if all is up to date before changing frame
      Fixes: debbugs:12733
    • Eli Zaretskii's avatar
      Fix bidi initialization in init_from_display_pos. · 67b50ba4
      Eli Zaretskii authored
       src/xdisp.c (init_from_display_pos): Fix initialization of the bidi
       iterator when starting in the middle of a display or overlay
      Fixes: debbugs:12745
    • Dmitry Antipov's avatar
      * frame.h (struct frame): Drop can_have_scroll_bars member · 3737fee7
      Dmitry Antipov authored
      which is meaningless for a long time.  Adjust comments.
      * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
    • Dmitry Antipov's avatar
      * window.c (decode_next_window_args): Update window arg after · b6a9e8b1
      Dmitry Antipov authored
      calling decode_live_window and so fix crash reported at
      by Juanma Barranquero <lekktu@gmail.com>.
      (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
      * font.c (Ffont_at): Likewise.
  3. 01 Nov, 2012 1 commit
    • Jan Djärv's avatar
      * widget.c (resize_cb): New function. · 600d4768
      Jan Djärv authored
      (EmacsFrameRealize): Add resize_cb as event handler.
      (EmacsFrameResize): Check if all is up to date before changing frame
      Fixes: debbugs:12733
  4. 02 Nov, 2012 3 commits
    • Eli Zaretskii's avatar
      Implement backtrace output for fatal errors on MS-Windows. · 1005b4b9
      Eli Zaretskii authored
       src/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.
    • Dmitry Antipov's avatar
      Window-related stuff cleanup here and there. · b9e9df47
      Dmitry Antipov authored
      * 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,
    • Dmitry Antipov's avatar
      Remove pad from struct input_event. · 2b371ff7
      Dmitry Antipov authored
      * 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
  5. 01 Nov, 2012 1 commit
  6. 31 Oct, 2012 3 commits
    • Paul Eggert's avatar
      Fix crash when using Emacs as commit editor for git. · 322aea6d
      Paul Eggert authored
      * 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.
      Fixes: debbugs:12697
    • Michael Albinus's avatar
    • Martin Rudalics's avatar
      Install fixes for Bug#12764 and Bug#12766. · 218e997a
      Martin Rudalics authored
      * window.el (quit-restore-window): If the window has been
      created on an existing frame and ended up as the sole window on
      that frame, do not delete it (Bug#12764).
      * minibuf.c (read_minibuf): Restore current buffer since
      choose_minibuf_frame calling Fset_frame_selected_window may
      change it (Bug#12766).
  7. 30 Oct, 2012 3 commits
  8. 29 Oct, 2012 1 commit
    • Daniel Colascione's avatar
      2012-10-29 Daniel Colascione <dancol@dancol.org> · ba116008
      Daniel Colascione authored
      cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode): In
      preparation for fixing bug#12739, move these functions from
      * coding.h, coding.c: ... to here, and compile them only when
      WINDOWSNT or HAVE_NTGUI.  Moving these functions out of cygw32
      proper lets us write cygw32-agnostic code for the HAVE_NTGUI case.
  9. 28 Oct, 2012 3 commits
    • Eli Zaretskii's avatar
      Don't use CLOCKS_PER_SEC in w32 timers. · 640bf8ad
      Eli Zaretskii authored
       src/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
       (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
       literal 10000.
    • Jan Djärv's avatar
      * nsterm.m (NO_APPDEFINED_DATA): New define. · 64ccff5f
      Jan Djärv authored
      (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.
      Fixes: debbugs:12698
    • Stefan Monnier's avatar
  10. 27 Oct, 2012 3 commits
    • Eli Zaretskii's avatar
      Fix compiler warnings in w32proc.c. · 2f246cd3
      Eli Zaretskii authored
       src/w32proc.c (sys_spawnve): Avoid compiler warning about format mismatch.
       (timer_loop): Remove unused variable.
    • Eli Zaretskii's avatar
    • Eli Zaretskii's avatar
      Fix w32 implementation of itimers: overflow and ITIMER_PROF. · 6c16c13e
      Eli Zaretskii authored
       Avoid overflow in w32 implementation of interval timers.  When
       possible, for ITIMER_PROF count only times the main thread
       actually executes.
       src/w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
       ULONGLONG types.  Likewise for all the other data which was
       previously clock_t.
       (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
       atomic.  Call 'w32_get_timer_time' instead of 'clock'.
       (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.
  11. 26 Oct, 2012 1 commit
  12. 25 Oct, 2012 1 commit
    • Paul Eggert's avatar
      Don't assume process IDs fit in int. · 69deda53
      Paul Eggert authored
      * emacs.c (shut_down_emacs) [!DOS_NT]:
      * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
      * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
      Use pid_t, not int, to store process IDs, as 'int'
      is not wide enough on a few platforms (e.g., AIX and IRIX).
  13. 23 Oct, 2012 2 commits
  14. 21 Oct, 2012 3 commits