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

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

Keyboard Macros


From: technically . eludible
Subject: Keyboard Macros
Date: Thu, 20 May 2021 11:08:09 -0000

Hello everyone,

I've been playing around with Keyboard Macros lately and ran into a
problem:

I tried to permanently save my macro into a file using M-x
insert-kbd-macro Enter <name> Enter

Doing this the macro that got inserted looked something like this:

(fset 'transpose-names

    (kmacro-lambda-form [?\C-a ?æ ?, ?ø ?\C-n] 0 "%d"  ))

It looked a little strange to me from the start, and trying to execute
it didn't exactly do what i wanted it to. In Essence it added the
characters "æ" and "ø" with a "," in between.


Here's what i wanted it to do:

I tried to set up a macro that transposes names in the form

First Name Last Name

to the form

Last Name, First Name


The keystrokes that i actually used were the following:

C-x (        Start recording

C-a          Move to start of line

M-f          Move forward a word

,              Insert ,

M-t          Transpose words

C-n          Move to next line

C-x )        Stop recording

(Maybe someone recognizes that example, it's taken from the book
"Learning GNU Emacs" published by O'Reilly)


I have absolutely no idea, why the macros doesn't get saved correctly.

Does anyone have any idea what went wrong there?






reply via email to

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