unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Why eev has a weird elisp tutorial and how to use it
@ 2022-01-27 16:06 Eduardo Ochs
  2022-01-27 18:06 ` Emanuel Berg via Users list for the GNU Emacs text editor
  2022-01-28  2:49 ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 2 replies; 5+ messages in thread
From: Eduardo Ochs @ 2022-01-27 16:06 UTC (permalink / raw)
  To: help-gnu-emacs

Hi list,

I made a video called:

  "Why eev has a weird elisp tutorial and how to use it"

comparing the "An Introduction to Programming in Emacs Lisp" - a.k.a.
the (info "(eintr)") - with the small elisp tutorial that comes with
eev - a.k.a. the (find-elisp-intro) - and discussing the design
decisions behind both.  In short: a few years ago I needed an elisp
tutorial for a workshop and the eintr was too book-y, so I wrote the
find-elisp-intro, that was more Emacs-y.

The video is here,

  http://angg.twu.net/find-elisp-intro.html
  http://angg.twu.net/eev-videos/2022-find-elisp-intro.mp4
  http://www.youtube.com/watch?v=WowDSciGs1A

and first link includes a full transcript with timestamps.

Comments welcome! Cheers =),
  Eduardo Ochs
  http://angg.twu.net/#eev


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Why eev has a weird elisp tutorial and how to use it
  2022-01-27 16:06 Why eev has a weird elisp tutorial and how to use it Eduardo Ochs
@ 2022-01-27 18:06 ` Emanuel Berg via Users list for the GNU Emacs text editor
  2022-01-28  2:49 ` Emanuel Berg via Users list for the GNU Emacs text editor
  1 sibling, 0 replies; 5+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2022-01-27 18:06 UTC (permalink / raw)
  To: help-gnu-emacs

Eduardo Ochs wrote:

> The video is here,
>
>   http://angg.twu.net/find-elisp-intro.html
>   http://angg.twu.net/eev-videos/2022-find-elisp-intro.mp4
>   http://www.youtube.com/watch?v=WowDSciGs1A
>
> and first link includes a full transcript

Alright, that's very good to include!

> Comments welcome! Cheers =),

  I say here that "This is a very quick introduction to Emacs
  Lisp my intent here is not to teach people how to _write_
  elisp code only to teach them to _read_ elisp code".
  
  I consider that reading and writing are two different
  stages, and in the beginning people are mostly going to want
  to read things [...]

Say what?!

Sacrilege!

I stopped there :(

But maybe I'll check out "Gwen, or The Book of Sand" ... and
I'll tell you if I do.

-- 
underground experts united
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Why eev has a weird elisp tutorial and how to use it
  2022-01-27 16:06 Why eev has a weird elisp tutorial and how to use it Eduardo Ochs
  2022-01-27 18:06 ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2022-01-28  2:49 ` Emanuel Berg via Users list for the GNU Emacs text editor
  2022-01-28  3:56   ` Eduardo Ochs
  1 sibling, 1 reply; 5+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2022-01-28  2:49 UTC (permalink / raw)
  To: help-gnu-emacs


  And this video is - hopefully - a first step to make my
  tutorial less mysterious. So: that's it. That's what
  i wanted to show. Bye! =) [1]

Yeah, that was a verbose and informal intro from a personal
POV if there ever was one - and except for the thing I already
mentioned, that people should learn to read code first, where
I disagree 100%, from my POV but also in general - but except
for that, all's cool obviously, but ...

Where is the actual Elisp intro? :O

There's no transcript of that?

That's the one, if one only has one, that one should have!

My own POV is rather different, I think. TBH I don't remember
ever having a problem with Elisp at the early stages actually
... a cheat sheet (crib sheet) with all the basic stuff
(meaning a lot since there is a lot) and on top of that
a cookbook of more advanced, but still common methods and
situations - this OTOH can be commented, tho briefly - those
two documents would have perhaps speeded up early effort.

"Methods and situations" would include small demos and
skeleton code with concepts such as DWIM, closures, stuff like
that, the more Lispy stuff. Nothing a beginner can't handle if
presented right.

Example DWIM:

;;; -*- lexical-binding: t -*-
;;;
;;; this file:
;;;   https://dataswamp.org/~incal/emacs-init/dwim.el

;; DWIM interface

(defun test-dwim (&optional beg end)
  (interactive (when (use-region-p)
                 (list (region-beginning) (region-end)) ))
  (let ((bg (or beg (point-min))) ; or just (point) here
        (ed (or end (point-max))) )
    (list bg ed) ; code here
    ))

;; test the interface

(when nil
  (save-excursion
    (set-mark   10)
    (goto-char 500)
    (call-interactively #'test-dwim) ) ; (10  500)
  (call-interactively #'test-dwim)     ; ( 1 1163)
  (test-dwim 30 90)                    ; (30   90)
  (test-dwim)                          ; ( 1 1163)
)

;; example function

(defun count-chars (&optional beg end)
  (interactive (when (use-region-p)
                 (list (region-beginning) (region-end)) ))
  (let*((bg   (or beg (point-min)))
        (ed   (or end (point-max)))
        (diff (- ed bg)) )
    (prog1
        diff
      (message "%d" diff) )))

;; test the example function

;; (call-interactively #'count-chars) ; 1162
;; (count-chars)                      ; 1162
;; (count-chars 10 40)                ; 30
;; (+ 1111 (count-chars))             ; 2273

[1] http://angg.twu.net/find-elisp-intro.html

-- 
underground experts united
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Why eev has a weird elisp tutorial and how to use it
  2022-01-28  2:49 ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2022-01-28  3:56   ` Eduardo Ochs
  2022-01-28  5:22     ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 5+ messages in thread
