<feed xmlns='http://www.w3.org/2005/Atom'>
<title>emacs/lisp/progmodes, branch scratch/python-eldoc-async</title>
<subtitle>Emacs is the extensible, customizable, self-documenting real-time display editor. 
</subtitle>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/'/>
<entry>
<title>Have Python mode cooperate asynchronously with Eldoc</title>
<updated>2020-07-08T21:47:10+00:00</updated>
<author>
<name>João Távora</name>
</author>
<published>2020-07-08T21:47:00+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=91041920c6f80d7a6b4ae53d27d844018710d7f3'/>
<id>91041920c6f80d7a6b4ae53d27d844018710d7f3</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Shoosh warnings about obsolete eldoc-documentation-function</title>
<updated>2020-07-08T19:20:19+00:00</updated>
<author>
<name>João Távora</name>
</author>
<published>2020-07-08T19:20:14+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=6063b542f765e55f4e93a64e40f202fe4af7cce1'/>
<id>6063b542f765e55f4e93a64e40f202fe4af7cce1</id>
<content type='text'>
* lisp/progmodes/cfengine.el (cfengine3-mode): Remove mention to
obsolete eldoc-documentation-function.

* lisp/progmodes/python.el (python-mode): Use with-no-warnings.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* lisp/progmodes/cfengine.el (cfengine3-mode): Remove mention to
obsolete eldoc-documentation-function.

* lisp/progmodes/python.el (python-mode): Use with-no-warnings.
</pre>
</div>
</content>
</entry>
<entry>
<title>Make more parts of Emacs use new Eldoc capabilities</title>
<updated>2020-07-08T10:25:33+00:00</updated>
<author>
<name>João Távora</name>
</author>
<published>2020-06-06T13:04:48+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=1203626f472b0d99d2746f5999711137c0c1fd0c'/>
<id>1203626f472b0d99d2746f5999711137c0c1fd0c</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Better handle asynchronous Eldoc sources</title>
<updated>2020-07-08T10:25:33+00:00</updated>
<author>
<name>João Távora</name>
</author>
<published>2020-05-25T15:39:40+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=a7a53f0d79e0012c909e87911c4f85ad12bb78b4'/>
<id>a7a53f0d79e0012c909e87911c4f85ad12bb78b4</id>
<content type='text'>
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 &lt;andreyk.mad@gmail.com&gt; and Dmitry Gutov
&lt;dgutov@yandex.ru&gt;.

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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;andreyk.mad@gmail.com&gt; and Dmitry Gutov
&lt;dgutov@yandex.ru&gt;.

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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge from origin/emacs-27</title>
<updated>2020-07-07T14:50:39+00:00</updated>
<author>
<name>Glenn Morris</name>
</author>
<published>2020-07-07T14:50:39+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=3b36b38713aefb3aba40b3c094246782e8893f80'/>
<id>3b36b38713aefb3aba40b3c094246782e8893f80</id>
<content type='text'>
59e768d64a Fix undefined behavior in json.c (Bug#42113)
cce00bef03 Fix ACTION argument of 'display-buffer' call in gud.el
0121db2702 * src/keyboard.c (Fclear_this_command_keys): Doc fix.
b9abf5ceb2 Improve do string of 'man'
b87fc938a0 ; * src/xdisp.c (pos_visible_p): Yet another minor fix for...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
59e768d64a Fix undefined behavior in json.c (Bug#42113)
cce00bef03 Fix ACTION argument of 'display-buffer' call in gud.el
0121db2702 * src/keyboard.c (Fclear_this_command_keys): Doc fix.
b9abf5ceb2 Improve do string of 'man'
b87fc938a0 ; * src/xdisp.c (pos_visible_p): Yet another minor fix for...
</pre>
</div>
</content>
</entry>
<entry>
<title>; Revert "; Add a note about a bottleneck"</title>
<updated>2020-07-06T01:29:52+00:00</updated>
<author>
<name>Dmitry Gutov</name>
</author>
<published>2020-07-06T01:29:52+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=10a0941f4dcc85d95279ae67032ec04463a44d59'/>
<id>10a0941f4dcc85d95279ae67032ec04463a44d59</id>
<content type='text'>
This reverts commit 9f9ce631a2ff44ebcb87b0b1390a21b13665db43.

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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 9f9ce631a2ff44ebcb87b0b1390a21b13665db43.

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.
</pre>
</div>
</content>
</entry>
<entry>
<title>; Add a note about a bottleneck</title>
<updated>2020-07-06T00:50:59+00:00</updated>
<author>
<name>Dmitry Gutov</name>
</author>
<published>2020-07-06T00:50:59+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=9f9ce631a2ff44ebcb87b0b1390a21b13665db43'/>
<id>9f9ce631a2ff44ebcb87b0b1390a21b13665db43</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>* lisp/progmodes/project.el: Bump the version.</title>
<updated>2020-07-05T21:51:24+00:00</updated>
<author>
<name>Dmitry Gutov</name>
</author>
<published>2020-07-05T21:51:13+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=3c7bae233770373c5183073a3ddcb466b328cfc9'/>
<id>3c7bae233770373c5183073a3ddcb466b328cfc9</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>; Add a couple of FIXMEs</title>
<updated>2020-07-05T21:51:24+00:00</updated>
<author>
<name>Dmitry Gutov</name>
</author>
<published>2020-07-05T21:50:32+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=bcde7952b35ced2f0cb277a32d1ae451f76b8a51'/>
<id>bcde7952b35ced2f0cb277a32d1ae451f76b8a51</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>project-switch-to-buffer: Don't filter based on default-directory</title>
<updated>2020-07-05T21:51:24+00:00</updated>
<author>
<name>Dmitry Gutov</name>
</author>
<published>2020-07-05T00:35:00+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=4ca13d98c9eb81b9c5e89f77b4012c74a30ab5fd'/>
<id>4ca13d98c9eb81b9c5e89f77b4012c74a30ab5fd</id>
<content type='text'>
* 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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 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.
</pre>
</div>
</content>
</entry>
</feed>
