all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Robert J. Chassell" <bob@rattlesnake.com>
Subject: Re: Emacs manual desribes keyboard macros in the wrong section.
Date: Fri, 28 Feb 2003 13:36:12 +0000 (UTC)	[thread overview]
Message-ID: <m18okgO-000IeIC@localhost> (raw)
In-Reply-To: 5xisv47eu2.fsf@kfs2.cua.dk

   >     I'm currently working on documenting the enhanced kmacro commands
   >     (ready in 1-2 weeks), ...

On a related issue:

A decade or more ago, Emacs possessed a command that would convert a
keyboard macro to an Emacs Lisp program starting with `defun'.  Does
this program still exist?  If so what is it called?  I cannot find it.

Here is what I mean.  As the manual says,

       C-x ( C-a C-<SPC> C-n M-w C-x b f o o <RET> C-y C-x b <RET> C-x )

    defines a macro that copies the current line into the buffer
    `foo', then returns to the original buffer.

The old function, which may have been part of an early version of
Emacs Calc, would have produced a `defun' like this
(the optional doc string was in the wrong place):

    (defun sample-kmacro () ""
      (interactive)
      (beginning-of-line)
      (set-mark-command)
      (next-line)
      (kill-ring-save)
      (switch-to-buffer "foo")
      (yank)
      (switch-to-buffer (other-buffer)))
                                        
Does the old function still exist?  I would like to see it.

I cannot find the old function, and have always thought it interesting
as well as useful both in practice and as a teaching tool.

Currently, `insert-kbd-macro' produces this:

  (fset 'sample-kmacro
     [?\C-a ?\C-  ?\C-n ?\M-w ?\C-x ?b ?f ?o ?o return ?\C-y ?\C-x ?b return])

Also, the `Keyboard Macro Editor' in the current distribution, in
`....emacs/lisp/edmacro.el', produces this when you type `C-x C-k RET'
(kmacro-edit-macro):

    ;; Keyboard Macro Editor.  Press C-c C-c to finish;
    ;; Press C-x k RET to cancel.
    ;; Original keys: C-a C-SPC C-n M-w C-x b foo RET C-y C-x b RET

    Command: last-kbd-macro
    Key: none

    Macro:

    C-a                 ;; beginning-of-line
    C-SPC               ;; set-mark-command
    C-n                 ;; next-line
    M-w                 ;; kill-ring-save
    C-x b               ;; switch-to-buffer
    foo                 ;; self-insert-command * 3
    RET                 ;; newline
    C-y                 ;; yank
    C-x b               ;; switch-to-buffer
    RET                 ;; newline

As is, the current `insert-kbd-macro' and `kmacro-edit-macro' are
fine; but they are not as helpful as a program that converts
keystrokes to a `defun'.

--
    Robert J. Chassell                         Rattlesnake Enterprises
    http://www.rattlesnake.com                  GnuPG Key ID: 004B4AC8
    http://www.teak.cc                             bob@rattlesnake.com

  reply	other threads:[~2003-02-28 13:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-26 16:32 Emacs manual desribes keyboard macros in the wrong section Kim F. Storm
2003-02-26 19:01 ` Luc Teirlinck
2003-02-27 11:10   ` Kim F. Storm
2003-02-27 22:30 ` Richard Stallman
2003-02-28 12:46   ` Kim F. Storm
2003-02-28 13:36     ` Robert J. Chassell [this message]
2003-03-01 21:44     ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m18okgO-000IeIC@localhost \
    --to=bob@rattlesnake.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.