~ubuntu-elisp/emacs/+git/master:scratch/eldoc-async

Last commit made on 2020-07-08
Get this branch:
git clone -b scratch/eldoc-async https://git.launchpad.net/~ubuntu-elisp/emacs/+git/master

Branch merges

Branch information

Name:
scratch/eldoc-async
Repository:
lp:~ubuntu-elisp/emacs/+git/master

Recent commits

b019a38... by =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= <email address hidden>

Improve Eldoc docstrings

* 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.

2866bbe... by =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= <email address hidden>

Change version scheme of two Eldoc obsolete specs

* lisp/emacs-lisp/eldoc.el (eldoc-documentation-function)
(eldoc-message): Obsolete spec uses eldoc-1.1.0.

b235e37... by =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= <email address hidden>

Adjust describe-char-eldoc to new eldoc-documentation-functions protocol

* lisp/descr-text.el (describe-char-eldoc): Adjust to new
eldoc-documentation-functions protocol.

ea8e1ec... by =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= <email address hidden>

Adjust Eldoc documentation after Eli's review

* 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.

99fd115... by =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= <email address hidden>

Make more parts of Emacs use new Eldoc capabilities

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.

aaf5dfc... by =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= <email address hidden>

* lisp/emacs-lisp/eldoc.el (Version): Bump to 1.1.0

62dc1d4... by =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= <email address hidden>

New M-x eldoc for on-demand and interactive documentation requests

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.

6c54414... by =?utf-8?b?Sm/Do28gVMOhdm9yYQ==?= <email address hidden>

Better handle asynchronous Eldoc sources

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 <email address hidden> and Dmitry Gutov
<email address hidden>.

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.

6242605... by =?utf-8?q?Mattias_Engdeg=C3=A5rd?= <email address hidden>

Fix spurious error in beginning-of-defun in pascal-mode (bug#41740)

* lisp/progmodes/pascal.el (pascal-beg-of-defun):
Ignore errors in forward-sexp.
* test/lisp/progmodes/pascal-tests.el (pascal-beg-of-defun): New test.

73daab9... by =?utf-8?q?Mattias_Engdeg=C3=A5rd?= <email address hidden>

Preserve point in pascal-mode completion (bug#41740)

Failure to do so caused errors in several cases.
Reported by Shinichi Sakata.

* lisp/progmodes/pascal.el (pascal-type-completion)
(pascal-completion): Wrap code that may move point in save-excursion.
* test/lisp/progmodes/pascal-tests.el: New file.