1. 08 Jul, 2020 14 commits
    • João Távora's avatar
      Have Python mode cooperate asynchronously with Eldoc · 91041920
      João Távora authored
      When combined with Flymake mode, which also adds a value to
      eldoc-documentation-functions, Python-mode users can now experiment
      with different eldoc-documentation-strategy values.
      
      Also, this shoulda allow us to write automatic tests for this
      particular Eldoc functionality.
      
      * lisp/progmodes/python.el (inferior-python-mode): Set
      coming-preoutput-filter-functions.
      (python--shell-output-filter-in-progress)
      (python--shell-output-filter-buffer): Rename from python- variant.
      (python-shell-output-filter): Rework to support async operation.
      (python-eldoc--get-doc-at-point): Rework to support async.
      (python-eldoc-function): Use callback.
      91041920
    • João Távora's avatar
      ; * etc/NEWS (Eldoc): adjust NEWS entry. · 9a7aab2d
      João Távora authored
      9a7aab2d
    • João Távora's avatar
      Shoosh warnings about obsolete eldoc-documentation-function · 6063b542
      João Távora authored
      * lisp/progmodes/cfengine.el (cfengine3-mode): Remove mention to
      obsolete eldoc-documentation-function.
      
      * lisp/progmodes/python.el (python-mode): Use with-no-warnings.
      6063b542
    • Eli Zaretskii's avatar
      ; * etc/NEWS: Fix last change. · a85026c3
      Eli Zaretskii authored
      a85026c3
    • Eli Zaretskii's avatar
      8cdfccfc
    • Mattias Engdegård's avatar
      Special-case symbol and fixnum keys in member, assoc and rassoc · b7058f95
      Mattias Engdegård authored
      * src/fns.c (Fmember, Fassoc, Frassoc): Delegate to the cheaper Fmemq,
      Fassq and Frassq for arguments of the appropriate types.
      (eq_comparable_value): New function.
      b7058f95
    • João Távora's avatar
      Improve Eldoc docstrings · 384fa109
      João Távora authored
      * lisp/emacs-lisp/eldoc.el (eldoc-documentation-strategy): Improve
      docstring.
      (eldoc--make-callback): Improve docstring.
      (eldoc--invoke-strategy): New helper function.
      (eldoc-print-current-symbol-info): Call eldoc--invoke-strategy.
      (eldoc-documentation-functions): Improve docstring.
      384fa109
    • João Távora's avatar
      Change version scheme of two Eldoc obsolete specs · fbc0bc6b
      João Távora authored
      * lisp/emacs-lisp/eldoc.el (eldoc-documentation-function)
      (eldoc-message): Obsolete spec uses eldoc-1.1.0.
      fbc0bc6b
    • João Távora's avatar
      Adjust describe-char-eldoc to new eldoc-documentation-functions protocol · b3efd5c2
      João Távora authored
      * lisp/descr-text.el (describe-char-eldoc): Adjust to new
      eldoc-documentation-functions protocol.
      b3efd5c2
    • João Távora's avatar
      Adjust Eldoc documentation after Eli's review · bba3bea2
      João Távora authored
      * etc/NEWS (Eldoc): Adjust paragraphs.
      
      * lisp/emacs-lisp/eldoc.el (eldoc-prefer-doc-buffer): Adjust
      docstring.
      (eldoc--enthusiasm-curbing-timer, eldoc-documentation-strategy)
      (eldoc-documentation-functions): Adjust docstring.
      (eldoc--handle-docs): Adjust comments.
      (eldoc--documentation-compose-1): New helper.
      (eldoc-documentation-compose)
      (eldoc-documentation-compose-eagerly): Use it.
      (eldoc-print-current-symbol-info): Adjust comments.
      bba3bea2
    • João Távora's avatar
      Make more parts of Emacs use new Eldoc capabilities · 1203626f
      João Távora authored
      Elisp-mode was doing a lot of work that can now be delegated to Eldoc.
      Flymake uses the new Eldoc functionality, too, installing a global
      documentation function that may report on diagnostics under point.
      
      CEDET's grammar.el was left as the only user of an Eldoc-internal
      function.  That function was moved to grammar.el.  That file is still,
      somewhat reprehensibly, using an internal function of elisp-mode.el,
      but this was left unchanged.
      
      In other situations, eldoc-documentation-functions is used or
      recommended.
      
      The only other places where the obsolete eldoc-documentation-function
      is still used is in libraries which are presumably meant to remain
      compatible with previous Emacs versions.
      
      * lisp/progmodes/elisp-mode.el (elisp-eldoc-funcall)
      (elisp-eldoc-var-docstring): New functions.
      (emacs-lisp-mode): Put two elements in
      eldoc-documentation-functions.
      
      * lisp/emacs-lisp/eldoc.el (eldoc--eval-expression-setup): Setup
      new Elisp eldoc-documentation-functions.
      
      * lisp/progmodes/flymake.el (flymake-mode): Use
      flymake-eldoc-function.
      (flymake-eldoc-function): New function.
      (Package-Requires): Require eldoc 1.1.0
      
      * lisp/descr-text.el (describe-char-eldoc): Recommend
      eldoc-documentation-functions.
      
      * lisp/progmodes/cfengine.el (cfengine3-documentation-function):
      Recommend eldoc-documentation-functions
      
      * lisp/progmodes/octave.el (inferior-octave-mode): Use
      eldoc-documentation-functions.
      
      * lisp/cedet/semantic/grammar.el (semantic--docstring-format-sym-doc):
      New function.
      (semantic-grammar-eldoc-get-macro-docstring): Adjust.
      1203626f
    • João Távora's avatar
      a9bd5060
    • João Távora's avatar
      New M-x eldoc for on-demand and interactive documentation requests · 22cae4f5
      João Távora authored
      The function eldoc is just an alias for
      eldoc-print-current-symbol-info, which is made interactive.
      
      * lisp/emacs-lisp/eldoc.el (eldoc-print-current-symbol-info): Now an
      interactive function.
      (eldoc): Alias to eldoc-print-current-symbol-info.
      22cae4f5
    • João Távora's avatar
      Better handle asynchronous Eldoc sources · a7a53f0d
      João Távora authored
      This is a backward compatible redesign of significant parts of the
      eldoc.el library.
      
      Previously, Eldoc clients (major/minor modes setting its documentation
      gathering variables) needed to directly call eldoc-message, an
      internal function, to display the docstring to the user.  When more
      asynchronous sources are involved, this is hard to do or even breaks
      down.
      
      Now, an Eldoc backend may return any non-nil, non-string value and
      call a callback afterwards.  This restores power to Eldoc over how
      (and crucially also when) to display the docstrings to the user.
      
      Among other things, this fixes so called "doc blinking", or the very
      short-lived display of a lower priority Eldoc message.  This would
      happen if a particular producer of documentation finishes shortly
      before a higher priority one, like in the LSP engine Eglot as reported
      by Andrii Kolomoiets <andreyk.mad@gmail.com> and Dmitry Gutov
      <dgutov@yandex.ru>.
      
      Gathering docstrings is now delegated to the variable
      eldoc-documentation-strategy, which is the new name for the
      now-obsolete eldoc-documentation-function, and still accepts the
      so-called "old protocol".  Examples of the new strategies enabled are
      codified in functions such as eldoc-documentation-enthusiast,
      eldoc-documentation-compose-eagerly, along with the existing
      eldoc-documentation-compose and eldoc-documentation-default.
      
      The work of displaying and formatting docstrings is shifted almost
      fully to Eldoc itself and is delegated to the internal function
      eldoc--handle-docs.  Among other improvements, it handles most of
      eldoc-echo-area-use-multiline-p and outputs documentation to a
      temporary *eldoc* buffer.
      
      The manual and NEWS are updated to mention the new Eldoc features.
      
      * lisp/emacs-lisp/eldoc.el (eldoc-documentation-functions):
      Overhaul docstring.
      (eldoc-documentation-compose, eldoc-documentation-default): Handle
      non-nil, non-string values of elements of
      eldoc-documentation-functions.  Use eldoc--handle-multiline.
      (eldoc-print-current-symbol-info): Honour non-nil, non-string
      values returned by eldoc-documentation-callback.
      (eldoc--make-callback): Now also a function.
      (eldoc-documentation-default, eldoc-documentation-compose): Tweak docstring.
      (eldoc-documentation-enthusiast, eldoc-documentation-compose-eagerly):
      New functions.
      (eldoc-echo-area-use-multiline-p): Add new semantics.
      (eldoc--handle-docs): Handle some of eldoc-echo-area-use-multiline-p.
      (eldoc-doc-buffer): New command.
      (eldoc-prefer-doc-buffer): New defcustom.
      (eldoc--enthusiasm-curbing-timer): New variable.
      (eldoc-documentation-strategy): Rename from eldoc-documentation-function.
      (eldoc--supported-p): Use eldoc-documentation-strategy
      (eldoc-highlight-function-argument)
      (eldoc-argument-case, global-eldoc-mode)
      (turn-on-eldoc-mode): Mention eldoc-documentation-strategy.
      (eldoc-message-function): Mention eldoc--message.
      (eldoc-message): Made obsolete.
      (eldoc--message): New helper.
      
      * lisp/hexl.el (hexl-print-current-point-info): Adjust to new
      eldoc-documentation-functions protocol.
      
      * lisp/progmodes/cfengine.el (cfengine3-documentation-function):
      Adjust to new eldoc-documentation-functions protocol.
      
      * lisp/progmodes/elisp-mode.el
      (elisp-eldoc-documentation-function): Adjust to new
      eldoc-documentation-functions protocol.
      
      * lisp/progmodes/octave.el (octave-eldoc-function): Adjust to new
      eldoc-documentation-functions protocol.
      
      * lisp/progmodes/python.el (python-eldoc-function): Adjust to new
      eldoc-documentation-functions protocol.
      
      (eldoc-print-current-symbol-info): Rework with cl-labels.
      
      * doc/emacs/programs.texi (Lisp Doc): Mention
      eldoc-documentation-strategy.
      
      * doc/lispref/modes.texi (Major Mode Conventions): Mention
      eldoc-documentation-functions.
      
      * etc/NEWS: Mention eldoc-documentation-strategy.
      a7a53f0d
  2. 07 Jul, 2020 5 commits
  3. 06 Jul, 2020 5 commits
    • Stefan Monnier's avatar
    • Mattias Engdegård's avatar
      Simplify byte-code optimisation of pure functions · 3f990c3c
      Mattias Engdegård authored
      Most pure functions need no explicit optimisation; we can do away with
      almost all uses of byte-optimize-predicate (now renamed to
      byte-optimize-constant-args, since it is not just for predicates).
      Also remove some superfluous arity warnings.
      
      * lisp/emacs-lisp/byte-opt.el (byte-optimize-identity, byte-optimize-memq)
      (byte-optimize-nth, byte-optimize-nthcdr):
      Remove arity warnings and simplify.
      * lisp/emacs-lisp/byte-opt.el (<, >, <=, >=, not, null, consp, listp)
      (symbolp, stringp, string<, string-lessp, proper-list-p, logand)
      (logior, logxor, lognot, car, cdr, car-safe, cdr-safe):
      Remove superfluous byte-optimizer property.
      (byte-optimize-predicate): Rename to byte-optimize-constant-args.
      All uses changed.
      3f990c3c
    • Mattias Engdegård's avatar
      Mark more functions pure (bug#42147) · fb63a64d
      Mattias Engdegård authored
      Extend the list of 'pure' functions to many predicates and numerical
      functions that we are reasonably confident will give portable results.
      Also include various list and array accessors, because our use of purity
      in the byte compiler isn't affected by the mutability of arguments.
      
      * lisp/emacs-lisp/byte-opt.el: Update example in comment.
      (pure-fns): Add many functions.
      (byte-optimize-form-code-walker) Don't signal errors during evaluation
      of calls to pure functions with constant arguments at compile time,
      since such calls are not necessarily reachable.
      fb63a64d
    • Dmitry Gutov's avatar
      ; Revert "; Add a note about a bottleneck" · 10a0941f
      Dmitry Gutov authored
      This reverts commit 9f9ce631.
      
      It's still a bottleneck, but so are mapcar (with its effect on GC) and
      concat. So our limits show in several places at once.
      10a0941f
    • Dmitry Gutov's avatar
      ; Add a note about a bottleneck · 9f9ce631
      Dmitry Gutov authored
      9f9ce631
  4. 05 Jul, 2020 7 commits
    • Dmitry Gutov's avatar
      3c7bae23
    • Dmitry Gutov's avatar
      ; Add a couple of FIXMEs · bcde7952
      Dmitry Gutov authored
      bcde7952
    • Dmitry Gutov's avatar
      project-switch-to-buffer: Don't filter based on default-directory · 4ca13d98
      Dmitry Gutov authored
      * lisp/progmodes/project.el (project-switch-to-buffer):
      Don't filter based on default-directory
      (https://lists.gnu.org/archive/html/emacs-devel/2020-07/msg00075.html).
      (project-switch-to-buffer): Ditto.
      4ca13d98
    • Wilson Snyder's avatar
      Verilog-Mode collected updates. · e3ada206
      Wilson Snyder authored
      * lisp/progmodes/verilog-mode.el (verilog-auto-inst): Support regexp of
      what AUTOINST I/O to include, issue #1682.  Reported by Mrainy.
      (verilog-font-lock-keywords-1): Fix highlighting module names with no
      following (, issue #1679.  Reported by Vinam Arora.
      (verilog-font-lock-keywords) Adds syntax highlighting for identifiers in
      declaration statements, #1678.
      (verilog-calculate-indent, verilog-inject-arg)
      (verilog-keywords, verilog-showscopes): Support AMS
      connectmodule/endconnectmodule, #1665. Reported by Dan McMahill.
      e3ada206
    • Mattias Engdegård's avatar
      Don't confuse errors with nil in bytecomp-tests.el · 58e27ebb
      Mattias Engdegård authored
      * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-check-1)
      (bytecomp-explain-1, test-byte-opt-arithmetic, bytecomp-lexbind-check-1)
      (bytecomp-lexbind-explain-1):
      If an expression raises an error when evaluated, don't treat it as if
      it had succeeded with the value nil; use 'bytecomp-check-error' as the
      result instead.
      58e27ebb
    • Eli Zaretskii's avatar
      Clarify the documentation of 'left/right-fringe' display spec · 247dcb4b
      Eli Zaretskii authored
      * doc/lispref/display.texi (Other Display Specs, Fringe Bitmaps):
      Clarify how the optional FACE parameter of the left-fringe and
      right-fringe display spec is used.  Reported by Gregory Heytings
      <ghe@sdf.org>.
      247dcb4b
    • Mattias Engdegård's avatar
      Relax portable number check in byte compiler (bug#42147) · c10293e1
      Mattias Engdegård authored
      With bignums, the set of representable integers is no longer
      platform-dependent, and since we use nothing but IEEE754 64-bit
      floats, all numbers are now portable.  Take advantage of this fact
      to simplify constant-folding in the byte compiler, allowing it to
      be applied more widely.
      
      * lisp/emacs-lisp/byte-opt.el (byte-opt--portable-max)
      (byte-opt--portable-min, byte-opt--portable-numberp): Remove.
      (byte-opt--arith-reduce, byte-optimize-minus, byte-optimize-1+)
      (byte-optimize-1-): Simplify: any number will do, and if N is a
      number, then so are -N, N+1 and N-1.
      c10293e1
  5. 04 Jul, 2020 5 commits
    • Alan Mackenzie's avatar
      Remove long obsolete c-looking-at-bos. Make c-at-expression-start-p obsolete · 1560c92c
      Alan Mackenzie authored
      * lisp/progmodes/cc-engine.el (c-looking-at-bos): Remove.
      (c-at-expression-start-p): Make obsolete, with no alternative function.
      1560c92c
    • Alan Mackenzie's avatar
      Fix filling in js-mode and mhtml-mode (js-mode parts), fixing bug #41897 · eae028b9
      Alan Mackenzie authored
      * lisp/progmodes/js.el (js-mode): Use "\\(?:" in the value of
      comment-start-skip rather than "\\(", fixing the second half of bug #41952.
      Call c-foreign-init-lit-pos-cache and install c-foreign-truncate-lit-pos-cache
      on before-change-functions, to connect up correctly with CC Mode's filling
      mechanism.
      
      * lisp/textmodes/mhtml-mode.el (mhtml--crucial-variable-prefix): Add prefixes
      "adaptive-fill-", "fill-", "normal-auto-fill-function" and "paragraph-" to
      pull in variables crucial to filling.
      (mhtml-syntax-propertize): Read the current submode from the piece of text
      being propertized rather than one character before it, and do so before
      erasing the submode text-property.
      (mhtml-mode): Set the js-mode value of auto-fill-function to js-do-auto-fill.
      Correctly initialize and use CC Mode's filling facilities, as above.
      eae028b9
    • Alan Mackenzie's avatar
      CC Mode: Fix wrong value of comment-start-skip, fixing half of bug #41952 · 697942f9
      Alan Mackenzie authored
      Also add functions to enable correct use of CC Mode's filling functionality
      from major modes which don't initialize CC Mode fully.  These modes are
      currently js-mode and mhtml-mode.
      
      * lisp/progmodes/cc-langs.el (comment-start-skip): Replace "\\(" by "\\(?:" so
      that (match-end 1) isn't falsely taken to be the start of the comment.
      
      * lisp/progmodes/cc-engine.el (c-foreign-truncate-lit-pos-cache)
      (c-foreign-init-lit-pos-cache): New functions.
      697942f9
    • Daniel Koning's avatar
      Use 'emacs-lisp-mode-syntax-table' for reading Lisp expressions · 32b3856f
      Daniel Koning authored
      * lisp/simple.el (read--expression): Set syntax table to
      'emacs-lisp-mode-syntax-table' when reading a Lisp expression
      from the minibuffer.  (Bug#41781)
      
      Copyright-paperwork-exempt: yes
      32b3856f
    • Eli Zaretskii's avatar
      Minor improvement in ELisp manual · d453cee1
      Eli Zaretskii authored
      * doc/lispref/frames.texi (Position Parameters): Clarify the
      description of the 'above' frame parameter.  (Bug#42154)
      d453cee1
  6. 02 Jul, 2020 3 commits
  7. 01 Jul, 2020 1 commit