1. 16 Jun, 2018 13 commits
    • Bozhidar Batsov's avatar
      Fix a docstring · adc80ddc
      Bozhidar Batsov authored
    • Bozhidar Batsov's avatar
    • João Távora's avatar
      Fix bug in elisp-flymake-byte-compile · 9740768a
      João Távora authored
      * lisp/progmodes/elisp-mode.el (elisp-flymake-byte-compile): Pass
      keyword args to make-process.
    • 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.
    • Paul Eggert's avatar
      Fix byte compilation of (eq foo 'default) · 9af399fd
      Paul Eggert authored
      Do not use the symbol ‘default’ as a special marker.
      Instead, use a value that cannot appear in the program,
      improving on a patch proposed by Robert Cochran (Bug#31718#14).
      * lisp/emacs-lisp/bytecomp.el (byte-compile--default-val):
      New constant.
      (byte-compile-cond-jump-table): Use it instead of 'default.
      * test/lisp/emacs-lisp/bytecomp-tests.el:
      (byte-opt-testsuite-arith-data): Add a test for the bug.
    • Eli Zaretskii's avatar
      Use mint_ptr in w32notify.c · 34e257f8
      Eli Zaretskii authored
      * src/w32notify.c (Fw32notify_add_watch, Fw32notify_rm_watch)
      (Fw32notify_valid_p, w32_get_watch_object): Use make_mint_ptr and
    • Eli Zaretskii's avatar
    • Eli Zaretskii's avatar
      Minor doc string fixes in json.c · bd68321d
      Eli Zaretskii authored
      * src/json.c (Fjson_serialize, Fjson_insert): Fix 'usage'.
    • Eli Zaretskii's avatar
      Formatting and doc fixes in recent changes · 67946b0c
      Eli Zaretskii authored
      * src/xfaces.c (evaluate_face_filter): Explain the inner braces.
      (merge_face_ref): Fix whitespace.
      (syms_of_xfaces) <face-filters-always-match>: Doc fix.
      * src/xdisp.c (extend_face_to_end_of_line): Fix whitespace.
    • Eli Zaretskii's avatar
      Improve documentation of several recent changes · 0a6a2fb1
      Eli Zaretskii authored
      * src/xfaces.c (merge_face_ref): Fix a typo in the commentary.
      (evaluate_face_filter, filter_face_ref): Minor copyedits in
      the commentary.
      * doc/lispref/display.texi (Face Remapping):
      * doc/lispref/text.texi (Special Properties): Document the
      ':filter' face specs and their effects.  Document
      * doc/emacs/files.texi (Visiting): Document the new
      possibility to visit large files literally in response to
      question asked by Emacs.
      * etc/NEWS: Mention the new possibility to visit large files
      * lisp/files.el (files--ask-user-about-large-file): Use
      "literally" instead of "raw", for consistency with
      * doc/lispref/frames.texi (Input Focus): Tell explicitly that
      focus-change events are sometimes supported on TTY frames.
    • Eli Zaretskii's avatar
      Prevent QUIT to top level inside 'while-no-input' · 2461266b
      Eli Zaretskii authored
      * lisp/subr.el (while-no-input): Handle the case when BODY
      never tests quit-flag, and runs to completion even though
      input arrives while BODY executes.  (Bug#31692)
    • Eli Zaretskii's avatar
      Fix a typo in xmenu.c · 31b2680b
      Eli Zaretskii authored
      * src/xmenu.c (x_menu_show): Replace a call to
      record_unwind_protect_pointer with record_unwind_protect_ptr.
    • Ari Roponen's avatar
      Fix --with-cairo build · a36008b5
      Ari Roponen authored
      * src/xterm.c (x_cr_destroy): Remove extra semicolon.
      (x_cr_export_frames): Fix a typo in calling
      record_unwind_protect_ptr.  (Bug#31856)
  2. 15 Jun, 2018 19 commits
    • Paul Eggert's avatar
      * src/Makefile.in: Update paxctl comment. · 7f2cfcce
      Paul Eggert authored
    • Paul Eggert's avatar
      Minor CANNOT_DUMP cleanups · b8b960e5
      Paul Eggert authored
      Mostly, this avoids munging executables when CANNOT_DUMP = yes,
      as the munging is needed only for unexec.
      * configure.ac (PAXCTL_dumped, PAXCTL_notdumped) [CANNOT_DUMP]:
      Leave these empty.
      Do not append -no-pie or -nopie.
      * src/alloc.c (my_heap_start) [CANNOT_DUMP]: Omit; not used.
    • Paul Eggert's avatar
      Remove old combreloc hack · c2b20948
      Paul Eggert authored
      It has not been needed for many years and gets in the way of
      portable dumping, address sanitization, etc.  See:
      * configure.ac (LDFLAGS_NOCOMBRELOC, emacs_cv_znocombreloc):
      Remove.  All uses removed.
      * etc/PROBLEMS: Remove discussion of combreloc problems.
    • Paul Eggert's avatar
      Fix typo in previous macfont.m change · dec54ec0
      Paul Eggert authored
      * src/macfont.m (macfont_descriptor_entity): Fix typo.
      Problem reported by Clemens Schüller.
    • Paul Eggert's avatar
      Restore macfont.m casts to void * · 850c0c1a
      Paul Eggert authored
      * src/macfont.m (macfont_set_family_cache): Restore casts
      to void * that were mistakenly removed in my recent change.
      The types in question are pointer-to-const.  Problem
      reported by Clemens Schüller.
    • João Távora's avatar
      Fix a bug in Flymake handling of region-specific reports · 115decb0
      João Távora authored
      The backend's diagnostic list must be updated too, not just cleared.
      * lisp/progmodes/flymake.el (flymake--diag): Add overlay field.
      (flymake--highlight-line): Return created overlay.
      (flymake--handle-report): Iterate the backend's diagnostics, not
      the overlays.  Set diagnostic overlay.
      (flymake--run-backend): Don't clean diagnostic list here.
      (flymake-mode): Call delete-overlay directly.
    • Eli Zaretskii's avatar
      Fix building --without-x and similar · 4221809b
      Eli Zaretskii authored
      * src/keyboard.c (make_lispy_focus_out): Compile it
      unconditionally, as it is now supported on TTYs as well.
      Reported by Filipp Gunbin <fgunbin@fastmail.fm>.
    • João Távora's avatar
      Flymake and backends exchange hints abouts changed regions · 3e7dff88
      João Távora authored
      * lisp/progmodes/flymake.el (flymake--delete-own-overlays): Accept
      BEG and END.  Rename from flymake-delete-own-overlays.
      (flymake-diagnostic-functions): Describe :region, :recent-changes
      in docstring.
      (flymake--handle-report): Accept REGION.
      (flymake--run-backend): Accept optional ARGS to pass to backend
      (flymake--recent-changes): New buffer-local variable.
      (flymake-start): Call flymake--run-backend with recent changes.
      (flymake-mode): Initialize flymake--recent-changes.  Call
      (flymake-after-change-function): Collect recent changes.
      * doc/misc/flymake.texi (Backend functions): Describe
      :recent-changes and :region.
      * etc/NEWS (Flymake): Mention improvements in backend communication.
    • Tino Calancha's avatar
      customize-apropos: Separate package name from its description · aeb6b2e3
      Tino Calancha authored
      * lisp/cus-edit.el (custom-group-value-create):
      Always insert documentation indented from its package name (Bug#31466).
    • Paul Eggert's avatar
      Remove Lisp_Misc_Save_Value · 4139c98e
      Paul Eggert authored
      This type and its associated routines are no longer used.
      * src/alloc.c (voidfuncptr): Move here from src/lisp.h.
      (free_misc, make_save_int_int_int)
      (make_save_obj_obj_obj_obj, make_save_ptr)
      (make_save_ptr_int, make_save_ptr_ptr)
      (make_save_funcptr_ptr_obj, make_save_memory)
      (free_save_value, mark_save_value):
      (mark_object): Remove mention of Lisp_Misc_Save_Value.
      * src/lisp.h (Lisp_Misc_Save_Value, SAVE_SLOT_BITS)
      (SAVE_VALUE_SLOTS, SAVE_TYPE_BITS, enum Lisp_Save_Type)
      (struct Lisp_Save_Value, SAVE_VALUEP, XSAVE_VALUE)
      (save_type, XSAVE_POINTER, set_save_pointer)
      (XSAVE_FUNCPOINTER, XSAVE_INTEGER, set_save_integer)
      (XSAVE_OBJECT): Remove.
      (union Lisp_Misc): Remove u_save_value.
      (voidfuncptr): Move from here to src/alloc.c.
      * src/print.c (print_object):
      Remove support for printing Lisp_Misc_Save_Value.
    • Paul Eggert's avatar
      New type Lisp_Misc_Ptr · f8ad6b31
      Paul Eggert authored
      This is a streamlined version of Lisp_Save_Value, which contains just
      a pointer, as that is all Lisp_Save_Values are used for any more.
      With the previous changes, these objects are not primarily used as
      save values, so just call them "Misc" rather than "Save".
      * src/alloc.c (make_misc_ptr): New function.
      (mark_object): Mark Lisp_Misc_Ptr too.
      * src/lisp.h (Lisp_Misc_Ptr): New constant.
      (struct Lisp_Misc_Ptr): New type.
      (make_mint_ptr, mint_ptrp, xmint_pointer):
      Use Lisp_Misc_Ptr, not Lisp_Save_Value.
      (union Lisp_Misc): Add Lisp_Misc_Ptr.
      * src/print.c (print_object): Print Lisp_Misc_Ptr.
    • Paul Eggert's avatar
      Avoid allocating Lisp_Save_Value for arrays · d98670eb
      Paul Eggert authored
      * src/alloc.c (mark_maybe_objects): New function.
      * src/eval.c (default_toplevel_binding)
      (backtrace_eval_unrewind, Fbacktrace__locals):
      Treat array unwindings like other miscellaneous pdl types.
      (record_unwind_protect_array): New function.
      (do_one_unbind): Free the array while unwinding.
      (mark_specpdl): Mark arrays directly.
      * src/lisp.h (SPECPDL_UNWIND_ARRAY): New constant.
      (union specbinding): New member unwind_array.
      (SAFE_ALLOCA_LISP_EXTRA): Use record_unwind_protect_array
      instead of make_save_memory + record_unwind_protect.
    • Paul Eggert's avatar
      Avoid allocating Lisp_Save_Value for excursions · aca938d1
      Paul Eggert authored
      * src/editfns.c (save_excursion_save): New arg PDL,
      specifying where to save the state.  All uses changed.
      (save_excursion_restore): Args are now the marker and info
      rather than a pointer to a Lisp_Save_Value containing them.
      All uses changed.
      * src/eval.c (default_toplevel_binding, Fbacktrace__locals):
      Treat excursions like other miscellaneous pdl types.
      (record_unwind_protect_excursion): Save data directly
      into the pdl rather than creating an object on the heap.
      This avoids the need to allocate and free an object.
      (do_one_unbind, backtrace_eval_unrewind):
      Unwind excursions directly.
      (mark_specpdl): Mark excursions directly.
      * src/lisp.h (SPECPDL_UNWIND_EXCURSION): New constant.
      (union specbinding): New member unwind_excursion.
    • Paul Eggert's avatar
      Just use cons in macfont_descriptor_entity · 6c04c848
      Paul Eggert authored
      * src/macfont.m (macfont_descriptor_entity): Use cons instead
      of make_save_ptr_int, as this avoids the need for a special
      type and function for this one-off.
    • Paul Eggert's avatar
      Avoid allocating a Lisp_Save_Value in ftfont.c · 888bf987
      Paul Eggert authored
      * src/ftfont.c (struct ftfont_cache_data): New member face_refcount.
      (ftfont_lookup_cache): Clear it when initializing.
      Use make_mint_ptr, since this typically avoids the need to
      allocate a Lisp_Save_Value as refcount is now stored elsewhere.
      (ftfont_open2, ftfont_close): Manipulate the reference
      count in the struct, not in the save object.
    • Paul Eggert's avatar
      Use record_unwind_protect_ptr to avoid allocation · 3f0a8a2e
      Paul Eggert authored
      * src/term.c (struct tty_pop_down_menu): New type.
      (tty_pop_down_menu, tty_menu_show): Use it, along with
      record_unwind_protect_ptr, to avoid allocating a Lisp_Misc.
      * src/xmenu.c (struct pop_down_menu): New type.
      (pop_down_menu, x_menu_show): Use it, likewise.
      * src/xterm.c (x_cr_destroy, x_cr_export_frames):
      Use record_unwind_protect_pointer to avoid possibly allocating
      a Lisp_Misc.
    • Paul Eggert's avatar
      Avoid Lisp_Misc allocation if C stack suffices · 12fd59bb
      Paul Eggert authored
      * src/fileio.c (union read_non_regular): New type.
      (read_non_regular, Finsert_file_contents):
      Use it to avoid	allocating a Lisp_Misc.
      * src/keymap.c (union map_keymap): New type.
      (map_keymap_char_table_item, map_keymap_internal):
      Use it to avoid	allocating a Lisp_Misc.
    • Paul Eggert's avatar
      Simplify init_module_assertions · ef66660c
      Paul Eggert authored
      * src/emacs-module.c (init_module_assertions): Just use NULL
      instead of allocating a dummy on the stack and then using
      eassert.  Practical platforms check for null pointer
      dereferencing nowadays, so this is good enough.
    • Paul Eggert's avatar
      New mint_ptr representation for C pointers · 30d393f9
      Paul Eggert authored
      * src/lisp.h (make_mint_ptr, mint_ptrp, xmint_pointer): New functions.
      * src/dbusbind.c (xd_lisp_dbus_to_dbus, Fdbus__init_bus):
      * src/emacs-module.c (module_free_global_ref, Fmodule_load)
      (module_assert_runtime, module_assert_env, value_to_lisp)
      (lisp_to_value, initialize_environment)
      (finalize_environment, finalize_runtime_unwind)
      * src/font.c (otf_open, font_put_frame_data)
      * src/macfont.m (macfont_invalidate_family_cache)
      * src/nsterm.h (XNS_SCROLL_BAR):
      * src/nsterm.m (ns_set_vertical_scroll_bar)
      * src/w32fns.c (w32_monitor_enum)
      * src/xterm.c (x_cr_destroy, x_cr_export_frames):
      * src/xwidget.c (webkit_javascript_finished_cb)
      (save_script_callback, Fxwidget_webkit_execute_script)
      Use mint pointers instead of merely save pointers.
  3. 14 Jun, 2018 3 commits
    • João Távora's avatar
      Also allow custom false and null when serializing to JSON · 51adab5d
      João Távora authored
      * doc/lispref/text.texi (Parsing JSON): Describe new arguments of
      json-serialize and json-insert.
      * src/json.c (enum json_object_type, struct json_configuration):
      Move up in file before first usage.
      (lisp_to_json_toplevel, lisp_to_json_toplevel_1, lisp_to_json):
      Accept a struct json_configuration*.
      (Fjson_serialize, Fjson_insert): Accept multiple args.
      (json_parse_args): Accept new boolean configure_object_type.
      * test/src/json-tests.el
      (json-serialize, json-insert): Update forward decls.
      (json-parse-with-custom-null-and-false-objects): Add assertions for
    • João Távora's avatar
      Support custom null and false objects when parsing JSON · 9348039e
      João Távora authored
      * doc/lispref/text.texi (Parsing JSON): Describe new :null-object
      and :false-object kwargs to json-parse-string and
      * src/json.c
      (struct json_configuration): New type.
      (json_to_lisp): Accept a struct json_configuration* param.
      (json_parse_args): Rename from json_parse_object_type.
      (Fjson_parse_string): Rework docstring.
      (Fjson_parse_string, Fjson_parse_buffer): Update call to
      (syms_of_json): Two new syms, QCnull_object and QCfalse_object.
      * test/src/json-tests.el
      (json-parse-with-custom-null-and-false-objects): New test.
    • Damien Cassou's avatar
      Fix pretty-printing empty objects as null · 8cb9beb3
      Damien Cassou authored
      * lisp/json.el (json-pretty-print): Force distinction between empty
        objects and null.
      (json-encode-list): Remove responsibility to print "null" as this
      value is not a list.
      (json-encode): Give higher precedence to lists so that an empty list
      is printed as an empty object, not as "null".
      * test/lisp/json-tests.el (test-json-encode): Add many tests to check
        the behavior of pretty-printing.
  4. 13 Jun, 2018 3 commits
    • Paul Eggert's avatar
      Remove some wrong 8-byte alignment assumptions · 967d2c55
      Paul Eggert authored
      Do not assume that 8-byte alignment suffices for all C objects,
      as some platforms require 16-byte alignment for some objects,
      and this will start to bite us as time goes on (e.g., if an
      Emacs module ever uses an object containing a long
      double, which requires 16-byte alignment on x86-64).
      Conversely, on !USE_LSB_TAG platforms, do not insist on
      aligning Lisp objects to a multiple of 8, as this is not
      needed for high-order tag bits.
      New constants.
      Removed.  All uses replaced by LISP_ALIGNMENT.
      (aligned_alloc, laligned, lmalloc, lrealloc, union aligned_Lisp_Misc)
      (maybe_lisp_pointer, pure_alloc):
      (aligned_alloc): Do not worry about an alignment of
      LISP_ALIGNMENT when MALLOC_IS_LISP_ALIGNED, as the code never
      uses aligned_alloc with alignment == LISP_ALIGNMENT in that case.
      (__alignof__): Remove.  All uses removed.
      (MALLOC_IS_GC_ALIGNED): Remove.
      All uses replaced with MALLOC_IS_LISP_ALIGNED.
      (vector_alignment): Remove.
      All uses replaced with LISP_ALIGNMENT.
      * src/alloc.c (mark_maybe_pointer):
      * src/emacs-module.c (value_to_lisp_bits):
      Do not assume GCALIGNMENT == 1 << GCTYPEBITS, as GCALIGNMENT
      is 1 on !USE_LSB_TAG platforms now.
      * src/lisp.h (GCALIGNMENT) [!USE_LSB_TAG]: Now 1.
      (struct Lisp_Symbol, union vectorlike_header, struct Lisp_Cons)
      (struct Lisp_String): Simplify test for verifying alignment.
    • Daniel Colascione's avatar
      Clarify that enabling a theme does not disable other themes · b8478b2a
      Daniel Colascione authored
      Avoid user confusion by explicitly stating that enabling a theme does
      not imply disabling other themes and that theme load functions are not
      theme switch functions.
      * lisp/custom.el (load-theme, enable-theme): Clarify docstrings.
    • Daniel Colascione's avatar
      Ignore focus events for dead frames · 5ed11914
      Daniel Colascione authored
      Frames can die between the time we generate a focus event and the time
      we get around to processing it.  Do run after-focus-change-function,
      since that's idempotent and we want to make sure not to miss
      any changes.
      * lisp/frame.el (handle-focus-in, handle-focus-out): Check for dead frames.
  5. 12 Jun, 2018 2 commits