[Arcana] yank-pop navigation

Roland McGrath roland at frob.com
Fri Dec 19 00:42:51 CST 2008

> I could just respond with "Patches welcome."  That would be classic, and
> well-understood by all :-).

But that would be ducking my obvious baiting to get you to instead
respond with ...

> But I'm curious: what is the tao of M-y beyond, you know, just using
> M-y, which I do all the time?  Give me some concrete examples -- maybe I
> can grok what yank-match is doing wrong and fix it.

But do you really use it?  Or do you just hit M-y without understanding
the meaning of your actions?

It's that M-y works by changing the value of kill-ring-yank-pointer.
(That's what makes the kill ring a ring, really.  The average person
only ever comes round the other side by enough successive steps of M-y,
after all.)

The actual order of the kill-ring is the true record of the sequence of
kills, and is inviolate.  yank-match-modify-kill-ring is fundamentally
wrong because it's so accurately named.

By hitting C-y, you enter the yanking state of mind, an ancient and holy
discipline inherited from our forebears.  This is similar to the more
modern minibuffer history state of mind, achieved in various ways such
as hitting M-x M-p.

The yanking state of mind is a bit like the weak nuclear force in
comparison to kill ring sensation being like the strong nuclear force.
(Even noninitiates are familiar with kill ring sensation, though they
may have been involved in one of those sad cults where it's known as
"clipboard anxiety".  As we all know, this is the physical sensation
produced by the inner knowledge that part of one's brain is momentarily
absent from any buffer that auto-saves, and present only on the kill
ring.  Healthy fingers have an autonomous reaction to kill ring
sensation that moves toward C-y in the absence of firm direction from
the higher nervous system.)  But I digress.

In the yanking state of mind, one becomes preternaturally aware of one's
position along another axis of which we are often unconscious, and able
to move to and fro along this axis at will.  It's like when you suddenly
transcend normal space and are able to wiggle to the left hand side
through the fourth dimension.  But in Emacs it's easier explain to others.

As our ancestors lived, one could move along this axis but not see down it.
So M-y, M-y, M-- M-5 M-y, M-2 M-y, guessing how to hop about and seeing
where you wind up.  (It's a habit that gels in the motor nerves much
like C-u C-u C-n, C-u C-n C-u C-n, C-n C-n dances between the fingers
and eyes to get to what you had no idea to start with was 26 lines down.)

When I was still young yet already well-reared in the old ways and those
nerve pathways laid down, there came browse-kill-ring (b-k-ring.el).
This is like getting a full snapshot map on a large sheaf of paper,
showing every point along this axis and the local conditions in detail.
It has everything there is to know, but it's wholly unstructured and you
must plot your positions on the map from first principles.  It jars you
completely out of your innate sense of your own position, pretty much
killing the yanking state of mind until you actually go plodding through
the pop-up buffer and pull the rip cord.

yank-match is just, well, naive.  Though entirely well-meaning, it
tramples on our ancient traditions through sheer ignorance.

Then comes kill-ring-search.  It is sort of isearchy, which is the kind
of hot hot miscegenation whose offspring eventually winds up amazingly
sexy.  It almost feels like it knows what I want in my deepest secret
heart.  But it makes me nervous, and my traditionalist tendencies just
can't quite get used to its new dance steps.  It could possibly make me
forget about the still place in my soul that can feel my way along the
kill ring in the yanking state of mind, and so I'd only revel in its
wild new fashions and bright colors.  But that would be the death of the
sacred ways we learned and were entrusted with when we were young.  I
yearn to believe that I can honor the ancient and true in respect of my
own history, and also drink lustily of the luscious bounty of youth.

As I alluded to earlier, modern science has taught us to see into
infinite new dimensions in the minibuffer history state of mind.
This is of course an advance of immeasurable value, but it does lack
a certain subtlety and romance.  We enter this state always with a
material aid (the minibuffer) that we can see and operate with our
pedestrian physiology in the common spatial dimesions.  One can
experience one's location and travel along a minibuffer history axis
only momentarily while using this device, and upon resuming normal
corporeal experience, one has snapped back to the common plane.  The
yanking state of mind, by contrast, stays with us with a deep echo
that affect our lives directly as we go about mundane activities
after shifting our position along the yanking axis.  This resonance
fills us and surrounds us, it directs our destiny, and it's killed
only by--a kill.

All I ask is that your science should open my eyes but not sully my soul.
Is that concrete enough for you to grok, young master?


More information about the Arcana mailing list