From aa8a8272df638c53e254ab32bb1c25f6b9821eb8 Mon Sep 17 00:00:00 2001 From: Ravi R Kiran Date: Sun, 2 Mar 2014 15:38:57 -0800 Subject: Use default versions first before enhanced versions diff --git a/ravi-init-navigation.el b/ravi-init-navigation.el index b698210..d291fca 100644 --- a/ravi-init-navigation.el +++ b/ravi-init-navigation.el @@ -168,7 +168,7 @@ (bind-key "C-:" 'ravi/kyle-sherman-duplicate-line) (defun ravi/back-to-indentation-or-beginning () (interactive) - (if (= (point) (progn (back-to-indentation) (point))) + (if (bolp) (back-to-indentation) (beginning-of-line))) (bind-key "C-a" 'ravi/back-to-indentation-or-beginning) @@ -180,9 +180,7 @@ (not (nth 3 syn))))) (defun ravi/Fuco-end-of-code-or-line+ (arg) - "Move to the end of code. If already there, move to the end of line, - that is after the possible comment. If at the end of line, move to the - end of code. + "Move to the end of line. If already there, move to the end of code. Comments are recognized in any mode that sets syntax-ppss properly." (interactive "P") @@ -192,13 +190,13 @@ (backward-char)) (skip-chars-backward " \t") (point)))) - (cond ((= (point) eoc) - (move-end-of-line arg)) - (t + (cond ((eolp) (move-end-of-line arg) (while (ravi/Fuco-point-in-comment) (backward-char)) - (skip-chars-backward " \t"))))) + (skip-chars-backward " \t")) + (t + (move-end-of-line arg))))) (bind-key "C-e" 'ravi/Fuco-end-of-code-or-line+) ;; Use current line for region-based commands if no region selected -- cgit v0.10.1