unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eshel Yaron <me@eshelyaron.com>
To: Augusto Stoffel <arstoffel@gmail.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: Sat, 11 Mar 2023 21:04:21 +0200	[thread overview]
Message-ID: <m17cvnt8i2.fsf@gmail.com> (raw)
In-Reply-To: <877cvnr2fc.fsf@gmail.com> (Augusto Stoffel's message of "Sat, 11 Mar 2023 11:46:15 +0100")

Augusto Stoffel <arstoffel@gmail.com> writes:

> On Fri, 10 Mar 2023 at 16:50, Eshel Yaron wrote:
>
>> IMO ElDoc and Help and two pretty different features, each with its own
>> use and purpose.
>> Eglot integrates with ElDoc but not with Help AFAIU,
>
> Right, the LSP protocol doesn't have an interface for anything like
> `C-h o'.  You only get information on the symbol at point.

Seems so, that strikes me as an unfortunate limitation of the protocol
as language servers are surely in a good position to provide this
information.

>> but language-specific packages can (and should!) integrate with both of
>> these facilities.  Emacs lets package authors reuse the Help UI pretty
>> easily.  For example, my package sweeprolog.el (for working with
>> SWI-Prolog code) provides both ElDoc integration and a command
>> sweeprolog-describe-predicate that works much like describe-predicate,
>> it uses the help.el interface to show a proper *Help* buffer with the
>> documentation of a given Prolog predicate.
>
> The generic Emacs way to provide this functionality is the Info symbol
> lookup command `C-h S'.

I'm not sure I agree that Info and similar manuals solve the same
problem as *Help* buffers.  During development I think that Help is much
more useful, as its aware of the current state of your project and
environment.  One obvious benefit is the ability to jump to the source
code corresponding to what you're getting help for with `s`.

> If your language doesn't have an Info manual you may have better luck
> with the `devdocs' package (which I mention as a shameless but
> pertinent plug).

Great stuff :) I actually just installed devdocs a few days ago to
access the PostgreSQL docs and it worked very well.

> Out of curiosity: apart from the issue of availability of documentation
> in different formats, is there any prolog-specific logic in
> sweeprolog-describe-predicate?

Some, yes.  Basically it uses SWI-Prolog's own documentation system to
get the current documentation for the given predicate in HTML format,
then it uses SHR with some custom shr-external-rendering-functions to
create nicely formatted text for the *Help* buffer.  That's the gist of
it.  It also links to the source location of the predicate and lists
some properties of the predicate like whether its exported or not.



      reply	other threads:[~2023-03-11 19:04 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
2023-03-11 10:46         ` Augusto Stoffel
2023-03-11 19:04           ` Eshel Yaron [this message]

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=m17cvnt8i2.fsf@gmail.com \
    --to=me@eshelyaron.com \
    --cc=arstoffel@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=goncholden@protonmail.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).