1. 23 Jul, 2019 10 commits
    • 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
    • Stefan Monnier's avatar
    • Alan Mackenzie's avatar
      Fix problems in CC Mode with " being entered into a comment at EOB. · 6bd817ee
      Alan Mackenzie authored
      * lisp/progmodes/cc-engine.el (c-full-lit-near-cache): Amend the definition
      such that an element's END element will be nil if the pertinent literal is
      open at EOB.
      (c-full-pp-to-literal): Before setting the aforementioned END element, check
      that we're no longer in a literal.  (c-literal-limits): When
      c-full-pp-to-literal returns a list with a nil END element, replace this by
      (point-max) to keep the interface of c-literal-limits unchanged.
      
      * lisp/progmodes/cc-mode.el (c-after-change-mark-abnormal-strings): Having
      found a string quote, check it is not inside an unterminated comment (i.e. one
      at EOB).
      6bd817ee
    • Paul Eggert's avatar
      Support "%x" etc. formats on more floats · dfb0ba79
      Paul Eggert authored
      * doc/lispref/strings.texi (Formatting Strings): Document this.
      * src/editfns.c (styled_format): Support %o, %x, and %X on
      finite floats less than zero or greater than UINTMAX_MAX.
      * test/src/editfns-tests.el (format-%x-large-float)
      (read-large-integer, format-%o-negative-float):
      Adjust tests to match extended behavior.
      Rename the latter test from format-%o-invalid-float,
      since the float is no longer invalid.
      
      * test/src/editfns-tests.el (format-%x-large-float)
      (read-large-integer): Test this.
      dfb0ba79
    • Paul Eggert's avatar
      Tweak performance of cmpfn_profiler · 56a3e4a5
      Paul Eggert authored
      * src/profiler.c (cmpfn_profiler):
      Improve performance when VECTORP (bt1) && EQ (bt1, bt2).
      56a3e4a5
    • Paul Eggert's avatar
      Avoid overexposing fixnums for hash codes · f378ed1a
      Paul Eggert authored
      Following a suggestion by Stefan Monnier in:
      https://lists.gnu.org/r/emacs-devel/2019-07/msg00530.html
      * doc/lispref/hash.texi (Creating Hash, Defining Hash):
      * src/fns.c (Fsxhash_eq, Fsxhash_eql, Fsxhash_equal, Fmake_hash_table):
      Don’t insist that hash codes be fixnums, reverting
      the recent doc changes to the contrary.
      * src/bytecode.c (exec_byte_code): Special-case only the eq case,
      as the others aren’t worth tuning now that we treat bignum hashes
      like fixnums.
      * src/fns.c (hashfn_user_defined): If the hash code is a bignum,
      reduce its hash down to a fixnum.
      f378ed1a
    • Stefan Kangas's avatar
      Document normal usage in ibuffer.el · 97477eda
      Stefan Kangas authored
      * lisp/ibuffer.el (Commentary): Document normal usage.  (Bug#5608)
      Remove redundant :group args.
      97477eda
    • Paul Eggert's avatar
      Do not pdump user-defined hashtabs · 3f4a9a5a
      Paul Eggert authored
      * src/pdumper.c (dump_hash_table_stable_p):
      Signal an error if a hash table has user-defined tests (Bug#36769).
      * src/fns.c (hashfn_user_defined): Now extern.
      3f4a9a5a
    • Paul Eggert's avatar
      Keep track of consing while GC’s inhibited · c34496d0
      Paul Eggert authored
      * src/alloc.c (allow_garbage_collection): Do not discard the count
      of consing that occurred while GC was inhibited.
      Problem and initial fix reported by Pip Cet in:
      https://lists.gnu.org/r/emacs-devel/2019-07/msg00523.html
      c34496d0
    • Pip Cet's avatar
      Avoid byte compiler warning for subr.el · f9443e2a
      Pip Cet authored
      * lisp/subr.el (number-sequence): Simplify to avoid byte compiler warning.
      f9443e2a
  2. 22 Jul, 2019 9 commits
    • Paul Eggert's avatar
      Remove no-longer-needed integer overflow code · c63e7f1b
      Paul Eggert authored
      * lisp/calculator.el (calculator-number-to-string):
      Use truncate, not calculator-truncate, since integer
      overflow cannot occur here.
      * lisp/calendar/cal-persia.el (calendar-persian-year-from-absolute):
      * lisp/gnus/gnus-agent.el (gnus-agent-read-article-number):
      * lisp/gnus/nnmaildir.el (nnmaildir--group-maxnum)
      (nnmaildir--new-number):
      * lisp/scroll-bar.el (scroll-bar-scale):
      * lisp/simple.el (beginning-of-buffer, end-of-buffer):
      Simplify, now that integer overflow cannot occur.
      c63e7f1b
    • Eric Abrahamsen's avatar
      Adjust regexp for parsing IMAP header response · b904a238
      Eric Abrahamsen authored
      * lisp/gnus/nnimap.el (nnimap-transform-headers): The first header
      might have no value, or a continuation header might start with a
      newline.
      b904a238
    • Stefan Monnier's avatar
      * lisp/progmodes/opascal.el: Tweak code to ease edebugging · 33ed5718
      Stefan Monnier authored
      (opascal-strings): Inline in its sole use.
      (opascal-save-excursion): Add Edebug spec.
      (opascal-is): Remove.  Use `memq` directly instead.
      (opascal--in): New pcase pattern.
      (opascal-literal-end-pattern): Remove unused function.
      (opascal--scan-non-whitespace-backward): New macro.
      (opascal-block-start, opascal-else-start, opascal-is-use-clause-end)
      (opascal-previous-indent-of, opascal-section-indent-of)
      (opascal-enclosing-indent-of): Use it.
      (opascal-corrected-indentation): Presume we're already at first token.
      (opascal-indent-line): Use indent-line-to.
      (opascal-new-comment-line): Declare obsolete.
      (opascal-mode-map): Keep the default M-j binding instead.
      33ed5718
    • Eric Abrahamsen's avatar
      Fix case of IMAP Noselect flag · 3f571bdd
      Eric Abrahamsen authored
      * lisp/gnus/nnimap.el (nnimap-get-groups): We should be looking for
      %Noselect, not %NoSelect.
      3f571bdd
    • Mattias Engdegård's avatar
      Remove some obsolete integer overflow handling · 7e294d55
      Mattias Engdegård authored
      * lisp/subr.el (number-sequence):
      * lisp/org/org-gnus.el (org-gnus-follow-link):
      * lisp/ls-lisp.el (ls-lisp-insert-directory):
      Remove dead code guarding against integer overflow.
      7e294d55
    • Stefan Monnier's avatar
      * lisp/progmodes/opascal.el: Allow inline `var` decl in `for` (bug#36348) · 87ad8a11
      Stefan Monnier authored
      (opascal-enclosing-indent-of): Ignore decls "neutered" by delimiter.
      87ad8a11
    • Mattias Engdegård's avatar
      Make tramp test regexp more robust · d0eeb62c
      Mattias Engdegård authored
      * test/lisp/net/tramp-tests.el (tramp-test17-insert-directory):
      Match a greater variety of human-readable size values.
      d0eeb62c
    • Michael Albinus's avatar
      Support history files in remote shells (Bug#36742) · 7f95d2d4
      Michael Albinus authored
      * doc/emacs/misc.texi (Shell Ring): Mention history file for
      remote shells.
      
      * lisp/shell.el (shell--start-prog): New buffer-local variable.
      (shell): Set it.
      (shell-mode): Handle history file for remote shells. (Bug#36742)
      7f95d2d4
    • Martin Rudalics's avatar
      Handle persistence of windows' scroll bar and fringes settings (Bug#36193) · 8e0ebb9a
      Martin Rudalics authored
      * doc/lispref/display.texi (Fringe Size/Pos): Document new
      argument PERSISTENT of 'set-window-fringes'.
      (Scroll Bars): Document new argument PERSISTENT of
      'set-window-scroll-bars'.  Mention that HORIZONTAL-TYPE must
      be 'bottom' to show a horizontal scroll bar on mini windows.
      * lisp/window.el (window-min-pixel-height): For mini windows the
      minimum height is one line.
      (window--min-size-1): Use value returned by
      'window-min-pixel-height' when dealing with mini windows.
      (window--resize-mini-window): Try to handle horizontal scroll
      bars and size restrictions more accurately.
      (window--state-put-2): Handle persistence of scroll bar
      settings.
      * src/frame.c (make_frame): Allow horizontal scroll bars in
      mini windows.
      (adjust_frame_size): Drop PIXELWISE argument in
      'resize_frame_windows' calls.
      * src/window.c (set_window_buffer): Don't override WINDOW's
      scroll bar and fringe settings when marked as persistent.
      (resize_frame_windows): Drop fourth argument PIXELWISE - SIZE
      is always specified in terms of pixels.  Try to handle height
      of mini windows more accurately.
      (grow_mini_window, shrink_mini_window): Use body height of
      mini window when calculating expected height change.  Take
      horizontal scroll bars into account.
      (struct saved_window): Two new members to handle persistence
      of window fringes and scroll bars.
      (Fset_window_configuration, save_window_save): Handle
      persistence of fringes and scroll bars.
      (set_window_fringes, set_window_scroll_bars): New arguments
      PERSISTENT.  Make dimension checks more accurate.
      (Fset_window_fringes): New argument PERSISTENT.
      (Fwindow_fringes, Fwindow_scroll_bars): Add PERSISTENT to
      return values.
      (Fset_window_scroll_bars): New argument PERSISTENT.  In
      doc-string mention that 'bottom' must be specified to get a
      horizontal scroll bar in mini windows.
      (compare_window_configurations): Add checks for persistence of
      fringes and scroll bars.
      * src/window.h (struct window): New boolean slots
      'fringes_persistent' and 'scroll_bars_persistent'.
      (WINDOW_HAS_HORIZONTAL_SCROLL_BAR): Allow horizontal scroll bars
      for mini windows.
      (resize_frame_windows): Remove fourth argument of
      'resize_frame_windows' in external declaration.
      * src/xdisp.c (resize_mini_window): Use box text height to
      tell whether mini window height changed.
      (set_horizontal_scroll_bar): Set mini window's horizontal
      scroll bar when its type is specified as 'bottom'.
      * etc/NEWS: Mention new options for 'set-window-fringes' and
      'set-window-scroll-bars'.
      8e0ebb9a
  3. 21 Jul, 2019 21 commits
    • Alan Mackenzie's avatar
      Implement C++ Mode attributes. This fixes bug #36650. · 5ccaee4b
      Alan Mackenzie authored
      * lisp/progmodes/cc-engine.el (c-looking-at-c++-attribute)
      (c-enclosing-c++-attribute, c-slow-enclosing-c++-attribute): New macro and
      functions.
      (c-crosses-statement-barrier-p): Add [ into skip-chars for C++ Mode, and use
      it to detect and skip over an attribute whilst scanning forward.
      (c-sws-lit-type): Use the new value 'attribute.
      (c-invalidate-sws-region-before): Put a save-match-data around this function.
      Detect and handle an enclosing attribute at either END or BEG.
      (c-invalidate-sws-region-after): Handle C++ attributes.
      (c-forward-sws, c-backward-sws): Handle C++ attributes.
      
      * lisp/progmodes/cc-mode.el (c-fl-decl-end): Detect and handle point being
      inside a C++ attribute.
      5ccaee4b
    • Paul Eggert's avatar
      Fix lifetime error in previous patch · 5d4dd552
      Paul Eggert authored
      Problem reported by Pip Cet in:
      https://lists.gnu.org/r/emacs-devel/2019-07/msg00520.html
      * src/alloc.c (inhibit_garbage_collection): Use new function.
      (allow_garbage_collection): Accept intmax_t, not pointer.
      * src/eval.c (default_toplevel_binding, do_one_unbind)
      (backtrace_eval_unrewind, Fbacktrace__locals, mark_specpdl):
      Support SPECPDL_UNWIND_INTMAX.
      (record_unwind_protect_excursion): New function.
      * src/lisp.h (enum specbind_tag): New constant SPECPDL_UNWIND_INTMAX.
      (union specbinding): New member unwind_intmax.
      5d4dd552
    • Paul Eggert's avatar
      Speed up maybe_gc when GC is inhibited · d02c2f7f
      Paul Eggert authored
      * src/alloc.c (allow_garbage_collection)
      (inhibit_garbage_collection): Temporarily bump
      consing_until_gc, to improve performance of maybe_gc while
      garbage collection is inhibited.  Suggested by Stefan Monnier in:
      https://lists.gnu.org/r/emacs-devel/2019-07/msg00511.html
      d02c2f7f
    • Paul Eggert's avatar
      Avoid integer overflow in hash table size · c72e6328
      Paul Eggert authored
      * src/fns.c (INDEX_SIZE_BOUND): Use a tighter bound.
      (maybe_resize_hash_table): Avoid integer overflow when
      checking for hash table size overflow.  Fix confusion
      between INDEX_SIZE_BOUND (which is for the index vector)
      and hash table size.  Fix typo in debugging message
      when ENABLE_CHECKING.
      c72e6328
    • Paul Eggert's avatar
      Improve doc for hash tables · cf285946
      Paul Eggert authored
      * doc/lispref/hash.texi (Creating Hash, Defining Hash):
      * src/fns.c (Fsxhash_eq, Fsxhash_eql, Fsxhash_equal):
      Say that hashes are fixnums.
      (Fmake_hash_table): Say that that an integer rehash-size
      should be a fixnum.
      * doc/lispref/hash.texi (Defining Hash): Say that hash and
      comparison functions should be consistent and pure, and should
      return quickly.
      cf285946
    • Paul Eggert's avatar
      pure_alloc returns cleared memory · 4a1507b8
      Paul Eggert authored
      * src/alloc.c (pure_alloc): Clear any heap-allocated storage.
      This is simpler than auditing all the callers to make sure
      they don’t assume pure memory is cleared memory, and the
      performance implication is nonexistent except when Emacs
      is misconfigured.  Also, add an assertion to catch
      caller misuse when pure space is exhausted.
      4a1507b8
    • Lars Ingebrigtsen's avatar
      Make the unflag-p parameter in dired-mark-unmarked-files work · 51f5c194
      Lars Ingebrigtsen authored
      * lisp/dired-x.el (dired-mark-unmarked-files): Make the unflag-p
      parameter work (bug#27465).
      51f5c194
    • Lars Ingebrigtsen's avatar
      Don't override SSH_AUTH_SOCK in the example emacs.service file · ca088159
      Lars Ingebrigtsen authored
      * etc/emacs.service (ExecStop): Don't override SSH_AUTH_SOCK by
      default, because it varies by distribution where the socket is
      (bug#27620).
      ca088159
    • Lars Ingebrigtsen's avatar
      Fill footnotes better on `M-q' · 76d0ca98
      Lars Ingebrigtsen authored
      * lisp/mail/footnote.el (footnote--fill-paragraph): New function
      (bug#27775).
      (footnote-mode): Use it.
      76d0ca98
    • Ken Brown's avatar
      Fix expand-file-name for names starting with '~' · 8b13ec1d
      Ken Brown authored
      * src/fileio.c: (file_name_absolute_no_tilde_p):
      New static function.
      (Fexpand_file_name): If the current buffer's default-directory
      starts with "~user" where "user" is not a valid user name, don't
      give the '~' a special meaning.  Just treat the value of
      default-directory as a relative name.  (Bug#36502)
      * test/src/fileio-tests.el
      (fileio-tests--relative-default-directory): Add a test.
      8b13ec1d
    • Gemini Lasswell's avatar
      Fix inline-quote Edebug spec · 0c48c0d0
      Gemini Lasswell authored
      * lisp/emacs-lisp/inline.el (inline-quote): Fix the edebug spec
      (bug#31051).
      0c48c0d0
    • Paul Eggert's avatar
      Tweak recent hash-table fix · 49e80e76
      Paul Eggert authored
      * src/fns.c (maybe_resize_hash_table): Completely initialize the
      new ‘next’ vector before allocating more vectors, as this
      preserves locality a bit better and it’s safer not to leave an
      uninitialized Lisp object around.  Use next_size instead of
      new_size to compute new index size.
      49e80e76
    • Paul Eggert's avatar
      Fix crash if user test munges hash table · 515afc9c
      Paul Eggert authored
      * src/fns.c (restore_mutability)
      (hash_table_user_defined_call): New functions.
      (cmpfn_user_defined, hashfn_user_defined): Use them.
      (make_hash_table, copy_hash_table):
      Mark new hash table as mutable.
      (check_mutable_hash_table): New function.
      (Fclrhash, Fputhash, Fremhash): Use it instead of CHECK_IMPURE.
      * src/lisp.h (struct hash_table_test): User-defined functions
      now take pointers to struct Lisp_Hash_Table, not to struct
      hash_table_test.  All uses changed.
      (struct Lisp_Hash_Table): New member ‘mutable’.
      * src/pdumper.c (dump_hash_table): Copy it.
      * test/src/fns-tests.el (test-hash-function-that-mutates-hash-table):
      New test, which tests for the bug.
      515afc9c
    • Paul Eggert's avatar
      Simplify hashfn/cmpfn calling convention · b6f194a0
      Paul Eggert authored
      * src/fns.c (cmpfn_eql, cmpfn_equal, cmpfn_user_defined)
      (hashfn_eq, hashfn_equal, hashfn_eql, hashfn_user_defined):
      * src/profiler.c (cmpfn_profiler, hashfn_profiler):
      Use new calling convention where the return value is a fixnum
      instead of EMACS_UINT.  While we’re at it, put the hash table
      at the end, since that’s a bit simpler and generates better
      code (at least on the x86-64).  All callers changed.
      * src/fns.c (hash_lookup): Store fixnum rather than EMACS_UINT.
      All callers changed.
      (hash_put): Take a fixnum rather than an EMACS_UINT.
      All callers changed.  Remove unnecessary eassert (XUFIXNUM does it).
      * src/lisp.h (struct hash_table_test):
      Adjust signatures of cmpfn and hashfn.
      b6f194a0
    • Paul Eggert's avatar
      Inhibit GC after inhibit_garbage_collection · 5018b663
      Paul Eggert authored
      Without this patch, there are unlikely ways that garbage
      collection could occur (sometimes causing undefined behavior)
      even when inhibit_garbage_collection is in effect.
      * src/alloc.c (garbage_collection_inhibited): New var.
      (pure_alloc): Increment it if pure space is exhausted, so that
      garbage_collect_1 no longer needs to inspect
      pure_bytes_used_before_overflow.
      (allow_garbage_collection): New function.
      (inhibit_garbage_collection): Increment the new variable rather
      than specbinding a user variable.
      (garbage_collect_1): Do not garbage collect if the new variable
      is set, rather than if pure_bytes_used_before_overflow is set.
      5018b663
    • Paul Eggert's avatar
      Simplify maybe_gc implementation · 26de2d42
      Paul Eggert authored
      * src/alloc.c (consing_until_gc): New variable, replacing the
      combination of consing_since_gc and gc_relative_threshold.
      All uses changed.
      (byte_ct): Move decl here from lisp.h.
      (memory_full_cons_threshold): New an enum constant.
      (free_cons): Check for integer overflow in
      statistics calculation.
      * src/lisp.h (object_ct): Move decl here from alloc.c.
      (OBJECT_CT_MAX): New macro.
      (maybe_gc): Simplify accordingly.
      26de2d42
    • Paul Eggert's avatar
      Rename ‘pure’ to ‘purecopy’ · df5024db
      Paul Eggert authored
      * src/lisp.h (struct Lisp_Hash_Table): Rename ‘pure’ member to
      ‘purecopy’, as the old name was quite confusing (it did not
      mean the hash table was pure).  All uses changed.
      df5024db
    • Paul Eggert's avatar
      Fix hash table overallocation etc. · b0908a0f
      Paul Eggert authored
      * src/fns.c (set_hash_key_and_value, set_hash_next)
      (set_hash_hash, set_hash_index): Remove.  All uses removed.
      (maybe_resize_hash_table): Don’t update h->next until it’s
      known that all the allocations succeeded, to avoid trashing
      the hash table if memory is exhausted.  Don’t overallocate the
      other vectors.  Don’t output growth message if the hash table
      didn’t actually grow due to allocation failure.  Assume C99
      decls after statements.
      b0908a0f
    • Noam Postavsky's avatar
      Merge from emacs-26 · 6490269b
      Noam Postavsky authored
      150bdfe4 Handle completely undecoded input in term (Bug#29918)
      021f32cc * doc/misc/forms.texi (Control File Format): Fix a doc error.
      76538d09 Fix typo in package-alist docstring
      b2fde4b5 * doc/lispref/text.texi (Mode-Specific Indent): Fix a typo...
      7e627785 ; Another minor change in 'bidi-display-reordering's doc s...
      4455ddbe Improve doc string of 'bidi-display-reordering'
      34ee26dd Add warning to bidi-display-reordering doc string
      
      # Conflicts:
      #	lisp/term.el
      #	test/lisp/term-tests.el
      6490269b
    • Noam Postavsky's avatar
      Handle completely undecoded input in term (Bug#29918) · 150bdfe4
      Noam Postavsky authored
      * lisp/term.el (term-emulate-terminal): Avoid errors if the whole
      decoded string is eight-bit characters.  Don't attempt to save the
      string for next iteration in that case.
      * test/lisp/term-tests.el (term-decode-partial)
      (term-undecodable-input): New tests.
      150bdfe4
    • Basil L. Contovounesios's avatar
      Use lexical-binding in compface.el · f02b9e9a
      Basil L. Contovounesios authored
      * lisp/image/compface.el: Use lexical-binding.  Extend Keywords
      header.
      (uncompface): Call call-process-region directly.
      f02b9e9a