1. 27 Jan, 2019 1 commit
    • Paul Eggert's avatar
      forward-line now works with bignums · cc1c46e4
      Paul Eggert authored
      * src/cmds.c (Fforward_line): Support bignum arg.
      (scan_newline): Return void since no caller was using the
      return value.
      * src/search.c (find_newline, scan_newline_from_point)
      (find_newline1): Return the number of newlines counted, not
      the count shortage, so that the return value always fits in
      ptrdiff_t even if the original count was a bignum.  All
      callers changed.
      * test/src/cmds-tests.el (forward-line-with-bignum): New test.
      cc1c46e4
  2. 15 Jan, 2019 1 commit
    • Daniel Colascione's avatar
      Add portable dumper · d12e5d00
      Daniel Colascione authored
      Add a new portable dumper as an alternative to unexec.  Use it by default.
      
      * src/dmpstruct.awk: New file.
      * src/doc.c (get_doc_string): use will_dump_p().
      * src/editfns.c (styled_format): silence compiler warning
      with UNINIT.
      * src/emacs-module.c (syms_of_module): staticpro ltv_mark.
      * src/emacs.c (gflags): new variable.
      (init_cmdargs): unwrap
      (string_starts_with_p, find_argument, dump_error_to_string)
      (load_pdump): new functions.
      (main): detect pdumper and --temacs invocation; actually load
      portable dump when detected; set gflags as appropriate; changes to
      init functions throughout to avoid passing explicit
      'initialized' argument.
      * src/eval.c (inhibit_lisp_code): remove unused variable.
      (init_eval_once_for_pdumper): new function.
      (init_eval_once): call it.
      * src/filelock.c: CANNOT_DUMP -> will_dump_p()
      * src/fingerprint-dummy.c: new file
      * src/fingerprint.h: new file
      * src/fns.c: CANNOT_DUMP -> will_dump_p(), etc.
      (weak_hash_tables): remove
      (hashfn_equal, hashfn_eql): un-staticify
      (make_hash_table): set new 'next_weak' hash table field; drop
      global weak_hash_tables logic.
      (copy_hash_table): drop global weak_hash_tables logic.
      (hash_table_rehash): new function.
      (hash_lookup, hash_put, hash_remove_from_table, hash_clear):
      rehash if needed.
      (sweep_weak_table): un-staticify; explain logic; bool-ify.
      (sweep_weak_hash_tables): remove function.
      * src/font.c (syms_of_font): remember pdumper stuff.
      * src/fontset.c (syms_of_fontset): remember pdumper stuff.
      * src/frame.c (make_initial_frame): don't reset Vframe_list.
      (init_frame_once_for_pdumper, init_frame_once): new functions.
      (syms_of_frame): remove redundant staticpro.
      * src/fringe.c (init_fringe_once_for_pdumper): new functin.
      (init_fringe_once): call it.
      * src/ftcrfont.c (syms_of_ftcrfont_for_pdumper): new function.
      (syms_of_ftcrfont): call it.
      * src/ftfont.c (syms_of_ftfont_for_pdumper): new function.
      (syms_of_ftfont): call it.
      * src/ftxont.c (syms_of_ftxfont_for_pdumper): new function.
      (syms_of_ftxfont): call it.
      * src/gmalloc.c: adjust for pdumper througout
      (DUMPED): remove weird custom dumped indicator.
      * src/gnutls.c (syms_of_gnutls): pdumper note for
      gnutls_global_initialized.
      * src/image.c (syms_of_image): add pdumper comment,
      initializer note.
      * src/insdel.c (prepare_to_modify_buffer_1): account
      for buffer contents possibly being in dump image.
      * src/keyboard.c (syms_of_keyboard_for_pdumper): new function.
      (syms_of_keyboard): staticpro more; call pdumper syms function.
      * src/lisp.h: add comments throughout
      (gflags): declare.
      (will_dump_p, will_bootstrap_p, will_dump_with_pdumper_p)
      (dumped_with_pdumper_p, will_dump_with_unexec_p)
      (dumped_with_unexec_p, definitely_will_not_unexec_p): new
      functions.
      (POWER_OF_2, ROUNDUP): move macros.
      (PSEUDOVECTOR_TYPE, PSEUDOVECTOR_TYPEP): take vectorlike header
      pointer instead of vector; constify.
      (Lisp_Hash_Table): add comment about need to rehash on access; add
      comment for next_weak.
      (HASH_KEY, HASH_VALUE, HASH_HASH, HASH_TABLE_SIZE): const-ify.
      (hash_table_rehash): declare.
      (hash_rehash_needed_p, hash_rehash_if_needed): new functions.
      (finalizers, doomed_finalizers): declare extern.
      (SUBR_SECTION_ATTRIBUTE): new macro.
      (staticvec, staticidx): un-static-ify.
      (sweep_weak_hash_tables): remove declaration.
      (sweep_weak_table): declare.
      (hashfn_eql, hashfn_equal): declare.
      (number_finalizers_run): new variable.
      (Vdead): externify when ENABLE_CHECKING.
      (gc_root_type): new enumeration.
      (gc_root_visitor): new struct.
      (visit_static_gc_roots): declare.
      (vectorlike_nbytes): declare.
      (vector_nbytes): define as trivial inline function wrapper for
      vectorlike_nbytes.
      (init_obarray_once): change signature.
      (primary_thread): extern-ify.
      (init_buffer): change signature.
      (init_frame_once): declare.
      * src/lread.c (readevalloop): adjust for new dumped predicates.
      (init_obarray_once): new function.
      (ndefsubr): new variable.
      (defsubr): increment it.
      (load_path_check): adjust for pdumper.
      (load_path_default): use pdumper functions; adjust for
      dump search.
      * src/macfont.m (macfont_init_font_change_handler): avoid
      shadowing global.
      (syms_of_macfont_for_pdumper): new function.
      (syms_of_macfont): call it.
      * src/menu.c (syms_of_menu): staticpro more stuff.
      * src/minibuf.c (Ftry_completion): rehash if needed.
      (init_minibuf_once_for_pdumper): new function.
      (init_minibuf_once): call it.
      * src/nsfont.m (syms_of_nsfns): staticpro more.
      * src/nsfont.m (syms_of_nsfont_for_pdumper): new function.
      (syms_of_nsfont): call it.
      * src/nsterm.m (syms_of_nsfont): remember pdumper stuff.
      * src/pdumper.c: new file.
      * src/pdumper.h: new file.
      * src/process.c (init_process_emacs): use new pdumper functions
      instead of CANNOT_DUMP.
      * src/profiler.c (syms_of_profiler_for_pdumper): new function.
      (syms_of_profiler_for_pdumper): call it.
      * src/search.c (syms_of_search_for_pdumper): new function.
      (syms_of_search_for_pdumper): call it.
      * src/sheap.c (bss_sbrk_did_unexec): remove.
      * src/sheap.h (bss_sbrk_did_unexec): remove.
      * src/syntax.c (syms_of_syntax): don't redundantly staticpro
      re_match_object.
      * src/sysdep.c: use will_dump_with_unexec_p() instead of bss
      hack thing.
      * src/syssignals.h (init_sigsegv): declare.
      * src/systime.h (init_timefns): remove bool from signature.
      * src/textprop.c (syms_of_textprop): move staticpro.
      * src/thread.c (main_thread_p): constify.
      * src/thread.h (main_thread_p): constify.
      * src/timefns.c (init_timefns): remove bool from signature.
      (syms_of_timefns_for_pdumper): new function.
      (syms_of_timefns): call it.
      * src/w32.c: rearrange code.
      * src/w32.h (w32_relocate): declare.
      * src/w32fns.c (syms_of_w32fns): add pdumper note.
      * src/w32font.c (syms_of_w32font_for_pdumper): new function.
      (syms_of_w32font): call it.
      * src/w32heap.c (using_dynamic_heap): new variable.
      (init_heap): use it.
      * src/w32menu.c (syms_of_w32menu): add pdumper note.
      * src/w32proc.c
      (ctrl_c_handler, mainCRTStartup, _start, open_input_file)
      (rva_to_section, close_file_data): move here.
      * src/w32uniscribe.c (syms_of_w32uniscribe_for_pdumper):
      new function.
      (syms_of_w32uniscribe): call it.
      * src/window.c (init_window_once_for_pdumper): new function.
      (init_window_once): call it; staticpro more stuff.
      * src/xfont.c (syms_of_xfont_for_pdumper): new function.
      (syms_of_xfont): call it.
      * src/xftfont.c (syms_of_xftfont_for_pdumper): new function.
      (syms_of_xftfont): call it.
      * src/xmenu.c (syms_of_xmenu_for_pdumper): new function.
      (syms_of_xmenu): call it.
      * src/xselect.c (syms_of_xselect_for_pdumper): new function.
      (syms_of_xselect): call it.
      * src/xsettings.c (syms_of_xsettings): add more pdumper notes.
      * src/term.c (syms_of_xterm): add pdumper note.
      
      * src/dispnew.c (init_faces_initial): new function.
      (init_display_interactive): rename from init_display; use
      will_dump_p instead of !initialized.  Initialize faces early for
      pdumper if needed.
      (init_display): new function.
      (syms_of_display_for_pdumper): new function.
      (syms_of_display): call it.
      
      * src/dbusbind.c (syms_of_dbusbind): Add TODO for bus reset
      on pdumper load.
      
      * src/data.c (Fdefalias): Use will_dump_p
      instead of Vpurify_flag.
      (Fmake_variable_buffer_local): silence compiler warning with -Og
      by making valcontents UNINIT.
      (arith_driver): silence compiler warning with UNINIT.
      
      * src/conf_post.h (ATTRIBUTE_SECTION): new macro.
      
      * src/composite.c (composition_gstring_put_cache): rehash hash
      table if needed.
      
      * src/coding.c (init_coding_once, syms_of_coding): remember
      pdumper stuff.
      
      * src/charset.h (charset_table_size, charset_table_user): declare.
      
      * src/charset.c (charset_table_used, charset_table_size): un-static.
      (init_charset_oncem, syms_of_charset): remember pdumper stuff.
      
      * src/category.c (category_table_version): remove obsolete
      variable.
      
      * src/callint.c (syms_of_callint): staticpro 'preserved_fns'
      (init_callproc): use will_dump_p instead of !CANNOT_DUMP.
      
      * src/bytecode.c (exec_byte_code): rehash table tables if needed
      
      * src/buffer.c (alloc_buffer_text, free_buffer_text): account for
      pdumper
      (init_buffer_once): add TODO; remember stuff for pdumper.
      (init_buffer): don't take initialized argument; adjust
      for pdumper.
      
      * src/atimer.c (init_atimer): initialize subr only if
      !initialized.
      
      * src/alloc.c: (vector_marked_p, set_vector_marked)
      (vectorlike_marked_p, set_vectorlike_marked, cons_marked_p)
      (set_cons_marked, string_marked_p, set_string_marked)
      (symbol_marked_p, set_symbol_marked, interval_marked_p)
      (set_interval_marked): new accessor routines.  Use them
      instead of raw GC access throughout.
      (Vdead): make non-static when ENABLE_CHECKING.
      (vectorlike_nbytes): rename of 'vector_nbytes'; take a vectorlike
      header as input instead of a vector.
      (number_finalizers_run): new internal C variable.
      (mark_maybe_object): check for pdumper objects.
      (valid_pointer_p): don't be gratuitously inefficient under rr(1).
      (make_pure_c_string): add support for size_byte = -2 mode
      indicating that string data points into Emacs image rodata.
      (visit_vectorlike_root): visits GC roots embedded in
      vectorlike objects.
      (visit_buffer_root): visits GC roots embedded in
      our totally-not-a-buffer buffer global objects.
      (visit_static_gc_roots): visit GC roots in the Emacs data section.
      (mark_object_root_visitor): root callback used for conventional GC
      marking
      (weak_hash_tables): new internal variable for tracking found weak
      hash tables during GC.
      (mark_and_sweep_weak_table_contents): new weak hash table marking.
      (garbage_collect_1): use new GC root visitor machinery.
      (mark_vectorlike): accept a vectorlike_header instead of a
      Lisp_Vector.
      (mark_frame, mark_window, mark_hash_table): new functions.
      (mark_object): initialize 'm'; check for pdumper objects and use
      new mark-bit accessors throughout.  Remove some object-specific
      marking code and move to helper functions above.
      (survives_gc_p): check for pdumper objects.
      (gc-sweep): clear pdumper mark bits.
      (init_alloc_once_for_pdumper): new helper function for early init
      called both during normal init and pdumper load.
      (init_alloc_once): pdumper integration.
      
      * src/Makefile.in: Rewrite dumping for pdumper; add pdumper.o;
      invoke temacs with --temacs command line option; build dmpstruct.h
      from dmpstruct.awk; stop relying on CANNOT_DUMP; clean up pdumper
      intermediate files during build.
      
      * nextstep/Makefile.in: build emacs.pdmp into NS packages
      
      * lisp/startup.el: account for new '--temacs' and '--dump-file'
      command line option.
      
      * lisp/loadup.el: rewrite early init to account for pdumper; use
      injected 'dump-mode' variable (set via the new '--temacs' option)
      instead of parsing command line.
      
      * lisp/cus-start.el: Check 'dump-mode' instead of 'purify-flag',
      since the new 'dump-mode'
      
      * lib-src/make-fingerprint.c: new program
      
      * lib-src/Makefile.in: built make-fingerprint utility program
      
      * configure.ac: Add --with-pdumper toggle to control pdumper
      support; add --with-unexec toggle to control unexec support.
      Add --with-dumping option to control which dumping strategy we use
      by default.  Adjust for pdumper throughout.  Check for
      posix_madvise.
      
      * Makefile.in: Add @DUMPING@ substitution; add pdumper mode.
      
      * .gitignore: Add make-fingerprint, temacs.in, fingerprint.c,
      dmpstruct.h, and pdumper dump files.
      d12e5d00
  3. 13 Jan, 2019 2 commits
    • Paul Eggert's avatar
      Fix translation-region bug with MAX_CHAR · 1a722e88
      Paul Eggert authored
      Also, clean up the code a bit.
      Actually I discovered the bug while cleaning up the code.
      * src/editfns.c (Fsubst_char_in_region)
      (Ftranslate_region_internal): Use bool for booleans.
      (Ftranslate_region_internal): Fix off-by-1 bug when a
      translation table translates the maximum char.  Assume C99
      decl-after-statement, similar minor cleanups.
      * test/src/editfns-tests.el (test-translate-region-internal):
      New test.
      1a722e88
    • Paul Eggert's avatar
      Minor overflow fix in translate-region-internal · 800d3815
      Paul Eggert authored
      * src/editfns.c (Ftranslate_region_internal):
      Use ptrdiff_t, not int, for a count that might exceed INT_MAX.
      800d3815
  4. 01 Jan, 2019 1 commit
  5. 19 Dec, 2018 1 commit
  6. 10 Nov, 2018 2 commits
    • Eli Zaretskii's avatar
      Fix last change · d6b7b60c
      Eli Zaretskii authored
      * src/editfns.c (Fgroup_name): Fix the doc string.  Move
      closer to the "group" functions.
      * src/w32.c (getgrgid): Return NULL if GID is not the group ID
      of the user of this Emacs session
      
      * test/src/editfns-tests.el (test-group-name): Rename from
      'group-name'.  Add tests for non-Posix hosts.  Test error when
      the argument to group-name is invalid.
      
      * etc/NEWS: Fix wording of last added entry.
      d6b7b60c
    • Jules Tamagnan's avatar
      src/editfns.c (group-name): New function. · ffb4c76d
      Jules Tamagnan authored
      ffb4c76d
  7. 07 Oct, 2018 1 commit
    • Paul Eggert's avatar
      Move timestamp-related stuff to timefns.c · b5d08da1
      Paul Eggert authored
      This does not change behavior; it’s just long-overdue
      refactoring (Bug#32902).
      * src/emacs.c (main): Call init_timefns, syms_of_timefns.
      * src/timefns.c: New file, containing timestamp-related stuff
      from editfns.c and sysdep.c.
      * src/Makefile.in (base_obj): Add timefns.o.
      * src/editfns.c: Simplify by moving a big chunk to timefns.c.
      Do not include systime.h, sys/resource.h, sys/param.h,
      strftime.h, coding.h.
      (HAVE_TZALLOC_BUG, TM_YEAR_BASE, HAVE_TM_GMTOFF, tzeqlen)
      (local_tz, utc_tz, emacs_localtime_rz, emacs_mktime_z)
      (invalid_time_zone_specification, xtzfree, tzlookup)
      (TIME_T_MIN, TIME_T_MAX, time_overflow, invalid_time)
      (check_time_validity, hi_time, lo_time, Fcurrent_time)
      (time_add, time_subtract, time_arith, Ftime_add)
      (Ftime_subtract, Ftime_less_p, Fget_internal_run_time)
      (make_lisp_time, disassemble_lisp_time, decode_float_time)
      (lisp_to_timespec, lisp_time_struct, lisp_time_argument)
      (lisp_seconds_argument, Ffloat_time, emacs_nmemftime)
      (Fformat_time_string, format_time_string, Fdecode_time)
      (check_tm_member, Fencode_time, Fcurrent_time_string)
      (tm_gmtoff, Fcurrent_time_zone, Fset_time_zone_rule)
      (emacs_getenv_TZ, emacs_setenv_TZ): Move to timefns.c.
      * src/emacs.c (main): Adjust to initialization changes.
      * src/sysdep.c: Include <sys/resource.h> if it's present.
      Regularize includes a bit.
      (Fget_internal_run_time): Move here from editfns.c.
      (init_timefns, syms_of_timefns): New functions.
      * src/w32.h (w32_get_internal_run_time): Move decl here
      so that it need not be cloned.
      * test/src/editfns-tests.el:
      * test/src/editfns-tests.el (format-time-string-with-zone)
      (format-time-string-with-outlandish-zone)
      (editfns-tests--have-leap-seconds)
      (format-time-string-with-bignum-on-32-bit):
      Move to ...
      * test/src/timefns-tests.el: ... this new file.
      b5d08da1
  8. 29 Sep, 2018 1 commit
    • Michael Albinus's avatar
      Rework time-* functions in Tramp · ce0da8a4
      Michael Albinus authored
      * doc/misc/emacs-mime.texi (time-date): Add time-equal-p.
      
      * lisp/net/tramp-compat.el (tramp-compat-time-equal-p): New defsubst.
      
      * lisp/net/tramp.el (tramp-file-name-handler): Remove `debug'
      error handler.
      (tramp-half-a-year): Remove.
      (tramp-time-dont-know, tramp-time-doesnt-exist): New defconst.
      (tramp-time-diff): Remove compat code.
      (tramp-handle-set-visited-file-modtime)
      (tramp-handle-verify-visited-file-modtime):
      * lisp/net/tramp-adb.el (tramp-do-parse-file-attributes-with-ls)
      (tramp-adb-handle-set-file-times):
      * lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls)
      (tramp-sh-handle-set-visited-file-modtime)
      (tramp-sh-handle-verify-visited-file-modtime)
      (tramp-sh-handle-set-file-times)
      (tramp-sh-handle-file-newer-than-file-p):
      Use `tramp-time-dont-know', `tramp-time-doesnt-exist' and
      `tramp-compat-time-equal-p'.
      (tramp-sh-handle-verify-visited-file-modtime): Simplify check.
      
      * lisp/net/tramp-smb.el (tramp-smb-handle-file-attributes)
      (tramp-smb-read-file-entry): Use `tramp-time-dont-know'.
      (tramp-smb-handle-insert-directory): Adapt half-a-year check.
      
      * src/editfns.c (Ftime_equal_p): Adapt docstring.
      
      * test/lisp/net/tramp-tests.el
      (tramp-test19-directory-files-and-attributes)
      (tramp-test22-file-times): Use `tramp-compat-time-equal-p' and
      `tramp-time-dont-know'.
      (tramp-test23-visited-file-modtime): Extend test.
      ce0da8a4
  9. 28 Sep, 2018 2 commits
    • Paul Eggert's avatar
      Rename time-equal to time-equal-p · 857c2c27
      Paul Eggert authored
      This is for consistency with time-less-p.
      * doc/lispref/os.texi (Time Calculations), etc/NEWS:
      * src/editfns.c (Ftime_equal_p, syms_of_editfns):
      * test/lisp/emacs-lisp/timer-tests.el (timer-test-multiple-of-time):
      Rename.
      857c2c27
    • Paul Eggert's avatar
      time-equal, and time values of infinity and NaN · 06e2814e
      Paul Eggert authored
      * doc/lispref/os.texi (Time Calculations):
      Document time-equal, and the behavior on NaNs and infinities of
      time-less-p, time-add, time-subtract.
      * etc/NEWS: Mention the change.
      * src/editfns.c (time_arith): Change last arg from function
      to bool.  All callers changed.  Do the right thing with
      infinities and NaNs.
      (time_cmp): New function, which handlesx infinities and NaNs.
      (Ftime_less_p): Use it.
      (Ftime_equal): New function.
      * test/lisp/emacs-lisp/timer-tests.el (timer-test-multiple-of-time):
      Use it.
      06e2814e
  10. 24 Sep, 2018 1 commit
    • Paul Eggert's avatar
      file-attributes cleanup · 662bee7d
      Paul Eggert authored
      Mostly, this replaces magic-number calls like (nth 4 A) with
      more-informative calls like (file-attribute-access-time A).
      It also fixes some documentation and minor timestamp coding
      issues that I noticed while looking into this.
      * doc/lispref/files.texi (File Attributes):
      * lisp/files.el (file-attribute-size)
      (file-attribute-inode-number, file-attribute-device-number):
      * src/dired.c (Fdirectory_files_and_attributes)
      (Ffile_attributes):
      Mention which attributes must be integers, or nonnegative integers,
      as opposed to merely being numbers.  Remove no-longer-correct
      talk about representing large integers as conses of integers.
      * doc/lispref/files.texi (Magic File Names):
      * doc/misc/gnus.texi (Low-level interface to the spam-stat dictionary):
      * lisp/autorevert.el (auto-revert-find-file-function)
      (auto-revert-tail-mode, auto-revert-handler):
      * lisp/auth-source.el (auth-source-netrc-parse):
      * lisp/cedet/ede/files.el (ede--inode-for-dir):
      * lisp/cedet/semantic/db-file.el (object-write):
      * lisp/cedet/semantic/db-mode.el (semanticdb-kill-hook):
      * lisp/cedet/semantic/db.el (semanticdb-needs-refresh-p)
      (semanticdb-synchronize):
      * lisp/cedet/srecode/table.el (srecode-mode-table-new):
      * lisp/desktop.el (desktop-save, desktop-read):
      * lisp/dired-aux.el (dired-file-set-difference)
      (dired-do-chxxx, dired-do-chmod, dired-copy-file-recursive)
      (dired-create-files):
      * lisp/dired.el (dired-directory-changed-p, dired-readin):
      * lisp/dos-w32.el (w32-direct-print-region-helper):
      * lisp/emacs-lisp/autoload.el (autoload-generate-file-autoloads)
      (autoload-find-destination, update-directory-autoloads):
      * lisp/emacs-lisp/shadow.el (load-path-shadows-same-file-or-nonexistent):
      * lisp/epg.el (epg--start, epg-wait-for-completion):
      * lisp/eshell/em-ls.el (eshell-ls-filetype-p)
      (eshell-ls-applicable, eshell-ls-size-string)
      (eshell-ls-file, eshell-ls-dir, eshell-ls-files)
      (eshell-ls-entries):
      * lisp/eshell/em-pred.el (eshell-predicate-alist)
      (eshell-pred-file-type, eshell-pred-file-links)
      (eshell-pred-file-size):
      * lisp/eshell/em-unix.el (eshell-shuffle-files, eshell/cat)
      (eshell-du-sum-directory, eshell/du):
      * lisp/eshell/esh-util.el (eshell-read-passwd)
      (eshell-read-hosts):
      * lisp/files.el (remote-file-name-inhibit-cache)
      (find-file-noselect, insert-file-1, dir-locals-find-file)
      (dir-locals-read-from-dir, backup-buffer)
      (file-ownership-preserved-p, copy-directory)
      (read-file-modes):
      * lisp/find-lisp.el (find-lisp-format):
      * lisp/gnus/gnus-agent.el (gnus-agent-unfetch-articles)
      (gnus-agent-read-agentview, gnus-agent-expire-group-1)
      (gnus-agent-request-article, gnus-agent-regenerate-group)
      (gnus-agent-update-files-total-fetched-for)
      (gnus-agent-update-view-total-fetched-for):
      * lisp/gnus/gnus-cache.el (gnus-cache-read-active)
      (gnus-cache-update-file-total-fetched-for)
      (gnus-cache-update-overview-total-fetched-for):
      * lisp/gnus/gnus-cloud.el (gnus-cloud-file-new-p):
      * lisp/gnus/gnus-score.el (gnus-score-score-files):
      * lisp/gnus/gnus-start.el (gnus-save-newsrc-file)
      (gnus-master-read-slave-newsrc):
      * lisp/gnus/gnus-sum.el (gnus-summary-import-article):
      * lisp/gnus/gnus-util.el (gnus-file-newer-than)
      (gnus-cache-file-contents):
      * lisp/gnus/mail-source.el (mail-source-delete-old-incoming)
      (mail-source-callback, mail-source-movemail):
      * lisp/gnus/nneething.el (nneething-create-mapping)
      (nneething-make-head):
      * lisp/gnus/nnfolder.el (nnfolder-read-folder):
      * lisp/gnus/nnheader.el (nnheader-file-size)
      (nnheader-insert-nov-file):
      * lisp/gnus/nnmail.el (nnmail-activate):
      * lisp/gnus/nnmaildir.el (nnmaildir--group-maxnum)
      (nnmaildir--new-number, nnmaildir--update-nov)
      (nnmaildir--scan, nnmaildir-request-scan)
      (nnmaildir-request-update-info)
      (nnmaildir-request-expire-articles):
      * lisp/gnus/nnmh.el (nnmh-request-list-1)
      (nnmh-request-expire-articles, nnmh-update-gnus-unreads):
      * lisp/gnus/nnml.el (nnml-request-expire-articles):
      * lisp/gnus/spam-stat.el (spam-stat-save, spam-stat-load)
      (spam-stat-process-directory, spam-stat-test-directory):
      * lisp/ido.el (ido-directory-too-big-p)
      (ido-file-name-all-completions):
      * lisp/image-dired.el (image-dired-get-thumbnail-image)
      (image-dired-create-thumb-1):
      * lisp/info.el (info-insert-file-contents):
      * lisp/ls-lisp.el (ls-lisp-insert-directory)
      (ls-lisp-handle-switches, ls-lisp-classify-file)
      (ls-lisp-format):
      * lisp/mail/blessmail.el:
      * lisp/mail/feedmail.el (feedmail-default-date-generator)
      (feedmail-default-message-id-generator):
      * lisp/mail/mailabbrev.el (mail-abbrevs-sync-aliases)
      (mail-abbrevs-setup):
      * lisp/mail/mspools.el (mspools-size-folder):
      * lisp/mail/rmail.el (rmail-insert-inbox-text):
      * lisp/mail/sendmail.el (sendmail-sync-aliases):
      * lisp/mh-e/mh-alias.el (mh-alias-tstamp):
      * lisp/net/ange-ftp.el (ange-ftp-parse-netrc)
      (ange-ftp-write-region, ange-ftp-file-newer-than-file-p)
      (ange-ftp-cf1):
      * lisp/net/eudcb-mab.el (eudc-mab-query-internal):
      * lisp/net/eww.el (eww-read-bookmarks):
      * lisp/net/netrc.el (netrc-parse):
      * lisp/net/newst-backend.el (newsticker--image-get):
      * lisp/nxml/rng-loc.el (rng-get-parsed-schema-locating-file):
      * lisp/obsolete/fast-lock.el (fast-lock-save-cache):
      * lisp/obsolete/vc-arch.el (vc-arch-state)
      (vc-arch-diff3-rej-p):
      * lisp/org/ob-eval.el (org-babel--shell-command-on-region):
      * lisp/org/org-attach.el (org-attach-commit):
      * lisp/org/org-macro.el (org-macro-initialize-templates):
      * lisp/org/org.el (org-babel-load-file)
      (org-file-newer-than-p):
      * lisp/org/ox-html.el (org-html-format-spec):
      * lisp/org/ox-publish.el (org-publish-find-date)
      (org-publish-cache-ctime-of-src):
      * lisp/pcmpl-gnu.el (pcomplete/tar):
      * lisp/pcmpl-rpm.el (pcmpl-rpm-packages):
      * lisp/play/cookie1.el (cookie-snarf):
      * lisp/progmodes/cmacexp.el (c-macro-expansion):
      * lisp/ps-bdf.el (bdf-file-mod-time):
      * lisp/server.el (server-ensure-safe-dir):
      * lisp/simple.el (shell-command-on-region):
      * lisp/speedbar.el (speedbar-item-info-file-helper)
      (speedbar-check-obj-this-line):
      * lisp/thumbs.el (thumbs-cleanup-thumbsdir):
      * lisp/time.el (display-time-mail-check-directory)
      (display-time-file-nonempty-p):
      * lisp/url/url-cache.el (url-is-cached):
      * lisp/url/url-file.el (url-file-asynch-callback):
      * lisp/vc/diff-mode.el (diff-delete-if-empty):
      * lisp/vc/pcvs-info.el (cvs-fileinfo-from-entries):
      * lisp/vc/vc-bzr.el (vc-bzr-state-heuristic):
      * lisp/vc/vc-cvs.el (vc-cvs-checkout-model)
      (vc-cvs-state-heuristic, vc-cvs-merge-news)
      (vc-cvs-retrieve-tag, vc-cvs-parse-status, vc-cvs-parse-entry):
      * lisp/vc/vc-hg.el (vc-hg--slurp-hgignore-1)
      (vc-hg--ignore-patterns-valid-p)
      (vc-hg--cached-dirstate-search, vc-hg-state-fast):
      * lisp/vc/vc-hooks.el (vc-after-save):
      * lisp/vc/vc-rcs.el (vc-rcs-workfile-is-newer):
      * lisp/vc/vc-svn.el (vc-svn-merge-news, vc-svn-parse-status):
      * lisp/vc/vc.el (vc-checkout, vc-checkin, vc-revert-file):
      * lisp/xdg.el (xdg-mime-apps):
      Prefer (file-attribute-size A) to (nth 7 A), and similarly
      for other file attributes accessors.
      * doc/lispref/files.texi (File Attributes):
      * doc/lispref/intro.texi (Version Info):
      * doc/lispref/os.texi (Idle Timers):
      * lisp/erc/erc.el (erc-string-to-emacs-time):
      * lisp/files.el (file-attribute-access-time)
      (file-attribute-modification-time)
      (file-attribute-status-change-time):
      * lisp/net/tramp-compat.el:
      (tramp-compat-file-attribute-modification-time)
      (tramp-compat-file-attribute-size):
      * src/buffer.c (syms_of_buffer):
      * src/editfns.c (Fget_internal_run_time):
      * src/fileio.c (Fvisited_file_modtime)
      (Fset_visited_file_modtime):
      * src/keyboard.c (Fcurrent_idle_time):
      * src/process.c (Fprocess_attributes):
      Defer implementation details about timestamp format to the
      section that talks about timestamp format, to make it easier
      to change the documentation later if timestamp formats are
      extended.
      * lisp/gnus/gnus-util.el (gnus-file-newer-than):
      * lisp/speedbar.el (speedbar-check-obj-this-line):
      * lisp/vc/vc-rcs.el (vc-rcs-workfile-is-newer):
      Prefer time-less-p to doing it by hand.
      * lisp/ls-lisp.el (ls-lisp-format): Inode numbers are no longer conses.
      * lisp/vc/vc-bzr.el (vc-bzr-state-heuristic):
      Use eql, not eq, to compare integers that might be bignums.
      * lisp/org/ox-publish.el (org-publish-cache-ctime-of-src):
      Prefer float-time to doing time arithmetic by hand.
      662bee7d
  11. 21 Sep, 2018 1 commit
    • Paul Eggert's avatar
      Fix ambiguity in nil DST flag · 0bec0644
      Paul Eggert authored
      Formerly nil meant both that DST was not in effect and that
      the DST flag was unknown, and different functions interpreted
      the flag differently.  Now the meaning is consistently nil for
      DST not in effect, and -1 for DST flag not known.
      * doc/lispref/os.texi (Time Conversion): The DST slot is
      now three-valued, not two-.
      * doc/misc/emacs-mime.texi (time-date): Adjust to new behavior.
      * etc/NEWS: Mention this.
      * lisp/calendar/parse-time.el (parse-time-string):
      * src/editfns.c (Fdecode_time):
      Return -1 for unknown DST flag.
      * test/lisp/calendar/parse-time-tests.el (parse-time-tests):
      Adjust tests to match new behavior, and add a new
      test for nil vs -1.
      0bec0644
  12. 10 Sep, 2018 1 commit
  13. 08 Sep, 2018 1 commit
    • Eli Zaretskii's avatar
      Fix documentation for conversion to bignums · e4896856
      Eli Zaretskii authored
      * src/xselect.c (selection_data_to_lisp_data):
      * src/w32fns.c (Fw32_read_registry):
      * src/process.c (Fprocess_id):
      * src/font.c (Ffont_variation_glyphs, Finternal_char_font):
      * src/fns.c (Fsafe_length):
      * src/editfns.c (Fuser_uid, Fuser_real_uid, Fgroup_gid)
      (Fgroup_real_gid, Femacs_pid):
      * src/dired.c (Ffile_attributes):
      * src/charset.c (Fencode_char): Update commentary and doc
      strings for recent changes that produce bignums where
      previously cons cells of integers were produced.
      e4896856
  14. 05 Sep, 2018 2 commits
    • Paul Eggert's avatar
      Fix format-time-string bignum bug · ccb3891f
      Paul Eggert authored
      The problem can occur on 32-bit platforms with current timestamps.
      * src/editfns.c (disassemble_lisp_time, decode_time_components):
      Support seconds counts that are bignums.
      * test/src/editfns-tests.el (editfns-tests--have-leap-seconds):
      New function.
      (format-time-string-with-bignum-on-32-bit): New test.
      ccb3891f
    • Paul Eggert's avatar
      Simplify bignum->intmax conversion · ecb985c1
      Paul Eggert authored
      * src/lisp.h (integer_to_intmax, integer_to_uintmax): New functions.
      * src/data.c (cons_to_unsigned, cons_to_signed)
      (arith_driver):
      * src/dbusbind.c (xd_extract_signed, xd_extract_unsigned):
      * src/dispnew.c (sit_for):
      * src/editfns.c (styled_format):
      * src/emacs-module.c (module_extract_integer):
      * src/fileio.c (file_offset):
      * src/font.c (font_unparse_xlfd, Fopen_font):
      * src/xdisp.c (calc_line_height_property):
      * src/process.c (handle_child_signal):
      ecb985c1
  15. 31 Aug, 2018 1 commit
    • Paul Eggert's avatar
      Several fixes for formatting bignums · db2fed3b
      Paul Eggert authored
      * src/bignum.c: Include stdlib.h, for abs.
      (bignum_bufsize, bignum_to_c_string): New functions.
      * src/bignum.c (bignum_to_string):
      * src/print.c (print_vectorlike): Use them.
      * src/editfns.c (styled_format): Instead of having a separate
      buffer for sprintf (which does not work for bignums), just append
      to the main buffer.  When formatting bignums, add support for the
      standard integer flags -, #, 0, + and space.  Fix some comments.
      Capitalize properly when formatting bignums with %X.  Use
      functions like c_isdigit rather than reinventing the wheel.
      Simplify computation of excess precision.
      * src/print.c: Do not include bignum.h; no longer needed.
      (print_vectorlike): Avoid recalculating string length.
      * test/src/editfns-tests.el (format-bignum):
      Test some of the above fixes.
      db2fed3b
  16. 28 Aug, 2018 3 commits
    • Paul Eggert's avatar
      Improve (format "%g" bignum) precision · d4586b7a
      Paul Eggert authored
      * src/editfns.c (styled_format): When formatting bignums with
      floating-point conversions like %g, use long double if that
      would lose less information than double, which is what the
      code was already doing for fixnums.  On Fedora 28 x86-64, for
      example, (format "%.100g" (1- (ash 1 64))) now yields
      "18446744073709551615" instead of the numerically incorrect
      "18446744073709549568".  Also, fix a stray INTEGERP that
      can just be FIXNUMP, since bignums are not possible there.
      d4586b7a
    • 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
    • Paul Eggert's avatar
      Modularize bignums better · 9abaf5f3
      Paul Eggert authored
      * src/bignum.c, src/bignum.h: New files.  Only modules that
      need to know how bignums are implemented should include
      bignum.h.  Currently these are alloc.c, bignum.c (of course),
      data.c, emacs.c, emacs-module.c, floatfns.c, fns.c, print.c.
      * src/Makefile.in (base_obj): Add bignum.o.
      * src/alloc.c (make_bignum_str): Move to bignum.c.
      (make_number): Remove; replaced by bignum.c’s make_integer.
      All callers changed.
      * src/conf_post.h (ARG_NONNULL): New macro.
      * src/json.c (json_to_lisp): Use it.
      * src/data.c (Fnatnump):
      Move NATNUMP’s implementation here from lisp.h.
      * src/data.c (Fnumber_to_string):
      * src/editfns.c (styled_format):
      Move conversion of string to bignum to bignum_to_string, and
      call it here.
      * src/emacs-module.c (module_make_integer):
      * src/floatfns.c (Fabs):
      Simplify by using make_int.
      * src/emacs.c: Include bignum.h, to expand its inline fns.
      * src/floatfns.c (Ffloat): Simplify by using XFLOATINT.
      (rounding_driver): Simplify by using double_to_bignum.
      (rounddiv_q): Clarify use of temporaries.
      * src/lisp.h: Move decls that need to know bignum internals to
      bignum.h.  Do not include gmp.h or mini-gmp.h; that is now
      bignum.h’s job.
      (GMP_NUM_BITS, struct Lisp_Bignum, XBIGNUM, mpz_set_intmax):
      Move to bignum.h.
      (make_int): New function.
      (NATNUMP): Remove; all callers changed to use Fnatnump.
      (XFLOATINT): If arg is a bignum, use bignum_to_double, so that
      bignum internals are not exposed here.
      * src/print.c (print_vectorlike): Use SAFE_ALLOCA to avoid the
      need for a record_unwind_protect_ptr.
      9abaf5f3
  17. 13 Aug, 2018 1 commit
    • Paul Eggert's avatar
      Pacify gcc -Og -Wuninitialized · a1e0868f
      Paul Eggert authored
      This addresses the -Og uninitialized variable warnings I ran
      into on Fedora 28, which uses 8.1.1 20180712 (Red Hat 8.1.1-5).
      It also changes some explicit initializations to UNINIT
      when the variable does not actually need to be initialized.
      * src/process.c (connect_network_socket):
      * src/sysdep.c (system_process_attributes):
      * src/xfns.c (x_real_pos_and_offsets):
      * src/xterm.c (get_current_wm_state) [USE_XCB]:
      Add UNINIT.
      * src/editfns.c (tzlookup):
      * src/fns.c (Fnconc):
      * src/font.c (font_parse_fcname):
      * src/frame.c (x_set_frame_parameters):
      Prefer UNINIT to explicit initialization.
      a1e0868f
  18. 12 Aug, 2018 2 commits
    • Eli Zaretskii's avatar
      ; Avoid compilation warnings under -Og · d9806a55
      Eli Zaretskii authored
      * src/w32.c (w32_read_registry):
      * src/font.c (font_parse_fcname):
      * src/fns.c (Fnconc):
      * src/editfns.c (tzlookup):
      * src/frame.c (x_set_frame_parameters): Avoid compiler warnings
      about maybe-uninitialized variables.
      d9806a55
    • Paul Eggert's avatar
      Turn misc objects into pseudovectors · d614e4a8
      Paul Eggert authored
      Eliminate the category of miscellaneous objects, and turn all
      such objects into pseudovectors.  The immediate motivation
      for this change is to free up an enum Lisp_Type tag value, a
      scarce resource that can be better used elsewhere.  However,
      this change is worthwhile in its own right, as it improves
      performance slightly on my platform, 0.3% faster for 'make
      compile-always' on Fedora 28, and it simplifies the garbage
      collector and interpreter (Bug#32405).
      * doc/lispref/internals.texi (Garbage Collection):
      * etc/NEWS:
      Document change to garbage-collect return value.
      * src/alloc.c (total_markers, total_free_markers):
      (union aligned_Lisp_Misc, MARKER_BLOCK_SIZE)
      (struct marker_block, marker_block, marker_block_index)
      (misc_free_list, allocate_misc, live_misc_holding)
      (live_misc_p, sweep_misc):
      * src/lisp.h (lisp_h_MARKERP, lisp_h_MISCP, MARKERP, MISCP)
      (Lisp_Misc, enum Lisp_Misc_Type, Lisp_Misc_Free)
      (Lisp_Misc_Marker, Lisp_Misc_Overlay, Lisp_Misc_Finalizer)
      (Lisp_Misc_Ptr, Lisp_Misc_User_Ptr, Lisp_Misc_Limit)
      (Lisp_Misc_Bignum)
      (XSETMISC, struct Lisp_Misc_Any, XMISCANY, XMISCTYPE)
      (struct Lisp_Free, union Lisp_Misc, XMISC):
      Remove.  All uses removed.
      (cleanup_vector): Clean up objects that were formerly misc
      and are now pseudovectors.
      (make_misc_ptr, build_overlay, Fmake_marker, build_marker)
      (make_bignum_str, make_number, make_pure_bignum)
      (make_user_ptr, Fmake_finalizer):
      Build as pseudovectors, not as misc objects.
      (mark_finalizer_list, queue_doomed_finalizers)
      (compact_undo_list, mark_overlay, mark_object)
      (unchain_dead_markers):
      Mark as vector-like objects, not as misc objects.
      (mark_maybe_object, mark_maybe_pointer, valid_lisp_object_p)
      (total_bytes_of_live_objects, survives_gc_p):
      * src/fns.c (sxhash):
      No need to worry about misc objects.
      (garbage_collect_1): Do not generate a 'misc' component.
      (syms_of_alloc): No need for 'misc' symbol.
      * src/buffer.c (overlays_at, overlays_in, overlay_touches_p)
      (overlay_strings, recenter_overlay_lists)
      (fix_start_end_in_overlays, fix_overlays_before)
      (Foverlay_lists, report_overlay_modification)
      (evaporate_overlays):
      * src/editfns.c (overlays_around):
      * src/data.c (Ftype_of):
      * src/fns.c (internal_equal):
      * src/lisp.h (mint_ptrp, xmint_pointer, FINALIZERP)
      (XFINALIZER, MARKERP, XMARKER, OVERLAYP, XOVERLAY, USER_PTRP)
      (XUSER_PTR, BIGNUMP, XBIGNUM):
      * src/print.c (print_vectorlike, print_object):
      * src/undo.c (record_marker_adjustments):
      * src/xdisp.c (load_overlay_strings):
      Formerly misc objects are now pseudovectors.
      * src/lisp.h (PVEC_MARKER, PVEC_OVERLAY, PVEC_FINALIZER)
      (PVEC_BIGNUM, PVEC_MISC_PTR, PVEC_USER_PTR):
      New constants, replacing their misc versions.  All uses changed.
      (struct Lisp_Marker, struct Lisp_Overlay, struct Lisp_Misc_Ptr)
      (struct Lisp_Bignum, struct Lisp_User_Ptr, struct Lisp_Finalizer):
      Make usable as a pseudovector by using a pseudovector header,
      replacing any DIY components, and putting Lisp_Object members
      first.  All uses changed.
      d614e4a8
  19. 10 Aug, 2018 1 commit
  20. 09 Aug, 2018 1 commit
    • Eli Zaretskii's avatar
      Fix copying text properties by 'format' · 71c92d89
      Eli Zaretskii authored
      * src/editfns.c (styled_format): Add the spec beginning index
      to the info recorded for each format spec, and use it to
      detect the case that a format spec and its text property end
      where the next spec with another property begins.  (Bug#32404)
      
      * test/src/editfns-tests.el (format-properties): Add tests for
      bug#32404.
      71c92d89
  21. 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
  22. 27 Jul, 2018 1 commit
  23. 26 Jul, 2018 2 commits
    • Paul Eggert's avatar
    • Paul Eggert's avatar
      %o and %x can now format signed integers · 4a56ca5b
      Paul Eggert authored
      Optionally treat integers as signed numbers with %o
      and %x format specifiers, instead of treating them as
      a machine-dependent two’s complement representation.
      This option is more machine-independent, allows formats
      like "#x%x" to be useful for reading later, and is
      better-insulated for future changes involving bignums.
      Setting the new variable ‘binary-as-unsigned’ to nil
      enables the new behavior (Bug#32252).
      This is a simplified version of the change proposed in:
      https://lists.gnu.org/r/emacs-devel/2018-07/msg00763.html
      I simplified that proposal by omitting bitwidth modifiers, as
      I could not find an any example uses in the Emacs source code
      that needed them and doing them correctly would have been
      quite a bit more work for apparently little benefit.
      * doc/lispref/strings.texi (Formatting Strings):
      Document that %x and %o format negative integers in a
      platform-dependent way.  Also, document how to format
      numbers so that the same values can be read back in.
      * etc/NEWS: Document the change.
      * src/editfns.c (styled_format): Treat integers as signed
      numbers even with %o and %x, if binary-as-unsigned is nil.
      Support the + and space flags with %o and %x, since they’re
      about signs.
      (syms_of_editfns): New variable binary-as-unsigned.
      * test/src/editfns-tests.el (read-large-integer):
      Test that maximal integers can be read after printing
      with all integer formats, if binary-as-unsigned is nil.
      4a56ca5b
  24. 23 Jul, 2018 2 commits
    • Paul Eggert's avatar
      (format "%#x" 0) yields "0", not "0x0" · 90256285
      Paul Eggert authored
      * doc/lispref/strings.texi (Formatting Strings):
      * src/editfns.c (Fformat): Document this.
      90256285
    • Paul Eggert's avatar
      positive → nonnegative doc fixes · 109cb152
      Paul Eggert authored
      * doc/lispref/numbers.texi (Bitwise Operations)
      (Math Functions):
      * doc/lispref/strings.texi (Formatting Strings):
      * src/editfns.c (Fformat):
      Correct “positive” with “nonnegative” in some documentation.
      109cb152
  25. 21 Jul, 2018 2 commits
  26. 13 Jul, 2018 2 commits
    • Tom Tromey's avatar
      Make format handle bignums · d14808cd
      Tom Tromey authored
      * src/editfns.c (styled_format): Handle bignums.
      * test/src/editfns-tests.el (read-large-integer): Update.
      (format-bignum): New test.
      d14808cd
    • 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
  27. 03 Jul, 2018 1 commit
    • Eli Zaretskii's avatar
      Speed up 'replace-buffer-contents' some more · 0dce5e59
      Eli Zaretskii authored
      * src/editfns.c (EXTRA_CONTEXT_FIELDS): New members beg_a and beg_b.
      (Freplace_buffer_contents): Set up ctx.beg_a and ctx.beg_b.
      (buffer_chars_equal): Use ctx->beg_a and ctx->beg_b instead of
      calling BUF_BEGV, which is expensive.  This speeds up the recipe
      in bug#31888 by 30%.
      0dce5e59
  28. 30 Jun, 2018 2 commits
    • Eli Zaretskii's avatar
      Improve on last change in replace-buffer-contents · ab983522
      Eli Zaretskii authored
      * src/editfns.c (Freplace_buffer_contents): Call modification
      hooks only for the actual region where changes are made.
      (Bug#31888)
      ab983522
    • 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