;; --- Home-key configuration file --- ;; Configure home to go to the start of the ;; code (ignores comment headers). ;; If pressed twice, goes to start of the line. ;; Requires: (defun smart-beginning-of-line () "Move point to first non-whitespace character or beginning-of-line. Move point to the first non-whitespace character on this line. If point was already at that position, move point to beginning of line." (interactive "^") ;(if (version< "22" emacs-version) (interactive "^") (interactive)) (let ((oldpos (point))) (beginning-of-line-text); goes to first significant character ;(back-to-indentation); goes to first non-whitespace (and (= oldpos (point)) (beginning-of-line)))) (global-set-key [home] 'smart-beginning-of-line) (provide 'smart-home)