1. 08 Nov, 2012 4 commits
    • Stefan Monnier's avatar
      Use ad-hoc comparison function for the profiler's hash-tables. · b7432bb2
      Stefan Monnier authored
      * src/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.
      * src/lisp.h (struct hash_table_test): New struct.
      (struct Lisp_Hash_Table): Use it.
      * src/alloc.c (mark_object): Mark hash_table_test fields of hash tables.
      * src/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.
      * src/emacs.c (main): Move syms_of_fns earlier.
      * src/xterm.c (syms_of_xterm):
      * src/category.c (hash_get_category_set): Adjust call to make_hash_table.
      * src/print.c (print_object): Adjust to new hash-table struct.
      * src/composite.c (composition_gstring_put_cache): Adjust to new hashfn.
      b7432bb2
    • Eli Zaretskii's avatar
      More fixes for bug #12806. · 88002743
      Eli Zaretskii authored
       src/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.
      88002743
    • Dmitry Antipov's avatar
      Shrink struct vectorlike_header to the only size field. · 914adc42
      Dmitry Antipov authored
      * 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.
      914adc42
    • Dmitry Antipov's avatar
      * keyboard.c (event_to_kboard): Do not dereference · c66f21ea
      Dmitry Antipov authored
      frame_or_window field of SELECTION_REQUEST_EVENT
      and SELECTION_CLEAR_EVENT events (Bug#12814).
      * xterm.h (struct selection_input_event): Adjust comment.
      c66f21ea
  2. 07 Nov, 2012 5 commits
  3. 06 Nov, 2012 7 commits
    • Paul Eggert's avatar
      Restore some duplicate definitions. · b6b3b294
      Paul Eggert authored
      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.
      b6b3b294
    • Jan Djärv's avatar
      * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask · e770aad5
      Jan Djärv authored
      to keypad keys.
      
      Fixes: debbugs:12816
      e770aad5
    • Paul Eggert's avatar
      Minor adjustments of recently-changed frame functions. · 68f8f1c0
      Paul Eggert authored
      * 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.
      68f8f1c0
    • Dmitry Antipov's avatar
      * window.c (Fwindow_combination_limit): Revert to the only · 72f94d4b
      Dmitry Antipov authored
      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>.
      72f94d4b
    • Juanma Barranquero's avatar
    • Dmitry Antipov's avatar
      Widely used frame validity and checking functions. · d9f07150
      Dmitry Antipov authored
      * 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.
      d9f07150
    • Dmitry Antipov's avatar
      * window.c (quad): New function. · 89bc0592
      Dmitry Antipov authored
      (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.
      89bc0592
  4. 05 Nov, 2012 6 commits
    • Juanma Barranquero's avatar
      Fix typos. · 8e2417bf
      Juanma Barranquero authored
      8e2417bf
    • 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
  5. 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
  6. 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
  7. 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
  8. 02 Nov, 2012 1 commit
    • 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