Dear fellow emacsers.

How can we make undo work on the scratch buffer? I’m sure it is a simple configuration issue, but I’m not getting the appropriate keyword to find the relevant documentation.

Thanks a lot in advance for your help and attention…
:) /\

  • Sunoc
    link
    English
    111 months ago

    Okay, I could reproduce your situation by evaluating

    (setq initial-major-mode 'org-mode)
    (setq-default major-mode 'org-mode)
    

    This setup forces the scratch buffer to be in org-mode, apparently breaking most of the available keybindings for it, including the undo.

    The value for the initial-major-mode should be kept as lisp-interaction-mode, if your configuration requires to set it.

    Otherwise I would remove both of these lines all together and see if the default behavior brings back the scratch buffer to be in the expected lisp-interaction-mode again. The additional hook I provided in my previous post shouldn’t be needed either.