1. 05 Nov, 2012 5 commits
    • Eli Zaretskii's avatar
      Fix last entry in src/ChangeLog. · ae600a8e
      Eli Zaretskii authored
      ae600a8e
    • Eli Zaretskii's avatar
      Fix bug #12805 with compilation error in the cygw32 build. · c8e3a9c3
      Eli Zaretskii authored
       src/makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
       src/w32fns.c Include unistd.h, to avoid compiler warnings on Cygwin.
       (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
       file descriptor 2 for standard error.
      c8e3a9c3
    • Chong Yidong's avatar
    • Paul Eggert's avatar
      Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid. · dd0333b6
      Paul Eggert authored
      This removes code that has been obsolete since around 1990.
      * admin/CPP-DEFINES (HAVE_SETPGID, HAVE_SETSID, SETPGRP_RELEASES_CTTY):
      Remove; obsolete.
      * configure.ac (setpgid, setsid): Assume their existence.
      (AC_FUNC_GETPGRP, SETPGRP_RELEASES_CTTY): Remove; obsolete.
      * src/callproc.c (Fcall_process):
      * src/emacs.c (main):
      * src/process.c (create_process):
      * src/term.c (dissociate_if_controlling_tty):
      Assume setsid exists.
      * src/callproc.c (child_setup): Assume setpgid exists and behaves as
      per POSIX.1-1988 or later.
      * src/conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
      * src/emacs.c (shut_down_emacs):
      * src/sysdep.c (sys_suspend, init_foreground_group):
      Assume getpgrp behaves as per POSIX.1-1998 or later.
      * src/msdos.c (setpgrp): Remove.
      (tcgetpgrp, setpgid, setsid): New functions.
      * src/systty.h (EMACS_GETPGRP): Remove.  All callers now use getpgrp.
      * src/term.c (no_controlling_tty): Remove; unused.
      * src/w32proc.c (setpgrp): Remove.
      (setsid, tcgetpgrp): New functions.
      
      Fixes: debbugs:12800
      dd0333b6
    • Paul Eggert's avatar
      Simplify by assuming __fpending. · 8148369c
      Paul Eggert authored
      Now that Emacs is using the gnulib fpending module,
      there's no need for Emacs to have a separate implementation.
      * configure.ac (stdio_ext.h, __fpending): Remove now-duplicate checks.
      (PENDING_OUTPUT_COUNT, DISPNEW_NEEDS_STDIO_EXT): Remove.
      * admin/CPP-DEFINES (PENDING_OUTPUT_COUNT): Remove.
      * src/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.
      8148369c
  2. 04 Nov, 2012 3 commits
    • Paul Eggert's avatar
      Remove EMACS_OUTQSIZE+sleep hack. · 06b63c9b
      Paul Eggert authored
      * dispnew.c (update_frame_1): Remove hack for terminals slower
      than 2400 bps, which throttled Emacs by having it sleep.  This
      code hasn't worked since at least 2007, when the multi-tty stuff
      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.
      06b63c9b
    • 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
      76abf5e5
    • 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
      8f31e74b
  3. 03 Nov, 2012 13 commits
    • Eli Zaretskii's avatar
      Fix order of entries in ChangeLog files. · 3478f4b5
      Eli Zaretskii authored
      3478f4b5
    • 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
      7ccfb720
    • 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
      0b3d4a47
    • Paul Eggert's avatar
      Omit duplicate definitions no longer needed with gcc -g3. · 0d879dca
      Paul Eggert authored
      * 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.
      0d879dca
    • 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
      893cc455
    • 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
      0f7b074f
    • Eli Zaretskii's avatar
      Load term/internal from loadup.el. · 1d4341f9
      Eli Zaretskii authored
      1d4341f9
    • Eli Zaretskii's avatar
      b3cf17f6
    • 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
      size.
      
      Fixes: debbugs:12733
      ad10696b
    • 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
       string.
      
      Fixes: debbugs:12745
      67b50ba4
    • 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_CAN_HAVE_SCROLL_BARS): Remove.
      * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
      3737fee7
    • 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
      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.
      b6a9e8b1
  4. 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
      size.
      
      Fixes: debbugs:12733
      600d4768
  5. 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.
      1005b4b9
    • 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,
      respectively.
      b9e9df47
    • 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
      field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
      2b371ff7
  6. 01 Nov, 2012 1 commit
  7. 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
      322aea6d
    • 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).
      218e997a
  8. 30 Oct, 2012 3 commits
  9. 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
      here...
      
      * 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.
      ba116008
  10. 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
       'clock'.
       (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
       literal 10000.
      640bf8ad
    • 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
      64ccff5f
    • Stefan Monnier's avatar
      e483264c
  11. 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.
      2f246cd3
    • 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.
      6c16c13e
  12. 26 Oct, 2012 1 commit