unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
To: Eshel Yaron <me@eshelyaron.com>
Cc: Yuri Khan <yuri.v.khan@gmail.com>,
	Ihor Radchenko <yantar92@posteo.net>,
	 goncholden <goncholden@protonmail.com>,
	"emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: Re: Documentation by function beyond elisp
Date: Fri, 10 Mar 2023 15:33:59 +0000	[thread overview]
Message-ID: <CALDnm52hCv6cE1QcHEsEO_uuwwAvi9oyiDiW9YiE7n69Wf+wxA@mail.gmail.com> (raw)
In-Reply-To: <m1lek4u0cq.fsf@gmail.com>

On Fri, Mar 10, 2023 at 2:51 PM Eshel Yaron <me@eshelyaron.com> wrote:
>
> Yuri Khan <yuri.v.khan@gmail.com> writes:
>
> > On Fri, 10 Mar 2023 at 16:12, Ihor Radchenko <yantar92@posteo.net> wrote:
> >>
> >> Yuri Khan <yuri.v.khan@gmail.com> writes:
> >>
> >> > For languages other than Elisp, this is handled by the language
> >> > server. Eglot arranges for language-server-provided function help to
> >> > be displayed by ElDoc.
> >>
> >> What about an equivalent of the *Help* buffer?
> >
> > Well, what about it? You move the point to an identifier. Its
> > signature and a few lines of documentation are shown in the echo area.
> > You invoke (eldoc-doc-buffer) and see the whole documentation.
> >
> > It may be a bit inconvenient that the content of that buffer changes
> > as you move point to a different identifier. But that can be worked
> > around with (clone-buffer).
>
> IMO ElDoc and Help and two pretty different features, each with its own
> use and purpose.

They are different in implementation, but there is definitely overlap,
and not in small amount.  I'm not saying this is ideal, but that's
what it is. Both features show documentation for language elements.

One difference is that it is just much easier to hook up ElDoc to
multiple asynchronous and synchronous documentation providing features,
such as Eglot's LSP interface, but also SLY, SLIME, CIDER as examples.

Also, using help-mode, the major mode must do all the window
management and documentation rendering.  It's not immediately
clear if it can be used to exert generic control over how
documentation is displayed, like eldoc.el can.  It's also not
immediately clear how to use it with asynchronous documentation
sources.

Eldoc.el lives in lisp/emacs-lisp, but it was effectively already
being used for other languages and modes long before I reworked
some of its interfaces.  The manual is very underdeveloped, but
IMHO a much more promising feature.  I myself have never used *Help*
for anything but Emacs lisp, where I do appreciate it immensely.

> Eglot integrates with ElDoc but not with Help AFAIU,
> but language-specific packages can (and should!) integrate
> with both of these facilities.

I'm not saying the contrary, but I'd say that for a new mode
for language-x it's easier to setup Eldoc with an external
documentation-producing program, an inferior process (like
SLY/CIDER) leave it to LSP via Eglot.  Fully fleshing out a
*Help* renderer like you did in sweeprolog.el seems a lot
more work.

João



  reply	other threads:[~2023-03-10 15:33 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-09 11:33 Documentation by function beyond elisp goncholden
2023-03-09 12:07 ` Po Lu
2023-03-09 12:17   ` goncholden
2023-03-09 13:33     ` Po Lu
2023-03-09 13:58       ` goncholden
2023-03-09 12:24 ` Eli Zaretskii
2023-03-09 13:01   ` goncholden
2023-03-09 15:29     ` Eli Zaretskii
2023-03-09 15:36       ` goncholden
2023-03-09 15:48     ` Eli Zaretskii
2023-03-09 17:04       ` goncholden
2023-03-09 17:33         ` Eli Zaretskii
2023-03-09 15:50 ` Yuri Khan
2023-03-10  9:14   ` Ihor Radchenko
2023-03-10 10:23     ` Yuri Khan
2023-03-10 14:43       ` João Távora
2023-03-10 14:50       ` Eshel Yaron
2023-03-10 15:33         ` João Távora [this message]
2023-03-11 10:46         ` Augusto Stoffel
2023-03-11 19:04           ` Eshel Yaron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALDnm52hCv6cE1QcHEsEO_uuwwAvi9oyiDiW9YiE7n69Wf+wxA@mail.gmail.com \
    --to=joaotavora@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=goncholden@protonmail.com \
    --cc=me@eshelyaron.com \
    --cc=yantar92@posteo.net \
    --cc=yuri.v.khan@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).