[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 18/35: Fix Issue #270
From: |
Matthew Fidler |
Subject: |
[elpa] 18/35: Fix Issue #270 |
Date: |
Fri, 11 Jul 2014 22:33:26 +0000 |
mlf176f2 pushed a commit to branch externals/ergoemacs-mode
in repository elpa.
commit 52fb57632231b6311a7c3aabf191e0126e1e329a
Author: Matthew L. Fidler <address@hidden>
Date: Wed Jul 9 10:41:56 2014 -0500
Fix Issue #270
---
ergoemacs-functions.el | 255 ++++++++++++++++++++++++++++--------------------
1 files changed, 148 insertions(+), 107 deletions(-)
diff --git a/ergoemacs-functions.el b/ergoemacs-functions.el
index f51a556..b9cd543 100644
--- a/ergoemacs-functions.el
+++ b/ergoemacs-functions.el
@@ -488,6 +488,18 @@ When 'nil don't use a repeatable command
(const nil :tag "Do nothing on repeat at beginning/end of line"))
:group 'ergoemacs-mode)
+(defcustom ergoemacs-beginning-or-end-of-line-prefix-scrolls-other-window t
+ "Turn on scrolling the other window.
+
+With a single prefix argument (called with \\[universal-argument]),
+
+`ergoemacs-end-of-line-or-what' and
+`ergoemacs-beginning-of-line-or-what' do a page up/down in the
+other window.
+"
+ :type 'boolean
+ :group 'ergoemacs-mode)
+
(defcustom ergoemacs-repeatable-beginning-or-end-of-buffer t
"Makes the beginning and end of buffer command repeatable.
Calling it more than once changes the point from the beginning
@@ -612,6 +624,15 @@ changed by `ergoemacs-use-beginning-or-end-of-line-only'.
Also this function tries to use whatever the specific mode wants
for these functions by using `ergoemacs-shortcut-remap'.
+
+With
+`ergoemacs-beginning-or-end-of-line-prefix-scrolls-other-window'
+and a single universal argument called with
+\\[univeral-argument], this will do a page down in the other
+window `scroll-other-window'. Repeated pressing will repeat
+`scroll-other-window'.
+
+
When moving in steps #1 - #4 if N is not nil or 1, move forward
N - 1 lines first. If point reaches the beginning or end of
the buffer, stop there.
@@ -621,69 +642,74 @@ the prefix arguments of `beginning-of-buffer',
`ergoemacs-backward-block' and `scroll-down-command'
"
(interactive "^p")
- (let ((N N)
- (single-u-prefix-p (eq current-prefix-arg '(4))))
+ (if (and ergoemacs-beginning-or-end-of-line-prefix-scrolls-other-window
+ (or (memq last-command '(scroll-other-window
scroll-other-window-down))
+ (equal current-prefix-arg '(4)))
+ (ignore-errors
+ (setq this-command 'scroll-other-window-down)
+ (ergoemacs-shortcut-remap 'scroll-other-window-down)
+ t)) nil
(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)))
- (bolp))
- (progn
- (cond
- ((eq ergoemacs-beginning-or-end-of-line-and-what 'buffer)
- (ergoemacs-shortcut-remap 'beginning-of-buffer)
- (setq this-command 'beginning-of-buffer))
- ((eq ergoemacs-beginning-or-end-of-line-and-what 'block)
- (ergoemacs-shortcut-remap 'ergoemacs-backward-block)
- (setq this-command 'ergoemacs-backward-block))
- ((eq ergoemacs-beginning-or-end-of-line-and-what 'page)
- (ergoemacs-shortcut-remap 'scroll-down-command)
- (setq this-command 'scroll-down-command)))
- (beginning-of-line))
- (setq N (or N 1))
- (when (not (= 1 N))
- (let ((line-move-visual nil))
- (forward-line (- N 1))))
- (let (pts tmp)
- (push (point-at-bol) pts)
- (save-excursion
- ;; (setq prefix-arg nil)
- (setq current-prefix-arg nil)
- (ergoemacs-shortcut-remap 'move-beginning-of-line)
- (setq this-command 'move-beginning-of-line)
- (push (point) pts))
- (when ergoemacs-back-to-indentation
- (save-excursion
- (back-to-indentation)
- (push (point) pts)))
- (when ergoemacs-end-of-comment-line
+ (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)))
+ (bolp))
+ (progn
+ (cond
+ ((eq ergoemacs-beginning-or-end-of-line-and-what 'buffer)
+ (ergoemacs-shortcut-remap 'beginning-of-buffer)
+ (setq this-command 'beginning-of-buffer))
+ ((eq ergoemacs-beginning-or-end-of-line-and-what 'block)
+ (ergoemacs-shortcut-remap 'ergoemacs-backward-block)
+ (setq this-command 'ergoemacs-backward-block))
+ ((eq ergoemacs-beginning-or-end-of-line-and-what 'page)
+ (ergoemacs-shortcut-remap 'scroll-down-command)
+ (setq this-command 'scroll-down-command)))
+ (beginning-of-line))
+ (setq N (or N 1))
+ (when (not (= 1 N))
+ (let ((line-move-visual nil))
+ (forward-line (- N 1))))
+ (let (pts tmp)
+ (push (point-at-bol) pts)
(save-excursion
- (when (not (eolp))
- (forward-char 1))
+ ;; (setq prefix-arg nil)
+ (setq current-prefix-arg nil)
+ (ergoemacs-shortcut-remap 'move-beginning-of-line)
+ (setq this-command 'move-beginning-of-line)
+ (push (point) pts))
+ (when ergoemacs-back-to-indentation
(save-excursion
- (when (ignore-errors (comment-search-backward (point-at-bol) t))
- (push (point) pts)
- (when (re-search-backward (format "%s\\=" comment-start-skip)
(point-at-bol) t)
- (while (re-search-backward (format "%s\\=" comment-start-skip)
(point-at-bol) t)
- (skip-syntax-backward " " (point-at-bol)))
- (push (point) pts))))))
- (cond
- ((not pts)
- (call-interactively 'move-beginning-of-line))
- (t
- (setq pts (sort pts '<))
- (dolist (x pts)
+ (back-to-indentation)
+ (push (point) pts)))
+ (when ergoemacs-end-of-comment-line
(save-excursion
- (goto-char x)
- (looking-at ".*"))
- (unless (>= x (point))
- (push x tmp)))
- (setq pts tmp)
- (when pts
- (goto-char (nth 0 pts))))))))
- ;; ergoemacs shortcut changes this-command
+ (when (not (eolp))
+ (forward-char 1))
+ (save-excursion
+ (when (ignore-errors (comment-search-backward (point-at-bol) t))
+ (push (point) pts)
+ (when (re-search-backward (format "%s\\=" comment-start-skip)
(point-at-bol) t)
+ (while (re-search-backward (format "%s\\="
comment-start-skip) (point-at-bol) t)
+ (skip-syntax-backward " " (point-at-bol)))
+ (push (point) pts))))))
+ (cond
+ ((not pts)
+ (call-interactively 'move-beginning-of-line))
+ (t
+ (setq pts (sort pts '<))
+ (dolist (x pts)
+ (save-excursion
+ (goto-char x)
+ (looking-at ".*"))
+ (unless (>= x (point))
+ (push x tmp)))
+ (setq pts tmp)
+ (when pts
+ (goto-char (nth 0 pts))))))))
(setq ergoemacs-beginning-of-line-or-what-last-command this-command))
+;; ergoemacs shortcut changes this-command
(defun ergoemacs-end-of-line-or-what (&optional N )
"Move cursor to end of line, or end of current or next text block or even
end of buffer.
(a text block is separated by empty lines).
@@ -717,6 +743,14 @@ To:
c. A PgDown ('page)
Move point to end of current line as displayed.
+
+With
+`ergoemacs-beginning-or-end-of-line-prefix-scrolls-other-window'
+and a single universal argument called with
+\\[univeral-argument], this will do a page down in the other
+window `scroll-other-window'. Repeated pressing will repeat
+`scroll-other-window'.
+
With argument ARG not nil or 1, move forward ARG - 1 lines first.
If point reaches the beginning or end of buffer, it stops there.
@@ -729,57 +763,64 @@ the prefix arguments of `end-of-buffer',
"
(interactive "^p")
- (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)))
- (or (eolp)
- (and
- (or
- (memq last-command '(ergoemacs-forward-block
scroll-up-command)))
- (bolp))))
- (progn
- (cond
- ((eq ergoemacs-beginning-or-end-of-line-and-what 'buffer)
- (ergoemacs-shortcut-remap 'end-of-buffer)
- (setq this-command 'end-of-buffer))
- ((eq ergoemacs-beginning-or-end-of-line-and-what 'block)
- (ergoemacs-shortcut-remap 'ergoemacs-forward-block)
- (setq this-command 'ergoemacs-forward-block))
- ((eq ergoemacs-beginning-or-end-of-line-and-what 'page)
- (ergoemacs-shortcut-remap 'scroll-up-command)
- (setq this-command 'scroll-up-command)
- (beginning-of-line))))
- (setq N (or N 1))
- (when (not (= 1 N))
- (let ((line-move-visual nil))
- (forward-line (- N 1))))
- (let (pts tmp)
- (setq current-prefix-arg nil)
- (save-excursion
- (call-interactively 'move-end-of-line)
- (setq this-command 'move-end-of-line)
- (push (point) pts))
- (when ergoemacs-end-of-comment-line
+ (if (and ergoemacs-beginning-or-end-of-line-prefix-scrolls-other-window
+ (or (memq last-command '(scroll-other-window
scroll-other-window-down))
+ (equal current-prefix-arg '(4)))
+ (ignore-errors
+ (setq this-command 'scroll-other-window)
+ (ergoemacs-shortcut-remap 'scroll-other-window)
+ t)) nil
+ (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)))
+ (or (eolp)
+ (and
+ (or
+ (memq last-command '(ergoemacs-forward-block
scroll-up-command)))
+ (bolp))))
+ (progn
+ (cond
+ ((eq ergoemacs-beginning-or-end-of-line-and-what 'buffer)
+ (ergoemacs-shortcut-remap 'end-of-buffer)
+ (setq this-command 'end-of-buffer))
+ ((eq ergoemacs-beginning-or-end-of-line-and-what 'block)
+ (ergoemacs-shortcut-remap 'ergoemacs-forward-block)
+ (setq this-command 'ergoemacs-forward-block))
+ ((eq ergoemacs-beginning-or-end-of-line-and-what 'page)
+ (ergoemacs-shortcut-remap 'scroll-up-command)
+ (setq this-command 'scroll-up-command)
+ (beginning-of-line))))
+ (setq N (or N 1))
+ (when (not (= 1 N))
+ (let ((line-move-visual nil))
+ (forward-line (- N 1))))
+ (let (pts tmp)
+ (setq current-prefix-arg nil)
(save-excursion
- ;; See http://www.emacswiki.org/emacs/EndOfLineNoComments
- (let ((cs (ignore-errors (comment-search-forward (point-at-eol) t))))
- (when cs
- (goto-char cs)
- (skip-syntax-backward " " (point-at-bol))
- (push (point) pts)))))
- (when pts
- (setq pts (sort pts '<))
- (dolist (x pts)
- (unless (<= x (point))
- (push x tmp)))
- (setq pts (reverse tmp)))
- (cond
- ((not pts)
- (call-interactively 'move-end-of-line)
- (setq this-command 'move-end-of-line))
- (t
- (goto-char (nth 0 pts))))))
+ (call-interactively 'move-end-of-line)
+ (setq this-command 'move-end-of-line)
+ (push (point) pts))
+ (when ergoemacs-end-of-comment-line
+ (save-excursion
+ ;; See http://www.emacswiki.org/emacs/EndOfLineNoComments
+ (let ((cs (ignore-errors (comment-search-forward (point-at-eol)
t))))
+ (when cs
+ (goto-char cs)
+ (skip-syntax-backward " " (point-at-bol))
+ (push (point) pts)))))
+ (when pts
+ (setq pts (sort pts '<))
+ (dolist (x pts)
+ (unless (<= x (point))
+ (push x tmp)))
+ (setq pts (reverse tmp)))
+ (cond
+ ((not pts)
+ (call-interactively 'move-end-of-line)
+ (setq this-command 'move-end-of-line))
+ (t
+ (goto-char (nth 0 pts)))))))
(setq ergoemacs-beginning-of-line-or-what-last-command this-command))
;;; TEXT SELECTION RELATED
- [elpa] 14/35: Another attempt to fix Issue #269, (continued)
- [elpa] 14/35: Another attempt to fix Issue #269, Matthew Fidler, 2014/07/11
- [elpa] 20/35: Make Open Last Closed show Ctl+Shift+T, Matthew Fidler, 2014/07/11
- [elpa] 16/35: Add open last closed to recentf menu, Matthew Fidler, 2014/07/11
- [elpa] 19/35: More accessible printer setup (Issue #236 and #235), Matthew Fidler, 2014/07/11
- [elpa] 17/35: Add Scroll up/down command for other window, Matthew Fidler, 2014/07/11
- [elpa] 09/35: Change startup messages, Matthew Fidler, 2014/07/11
- [elpa] 21/35: Add load path to batch byte compile, Matthew Fidler, 2014/07/11
- [elpa] 22/35: Fix byte compile warning, Matthew Fidler, 2014/07/11
- [elpa] 23/35: Start modal shift-select (Issue #215), Matthew Fidler, 2014/07/11
- [elpa] 24/35: Fix keys on web-page, Matthew Fidler, 2014/07/11
- [elpa] 18/35: Fix Issue #270,
Matthew Fidler <=
- [elpa] 15/35: Misc Code Cleanup, Matthew Fidler, 2014/07/11
- [elpa] 27/35: Use pr-interface when available, Matthew Fidler, 2014/07/11
- [elpa] 25/35: Fix Issue #271, Matthew Fidler, 2014/07/11
- [elpa] 26/35: Should display the correct key now., Matthew Fidler, 2014/07/11
- [elpa] 28/35: Another attempt to fix the webpage, Matthew Fidler, 2014/07/11
- [elpa] 30/35: Delete Frame/Close Emacs for Alt+f4, Matthew Fidler, 2014/07/11
- [elpa] 29/35: Fix webpage (tested works), Matthew Fidler, 2014/07/11
- [elpa] 32/35: browse-kill-ring-mode no longer needs work-around, Matthew Fidler, 2014/07/11
- [elpa] 31/35: ergoemacs-keyboard-quit calls 【q】 when applicable, Matthew Fidler, 2014/07/11
- [elpa] 35/35: v5.14.7.2 - Removed ergoemacs-pushnew, and use add-to-list for variables that are defined with defvar (Allows work-around of calling adjoin at runtime for emacs 24.1; Thaks to Stefan Monnier for pointing this out). - Expanded ã€ESC】 to exit modes that use ã€q】 for quitting the current operation. This includes many packages like magit and browse-kill-ring. - Expanded ã€Alt+f4】 to close the current frame when it is the only frame present. - Added Recent files menu that includes Open Last Closed ã€Ctl+⇧Shift+T】. - Changed ergoemacs-mode printing to use printing package when available. The file-menu has been replaced - The default theme is now selected automatically (Issue #269) - Show goto-line as ã€Ctl+L】, although the test doesn't work (Issue #265) - Added an option to move lines up and down with ã€Alt+up】, ã€Alt+down】 like Gedit (See #266) - Changed the emacs startup messages to reflect emacs keys (#267) - Other miscellaneous cleanups and fixes, Matthew Fidler, 2014/07/11