unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Tim Cross <theophilusx@gmail.com>
To: Arthur Miller <arthur.miller@live.com>
Cc: Jean-Christophe Helary <lists@traduction-libre.org>, emacs-devel@gnu.org
Subject: Re: Emacs development...
Date: Sun, 22 Aug 2021 18:11:48 +1000	[thread overview]
Message-ID: <87pmu550cv.fsf@gmail.com> (raw)
In-Reply-To: <AM9PR09MB4977A6333DAA0126D47DFFA496C39@AM9PR09MB4977.eurprd09.prod.outlook.com>


Arthur Miller <arthur.miller@live.com> writes:

> Tim Cross <theophilusx@gmail.com> writes:
>
>> Arthur Miller <arthur.miller@live.com> writes:
>>
>>> Tim Cross <theophilusx@gmail.com> writes:
>>>
>>>> Jean-Christophe Helary <lists@traduction-libre.org> writes:
>>>>
>>>>>> On Aug 21, 2021, at 23:08, Tim Cross <theophilusx@gmail.com> 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. 



  reply	other threads:[~2021-08-22  8:11 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-21  5:07 Emacs development Jean-Christophe Helary
2021-08-21  6:46 ` Eli Zaretskii
2021-08-21  7:08   ` Jean-Christophe Helary
2021-08-21  7:16     ` Tassilo Horn
2021-08-21  7:50       ` Jean-Christophe Helary
2021-08-21  7:54         ` Tassilo Horn
2021-08-21  8:12           ` Eli Zaretskii
2021-08-21 13:51           ` Arthur Miller
2021-08-21 22:00           ` [External] : " Drew Adams
2021-08-21  8:08         ` Stephen Berman
2021-08-21 12:05         ` Konstantin Kharlamov
2021-08-21 12:28           ` Jean-Christophe Helary
2021-08-21 14:08             ` Tim Cross
2021-08-21 15:00               ` Jean-Christophe Helary
2021-08-21 23:09                 ` Tim Cross
2021-08-22  1:26                   ` Jean-Christophe Helary
2021-08-22  2:25                     ` Tim Cross
2021-08-22  2:15                   ` Arthur Miller
2021-08-22  2:48                     ` Tim Cross
2021-08-22  7:47                       ` Arthur Miller
2021-08-22  8:11                         ` Tim Cross [this message]
2021-08-22 13:54                           ` T.V Raman
2021-08-22 16:04                             ` Eric Abrahamsen
2021-08-22 16:19                               ` Jean-Christophe Helary
2021-08-22 16:23                                 ` Eric Abrahamsen
2021-08-22 16:25                                 ` Arthur Miller
2021-08-22 16:43                                   ` Jean-Christophe Helary
2021-08-22 16:29                               ` Arthur Miller
2021-08-22 17:08                               ` T.V Raman
2021-08-22 17:44                                 ` Arthur Miller
2021-08-22 18:34                                   ` Stephen Berman
2021-08-22 23:12                                     ` Arthur Miller
2021-08-23  9:17                                       ` Arthur Miller
2021-08-22 14:41                           ` Arthur Miller
2021-08-21 14:07           ` Arthur Miller
2021-08-21  8:10     ` Eli Zaretskii
2021-08-21  8:36 ` Alfred M. Szmidt
  -- strict thread matches above, loose matches on Subject: below --
2015-02-21  2:36 Sam Auciello
2015-02-21  3:52 ` Alexis
2015-02-21  8:56   ` Eli Zaretskii
2015-02-21 10:07   ` Adam Sjøgren
2015-02-21 11:28     ` Eric Abrahamsen
2015-02-21 11:44       ` Eli Zaretskii
2015-02-21 12:24         ` Thien-Thi Nguyen
2015-02-21 12:27           ` Eli Zaretskii
2015-02-21 14:22             ` Thien-Thi Nguyen
2015-02-21 18:43               ` Eli Zaretskii
2015-02-22 17:17                 ` Thien-Thi Nguyen
2015-02-21 12:45         ` Eric Abrahamsen
2015-02-24 10:58     ` Filipp Gunbin

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=87pmu550cv.fsf@gmail.com \
    --to=theophilusx@gmail.com \
    --cc=arthur.miller@live.com \
    --cc=emacs-devel@gnu.org \
    --cc=lists@traduction-libre.org \
    /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).