1. 07 Jan, 2019 1 commit
    • Paul Eggert's avatar
      Minor INFINITY/NAN cleanup · 8acb88c5
      Paul Eggert authored
      * src/lread.c (INFINITY): Use a more-portable way to specify
      this macro on non-C99 platforms that lack it.
      (NAN): Remove; unused.
      8acb88c5
  2. 01 Jan, 2019 1 commit
  3. 09 Dec, 2018 1 commit
    • Paul Eggert's avatar
      Add make_vector and make_nil_vector · d79bb756
      Paul Eggert authored
      This makes the callers a bit easier to read, and doubtless
      improves efficiency very slightly.  It also simplifies
      possible future changes to allow bignum indexes to buffers.
      * src/alloc.c (allocate_vectorlike):
      Prefer ptrdiff_t to size_t when either will do.
      (make_vector): New function.
      (Fmake_vector): Use it.
      * src/buffer.c (syms_of_buffer):
      * src/bytecode.c (syms_of_bytecode):
      * src/category.c (Fmake_category_table, init_category_once):
      * src/ccl.c (syms_of_ccl):
      * src/character.c (syms_of_character):
      * src/charset.c (Fdefine_charset_internal)
      (Ffind_charset_region, Ffind_charset_string):
      * src/chartab.c (copy_char_table):
      * src/coding.c (Fdefine_coding_system_internal, syms_of_coding):
      * src/composite.c (get_composition_id, Fcomposition_get_gstring):
      * src/composite.h (LGLYPH_NEW):
      * src/fns.c (concat, Flocale_info, make_hash_table):
      * src/font.c (font_otf_ValueRecord, font_otf_anchor)
      (build_style_table, syms_of_font):
      * src/fontset.c (RFONT_DEF_NEW, fontset_find_font)
      (dump_fontset, syms_of_fontset):
      * src/image.c (xpm_make_color_table_v):
      * src/keyboard.c (modify_event_symbol, menu_bar_items)
      (parse_menu_item, parse_tool_bar_item, init_tool_bar_items)
      (syms_of_keyboard):
      * src/keymap.c (Fdefine_key, describe_map, describe_vector):
      * src/lread.c (read_vector):
      * src/macfont.m (macfont_shape):
      * src/menu.c (init_menu_items):
      * src/nsfns.m (ns_make_monitor_attribute_list):
      * src/process.c (conv_sockaddr_to_lisp, network_interface_info):
      * src/profiler.c (make_log):
      * src/window.c (Fcurrent_window_configuration):
      * src/xdisp.c (with_echo_area_buffer_unwind_data)
      (format_mode_line_unwind_data):
      * src/xfaces.c (Finternal_make_lisp_face)
      (Fface_attributes_as_vector):
      * src/xfns.c (x_make_monitor_attribute_list)
      (Fx_display_monitor_attributes_list):
      * src/xfont.c (syms_of_xfont):
      * src/xselect.c (x_handle_dnd_message):
      * src/xwidget.c (save_script_callback):
      Prefer make_nil_vector (N) to Fmake_vector (make_fixnum (N), Qnil).
      * src/callint.c (Fcall_interactively):
      * src/charset.c (load_charset_map):
      * src/chartab.c (Fmake_char_table, uniprop_encode_value_numeric):
      * src/composite.c (get_composition_id)
      * src/dispnew.c (Fframe_or_buffer_changed_p)
      (syms_of_display):
      * src/fns.c (make_hash_table, maybe_resize_hash_table):
      * src/font.c (font_style_to_value):
      * src/fontset.c (FONTSET_ADD, fontset_add):
      * src/json.c (json_to_lisp):
      * src/keymap.c (syms_of_keymap):
      * src/lread.c (init_obarray):
      * src/profiler.c (make_log, Fprofiler_cpu_log):
      * src/term.c (term_get_fkeys_1):
      Prefer make_vector (N, V) to Fmake_vector (make_fixnum (N), V).
      * src/font.c (build_style_table):
      * src/macfont.m (macfont_shape):
      * src/process.c (conv_sockaddr_to_lisp, network_interface_info):
      Prefer make_uninit_vector if the vector will be initialized soon.
      * src/lisp.h (make_nil_vector): New function.
      d79bb756
  4. 19 Oct, 2018 1 commit
    • Paul Eggert's avatar
      Fix struct thread alignment on FreeBSD x86 · d2a07b9a
      Paul Eggert authored
      Problem reported by Joseph Mingrone in:
      https://lists.gnu.org/r/emacs-devel/2018-10/msg00238.html
      While we’re at it, apply a similar fix to struct Lisp_Subr; this
      removes the need for GCALIGNED_STRUCT_MEMBER and thus can shrink
      struct Lisp_Subr a bit.
      * configure.ac (HAVE_STRUCT_ATTRIBUTE_ALIGNED): Bring back this macro.
      Although used only for performance (not to actually align
      structures), we might as well take advantage of it.
      * src/lisp.h (GCALIGNED_STRUCT_MEMBER): Remove; all uses removed.
      (union Aligned_Lisp_Subr): New type, like struct Lisp_Subr but aligned.
      * src/lisp.h (XSUBR, DEFUN):
      * src/lread.c (defsubr): Use it.  All callers changed.
      * src/thread.c (union aligned_thread_state): New type.
      (main_thread): Now of this type, so it’s aligned.
      All uses changed.
      * src/xmenu.c (syms_of_xmenu) [USE_GTK || USE_X_TOOLKIT]:
      Adjust to union Aligned_Lisp_Subr change.
      d2a07b9a
  5. 11 Oct, 2018 1 commit
    • Paul Eggert's avatar
      Fix mishandling of symbols that look like numbers · 5bd8cfc1
      Paul Eggert authored
      * src/bignum.c (make_neg_biguint): New function.
      * src/lread.c (read1): Do not mishandle an unquoted symbol
      with name equal to something like "1\0x", i.e., a string
      of numeric form followed by a NUL byte.
      Formerly these symbols were misread as numbers.
      (string_to_number): Change last argument from an integer flag
      to a pointer to the length.  This lets the caller figure out
      how much of the prefix was used.  All callers changed.
      Add a fast path if the integer (sans sign) fits in uintmax_t.
      Update comments and simplify now that bignums are present.
      * src/print.c (print_object): Fix quoting of symbols that look
      like numbers, by relying on string_to_number for the tricky
      cases rather than trying to redo its logic, incorrectly.  For
      example, (read (prin1-to-string '\1e+NaN)) formerly returned
      "1e+NaN", which was wrong: a backslash is needed in the output
      to prevent it from being read as a NaN.  Escape NO_BREAK_SPACE
      too, since lread.c treats it like SPACE.
      * test/src/print-tests.el (print-read-roundtrip):
      Add tests illustrating the abovementioned bugs.
      5bd8cfc1
  6. 10 Sep, 2018 1 commit
    • Eli Zaretskii's avatar
      Clarify documentation of functions reading character events · 5cf282d6
      Eli Zaretskii authored
      * doc/lispref/help.texi (Describing Characters):
      * doc/lispref/commands.texi (Keyboard Events)
      (Reading One Event, Classifying Events): Make the distinction
      between characters and character events more explicit.
      
      * src/keymap.c (Ftext_char_description)
      (Fsingle_key_description):
      * src/lread.c (Fread_char, Fread_char_exclusive): Doc fixes,
      to make a clear distinction between a character input event
      and a character code.  (Bug#32562)
      5cf282d6
  7. 31 Aug, 2018 1 commit
    • Paul Eggert's avatar
      Port better to non-IEEE platforms · ab871981
      Paul Eggert authored
      * src/lread.c (string_to_number) [!IEEE_FLOATING_POINT]:
      Do not use the INFINITY macro, since the C standard requires
      it to provoke a compile-time error on platforms that do not
      support infinities.
      ab871981
  8. 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
  9. 21 Aug, 2018 1 commit
    • Paul Eggert's avatar
      Fix assertion failure when reading 'BIGNUM.' · f8069952
      Paul Eggert authored
      Problem reported by Stefan Monnier (Bug#32476).
      * src/lread.c (string_to_number): Don't pass leading "+"
      or trailing "." or junk to make_bignum_str.
      * test/src/lread-tests.el (lread-string-to-number-trailing-dot):
      New test.
      f8069952
  10. 08 Aug, 2018 2 commits
    • Tom Tromey's avatar
      Handle leading "+" when converting string to bignum · 5ebf062e
      Tom Tromey authored
      * src/lread.c (string_to_number): Skip leading "+" when calling
      make_bignum_str.
      5ebf062e
    • 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
  11. 02 Aug, 2018 1 commit
    • Paul Eggert's avatar
      Substitute a <ieee754.h> on hosts lacking it · d216d7d2
      Paul Eggert authored
      * .gitignore: Add lib/ieee754.h.
      * admin/merge-gnulib (GNULIB_MODULES): Add ieee754-h.
      * configure.ac: Remove ieee754.h check, as Gnulib now does that.
      * etc/NEWS: Mention this.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * lib/ieee754.in.h, m4/ieee754-h.m4: New files, from Gnulib.
      * src/lisp.h (IEEE_FLOATING_POINT): Now a macro so that it
      can be used in #if.
      * src/lread.c, src/print.c: Include <ieee754.h> if
      IEEE_FLOATING_POINT, not if HAVE_IEEE754_H.
      * src/lread.c (string_to_number):
      * src/print.c (float_to_string):
      Process NaNs only on IEEE hosts, and assume <ieee754.h>
      in that case.
      d216d7d2
  12. 01 Aug, 2018 1 commit
    • Paul Eggert's avatar
      Read and print NaN significand if <ieee754.h> · 6e37d2fd
      Paul Eggert authored
      * configure.ac: Check for ieee754.h.
      * doc/lispref/numbers.texi (Float Basics): Document
      that NaN string representation digits are machine-dependent.
      * etc/NEWS: Mention the change.
      * src/lread.c, src/print.c [HAVE_IEEE754_H]: Include ieee754.h.
      * src/lread.c (string_to_number) [HAVE_IEEE754_H]:
      * src/print.c (float_to_string) [HAVE_IEEE754_H]:
      Read and print NaN significand.
      6e37d2fd
  13. 21 Jul, 2018 1 commit
  14. 20 Jul, 2018 1 commit
    • Paul Eggert's avatar
      Prefer NILP (x) to EQ (x, Qnil) · fb24ce37
      Paul Eggert authored
      This simplifies the code a bit, and also simplifies some
      potential future changes slightly (e.g., altering eq vs eql).
      * src/alloc.c (mark_object):
      * src/callint.c (fix_command):
      * src/chartab.c (Fchar_table_range, Fset_char_table_range):
      * src/dbusbind.c (XD_OBJECT_TO_DBUS_TYPE, xd_signature):
      * src/dired.c (Fsystem_users):
      * src/fileio.c (Fdo_auto_save):
      * src/fns.c (concat):
      * src/frame.c (get_frame_param, frame_inhibit_resize)
      (store_in_alist, store_frame_param, x_set_autoraise)
      (x_set_autolower, x_get_arg):
      * src/image.c (Fclear_image_cache):
      * src/intervals.c (intervals_equal):
      * src/intervals.h (DEFAULT_INTERVAL_P):
      * src/lread.c (substitute_object_recurse):
      * src/menu.c (digest_single_submenu)
      (find_and_call_menu_selection)
      (find_and_return_menu_selection):
      * src/nsfns.m (x_set_icon_name, Fx_create_frame):
      * src/nsmenu.m (ns_menu_show):
      * src/nsselect.m (ns_string_to_pasteboard_internal)
      (Fns_selection_exists_p, Fns_selection_owner_p):
      * src/process.c (Faccept_process_output)
      (wait_reading_process_output):
      * src/terminal.c (store_terminal_param):
      * src/textprop.c (verify_interval_modification):
      * src/xdisp.c (next_element_from_buffer):
      * src/xfaces.c (Finternal_set_lisp_face_attribute):
      * src/xfns.c (x_set_icon_type, Fx_synchronize):
      * src/xmenu.c (x_menu_show):
      * src/xselect.c (Fx_selection_owner_p)
      (Fx_selection_exists_p):
      * src/xwidget.c (xwidget_view_lookup):
      Prefer NILP (x) to EQ (x, Qnil).
      fb24ce37
  15. 13 Jul, 2018 3 commits
    • Tom Tromey's avatar
      Make the reader accept bignums · 1e8ae6ca
      Tom Tromey authored
      * src/data.c (Fstring_to_number): Update.
      * src/lisp.h (S2N_OVERFLOW_TO_FLOAT): Remove.
      * src/lread.c (free_contents): New function.
      (read_integer): Handle bignums.
      (read1): Update.
      (string_to_number): Handle bignums.
      (syms_of_lread): Remove read-integer-overflow-as-float.
      * src/process.c (Fsignal_process): Update.
      1e8ae6ca
    • 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
    • Paul Eggert's avatar
      Lessen stack consumption in recursive read1 · b38b91a8
      Paul Eggert authored
      * src/lread.c (read1): Shrink local buffer size from
      MAX_ALLOCA to 128 (Bug#31995).
      b38b91a8
  16. 30 Jun, 2018 1 commit
    • Paul Eggert's avatar
      unbind_to performance tuning · 2e281186
      Paul Eggert authored
      * src/alloc.c (which_symbols):
      * src/dispnew.c (Fredisplay):
      * src/editfns.c (Fsubst_char_in_region):
      * src/fileio.c (Fdo_auto_save):
      * src/indent.c (Fvertical_motion):
      * src/keymap.c (Fcurrent_active_maps):
      * src/lread.c (Feval_buffer):
      * src/minibuf.c (get_minibuffer):
      * src/sysdep.c (system_process_attributes):
      * src/textprop.c (Fnext_single_char_property_change)
      (Fprevious_single_char_property_change):
      * src/window.c (Fscroll_other_window, Fscroll_other_window_down):
      * src/xdisp.c (Fformat_mode_line):
      Help the compiler eliminate tail recursion in call to unbind_to.
      * src/coding.c (decode_coding_gap):
      Omit unnecessary unbind_to, as we’re about to call unbind_to anyway.
      * src/coding.c (Fread_coding_system):
      * src/eval.c (eval_sub):
      * src/xdisp.c (handle_single_display_spec, decode_mode_spec):
      * src/xselect.c (x_get_local_selection):
      Avoid need to save a machine register when calling unbind_to.
      * src/minibuf.c (Ftry_completion, Fall_completions):
      Omit unnecessary assignment.
      2e281186
  17. 10 Jun, 2018 1 commit
    • Paul Eggert's avatar
      Fix read buffer overrun on overflowed integers · 1a4c6e69
      Paul Eggert authored
      * src/lread.c (read_integer): Fix off-by-1 buffer overrun
      introduced in 2018-04-17T23:23:16Z!eggert@cs.ucla.edu.  The
      bug could occur when Emacs read radixed integers containing
      more than 100 digits.  Bug caught by AddressSanitizer.
      1a4c6e69
  18. 08 Jun, 2018 1 commit
    • Paul Eggert's avatar
      New function record_unwind_protect_excursion · a0aa1d4e
      Paul Eggert authored
      This simplifies callers a bit, and will simplify future changes.
      * src/eval.c (record_unwind_protect_excursion): New function.
      * src/buffer.c (Fkill_buffer):
      * src/bytecode.c (exec_byte_code):
      * src/editfns.c (Fsave_excursion, Freplace_buffer_contents):
      * src/lread.c (readevalloop, Feval_buffer):
      * src/window.c (scroll_command):
      Use it.
      a0aa1d4e
  19. 22 May, 2018 1 commit
    • Paul Eggert's avatar
      Fix failed assertion when load-force-doc-strings · 02f303d7
      Paul Eggert authored
      Problem reported by Philipp Stephani (Bug#31556).
      * src/lread.c (read_vector): When load_force_doc_strings, check
      for byte code vectors that are invalid because they are too short.
      * test/src/lread-tests.el (lread-invalid-bytecodes): New test.
      02f303d7
  20. 23 Apr, 2018 1 commit
  21. 18 Apr, 2018 1 commit
  22. 17 Apr, 2018 2 commits
  23. 15 Apr, 2018 1 commit
  24. 14 Apr, 2018 2 commits
  25. 29 Mar, 2018 2 commits
    • Paul Eggert's avatar
      New experimental variable read-integer-overflow-as-float. · c213f465
      Paul Eggert authored
      Following a suggestion by Eli Zaretskii (Bug#30408#46).
      * etc/NEWS: Mention it.
      * src/lread.c (syms_of_lread): Add it.
      (read1): Treat out-of-range integers as floats if
      read-integer-overflow-as-float is non-nil.
      c213f465
    • Paul Eggert's avatar
      Lisp reader now checks for integer overflow · 6b3d01da
      Paul Eggert authored
      * doc/lispref/numbers.texi (Integer Basics), etc/NEWS:
      Document this.
      * src/lisp.h (S2N_IGNORE_TRAILING, S2N_OVERFLOW_TO_FLOAT):
      New constants.
      * src/lread.c (string_to_number): Change trailing bool arg to
      integer argument with flags, to support S2N_OVERFLOW_TO_FLOAT.
      All uses changed.
      * test/src/editfns-tests.el (read-large-integer): New test.
      6b3d01da
  26. 12 Mar, 2018 1 commit
    • Paul Eggert's avatar
      Revert overenthusiastic procfs fixup · e067f1fd
      Paul Eggert authored
      Also, be more systematic in calls to string_to_number.
      * src/sysdep.c (list_system_processes) [HAVE_PROCFS]: Allow pids
      to be floating-point if they exceed fixnum range.  This partially
      reverts my patch 2018-03-09T20:06:05Z!eggert@cs.ucla.edu, which
      went too far in fixing string-to-number mishandling.
      e067f1fd
  27. 20 Feb, 2018 1 commit
    • Paul Eggert's avatar
      Fix false alarm with recent GCC x86 · 240df54e
      Paul Eggert authored
      * src/lread.c (Fload): Use UNINIT to pacify -Wmaybe-uninitialized
      false alarm on Fedora 27 x86 with GCC 7.3.1 20180130 (Red Hat 7.3.1-2).
      240df54e
  28. 17 Feb, 2018 1 commit
  29. 03 Feb, 2018 1 commit
    • Paul Eggert's avatar
      Avoid EOVERFLOW problems with file-directory-p · 327d251f
      Paul Eggert authored
      This fixes a bug where (file-directory-p FOO) would fail if FOO
      had an inode number out of range for ‘stat’.
      * src/fileio.c (file_directory_p): Accept a Lisp string instead of
      a C string.  All callers changed.  On non-MS-Windows hosts, use
      openat with O_PATH|O_DIRECTORY if available, otherwise
      file_accessible_directory_p unless it fails due to EACCESS,
      otherwise stat.
      327d251f
  30. 02 Feb, 2018 1 commit
    • Philipp Stephani's avatar
      Properly integrate modules into the loading process (Bug#30164). · 0443411f
      Philipp Stephani authored
      * src/lread.c (Fload): Don't defer to module-load immediately when
      encountering a module, but use the normal loading machinery to
      properly set up load-history, check for recursive loads, print
      messages, etc.
      
      * test/src/emacs-module-tests.el (module/load-history): New test.
      (module/describe-function-1): Adapt test.
      
      * etc/NEWS: Mention fixed behavior.
      0443411f
  31. 28 Jan, 2018 2 commits
    • 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
    • Noam Postavsky's avatar
      Fix round tripping of read->print for symbols with strange quotes · 36c8128e
      Noam Postavsky authored
      Since 2017-07-22 "Signal error for symbol names with strange
      quotes (Bug#2967)", symbol names beginning with certain quote
      characters require an escaping backslash.  However, the corresponding
      change for printing missed, so that (eq (read (prin1-to-string SYM))
      SYM) does not give `t' for such symbols.
      * src/character.c (confusable_symbol_character_p): New function,
      extracted from test `read1'.
      * src/lread.c (read1): Use it.
      * src/print.c (print_object): Use it to print a backslash for symbols
      starting with characters that `read1' requires to be escaped.
      * test/src/print-tests.el (print-read-roundtrip): New test.
      * etc/NEWS.26:
      * etc/NEWS: Clarify the announcement for the earlier reader
      change (Bug#30217).
      36c8128e
  32. 07 Jan, 2018 2 commits