Last active
April 6, 2025 14:24
-
-
Save mmarshall540/58b0374295f2760c9ee5058d3225a22d to your computer and use it in GitHub Desktop.
Beginning-of-line or indentation on one key
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun my/mbol-advice (arg) | |
| "With prefix ARG other than 1, return t. | |
| Else, go `back-to-indentation', and if point hasn't moved, return t." | |
| (if (eq arg 1) | |
| (let ((start (point))) | |
| (back-to-indentation) | |
| (eq start (point))) | |
| t)) | |
| (advice-add 'move-beginning-of-line :before-while 'my/mbol-advice) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated so that if a prefix argument other than 1 is passed,
move-beginning-of-linewill be immediately called using the prefix argument, sinceback-to-indentationdoesn't use a prefix argument.