From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.devel Subject: Re: Patch proposal: display symbol source code in help buffers Date: Mon, 20 Sep 2021 16:55:55 +0200 Message-ID: References: <875yuvlrz3.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32873"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Lars Ingebrigtsen , emacs-devel@gnu.org To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Sep 20 17:06:22 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mSKs9-0008Iv-EZ for ged-emacs-devel@m.gmane-mx.org; Mon, 20 Sep 2021 17:06:22 +0200 Original-Received: from localhost ([::1]:58688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSKs8-0001gD-Du for ged-emacs-devel@m.gmane-mx.org; Mon, 20 Sep 2021 11:06:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44558) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSKiB-0000b9-Td for emacs-devel@gnu.org; Mon, 20 Sep 2021 10:56:03 -0400 Original-Received: from mail-oln040092067054.outbound.protection.outlook.com ([40.92.67.54]:54697 helo=EUR02-AM5-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSKi8-0005Dn-LB for emacs-devel@gnu.org; Mon, 20 Sep 2021 10:56:03 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GjtJL+Pog/KLzLY56x/y/x/ySH1OUQMs+8X9s0NkFE/NvgvqZKzk6fGNgprQ0xOAnz6kfM2jSF1FCCk9zC08hUyXAisSdVi2+fRsvGZ7A1eSS7go4VbopwiqwGmTpYT4ynYS74UhtuDmh3o3GFCUmRVhxivWXLZQt+H+gL/0RelRU2f23yxdcHoZRJz7MNw/6X49EgtQsHgevyhp9qEzzcEVxpSfJcjhZVj8DuAXAAenLwhkkdRYx4jKAQIz5OIyt092J8s2wvfzKTF4/ByGWz4fjTXGz3HsXw1QlEOrvdQI+8B/KpQZR5FtdEL2qCh5Kddy4cnXrPr1AdU4wYNBkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=LVofBD+2d7nNywGtyeUDKeG69E/PsnPrHVOX3gwWhSU=; b=Hz7ESU4ENFrr/BEufa4Zjj70zOje74qbhL4LlWMW7dQBj5gO6Qd/8PyR0HIe4+uyN0I2YVolVd29unwDnow3aCIjMiOj8xWqsvfBTnd0IHTGrNXxbfgvsUOJTMP0V0nqhWS29T9QjM7QH6Zc63nrAaJMq4VtffbqJ62b3jok9IOOO0vLXqIPSnbQJCsPvtNonJu4MfgqvAlijGdzmJAQDcLj5hAvh9v0Zl11ZcwcfpsnpHrMzoAJXixLv+lKrX438ayv790u11Vg8ieo/HdJOS1bY0m4jswnHaetieAbEv0r+rmPSluzFUAKdI7YuCxyxrXjKl6nsQ76t9cAmR3P2w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LVofBD+2d7nNywGtyeUDKeG69E/PsnPrHVOX3gwWhSU=; b=Rku5+8wzESZfkeiKnFRH1LAPX+qCdP2YsaYpQRc29pWerQZiC8TEGnNfx88BScWTClhW75qfXyhk/u4xHIvga671CG0CgEvquCThlJk4tuR6qqZIEj+QU6A8EumNAo8J5QQx7sUSIeBH+jUENgnEa8tyOhetxAD2Wn162cRVA5APN2OcHWH2aYKhUcHbOzURnLSXDSeU4NWLOCEL30bT6L6Ar3YAdfIXOY+I9G4KMGv7wr3EmyuzpT2wln3Li7J4YF1qHH24yDp+I6lHnyOO7pyu3XzmMg1ASby6TaCO5C2vZrCmVK8T6NeDBLa5w9YZopVEbmsp/QkjDSReQkWa7w== Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) by AM0PR09MB3763.eurprd09.prod.outlook.com (2603:10a6:208:185::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14; Mon, 20 Sep 2021 14:55:56 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::c55c:ece5:bed2:a9dc]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::c55c:ece5:bed2:a9dc%9]) with mapi id 15.20.4523.018; Mon, 20 Sep 2021 14:55:56 +0000 In-Reply-To: (Stefan Kangas's message of "Sun, 19 Sep 2021 23:09:51 -0700") X-TMN: [Tl+omPsRmrdQ2e3KuF6OWnVvb07toWnE] X-ClientProxiedBy: AM5PR1001CA0052.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:206:15::29) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <8735pzmh38.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (81.232.177.30) by AM5PR1001CA0052.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:206:15::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.16 via Frontend Transport; Mon, 20 Sep 2021 14:55:55 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ae122502-f928-48e1-9d17-08d97c46bfb7 X-MS-TrafficTypeDiagnostic: AM0PR09MB3763: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /GQfDQiiFwR2P5KzbJVCjGw/3b7dSDf7D8Kp6kbOSHgW1fPFLVIyH6i+WpNajJ4H6c4z4tONpxaCj1gUWd4AKiBfSxJzNpWpAv31pW9BNxSkFbOpq/KXeooJY9KHoxxvZEbbYwqRzStahKpS0szDHq99DIg/TmbIAkY+gl1kelaY7VMNnechOlhYNP1ozAvCv0SJljY78CNy3fh/U8K0vPWXm98lUnoBPoMnRM/zw3En+EnrCO6muyMIjlqPF/PTD0vO921vR7BPRS6ODaak826NCSzrRxpAePT8XXhgyMZXHiBdhUVUrib9L7tyRfSFIxouv3oTS5UGd8p42oiTCWzOMVATG/l3T6MXK0z9PJZh7HnLZM4a+RGib27IYJJNs4izwP61UuF/XT5hunxahF4ljlbtcV7ZsaXWZd2CtaJsHo8apLG68C54R7Kxzk+b/ic2hh5xjkljGyzdiZIZE+55eIggte2eRHiVsFGXjnM= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Z1hQETlx7XXkw7CgY1FXNc2VTWSqCjVXFKdOx/RkrQJndypZJgsEoA3noP9fUeUacCm3Fg+KxT2aOOQLsx2uxnDTTgZoDbQLXlFaLHocyVC0nqjAyqi9eLluMyuq8zVUuzXrutgAgztIH1aZp0ZS5Q== X-OriginatorOrg: sct-15-20-3174-20-msonline-outlook-72e6e.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: ae122502-f928-48e1-9d17-08d97c46bfb7 X-MS-Exchange-CrossTenant-AuthSource: AM9PR09MB4977.eurprd09.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Sep 2021 14:55:56.0590 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR09MB3763 Received-SPF: pass client-ip=40.92.67.54; envelope-from=arthur.miller@live.com; helo=EUR02-AM5-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:275136 Archived-At: Stefan Kangas writes: > Lars Ingebrigtsen 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.