[Top][All Lists]

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

Re: Assignment of misc packages for emacs

From: Kim F. Storm
Subject: Re: Assignment of misc packages for emacs
Date: 06 May 2002 00:02:18 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.50

I've CC:ed this to emacs-devel [I've offered a number of packages for
inclusion with emacs], as there are some requests for comments from
the other developers.

Richard Stallman <address@hidden> writes:

>     - - struct.el [medium]
>     which is a structed binary data packing/unpacking package, primarily
>     for usage with the networking part of emacs.  I wrote this while
>     enhancing the networking part of emacs to support async connections
>     and datagrams.  I don't know whether this is covered by my general
>     assignment, or you need separate papers?
>     - - kmacro.el [medium]
>     which is a more user friendly front-end to emacs' keyboard macro
>     feature with added features.
> Could you tell me more?  This might be interesting.

It basically works by placing all keyboard macro commands on two
function keys -- for easy access.  Before doing this, I rarely used
keyboard macros, but after moving them to function keys, I use them
all the time:

To start recording a keyboard macro, use F5  [like C-x (].
To end a keyboard macro, use F6  [like C-x )].

.. this is the first simplification -- using single keys to start and
end keyboard macros makes it much easier to use them also for minor

To call the last keyboard macro, use F6  [like C-x e].

.. this is the second simplification -- to execute the macro
immediately (I often do this if the same change applies to a number of
successive lines), just press the same key which ended the last
keyboard macro.  And to repeat it again, press F6 again.  etc.  [works
with numeric prefix arg as well].

Now, while defining the keyboard macro, F5 will insert 0.  The first
time the macro is called, it will insert a 1 instead of the 0; a 2 is
inserts on the second call, etc.

The initial value to be inserted can be set via a numeric prefix
argument to F5 (when starting the keyboard macro), and each use of F5
inside the keyboard macro will increase the internal counter by 1 - or
by the numeric prefix argument to F5.

The macro counter can also be set directly with C-F1.

The default format for the inserted number is %d, but can
be redefined using S-F6.

The previous keyboard macro is available on S-F6, i.e. you can
define two keyboard macros and execute the latest with F6 and the
other with S-F6.

The last keyboard macro can be edited with M-F6  [C-x C-k].

Finally, kmacro maintains a keymacro ring which can be rotated
(and displayed) using C-F6.

>     - - ido.el [large]
>     which is a package similar to iswitchb.el, but allowing both
>     buffer switching and opening of files with a minimum of keystrokes.
> I think we have plenty of things like this.

Yes, but ido.el is still unique in the sense that it does for
opening files what iswitchb does for switching buffers [but it is
implemented as a superset of iswitchb to unify switching buffers
and files].

I get very positive feedback from the users of ido!!!

I know that some of the other people on emacs-devel use ido --
please speak up if you find it useful.

>     - - match.el [large]
>     which is a menu-based alternative to the grep package with more
>     features and a simpler interface
> Could you tell me more?

The first visible difference between M-x grep and M-x match is the
way it is called.

Where M-x grep prompts for a command line, M-x match prompts for a
search pattern (offering the current word from the selected buffer as
default), a file pattern (with predefined abbreviations, e.g. `ch'
searches all .c and .h files), and a base directory where to start the
recursive search.

Match will then recurse through all subdirectories of the specified
directory, grepping for the specified search pattern in the specified

As a result, it presents a buffer with all the matching lines [like
M-x grep does], but it has a command set which is specifically
tailored to navigating through the matches, e.g.

SPC, n - shows the next match in the other window (but keeps the match
buffer active).  It temporarily highlights the matching text in the
other window.

b - shows the previous match (i.e. n/b goes forward/backward through
the matches).

TAB - skips over remaining matches in the current file, and shows the
first match in the next file in the list of matches.

left / right - scroll other window backward/forward (this is a
convenient way to look at the context of the current match).

/ <string> - replaces the current match with <string>

 - replaces the current match with the last string defined by /

        ... i.e. using n n . n n n . n n . n  etc  is a simple
        way to replace selected matches in multiple files.

RET - jump to the current match in the other window (so it can be edited).

H-n / H-b - jump to next/previous match (can be used in any buffer).

S-H-n - jump to the match menu buffer.

The mouse can also be used to navigate using the match menu buffer.

>     - - find-char.el [small]
>     which provides find char forward and backward commands similar
>     to vi's f and b commands.
> It can't hurt to have these functions available in Emacs for those
> who prefer them.
>     - - begendol.el [small]
>     which provides alternatives to the interactive beginning-of-line and
>     end-of-line with added functionality (e.g. repeating C-a will jump
>     between the left margin and the indentation).
> This would be interesting if and only if we would want to make it the
> default.  How about asking people on emacs-devel whether they like
> this change?

Ok, then let me explain more of the functionality:

Enhanced C-a:

The first C-a always jumps to the beginning of the line (even if the cursor is
already there -- this is so keyboard macros can consistenly depend on
where C-a moves).

The second C-a jumps over any indentation on the current line.

Subsequent C-a's will jump between the beginning of the line and the 

.. I find this very convenient.

Enhanced C-e:

The first C-e always jumps to the end of the line (for the same reason
as explained above).

Subsequent C-e's moves one character backwards on the line until the
cursor reaches the beginning of the line (in which case it jumps to
the end of the line).

If I regret the multiple C-e's I use C-a C-e to go to the end of the
line (but C-u C-e will also work -- or any other movement).

... I often find I need to go to a character near the end of the 
line (e.g. before a `)' or a `.', and I find it very convenient to
simply do a few C-e C-e C-e's to get there.

What do other people think?

>     - - minimenu.el [small]
>     which provides simple menu prompting in the minibuffer
> Could you tell me more?

It makes it easy for other packages to prompt with something like

EMACS file: c)ommon u)ser i)nit p)re .)emacs cus(t)om l)isp e(x)ec s)rc

in the minibuffer and then take different actions depending on whether
the user enters c, u, i, p, ., t, l, x, or s.

(This example is a quick emacs navigation function I have bound to C-x C-g
which I use all the time, e.g.

        C-x C-g .

opens my .emacs file.

>     - - colordif.el [small]
>     which adds color to (vc) diff output
> Do we want to install this unconditionally in diff.el?
> If so, it is good.

It is fully customizable, so I don't see why not.

>     - - copy-above.el [small]
>     which allows easy copying of chars, words, and to end of line 
>     from the line above the current line.
> It can't hurt to have these functions available in Emacs for those
> who prefer them.

Kim F. Storm <address@hidden> http://www.cua.dk

reply via email to

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