From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel 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 Organization: JURTA Message-ID: <874ojozp27.fsf@mail.jurta.org> References: <877hol5qso.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1270570942 9541 80.91.229.12 (6 Apr 2010 16:22:22 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 6 Apr 2010 16:22:22 +0000 (UTC) Cc: Emacs developers To: Juanma Barranquero Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 06 18:22:20 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NzBXf-0005Gv-3Q for ged-emacs-devel@m.gmane.org; Tue, 06 Apr 2010 18:22:19 +0200 Original-Received: from localhost ([127.0.0.1]:43119 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NzBXe-0008RB-FS for ged-emacs-devel@m.gmane.org; Tue, 06 Apr 2010 12:22:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NzBTf-0006Ld-LA for emacs-devel@gnu.org; Tue, 06 Apr 2010 12:18:11 -0400 Original-Received: from [140.186.70.92] (port=33680 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NzBTd-0006KE-JU for emacs-devel@gnu.org; Tue, 06 Apr 2010 12:18:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NzBTb-000647-Qq for emacs-devel@gnu.org; Tue, 06 Apr 2010 12:18:09 -0400 Original-Received: from smtp-out2.starman.ee ([85.253.0.4]:59580 helo=mx2.starman.ee) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NzBTb-00063q-Gw for emacs-devel@gnu.org; Tue, 06 Apr 2010 12:18:07 -0400 X-Virus-Scanned: by Amavisd-New at mx2.starman.ee Original-Received: from mail.starman.ee (82.131.99.253.cable.starman.ee [82.131.99.253]) by mx2.starman.ee (Postfix) with ESMTP id 137333F40CD; Tue, 6 Apr 2010 19:18:00 +0300 (EEST) In-Reply-To: (Juanma Barranquero's message of "Tue, 6 Apr 2010 03:58:48 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:123272 Archived-At: > 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/