How to obtain/implement a beginning-of-defun
drop-in replacement that is idempotent?
i.e., if I already am at the beginning of a defun, beginning-of-defun
should do nothing, rather than jumping to the beginning of the previous defun.
I acknowledge though that the following case would be ambiguous:
(defun ...)
| ;; <------ cursor is here. What should the function do: jump to next or previous defun?
(defun ...)
end-of-defun
before callingbeginning-of-defun
to get the behavior you describe? – Willy Lee Mar 2 '19 at 23:16