I use emacs for development and very often need to move to the start of a line (C-a). However if the line is indented, I\'d like to move to the point at which code st
I do the same toggling trick as Trey, but defaulting to indentation instead of to beginning of line. It takes slightly more code because there's no "at-beginning-of-indentation" function that I know of.
(defun smart-line-beginning ()
"Move point to the beginning of text on the current line; if that is already
the current position of point, then move it to the beginning of the line."
(interactive)
(let ((pt (point)))
(beginning-of-line-text)
(when (eq pt (point))
(beginning-of-line))))
This will probably let you continue to use Ctrl-a and have it do what you want most often, while still being able to get the built-in behavior easily.