unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Arthur Miller <arthur.miller@live.com>
To: Stefan Kangas <stefankangas@gmail.com>
Cc: Lars Ingebrigtsen <larsi@gnus.org>, emacs-devel@gnu.org
Subject: Re: Patch proposal: display symbol source code in help buffers
Date: Mon, 20 Sep 2021 16:55:55 +0200	[thread overview]
Message-ID: <AM9PR09MB497777CCFF3FFEF2C92F81C196A09@AM9PR09MB4977.eurprd09.prod.outlook.com> (raw)
In-Reply-To: <CADwFkmnmWFRD_qq9ETesizZep32sHWwG7AhrCUxPwDe=9vp=zA@mail.gmail.com> (Stefan Kangas's message of "Sun, 19 Sep 2021 23:09:51 -0700")

Stefan Kangas <stefankangas@gmail.com> writes:

> Lars Ingebrigtsen <larsi@gnus.org> writes:
>
>> I haven't tried the patch, but this is for showing the source code of
>> the function/variable in question in the *Help* buffer?

Yes, that is a feature of Helpful. We had some discussion last week, which I
started by asking if we can get Helpful in i Emacs. I thought to have Helpful as
"advanced" help enabled in Emacs as-is, but some peopel expressed that would be
better to refactor it. Also, when looking at Helfpul sources it would some
refactoring to reomve dependency on some external libraries. Since Helfpul does
not use Emacs help-mode buffer, and nothing of built-in help-mode infrastructure
but implements everythin on it's own, I am of opinion that it takes less effort
to implement comparable features from scratch. Helpful author(s) have also not
said anything, either for or against, I cc:d willfred when I posted on the mail
list. 

>>                                                          I'm not quite
>> sure I understand the utility of that

To me it has been useful when I was learning, it still is; it is kind of nice to
be able to see the code together with the docs. It also makes, at least me, more
inclined to look at the sources when it is thrown at my face directly to see
what is going on, than if I have to take extra action to look at the sources.

>> sure I understand the utility of that -- if you want to look at the
>> source, you can just hit the `s' key.  And then you get all the proper
>> language-related Emacs stuff in that buffer -- looking at sources is
>> usually nicer in the correct major mode than in other buffers.

Yes, I agree that it is easy to hit 's' key. Often I would like to see functions
called in a function, and it that case I would anyway open the source file. But
there are cases when it is good enough to just glimpse through the source and
confirm what is going on. Most of the times I don't want to look at the source
at all, but if it is already there, I am actually more inclined to look at the
source than if it wasn't there.

Another feature compared to Helfpul (or anti-feature, depends whom you ask), is
that built-in help does not focus the help buffer, while Helpful shifts
focus. Many time I just want to glimpse on the source to confirm if my
understanding is correct, and I will maybe scroll other buffer (I like
two-buffer setup), so I prefer my cursor not to jump over to help buffer every
time as it does with helpful.

>> So I don't understand who'd want this.

People who are used to Helpful; people not used to Elisp at all, 

> I believe this is a feature in helpful.el:
>
> https://github.com/Wilfred/helpful/blob/master/screenshots/helpful_source.png
>
> FWIW, I personally also ask myself why/how this is useful.  Is it
> because some users don't know that you can get to the source code?
>
> That said, I don't see any reason not to have this as an optional
> feature, if some users find that it works well for them.

Of course, this can be/is cpu intensive so it should always be an opt-in
feature. I have put in a defcustom to enable/disable this, and it is nil by
default. I think that my implementation is slightly more effective than one in
Helpful, but that would be just very slightly, and probably does not matter when
it comes to compressed sources which have to be decompressed to be shown.



  parent reply	other threads:[~2021-09-20 14:55 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-19 19:50 Patch proposal: display symbol source code in help buffers Arthur Miller
2021-09-20  5:46 ` Lars Ingebrigtsen
2021-09-20  6:09   ` Stefan Kangas
2021-09-20  6:14     ` Lars Ingebrigtsen
2021-09-20  7:17       ` Ihor Radchenko
2021-09-20  7:43         ` Stefan Kangas
2021-09-20  8:29           ` martin rudalics
2021-09-20  9:04           ` Ihor Radchenko
2021-09-20 23:45             ` Arthur Miller
2021-09-21  4:16             ` Lars Ingebrigtsen
2021-09-21  6:59               ` Ihor Radchenko
2021-09-21  7:41                 ` Stefan Kangas
2021-09-21  8:38                   ` Eli Zaretskii
2021-09-21  9:17                     ` Ihor Radchenko
2021-09-21 16:49                       ` Lars Ingebrigtsen
2021-10-01  7:05                         ` Ihor Radchenko
2021-10-01  7:09                           ` Lars Ingebrigtsen
2021-10-01  7:21                             ` Ihor Radchenko
2021-10-01  7:21                               ` Lars Ingebrigtsen
2021-10-01  9:04                                 ` Ihor Radchenko
2021-10-01 12:20                                   ` Lars Ingebrigtsen
2021-10-01  7:24                           ` Eli Zaretskii
2021-10-01  9:08                             ` Ihor Radchenko
2021-10-01 10:24                               ` Eli Zaretskii
2021-10-01 14:14                                 ` Ihor Radchenko
2021-09-21  8:34               ` martin rudalics
2021-09-20 15:01           ` Arthur Miller
2021-09-21  7:41             ` Stefan Kangas
2021-09-20 15:27         ` Arthur Miller
2021-09-20  6:47     ` Eli Zaretskii
2021-09-20 15:27       ` Arthur Miller
2021-09-20 14:55     ` Arthur Miller [this message]
2021-09-21  4:18       ` Lars Ingebrigtsen
2021-09-21 10:26         ` Arthur Miller
2021-09-20 15:23   ` Arthur Miller
2021-09-20  5:59 ` Eli Zaretskii
2021-09-20  6:37   ` Gregor Zattler
2021-09-20  7:01     ` Eli Zaretskii
2021-09-20 15:21       ` Arthur Miller
2021-09-20  8:21     ` martin rudalics
2021-09-20 18:13       ` Arthur Miller
2021-09-21  8:34         ` martin rudalics
2021-09-21 10:24           ` Arthur Miller
2021-09-21 16:52             ` martin rudalics
2021-09-21 18:56               ` Arthur Miller
2021-09-21 17:30           ` Juri Linkov
2021-09-21 19:13             ` Arthur Miller
2021-09-22  7:49               ` martin rudalics
2021-09-22 16:04                 ` Juri Linkov
2021-09-22 17:52                   ` martin rudalics
2021-09-23  8:15                     ` martin rudalics
2021-09-23 15:52                       ` Juri Linkov
2021-09-26  9:10                         ` martin rudalics
2021-09-22 22:38                 ` Arthur Miller
2021-09-23  8:22                   ` martin rudalics
2021-09-20 12:19     ` Dmitry Gutov
2021-09-20 15:13       ` Arthur Miller
2021-09-20 15:11   ` Arthur Miller

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=AM9PR09MB497777CCFF3FFEF2C92F81C196A09@AM9PR09MB4977.eurprd09.prod.outlook.com \
    --to=arthur.miller@live.com \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    --cc=stefankangas@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).