1. 13 Jul, 2018 1 commit
  2. 17 Apr, 2018 1 commit
  3. 28 Jan, 2018 1 commit
    • Noam Postavsky's avatar
      Revert "Signal error for symbol names with strange quotes (Bug#2967)" · 0510a78d
      Noam Postavsky authored
      That commit did not make the corresponding change to printing, thus
      breaking the (eq (read (prin1-to-string SYM)) SYM) invariant for those
      symbols.  It's too late in the release cycle to change printing
      behavior, therefore revert the reader change.
      
      Don't merge to master, the print function will be updated there (see
      "Fix round tripping of read->print for symbols with strange quotes").
      0510a78d
  4. 01 Jan, 2018 1 commit
  5. 27 Nov, 2017 1 commit
  6. 13 Nov, 2017 1 commit
    • Paul Eggert's avatar
      Use alignas to fix GCALIGN-related bugs · b1573a97
      Paul Eggert authored
      Use alignas and unions to specify alignments of objects needing
      addresses that are at least a multiple of GCALIGNMENT.  Using
      these standard C facilities should be safer than relying on ad hoc
      and poorly-understood features like GCC’s __attribute__
      ((aligned (N))), the root cause for recent porting bugs like
      Bug#29040.  The alignas macro was standardized by C11 and Gnulib
      supports alignas for pre-C11 platforms.  I have tested this on Sun
      Studio 12 sparc (2007) and GCC 4.4.7 x86-64 (2012) as well as on
      more recent platforms like GCC 7.2.1 (2017) on Fedora 26 (both
      x86-64 and x86).
      * lib-src/make-docfile.c (close_emacs_globals): lispsym is now
      just an array of struct Lisp_Symbol, since struct Lisp_Symbol is
      now properly aligned.  All uses changed.
      * src/alloc.c (NEXT_FREE_LISP_STRING): Just use the new u.next
      member; this is simpler and safer than casting a pointer that
      might not be aligned properly.
      (aligned_Lisp_Symbol): Remove.  No longer needed, now that struct
      Lisp_Symbol is aligned properly.  All uses replaced with struct
      Lisp_Symbol.
      * src/lisp.h (GCALIGNED): Remove, as it does not work as expected:
      it can cause the natural alignment to be ignored.  All uses
      replaced by unions with a ‘char alignas (GCALIGNMENT)’ member as
      described below.
      (struct Lisp_Symbol, struct Lisp_Cons, struct Lisp_String):
      Change definition from ‘struct TAG { MEMBERS };’ to
      ‘struct TAG { union { struct { MEMBERS } s; char alignas
      (GCALIGNMENT) gcaligned; } u; };’.  This guarantees ‘struct TAG’
      to have an alignment that at least max (GCALIGNMENT, N) where N is
      its old alignment.  All uses like ‘PTR->MEMBER’ changed to
      ‘PTR->u.s.MEMBER’; these uses were supposed to be mostly private
      anyway.  Verify that the resulting ‘struct TAG’ is properly
      aligned for Emacs.
      (union vectorlike_header): New member ‘gcaligned’ to guarantee
      that this type, and its containing types like ‘struct Lisp_Subr’,
      ‘struct buffer’ and ‘struct thread_state’, are all properly
      aligned for Emacs.
      (struct Lisp_String): New union member ‘next’, for the benefit
      of NEXT_FREE_LISP_STRING.
      (union Aligned_Cons, union Aligned_String): Remove.  All uses
      replaced by struct Lisp_Cons and struct Lisp_String, since they
      are now properly aligned.
      (USE_STACK_CONS, USE_STACK_STRING): Simplify now that we can
      assume struct Lisp_Cons and struct Lisp_String are properly
      aligned.
      b1573a97
  7. 09 Oct, 2017 1 commit
  8. 13 Sep, 2017 1 commit
    • Paul Eggert's avatar
      Prefer HTTPS to FTP and HTTP in documentation · bc511a64
      Paul Eggert authored
      Most of this change is to boilerplate commentary such as license URLs.
      This change was prompted by ftp://ftp.gnu.org's going-away party,
      planned for November.  Change these FTP URLs to https://ftp.gnu.org
      instead.  Make similar changes for URLs to other organizations moving
      away from FTP.  Also, change HTTP to HTTPS for URLs to gnu.org and
      fsf.org when this works, as this will further help defend against
      man-in-the-middle attacks (for this part I omitted the MS-DOS and
      MS-Windows sources and the test tarballs to keep the workload down).
      HTTPS is not fully working to lists.gnu.org so I left those URLs alone
      for now.
      bc511a64
  9. 22 Jul, 2017 1 commit
  10. 14 Jul, 2017 1 commit
    • Paul Eggert's avatar
      Improve stack-overflow heuristic on GNU/Linux · 9dee1c88
      Paul Eggert authored
      Problem reported by Steve Kemp (Bug#27585).
      * src/eval.c (near_C_stack_top): Remove.  All uses replaced
      by current_thread->stack_top.
      (record_in_backtrace): Set current_thread->stack_top.
      This is for when the Lisp interpreter calls itself.
      * src/lread.c (read1): Set current_thread->stack_top.
      This is for recursive s-expression reads.
      * src/print.c (print_object): Set current_thread->stack_top.
      This is for recursive s-expression printing.
      * src/thread.c (mark_one_thread): Get stack top first.
      * src/thread.h (struct thread_state.stack_top): Now void *, not char *.
      9dee1c88
  11. 12 Jul, 2017 1 commit
  12. 09 Jul, 2017 1 commit
    • Paul Eggert's avatar
      Fix core dump in substitute-object-in-subtree · 083940a9
      Paul Eggert authored
      Without this fix, (substitute-object-in-subtree #0=(#0# 'a) 'a)
      would dump core, since the C code would recurse indefinitely through
      the infinite structure.  This patch adds an argument to the function,
      and renames it to lread--substitute-object-in-subtree as the function
      is not general-purpose and should not be relied on by outside code.
      See Bug#23660.
      * src/intervals.c (traverse_intervals_noorder): ARG is now void *,
      not Lisp_Object, so that callers need not cons unnecessarily.
      All callers changed.  Also, remove related #if-0 code that was
      “temporary” in the early 1990s and has not been compilable for
      some time.
      * src/lread.c (struct subst): New type, for substitution closure data.
      (seen_list): Remove this static var, as this info is now part of
      struct subst.  All uses removed.
      (Flread__substitute_object_in_subtree): Rename from
      Fsubstitute_object_in_subtree, and give it a 3rd arg so that it
      doesn’t dump core when called from the top level with an
      already-cyclic structure.  All callers changed.
      (SUBSTITUTE): Remove.  All callers expanded and then simplified.
      (substitute_object_recurse): Take a single argument SUBST rather
      than a pair OBJECT and PLACEHOLDER, so that its address can be
      passed around as part of a closure; this avoids the need for an
      AUTO_CONS call.  All callers changed.  If the COMPLETED component
      is t, treat every subobject as potentially circular.
      (substitute_in_interval): Take a struct subst * rather than a
      Lisp_Object, for the closure data.  All callers changed.
      * test/src/lread-tests.el (lread-lread--substitute-object-in-subtree):
      New test, to check that the core dump does not reoccur.
      083940a9
  13. 08 Jul, 2017 2 commits
    • Paul Eggert's avatar
      Fix more ungetc bugs with encoding errors · b8ead34f
      Paul Eggert authored
      * src/lread.c (infile): New variable, replacing ...
      (instream): ... this.  All uses changed.
      (readbyte_from_stdio): New function, which deals with lookahead.
      (readbyte_from_file, Fget_file_char): Use it.
      (Fget_file_char): When misused, signal an error instead of
      relying on undefined behavior.
      (close_infile_unwind): New function.
      (Fload): Use it.
      (readevalloop): 2nd arg is now struct infile *, not FILE *.
      All callers changed.
      (read1): Handle lookahead when copying doc strings with
      encoding errors.
      b8ead34f
    • Paul Eggert's avatar
      Fix ungetc bug when reading an encoding error · d2832063
      Paul Eggert authored
      * src/lread.c (readchar, read_emacs_mule_char): Fix off-by-one
      error when reading an encoding error from a file, e.g., a symbol
      in an .elc file whose name is "\360\220\200\360".
      d2832063
  14. 06 Jul, 2017 1 commit
    • Paul Eggert's avatar
      Convert hex digits more systematically · d6662694
      Paul Eggert authored
      This makes the code a bit smaller and presumably faster, as
      it substitutes a single lookup for conditional jumps.
      * src/character.c (hexdigit): New constant.
      (syms_of_character) [HEXDIGIT_IS_CONST]: Initialize it.
      * src/character.h (HEXDIGIT_CONST, HEXDIGIT_IS_CONST): New macros.
      (hexdigit): New decl.
      (char_hexdigit): New inline function.
      * src/charset.c: Do not include c-ctype.h.
      * src/charset.c (read_hex):
      * src/editfns.c (styled_format):
      * src/image.c (xbm_scan):
      * src/lread.c (read_escape):
      * src/regex.c (ISXDIGIT) [emacs]:
      Use char_hexdigit insted of doing it by hand.
      d6662694
  15. 22 Jun, 2017 7 commits
    • Paul Eggert's avatar
      Use unlocked stdio more systematically · f6ef15cf
      Paul Eggert authored
      This can improve performance significantly on stdio-bottlenecked code.
      E.g., make-docfile is 3x faster on my Fedora 25 x86-64 desktop.
      * admin/merge-gnulib (GNULIB_MODULES): Add unlocked-io.
      * lib-src/ebrowse.c, lib-src/emacsclient.c, lib-src/etags.c:
      * lib-src/hexl.c, lib-src/make-docfile.c, lib-src/movemail.c:
      * lib-src/profile.c, lib-src/update-game-score.c:
      Include unlocked-io.h instead of stdio.h, since these programs are
      single-threaded.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * lib/unlocked-io.h, m4/unlocked-io.m4: New files, copied from Gnulib.
      * src/charset.c, src/cm.c, src/emacs.c, src/image.c, src/keyboard.c:
      * src/lread.c, src/term.c:
      Include sysstdio.h, possibly instead of stdio.h, to define
      the unlocked functions if the system does not provide them.
      * src/charset.c, src/lread.c (getc_unlocked):
      Remove, since sysstdio.h now defines it if needed.
      * src/cm.c (cmputc, cmcheckmagic):
      * src/dispnew.c (update_frame, update_frame_with_menu)
      (update_frame_1, Fsend_string_to_terminal, Fding, bitch_at_user):
      * src/emacs.c (main, Fdump_emacs):
      * src/fileio.c (Fdo_auto_save, Fset_binary_mode):
      * src/image.c (slurp_file, png_read_from_file, png_load_body)
      (our_stdio_fill_input_buffer):
      * src/keyboard.c (record_char, kbd_buffer_get_event, handle_interrupt):
      * src/lread.c (readbyte_from_file):
      * src/minibuf.c (read_minibuf_noninteractive):
      * src/print.c (printchar_to_stream, strout)
      (Fredirect_debugging_output):
      * src/sysdep.c (reset_sys_modes, procfs_ttyname)
      (procfs_get_total_memory):
      * src/term.c (tty_ring_bell, tty_send_additional_strings)
      (tty_set_terminal_modes, tty_reset_terminal_modes)
      (tty_update_end, tty_clear_end_of_line, tty_write_glyphs)
      (tty_write_glyphs_with_face, tty_insert_glyphs)
      (tty_menu_activate):
      * src/xfaces.c (Fx_load_color_file):
      Use unlocked stdio when it should be safe.
      * src/sysstdio.h (clearerr_unlocked, feof_unlocked, ferror_unlocked)
      (fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked)
      (fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked)
      (putc_unlocked, putchar_unloced): Provide substitutes if not declared.
      f6ef15cf
    • Martin Rudalics's avatar
      Fix make_hash_table calls in lread.c · 386a3da9
      Martin Rudalics authored
      * src/lread.c (readevalloop, read_internal_start): Fix
      make_hash_table calls to make build succeed.
      386a3da9
    • Ken Raeburn's avatar
      Create less garbage to collect while reading symbols. · 59f3c866
      Ken Raeburn authored
      * src/lread.c (read1): When interning a symbol, only create a new
      string object for the name if we're going to use it for a new symbol
      object.
      59f3c866
    • Ken Raeburn's avatar
      Replace read_objects assoc list with two hash tables. · b9145563
      Ken Raeburn authored
      For larger input files with lots of shared data structures, an
      association list is too slow.
      
      * src/lread.c (read_objects_map, read_objects_completed): New
      variables, replacing read_objects.
      (readevalloop): Initialize them with hash tables before starting a
      top-level read, if they're not already empty hash tables, and reset
      them to Qnil afterwards if something was added to the hash tables.
      (read_internal_start): Likewise.
      (read1): Store first the placeholder and later the newly read object
      into read_objects_map under the specified object number.  If the new
      object can contain a reference to itself, store it in
      read_objects_completed.
      (substitute_objects_recurse): Check read_objects_completed instead of
      read_objects for the known possibly-recursive objects.
      (syms_of_lread): Update initializations.
      b9145563
    • Ken Raeburn's avatar
      Use getc_unlocked. · efe200c1
      Ken Raeburn authored
      * configure.ac: Check for getc_unlocked.
      * src/charset.c (read_hex, load_charset_map_from_file): Use
      getc_unlocked instead of getc.
      (getc_unlocked) [!HAVE_GETC_UNLOCKED]: Fall back to getc.
      * src/lread.c (readbyte_from_file, Fget_file_char, read1,
      getc_unlocked): Likewise.
      efe200c1
    • Stefan Monnier's avatar
      Reduce lread substitutions. · 6af67b4a
      Stefan Monnier authored
      * src/lread.c (read1): After reading an object using the "#n=" syntax,
      if the read object is a cons cell, instead of recursively substituting
      the placeholder with the new object, mutate the placeholder cons cell
      itself to have the correct car and cdr values.
      6af67b4a
    • Ken Raeburn's avatar
      Short-circuit substitutions for some simple types. · 0b3a0f30
      Ken Raeburn authored
      Values that don't contain other values cannot be circular, so checking
      for circular objects is a waste of cycles.
      
      * src/lread.c (substitute_object_recurse): If the subtree being
      examined is a symbol, number, or property-less string, just return
      it.
      0b3a0f30
  16. 21 Jun, 2017 1 commit
  17. 01 Jun, 2017 2 commits
    • Paul Eggert's avatar
      Improve performance by avoiding strtoumax · 178d0cb5
      Paul Eggert authored
      This made (string-to-number "10") 20% faster on my old desktop,
      an AMD Phenom II X4 910e running Fedora 25 x86-64.
      * admin/merge-gnulib (GNULIB_MODULES): Remove strtoumax.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * lib/strtoul.c, lib/strtoull.c, lib/strtoumax.c, m4/strtoull.m4:
      * m4/strtoumax.m4: Remove.
      * src/editfns.c (str2num): New function.
      (styled_format): Use it instead of strtoumax.  Use ptrdiff_t
      instead of uintmax_t.  Check for integer overflow.
      * src/lread.c (LEAD_INT, DOT_CHAR, TRAIL_INT, E_EXP):
      Move to private scope and make them enums.
      (string_to_number): Compute integer value directly during
      first pass instead of revisiting it with strtoumax later.
      178d0cb5
    • Glenn Morris's avatar
      Use true names for invocation- and source-directory · 6aacd4fb
      Glenn Morris authored
      * src/emacs.c (init_cmdargs) <Vinvocation_directory>:
      * src/lread.c (init_lread) <Vsource_directory>: Use true names.
      6aacd4fb
  18. 20 May, 2017 1 commit
  19. 16 May, 2017 1 commit
    • Paul Eggert's avatar
      Merge with gnulib, pacifying GCC 7 · 2e1bebe2
      Paul Eggert authored
      This incorporates:
      2017-05-16 manywarnings: update for GCC 7
      2017-05-15 sys_select: Avoid "was expanded before it was required"
      * configure.ac (nw): Suppress GCC 7’s new -Wduplicated-branches and
      -Wformat-overflow=2 options, due to too many false alarms.
      * doc/misc/texinfo.tex, lib/strftime.c, m4/manywarnings.m4:
      Copy from gnulib.
      * m4/gnulib-comp.m4: Regenerate.
      * src/coding.c (decode_coding_iso_2022):
      Fix bug uncovered by -Wimplicit-fallthrough.
      * src/conf_post.h (FALLTHROUGH): New macro.
      Use it to mark all switch cases that fall through.
      * src/editfns.c (styled_format): Use !, not ~, on bool.
      * src/gtkutil.c (xg_check_special_colors):
      When using sprintf, don’t trust Gtk to output colors in [0, 1] range.
      (xg_update_scrollbar_pos): Avoid use of possibly-uninitialized bool;
      this bug was actually caught by Clang.
      * src/search.c (boyer_moore):
      Tell GCC that CHAR_BASE, if nonzero, must be a non-ASCII character.
      * src/xterm.c (x_draw_glyphless_glyph_string_foreground):
      Tell GCC that glyph->u.glyphless.ch must be a character.
      2e1bebe2
  20. 13 May, 2017 2 commits
    • Philipp's avatar
      Make `old-style-backquotes' variable internal · a1d46159
      Philipp authored
      * src/lread.c (load_warn_old_style_backquotes, Fload, read1)
      (syms_of_lread): Rename `old-style-backquotes' to
      `lread--old-style-backquotes', and clarify that it's for internal
      use only.
      * lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Rename
      variable.
      * test/src/lread-tests.el (lread-tests--old-style-backquotes): Add
      unit test.
      * emacs-lisp/bytecomp-tests.el
      (bytecomp-tests--old-style-backquotes): Add unit test.
      a1d46159
    • Philipp Stephani's avatar
      Improve unescaped character literal warnings · 16004397
      Philipp Stephani authored
      * src/lread.c (load_warn_unescaped_character_literals)
      (syms_of_lread):
      lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Improve
      formatting of unescaped character literal warnings.
      
      * test/src/lread-tests.el (lread-tests--unescaped-char-literals):
      test/lisp/emacs-lisp/bytecomp-tests.el
      (bytecomp-tests--unescaped-char-literals): Adapt unit tests.
      16004397
  21. 09 May, 2017 1 commit
    • Glenn Morris's avatar
      Put re-loaded file back at start of load-history (bug#26837) · db30296b
      Glenn Morris authored
      * src/lread.c (readevalloop): Fix the "whole buffer" check to
      operate in the correct buffer.
      (Feval_buffer): Move point back to the start after checking
      for lexical binding.
      * test/src/lread-tests.el (lread-test-bug26837): New test.
      * test/data/somelib.el, test/data/somelib2.el: New test data files.
      db30296b
  22. 01 May, 2017 1 commit
    • Philipp Stephani's avatar
      Warn about missing backslashes during load · c2bbdc33
      Philipp Stephani authored
      * src/lread.c (load_warn_unescaped_character_literals, Fload, read1)
      (syms_of_lread): Warn if unescaped character literals are
      found (Bug#20152).
      * lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Check for
      unescaped character literals during byte compilation.
      * test/src/lread-tests.el (lread-tests--unescaped-char-literals): New
      unit test.
      (lread-tests--with-temp-file, lread-tests--last-message): Helper
      functions for unit test.
      * test/lisp/emacs-lisp/bytecomp-tests.el
      (bytecomp-tests--unescaped-char-literals): New unit test.
      * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--with-temp-file):
      Helper macro for unit test.
      c2bbdc33
  23. 10 Apr, 2017 1 commit
    • Lars Brinkhoff's avatar
      Add PVSIZE function to return the size of a pseudovector. · 3ccd0ff1
      Lars Brinkhoff authored
      * src/lisp.h (PVSIZE): New function.
      
      * src/chartab.c (copy_char_table):
      * src/data.c (Ftype_of, Finteractive_form, Faref, Faset):
      * src/doc.c (Fdocumentation, store_function_docstring):
      * src/eval.c (Fcommandp, funcall_lambda, lambda_arity, Ffetch_bytecode):
      * src/fns.c (Flength, Fcopy_sequence):
      * src/font.h (FONT_SPEC_P, FONT_ENTITY_P, FONT_OBJECT_P):
      * src/lread.c (substitute_object_recurse):
      * src/src/print.c (print_object):
        Use it.
      3ccd0ff1
  24. 08 Apr, 2017 1 commit
  25. 04 Apr, 2017 1 commit
    • Lars Brinkhoff's avatar
      Add record objects with user-defined types. · a2c33430
      Lars Brinkhoff authored
      * src/alloc.c (allocate_record): New function.
      (Fmake_record, Frecord, Fcopy_record): New functions.
      (syms_of_alloc): defsubr them.
      (purecopy): Work with records.
      
      * src/data.c (Ftype_of): Return slot 0 for record objects, or type
      name if record's type holds class.
      (Frecordp): New function.
      (syms_of_data): defsubr it.  Define `Qrecordp'.
      (Faref, Faset): Work with records.
      
      * src/fns.c (Flength): Work with records.
      
      * src/lisp.h (prec_type): Add PVEC_RECORD.
      (RECORDP, CHECK_RECORD, CHECK_RECORD_TYPE): New functions.
      
      * src/lread.c (read1): Add syntax for records.
      
      * src/print.c (PRINT_CIRCLE_CANDIDATE_P): Add RECORDP.
      (print_object): Add syntax for records.
      
      * test/lisp/emacs-lisp/cl-print-tests.el (cl-print-tests-2):
      New test.
      
      * test/src/alloc-tests.el (record-1, record-2, record-3):
      New tests.
      
      * doc/lispref/elisp.texi, doc/lispref/objects.texi,
      doc/lispref/records.texi: Add documentation for records.
      a2c33430
  26. 02 Mar, 2017 1 commit
    • Paul Eggert's avatar
      Restore XFLOATINT but with restricted args · 56aaaf9b
      Paul Eggert authored
      Turn instances of extract_float into XFLOAT_DATA when possible,
      and to a resurrected XFLOATINT when the arg is a number.
      The resurrected XFLOATINT is more like XFLOAT and XINT in
      that is valid only if its arg is a number.  This clarifies
      the ways in which floats can be extracted at the C level.
      * src/editfns.c (styled_format):
      * src/floatfns.c (extract_float, Fexpt):
      Use XFLOATINT rather than open-coding it.
      * src/fns.c (internal_equal):
      * src/image.c (imagemagick_load_image):
      * src/xdisp.c (resize_mini_window):
      Prefer XFLOAT_DATA to extract_float on values known to be floats.
      * src/frame.c (x_set_screen_gamma):
      * src/frame.h (NUMVAL):
      * src/image.c (x_edge_detection, compute_image_size):
      * src/lread.c (read_filtered_event):
      * src/window.c (Fset_window_vscroll):
      * src/xdisp.c (handle_single_display_spec, try_scrolling)
      (redisplay_window, calc_pixel_width_or_height, x_produce_glyphs)
      (on_hot_spot_p):
      Prefer XFLOATINT to extract_float on values known to be numbers.
      * src/lisp.h (XFLOATINT): Bring back this function, except
      it now assumes its argument is a number.
      56aaaf9b
  27. 24 Feb, 2017 1 commit
    • Gemini Lasswell's avatar
      Support read syntax for circular objects in Edebug (Bug#23660) · 8b912ab4
      Gemini Lasswell authored
      * lisp/emacs-lisp/edebug.el (edebug-read-special): New name
      for edebug-read-function. Handle the read syntax for circular
      objects.
      (edebug-read-objects): New variable.
      (edebug-read-and-maybe-wrap-form1): Reset edebug-read-objects.
      
      * src/lread.c (Fsubstitute_object_in_subtree): Make
      substitute_object_in_subtree into a Lisp primitive.
      8b912ab4
  28. 01 Feb, 2017 1 commit
    • Paul Eggert's avatar
      Revamp quitting and fix infloops · b01ac672
      Paul Eggert authored
      This fixes some infinite loops that cannot be quitted out of,
      e.g., (defun foo () (nth most-positive-fixnum '#1=(1 . #1#)))
      when byte-compiled and when run under X.  See:
      http://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00577.html
      This also attempts to keep the performance improvements I recently
      added, as much as possible under the constraint that the infloops
      must be caught.  In some cases this fixes infloop bugs recently
      introduced when I removed immediate_quit.
      * src/alloc.c (Fmake_list):
      Use rarely_quit, not maybe_quit, for speed in the usual case.
      * src/bytecode.c (exec_byte_code):
      * src/editfns.c (Fcompare_buffer_substrings):
      * src/fns.c (Fnthcdr):
      * src/syntax.c (scan_words, skip_chars, skip_syntaxes)
      (Fbackward_prefix_chars):
      Use rarely_quit so that users can C-g out of long loops.
      * src/callproc.c (call_process_cleanup, call_process):
      * src/fileio.c (read_non_regular, Finsert_file_contents):
      * src/indent.c (compute_motion):
      * src/syntax.c (scan_words, Fforward_comment):
      Remove now-unnecessary maybe_quit calls.
      * src/callproc.c (call_process):
      * src/doc.c (get_doc_string, Fsnarf_documentation):
      * src/fileio.c (Fcopy_file, read_non_regular, Finsert_file_contents):
      * src/lread.c (safe_to_load_version):
      * src/sysdep.c (system_process_attributes) [GNU_LINUX]:
      Use emacs_read_quit instead of emacs_read in places where
      C-g handling is safe.
      * src/eval.c (maybe_quit): Move comment here from lisp.h.
      * src/fileio.c (Fcopy_file, e_write):
      Use emacs_write_quit instead of emacs_write_sig in places where
      C-g handling is safe.
      * src/filelock.c (create_lock_file): Use emacs_write, not
      plain write, as emacs_write no longer has a problem.
      (read_lock_data): Use emacs_read, not read, as emacs_read
      no longer has a problem.
      * src/fns.c (rarely_quit): Move to lisp.h and rename to
      incr_rarely_quit.  All uses changed..
      * src/fns.c (Fmemq, Fmemql, Fassq, Frassq, Fplist_put, Fplist_member):
      * src/indent.c (compute_motion):
      * src/syntax.c (find_defun_start, back_comment, forw_comment)
      (Fforward_comment, scan_lists, scan_sexps_forward):
      Use incr_rarely_quit so that users can C-g out of long loops.
      * src/fns.c (Fnconc): Move incr_rarely_quit call to within
      inner loop, so that it catches C-g there too.
      * src/keyboard.c (tty_read_avail_input): Remove commented-out
      and now-obsolete code dealing with interrupts.
      * src/lisp.h (rarely_quit, incr_rarely_quit): New functions,
      the latter moved here from fns.c and renamed from rarely_quit.
      (emacs_read_quit, emacs_write_quit): New decls.
      * src/search.c (find_newline, search_buffer, find_newline1):
      Add maybe_quit to catch C-g.
      * src/sysdep.c (get_child_status): Always invoke maybe_quit
      if interruptible, so that the caller need not bother.
      (emacs_nointr_read, emacs_read_quit, emacs_write_quit):
      New functions.
      (emacs_read): Rewrite in terms of emacs_nointr_read.
      Do not handle C-g or signals; that is now for emacs_read_quit.
      (emacs_full_write): Replace PROCESS_SIGNALS two-way arg
      with INTERRUPTIBLE three-way arg.  All uses changed.
      b01ac672
  29. 30 Jan, 2017 1 commit
    • Vibhav Pant's avatar
      Fix hash tables not being purified correctly. · 9c4dfdd1
      Vibhav Pant authored
      * src/alloc.c
      (purecopy_hash_table) New function, makes a copy of the given hash
      table in pure storage.
      Add new struct `pinned_object' and `pinned_objects' linked list for
      pinning objects.
      (Fpurecopy) Allow purifying hash tables
      (purecopy) Pin hash tables that are either weak or not declared with
      `:purecopy t`, use purecopy_hash_table otherwise.
      (marked_pinned_objects) New function, marks all objects in pinned_objects.
      (garbage_collect_1) Use it. Mark all pinned objects before sweeping.
      * src/lisp.h Add new field `pure' to struct `Lisp_Hash_Table'.
      * src/fns.c: Add `purecopy' parameter to hash tables.
      (Fmake_hash_table): Check for a `:purecopy PURECOPY' argument, pass it
      to make_hash_table.
      (make_hash_table): Add `pure' parameter, set h->pure to it.
      (Fclrhash, Fremhash, Fputhash): Enforce that the table is impure with
      CHECK_IMPURE.
      * src/lread.c: (read1) Parse for `purecopy' parameter while reading
        hash tables.
      * src/print.c: (print_object) add the `purecopy' parameter while
        printing hash tables.
      * src/category.c, src/emacs-module.c, src/image.c, src/profiler.c,
        src/xterm.c: Use new (make_hash_table).
      9c4dfdd1
  30. 26 Jan, 2017 1 commit
    • Paul Eggert's avatar
      Replace QUIT with maybe_quit · b3a3ed52
      Paul Eggert authored
      There’s no longer need to have QUIT stand for a slug of C statements.
      Use the more-obvious function-call syntax instead.
      Also, use true and false when setting immediate_quit.
      These changes should not affect the generated machine code.
      * src/lisp.h (QUIT): Remove.  All uses replaced by maybe_quit.
      b3a3ed52
  31. 01 Jan, 2017 1 commit