1. 06 Dec, 2012 3 commits
    • Dmitry Antipov's avatar
      * frame.h (x_char_width, x_char_height): Remove prototypes. · 1700db3c
      Dmitry Antipov authored
      * 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.
    • Paul Eggert's avatar
      Fix a recently-introduced delete-process race condition. · 35fb8050
      Paul Eggert authored
      * 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.
    • Dmitry Antipov's avatar
      Avoid code duplication between prev_frame and next_frame. · 565212e5
      Dmitry Antipov authored
      * frame.c (candidate_frame): New function.  Add comment.
      (prev_frame, next_frame): Use it.  Adjust comment.
  2. 05 Dec, 2012 3 commits
  3. 04 Dec, 2012 3 commits
  4. 03 Dec, 2012 6 commits
    • Paul Eggert's avatar
      Don't let call-process be a zombie factory. · bb5f74ee
      Paul Eggert authored
      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
      (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.
      Fixes: debbugs:12980
    • Paul Eggert's avatar
      * bytecode.c, lisp.h (Qbytecode): Remove. · bc9dbce6
      Paul Eggert authored
      No longer needed after 2012-11-20 interactive-p changes.
    • Eli Zaretskii's avatar
      Fix bug #13055 with cursor positioning inside scroll-margin. · 3cf3c607
      Eli Zaretskii authored
       src/xdisp.c (redisplay_window): If the cursor is visible, but inside
       the scroll margin, move point outside the margin.
    • Jan Djärv's avatar
      * gtkutil.c (my_log_handler): New function. · 005c8d13
      Jan Djärv authored
      (xg_set_geometry): Set log handler to my_log_handler.
      Fixes: debbugs:11177
    • Dmitry Antipov's avatar
      * lisp.h (modify_region): Rename to... · 20edc1c9
      Dmitry Antipov authored
      (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 boolean arg.
    • Dmitry Antipov's avatar
      * alloc.c (free_save_value): New function. · 62c2e5ed
      Dmitry Antipov authored
      (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.
  5. 02 Dec, 2012 2 commits
    • Paul Eggert's avatar
      Fix xpalloc confusion after memory is exhausted. · 2dd2e622
      Paul Eggert authored
      * 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.
    • Paul Eggert's avatar
      Use execve to avoid need to munge environ. · 21e54a94
      Paul Eggert authored
      * 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.
      Fixes: debbugs:13054
  6. 01 Dec, 2012 3 commits
  7. 30 Nov, 2012 2 commits
    • Juanma Barranquero's avatar
      src/doc.c: Fix bug#13034. · f8aff4c6
      Juanma Barranquero authored
      (Fdocumentation): Re-add handling of function-documentation,
      accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca.
    • Fabrice Popineau's avatar
      Fix compilation problems with 64-bit MSVC compiler. · c7b36b95
      Fabrice Popineau authored
       src/w32fns.c: Remove prototype of atof.
       (syspage_mask): Declared DWORD_PTR, for compatibility with 64-bit
       (file_dialog_callback): Declared UINT_PTR.
       src/w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
       with 64-bit builds.
       (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
  8. 29 Nov, 2012 2 commits
  9. 28 Nov, 2012 1 commit
    • Paul Eggert's avatar
      * callproc.c (Fcall_process): Fix vfork portability problems. · 60aeceb8
      Paul Eggert authored
      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.
      Now local constants, not macros.
  10. 27 Nov, 2012 4 commits
  11. 26 Nov, 2012 1 commit
  12. 25 Nov, 2012 1 commit
  13. 24 Nov, 2012 4 commits
  14. 23 Nov, 2012 5 commits
    • Paul Eggert's avatar
      Fix a race condition with glib (Bug#8855). · 6d4e8f62
      Paul Eggert authored
      This is a backport from the trunk, consisting of:
      2012-11-17  Eli Zaretskii  <eliz@gnu.org>
      * nt/inc/sys/wait.h: New file, with prototype of waitpid and
      definitions of macros it needs.
      * nt/inc/ms-w32.h (wait): Don't define, 'wait' is not used anymore.
      (sys_wait): Remove prototype.
      * nt/config.nt (HAVE_SYS_WAIT_H): Define to 1.
      * src/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
      (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
      (sys_select): Don't set dead_child.
      * src/sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
      as it is no longer needed.
      * src/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.
      2012-11-03  Paul Eggert  <eggert@cs.ucla.edu>
      Fix a race condition that causes Emacs to mess up glib (Bug#8855).
      This is a backport from the trunk.
      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.
      * src/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.
      * src/process.h (Lisp_Process): New boolean member 'alive'.
    • Dmitry Antipov's avatar
      * frame.h (struct frame): Remove display_preempted member · f418b22e
      Dmitry Antipov authored
      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.
    • Eli Zaretskii's avatar
      Fix bug #12955 with building under MSYS Bash. · a879f0ea
      Eli Zaretskii authored
       src/makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
       of a literal "/".
       (gl-stamp): Invoke fc.exe directly, not through cmd.
    • Eli Zaretskii's avatar
      Fix cursor display when several display strings follow each other. · 24becea4
      Eli Zaretskii authored
       src/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.
    • Eli Zaretskii's avatar
      Fix pgx in .gdbinit when CHECK_LISP_OBJECT_TYPE is defined. · 8654a41b
      Eli Zaretskii authored
       src/.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).