From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tim Cross Newsgroups: gmane.emacs.devel Subject: Re: Emacs development... Date: Sun, 22 Aug 2021 18:11:48 +1000 Message-ID: <87pmu550cv.fsf@gmail.com> 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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26159"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.6.4; emacs 27.2.50 Cc: Jean-Christophe Helary , emacs-devel@gnu.org To: Arthur Miller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Aug 22 10:51:45 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 1mHjCi-0006a0-NT for ged-emacs-devel@m.gmane-mx.org; Sun, 22 Aug 2021 10:51:44 +0200 Original-Received: from localhost ([::1]:52906 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mHjCh-0005YY-JD for ged-emacs-devel@m.gmane-mx.org; Sun, 22 Aug 2021 04:51:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39160) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mHjC5-0004rB-2d for emacs-devel@gnu.org; Sun, 22 Aug 2021 04:51:05 -0400 Original-Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]:46870) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mHjC3-0003gw-CR for emacs-devel@gnu.org; Sun, 22 Aug 2021 04:51:04 -0400 Original-Received: by mail-pj1-x102e.google.com with SMTP id u11-20020a17090adb4b00b00181668a56d6so3862980pjx.5 for ; Sun, 22 Aug 2021 01:51:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:date:in-reply-to :message-id:mime-version; bh=ezJGhlpTXKYaTnHeyQNQ3k/R1DzFurYbU7PR4dVuCmc=; b=mWdOxPi0a4/o1gC7ASZgdhw0O6jm3Mbr8mAGAWgUrUI57uIdM0fLC8sMxFczzOWUbX EApo5K9YpTyUXtWsJkFF6c2sOirC3BLD0etsDdFFdAvwO99v3pEqaCK59FhR9uX5Cx0h HABjWljof9meZwGkXdV5rAMw/76Oed2e8Hcvne4DY2hKy34vprxSzD5ESnGQj5aWsEnR FZ7Us5iEdTX+cYvYvVvP6Pp6PXajblh3oxPvt0lSKiTxbHQHv1oY8rbuwm50eeCLrOle Xd5oidid8ELDojz9Lvrcva2Z+Mo+oFY6g1qm9BjuTPYjZGEdqIkc6MGwZ/tYGC3JFq/1 TfXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject:date :in-reply-to:message-id:mime-version; bh=ezJGhlpTXKYaTnHeyQNQ3k/R1DzFurYbU7PR4dVuCmc=; b=EBEBYv9dT0S5I5vQjAQra41DCOu1fZRJtYovEnZa/ZPL1RRpPMpZnF8Ad8VG4wLZX6 87H7NrQeteoGs/hC5YxZQFhJ6C12kkWShseq+1T/rqT8cw6aqkLFPdjRovB4Vu5bHvln 6vCW184c34W0kSZT/czq7WE8Bxtqv5seWoY9m2DNgA27W0T2ivbNvGubedpqwS2Y3Xwy 0byIr1f2ri+pc6Vi8297hafD2kP8Oh9ZwvendqHfB/e3pmsddPD5YzJK3z2ijfKhnYLX Xc3Fxz7o9xnAXHQv8UXyK1mwhnYoUAX7Jnxyob1glCU+0TeRrvkshrSn0vNdvplYish6 LttA== X-Gm-Message-State: AOAM533D6ekIhd/Yz+lNNecC0zXYunh/pWNjwUaVGAGFp3CGcumB+SSW VoVbJzi/RKHoDLCnomH6/3lAU8ofwpQ= X-Google-Smtp-Source: ABdhPJw7MHOr1mqp2c2UmUglCs8/fRxBWjs3z3kHgeJANx1QCY9Hbcgflky8eWrt0r8DKcwIH0EgvQ== X-Received: by 2002:a17:90a:5515:: with SMTP id b21mr14274549pji.142.1629622261224; Sun, 22 Aug 2021 01:51:01 -0700 (PDT) Original-Received: from tim-desktop (106-69-104-133.dyn.iinet.net.au. [106.69.104.133]) by smtp.gmail.com with ESMTPSA id f13sm10679193pfe.125.2021.08.22.01.50.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Aug 2021 01:51:00 -0700 (PDT) In-reply-to: Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=theophilusx@gmail.com; helo=mail-pj1-x102e.google.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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:272832 Archived-At: 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. 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. I also find it a lot easier when entering more complex expressions than just using the minibuffer with 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. 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. 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). 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. It is powerful because you can create 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.