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 6104669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:52:06+00:00 2026-05-23T13:52:06+00:00

When you enter the command C-/ , Emacs undoes some part of your recent

  • 0

When you enter the command C-/, Emacs undoes some part of your recent changes to a buffer. When you enter C-/ again, it undoes another chunk of work.

I have read the Emacs manual entry on Undo but it is vague about exactly how it works. The manual says “Consecutive character insertion commands are usually grouped together into a single undo record” but it does not explain how it decides the number of character insertion commands that constitute a group. The number of characters it puts in a group seems random.

Can anyone explain the algorithm Emacs uses to group characters into undo records?

  • 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-23T13:52:06+00:00Added an answer on May 23, 2026 at 1:52 pm

    The logic for setting undo boundaries is mostly in self-insert-command which is implemented in cmds.c. You’ll have to read the code for the full story, but basically:

    • As long as you are just typing characters, there’s an undo boundary every 20 characters you type.
    • But if you issue a different editing command (you kill a word, for example), this causes an undo boundary to be added immediately, resetting the character count.
    • Certain “hairy” insertions (as determined by internal_self_insert) cause an an undo boundary to be added immediately, and the character count to be reset. Reading the code, it looks as though these are: (1) in overwrite-mode, if you overwrote a character with one that has a different width, e.g. typing over a tab; (2) if the character you inserted caused an abbreviation to be expanded; (3) if the character you typed caused auto-fill-mode to insert indentation.
    • In addition, any editing command that decides it would be a good idea to have an undo boundary can request it by calling undo-boundary. This does not cause the character count to be reset.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to have a command in Emacs to make it as opaque/transparent as
with (x)emacs, how could I run the 'compile' command without separately pressing enter to
I want to send enter command to another application via c# 4.0 win forms.
I want to ask a question about route command in Linux. I have enter
I have the following code example below. Whereby you can enter a command to
I have a few different input textboxes which you can enter a command into,
I enter command apt-get install apache2 --fix-missing (under the root user) and this is
How to enter a directory like the command - cd, thus operate remote files
I run command: sudo apt-get install phpmyadmin to install phpMyAdmin. Then I enter address:
I would like to know how to enter commands into the cmd.exe (command prompt

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.