1. 04 Dec, 2019 1 commit
    • Philipp Stephani's avatar
      Change module interface to no longer use GMP objects directly. · 096be9c4
      Philipp Stephani authored
      As described in the new comment added to emacs-module.c, using GMP
      directly in the module interface has significant downsides: it couples
      the module interface directly to the implementation and requires
      module authors to link their module against the same GMP library as
      Emacs itself, which is often difficult and an unnecessary burden.  By
      picking a representation for the magnitude that often matches the one
      used by GMP, we can avoid overhead when converting from and to GMP in
      most cases.
      
      Loading the test module in test/data/emacs-module and evaluating
      
      (dotimes (_ 10000)
        (mod-test-double (* 2 most-negative-fixnum)))
      
      under Callgrind shows that on my (GNU/Linux) machine Emacs only spends
      10% of the CPU time of mod-test-double in mpz_import and mpz_export
      combined, even though that function does little else.  (By contrast,
      30% is spent in allocate_pseudovector.)
      
      * src/emacs-module.h.in: Don't check EMACS_MODULE_GMP.  Don't include
      gmp.h.  Remove emacs_mpz structure.  Instead, define type alias
      emacs_limb_t and macro EMACS_LIMB_MAX.
      
      * src/module-env-27.h: Change interface of extract_big_integer and
      make_big_integer to take a sign-magnitude representation instead of
      mpz_t.
      
      * src/emacs-module.c: Don't check EMACS_MODULE_GMP or
      EMACS_MODULE_HAVE_MPZ_T.  Add a comment about the chosen
      implementation.
      (module_extract_big_integer, module_make_big_integer): Reimplement
      without using mpz_t in the interface.
      
      * doc/lispref/internals.texi (Module Values): Adapt function
      documentation and example.  Stop mentioning GMP and EMACS_MODULE_GMP.
      
      * test/data/emacs-module/mod-test.c: Don't define EMACS_MODULE_GMP or
      EMACS_MODULE_HAVE_MPZ_T.
      (memory_full, extract_big_integer, make_big_integer): New helper
      functions, identical to example in the Info documentation.
      (Fmod_test_nanoseconds, Fmod_test_double): Adapt to new interface.
      096be9c4
  2. 15 Oct, 2019 1 commit
  3. 13 Oct, 2019 1 commit
    • Juri Linkov's avatar
      Enable tab-bar-mode from X resources · 097a03d2
      Juri Linkov authored
      * lisp/startup.el (x-apply-session-resources): Enable tab-bar-mode
      when X resource "tabBar" class "TabBar" is "on", "yes" or "1".
      
      * doc/man/emacs.1.in:
      * doc/emacs/xresources.texi (Table of Resources):
      Document X resource "tabBar" (class "TabBar").
      097a03d2
  4. 09 Oct, 2019 2 commits
    • Robert Pluim's avatar
      Expand documentation on Lisp variables defined in C sources · b5fbefda
      Robert Pluim authored
      * doc/lispref/internals.texi (Writing Emacs Primitives): Add
      description of DEFVAR_* arguments.  Describe variable naming
      conventions.  Explain how to express quoting of symbols in C, plus
      'specbind' and how to create buffer-local variables.
      b5fbefda
    • Eli Zaretskii's avatar
      Fix minor Texinfo errors in ELisp manual · 87d999a2
      Eli Zaretskii authored
      * doc/lispref/errors.texi (Standard Errors): Fix incorrect
      usage of @xref commands.  (Bug#37660)
      * doc/lispref/internals.texi (Buffer Internals): Fix markup.
      (Bug#37639)
      87d999a2
  5. 14 Sep, 2019 1 commit
  6. 23 Jul, 2019 1 commit
    • Paul Eggert's avatar
      Improve pdumper doc; say unexec is deprecated · 8dd5b6ea
      Paul Eggert authored
      Say that pdumping cannot redump unless -batch is used.  Say that
      the traditional unexec dumping method is by default not available,
      and is deprecated.  Don't call dump files "portable", as dump files
      are not any more portable than the Emacs executables themselves.
      Just call them "dump files".  Similar, prefer "portable dumper"
      (since the dumper code is portable) to "portable dumping" (since
      the dump file is not).  Be more systematic about calling them
      "dump files" instead of "dumped images" or whatnot.
      8dd5b6ea
  7. 07 Jul, 2019 1 commit
    • Paul Eggert's avatar
      Remove printmax_t etc. · 8f522efe
      Paul Eggert authored
      printmax_t etc. were needed only for platforms that lacked
      support for printing intmax_t.  These platforms are now so
      obsolete that they are no longer practical porting targets.
      * src/image.c (gs_load): Fix unlikely buffer overrun
      discovered while making these changes.  It was introduced in
      2011-07-17T00:34:43!eggert@cs.ucla.edu.
      * src/lisp.h (printmax_t, uprintmax_t, pMd, pMu, pMx):
      Remove.  All uses replaced by their standard counterparts
      intmax_t, uintmax_t, PRIdMAX, PRIuMAX, PRIxMAX.
      8f522efe
  8. 26 Jun, 2019 2 commits
  9. 28 Apr, 2019 1 commit
    • Philipp Stephani's avatar
      Export major version of latest Emacs supported by emacs-module.h. · 4d97e1a9
      Philipp Stephani authored
      This is useful if module authors want to support multiple versions of
      emacs-module.h.
      
      * configure.ac (emacs_major_version): Define substitution.
      
      * src/emacs-module.h.in (EMACS_MAJOR_VERSION): Define macro.
      
      * doc/lispref/internals.texi (Module Initialization): Document
      EMACS_MAJOR_VERSION preprocessor macro.
      
      * test/data/emacs-module/mod-test.c (emacs_module_init): Verify
      behavior of EMACS_MAJOR_VERSION.
      4d97e1a9
  10. 24 Apr, 2019 4 commits
    • Philipp Stephani's avatar
    • Philipp Stephani's avatar
      Clarify rounding mode when converting to struct timespec. · c4bacb12
      Philipp Stephani authored
      * doc/lispref/internals.texi (Module Values): Clarify that the
      truncation is towards negative infinity.
      
      * test/data/emacs-module/mod-test.c (Fmod_test_nanoseconds): Add test
      function.
      (emacs_module_init): Define it.
      
      * test/src/emacs-module-tests.el (mod-test-nanoseconds): New unit test.
      c4bacb12
    • Philipp Stephani's avatar
      Add module functions to convert from and to big integers. · e290a7d1
      Philipp Stephani authored
      * src/module-env-27.h: Add new module functions to convert big
      integers.
      
      * src/emacs-module.h.in (emacs_mpz): Define if GMP is available.
      
      * src/emacs-module.c (module_extract_big_integer)
      (module_make_big_integer): New functions.
      (initialize_environment): Use them.
      
      * test/data/emacs-module/mod-test.c (Fmod_test_double): New test
      function.
      (emacs_module_init): Define it.
      
      * test/src/emacs-module-tests.el (mod-test-double): New unit test.
      
      * doc/lispref/internals.texi (Module Values): Document new functions.
      e290a7d1
    • Philipp Stephani's avatar
      Add conversions to and from struct timespec to module interface. · bffceab6
      Philipp Stephani authored
      Time values are a fundamental data type, and such conversions are hard
      to implement within modules because of the various forms of time
      values in Emacs Lisp.  Adding dedicated conversion functions can
      significantly simplify module code dealing with times.
      
      This approach uses nanosecond precision.  While Emacs in theory has
      support for higher-precision time values, in practice most languages
      and standards, such as POSIX, C, Java, and Go, have settled on
      nanosecond-precision integers to represent time.
      
      * src/emacs-module.h.in: Add header for struct timespec.
      
      * src/module-env-27.h: Add module functions for time conversion.
      
      * src/emacs-module.c (module_extract_time, module_make_time): New
      functions.
      (initialize_environment): Use them.
      
      * test/data/emacs-module/mod-test.c (Fmod_test_add_nanosecond): New
      test function.
      (emacs_module_init): Define it.
      
      * test/src/emacs-module-tests.el (mod-test-add-nanosecond/valid)
      (mod-test-add-nanosecond/nil, mod-test-add-nanosecond/invalid): New
      unit tests.
      
      * doc/lispref/internals.texi (Module Values): Document time
      conversion functions.
      bffceab6
  11. 22 Apr, 2019 2 commits
    • Basil L. Contovounesios's avatar
      Backport: Improve pure and side-effect-free docs · 3988e93d
      Basil L. Contovounesios authored
      For discussion, see thread starting at:
      https://lists.gnu.org/archive/html/emacs-devel/2019-04/msg00316.html
      * doc/lispref/customize.texi (Composite Types): Do not overspecify
      :match-alternatives predicates.
      * doc/lispref/eval.texi (Intro Eval): Anchor definition of "side
      effect" for cross-referencing...
      * doc/lispref/functions.texi (What Is a Function): ...from here.
      Define what a pure function is.
      * doc/lispref/internals.texi (Writing Emacs Primitives): Describe
      currently preferred approach to marking primitives as pure and
      side-effect-free.
      * doc/lispref/symbols.texi (Standard Properties): Expand description
      of pure and side-effect-free properties.
      
      (cherry picked from commit 4430a9b5)
      3988e93d
    • Basil L. Contovounesios's avatar
      Improve pure and side-effect-free docs · 4430a9b5
      Basil L. Contovounesios authored
      For discussion, see thread starting at:
      https://lists.gnu.org/archive/html/emacs-devel/2019-04/msg00316.html
      * doc/lispref/customize.texi (Composite Types): Do not overspecify
      :match-alternatives predicates.
      * doc/lispref/eval.texi (Intro Eval): Anchor definition of "side
      effect" for cross-referencing...
      * doc/lispref/functions.texi (What Is a Function): ...from here.
      Define what a pure function is.
      * doc/lispref/internals.texi (Writing Emacs Primitives): Describe
      currently preferred approach to marking primitives as pure and
      side-effect-free.
      * doc/lispref/symbols.texi (Standard Properties): Expand description
      of pure and side-effect-free properties.
      4430a9b5
  12. 18 Apr, 2019 1 commit
  13. 25 Mar, 2019 1 commit
  14. 24 Feb, 2019 1 commit
    • Philipp Stephani's avatar
      Ignore pending_signals when checking for quits. · 72ec233f
      Philipp Stephani authored
      pending_signals is often set if no quit is pending.  This results in
      bugs in module code if the module returns but no quit is actually
      pending.
      
      As a better alternative, add a new process_input environment function
      for Emacs 27.  That function processes signals (like maybe_quit).
      
      * configure.ac: Add module snippet for Emacs 27.
      
      * src/module-env-27.h: New file.
      
      * src/emacs-module.h.in: Add process_input function to environment
      interface.
      
      * src/emacs-module.c (module_should_quit): Use QUITP macro to check
      whether the caller should quit.
      (module_process_input): New function.
      (initialize_environment): Use it.
      
      * src/eval.c: Remove obsolete comment.
      
      * test/data/emacs-module/mod-test.c (signal_wrong_type_argument)
      (signal_errno): New helper functions.
      (Fmod_test_sleep_until): New test module function.
      
      * test/src/emacs-module-tests.el (mod-test-sleep-until): New unit
      test.
      
      * doc/lispref/internals.texi (Module Misc): Document process_input.
      72ec233f
  15. 29 Jan, 2019 1 commit
  16. 19 Jan, 2019 2 commits
    • Paul Eggert's avatar
      pdumper-stats now returns s, not ms · 3e125517
      Paul Eggert authored
      * doc/lispref/internals.texi (pdumper-stats):
      * src/pdumper.c (pdumper_load): Return seconds, not milliseconds.
      Minimize rounding errors in the usual case.
      3e125517
    • Eli Zaretskii's avatar
      Improve 'pdumper-stats' and its documentation · 8bb5939e
      Eli Zaretskii authored
      * src/pdumper.c (Fpdumper_stats): Improve formatting and
      wording of the doc string.  Decode the pdump file name and
      expand-file-name it.
      
      * doc/lispref/internals.texi (Building Emacs): Document
      'pdumper-stats'.
      8bb5939e
  17. 18 Jan, 2019 1 commit
    • Eli Zaretskii's avatar
      Improve documentation of portable dumping · 6bac9ea1
      Eli Zaretskii authored
      * src/pdumper.c (Fdump_emacs_portable): Improve the doc string
      and the error messages.
      
      * doc/lispref/internals.texi (Building Emacs): Document
      portable dumping and the 'dump-emacs-portable' function.
      6bac9ea1
  18. 01 Jan, 2019 1 commit
  19. 03 Dec, 2018 1 commit
  20. 20 Nov, 2018 1 commit
  21. 14 Oct, 2018 1 commit
  22. 11 Oct, 2018 2 commits
  23. 07 Sep, 2018 1 commit
  24. 14 Aug, 2018 1 commit
    • Paul Eggert's avatar
      Remove more traces of misc (Bug#32405) · 11c7c2f7
      Paul Eggert authored
      Remove misc-objects-consed and the misc component of
      memory-use-count, since misc objects no longer exist.
      * doc/lispref/internals.texi, etc/NEWS: Mention this,
      and adjust better to recent removal of misc objects.
      * src/alloc.c (MEM_TYPE_MISC): Remove; no longer used.
      (Fmemory_use_counts): Omit misc count, since miscs
      no longer exist.
      (misc-objects-consed): Remove.
      11c7c2f7
  25. 12 Aug, 2018 2 commits
    • Paul Eggert's avatar
      1145bd0e
    • 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
  26. 25 Jun, 2018 1 commit
  27. 24 Jun, 2018 1 commit
    • Karl Fogel's avatar
      Say how to override a primitive interactive spec · 9a53b6d4
      Karl Fogel authored
      * doc/lispref/internals.texi (Writing Emacs Primitives): Mention that
        the `interactive-form' property can be used to override a primitive
        interactive specification, and refer to the detailed documentation
        for setting that property.
      
      From this thread on Emacs Devel:
      
        https://lists.gnu.org/archive/html/emacs-devel/2018-03/msg00923.html
        From: Eli Zaretskii
        To: Karl Fogel
        CC: Juri Linkov, Emacs Devel
        Subject: Re: [Emacs-diffs] \
                 master b88e7c8b: Make transpose-regions interactive (Bug#30343)
        Date: Thu, 29 Mar 2018 14:38:15 +0300
        Message-Id: <834lkzdsd4.fsf@gnu.org>
      9a53b6d4
  28. 16 Jun, 2018 1 commit
    • Paul Eggert's avatar
      Rewrite memory-limit in Lisp · ec1b4d9a
      Paul Eggert authored
      Have it return Emacs virtual memory size, not the sbrk value
      which is often useless newadays.
      * doc/lispref/internals.texi (Garbage Collection):
      * etc/NEWS: Document this.
      * lisp/subr.el (memory-limit): New implementation in Lisp,
      written in terms of process-attributes, and which returns
      virtual memory size.
      * src/alloc.c (Fmemory_limit): Remove C implementation.
      ec1b4d9a
  29. 13 Apr, 2018 1 commit
    • Eli Zaretskii's avatar
      Fix typos and minor wording issues in ELisp manual · 6bdcaec8
      Eli Zaretskii authored
      * doc/lispref/internals.texi (Writing Emacs Primitives):
      * doc/lispref/display.texi (Temporary Displays): Fix typos.
      * doc/lispref/text.texi (Filling, Changing Properties)
      (Transposition): Clarify and fix typos.
      * doc/lispref/positions.texi (Screen Lines): Improve wording.
      * doc/lispref/modes.texi (Minor Mode Conventions)
      (Font Lock Multiline): Fix typos.
      * doc/lispref/variables.texi (Dynamic Binding Tips): Fix a
      cross-reference.  Fix a typo.
      * doc/lispref/sequences.texi (Sequence Functions): Fix typos.
      (Bug#31143)
      6bdcaec8
  30. 22 Mar, 2018 1 commit
    • Eli Zaretskii's avatar
      Document DEFUN attributes · 8ac621bb
      Eli Zaretskii authored
      * doc/lispref/internals.texi (Writing Emacs Primitives): Document
      specification of function attributes in DEFUN.
      8ac621bb
  31. 21 Mar, 2018 1 commit