From: Eduardo Ochs @ 2022-01-28  3:56 UTC (permalink / raw)
  To: Emanuel Berg, help-gnu-emacs

On Thu, 27 Jan 2022 at 23:50, Emanuel Berg via Users list for the GNU Emacs
text editor <help-gnu-emacs@gnu.org> wrote:

>
>   And this video is - hopefully - a first step to make my
>   tutorial less mysterious. So: that's it. That's what
>   i wanted to show. Bye! =) [1]
>
> Yeah, that was a verbose and informal intro from a personal
> POV if there ever was one - and except for the thing I already
> mentioned, that people should learn to read code first, where
> I disagree 100%, from my POV but also in general - but except
> for that, all's cool obviously, but ...
>
> Where is the actual Elisp intro? :O
>
>
 Hi!

In the video I refer to the intro in several places as
"find-elisp-intro", and people who have played with the main eev
tutorial a bit usually quickly become familiar with three ways of
going to an "intro"... in the case of find-elisp-intro the three ways
are:

  1) running M-x find-elisp-intro

  2) eval-ing a sexp like this: (find-elisp-intro)

  3) in most pages in http://angg.twu.net/ when a sexp like

       (find-elisp-intro)

     appears, its middle part - the "find-elisp-intro" - becomes a
     link that points to an htmlized version of that intro, that is
     here:

       http://angg.twu.net/eev-intros/find-elisp-intro.html

One of the first things in this page

  http://angg.twu.net/find-elisp-intro.html

is a "(find-elisp-intro)" that has a link to the htmlized version of
the intro.

This part of the video explains that if you have eev installed it's
easy to create elisp hyperlinks to sections of that tutorial:

  8:23 One important thing is that people can create hyperlinks to the
       sections of the of my elisp tutorial very easily.

  8:35 For example, suppose that you're one of the students in my
       workshop, you are starting to learn Emacs today today, and you
       learned the basic ideas of how to create elisp hyperlinks

  8:56 and you think that there's something interesting in this section
       here - section 5.

  9:02 So you can create a link to it by hand. For example you can
       simply type this (find-elisp-intro "...") - initially by hand;
       later you can learn the tricks for generating this automatically -

  9:22 and you can copy the title to this position here. Now you have
       something that if you execute... if you execute this you go
       exactly to this section here.

It starts here:

  http://www.youtube.com/watch?v=WowDSciGs1A&t=8m23s

Cheers,
  Eduardo Ochs
  http://angg.twu.net/#eev


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Why eev has a weird elisp tutorial and how to use it
  2022-01-28  3:56   ` Eduardo Ochs
@ 2022-01-28  5:22     ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 0 replies; 5+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2022-01-28  5:22 UTC (permalink / raw)
  To: help-gnu-emacs

Eduardo Ochs wrote:

> http://angg.twu.net/eev-intros/find-elisp-intro.html

Okay, there's no way around it, we are total opposites ...

You are supposed to learn programming by evaluating some other
guy's code?

Also you write stuff like

  These `find-*-noselect' functions work quite well but are
  not 100% reliable - for example, if an elisp file has
  several definitions for the same function, variable, or
  face, the `find-*-noselect's don't know which ones were
  executed, neither which one was executed last, overriding
  the other ones... and it may return the position of a defun,
  defvar, or defface that is not the "active" one.

at a time when you haven't mention even the most basic
building blocks of the language, e.g. `if', `when', `unless',
`cond' ...

That page is rather some kind of interactive index for people
who are already programmers, I'd say. Maybe do the first Elisp
multimedia CD-ROM instead?

-- 
underground experts united
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-01-28  5:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-27 16:06 Why eev has a weird elisp tutorial and how to use it Eduardo Ochs
2022-01-27 18:06 ` Emanuel Berg via Users list for the GNU Emacs text editor
2022-01-28  2:49 ` Emanuel Berg via Users list for the GNU Emacs text editor
2022-01-28  3:56   ` Eduardo Ochs
2022-01-28  5:22     ` Emanuel Berg via Users list for the GNU Emacs text editor

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).