emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] /srv/bzr/emacs/trunk r99831: Scrolling commands which


From: Juri Linkov
Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r99831: Scrolling commands which does not signal errors at top/bottom.
Date: Tue, 06 Apr 2010 19:12:45 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu)

> Fine. I'm talking about the case when point does not stay in the same
> screen. I mean, try
>
>   emacs -Q --eval '(setq scroll-preserve-screen-position :always)'
>
> with emacs-23 and trunk, by moving the cursor to the end of some line
> in etc/NEWS and doing a few pg-up/pg-down, and I think you'll see the
> difference.

This means a customizable option is still necessary:

=== modified file 'lisp/emulation/pc-select.el'
--- lisp/emulation/pc-select.el 2010-04-05 22:54:57 +0000
+++ lisp/emulation/pc-select.el 2010-04-06 16:12:36 +0000
@@ -93,6 +93,9 @@ (defcustom pc-select-override-scroll-err
 errors are suppressed."
   :type 'boolean
   :group 'pc-select)
+(define-obsolete-variable-alias 'pc-select-override-scroll-error
+                                'scroll-error-top-bottom
+                                "24.1")
 
 (defcustom pc-select-selection-keys-only nil
   "*Non-nil means only bind the basic selection keys when started.

=== modified file 'lisp/simple.el'
--- lisp/simple.el      2010-04-06 13:08:58 +0000
+++ lisp/simple.el      2010-04-06 16:12:02 +0000
@@ -4877,6 +4877,16 @@ (define-globalized-minor-mode global-vis
 ;;; of buffer at first key-press (instead moves to top/bottom
 ;;; of buffer).
 
+(defcustom scroll-error-top-bottom nil
+  "Move point to top/bottom of buffer before signalling a scrolling error.
+A value of nil means just signal an error if no more scrolling possible.
+A value of t means point moves to the beginning or the end of the buffer
+\(depending on scrolling direction) when no more scrolling possible.
+When point is already on that position, then signal an error."
+  :type 'boolean
+  :group 'scrolling
+  :version "24.1")
+
 (defun scroll-up-command (&optional arg)
   "Scroll text of selected window upward ARG lines; or near full screen if no 
ARG.
 If `scroll-up' cannot scroll window further, move cursor to the bottom line.
@@ -4886,6 +4896,8 @@ (defun scroll-up-command (&optional arg)
 If ARG is the atom `-', scroll downward by nearly full screen."
   (interactive "^P")
   (cond
+   ((null scroll-error-top-bottom)
+    (scroll-up arg))
    ((eq arg '-) (scroll-down-command nil))
    ((< (prefix-numeric-value arg) 0)
     (scroll-down-command (- (prefix-numeric-value arg))))
@@ -4914,11 +4926,13 @@ (defun scroll-down-command (&optional ar
 If ARG is the atom `-', scroll upward by nearly full screen."
   (interactive "^P")
   (cond
+   ((null scroll-error-top-bottom)
+    (scroll-down arg))
    ((eq arg '-) (scroll-up-command nil))
    ((< (prefix-numeric-value arg) 0)
     (scroll-up-command (- (prefix-numeric-value arg))))

=== modified file 'lisp/tutorial.el'
--- lisp/tutorial.el    2010-01-13 08:35:10 +0000
+++ lisp/tutorial.el    2010-04-06 16:10:38 +0000
@@ -218,8 +218,8 @@ (defconst tutorial--default-keys
              (save-buffers-kill-terminal [?\C-x ?\C-c])
 
              ;; * SUMMARY
-             (scroll-up [?\C-v])
-             (scroll-down [?\M-v])
+             (scroll-up-command [?\C-v])
+             (scroll-down-command [?\M-v])
              (recenter-top-bottom [?\C-l])
 
              ;; * BASIC CURSOR CONTROL

=== modified file 'src/window.c'
--- src/window.c        2010-04-05 22:54:57 +0000
+++ src/window.c        2010-04-06 16:09:50 +0000
@@ -7377,9 +7377,9 @@ (let ((edges (window-edges))) (- (nth 2 
   initial_define_key (control_x_map, '<', "scroll-left");
   initial_define_key (control_x_map, '>', "scroll-right");
 
-  initial_define_key (global_map, Ctl ('V'), "scroll-up");
+  initial_define_key (global_map, Ctl ('V'), "scroll-up-command");
   initial_define_key (meta_map, Ctl ('V'), "scroll-other-window");
-  initial_define_key (meta_map, 'v', "scroll-down");
+  initial_define_key (meta_map, 'v', "scroll-down-command");
 }
 
 /* arch-tag: 90a9c576-0590-48f1-a5f1-6c96a0452d9f

-- 
Juri Linkov
http://www.jurta.org/emacs/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]