Commit graph

175 commits

Author SHA1 Message Date
Daniel Martín
9f505c476e New option show-paren-context-when-offscreen
* lisp/simple.el (blink-paren-open-paren-line-string): Extract
functionality that shows the open paren line in the echo area into its
own function, to reuse it from paren.el.
(blink-matching-open): Use blink-paren-open-paren-line-string.
* lisp/paren.el (show-paren-context-when-offscreen): New option
show-paren-context-when-offscreen.
(show-paren-function): Implement it using
blink-paren-open-paren-line-string.
* lisp/emacs-lisp/eldoc.el (eldoc-display-message-no-interference-p):
Make sure the feature works well with eldoc.
* test/lisp/paren-tests.el (paren-tests-open-paren-line): Test
blink-paren-open-paren-line-string.
* doc/emacs/programs.texi (Matching): Update the documentation.
* etc/NEWS: And announce the new feature.
2021-10-18 09:26:44 +02:00
Augusto Stoffel
90575a6c0c Disable 'nobreak-char-display' in Eldoc buffers
* lisp/emacs-lisp/eldoc.el (eldoc--format-doc-buffer): Set
'nobreak-char-display' to nil in Eldoc buffers (bug#50989).
2021-10-05 11:12:05 +02:00
Stefan Kangas
25ebb9374b ; More minor docfixes found by checkdoc 2021-09-14 07:57:14 +02:00
Basil L. Contovounesios
33c0994c7c Look for ElDoc buffer in all visible frames
* lisp/emacs-lisp/eldoc.el (eldoc--echo-area-prefer-doc-buffer-p):
Look for a window displaying the ElDoc documentation buffer in all
visible frames, as promised by the user option
eldoc-echo-area-prefer-doc-buffer (bug#48278).
2021-05-18 16:31:19 +01:00
Štěpán Němec
2c2dfbbbf0 ; Fix some typos in doc strings and manuals 2021-04-24 18:26:07 +02:00
Mattias Engdegård
de15ca7d00 Fix typos
* doc/lispref/display.texi (Size of Displayed Text):
* doc/lispref/windows.texi (Buffer Display Action Functions):
* etc/NEWS:
* etc/ORG-NEWS (Org-Attach has been refactored and extended):
* lisp/battery.el (display-battery-mode, battery--upower-subsribe):
* lisp/calendar/parse-time.el:
* lisp/dired-x.el:
* lisp/emacs-lisp/chart.el (chart-sequece, chart-bar-quickie):
* lisp/emacs-lisp/eldoc.el (eldoc-echo-area-use-multiline-p)
(eldoc-documentation-strategy):
* lisp/emacs-lisp/pcase.el (pcase--split-pred, pcase--u1):
* lisp/gnus/gnus-search.el (gnus-search-expandable-keys)
(gnus-search-parse-query, gnus-search-query-return-string)
(gnus-search-imap, gnus-search-imap-search-command)
(gnus-search-transform-expression):
* lisp/gnus/nnselect.el:
* lisp/isearch.el (isearch-lazy-count-format):
* lisp/mh-e/mh-show.el (mh-show-msg):
* lisp/net/dictionary-connection.el (dictionary-connection-open):
* lisp/net/dictionary.el (dictionary-default-popup-strategy)
(dictionary, dictionary-split-string, dictionary-do-select-dictionary)
(dictionary-display-dictionarys, dictionary-search)
(dictionary-tooltip-mode):
* lisp/net/eudcb-macos-contacts.el (eudc-macos-contacts-set-server):
* lisp/net/mailcap.el (mailcap-mime-data):
* lisp/net/tramp-smb.el (tramp-smb-maybe-open-connection):
* lisp/nxml/nxml-mode.el (nxml-mode):
* lisp/progmodes/cc-engine.el:
* lisp/progmodes/cperl-mode.el (cperl-mode)
(cperl-fontify-syntaxically):
* lisp/progmodes/flymake.el (flymake-diagnostic-functions):
* lisp/progmodes/verilog-mode.el (verilog--supressed-warnings)
(verilog-preprocess):
* lisp/simple.el (self-insert-uses-region-functions):
* lisp/textmodes/bibtex.el (bibtex-copy-summary-as-kill):
* lisp/textmodes/texnfo-upd.el (texinfo-insert-master-menu-list):
* src/dispnew.c:
* src/font.c (Ffont_get):
* src/indent.c (compute_motion):
* src/process.c (init_process_emacs):
* src/w32fns.c (deliver_wm_chars):
* test/lisp/jsonrpc-tests.el (deferred-action-complex-tests):
Fix typos in documentation, comments, and internal identifiers.
2021-02-18 16:50:55 +01:00
Basil L. Contovounesios
c3163069a1 Fix ElDoc setup for eval-expression
* lisp/emacs-lisp/eldoc.el (eldoc--eval-expression-setup): Don't set
global value of eldoc-documentation-strategy (bug#44886).
2021-02-12 21:28:47 +00:00
Paul Eggert
ba05d005e5 Update copyright year to 2021
Run "TZ=UTC0 admin/update-copyright".
2021-01-01 01:13:56 -08:00
João Távora
755a9f2a8b Inhibit quit in ElDoc timer functions (bug#45117)
The point of un-inhibiting it was to make ElDoc backends interruptible
with any input (as in while-no-input), since that should in principle
invalidate the need of the current ElDoc processing.  But that
strategy is dangerous for backends that perform complex
synchronization with external processes.  Better let each backend
decide for itself it needs this eager interruptive behavior, like is
presumably the case with the Octave backend.

This reverts a part of

    commit 12e922156c
    Author: Stefan Monnier <monnier@iro.umontreal.ca>
    Date:   Tue Dec 4 18:15:44 2018 -0500

* lisp/emacs-lisp/eldoc.el (eldoc-print-current-symbol-info):

* lisp/progmodes/octave.el (octave-eldoc-function-signatures): Use
while-no-input.
2020-12-13 23:16:53 +00:00
João Távora
67a9ecb489 Remove interactive spec from internal eldoc--format-doc-buffer
Per bug#43609.

* lisp/emacs-lisp/eldoc.el (eldoc--format-doc-buffer): Remove
useless interactive spec.
2020-12-08 23:40:23 +00:00
Lars Ingebrigtsen
0287c51768 Keep point in the *eldoc* buffer in eldoc-display-in-echo-area
* lisp/emacs-lisp/eldoc.el (eldoc-display-in-echo-area): Use
'save-excursion' to keep point position in *eldoc* buffer.
Suggested by Andrii Kolomoiets <andreyk.mad@gmail.com>.
2020-11-26 11:24:20 +01:00
João Távora
74c45a62e1 Shoosh byte-compilation warning in lisp/emacs-lisp/eldoc.el
Per bug#43609, elisp-eldoc-documentation-function is again in master,
but since it's now officially obsoleted, this backward compatibility
shim in eldoc--eval-expression-setup shouldn't unnecessarily trigger
warnings in master's code.

* lisp/emacs-lisp/eldoc.el (eldoc--eval-expression-setup): Shoosh
by-compilation warning.
2020-10-30 22:31:20 +00:00
João Távora
3758be484e Don't make ElDoc doc buffer visible in buffer list by default
Fixes: bug#44334

* lisp/emacs-lisp/eldoc.el (eldoc-doc-buffer): No longer take
INTERACTIVE arg.  Show buffer if invisible.
(eldoc--format-doc-buffer): Don't change buffer visibility.
(eldoc-display-in-buffer): Show buffer if invisible if by calling
eldoc-doc-buffer.
2020-10-30 22:31:20 +00:00
João Távora
10e7c76ee3 Rework semantics of eldoc-echo-are-use-multiline-p
Per bug#43543.  Now uses logical lines, not visual lines.

* lisp/emacs-lisp/eldoc.el (eldoc-echo-area-use-multiline-p): Rework
semantics.
(eldoc--echo-area-substring): New helper.
(eldoc--echo-area-prefer-doc-buffer-p): New helper.
(eldoc-display-in-echo-area): Rework using new helpers.
2020-10-24 18:02:28 +01:00
João Távora
77c3928425 Rename ElDoc user option controlling display of truncation notice
The new name makes it consistent with other variables controlling the
display of ElDoc documentation in the echo area.

Per bug#43543.

* etc/NEWS (Eldoc): Rename eldoc-display-truncation-message to
eldoc-echo-area-display-truncation-message.

* lisp/emacs-lisp/eldoc.el
(eldoc-echo-area-display-truncation-message): Rename from
eldoc-display-truncation-message.
(eldoc-display-in-echo-area): Use new variable name.
2020-10-24 18:02:28 +01:00
João Távora
5daa6a6a03 Rework eldoc-echo-area-prefer-doc-buffer (bug#42532)
* lisp/emacs-lisp/eldoc.el:
(eldoc-echo-area-prefer-doc-buffer): Rename from
eldoc-echo-area-prefer-doc-buffer
(eldoc-display-in-echo-area): Rework to honour
eldoc-echo-area-prefer-doc-buffer.
2020-10-24 18:02:28 +01:00
João Távora
4c543a724f Introduce eldoc-display-functions
See bug#43609.

* lisp/emacs-lisp/eldoc.el (eldoc--request-state): Add comment.
(eldoc--last-request-state): No longer buffer-local.
(eldoc--request-docs-p): Delete.
(eldoc-display-functions): New user variable.
(eldoc--doc-buffer-docs): New variable.
(eldoc-display-message-p): Rework.
(eldoc--format-doc-buffer): Rework from eldoc--handle-docs.
(eldoc-display-in-echo-area, eldoc-display-in-buffer): New
user-visible function.
(eldoc--invoke-strategy): Take INTERACTIVE arg.
Invoke eldoc-display-in-buffer
(eldoc-print-current-symbol-info): Simplify.
(Version): Bump to 1.11.0

* etc/NEWS: Mention eldoc-display-functions.
2020-10-24 18:02:28 +01:00
Lars Ingebrigtsen
73f77558cc Fix off-by-one error in eldoc--handle-docs
* lisp/emacs-lisp/eldoc.el (eldoc--handle-docs): We have one extra
line to use if we don't show the truncation message (bug#43543).
2020-09-22 16:20:05 +02:00
Stefan Kangas
462dbc1cb2 ; Fix typos 2020-09-21 14:26:42 +02:00
Lars Ingebrigtsen
e72d3793bc Allow disabling the verbose eldoc truncation message
* doc/emacs/programs.texi (Lisp Doc): Document it.

* lisp/emacs-lisp/eldoc.el (eldoc-display-truncation-message): New
variable (bug#43543).
(eldoc--handle-docs): Use it.
2020-09-21 14:15:39 +02:00
João Távora
ae6daa680a Fix ElDoc's eldoc-documentation-enthusiast strategy
As soon as we get a response from any of the user functions/sources in
eldoc-documentation-functions, we must make sure to call the
display-doc local function, just like in the other strategies.

That is even if that response produced nil, meaning that there's no
doc coming from that source.  Failure to do so when none of the
sources produced non-nil would keep stale documentation displaying.

First reported in https://github.com/joaotavora/eglot/issues/503

* lisp/emacs-lisp/eldoc.el (eldoc--invoke-strategy): Fix
:enthusiast strategy.
(Version): Bump to 1.10.0
2020-09-03 23:20:55 +01:00
João Távora
c7e297e906 Prevent ElDoc blinking when eldoc-documentation-enthusiast is used
This eldoc-documentation-strategy function didn't always obey protocol
since it returned nil sometimes, which the eldoc engine took it as a
hint for the "old" protocol to clear the echo area.

* lisp/emacs-lisp/eldoc.el (eldoc-documentation-enthusiast):
Return t.
(Version): Bump to 1.9.0
2020-08-29 14:29:22 +01:00
Jonas Bernoulli
0bc9e7b8f5 Merge two conditions and fix indentation
The motivation behind this change is that the indentation of some
lines was outright wrong.  If we address that issue, then we might
as well also address the issue that some code is needlessly nested
an additional level.  That we can fix by merging the conditions.

By doing these two changes in on commit we have to change the fewest
lines.  Even though we are moving to using just spaces for indentation
of the modified lines, other lines in the same function are left alone
and continue to us tabs+spaces for indentation.  That is not "wrong",
but just the style we are slowly migrating away from when touching
lines for other reasons.

Discussed in bug#42397.

* lisp/emacs-lisp/eldoc.el (eldoc-minibuffer-message): Merge two
conditions and fix indentation.
2020-08-13 11:30:16 +02:00
João Távora
9d751aa822 Make newer ElDoc versions are compatible with Emacs < 28
Fixes: bug#42563

For some time, Eldoc has has some Elisp-specific code that shouldn't
live there, but in elisp-mode.el.  This can be fixed in Emacs master,
but since ElDoc is distributed in GNU Elpa and is meant to work with
Emacs 26 and 27, this means that that elisp-specific code must still
be distributed with eldoc.el and kept up to date.

* lisp/emacs-lisp/eldoc.el (eldoc--eval-expression-setup): Ensure
implementation is compatible with Emacs < 28.
(Version): Bump to 1.8
2020-07-27 22:18:57 +01:00
João Távora
688c03f412 Bring back ElDoc's eldoc-display-message-p, but obsolete it
Like others, this is an implementation detail that third parties could
be relying on.  Better not remove it outright just now, since its
implementation is very simple anyway.

* lisp/emacs-lisp/eldoc.el (Version): Bump to 1.7.0
(eldoc-display-message-p): Bring back, but obsolete.
2020-07-27 16:26:33 +01:00
João Távora
fcd43287b3 Don't needlessly request docs from ElDoc functions
Fixes: bug#42421

Do this conservatively for now: if the ElDoc helper buffer (as
returned by eldoc--doc-buffer) is visible and showing documentation
for the very same "situation" (as computed by the the new
eldoc--request-state helper), don't request that documentation from
sources again.

Before this change, not only was that request inefficient but if the
user invoked scroll-other-window to see more of the helper buffer,
that would eventually cause it to be reformatted and unexpectedly
recentered.

Later on, when a customizable list of documentation "sinks" is offered
to the user, say, something like eldoc-display-functions, this process
must be consolidated.  In those circumstances, as soon as one of those
sinks signals that it doesn't have up-to-date documentation for the
state computed by eldoc--request-state, documentation will have to be
requested anew from eldoc-documentation-functions via
eldoc--invoke-strategy.

* lisp/emacs-lisp/eldoc.el (eldoc--request-docs-p): Rework from
eglot-display-message-p.
(eldoc--last-request-state): New variable.
(eldoc--request-state): New helper.
(eldoc--handle-docs): Memorize state of request in doc buffer.
(eldoc-print-current-symbol-info): Pass a token to
eldoc--request-docs-p.
(Version): Bump to 1.6.0
2020-07-23 11:57:27 +01:00
João Távora
c77731e824 Fix ElDoc bugs around eldoc-echo-area-use-multiline-p.
If the value is 'truncate-sym-name-if-fit andthe single docstring
doesn't fit in the echo area even when the symbol name is elided, that
step shouldn't be attempted.  Also if the value is nil, really ensure
that only the first line is shown.

* lisp/emacs-lisp/eldoc.el (eldoc--handle-docs): Rework
'truncate-sym-name-if-fit case of eldoc-echo-area-use-multiline-p.
2020-07-19 00:59:14 +01:00
João Távora
4a7ecaaee0 ; Reword bits of ElDoc internal documentation
* lisp/emacs-lisp/eldoc.el (eldoc--invoke-strategy): Rewrite docstring.
(eldoc--invoke-strategy): Fix formatting and rewrite comments
2020-07-19 00:59:14 +01:00
Tassilo Horn
85eaa8373b ;Fix eldoc regression bug#42365 2020-07-15 18:58:57 +02:00
Basil L. Contovounesios
36e6019034 Consistently stylize eldoc as ElDoc in more prose
This fixes new occurrences of "Eldoc" since emacs-27.

* doc/lispref/modes.texi (Major Mode Conventions):
* etc/NEWS:
* lisp/descr-text.el (describe-char-eldoc):
* lisp/emacs-lisp/eldoc.el (eldoc-echo-area-use-multiline-p)
(eldoc-prefer-doc-buffer, eldoc--documentation-strategy-defcustom):
Consistently capitalize eldoc as ElDoc rather than Eldoc in
documentation and commentary.
2020-07-14 13:49:34 +01:00
James N. V. Cash
7a712578ed Fix a typo in eldoc.el
* lisp/emacs-lisp/eldoc.el (eldoc-documentation-functions): Fix a
typo.  (Bug#42310)

Copyright-paperwork-exempt: yes
2020-07-12 17:10:32 +03:00
João Távora
45d7db6d22 Sort out ElDoc backward compatibility of eldoc-documentation-function
As explained previously, we can't simply make
eldoc-documentation-function an variable alias for
eldoc-documentation-strategy, because ElDoc is pre-loaded in Emacs <
28, where it holds at least one buffer-local binding.  So if eldoc.el
is loaded in those versions, we do the variable alias binding in
reverse.  We do this using a macro
eldoc--documentation-strategy-defcustom to at load time in which
direction to make the variable alias.

* lisp/emacs-lisp/eldoc.el
(eldoc--documentation-strategy-defcustom): Helper macro.
(eldoc-documentation-strategy, eldoc-documentation-function): Use it.
(Version): Bump to 1.5.0
2020-07-12 14:24:05 +01:00
João Távora
1198b03e55 Fix placement of Eldoc docs during eval-expression (bug#42309)
* lisp/emacs-lisp/eldoc.el (eldoc--handle-docs): Rework.
2020-07-10 21:23:33 +01:00
João Távora
c2599632b0 Revert "Fix Eldoc problem when loading on Emacs 26.3"
This reverts commit 9ade7ea7b7.

* lisp/emacs-lisp/eldoc.el (Version): Bump to 1.4.0
2020-07-10 18:12:10 +01:00
João Távora
62725e87f2 Fix byte compilation warning in Eldoc
* lisp/emacs-lisp/eldoc.el (eldoc-documentation-function): Pass nil as
second argument.
2020-07-10 08:13:15 +01:00
João Távora
9ade7ea7b7 Fix Eldoc problem when loading on Emacs 26.3
When defining the obsolete variable alias for old
eldoc-documentation-function (which now points to the newer
eldoc-documentation-strategy), one gets the error "don't know how to
make a localized vareiable an alias".  I'm not sure, but I suspect
this is because Eldoc is preloaded in Emacs 26.3 and the
eldoc-documentation-function variable is already set locally by some
Elisp buffer.

Uninterning the symbol shortly before defining the alias seems to fix
it.

* lisp/emacs-lisp/eldoc.el (eldoc-documentation-function):
Unintern on load.
(Version): Bump to 1.3.0
2020-07-10 01:47:33 +01:00
João Távora
59f563680d Unbreak M-x eldoc
The command should always invoke Eldoc when called interactively,
instead of going through the usual checks, which are performed to
avoid interference with other commands.

* lisp/emacs-lisp/eldoc.el (eldoc-print-current-symbol-info): Rework.
(Version): Bump to 1.2.0
2020-07-09 18:07:22 +01:00
João Távora
ffb99d8490 Prevent infloop in Eldoc message truncation algorithm
The truncation algorithm still has a long way to go for very narrow
frame sizes.  It should become a generic mechanism that would allows
one to truncate a string so that fits in N possibly truncated screen
lines of a full-width window.

* lisp/emacs-lisp/eldoc.el (eldoc-handle-docs): Tweak
2020-07-09 18:07:22 +01:00
João Távora
384fa10958 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.
2020-07-08 11:25:33 +01:00
João Távora
fbc0bc6bef 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.
2020-07-08 11:25:33 +01:00
João Távora
bba3bea247 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.
2020-07-08 11:25:33 +01:00
João Távora
1203626f47 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.
2020-07-08 11:25:33 +01:00
João Távora
a9bd506004 * lisp/emacs-lisp/eldoc.el (Version): Bump to 1.1.0 2020-07-08 11:25:33 +01:00
João Távora
22cae4f509 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.
2020-07-08 11:25:33 +01:00
João Távora
a7a53f0d79 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 <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.
2020-07-08 11:25:33 +01:00
João Távora
9ebf51999c Turn Eldoc, Xref and Project into GNU ELPA :core packages
The new packages state they require Emacs 26.3 to function, but a
small part of project.el breaks this "soft" rule: the two functions
requiring fileloop.el are incompatible with Emacs 26.3.

* lisp/jsonrpc.el: Tweak comment near Package-Requires.

* lisp/emacs-lisp/eldoc.el: Add Version and Package-Requires.

* lisp/progmodes/flymake.el: Add comment near Package-Requires.

* lisp/progmodes/project.el: Add Version and Package-Requires.

* lisp/progmodes/xref.el: Add Version and Package-Requires.
2020-05-13 11:31:35 +01:00
Stefan Monnier
3db5a51384 * lisp/emacs-lisp/eldoc.el: Remove redundant :group arguments 2020-03-12 18:21:19 -04:00
Stefan Monnier
2d221c8d87 * lisp/emacs-lisp/eldoc.el (eldoc--supported-p): Understand the "old" API 2020-03-12 11:18:07 -04:00
Stefan Monnier
125da00b14 * lisp/emacs-lisp/eldoc.el (eldoc-documentation-function): No nil value
(eldoc--supported-p): Move after the vars it uses.  Simplify.
(eldoc-print-current-symbol-info): Revert to previous code which
assumed a non-nil value of eldoc-documentation-function.
2020-02-26 22:47:32 -05:00
Mark Oteiza
c0fcbd2c11 Expose ElDoc functions in a hook (Bug#28257)
* lisp/emacs-lisp/eldoc.el: Update commentary.
(eldoc--eval-expression-setup): Use new hook.
(eldoc--supported-p): Accomodate new hook.
(eldoc-documentation-functions): New hook.
(eldoc-documentation-default, eldoc-documentation-compose): New
functions.
(eldoc-documentation-function): Use 'eldoc-documentation-default' as new
default value.  Update documentation and custom attributes.
(eldoc-print-current-symbol-info): Accomodate possible null value for
'eldoc-documentation-function'.
* etc/NEWS: Mention them.
* doc/emacs/programs.texi (Emacs Lisp Documentation Lookup): Mention
new hook and changes to 'eldoc-documentation-function'.
* lisp/hexl.el (hexl-mode, hexl-revert-buffer-function):
* lisp/ielm.el (inferior-emacs-lisp-mode):
* lisp/progmodes/cfengine.el (cfengine3-mode):
* lisp/progmodes/elisp-mode.el (emacs-lisp-mode):
* lisp/progmodes/octave.el (octave-mode):
* lisp/progmodes/python.el (python-mode): Use new hook.
2020-02-25 18:15:12 -05:00