Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [INCLUDE TH/speedbar.blogme]
- [SETFAVICON dednat4/dednat4-icon.png]
- [SETFAVICON IMAGES/forthsun.png]
- [#
- (defun c () (interactive) (find-blogme3-sh0-if "emacsconf2019"))
- (defun u () (interactive) (find-blogme-upload-links "emacsconf2019"))
- ;; http://angg.twu.net/emacsconf2019.html
- ;; file:///home/edrx/TH/L/emacsconf2019.html
- ;; (eco)
- ;;
- #]
- [lua:
- require "sexp" -- (find-blogme3 "sexp.lua")
- def [[ ECS0 1 time youtube_make_url("86yiRG8YJD0", time) ]]
- def [[ ECS 2 time,text BR()..R(ECS0(time), time).." "..text ]]
- def [[ ECSQ 2 time,text ECS(time, Q(text)) ]]
- ]
- [SETHEADSTYLE [LUCIDA]]
- [htmlize [J Eev @ EmacsConf 2019]
- [P This is what I submitted to the [R https://emacsconf.org/2019
- EmacsConf 2019]:]
- [NARROW
- [P [BF Title:]
- [BR] How to record executable notes with eev - and how to play them
- back
- ]
- [P A transcription of what I say in the demo:
- [ECSQ 0:00 Hello. The name of this talk is ]
- [ECSQ 0:04 "How to record executable notes with Eev and how to play them back." ]
- [ECSQ 0:07 I'm Eduardo Ochs—this person here—the author of Eev, ]
- [ECSQ 0:11 and this is Selana Ochs, my main contributor at the moment. ]
- [ECSQ 0:16 Let me start by explaining the prehistory of Eev. ]
- [ECSQ 0:18 Eev appeared by accident. ]
- [ECSQ 0:21 I was fascinated by programming and from what I knew ]
- [ECSQ 0:25 UNIX seemed to be the right thing and in 1995 ]
- [ECSQ 0:28 I bought a computer that could run GNU Linux, ]
- [ECSQ 0:30 and a Linux CD. ]
- [ECSQ 0:32 I was studying mathematics at the University ]
- [ECSQ 0:34 (not computer science) and I was ]
- [ECSQ 0:37 able to learn a tiny bit of UNIX and Lisp at the University. ]
- [ECSQ 0:41 My social skills were very bad; ]
- [ECSQ 0:46 I couldn't socialize properly with ]
- [ECSQ 0:48 the people there who really knew Unix. ]
- [ECSQ 0:51 They kept saying to me that ]
- [ECSQ 0:53 everybody uses VI ]
- [ECSQ 0:55 but my memory was very bad ]
- [ECSQ 0:56 as bad as my social skills ]
- [ECSQ 0:58 and I typed slowly and with lots of mistakes ]
- [ECSQ 1:00 so at one point I decided to give up ]
- [ECSQ 1:03 learning VI and tried Emacs ]
- [ECSQ 1:05 and I found it [IT mind-blowing ]. ]
- [ECSQ 1:07 I was taking notes about ]
- [ECSQ 1:10 everything that I was learning ]
- [ECSQ 1:14 and my notes started to have ]
- [ECSQ 1:16 lots of elisp hyperlinks like these. ]
- [ECSQ 1:17 When we execute this ]
- [ECSQ 1:19 [COLOR GREEN (find-file "/usr/share/emacs/19.24/lisp") ]
- [ECSQ 1:21 it opens a certain directory ]
- [ECSQ 1:22 with lots of interesting files in it ]
- [ECSQ 1:25 and when we execute this ]
- [ECSQ 1:28 [COLOR GREEN (find-file "/usr/share/emacs/19.24/lisp/files.el") ]
- [ECSQ 1:29 it opens a specific file in the directory. ]
- [ECSQ 1:31 At first I was using hundreds of hyperlinks ]
- [ECSQ 1:33 like this to take notes of ]
- [ECSQ 1:35 everything that I found interesting. ]
- [ECSQ 1:38 It was easy to follow these ]
- [ECSQ 1:40 expressions as hyperlinks. ]
- [ECSQ 1:42 In the beginning I used the standard function ]
- [ECSQ 1:45 'find_file' ]
- [ECSQ 1:48 and then I created a variant of it called ]
- [ECSQ 1:50 'find_fline' ]
- [ECSQ 1:51 that accepted extra arguments. ]
- [ECSQ 1:53 In the beginning it only supported the ]
- [ECSQ 1:55 line number like this that would ]
- [ECSQ 1:56 open this file and go to the line 423 ]
- [ECSQ 1:57 and then I made it accept]
- [ECSQ 2:02 a string to search for ]
- [ECSQ 2:05 so this variant here would open this file ]
- [ECSQ 2:09 and search for the first ]
- [ECSQ 2:10 occurrence of this string here ]
- [ECSQ 2:12 and I also invented shorter hyperlinks]
- [ECSQ 2:16 like these three here in which ]
- [ECSQ 2:19 I do not need to specify the directory ]
- [ECSQ 2:23 like this because this directory is ]
- [ECSQ 2:26 somehow embedded in this code here: 'e'. ]
- [ECSQ 2:29 'e' means the directory with the list ]
- [ECSQ 2:34 files in Emacs. ]
- [ECSQ 2:36 I also wrote a very primitive way ]
- [ECSQ 2:38 to send the current region to a shell. ]
- [ECSQ 2:42 When I typed "Meta-x Eev" ]
- [ECSQ 2:44 which means "emacs-execute-verbosely", ]
- [ECSQ 2:48 this command wrote the region into a ]
- [ECSQ 2:50 certain temporary file; if I went to ]
- [ECSQ 2:54 the shell and I typed 'ee' ]
- [ECSQ 2:56 it would run the commands in this ]
- [ECSQ 2:57 temporary file to execute them. ]
- [ECSQ 3:00 Now these are some technical details that I did not want to discuss now. ]
- [ECSQ 3:04 In a few months using that I had created several ]
- [ECSQ 3:08 other kinds of elisp hyperlinks, all of them also supporting these ]
- [ECSQ 3:13 extra arguments that indicated usually strings to search for ]
- [ECSQ 3:18 but also sometimes I could use that to point to a certain line number. ]
- [ECSQ 3:23 I called these as extra arguments: "pos-spec-lists.",
- [ECSQ 3:27 and here are some examples. These hyperlinks here ]
- [ECSQ 3:32 would open the man page of GNU awk and go to the specific section in it. ]
- [ECSQ 3:39 These hyperlinks open the info manual of "make" and go to ]
- [ECSQ 3:47 certain nodes in this menu and in some cases it also looks first ]
- [ECSQ 3:52 for these strings in these nodes. ]
- [ECSQ 3:57 These are the hyperlinks here; they run certain commands in the shell ]
- [ECSQ 4:02 and then display its output. ]
- [ECSQ 4:07 The Elisp hyperlink set that I was using ]
- [ECSQ 4:11 could be always be put in comments in scripting languages. They were ]
- [ECSQ 4:16 always the sexp at the end of the line—so let me show you an example here. ]
- [ECSQ 4:21 This thing here is a small TCL script, this line is a comment, and this s-expression here is ]
- [ECSQ 4:30 treated by TCL as a comment but in Emacs we can put the cursor here say and then ]
- [ECSQ 4:36 we type "Ctrl-e" to go to the end of the line and then "Ctrl-x Ctrl-e" to ]
- [ECSQ 4:40 execute this and if we execute this we visit the file ]
- [ECSQ 4:45 that is mentioned in the line below. ]
- [ECSQ 4:48 I was doing that so much going to the end of the line and then ]
- [ECSQ 4:53 executing the expression before point that I defined a key that would do that; ]
- [ECSQ 4:59 so the fact that "Meta-e" would work like "Ctrl-e" to go to ]
- [ECSQ 5:02 the end of the line and then "Ctrl-x Ctrl-e" ]
- [ECSQ 5:06 and my name for it was 'eval-sexp-eol' (end of line here). ]
- [ECSQ 5:12 So "Ctl-x Ctl-e", that's the standard key sequence, means ]
- [ECSQ 5:16 'eval-last-sexp' and I named "Meta-e" 'eval-sexp-eol'. ]
- [ECSQ 5:24 At the time all the languages and interpreters that I was using ]
- [ECSQ 5:30 supported at least hyperlinks in comments like this ]
- [ECSQ 5:34 and I also created variants of "Meta-x eev" that could ]
- [ECSQ 5:38 send the region to other interpreters and in a few years using that, ]
- [ECSQ 5:44 I had several megabytes of notes and scripts. ]
- [ECSQ 5:47 I not only had scripts with elisp hyperlinks in comments, ]
- [ECSQ 5:52 but also I had tons of executable notes— ]
- [ECSQ 5:56 I called them "e-scripts"—that were totally free form; ]
- [ECSQ 6:00 some parts of them were blocks of elisp hyperlinks, ]
- [ECSQ 6:04 some other parts were blocks of codes to be sent to shells and to other interpreters, ]
- [ESCQ 6:08 and some other parts with just comments in English or Portuguese or whatever. ]
- [ECSQ 6:15 In 1995 I started to have dial-up internet at home and in 1999 ]
- [ESCQ 6:21 I created a home page and I uploaded all the scripts and notes ]
- [ECSQ 6:25 to my home page because it was good karma and it was a way to become a person ]
- [ECSQ 6:33 who deserves hints and help, instead of just being the idiot that I was ]
- [ECSQ 6:38 considered in my University because I couldn't learn VI. ]
- [ECSQ 6:41 And at that point I was absolutely sure that everybody was using Emacs like that, ]
- [ECSQ 6:48 that Emacs was made to be used with elisp hyperlinks. ]
- [ECSQ 6:56 At one point I sent an email to one of the Emacs mailing lists, in the email ]
- [ECSQ 7:02 I used some of the things that I use at home—some elisp hyperlinks ]
- [ECSQ 7:06 and some other tricks—and I explained how to use everything there, ]
- [ESCQ 7:11 and I apologized for the ugly names. I said: ]
- [ESCQ 7:14 "I don't know what are the standard functions that do that, so I wrote my own ones…" ]
- [ECSQ 7:19 and I apologized for choosing bad names with them. ]
- [ECSQ 7:23 Richard Stallman himself answered and his answer was sort of: ]
- [ECSQ 7:27 "This looks interesting and as far as I know no one else is using Emacs like this. ]
- [ECSQ 7:34 Someone should clean up the code and document it so that ]
- [ECSQ 7:38 we can include it in Emacs; can you do that?" ]
- [ESCQ 7:41 Well, this was amazing, it wasn't believable; I wasn't no one in ]
- [ECSQ 7:46 the university. I was just an idiot; and suddenly God spoke to me ]
- [ECSQ 7:50 and gave me a mission. So I started then to work to ]
- [ECSQ 7:57 make Eev into an official package. I submitted some code ]
- [ECSQ 8:00 and Stallman answered very briefly. He had some objections that I didn't ]
- [ECSQ 8:06 understand very well, they didn't make much sense to me. ]
- [ECSQ 8:10 And in the year 2000 I discovered that he was going to give a talk ]
- [ECSQ 8:14 in a city close to where I live. I live in Rio De Janerio in Brazil, ]
- [ECSQ 8:18 and he was going to give a talk in Campinas that is just 500 kilometers away ]
- [ECSQ 8:23 from Rio De Janerio. I went there, I attended the talk ]
- [ECSQ 8:27 and I chatted with Stallman after the talk. I mentioned ]
- [ECSQ 8:31 things about Eev and he remembered the discussion and the code ]
- [ECSQ 8:36 and he said that "…users should not be forced to see elisp…" ]
- [ECSQ 8:39 and then I was incredibly offended, that was totally absurd ]
- [ECSQ 8:44 and Stallman was so scared so startled by my reaction that he walked away! ]
- [ECSQ 8:51 And the thing is that for me, the ability to write one-liners in Emacs Lisp ]
- [ESCQ 8:56 was the thing that completely dissolved the barrier between users and programmers. ]
- [ECSQ 9:01 It was a kind of a philosopher's stone that could turn users into ]
- [ECSQ 9:06 programmers almost magically. It was a catalyst and it was the distilled essence ]
- [ECSQ 9:13 of free software so it was absurd to say this; it was sick to say that ]
- [ECSQ 9:19 users should not be forced to see elisp. ]
- [ECSQ 9:23 Okay, so let me fast forward many years. ]
- [ECSQ 9:26 In the year 2000 I had "users should not be forced to see elisp" and also ]
- [ECSQ 9:32 "M-x eev" that was one of my ways of saving as executable notes. ]
- [ECSQ 9:39 It was difficult to set up because users that wanted to use it had to change their ]
- [ECSQ 9:45 rcfiles a bit, so very few people were trying Eev and installing it and using it. ]
- [ECSQ 9:54 So let me fast forward many years to 2019. "M-x eev" is obsolete now, I use something ]
- [ECSQ 10:03 called eepitch instead. The setup is now totally trivial, Eev comes with lots of ]
- [ECSQ 10:09 sandboxed tutorials with names like "find-*-intro". I've been using ]
- [ECSQ 10:16 Eev to teach Emacs and free software principles to people who ]
- [ECSQ 10:20 don't know anything about programming or UNIX that they're just kind of ]
- [ECSQ 10:24 fascinated by the idea of programming but they know very little. ]
- [ECSQ 10:28 Now people can learn Eev by memorizing just three keys or just two, ]
- [ECSQ 10:33 because this third one is secondary. M-e is for execute and M-j is for jump ]
- [ECSQ 10:39 M-k runs a kind of "kill this buffer" and sometimes can be used to go back from a hyperlink. ]
- [ECSQ 10:47 In April 10, 2019 Eev finally became an ELPA package, ]
- [ECSQ 10:55 it finally became official in some way. ]
- [ECSQ 10:59 This new Eev has lots of tutorials with names like this: "find-*-intro" ]
- [ECSQ 11:04 and when you install it with the beginner setup, and you start Emacs ]
- [ECSQ 11:10 in a certain way this starts Emacs, turning Eev mode on, and it opens the main tutorial. ]
- [ECSQ 11:21 If you type just "M-j" without a numeric prefix you get a page with this header. ]
- [ECSQ 11:27 So it opens a page with this header and some mysterious things below it. ]
- [ECSQ 11:32 This part of the header explains how to run Eev "M-j" with some of the main numeric prefixes. ]
- [ECSQ 11:42 And so "M-5 M-j" goes to the main tutorial method, ]
- [ECSQ 11:50 "M-2 M-j" goes to a kind of a tutorial that is mainly an index of the main keys of ]
- [ECSQ 11:56 both Eev and Emacs, and we also have these three hyperlinks here. ]
- [ECSQ 12:04 This first one goes to a section of the manual of the main tutorial that explains "M-j", ]
- [ECSQ 12:12 this one goes to the section about the Eev keys in the tutorial about keys, ]
- [ECSQ 12:18 and this one goes to the first section about Emacs keys in this tutorial ]
- [ECSQ 12:25 that works like an index of keys. ]
- [ECSQ 12:29 If people followed this and they can follow hyperlinks that go to the ]
- [ECSQ 12:38 two pages in the Emacs manuals, they usually learned very quickly how to ]
- [ECSQ 12:43 navigate these manuals and how to go back to the tutorials ]
- [ECSQ 12:47 and how to switch between tutorials, other files, the ]
- [ECSQ 12:52 manuals and so on. Okay, let me show you a demo now. ]
- [ECSQ 12:57 I mentioned that "M-x eev" is now obsolete; it has been replaced by ]
- [ECSQ 13:04 something that we run, but by just typing "F8", ]
- [ECSQ 13:08 that always operates on the current line and moves down. ]
- [ECSQ 13:11 Let me show you an example of "executable notes and how to play them back".]
- [ECSQ 13:18 I will only be able to explain how to _record_ these executable notes in the longer video.]
- [ECSQ 13:25 Anyway: when I was recording this video I realized that xpdf was behaving in a very annoying way -]
- [ECSQ 13:34 it was changing the page in moments that I didn't want it to...]
- [ECSQ 13:39 and the problem was that when my finger was at the right side of the touchpad]
- [ECSQ 13:45 and I moved it up or down this would be interpreted as a _mousewheel scroll_,]
- [ECSQ 13:52 that would be interpreted as PageUp or PageDown,]
- [ECSQ 13:57 and I wanted to disable that - I wanted to disable the support for mousewheel scroll in xpdf.]
- [ECSQ 14:01 So I took a look at the man page for xpdf - here -]
- [ECSQ 14:06 I didn't find a simple way to change that by changing a configuration file]
- [ECSQ 14:11 but I found a section that described all the default mouse bindings - here -]
- [ECSQ 14:18 I found a line that seemed to be relevant - this one -]
- [ECSQ 14:21 I created a hyperlink that pointed directly to that line - this one -]
- [ECSQ 14:30 and I also found an explanation for what this function does]
- [ECSQ 14:35 and the explanation says that this function either scrolls up by some pixels]
- [ECSQ 14:41 or it moves to the previous page - which means PageUp.]
- [ECSQ 14:46 So the _quickest_ way to change xpdf - because I was in a hurry -]
- [ECSQ 14:51 was by downloading and recompiling the Debian source with some changes.]
- [ECSQ 14:56 I used this hyperlink here, that uses a template, to generate several links]
- [ECSQ 15:01 and several shell commands for downloading and recompiling a debian source package.]
- [ECSQ 15:08 I copied these lines to my notes with some small changes,]
- [ECSQ 15:15 and this part - here - uses the alternative to M-x eev...]
- [ECSQ 15:20 remember that I said that my old way of sending lines to the shell was by using M-x eev,]
- [ECSQ 15:27 that was very clumsy: it needed several keystrokes, and it was difficult to install]
- [ECSQ 15:34 because we would need to change an rcfile.]
- [ECSQ 15:38 So, the new alternative to it uses just <f8>,]
- [ECSQ 15:43 that behaves in one way in lines that start with a red star - like these ones -]
- [ECSQ 15:49 and in another way in lines that do not start with a red star.]
- [ECSQ 15:54 Let me change the font to a smaller one to show how it works.]
- [ECSQ 16:00 If I type <f8> in these three lines - here -]
- [ECSQ 16:03 this will set up a target buffer - here - running a shell,]
- [ECSQ 16:08 and if I type <f8> in these lines - here - this will send these commands to the shell.]
- [ECSQ 16:14 This command, in particular, it downloads - sorry, it _makes sure_ that I have]
- [ECSQ 16:20 all the Debian packages that I need to be able to compile the source for xpdf,]
- [ECSQ 16:27 and this command - here - downloads the source package for xpdf]
- [ECSQ 16:34 and unpacks it. It takes a few seconds - here.]
- [ECSQ 16:40 I do not want to execute this thing now - this thing would recompile the source.]
- [ECSQ 16:49 So, this hyperlink - here - opens this temporary directory,]
- [ECSQ 16:54 and it turns out that the source package was unpacked in this subdirectory - here -]
- [ECSQ 17:04 so this hyperlink points to the subdirectory,]
- [ECSQ 17:07 and this s-expression - here - defines several shorter hyperlinks with "find-xpdf" in their names]
- [ECSQ 17:17 that operate in this subdirectory - here.]
- [ECSQ 17:22 So, this hyperlink - here - opens that directory,]
- [ECSQ 17:30 this one - here - runs these shell commands in that directory]
- [ECSQ 17:37 to list all the files - remember that I haven't compiled anything yet,]
- [ECSQ 17:41 so all these files belong to the source package,]
- [ECSQ 17:46 and this one is much more interesting - it runs a grep in that directory.]
- [ECSQ 17:51 Remember that I discovered that the name of the mouse event that was bound to]
- [ECSQ 17:57 PageUp, or to the _bad_ PageUp in the bad PageDown,]
- [ECSQ 18:02 was MousePress4 (and MousePress5)...]
- [ECSQ 18:06 So this grep here searches for all the occurrences of MousePress4]
- [ECSQ 18:12 in the source... and it shows that there are only two occurrences,]
- [ECSQ 18:18 one of them in the source for the man page and the other one]
- [ECSQ 18:22 in the rendered version of that source, which is not good...]
- [ECSQ 18:27 Let me change to the bigger font again.]
- [ECSQ 18:31 So I decided to search for the function that was associated to that mouse event -]
- [ECSQ 18:39 this function here - and I found several occurrences of that string,]
- [ECSQ 18:45 and it turned out that _this_ is a relevant occurrence,]
- [ECSQ 18:49 so I created a direct link to that source file,]
- [ECSQ 18:53 and I discovered that if I commented out these lines by hand]
- [ECSQ 19:03 and recompiled everything and installed the new debian binary package]
- [ECSQ 19:09 then I would get an xpdf that does not have the annoying behavior. But...]
- [ECSQ 19:15 That's it.]
- ]
- [br]
- [P [BF My longer presentation:]
- [R http://angg.twu.net/LATEX/2019emacsconf-long.pdf slides] (work in progress!!!)
- ]
- [P The longer presentation [COLOR red will] [IT complement] the
- shorter one, and will be mainly about:
- [BR] 2) how to create elisp hyperlinks and eepitch blocks with very few keystrokes,
- [BR] 3) how to use this to do "task"+"notes" with just a few more
- keystrokes than we would use to do just "task",
- [BR] how to switch between "task" and "notes" without losing focus,
- [BR] other design decisions - like the sexp-based interface - and why
- some people hate them.
- ]
- [br]
- [P [BF On integrating eev and Org]
- [BR] After the conference I started to work on this:
- [TT [STOH (find-org-intro)]]
- [BR] See [R https://orgmode.org/]
- and these threads: [R
- https://lists.gnu.org/archive/html/emacs-orgmode/2013-11/msg00124.html
- 2013-11], [R
- https://lists.gnu.org/archive/html/emacs-orgmode/2019-11/msg00113.html
- 2019-11].
- ]
- [#
- More links:
- (find-es "emacs" "emacsconf-2019")
- Slides for the 10-minute video (work in progress!):
- http://angg.twu.net/LATEX/2019emacsconf.pdf
- Slides for the 20-minute video:
- (I haven't started working on them!)
- ]
- ]
- [#
- # Local Variables:
- # coding: raw-text-unix
- # modes: (fundamental-mode blogme-mode)
- # End:
- #]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement