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 00:08:00 +1000 Message-ID: <87fsv26eu1.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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19572"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.6.4; emacs 27.2.50 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Aug 21 16:41:23 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 1mHSBX-0004uj-8G for ged-emacs-devel@m.gmane-mx.org; Sat, 21 Aug 2021 16:41:23 +0200 Original-Received: from localhost ([::1]:51388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mHSBW-0001XO-2O for ged-emacs-devel@m.gmane-mx.org; Sat, 21 Aug 2021 10:41:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42068) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mHSAw-0000q0-Vl for emacs-devel@gnu.org; Sat, 21 Aug 2021 10:40:46 -0400 Original-Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]:42696) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mHSAv-0001I4-44 for emacs-devel@gnu.org; Sat, 21 Aug 2021 10:40:46 -0400 Original-Received: by mail-pf1-x42c.google.com with SMTP id 18so11293545pfh.9 for ; Sat, 21 Aug 2021 07:40:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:subject:date:in-reply-to:message-id :mime-version:content-transfer-encoding; bh=c+gnZHsETmwuwS3CY0ZWY4fWkjpcHufz/4Vw2Et8TH0=; b=FnGtfBlYVsd0YcQZvJ+El7sBHo6CMJv0eEhQ2lCBib/wbodpZ0ofRoyOQit5c3hMCx 7Sx/guAtv0LCPcqbbbv7x2fd1YB+GHLPHjP9k468kIwKemSN5W9P1dKD9WEvKnQhiENt Kj4U6N8fGBMEjjf41W8qu+IocQy7ftQBOJ+D9u67MhJ3q8yrTzqD5Z+Zb5A0mgxhQgTH BbUg1bnJk7n0xL+YSkRomCVP4pIdyDRloadXn8jZ4DP18lyW4I+5d5WtE9lViOElHNXE t2x6Z9tKOZgxMk9BEdpUxmRo7Jy9a3CPHMZ3a5CovsHbkeqWWG5YFcoq2wzv77sxE9QN NbWQ== 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:subject:date :in-reply-to:message-id:mime-version:content-transfer-encoding; bh=c+gnZHsETmwuwS3CY0ZWY4fWkjpcHufz/4Vw2Et8TH0=; b=qz2tFfU1VW9wG7QZloYPyI/9F1ASmkinf8EG+Z5wnbyCUB89HGB8Rz1qAtoX7CXTAS XwhmDFC4UGy0FjOLFi8J7GMcVzpqPHGxac75+TsK84P7VetA28Z3ju9wyU0wk2MARTLr SN4E1nTSbxNZT/+DCvRRXLsOZQFzGKVty9AhDdZEX94dJWWQe2UwqjrdXYIrPicB1tmc 6lGwuISqGtHGA4i4UlFu83whHIhor7HPkvhqEyFDhhut8MFEvk7I/BzXXc+wUnp2SA+/ 6wDPCgBZ03t61Y7N0IziAZspPfM8DKXh8thgOycqrMaoylT2KLLrQBXv/L9wB2yjdT6K Uo7g== X-Gm-Message-State: AOAM531H8AFymBRJEinyh1i1HMc/+T4HgvmPADCjXlq91i8qXrBbjSFW Gguq86VcedP/wgH16QwKeJVmIzIjbek= X-Google-Smtp-Source: ABdhPJzMjCLCO6veHKJEjOr4gzg07u52sbq4ebDO4zQKhV/MNfhZOB2ErHC9UKuD5EFVf8/ClYZYSQ== X-Received: by 2002:a63:db4a:: with SMTP id x10mr9957378pgi.30.1629556842960; Sat, 21 Aug 2021 07:40:42 -0700 (PDT) Original-Received: from tim-desktop (106-69-122-228.dyn.iinet.net.au. [106.69.122.228]) by smtp.gmail.com with ESMTPSA id c64sm8871671pfc.8.2021.08.21.07.40.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Aug 2021 07:40:42 -0700 (PDT) In-reply-to: <3AA2DD3C-EDEC-4180-9180-AE84D6705BE8@traduction-libre.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=theophilusx@gmail.com; helo=mail-pf1-x42c.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:272793 Archived-At: Jean-Christophe Helary writes: >> On Aug 21, 2021, at 21:05, Konstantin Kharlamov wro= te: >>=20 >> On Sat, 2021-08-21 at 16:50 +0900, Jean-Christophe Helary wrote: >>>=20 >>>=20 >>>> On Aug 21, 2021, at 16:16, Tassilo Horn wrote: >>>>=20 >>>> Jean-Christophe Helary writes: >>>>=20 >>>> Hi Jean-Christophe, >>>>=20 >>>>> Right now, I use C-h f to find the function definitions and move >>>>> around the code. >>>>=20 >>>> That, and also M-. on a function call or variable will bring you to its >>>> definition. >>>=20 >>> Thank you. >>>=20 >>> Sorry for this very basic question, what's the best way to navigate bac= k to >>> where I was ? >>=20 >> Seems to me, you don't have a workflow yet for development in general th= rough >> Emacs. Because questions like "how to go to definition" and "how to go b= ack" >> aren't really specific to ELisp, it's something you'd use while working = with >> pretty much any language, be it C, Python, Haskell, C++, Rust=E2=80=A6 T= he only >> question you asked specific to ELisp is about debugging ELisp code. > > Thank you Konstantin > > I guess that's the case, but I was not even asking for *debugging*, just = to see > how values change over the run of a piece of code. If *that* is called > "debugging", there is a discoverability issue. > > I saw the EDE mode but even after reading its manual I was not sure how t= hat > could be put to use to ease work inside Emacs list code. > > So I guess I'll stick to edebug, M-. and M-, eldoc, highlight-defined, > which-key, helpful. Right now they seem to be a good minimal setting for = what I > want to do. 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.=20 A common 'development' pattern with lisp like languages is sometimes referred to as "REPL driven development". This is where you incrementally build up your code, running and testing small bits in the REPL as you go. You can do things like execute single s-expressions to see what value they return. This can be a really useful way to also learn about a bit of code - essentially, you can 'explore' what each statement does/returns. Initially, you will probably need to add message statements to print out variable values and state at various points in the code. However, as your knowledge and confidence grows, you will find this less and less necessary. While having tools like edebug can be extremely useful, I don't think focusing on them is a terribly useful approach. I find the debugger to be the tool of last resort - I turn to it when I'm completely lost and cannot work out why something is not working correctly. When you get to that point, it can be invaluable. However, adopting a debugging approach based around tracing code and stepping through it, watching variables change etc is tedious and time consuming. Focus on the logic and understanding/interpreting the code and documentation and I suspect you will progress faster and find it more enjoyable. A few minutes scanning and really understanding the code will often be much faster than starting edebug, instrumenting functions and tediously stepping through the code watching variables change. You may be surprised at how quickly you develop the skill of being able to just look at a bit of code and understand exactly what it does. However, the most critical bit of advice I can give is 'just do it'. Don't get too caught up in tools and workflows. Just get in there and start writing code. Initially, it will probably be rubbish. However, the process is crucial. You will learn more from sitting and trying to write some code than you will from hours of scanning documents, manuals and blog posts on how to develop. It is also through writing code you will learn what you find to be the biggest 'pain points'. This will gide you on what workflow and combination of tools/modes etc are best suited to your needs. Without that knowledge, it can all be a bit too abstract and overwhelming.