1. 01 Jan, 2020 1 commit
  2. 27 Jun, 2019 2 commits
    • Paul Eggert's avatar
      Improve XFIXNUM cleanup a bit · f59a3f3d
      Paul Eggert authored
      Based on Pip Cet’s review (Bug#36370#13).
      * src/ccl.c (Fccl_execute_on_string): Use clearer indexing.
      * src/dosfns.c (Fint86, Fdos_memput):
      Avoid runtime checks for negative fixnums when debugging.
      This restores the earlier machine code.
      * src/lisp.h (XFIXNUM, XUFIXNUM): Use eassert, not eassume.
      (XFIXNAT): At the start, merely eassert FIXNUMP rather
      than eassuming FIXNATP.  At the end, eassume that the
      result is nonnegative.  This restores help to the compiler
      that the previous patch mistakenly removed.
      f59a3f3d
    • Paul Eggert's avatar
      Clean up use of XFIXNUM etc. · 4893a09c
      Paul Eggert authored
      A few bits of the code were relying on the fact that XFIXNUM,
      XFIXNAT, and XUFIXNUM do something even with arguments that
      are not fixnums/fixnats.  Separate these rare uses out into
      XFIXNUM_RAW and XUFIXNUM_RAW.
      Problem and original patch reported by Pip Cet (Bug#36370).
      * src/ccl.c (Fccl_execute_on_string):
      * src/fileio.c (Finsert_file_contents, a_write)
      (Fdo_auto_save):
      * src/process.c (conv_lisp_to_sockaddr):
      * src/textprop.c (Fnext_single_char_property_change)
      (Fprevious_single_char_property_change)
      (Fnext_property_change, Fnext_single_property_change)
      (Fprevious_property_change)
      (Fprevious_single_property_change):
      Don’t assume fixnums are nonnegative.
      * src/ccl.c (Fccl_execute_on_string):
      Fix range-checking bug if AREF (status, i) is out of int range.
      * src/data.c (arith_driver): Use XFIXNUM_RAW as we want
      efficient garbage if the value is not a fixnum.
      * src/dosfns.c (Fint86, Fdos_memput):
      Check that args are nonnegative.
      * src/image.c (lookup_image): Check that args are in range.
      * src/lisp.h (lisp_h_XHASH): Use XUFIXNUM_RAW, since this
      is for hashing.
      (lisp_h_XFIXNAT, XFIXNAT) [USE_LSB_TAG]: Remove macros.
      (lisp_h_XFIXNUM_RAW, XFIXNUM_RAW) [USE_LSB_TAG]: New macros, with
      the semantics of the old macros without _RAW.
      (XFIXNUM_RAW, XUFIXNUM_RAW): New inline functions, with the
      semantics of the old functions without _RAW.
      (FIXNUMP): Move definition up to avoid forward use.
      (XFIXNUM, XFIXNAT, XUFIXNUM): Use eassume to add a runtime
      check (when debugging) that the argument has the proper form.
      (XFIXNUM, XFIXNAT): Now inline functions only, since they
      refer to their arguments more than once now that they use eassume.
      * src/textprop.c (Fprevious_single_char_property_change):
      Avoid fixnum overflow with invalid input.
      (set_text_properties): Fix unlikely failure
      to validate arguments, by using EQ instead of XFIXNAT.
      * src/w32term.c (w32_draw_glyph_string):
      * src/xterm.c (x_draw_glyph_string):
      Treat negative minimums as 0 rather than as garbage patterns.
      4893a09c
  3. 01 Jan, 2019 1 commit
  4. 28 Aug, 2018 1 commit
    • Paul Eggert's avatar
      Improve bignum support for system types · d77d01d2
      Paul Eggert authored
      Use bignums when Emacs converts to and from system types like
      off_t for file sizes whose values can exceed fixnum range.
      Formerly, Emacs sometimes generted floats and sometimes ad-hoc
      conses of integers.  Emacs still accepts floats and conses for
      these system types, in case some stray Lisp code is generating
      them, though this usage is obsolescent.
      * doc/lispref/files.texi (File Attributes):
      * doc/lispref/hash.texi (Defining Hash):
      * doc/lispref/nonascii.texi (Character Sets):
      * doc/lispref/os.texi (User Identification):
      * doc/lispref/processes.texi (System Processes):
      * etc/NEWS:
      Document changes.
      * src/bignum.c (mpz_set_uintmax, make_biguint)
      (mpz_set_uintmax_slow, bignum_to_intmax, bignum_to_uintmax):
      New functions.
      (mpz_set_intmax_slow): Implement via mpz_limbs_write,
      to avoid the need for an extra pass through a negative number.
      * src/charset.c (Fencode_char):
      * src/composite.h (LGLYPH_SET_CODE):
      * src/dired.c (file_attributes):
      * src/dosfns.c, src/w32.c (list_system_processes)
      (system_process_attributes):
      * src/editfns.c (init_editfns, Fuser_uid, Fuser_real_uid)
      (Fgroup_gid, Fgroup_real_gid, Femacs_pid):
      * src/emacs-module.c (check_vec_index):
      * src/fns.c (Fsafe_length):
      * src/process.c (record_deleted_pid, Fprocess_id):
      * src/sysdep.c (list_system_processes, system_process_attributes):
      * src/xselect.c (x_own_selection, selection_data_to_lisp_data):
      * src/xterm.c (set_wm_state):
      * src/inotify.c (inotifyevent_to_event, add_watch)
      (inotify_callback):
      If an integer is out of fixnum range, use a bignum
      instead of converting it to a float or a cons of integers.
      * src/coding.c (Fdefine_coding_system_internal):
      * src/frame.c (frame_windows_min_size)
      (x_set_frame_parameters):
      * src/fringe.c (Fdefine_fringe_bitmap):
      * src/nsterm.m (mouseDown:):
      * src/syntax.c (find_defun_start):
      * src/w32fns.c (x_set_undecorated, w32_createwindow)
      (w32_wnd_proc, Fx_create_frame, Fx_show_tip)
      (w32_console_toggle_lock_key):
      * src/w32inevt.c (key_event):
      * src/w32proc.c (Fw32_get_locale_info):
      Do not mishandle floats by treating their addresses as their
      values.
      * src/data.c (store_symval_forwarding):
      * src/gnutls.c (Fgnutls_error_fatalp, Fgnutls_error_string):
      * src/keyboard.c (command_loop_1, make_lispy_event):
      * src/lread.c (read_filtered_event, read1)
      (substitute_object_recurse):
      * src/window.c (Fcoordinates_in_window_p, Fwindow_at)
      (window_resize_apply, Fset_window_vscroll):
      * src/xdisp.c (handle_single_display_spec, try_scrolling)
      (redisplay_window, calc_pixel_width_or_height)
      (calc_line_height_property, on_hot_spot_p):
      * src/xfaces.c (check_lface_attrs):
      * src/xselect.c (x_get_local_selection, cons_to_x_long)
      (lisp_data_to_selection_data, clean_local_selection_data)
      (x_check_property_data, x_fill_property_data):
      (x_send_client_event):
      Do not reject bignums.
      * src/data.c (INTBIG_TO_LISP, intbig_to_lisp)
      (uintbig_to_lisp):
      Remove.  All uses removed.
      * src/data.c (cons_to_unsigned, cons_to_signed):
      * src/dbusbind.c (xd_signature, xd_extract_signed)
      (xd_extract_unsigned):
      * src/dispnew.c (sit_for):
      * src/dosfns.c, src/w32.c (system_process_attributes):
      * src/editfns.c (Fuser_full_name):
      * src/fileio.c (file_offset):
      * src/fileio.c (write_region):
      * src/font.c (font_unparse_xlfd, font_open_for_lface, Fopen_font):
      * src/frame.c (x_set_screen_gamma):
      * src/frame.h (NUMVAL, FRAME_PIXEL_X_FROM_CANON_X)
      (FRAME_PIXEL_Y_FROM_CANON_Y):
      * src/image.c (parse_image_spec, x_edge_detection)
      (compute_image_size):
      * src/json.c (json_to_lisp):
      * src/lcms.c (PARSE_LAB_LIST_FIELD, Flcms_cie_de2000)
      (PARSE_XYZ_LIST_FIELD, PARSE_JCH_LIST_FIELD)
      (PARSE_JAB_LIST_FIELD, PARSE_VIEW_CONDITION_FLOAT)
      (Flcms_temp_to_white_point):
      * src/nsimage.m (ns_load_image, setSizeFromSpec):
      * src/process.c (Fsignal_process, handle_child_signal):
      * src/sysdep.c (system_process_attributes):
      * src/xdisp.c (calc_line_height_property):
      Handle bignums.
      * src/data.c (Fnumber_to_string): Use proper predicate name in
      signal if the argument is not a number.
      * src/lisp.h (make_uint): New function.
      (INT_TO_INTEGER): New macro.
      (FIXED_OR_FLOATP, CHECK_FIXNUM_OR_FLOAT)
      (CHECK_FIXNUM_OR_FLOAT_COERCE_MARKER, INTEGER_TO_CONS)
      (make_fixnum_or_float): Remove; no longer used.
      * src/nsfns.m, src/w32fns.c, src/xfns.c (Fx_create_frame):
      Reject floating-point min-width or min-height.
      * src/process.c (handle_child_signal): Do not worry
      about floating-point pids, as they are no longer generated.
      d77d01d2
  5. 08 Aug, 2018 1 commit
    • Tom Tromey's avatar
      More macro renamings for bignum · d1ec3a0a
      Tom Tromey authored
      * src/alloc.c, src/bidi.c, src/buffer.c, src/buffer.h, src/bytecode.c,
      src/callint.c, src/callproc.c, src/casefiddle.c, src/casetab.c,
      src/category.c, src/ccl.c, src/character.c, src/character.h,
      src/charset.c, src/charset.h, src/chartab.c, src/cmds.c, src/coding.c,
      src/composite.c, src/composite.h, src/data.c, src/dbusbind.c,
      src/decompress.c, src/dired.c, src/dispextern.h, src/dispnew.c,
      src/disptab.h, src/doc.c, src/dosfns.c, src/editfns.c,
      src/emacs-module.c, src/emacs.c, src/eval.c, src/fileio.c,
      src/floatfns.c, src/fns.c, src/font.c, src/font.h, src/fontset.c,
      src/frame.c, src/frame.h, src/fringe.c, src/ftcrfont.c, src/ftfont.c,
      src/gfilenotify.c, src/gnutls.c, src/gtkutil.c, src/image.c,
      src/indent.c, src/insdel.c, src/intervals.c, src/json.c,
      src/keyboard.c, src/keymap.c, src/kqueue.c, src/lcms.c, src/lisp.h,
      src/lread.c, src/macros.c, src/marker.c, src/menu.c, src/minibuf.c,
      src/msdos.c, src/print.c, src/process.c, src/profiler.c, src/search.c,
      src/sound.c, src/syntax.c, src/syntax.h, src/sysdep.c, src/term.c,
      src/termhooks.h, src/textprop.c, src/undo.c, src/w32.c,
      src/w32console.c, src/w32fns.c, src/w32font.c, src/w32inevt.c,
      src/w32proc.c, src/w32select.c, src/w32term.c, src/w32term.h,
      src/w32uniscribe.c, src/window.c, src/xdisp.c, src/xfaces.c,
      src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c, src/xml.c,
      src/xrdb.c, src/xselect.c, src/xsettings.c, src/xterm.c, src/xwidget.c
      Rename XINT->XFIXNUM, XFASTINT->XFIXNAT, XUINT->XUFIXNUM.
      d1ec3a0a
  6. 13 Jul, 2018 1 commit
    • Tom Tromey's avatar
      Rename integerp->fixnum, etc, in preparation for bignums · 42fe787b
      Tom Tromey authored
      * src/json.c, src/keyboard.c, src/keyboard.h, src/keymap.c,
      src/kqueue.c, src/lcms.c, src/lisp.h, src/lread.c, src/macros.c,
      src/marker.c, src/menu.c, src/minibuf.c, src/msdos.c, src/print.c,
      src/process.c, src/profiler.c, src/search.c, src/sound.c,
      src/syntax.c, src/sysdep.c, src/term.c, src/terminal.c,
      src/textprop.c, src/undo.c, src/w16select.c, src/w32.c,
      src/w32console.c, src/w32cygwinx.c, src/w32fns.c, src/w32font.c,
      src/w32inevt.c, src/w32proc.c, src/w32select.c, src/w32term.c,
      src/w32uniscribe.c, src/widget.c, src/window.c, src/xdisp.c,
      src/xfaces.c, src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c,
      src/xrdb.c, src/xselect.c, src/xterm.c, src/xwidget.c: Rename
      INTEGERP->FIXNUM, make_number->make_fixnum, CHECK_NUMBER->CHECK_FIXNUM,
      make_natnum->make_fixed_natum, NUMBERP->FIXED_OR_FLOATP,
      NATNUMP->FIXNATP, CHECK_NATNUM->CHECK_FIXNAT.
      42fe787b
  7. 13 Feb, 2018 1 commit
    • Glenn Morris's avatar
      Stop keeping multiple doc copies for items defined multiple times · 4bee1b8b
      Glenn Morris authored
      It was always a nuisance to keep all the copies in sync.
      * src/doc.c (Fsnarf_documentation): Don't skip entire files.
      Instead, skip individual doc strings starting with "SKIP".
      * doc/lispref/internals.texi (Writing Emacs Primitives):
      Mention this skipping.
      * lisp/term/ns-win.el, lisp/term/pc-win.el, src/dosfns.c:
      * src/frame.c, src/nsfns.m, src/nsmenu.m, src/nsterm.m:
      * src/w16select.c, src/w32fns.c, src/w32menu.c, src/w32select.c:
      * src/w32term.c, src/xmenu.c: Remove duplicated doc strings.
      * src/xfns.c: Merge in information from doc string duplicates.
      4bee1b8b
  8. 01 Jan, 2018 1 commit
  9. 30 Sep, 2017 1 commit
  10. 01 Jan, 2017 1 commit
  11. 10 Mar, 2016 1 commit
    • Paul Eggert's avatar
      Rework C source files to avoid ^( · 7352c6c6
      Paul Eggert authored
      Work around Bug#22884 by rewording comments and strings to avoid ‘(’
      at the start of a line unless it starts a function.  This change
      is a short-term hack; in the longer run we plan to fix cc-mode’s
      performance for C files that have ‘(’ at the start of a line in a
      comment or string.
      7352c6c6
  12. 01 Jan, 2016 1 commit
  13. 05 Jan, 2015 1 commit
    • Paul Eggert's avatar
      Compute C decls for DEFSYMs automatically · 58f2d6ef
      Paul Eggert authored
      Fixes Bug#15880.
      This patch also makes Q constants (e.g., Qnil) constant addresses
      from the C point of view.
      * make-docfile.c: Revamp to generate table of symbols, too.
      Include <stdbool.h>.
      (xstrdup): New function.
      (main): Don't process the same file twice.
      (SYMBOL): New constant in enum global_type.
      (struct symbol): Turn 'value' member into a union, either v.value
      for int or v.svalue for string.  All uses changed.
      (add_global): New arg svalue, which overrides value, so that globals
      can have a string value.
      (close_emacs_global): New arg num_symbols; all uses changed.
      Output lispsym decl.
      (write_globals): Output symbol globals too.  Output more
      ATTRIBUTE_CONST, now that Qnil etc. are C constants.
      Output defsym_name table.
      (scan_c_file): Move most of guts into ...
      (scan_c_stream): ... new function.  Scan for DEFSYMs and
      record symbols found.  Don't read past EOF if file doesn't
      end in newline.
      * alloc.c, bidi.c, buffer.c, bytecode.c, callint.c, casefiddle:
      * casetab.c, category.c, ccl.c, charset.c, chartab.c, cmds.c, coding.c:
      * composite.c, data.c, dbusbind.c, decompress.c, dired.c, dispnew.c:
      * doc.c, editfns.c, emacs.c, eval.c, fileio.c, fns.c, font.c, fontset.c:
      * frame.c, fringe.c, ftfont.c, ftxfont.c, gfilenotify.c, gnutls.c:
      * image.c, inotify.c, insdel.c, keyboard.c, keymap.c, lread.c:
      * macfont.m, macros.c, minibuf.c, nsfns.m, nsfont.m, nsimage.m:
      * nsmenu.m, nsselect.m, nsterm.m, print.c, process.c, profiler.c:
      * search.c, sound.c, syntax.c, term.c, terminal.c, textprop.c, undo.c:
      * window.c, xdisp.c, xfaces.c, xfns.c, xftfont.c, xmenu.c, xml.c:
      * xselect.c, xsettings.c, xterm.c:
      Remove Q vars that represent symbols (e.g., Qnil, Qt, Qemacs).
      These names are now defined automatically by make-docfile.
      * alloc.c (init_symbol): New function.
      (Fmake_symbol): Use it.
      (c_symbol_p): New function.
      (valid_lisp_object_p, purecopy): Use it.
      * alloc.c (marked_pinned_symbols):
      Use make_lisp_symbol instead of make_lisp_ptr.
      (garbage_collect_1): Mark lispsym symbols.
      (CHECK_ALLOCATED_AND_LIVE_SYMBOL): New macro.
      (mark_object): Use it.
      (sweep_symbols): Sweep lispsym symbols.
      (symbol_uses_obj): New function.
      (which_symbols): Use it.  Work for lispsym symbols, too.
      (init_alloc_once): Initialize Vpurify_flag here; no need to wait,
      since Qt's address is already known now.
      (syms_of_alloc): Add lispsym count to symbols_consed.
      * buffer.c (init_buffer_once): Compare to Qnil, not to make_number (0),
      when testing whether storage is all bits zero.
      * dispextern (struct image_type):
      * font.c (font_property_table):
      * frame.c (struct frame_parm_table, frame_parms):
      * keyboard.c (scroll_bar_parts, struct event_head):
      * xdisp.c (struct props):
      Use XSYMBOL_INIT (Qfoo) and struct Lisp_Symbol * rather than &Qfoo and
      Lisp_Object *, since Qfoo is no longer an object whose address can be
      taken.  All uses changed.
      * eval.c (run_hook): New function.  Most uses of Frun_hooks changed to
      use it, so that they no longer need to take the address of a Lisp sym.
      (syms_of_eval): Don't use DEFSYM on Vrun_hooks, as it's a variable.
      * frame.c (syms_of_frame): Add defsyms for the frame_parms table.
      * keyboard.c (syms_of_keyboard): Don't DEFSYM Qmenu_bar here.
      DEFSYM Qdeactivate_mark before the corresponding var.
      * keymap.c (syms_of_keymap): Use DEFSYM for Qmenu_bar and Qmode_line
      instead of interning their symbols; this avoids duplicates.
      (LISP_INITIALLY, TAG_PTR)
      (DEFINE_LISP_SYMBOL_BEGIN, DEFINE_LISP_SYMBOL_END, XSYMBOL_INIT):
      New macros.
      (LISP_INITIALLY_ZERO): Use it.
      (enum symbol_interned, enum symbol_redirect, struct Lisp_Symbol)
      (EXFUN, DEFUN_ARGS_MANY, DEFUN_ARGS_UNEVALLED, DEFUN_ARGS_*):
      Move decls up, to avoid forward uses.  Include globals.h earlier, too.
      (make_lisp_symbol): New function.
      (XSETSYMBOL): Use it.
      (DEFSYM): Now just a placeholder for make-docfile.
      * lread.c (DEFINE_SYMBOLS): Define, for globals.h.
      (intern_sym): New function, with body taken from old intern_driver.
      (intern_driver): Use it.  Last arg is now Lisp integer, not ptrdiff_t.
      All uses changed.
      (define_symbol): New function.
      (init_obarray): Define the C symbols taken from lispsym.
      Use plain DEFSYM for Qt and Qnil.
      * syntax.c (init_syntax_once): No need to worry about
      Qchar_table_extra_slots.
      58f2d6ef
  14. 01 Jan, 2015 2 commits
  15. 09 Aug, 2014 1 commit
  16. 11 Jul, 2014 1 commit
    • Eli Zaretskii's avatar
      Implement memory-info for MS-DOS. · 5f7c30e7
      Eli Zaretskii authored
       src/dosfns.c (dos_memory_info): New function.
       src/dosfns.h (dos_memory_info): Add prototype.
       src/alloc.c (Fmemory_info) [MSDOS]: Call dos_memory_info.
       src/vm-limit.c (get_lim_data) [MSDOS]: Call dos_memory_info, instead
       of doing some of its job.
      5f7c30e7
  17. 03 Apr, 2014 2 commits
  18. 01 Jan, 2014 1 commit
  19. 06 Nov, 2013 1 commit
  20. 01 Jan, 2013 1 commit
  21. 23 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Simplify and avoid signal-handling races. · 4d7e6e51
      Paul Eggert authored
      * nt/inc/ms-w32.h (emacs_raise): New macro.
      * src/alloc.c (die):
      * src/sysdep.c (emacs_abort) [HAVE_NTGUI]:
      Avoid recursive loop if there's a fatal error in the function itself.
      * src/atimer.c (pending_atimers):
      * src/blockinput.h: Don't include "atimer.h"; no longer needed.
      (interrupt_input_pending): Remove.  All uses removed.
      pending_signals now counts both atimers and ordinary interrupts.
      This is less racy than having three separate pending-signal flags.
      (block_input, unblock_input, totally_unblock_input, unblock_input_to)
      (input_blocked_p):
      Rename from their upper-case counterparts BLOCK_INPUT,
      UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
      INPUT_BLOCKED_P, and turn into functions.  All uses changed.
      This makes it easier to access volatile variables more accurately.
      (BLOCK_INPUT_RESIGNAL): Remove.  All uses replaced by unblock_input ().
      (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
      that's more reliable if the code is buggy and sets
      interrupt_input_blocked to a negative value.  All uses changed.
      * src/atimer.c (deliver_alarm_signal):
      Remove.  No need to deliver this to the parent; any thread can
      handle this signal now.  All uses replaced by underlying handler.
      * src/atimer.c (turn_on_atimers):
      * src/dispnew.c (handle_window_change_signal):
      * src/emacs.c (handle_danger_signal):
      * src/keyboard.c (kbd_buffer_get_event):
      Don't reestablish signal handler; not needed with sigaction.
      * src/blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
      (UNBLOCK_INPUT_TO):
      Rework to avoid unnecessary accesses to volatile variables.
      (UNBLOCK_INPUT_TO): Now a function.
      (totally_unblock_input, unblock_input): New decls.
      * src/data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
      (init_data): Remove.  Necessary stuff now done in init_signal.
      * src/emacs.c, src/xdisp.c: Include "atimer.h", since we invoke atimer functions.
      * src/emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
      (fatal_error_code): Remove; no longer needed.
      (terminate_due_to_signal): Rename from fatal_error_backtrace, since
      it doesn't always backtrace.  All uses changed.  No need to reset
      signal to default, since sigaction and/or die does that for us now.
      Use emacs_raise (FOO), not kill (getpid (), FOO).
      (main): Check more-accurately whether we're dumping.
      Move fatal-error setup to sysdep.c
      * src/floatfns.c: Do not include "syssignal.h"; no longer needed.
      * src/gtkutil.c (xg_get_file_name, xg_get_font):
      Remove no-longer-needed signal-mask manipulation.
      * src/keyboard.c, src/process.c (POLL_FOR_INPUT):
      Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
      * src/keyboard.c (read_avail_input): Remove.
      All uses replaced by gobble_input.
      (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
      (kbd_buffer_store_event_hold, gobble_input):
      (record_asynch_buffer_change) [USABLE_SIGIO]:
      (store_user_signal_events):
      No need to mess with signal mask.
      (gobble_input): If blocking input and there are terminals, simply
      set pending_signals to 1 and return.  All hooks changed to not
      worry about whether input is blocked.
      (process_pending_signals): Clear pending_signals before processing
      them, in case a signal comes in while we're processing.
      By convention callers now test pending_signals before calling us.
      (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
      New functions, to support changes to blockinput.h.
      (handle_input_available_signal): Now extern.
      (reinvoke_input_signal): Remove.  All uses replaced by
      handle_async_input.
      (quit_count): Now volatile, since a signal handler uses it.
      (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.  All
      callers changed.  Block SIGINT only if not already blocked.
      Clear sigmask reliably, even if Fsignal returns, which it can.
      Omit unnecessary accesses to volatile var.
      (quit_throw_to_read_char): No need to restore sigmask.
      * src/keyboard.c (gobble_input, handle_user_signal):
      * src/process.c (wait_reading_process_output):
      Call signal-handling code rather than killing ourselves.
      * src/lisp.h: Include <float.h>, for...
      (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
      (pending_signals): Now volatile.
      (syms_of_data): Now const if IEEE floating point.
      (handle_input_available_signal) [USABLE_SIGIO]:
      (terminate_due_to_signal, record_child_status_change): New decls.
      * src/process.c (create_process): Avoid disaster if memory is exhausted
      while we're processing a vfork, by tightening the critical section
      around the vfork.
      (send_process_frame, process_sent_to, handle_pipe_signal)
      (deliver_pipe_signal): Remove.  No longer needed, as Emacs now
      ignores SIGPIPE.
      (send_process): No need for setjmp/longjmp any more, since the
      SIGPIPE stuff is now gone.  Instead, report an error if errno
      is EPIPE.
      (record_child_status_change): Now extern.  PID and W are now args.
      Return void, not bool.  All callers changed.
      * src/sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
      Remove.  All uses removed.  This bug should be fixed now in a
      different way.
      (wait_for_termination_1): Use waitpid rather than sigsuspend,
      and record the child status change directly.  This avoids the
      need to futz with the signal mask.
      (process_fatal_action): Move here from emacs.c.
      (emacs_sigaction_flags): New function, containing
      much of what used to be in emacs_sigaction_init.
      (emacs_sigaction_init): Use it.  Block nonfatal system signals that are
      caught by emacs, to make races less likely.
      (deliver_process_signal): Rename from handle_on_main_thread.
      All uses changed.
      (BACKTRACE_LIMIT_MAX): Now at top level.
      (thread_backtrace_buffer, threadback_backtrace_pointers):
      New static vars.
      (deliver_thread_signal, deliver_fatal_thread_signal):
      New functions, for more-accurate delivery of thread-specific signals.
      (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
      (deliver_arith_signal): Handle in this thread, not
      in the main thread, since it's triggered by this thread.
      (maybe_fatal_sig): New function.
      (init_signals): New arg DUMPING so that we can be more accurate
      about whether we're dumping.  Caller changed.
      Treat thread-specific signals differently from process-general signals.
      Block all signals while handling fatal error; that's safer.
      xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
      on IEEE hosts.
      When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
      Ignore SIGPIPE unless batch.
      (emacs_backtrace): Output backtrace for the appropriate thread,
      which is not necessarily the main thread.
      * src/syssignal.h: Include <stdbool.h>.
      (emacs_raise): New macro.
      * src/xterm.c (x_connection_signal): Remove; no longer needed
      now that we use sigaction.
      (x_connection_closed): No need to mess with sigmask now.
      (x_initialize): No need to reset SIGPIPE handler here, since
      init_signals does this for us now.
      
      Fixes: debbugs:12471
      4d7e6e51
  22. 15 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Port better to POSIX hosts lacking _setjmp. · 0328b6de
      Paul Eggert authored
      * configure.ac (HAVE__SETJMP, HAVE_SIGSETJMP): New symbols.
      (_setjmp, _longjmp): Remove.
      * src/lisp.h: Include <setjmp.h> here, since we use its symbols here.
      All instances of '#include <setjmp.h>' removed, if the
      only reason for the instance was because "lisp.h" was included.
      (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
      Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
      and _longjmp with the new symbols.  Emacs already uses _setjmp if
      available, so this change affects only POSIXish hosts that have
      sigsetjmp but not _setjmp, such as some versions of Solaris and
      Unixware.  (Also, POSIX-2008 marks _setjmp as obsolescent.)
      * src/image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
      (png_load_body) [HAVE_PNG]:
      (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
      (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
      Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
      since PNG requires jmp_buf.  This is the only exception to the
      general rule that we now use sys_setjmp and sys_longjmp.
      This exception is OK since this code does not change the signal
      mask or longjmp out of a signal handler.
      
      Fixes: debbugs:12446
      0328b6de
  23. 17 Aug, 2012 1 commit
    • Paul Eggert's avatar
      * frame.h (FSET): Remove (Bug#12215). · f00af5b1
      Paul Eggert authored
      Replace all uses with calls to new setter functions.
      Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
      (FRAME_INLINE): New macro.
      (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
      (fset_current_tool_bar_string, fset_desired_tool_bar_string)
      (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
      (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
      (fset_param_alist, fset_root_window, fset_scroll_bars)
      (fset_selected_window, fset_title, fset_tool_bar_items)
      (fset_tool_bar_position, fset_tool_bar_window): New functions.
      * frame.c (FRAME_INLINE):
      Define to EXTERN_INLINE, so that the corresponding functions
      are compiled into code.
      (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
      f00af5b1
  24. 07 Aug, 2012 1 commit
    • Dmitry Antipov's avatar
      Drop FGET and revert read access to Lisp_Objects slots of struct frame. · e69b0960
      Dmitry Antipov authored
      * frame.h (FGET): Remove.
      (struct frame): Do not use INTERNAL_FIELD.
      * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
      * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
      * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
      * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
      e69b0960
  25. 06 Aug, 2012 1 commit
    • Dmitry Antipov's avatar
      Separate read and write access to Lisp_Object slots of struct frame. · edd74c35
      Dmitry Antipov authored
      * frame.h (FGET, FSET): New macros similar to AREF and ASET.
      * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
      * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
      * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
      * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
      edd74c35
  26. 31 Jul, 2012 1 commit
    • Dmitry Antipov's avatar
      Generalize INTERNAL_FIELD between buffers, keyboards and frames. · e34f7f79
      Dmitry Antipov authored
      * src/lisp.h (INTERNAL_FIELD): New macro.
      * src/buffer.h (BUFFER_INTERNAL_FIELD): Removed.
      (BVAR): Change to use INTERNAL_FIELD.
      * src/keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
      (KVAR): Change to use INTERNAL_FIELD.
      * src/frame.h (FVAR): New macro.
      (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
      * src/alloc.c, src/buffer.c, src/data.c, src/dispnew.c, src/dosfns.c
      * src/eval.c, src/frame.c, src/fringe.c, src/gtkutil.c, src/minibuf.c
      * src/nsfns.m, src/nsterm.m, src/print.c, src/term.c, src/w32fns.c
      * src/w32menu.c, src/w32term.c, src/window.c, src/window.h, src/xdisp.c
      * src/xfaces.c, src/xfns.c, src/xmenu.c, src/xterm.c: Users changed.
      * admin/coccinelle/frame.cocci: Semantic patch to replace direct
      access to Lisp_Object members of struct frame to FVAR.
      e34f7f79
  27. 20 Jul, 2012 1 commit
    • Dmitry Antipov's avatar
      Simple wrapper for make_unibyte_string, adjust font_open_by_name. · d7ea76b4
      Dmitry Antipov authored
      * src/lisp.h (build_unibyte_string): New function.
      * src/dosfns.c, src/fileio.c, src/fns.c, src/ftfont.c, src/process.c:
      * src/sysdep.c, src/w32fns.c, src/xfns.c: Use it.
      * src/font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
      of type Lisp_Object to avoid redundant calls to make_unibyte_string.
      Adjust users accordingly.
      * src/font.h (font_open_by_name): Adjust prototype.
      * admin/coccinelle/unibyte_string.cocci: Semantic patch to convert from
      make_unibyte_string to build_unibyte_string where appropriate.
      d7ea76b4
  28. 03 Jul, 2012 1 commit
    • Tom Tromey's avatar
      Auto-generate EXFUN using make-docfile · 404dbd37
      Tom Tromey authored
      src
      	* window.c (Fset_window_margins, Fset_window_fringes)
      	(Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
      	* textprop.c (Fprevious_property_change): No longer static.
      	* syntax.c (Fsyntax_table_p): No longer static.
      	* process.c (Fget_process, Fprocess_datagram_address): No longer
      	static.
      	* keymap.c (Flookup_key, Fcopy_keymap): No longer static.
      	* keyboard.c (Fcommand_execute): No longer static.
      	Remove EXFUN.
      	* insdel.c (Fcombine_after_change_execute): No longer static.
      	* image.c (Finit_image_library): No longer static.
      	* fileio.c (Fmake_symbolic_link): No longer static.
      	* eval.c (Ffetch_bytecode): No longer static.
      	* editfns.c (Fuser_full_name): No longer static.
      	* doc.c: (Fdocumentation_property, Fsnarf_documentation): No
      	longer static.
      	* buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
      	static.
      	* dired.c (Ffile_attributes): No longer static.
      	* composite.c (Fcomposition_get_gstring): No longer static.
      	* callproc.c (Fgetenv_internal): No longer static.
      
      	* ccl.h: Remove EXFUNs.
      	* buffer.h: Remove EXFUNs.
      	* dispextern.h: Remove EXFUNs.
      	* intervals.h: Remove EXFUNs.
      	* fontset.h: Remove EXFUN.
      	* font.h: Remove EXFUNs.
      	* dosfns.c (system_process_attributes): Remove EXFUN.
      	* keymap.h: Remove EXFUNs.
      	* lisp.h: Remove EXFUNs.
      	* w32term.h: Remove EXFUNs.
      	* window.h: Remove EXFUNs.
      	* xsettings.h: Remove EXFUN.
      	* xterm.h: Remove EXFUN.
      
      lib-src
      	* make-docfile.c (enum global_type) <FUNCTION>: New constant.
      	(struct global) <value>: New field.
      	(add_global): Add 'value' argument.
      	(compare_globals): Sort functions at the end.
      	(close_emacs_globals): New function.
      	(write_globals): Handle functions.
      	(scan_c_file): Call add_global for DEFUN.
      404dbd37
  29. 02 Jul, 2012 1 commit
  30. 30 Jun, 2012 1 commit
    • Eli Zaretskii's avatar
      Adapt the MS-DOS build to the latest changes. · 0d23c240
      Eli Zaretskii authored
       msdos/mainmake.v2 (bootstrap-clean): Do a maintainer-clean in lib, not
       bootstrap-clean (which doesn't exist).
       msdos/inttypes.h (PRIuMAX) [__DJGPP__ < 2.04]: Define to "llu".
       msdos/sedleim.inp (MKDIR_P): Edit to DOS "md" command.
       msdos/sed1v2.inp: (LIB_CLOCK_GETTIME): Edit to empty.
       Remove lines that invoke PAXCTL.
       (clean): Fix recipe not to run Unixy shell commands.
       msdos/sed2v2.inp (GETTIMEOFDAY_TIMEZONE): Edit to 'struct timezone'.
       (HAVE_STRNCASECMP): Edit to 1.
       msdos/sed3v2.inp (LIB_CLOCK_GETTIME): Edit to empty.
       (C_SWITCH_SYSTEM): Add "-I../msdos".
       msdos/sedlibmk.inp (GNULIB_GETTIMEOFDAY, GNULIB_PSELECT)
       (GNULIB_SELECT, HAVE_STRUCT_TIMEVAL, HAVE_SYS_SELECT_H)
       (HAVE_SYS_TIME_H, NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H)
       (NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H, NEXT_SYS_SELECT_H)
       (NEXT_SYS_TIME_H, REPLACE_GETTIMEOFDAY, REPLACE_PSELECT)
       (REPLACE_STRUCT_TIMEVAL): Edit to appropriate values.
       (BUILT_SOURCES): Edit out sys/select.h and sys/time.h.
       (mostlyclean-local, distclean-generic): Fix recipe not to run
       Unixy shell commands.
      
       src/sysselect.h [DOS_NT]: Don't include sys/select.h.
       src/s/ms-w32.h (select, pselect): Don't define here, they are
       defined in sysselect.h
       src/sysselect.h (pselect) [!HAVE_PSELECT]: Redirect to sys_select.
       src/sysdep.c: Don't include dos.h and dosfns.h.
       src/process.c (sys_select):
       src/msdos.c (sys_select): Accept one more argument and ignore it.
       src/msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
       adapt data types and code to that.
       src/dosfns.c:
       src/msdos.c (gettime, settime): Define away the prototypes in dos.h,
       which clashes with the gnulib function of the same name.
      
       lisp/emacs-lisp/timer.el (timer-until): Subtract results of
       float-time, instead of taking float-time of the result of
       time-subtract, since float-time signals an error for negative time
       arguments.
      0d23c240
  31. 19 Jun, 2012 1 commit
  32. 16 Jun, 2012 1 commit
    • Andreas Schwab's avatar
      * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline. · e5560ff7
      Andreas Schwab authored
      (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
      * character.c (_fetch_multibyte_char_p): Remove.
      * alloc.c: Include "character.h" before "buffer.h".
      * bidi.c: Likewise.
      * buffer.c: Likewise.
      * bytecode.c: Likewise.
      * callint.c: Likewise.
      * callproc.c: Likewise.
      * casefiddle.c: Likewise.
      * casetab.c: Likewise.
      * category.c: Likewise.
      * cmds.c: Likewise.
      * coding.c: Likewise.
      * composite.c: Likewise.
      * dired.c: Likewise.
      * dispnew.c: Likewise.
      * doc.c: Likewise.
      * dosfns.c: Likewise.
      * editfns.c: Likewise.
      * emacs.c: Likewise.
      * fileio.c: Likewise.
      * filelock.c: Likewise.
      * font.c: Likewise.
      * fontset.c: Likewise.
      * fringe.c: Likewise.
      * indent.c: Likewise.
      * insdel.c: Likewise.
      * intervals.c: Likewise.
      * keyboard.c: Likewise.
      * keymap.c: Likewise.
      * lread.c: Likewise.
      * macros.c: Likewise.
      * marker.c: Likewise.
      * minibuf.c: Likewise.
      * nsfns.m: Likewise.
      * nsmenu.m: Likewise.
      * print.c: Likewise.
      * process.c: Likewise.
      * regex.c: Likewise.
      * region-cache.c: Likewise.
      * search.c: Likewise.
      * syntax.c: Likewise.
      * term.c: Likewise.
      * textprop.c: Likewise.
      * undo.c: Likewise.
      * unexsol.c: Likewise.
      * w16select.c: Likewise.
      * w32fns.c: Likewise.
      * w32menu.c: Likewise.
      * window.c: Likewise.
      * xdisp.c: Likewise.
      * xfns.c: Likewise.
      * xmenu.c: Likewise.
      * xml.c: Likewise.
      * xselect.c: Likewise.
      e5560ff7
  33. 09 Apr, 2012 1 commit
  34. 11 Jan, 2012 1 commit
  35. 05 Jan, 2012 1 commit
  36. 09 Sep, 2011 1 commit
  37. 30 Apr, 2011 1 commit
    • Eli Zaretskii's avatar
      Adapt the MSDOS build to latest changes. · 8db90b73
      Eli Zaretskii authored
       msdos/inttypes.h: New file.
       msdos/sed2v2.inp (HAVE_DECL_STRTOULL, HAVE_DECL_STRTOUMAX)
       (HAVE_STRTOULL, HAVE_STRTOULL): Define to 1.
       src/sedlibmk.inp (BUILT_SOURCES): Edit out inttypes.h.
       src/sed1v2.inp (CPPFLAGS): Edit to "-I../msdos".
       Add ../msdos/inttypes.h to prerequisites of lread.o.
       src/dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
       rather than `XVECTOR (FOO)->size'.
      8db90b73