aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorJuri Linkov2010-04-14 03:43:54 +0300
committerJuri Linkov2010-04-14 03:43:54 +0300
commit7b05466ff6721988517519081078b19fffeecd09 (patch)
tree46a9ff6f927e99516677966da639ccb97442512b /lisp
parent3212974649ca9415a3a4a5197a169a0160a6b36f (diff)
downloademacs-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'.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/emulation/pc-select.el3
-rw-r--r--lisp/simple.el30
3 files changed, 35 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 01bfbf55434..89d56ffd323 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,13 @@
12010-04-14 Juri Linkov <juri@jurta.org> 12010-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
92010-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
93errors are suppressed." 93errors 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.
4749A value of nil means just signal an error if no more scrolling possible.
4750A 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.
4752When 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.
4749If `scroll-up' cannot scroll window further, move cursor to the bottom line. 4759If `scroll-error-top-bottom' is non-nil and `scroll-up' cannot
4760scroll window further, move cursor to the bottom line.
4750When point is already on that position, then signal an error. 4761When point is already on that position, then signal an error.
4751A near full screen is `next-screen-context-lines' less than a full screen. 4762A near full screen is `next-screen-context-lines' less than a full screen.
4752Negative ARG means scroll downward. 4763Negative ARG means scroll downward.
4753If ARG is the atom `-', scroll downward by nearly full screen." 4764If 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.
4778If `scroll-down' cannot scroll window further, move cursor to the top line. 4792If `scroll-error-top-bottom' is non-nil and `scroll-down' cannot
4793scroll window further, move cursor to the top line.
4779When point is already on that position, then signal an error. 4794When point is already on that position, then signal an error.
4780A near full screen is `next-screen-context-lines' less than a full screen. 4795A near full screen is `next-screen-context-lines' less than a full screen.
4781Negative ARG means scroll upward. 4796Negative ARG means scroll upward.
4782If ARG is the atom `-', scroll upward by nearly full screen." 4797If 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)