help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

You learn something every day...


From: Skip Montanaro
Subject: You learn something every day...
Date: Thu, 12 Apr 2018 14:26:05 -0500

I've been using some version of Emacs since 1981, when I installed
Gosling Emacs from a DECUS tape on VMS. (I had gotten used to a "full
screen" editor on the PR1ME computers we used at school, and
complained about what was effectively an ed(1)-style editor on VMS.
Not sure EDT was available yet.) So though I long ago stopped messing
with Emacs at the Lisp level other than to define some keys in my init
file, I have used many versions of Emacs, plumbed the depths of its
user interface and have tried any number of packages.

Still, there is always something new under the sun. Today I learned
about M-n and M-p in the minibuffer. I pass this along in case there
are any other Emacs users as apparently oblivious as I've been all
these years.

For the past couple days, I have been monitoring the logfile from an
uncooperative server process using occur to match and highlight
interesting bits. A simple keyboard macro looks like this:

* revisit the log file
* return to the top
* execute occur, accepting the default pattern
* scroll the *Occur* buffer to the end
* return point to the log file

This all goes swimmingly, unless I need to tweak the pattern or use
occur for some other task. The pattern grows and shrinks over time,
but basically looks like this:

subpat1 \| subpat2 \| ... \| subpatN

where N is generally five or less and the various subpatterns aren't
too complex, often just simple strings.

It was getting to be a royal PITA to have to retype the pattern from
scratch any time I wanted to alter it. As I went looking for how to
load the last regular expression into the minibuffer to edit it, I
stumbled on the Minibuf menu and its M-n and M-p bindings. I almost
*never* use the graphical menu (remember how long I've been using
Emacs, old habits die hard - I used to suppress it altogether as a
waste of screen space). I don't know what possessed me to glance at
the menu bar at just the right time, but that glance saved me a trip
down a deep, dark rabbit hole.

M-p-is-your-friend-ly, y'rs,

Skip

Yo, Adam...



reply via email to

[Prev in Thread] Current Thread [Next in Thread]