817 ) |
817 ) |
818 |
818 |
819 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
819 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
820 (message "key binding, short-keys") |
820 (message "key binding, short-keys") |
821 |
821 |
822 (defun my-smart-beginning-of-line () |
822 (defun my--smart-beginning-of-line () |
823 "Move point to beginning-of-line. If repeat command it cycle |
823 "Move point to `beginning-of-line'. If repeat command it cycle |
824 position between `back-to-indentation' and `beginning-of-line'." |
824 position between `back-to-indentation' and `beginning-of-line'." |
825 (interactive "^") |
825 (interactive "^") |
826 (if (and (eq last-command 'my-smart-beginning-of-line) |
826 (if (and (eq last-command 'my--smart-beginning-of-line) |
827 (= (line-beginning-position) (point))) |
827 (= (line-beginning-position) (point))) |
828 (back-to-indentation) |
828 (back-to-indentation) |
829 (beginning-of-line))) |
829 (beginning-of-line))) |
830 |
830 |
831 (global-set-key [home] 'my-smart-beginning-of-line) |
831 (defun my--smart-end-of-line () |
832 (global-set-key [end] 'end-of-line) |
832 "Move point to `end-of-line'. If repeat command it cycle |
|
833 position between last non-whitespace and `end-of-line'." |
|
834 (interactive "^") |
|
835 (if (and (eq last-command 'my--smart-end-of-line) |
|
836 (= (line-end-position) (point))) |
|
837 (skip-syntax-backward " " (line-beginning-position)) |
|
838 (end-of-line))) |
|
839 |
|
840 (global-set-key [home] 'my--smart-beginning-of-line) |
|
841 (global-set-key [end] 'my--smart-end-of-line) |
833 (global-set-key [C-home] 'beginning-of-buffer) |
842 (global-set-key [C-home] 'beginning-of-buffer) |
834 (global-set-key [C-end] 'end-of-buffer) |
843 (global-set-key [C-end] 'end-of-buffer) |
835 (global-set-key [C-delete] 'kill-word) |
844 (global-set-key [C-delete] 'kill-word) |
836 (global-set-key [delete] 'delete-char) |
845 (global-set-key [delete] 'delete-char) |
837 ;; (global-set-key [backspace] 'backward-delete-char-untabify) ; not work properly in *info* mode |
846 ;; (global-set-key [backspace] 'backward-delete-char-untabify) ; not work properly in *info* mode |