[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 232/287: Fix beginning of line function again...
From: |
Matthew Fidler |
Subject: |
[elpa] 232/287: Fix beginning of line function again... |
Date: |
Wed, 02 Jul 2014 14:46:15 +0000 |
mlf176f2 pushed a commit to branch externals/ergoemacs-mode
in repository elpa.
commit 29a983e40bf5f1ab83854ede02a13cea78787612
Author: Matthew L. Fidler <address@hidden>
Date: Thu Jun 26 14:13:19 2014 -0500
Fix beginning of line function again...
---
ergoemacs-functions.el | 44 ++++++++++++++++++++++----------------------
1 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/ergoemacs-functions.el b/ergoemacs-functions.el
index 1d1bf91..250ed57 100644
--- a/ergoemacs-functions.el
+++ b/ergoemacs-functions.el
@@ -442,14 +442,17 @@ See: `ergoemacs-forward-block'"
(defcustom ergoemacs-back-to-indentation t
"Allow `ergoemacs-beginning-of-line-or-what' to move cursor back to the
beginning of the indentation. Otherwise, it is always beginning of line."
:type 'boolean
- :group 'ergoemacs-mode)
+ :group 'ergoemacs-mode) ;
+
+(defcustom ergoemacs-end-of-comment-line nil
+ "When non-nil, treat comments different for beginning/end of line.
-(defcustom ergoemacs-end-of-comment-line t
- "Allow `ergoemacs-end-of-line-or-what' to move cursor to the
-end of line, but ignore comments.
+ When non-nil `ergoemacs-end-of-line-or-what', the end of the line is the end
of the code line first, then the end of the code + comment.
-It also allows `ergoemacs-beginning-of-line-or-what' to move the
-cursor to the beginning of the comment line.
+When non-nil `ergoemacs-beginning-of-line-or-what' to move the
+cursor to the beginning of the comment, then end of code,
+followed by the beginning of indentation (if
+`ergoemacs-back-to-indentation' is true) and beginning of line.
"
:type 'boolean
:group 'ergoemacs-mode)
@@ -609,7 +612,9 @@ the prefix arguments of `beginning-of-buffer',
`ergoemacs-backward-block' and `scroll-down-command'
"
(interactive "^p")
- (if (and ergoemacs-beginning-or-end-of-line-and-what
+ (let ((N N)
+ (single-u-prefix-p (eq current-prefix-arg '(4))))
+ (if (and ergoemacs-beginning-or-end-of-line-and-what
(or (not ergoemacs-use-beginning-or-end-of-line-only)
(and (eq 'on-repeat ergoemacs-use-beginning-or-end-of-line-only)
(eq last-command
ergoemacs-beginning-of-line-or-what-last-command)))
@@ -646,20 +651,15 @@ the prefix arguments of `beginning-of-buffer',
(save-excursion
(when (not (eolp))
(forward-char 1))
- (let ((cs (ignore-errors
- (let ((tmp (comment-search-backward (point-at-bol) t)))
- (if (and font-lock
- (not
- (eq (get-text-property (point) 'face)
- 'font-lock-comment-face))) nil
- tmp)))))
- (when cs
- (skip-syntax-forward " " (point-at-eol))
- (unless (looking-at "$")
- (push (point) pts))
- (goto-char cs)
- (skip-syntax-backward " " (point-at-bol))
- (push (point) pts))))) ;; Test
+ (save-excursion
+ (when (comment-search-backward (point-at-bol) t)
+ (push (point) pts)
+ (when (and font-lock-mode
+ (eq (get-text-property (point) 'face)
+ 'font-lock-comment-face))
+ (goto-char (max (point-at-bol)
(previous-single-property-change (point) 'face (current-buffer)
(point-at-bol))))
+ (skip-syntax-backward " " (point-at-bol))
+ (push (point) pts)))))) ;; Test
(cond
((not pts)
(call-interactively 'move-beginning-of-line))
@@ -673,7 +673,7 @@ the prefix arguments of `beginning-of-buffer',
(push x tmp)))
(setq pts tmp)
(when pts
- (goto-char (nth 0 pts)))))))
+ (goto-char (nth 0 pts))))))))
;; ergoemacs shortcut changes this-command
(setq ergoemacs-beginning-of-line-or-what-last-command this-command))
- [elpa] 218/287: Merge branch 'master' of github.com:ergoemacs/ergoemacs-mode, (continued)
- [elpa] 218/287: Merge branch 'master' of github.com:ergoemacs/ergoemacs-mode, Matthew Fidler, 2014/07/02
- [elpa] 231/287: Change layout descriptions, Matthew Fidler, 2014/07/02
- [elpa] 229/287: Fix order of operations, Matthew Fidler, 2014/07/02
- [elpa] 226/287: Remove default redo keys; Possibly Fix Issue #242, Matthew Fidler, 2014/07/02
- [elpa] 224/287: Make undo-tree the default undo method and installed when ergoemacs-mode is installed. Issue #242, Matthew Fidler, 2014/07/02
- [elpa] 228/287: Add `cua-rect` require so that tests pass, Matthew Fidler, 2014/07/02
- [elpa] 219/287: `ergoemacs-select-text-in-quote' can now deal with escaped quote in string., Matthew Fidler, 2014/07/02
- [elpa] 233/287: Change the default option back, Matthew Fidler, 2014/07/02
- [elpa] 230/287: Fix `ergoemacs-beginning-of-line-or-what` and `ergoemacs-end-of-line-or-what`, Matthew Fidler, 2014/07/02
- [elpa] 227/287: Be more careful of cua--rectangle, Matthew Fidler, 2014/07/02
- [elpa] 232/287: Fix beginning of line function again...,
Matthew Fidler <=
- [elpa] 238/287: Fix warnings for cua-clear-rectangle-mark., Matthew Fidler, 2014/07/02
- [elpa] 240/287: Move the fixed bracket moving to the bracket theme component., Matthew Fidler, 2014/07/02
- [elpa] 236/287: add electric-pair-made as an option, Matthew Fidler, 2014/07/02
- [elpa] 237/287: Expanded outlook integration with Emacs org-mode, Matthew Fidler, 2014/07/02
- [elpa] 234/287: Make comment-search-backward less fragile, Matthew Fidler, 2014/07/02
- [elpa] 235/287: Add the uri encoding function, Matthew Fidler, 2014/07/02
- [elpa] 241/287: Cleanup for select text in quotes, Matthew Fidler, 2014/07/02
- [elpa] 243/287: Make the quote selection consistent., Matthew Fidler, 2014/07/02
- [elpa] 242/287: Fix `ergoemacs-select-text-in-ascii-quote` to work using font-lock, Matthew Fidler, 2014/07/02
- [elpa] 239/287: Allow emacs 24.4 differences for backward-up-list, Matthew Fidler, 2014/07/02