diff options
| author | Juri Linkov | 2010-04-14 03:43:54 +0300 |
|---|---|---|
| committer | Juri Linkov | 2010-04-14 03:43:54 +0300 |
| commit | 7b05466ff6721988517519081078b19fffeecd09 (patch) | |
| tree | 46a9ff6f927e99516677966da639ccb97442512b | |
| parent | 3212974649ca9415a3a4a5197a169a0160a6b36f (diff) | |
| download | emacs-7b05466ff6721988517519081078b19fffeecd09.tar.gz emacs-7b05466ff6721988517519081078b19fffeecd09.zip | |
Add variable scroll-error-top-bottom.
http://lists.gnu.org/archive/html/emacs-devel/2010-04/msg00403.html
* simple.el (scroll-error-top-bottom): New defcustom.
(scroll-up-command, scroll-down-command): Use it. Doc fix.
* emulation/pc-select.el (pc-select-override-scroll-error):
Obsolete in favor of `scroll-error-top-bottom'.
| -rw-r--r-- | etc/NEWS | 5 | ||||
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/emulation/pc-select.el | 3 | ||||
| -rw-r--r-- | lisp/simple.el | 30 |
4 files changed, 38 insertions, 8 deletions
| @@ -69,8 +69,9 @@ Use `set-scroll-bar-mode' to change this. | |||
| 69 | with Xft. | 69 | with Xft. |
| 70 | 70 | ||
| 71 | ** New scrolling commands `scroll-up-command' and `scroll-down-command' | 71 | ** New scrolling commands `scroll-up-command' and `scroll-down-command' |
| 72 | (bound to [next] and [prior]) does not signal errors at top/bottom | 72 | (bound to C-v/[next] and M-v/[prior]) does not signal errors at top/bottom |
| 73 | of buffer at first key-press (instead moves to top/bottom of buffer). | 73 | of buffer at first key-press (instead moves to top/bottom of buffer) |
| 74 | when a new variable `scroll-error-top-bottom' is non-nil. | ||
| 74 | 75 | ||
| 75 | ** New scrolling commands `scroll-up-line' and `scroll-down-line' | 76 | ** New scrolling commands `scroll-up-line' and `scroll-down-line' |
| 76 | scroll a line instead of full screen. | 77 | scroll a line instead of full screen. |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 01bfbf55434..89d56ffd323 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,13 @@ | |||
| 1 | 2010-04-14 Juri Linkov <juri@jurta.org> | 1 | 2010-04-14 Juri Linkov <juri@jurta.org> |
| 2 | 2 | ||
| 3 | * simple.el (scroll-error-top-bottom): New defcustom. | ||
| 4 | (scroll-up-command, scroll-down-command): Use it. Doc fix. | ||
| 5 | |||
| 6 | * emulation/pc-select.el (pc-select-override-scroll-error): | ||
| 7 | Obsolete in favor of `scroll-error-top-bottom'. | ||
| 8 | |||
| 9 | 2010-04-14 Juri Linkov <juri@jurta.org> | ||
| 10 | |||
| 3 | * tutorial.el (tutorial--default-keys): Rebind `C-v' to | 11 | * tutorial.el (tutorial--default-keys): Rebind `C-v' to |
| 4 | `scroll-up-command' and `M-v' to `scroll-down-command'. | 12 | `scroll-up-command' and `M-v' to `scroll-down-command'. |
| 5 | 13 | ||
diff --git a/lisp/emulation/pc-select.el b/lisp/emulation/pc-select.el index 175999b6e37..529ba290cb8 100644 --- a/lisp/emulation/pc-select.el +++ b/lisp/emulation/pc-select.el | |||
| @@ -93,6 +93,9 @@ text with these commands. If you set this variable to non-nil, these | |||
| 93 | errors are suppressed." | 93 | errors are suppressed." |
| 94 | :type 'boolean | 94 | :type 'boolean |
| 95 | :group 'pc-select) | 95 | :group 'pc-select) |
| 96 | (define-obsolete-variable-alias 'pc-select-override-scroll-error | ||
| 97 | 'scroll-error-top-bottom | ||
| 98 | "24.1") | ||
| 96 | 99 | ||
| 97 | (defcustom pc-select-selection-keys-only nil | 100 | (defcustom pc-select-selection-keys-only nil |
| 98 | "*Non-nil means only bind the basic selection keys when started. | 101 | "*Non-nil means only bind the basic selection keys when started. |
diff --git a/lisp/simple.el b/lisp/simple.el index 60fe6c875d2..34e31b10276 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -4744,20 +4744,34 @@ This also turns on `word-wrap' in the buffer." | |||
| 4744 | ;;; of buffer at first key-press (instead moves to top/bottom | 4744 | ;;; of buffer at first key-press (instead moves to top/bottom |
| 4745 | ;;; of buffer). | 4745 | ;;; of buffer). |
| 4746 | 4746 | ||
| 4747 | (defcustom scroll-error-top-bottom nil | ||
| 4748 | "Move point to top/bottom of buffer before signalling a scrolling error. | ||
| 4749 | A value of nil means just signal an error if no more scrolling possible. | ||
| 4750 | A value of t means point moves to the beginning or the end of the buffer | ||
| 4751 | \(depending on scrolling direction) when no more scrolling possible. | ||
| 4752 | When point is already on that position, then signal an error." | ||
| 4753 | :type 'boolean | ||
| 4754 | :group 'scrolling | ||
| 4755 | :version "24.1") | ||
| 4756 | |||
| 4747 | (defun scroll-up-command (&optional arg) | 4757 | (defun scroll-up-command (&optional arg) |
| 4748 | "Scroll text of selected window upward ARG lines; or near full screen if no ARG. | 4758 | "Scroll text of selected window upward ARG lines; or near full screen if no ARG. |
| 4749 | If `scroll-up' cannot scroll window further, move cursor to the bottom line. | 4759 | If `scroll-error-top-bottom' is non-nil and `scroll-up' cannot |
| 4760 | scroll window further, move cursor to the bottom line. | ||
| 4750 | When point is already on that position, then signal an error. | 4761 | When point is already on that position, then signal an error. |
| 4751 | A near full screen is `next-screen-context-lines' less than a full screen. | 4762 | A near full screen is `next-screen-context-lines' less than a full screen. |
| 4752 | Negative ARG means scroll downward. | 4763 | Negative ARG means scroll downward. |
| 4753 | If ARG is the atom `-', scroll downward by nearly full screen." | 4764 | If ARG is the atom `-', scroll downward by nearly full screen." |
| 4754 | (interactive "^P") | 4765 | (interactive "^P") |
| 4755 | (cond | 4766 | (cond |
| 4756 | ((eq arg '-) (scroll-down-command nil)) | 4767 | ((null scroll-error-top-bottom) |
| 4768 | (scroll-up arg)) | ||
| 4769 | ((eq arg '-) | ||
| 4770 | (scroll-down-command nil)) | ||
| 4757 | ((< (prefix-numeric-value arg) 0) | 4771 | ((< (prefix-numeric-value arg) 0) |
| 4758 | (scroll-down-command (- (prefix-numeric-value arg)))) | 4772 | (scroll-down-command (- (prefix-numeric-value arg)))) |
| 4759 | ((eobp) | 4773 | ((eobp) |
| 4760 | (scroll-up arg)) ; signal error | 4774 | (scroll-up arg)) ; signal error |
| 4761 | (t | 4775 | (t |
| 4762 | (condition-case nil | 4776 | (condition-case nil |
| 4763 | (scroll-up arg) | 4777 | (scroll-up arg) |
| @@ -4775,18 +4789,22 @@ If ARG is the atom `-', scroll downward by nearly full screen." | |||
| 4775 | 4789 | ||
| 4776 | (defun scroll-down-command (&optional arg) | 4790 | (defun scroll-down-command (&optional arg) |
| 4777 | "Scroll text of selected window down ARG lines; or near full screen if no ARG. | 4791 | "Scroll text of selected window down ARG lines; or near full screen if no ARG. |
| 4778 | If `scroll-down' cannot scroll window further, move cursor to the top line. | 4792 | If `scroll-error-top-bottom' is non-nil and `scroll-down' cannot |
| 4793 | scroll window further, move cursor to the top line. | ||
| 4779 | When point is already on that position, then signal an error. | 4794 | When point is already on that position, then signal an error. |
| 4780 | A near full screen is `next-screen-context-lines' less than a full screen. | 4795 | A near full screen is `next-screen-context-lines' less than a full screen. |
| 4781 | Negative ARG means scroll upward. | 4796 | Negative ARG means scroll upward. |
| 4782 | If ARG is the atom `-', scroll upward by nearly full screen." | 4797 | If ARG is the atom `-', scroll upward by nearly full screen." |
| 4783 | (interactive "^P") | 4798 | (interactive "^P") |
| 4784 | (cond | 4799 | (cond |
| 4785 | ((eq arg '-) (scroll-up-command nil)) | 4800 | ((null scroll-error-top-bottom) |
| 4801 | (scroll-down arg)) | ||
| 4802 | ((eq arg '-) | ||
| 4803 | (scroll-up-command nil)) | ||
| 4786 | ((< (prefix-numeric-value arg) 0) | 4804 | ((< (prefix-numeric-value arg) 0) |
| 4787 | (scroll-up-command (- (prefix-numeric-value arg)))) | 4805 | (scroll-up-command (- (prefix-numeric-value arg)))) |
| 4788 | ((bobp) | 4806 | ((bobp) |
| 4789 | (scroll-down arg)) ; signal error | 4807 | (scroll-down arg)) ; signal error |
| 4790 | (t | 4808 | (t |
| 4791 | (condition-case nil | 4809 | (condition-case nil |
| 4792 | (scroll-down arg) | 4810 | (scroll-down arg) |