Hi, my name is Eduard Oxt, I'm the author of an MX package called EEV, and the name
of this presentation is Bidirectional Links in EEV.
Let me present things in a weird order, starting by the new feature and then I'm going to
explain the whole context.
One of the main features that we are going to see here is this function here, MetaX Cla,
and Cla is a mnemonic for Q-link to anchor.
Let me explain, let me demonstrate how it works.
This thing here with the green angle brackets is an anchor, this thing between the green
angle brackets is a tag of an anchor, and if I type MetaX Cla here, it highlights this
tag for a second and it says copied to the Q-link blah blah blah, and this thing here
is a link.
I can insert the link here, I can insert the link in my notes, and if I execute this link,
this link here, it goes to this anchor in this file.
If you have a recent version of EEV installed, then trying this feature should be very easy.
You just need to open this file here in which everything is defined, and then go to this
section at the beginning of the file, and then run the three blocks of tests that are
there.
This block corresponds roughly to what we have just done.
This other block is slightly different because it shows some variants of Cla.
One is with F instead of an A here.
Let me show how it works.
If we type MetaX eKlf or just MetaX klf, we get a link to this file that does not point
to an anchor, and if we type MetaX klt, we get another kind of link that is linked to
an anchor in the same file.
The third block is more interesting because it lets people create links to files that
are elsewhere and that do not have anchors pointing to them.
Let me execute this.
This will run this extra here and display the target at the window at the right.
This is one of the source files of MX.
Let's imagine that I want to create a link to this string here.
Then I can type MetaX klfs, and this will create a link to a file in a string in that
file.
If I type enter here, it says copy to the kil ring, and this is a link to this file
here and to the first occurrence of this string in this file.
Notice this work inside.
When I was trying to write the documentation of this, I tried to write a summary of how
the algorithm works, and I failed, and I tried again, and I failed again several times, and
then I gave up and I decided to write an intro, a tutorial, this one, that explains everything
but lots of details and lots of sections with try it that have examples that you can run
to understand things, to examine how some functions work, how the data structures work,
and so on.
The problem is that sometimes we have several hyperlinks that point to the same file.
Let me give an example.
In the configuration in which I am now, in this file here, the old way of generating
hyperlinks to this file with find here links, which generate a temporary buffer like this,
and then I would have to choose which one of these hyperlinks I find best, which one
I prefer, and then copy it to my notes.
So instead of choosing a hyperlink, this thing here shows all the options.
And in the new way, in MetaX and Friends, there's an algorithm that chooses the best
short hyperlink by itself.
And this algorithm is a bit hard to explain.
Let me demonstrate it here.
Again, we have all these options here of hyperlinks to this file, and if I type MetaX klf, it
chooses one of them.
And of course, I can copy it to my notes, it's going to work, it's going to point to
here and so on.
Well, the title of this presentation was Bidirectional Links with EEV.
Let me show what I mean by bidirectional hyperlinks and how we can use this thing to create bidirectional
hyperlinks very quickly.
I will have to use a smaller font.
Let me open these two files here.
This one at the left is a program in Haskell, and this one is a file with my notes on Haskell.
How do I create a link to this file in Haskell to put it in this file here?
I can put the cursor here in any position after this anchor here and type MetaX klf.
It copies this link here to the kill ring, and then I can go here and either insert it
with Ctrl Y, yank, or insert it with MetaX klf that adds a comment prefix here.
So this is a way to create a link from here to there in which every comment has to be
given explicitly.
But I also implemented a way to create the two links at the same time.
I don't use it much.
It is mostly for demos because it is impressive.
I wanted to show that in this presentation.
Anyway, let me show it here.
Note that in this file here the point is here, in this file the point is here.
My trick is going to create a link to this anchor and put it in this file, and it is
going to create a link to this anchor and put it in this file.
So here it goes, MetaX klhu, ta-da!
It highlighted the two anchors for a second and then it created these things here and
inserted them with the right comment prefixes.
And that's it.
So that's it.
If you found these things interesting, just install a recent version of VEV and run the
tutorial either with this thing here, MetaX client client intro, or by running this exp,
or open this file here in the iv directory and follow the tutorials.
And most things there are well documented, but the thing that I don't use much and that
is mostly for demos, which is the thing that creates bidirectional hyperlinks, is not yet
well documented, but the rest is.
So that's it.
Have fun.