Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1047739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:20:55+00:00 2026-05-16T16:20:55+00:00

I’ve been using kmacro commands such as kmacro-name-last-macro to save keyboard macros. The problem

  • 0

I’ve been using kmacro commands such as kmacro-name-last-macro to save keyboard macros. The problem is that after I have saved a macro and even added it to my .emacs file, I come across an error and want to edit the macro using kmacro-step-edit-macro. If my named macro is no longer in the macro ring (the default kmacro-ring-max is 8) I can’t use any of the editing or macro ring commands on that macro. After learning that name-last-kbd-macro will save the symbol form which is easier to edit, I regret using kmacro-name-last-macro and wonder why it is the new default.

Is there are way to add a previously defined macro to the macro ring so I can edit it with kmacro-step-edit-macro?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T16:20:56+00:00Added an answer on May 16, 2026 at 4:20 pm

    Yes, there is a way to add a previously defined macro to the macro ring so you can edit it with kmacro-step-edit-macro :

    Imagine you have named a keyboard macro tata using name-last-kbd-macro, and done a insert-kbd-macro for tata. For example :

    (fset 'tata
       [return return ?f ?o ?o return])
    

    You can store this macro definition into your .emacs for later use. On a new emacs session, you can use the following lisp code to put back your macro into your kmacro-ring :

    (kmacro-push-ring (list 'tata 0 "%d"))
    (kmacro-pop-ring)
    

    After that, you can do a kmacro-step-edit-macro on it.

    If you have named your macro using kmacro-name-last-macro instead of name-last-kbd-macro, the call to insert-kbd-macro will insert a different definition for your macro, using a lambda function instead of a vector or a string (to be able to store the current counter), for example :

    (fset 'tata
       (lambda (&optional arg) "Keyboard macro." (interactive "p")
       (kmacro-exec-ring-item
          (quote ([return return 102 111 111 return] 0 "%d")) arg)))
    

    In this case, kmacro-step-edit-macro raises an error as this is not a vector or a string. To solve this problem you can :

    • either transform your lambda function to a classic vector macro definition (like, for example, the top definition of tata above). It is normally always possible to do this kind of transformation.

    • or define a macro that calls your lambda function macro, for example : (fset 'foo [?\M-x ?t ?a ?t ?a return]) And then you can place this foo macro into the kmacro ring as said before. But in this case, you could have some side-effects at the end of the macro execution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I am reading a book about Javascript and jQuery and using one of the
I am doing a simple coin flipping experiment for class that involves flipping a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.