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: Emacs development... Date: Sun, 22 Aug 2021 16:41:47 +0200 Message-ID: References: <56B1C272-CB13-4793-930C-9F6B96F9856B@traduction-libre.org> <83r1enz453.fsf@gnu.org> <87h7fjuuva.fsf@gnu.org> <351DF59E-BFE0-4CC2-8A40-B4E7CB73D81E@traduction-libre.org> <2281ccca2d439b935535197d931c1ccf41b0f86f.camel@yandex.ru> <3AA2DD3C-EDEC-4180-9180-AE84D6705BE8@traduction-libre.org> <87fsv26eu1.fsf@gmail.com> <5587433C-396F-4230-A81D-21CC33FAF901@traduction-libre.org> <87bl5q5n8b.fsf@gmail.com> <87tuji41l5.fsf@gmail.com> <87pmu550cv.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5102"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Jean-Christophe Helary , emacs-devel@gnu.org To: Tim Cross Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Aug 22 16:49:53 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 1mHonI-00017I-Py for ged-emacs-devel@m.gmane-mx.org; Sun, 22 Aug 2021 16:49:53 +0200 Original-Received: from localhost ([::1]:33952 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mHonH-0004up-Hb for ged-emacs-devel@m.gmane-mx.org; Sun, 22 Aug 2021 10:49:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54506) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mHokT-0007aS-GA for emacs-devel@gnu.org; Sun, 22 Aug 2021 10:46:57 -0400 Original-Received: from mail-vi1eur06olkn20806.outbound.protection.outlook.com ([2a01:111:f400:fe11::806]:43674 helo=EUR06-VI1-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 1mHokQ-0003Xe-KU for emacs-devel@gnu.org; Sun, 22 Aug 2021 10:46:57 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TBbkQ4VjF8bku280ZKC7EAcJJ5ppPZKAYzSmcncxKBg9POFkes+F69QaDNyf7hwW4VoAokQ/0Km2FD0CxzIyl9R+zUjzaOGimvbLq8zs+A+ki/HAB0k4p+U9m0G2LlxtWoJcPG+ESG7Np7FShYUjldkYhWk1NLklFQbVJ5xNavw3EabwX17OnF6aUePaV7XDP64C6/BzqAmM7662hTx4Ssjg4HWWodSkWqzEIwRNGXkq+e3bzE4VW/oR3q8i8+p0RoXQUsCE5/yy1ldYloQ/cgyL3FtCKqfQHYVIHuGqkxpL9ov0xX03GZ/4y1rPzfTC+7NM+9SjhNuZRW+auq7gng== 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:X-MS-Exchange-SenderADCheck; bh=yETkBSRMCLpEgDg0EIRB6GfORKLMscI3h1PJau6Pnxs=; b=Aqn71wSL33uxIjZGmcg2Ljkb4AvZwabI77FSOpRmgBmNdlsiQo9nk3jdelzh0d/FvKdBSJEOQIVGF4DritfZOhobscCmWKxdyIxHUmH/nfCOWPGXfEmKAjRDFTNu3suGJsqt4AKYJGkLAW39Vy940uYAQFWaq4AmJrlaxAbkm8CzmKU1WHRoi86GovwSl0vVE3Isl79X3bWo/nSOH5P6OuGCHcjKwqgeuj+LerpMGt1IYjHuhvcJPPekwSLBOOn00q+fEcriAl7RCmQOxOUBKdRCMvXz5Mf9P6ilzIGER0D6cGenGNMS+Hlup45ih0uTVofO6c8wEk3a3Zwjd3qlIg== 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=yETkBSRMCLpEgDg0EIRB6GfORKLMscI3h1PJau6Pnxs=; b=p0SJTZXzL8qDVCZ3TrGhoQQCVnyJV9XN6IUE5tk4kGl7J1ZApfJsQNMA+/suZe56BrK4hwxU14vSb+PchuZ8ns1RF5k1HKKLZ9cIr++gjqfgK1sELFBKBQiKz6AhUzEFiZ9gokPOgpr9wgv/N0Zn+yAKMR5Hr/7ZvH4UHkNa/PyY+IzCN55h4glneHYVE+ILFPzyM03Ag6pVcoecwQDerTLSOxBWF47x/k16cg/PLdcxO+rE9Mw6iPjl0BNA/AIiLBsn+hOWfAl/l9t1S3GgnGkYdF2/UwQinM/rQ9MMbri1hVciYxwFsJ2ML/tfI+ib6XVvTEfy7nQPPJQ/EK0zsg== Original-Received: from VI1EUR06FT032.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc37::45) by VI1EUR06HT021.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc37::174) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Sun, 22 Aug 2021 14:41:47 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2a01:111:e400:fc37::51) by VI1EUR06FT032.mail.protection.outlook.com (2a01:111:e400:fc37::480) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Sun, 22 Aug 2021 14:41:47 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:C993CF69E044821E142F34925B60E5B0E515330C184D437ED7D15802A0BB2328; UpperCasedChecksum:7AF82C704C901A26CBB87428CA2C5D7C090FAADB31CCFCE6F28FCC7AB8332CAF; SizeAsReceived:8088; Count:46 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::b483:471e:6dc2:12ae]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::b483:471e:6dc2:12ae%9]) with mapi id 15.20.4436.024; Sun, 22 Aug 2021 14:41:47 +0000 In-Reply-To: <87pmu550cv.fsf@gmail.com> (Tim Cross's message of "Sun, 22 Aug 2021 18:11:48 +1000") X-TMN: [Jfbh8V/fGJJwzdFZiXIHDFxlOJfpAu95] X-ClientProxiedBy: AM5PR1001CA0001.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:206:2::14) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <87pmu5mthw.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (81.232.177.30) by AM5PR1001CA0001.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:206:2::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Sun, 22 Aug 2021 14:41:47 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 857e1408-fe72-4655-cd71-08d9657af836 X-MS-TrafficTypeDiagnostic: VI1EUR06HT021: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kdN3/yvrDI0cxLgp6zJG9Ksj0GAi5WtdemhvM31O47uoFydjfkRCcwX27UYlEvsm62qg4UeZZ/GCLbiGq1b0Tl+/Bm8yp2/ve4w5eh8rFLaBUsNICGwOk/pVpPKV42p1ggTbgjDPUw+ax6LUW6g4rtJIb7dDNfd7dq/MI+S3jUYU7yHzY8JcbkX/Jv4xM0/r+d7Ujib9iw4p6u+N89IzAVhBq+FUTJpOzZfYzQOlt9+jZ8EPZoE1puKufdJ33wDWFGhzZeisxI97DWon7y5jBzVFNb2gDJoSc6I+HE6xxCGHBBP70CGY+aLad0rK8I42naP6Brj7tOcqmQUyuEftUUnrA/uyB4wc23z5LJyBYMkyIYURuRDj9rViyIE7JY3f4a4FknNyJnDSUgHyu0yf764y8E1yMyJntNdpY9uSRjZPbLNAm15QnxgtMw34M0zN X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: s0UPVVLQHUf5+qXUxlVzQ7l3n61wnDVQIL3e2OO5U6E0wZvuqoYVZy21NfqtADRNSc2j8FeWoVtgYkN7N9nXoxmGo233NdJn3ctBWRmIG9hZzRO+JpVoNjWJXLMcJA1Nopi2oPCByeURPvhqDzRl7w== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: 857e1408-fe72-4655-cd71-08d9657af836 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2021 14:41:47.8374 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: VI1EUR06FT032.eop-eur06.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1EUR06HT021 Received-SPF: pass client-ip=2a01:111:f400:fe11::806; envelope-from=arthur.miller@live.com; helo=EUR06-VI1-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, 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:272839 Archived-At: Tim Cross writes: > Arthur Miller writes: > >> Tim Cross writes: >> >>> Arthur Miller writes: >>> >>>> Tim Cross writes: >>>> >>>>> Jean-Christophe Helary writes: >>>>> >>>>>>> On Aug 21, 2021, at 23:08, Tim Cross wrote: >>>>>>> >>>>>>> I would also recommend getting comfortable with ielm (M-x ielm), an >>>>>>> Interactive Emacs Lisp Mode, as well as learning how to evaluate >>>>>>> expressions in the source buffer. >>>>>> >>>>>> Thank you Tim for the suggestion. I like ielm a lot, when I use it. >>>>>> >>>>>> What I am trying to do now is fix a bug in package.el and I don't see how I can >>>>>> use ielm for that. Do you have suggestions ? >>>>> >>>>> The relevance of ielm is that it is a powerful and useful tool you have >>>>> at hand when doing development or bug fixing in elisp. It provides the >>>>> REPL where you can test/evaluate bits of code. How useful it is for a >>>>> specific issue will depend on that issue. >>>> >>>> What does ielm offer over M-: (eval-expression)? I use a lot M-: so I am >>>> interested to know if I can improve on my workflow. >>>> >>> >>> Evaluating sexp in the code is very valuable. However, sometimes, I just >> What do you mean in the code? Like C-x C-e? >> >> M-: opens a repl, similar to ielm. It places cursor in minibuffer and >> lets me eval a function with any arguments and so. Ielm asks me to keep >> a prompt open in another buffer. So I have to switch to and from that >> buffer, so I never really appreciate it. So I wonder if ielm has >> something more to offer, than what I get from M-:? >> > > M-: isn't what I would call a REPL. It just provides a way to evaluate a > lisp expression which you can enter in the echo area. It is similar to > eval-last-sexp (C-x C-e), except as you say, you can specify the arguments. > Where ielm differs is that it is more like a proper REPL - it adds the > 'L' (loop) which you don't have with M-:, which is really just the REP > (read, eval print) part. Isn't that what a repl is too? You type a form and press enter to get it evaled in ielm. That is similar to eval-last-sexp, it is just that as you say, one press instead of C-x C-e. I think both are interfaces into emacs command loop, which is the real repl going on. I don't know, I experience M-: as a hidden repl which is out of my way until I needed while ielm asks me to have that repl open all the time in a buffer. I don't say you are wrong, I just never really got into why I should use ielm, and many are praising it, so I have a feel I am missing something good :). > With ielm you can enter multiple statements, go back > through history and edit/modify an expression and re-evaluate it. Define > a new function and then call it, set a variable and then see its printed > form by just typing it at the prompt etc. But you can do all that with M-:. It remembers history, you can go back and forth and so. Results and printed forms, are echoed in the minibuffer, and I usually open messages buffer. There might you have the point: you don't need messages buffer with ielm. Ielm displays everything in same buffer. I am so used to messages buffer that I don't even thing of it. I have it almost always open. But I don't switch to it, it is scrolling itself, and it is just "read only" for me to see results from M-:. > When I'm writing new eilsp, I will often open a new *.el file and a ielm > buffer. I might write the first pass of a function in ielm, run it with > different arguments until it works as desired and then copy it back to > the *.el file to save it. We all have personal workflow, I am not sure that one would be for me. I have those few shortcuts I posted in some comment before. I type in .el file and than I can eval any form, from entire defun to just variable directly with a shortcut. I understand appeal with a freshly written defun, and than when you press enter, you are ready to type some test to test how it works, while I have to hit M-: first to test it. But can you easily change defun, say you need to fix a typo in the middle of a defun? How do you do that in ielm? Can you just go back in buffer and retupe and re-eval? I never tried to be honest. I am so used that I can move freely in .el buffer, and when I type M-: and it finishes, my corsor is back at same spot so I can fix typos, change defun etc. I don't even need to jump to the end of defun to test it again. Is it one of those things thay call trade offs? Both have trade off, and it's personal preferance which one to go for? Sorry, I dont' mean to compete, I am just really curious myself. I dislike constant switching between buffers, contexts and so. I would just like to type code as I type prosa. I even dislike special characters like #$[] and such since they are not as easy to type on the keyboard. I like to use macros so I don't need to quote stuff :-). > I don't find it an issue to switch buffers - this is what I'm doing all > the time. I have a frame with multiple tabs and each tab might have > multiple windows and I will jump around between them constantly. It only > takes one or two key strokes, so I find it no more hassle than M-:. > > Being able to edit more complex expressions and move up/down through the > history is extremely useful. However, I also really enjoy interactive > development and exploration. I hate writing a whole heap of code and > then having to spend hours debugging it. I prefer to write small > functions and build them up bit by bit, running and testing them as I > go. For this, ielm is a key tool. Yes, that is me too. Regardless of a language. I prefer to write small piece of code, small units. I would usually start by defining a function and return points so I can compile it and run, than I would add a pice of logic, like maybe a loop, or call to something else and compile again, if possible run and so on. Unfortuantely does not scale well in big code bases, complex guis and so. Not even when working with Emacs C sorces, at least I didn't found a good way. But it works fine for elisp. > What would be even better is the ability to send code from the buffer to > be evaluated in the ielm buffer. I think Stefan posted something about > this recently. This could make it easier to execute expressions within a > context you have created and provide some additional functionality which > isn't easily done now (though of course, being Emacs, you can set it up). I am not sure I follow about that "with the context I created", why not just execute it in the context itself, why sending everything somewhere else? Maybe I am missing something there. But I am really intersted to hear bout which functionality more? > To what extent you would find ielm useful really depends on personal taste > and style when it comes to development and/or debugging. This is both > the power and weakness of Emacs. Yes of course, I completely agree there. Seems lilke I have centered my workflow around different tools and am little lazy to explore other tools. That is why I ask you, since you seem to be using ielm :-). I am very thankful for thorough explanations. Kind of you to explain it so detailed. > the workflow which is more natural and customised to individual tastes. > It is a weakness because 'out of the box', things are very vanilla and > it can take time to learn what is possible and configure it. To be > honest, my current emacs lisp environment is nowhere as refined and > configured as it once was. Back when I was doing more elisp, things were > heavily customised with many advanced features enabled, custom key > bindings, additional functions, advice etc etc. However, I rarely find > it necessary to do much elisp these days. I've even stopped maintaining > my own emacs configuration and now just use spacemacs - I have always > liked VI's modal editing style and I find spacemacs mostly works really > well. I have some fairly minor tweaks and customisation, but on the > whole, I just leave it alone and get on with the other stuff I need to > do. I find myself pressing lots of C-x and C-z, so I lately have being thinking of how to lessen typing, and I think I like the idea used in Vi, of having a "command mode" as normal and insert mode as editing mode. But I have tried evil, and I can't really get that with 5 different modes and so. I also experienced some slugishness after evil was on for a while. Maybe just mine config and me not being experienced with evil. No Doom or Spacemacs here, just plain evil mode installed. But I do like the idea with repeaters. I had thought for a couple of monts to build a mode where I can press a key and have it "sticky" until I turn it off. I think it is similar to idea of mode. Someone on Reddit published yesterday a mode for just that, so I don't need to build it myself now :-).