hi my name is eduardo x I'm this person
here
and the title of this talk is on why
most of
most of the best features in ev look
like five minute hacks
and this is a presentation at the max
conf 2020
happening in november 22 28 and 29 2020
so this is part one of the presentation
and here I'm going to explain some
some ideas that are prerequisites for
understanding the rest of the
presentation
the three main keys of ev are matay meta
k
and mata j and I'm going to start by
explaining metae and meta k
metae is used to follow hyperlink and
technically it is
essentially just a ctrl e to move to the
end of the line and then
a ctrl x control e to execute this the
sext before point at the end of the line
and the thing is that a max comes with
many functions that can be used as sex
hyperlinks
we can consider that they point to
somewhere I'm going to refer to that as
the
target of the hyperlink and if we
execute this
sex paper links would go to that target
for example this one
is a hyperlink that points to a buffer
with demand paid for cat
and usually but not always after
following the hyperlink we can go back
by just skilling the the current buffer
that the hyperlink
created the target of the hyperlink
but this example here is badly behaved
if we execute it it creates a new frame
and to go back to the previous situation
we have to either
click here or type ctrl x50
uh
so here are some examples of sex
hyperlinks using standard max functions
this third one is uh badly behaved in a
different way
if executed we the target is created in
the same window
as we are now but it also shows a lot of
garbage here in the aqua area so
the the current frame becomes a bit
messy
and well one of the first things that I
did when I was creating av
many many years ago was that I created
variants
of all these functions that were better
behaved
and they were better behaved in two
senses the obvious one
was that they they all created the
target
in the same window as before so I could
go back by just typing meta k
which is essentially just killed this
buffer
and well but I also implemented
something extra that
are the post back lists for example for
example these
extra arguments here are a postback list
and this extra arguments specify
position and the target buffer
and in this example this this spot
spec list means starting from the from
the beginning of the buffer
search for the first occurrence of this
string
after that after the beginning of the
buffer and then
search for the first occurrence of this
string
after that
eev also defines some hyperlinks that do
not create new buffers
uh here is the first example if I
execute
this one this one is a hyperlink to the
to the result
of running this show comment date uh
but instead of showing the result in the
new buffer the result is shown
here so if execute to this type link
the result of date the output of data is
shown in the echo area and if executed
again
it shows the result again and the result
changes every second
and if so this is a variant
of fine sh
uh find sh0 is the variant that
just shows the output in the echo area
and find sh shows the output in
a new buffer
and here is an example of a hyperlink
that
calls an external program if execute
this
it it calls google chrome to open a
certain url
here it is let's go back to mx
if execute this happening here
it invokes my favorite pdf viewer which
is
xpdf it makes xpdf
open this pdf page it is pdf
in this page and this other arguments
are ignored let me show how it works
here it is this is a an accept from a
book
so page 3 and the pdf corresponds to
page
113 in the book and
this variant here of the hyperlink above
it opens the pdf in a different way
it runs a program called pdf to text on
this pdf here
and max takes the output of
run epd after text on this pdf here
and displays it in a buffer and now this
postback list
is interpreted in a different way this
thing is interpreted
as a as a number of a page and a max
goes
to page three by counting form feeds in
the
converted version of the pdf and then it
searches for this string
and in this three so let's execute this
to see what happens
here it is I opened the same page as
before
it starts with lecture one so
the other hyperlink searched for this
string and for this string here
uh and this thing here is a hyperlink to
video
and when I executed it's going to open
this video here
at this time this time stamp let's see
one two three one
two three that's the way to do
it
and also some hyperlinks that that I
defined
uh they don't work like like usual
hyperlinks they work more
like browser buttons
these buttons that appear in web pages
in the sense that these buttons usually
don't open a new page they usually
just do something to change the current
page
if I execute this the action of this
function
eek is to uh
it interprets this string as a series of
keys and it
acts as if the user had typed all these
keys so
if executed I get a hello in the next
line
if executed again I get another hello
another hello hello hello etc etc
let me undo this mess oops
and here is another kind of button
that defines a new function if I execute
this sex here at this moment though is
not defined
and if I execute this mx is going to
show me a message saying
uh symbols function cell is not defined
something like this
but if I execute the defund
this the action of this function o here
is to run this which opens a certain
directory
let me go back and here is another
button that defines
several functions at the same time if I
execute
this
note that the the result of executing
this expression
is the name of one of the functions that
it defined
that is this one here and let me explain
the
these examples uh one of the functions
that this thing here defined
is called find or git file where
this or gate in the middle of its name
is
exactly this first argument to code cd
and the action of running find or get
file
on a string like this is that
find or get file takes the string
and prepends this string to it
this one here which is the second
argument to called cd
and then it executes find flying
on the result which is this one
and fine flying is my variant of find
file
that supports both spec lists
and this function here that I'm
referring to as a button it also defines
a function called
find audit node here where the or gate
is the same string
as here and this function opens a node
of of an info manual this one
this text here opens this node in the
org manual
it is equivalent to this text here
so in the passage from this line to this
line we prepended
to the node name the name of the manual
here and find node is my variant
of this standard mx function here
but find node also supports post
backlists
eevee also defines some functions that
define shorter hyperlinks to pdfs and
videos
remember that this thing here is a
shorter hyperlink to a
to a file and this thing here is a
shorter hyperlink to a node and
in an mx menu in an info manual
uh if we run this thing here this code
pdf page
this acts like a button that defines a
certain function
and this string this other sex
here defines another function the first
one defines
the function find funcspivac page and
the second one defines the function find
from text when we run the
file when we run findfoxpivotpage it
opens
this pdf here the name is
quite long uh
this example opens this pdf at page 8
and searches for the string contents
oops sorry in this case
in this case it just ignores this string
here it only considers
the number of the page let's try
ah we got
here it is uh the contents of a book
that is freely
available uh here is another page of the
book
and if we execute the this happening
here
find funk's pivot text it converts the
pdf to text
and it searches for the page eight
in it and then for the string this
string here in page eight
it takes a few seconds
here it is so this is the
ascii version of this contents page
here uh note that this block here
is a kind of an index to that book
uh I have the full index somewhere but
it's very long so I just copied a few
lines here
uh so this is a link to the to set
section one chapter one this is the
section 1.1
section 1.1.1 and so on
and here is a link to the index
and here is a part of my index
of positions in the video that we just
saw
that I think that are especially
relevant
uh so this I believe
hyperlink is a kind of a button that
defines this function here
find punch and punch into the video
uh
and we can also use this for video
tutorials for example
this is a very good tutorial on on magic
if we execute this
then these functions are going to be
defined and these functions open
this tutorial on magic
these are some of the positions in the
tutorial that I found especially
especially relevant this is a very dense
tutorial I had to take notes of
everything
and I had to watch everything things
several times
and for example this is a link to the
position in the tutorial that explains
uh how in space
space max magic magic
interprets space gs magic status
let's see beginners space gs to initiate
magic's git status
uh you can also do that's it
and here are some examples that I
took from somewhere else the video
tutorials from
ralph koenig about org mode
now let me show how the functions that
define this router hyperlinks are
implemented
the standard ways in max to define
functions that define
other functions would be with macros uh
let's see an example this is a standard
function that
defines new functions
[Music]
and if we execute it one of the res
its result is the last function that it
defined which is
e-grief which is here
it's implemented as a macro we can
look at the result of macro expand which
is going to show
show us the result of of this of the
expansion of this
instead of expanding and executing it
just
expands and shows us the result
here the result is a bit messy is too
big for
humans to understand but we can run
this or this text here that takes that
that result and pretty prints it
so this is the pretty printed version of
uh this macro here
we can see that it defines
several functions here
for example this one
and this just as a curiosity is a link
to
the definition of cld struct
and note that the code is huge uh
well it's very well commented but it's
it has
lots of special cases it has uh
it supports lots of constructions and so
it's huge and
it's very difficult to understand I mean
I found it very difficult to understand
and here's a link to document the
documentation of cld struct
here in the manual for
cl which is a kind of support for some
features of common lisp in the max
so let's compare this standard way of
defining
functions that define new functions
which is with macros
with this I'm going to use a slogan
repeatedly the slogan is I am a very bad
programmer
I'm a very bad programmer so when I was
trying to create functions that would
define new functions
I found it easier to generally generate
this code as text
and then run read and eval in it
the code cd that we saw in the previous
section
we can see the the code that it produces
by
making a copy of this line and
prepending this string here to the name
of the function
so instead of running code cd we run
find code cd
and it creates a new temporary buffer
with the code that
code cd would execute
so it's a series of the fonts and a few
set cues and so on
and this thing is implemented mostly as
a template
uh the lola the
there's an inner function called ee
called cd base that receives just
these two arguments and it says
essentially just runs the function
e template zero on the string here and
the things between curly braces are
substituted by the values
of these arguments here
there's one part of the tutorial here
that explains all these things
uh except for the rationale for some
design decisions
and those design decisions are one of
the many motivations for this talk but
um
we are I'm only going to explain these
things in detail at the end
which is kind of so on
in the beginning I said that the three
main keys of av
are meta e meta k and meta j
let's see now what met what meta j does
uh but I need to start with some
motivation uh the motivation is that we
can define commands with very short
names and actually I became kind of
addicted to that
this is an example of the fund that
defines a comment with a very short name
its name is just one letter e
and I can invoke you invoke it with meta
x
e if I type meta xp
now it opens a latex file that I'm
working on
[Music]
and I create most of my latex files
using
template template-based functions like
the the
implementation of code cd above and
this template-based functions create
files with extension.tag
that start with a series of the fonts
and comments for example
let's look at this example here if I
execute find the attack links with this
argument
uh it's going it's going to do several
things for creating a
file called slash tmp slash forward
attack
and the header of that file is going to
be this
which starts with two and with three
the fonts with functions with very short
names and comments
let's compare with the situation here
in my file 2020 favorite conventions.tag
I have this header here in which I
define six functions with very short
names
and in this case here that is even
explained in the tutorial
this we have mnemonics for
these short names here and c is compile
d is display I mean display the pdf
and e is added in the sense of make a
max
visit that file
okay now I can explain what is meta j
itself
uh we just saw comments with very short
names
and the idea is behind meta j is that we
can define comments with very short
numbers
let me explain this uh
the short explanation for what meta j
does
is that it jumps to set certain
predefined places
in particular a meta j without a numeric
argument
takes us to a buffer with with the basic
help
and a list of the current age of targets
and this is something that is a bit
simpler to understand
if we type meta five meta j
then meta j runs this sex
here that is associated to
the argument five I say that the target
for the argument five is this one
and if the argument is true then the
target associated to the to the true
is this sex here that opens
well this one opens the main tutorial vv
and this one
opens another tutorial
this is a link to one of the tutorials
of ev to the part that explains meta j
I've copied the the main part of the
text here
the header the header that meta j shows
let me show it very quickly here
here is their header and here is their
rest
the header is very beginner friendly and
if you're a beginner
who only knows how to use meta e to
execute and met
this should be okay and meta k to go
back
then you can and should use that header
I mean this header here
as your main starting point and every
time that you feel lost
you can type meta j and to go back to
that header
and you can use its links to navigate to
the documentation
for max nav let me explain that
uh this header here has several ellis
hyperlinks
one here one here
one here one here and so on
uh these ones are links to the
to the intros which are the tutorials
find if you quick enter in the main
tutorial and find ev
keys intro is a kind of tutorial that is
an index of
the main keys
and after that we have an explanation of
what some
numeric prefixes do so if we type
met one method j the effect of that is
exactly the same as executing this and
we can execute this
with meta e also
meta tube meta j runs this sex and
I can also execute it with meta e
here it is it's this uh
intro this uh
sandbox tutorial and
here is another sandbox tutorial
let me go back and then the
documentation says that
that header the header that is beginner
friendly
is followed by a section that is very
beginner unfriendly
that contains a series of the fonts like
these ones
here the last line of the header is this
comment here
and then we have several defense like
this
let me explain how these things work
technically what happens when we type
meta j without any arguments is that it
runs
eu jump with argument neil and then
this runs 5 e jumps
when I run meta j with a numeric
argument for example
with argument 5 it runs a jump
5 and e jump five
uh concatenates this five one
to make a name of a function this
function here
and it executes this function e jump
five
you jump uh dash five
and eu jump dash five is
executes find ev equity intro
if I execute just meta j
the section that shows the current age
on targets
has a line for e job five this is that
is exactly the
thing that I was explaining before
so we can use meta j to navigate the
tutorials and we can copy the links
sorry we can copy links to the to
tutorials to our notes
oh sorry this has some typos
for example if I execute this
I go to a section of this tutorial here
that explains the main keys of ev
and these things are hyperlinks I can
mark a hyperlink like this it is just
plain text and I
can copy it to my notes and the idea is
that every time
every time that I find something that is
interesting I can create a hyperlink to
it
and I can put these links in my notes so
I can navigate back
to all the interesting positions very
quickly
okay next feature if we type meta
uppercase j
uh then
this this is a function that transforms
the current line in a certain way
let me give an example let me isolate
this and let me create
duplicate this line to to make clear
what happens
if I type meta uppercase j here
this line here becomes the fund for a
jump
6 and the target of this e-jump
is exactly this sex here
let me undo this mess
and if the first word in the line is not
a number for example
here let me do the same thing
duplicate the line and type meta
uppercase j
then mat uppercase j converts that to a
defund that defines
a function with a very short name
and this function with a very short name
opens this file here in the directory
with the copy of the the git repository
for org mode
let me undo the mass again
oops
that's it
meta uppercase j is a
particular case of of something that
I use a lot in eevee I have if he has
lots of
comments that sorry key sequences
that are like meta uppercase letter and
[Music]
almost all of them operate on the
current line and transform the current
line in certain way
for example this is a file name
and if I type meta uppercase f here
it becomes a link to that file this is
the name of a month page
and if I type meta uppercase m here
it converts that to the link to a month
page and this is a shell command
and if I type meta uppercase s here
it converts that to a link to a
to find fan shell
and until a few years ago these
functions
with matter uppercase letter were half
of my main ways of creating sex
hyperlinks
with few key strokes in the beginning of
course I had to create my
sex pipelines by typing each character
but uh after some time and decided that
I needed something more efficient
so this is end of part one of the two of
the
presentation
so this is part two of the presentation
and the main theme
here is the standard describe key
function that comes with the max
and my variant of it the thing is that
the standard described key in max
is user friendly but it is hacker
unfriendly well I felt so
and when I tried to complement it by by
writing a hacker friendly version of it
that produced the sex hyperlinks that I
needed
I got something that I found really
lovely and
several of the main designs design
decisions of eev can be seen there
but when I showed my variants to other
people they hated it
they felt that it was totally against
their notions of
user friendliness
okay so let's see the standard describe
key if I run
this hyperlink here I get
this the result of running the scribe
key on the key down
and this is a big buffer with some
things in italics
and some hyperlinks here these
hyperlinks are standard in the sense
that
the targets are not visible and they are
implemented using
buttons in a max lisp this section of
the
mx list manual describes how buttons
work
and the the source code is
quite difficult I mean when I was
starting to
to try to decipher this when I was a
beginner
using max 19.34 I felt that this
described key was
very difficult to understand uh
and I felt that the the designers the
the people who wrote it were sacrificing
too much of the
hacker friendliness that I was expecting
from it to make it beginner friendly
let me explain what are the the problems
with the standard
the describe key if we think that
hyperlinks are things like this
with the target and the text then in the
button hyperlinks of describe key
this three bad things happen first
it is hard to extract the target from
the hyperlink second it is hard to
recreate
a list of code that would go to that
target
and third it is hard to copy the full
hyperlink including the targets to other
buffers
I only knew how to copy the text
when I was trying to decipher what
described key was doing
I created lots of hyperlinks like this
to
inspect the text properties and things
like that
for example in the description of the
key down
here we have a button that points to
simple dotel
the text of that button is simple.l this
hyperlinks goes to the
to the middle of this button hyperlink
here
uh this hyperlink here
goes to the middle of the button of this
button hyperlink
and then inspects its text properties
and then goes to
this section here of the description
so this is a high level description of
the text properties
I mean the text properties that make it
a button and this is a
lower level description of the these
text properties
and the button that points to
forward line sorry the the button that
whose
text is forward line this one is
slightly different
this hyperlink here goes to the middle
of that button
and this hyperlink goes to the mid to
the middle of that button
inspects its text properties and go to
the section
of this button of this help
uh buffer here that describe the the
button
and the lower level view of the text
properties
so I started to with things like this
to understand what these buttons were
doing and I was able to figure out how
these things are
implemented and describe key and then
similar help functions in max
and I discovered that one of the main
lower level functions that a max used
for this
is a function called find function no
select
if I run find function no select on next
line
[Music]
it returns a pair
a cons made of a buffer and a position
so I created functions that would that
would
uh follow this that would open that
buffer
in that position and then this is a
postback list
so we could go to these positions and
then search for this string and another
string and another string and so on
so this goes to the definition of find a
function
and then to a to a string
after it and I use these things to
implement my own
functions that pointed to the same the
same targets
as the button hyperlinks and describe
key
again let me show the comparison this is
the standard describe key
here and this is my variant
uh it creates a buffer with links
with the list hyperlinks about this key
we get this so each one of these
functions is either a blank line
or a or an ellipse hyperlink
here is a slight variant of the of the
function
find e key links above in this variant
the argument is a string that has to be
processed by
read cbd macro to convert it to the
lower level format
and note that these functions here that
I wrote
they display temporary buffers with no
help at all
uh to be honest there's a link to a
tutorial here but
this is a recent edition so let's ignore
this
uh they they display temporary buffers
with no help at all just lots of
hyperlinks
and these hyperlinks can be they are
very hacker friendly in the sense that
they can be followed with
metae they can be copied to other
buffers because they are plain text
because they are just sex
and they can be inspected in the sense
that
for example here
we have a hyperlink to a function that
we
it may be difficult to figure out what
this function does
but we can go to that position and then
type ctrl h f to see the descript
description of this function
and here is a hyperlink to
the does that
[Music]
in my syntax say
and this list of hyperlinks were
generated by
this code here that just just uh
used a back quote to to generate
lists of sex
and I I felt that this function here
uh that just generated this list was
very easy to understand
and to modify so this was hacker
friendly in the way that I wanted
and so I started using this
and this idea of using buffers with sex
fiber links and no help violated
all the notions of user friendliness
that I knew so I was
exploring some something new at that
time and this is the end of part two
part three of this presentation is uh
about the killer features of ev or why
everybody should use av or at least have
eev installed even if they think the tv
is too weird
so this is a very quick listing eevee
has lease hyperlinks which are super
nice
it comes with lots of tutorials the main
one here
explains all the main features
uh there's also a tutorial with that's
an index of
all the other tutorials here
many many many tutorials uh if we forget
everything we can just type meta j
and remember that this this part here is
beginner friendly and the rest is
beginner
unfriendly
there's a tutorial on max list here
it mainly explains how to understand
a lisp code which is much easier than
it's much easier to understand the lisp
code and
then to understand how to program in a
lisp and
most people are only going to need this
uh ev is very easy to install it's in
helper so we just need to do
this thing here and it's very
non-invasive
uh years ago several years ago it was a
very invasive package but then I changed
everything
now uh if we toggle ev mode on and off
what's going to happen is just that the
evk map key map becomes activated or
deactivated
and when we install the evita
I mean when we require the only things
that
happens globally distance here
several functions and variables become
defined all of them have
standard prefixes except for one
three characters are changed in the
standard display table
to make them appear as colored glyphs
the red star and two and the open
double angle brackets and the closed
double angle brackets
and two environment variables are set
and this is a trivial technicality
we just run a def advice
around one function that that is used by
man
justice also
eevee has a very high discoverability
factor
and there's a way to create a very easy
way to create a hyperlink to here
uh I do not have time to show this now
but for example if I'm
here in a tutorial and I think that that
this
section is something interesting and I
want to create a hyperlink to it
I just have to type a certain key
sequence here
and here I got a hyperlink that I can
copy to my notes and this hyperlink goes
to that section
[Music]
we have hyperlinks that point to
specific positions in
pdf documents and nvidia files here
this one opens a pdf and displays it
this one
opens a pdf and converts it to text
and this one opens the video in a
certain position
and we also have a way to control
shell-like programs
uh in my presentation of the last year I
spent one third of the presentation
explaining this and I think that I gave
a very good demonstration there
the demonstration is here
we can go to the web page and go to
this section of the web page
and start by this point
and here we have an explanation and so
on whatever
and I've already mentioned this before
uh
eevee comes with a very nice elise
tutorial
so that's it this is the end of part
three
so this is the last part of my
presentation and it's about the title of
the
the presentation I called the
presentation why
most of the best features in eevee look
like
like five minute hacks uh I've already
run off
out of time so I have to to skip this
first
part here in which I describe how I
was exposed to several different notions
of user friendliness
and how the one that really blew my mind
was the one in
in a certain uh fought environment
uh and let me make the long long story
very very short
uh in all this process I switched from
from
the belief that the user was always
someone else
someone external and that that I always
had to write my programs for
this external user I switched
from from that to the belief that I am
the user
and I can play with the interface that I
want I can
write programs which that
that only I am going to understand I can
experiment with hundreds of interfaces
and then select the best ones
and document them and then share them
with other people
who are also experimenting with
interfaces in their
own ways and so eevee has
lots of things that are user-friendly in
these unusual ways that I've explained
before
and uh and if we disconsider that this
notion of user friendliness is valid
then this implement these things that av
implement they are
user friendly and hacker friendly at the
same time
and let me show one example this is one
this is
one that really took me one only five
minutes to implement
uh at one point a few months ago I
discovered
that sasha chewer's weekly posts about
the max news
had uh were also being posted to a
mailing list that is stored at
lists.we know.org and it's called max
dungeons
uh and I just and I found a way to
create
the links to to the posts in both places
but I had to use a template for that so
what we are seeing here now
is a template with the the default
values so this means that we have not uh
set the year correctly we have not set
the month correctly
or the day correctly but if we run this
text
here uh let me do something else before
if we run this text here
which we change some of these
entries in the
in the template and we get these links
here
they all work for example this one opens
uh the blog post in in session sasha
chewers
site and this one
opens it in the mailing list
and sometimes I want the org source of
that and the easiest way to get the word
source is to
look at this link here that has an
attachment
and if I take this
link here and I take this
stem that points to to the attachment
and I put it here and I generate this
page again
with all this data then I get a script
here
that downloads let me switch to a
smaller font
it downloads this attachment
and it renames that attachment to
something
dot slash nx news sorry some things
uh iphone mx news hyphen
something mxnews.org here
the file is already here already with
the right name
so I can open it with just this
hyperlink
let me go to the big font again
[Music]
and now I have the work source for that
hyperlink
sorry for that blog post
and so this one line thing
here is in a sense
a a to to this blog post in all its
formats
uh if I execute this I get links to
to all the places where it is posted
and I get a hype and I get a script to
download the local copy
of the org source of it and that's it
well I'm already out of time so let me
finish here
thanks bye