From duanpanda@gmail.com Sat May 23 23:28:52 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 24 May 2009 06:28:52 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.1 required=4.0 tests=FOURLA autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n4O6Slwi030737 for ; Sat, 23 May 2009 23:28:49 -0700 Received: from mx10.gnu.org ([199.232.76.166]:59744) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1M87CR-0006VR-71 for emacs-pretest-bug@gnu.org; Sun, 24 May 2009 02:28:47 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1M87CQ-0006va-Hz for emacs-pretest-bug@gnu.org; Sun, 24 May 2009 02:28:47 -0400 Received: from mail-px0-f111.google.com ([209.85.216.111]:56111) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M87CP-0006vC-Ln for emacs-pretest-bug@gnu.org; Sun, 24 May 2009 02:28:45 -0400 Received: by pxi9 with SMTP id 9so2875277pxi.14 for ; Sat, 23 May 2009 23:28:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=h3mpRZnQKFyDCx+uHUfiavdO3zS5cOPtwWsovsj0sqQ=; b=Ytx1biiEpecs2X2vmWrEFAQAgdJBZZ4prr76Irr9jHjwlXUXpVfAnw8yRNiFewHnj6 UYf5q01zcag95Q5O796bs9yQUudAHLzFlLS9CG2RYIxI6LuNXChtu2KMi8NwAMrRDkcE xWDvUqCTfdZ5//qhgRG4bJFsE8823eyn3DbcQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=LJrGH6gVIylJW7dD9TCJWEete6uXpjyu1aoJ/dZi20aGr/FEmnQarDTgLG7OQH+l+0 cQYDGNlX3fnlVCeCRp4E9BJ5lPnpXW5d0tc7fGw+zkUIB01R3Qsz66azRE//0skceBLi wGfYew5W3cjbshKYZvSQBbXqYU19CEWv/l/ik= MIME-Version: 1.0 Received: by 10.114.179.1 with SMTP id b1mr11952346waf.70.1243146523489; Sat, 23 May 2009 23:28:43 -0700 (PDT) Date: Sun, 24 May 2009 14:28:43 +0800 Message-ID: <30dcab0d0905232328i619340cfv1590192f4c1e9855@mail.gmail.com> Subject: 23.0.92; View-scroll-page-forward/backward does wrong in text mode after text-scale-increase/decrease From: =?GB2312?B?tsvI8A==?= To: emacs-pretest-bug@gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Open a normal text file with the text mode, do (view-mode) (text-scale-increase) or (text-scale-decrease) (View-scroll-page-forward) or (View-scroll-page-backward) The View-scroll-page-* command does wrong. It cannot scroll "page size" as expected like it does when the text-scale minor mode is off. In GNU Emacs 23.0.92.1 (i386-mingw-nt5.1.2600) of 2009-03-31 on SOFT-MJASON Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (3.4)' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: CHS value of $XMODIFIERS: nil locale-coding-system: cp936 default-enable-multibyte-characters: t Major mode: Text Minor modes in effect: tooltip-mode: t tool-bar-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t view-mode: t Recent input: C-x C-f d : / c o d e / b r e w / c t m a i l / r e f / p r o t o c r f c 1 9 3 9 M-x v i e w SPC m o d e SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC M-x l i n SPC u m SPC m o e d e SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC M-x M-p C-x C-f d : / e h o m e / t e C-@ C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-w C-x d n n n n n n n n n n n n n n n n n p p d x y e s C-x b C-x k y e s M-x r e p o r t C-g M-x r e p o r t V i e w - C-g C-x b C-h k SPC C-x b C-x b M-x r e p o r t Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Making completion list... Linum mode enabled Linum mode disabled Mark set 1 of 1 deletions 1 deletion done Quit [2 times] Type C-x 1 to delete the help window. From cyd@stupidchicken.com Tue May 26 07:47:04 2009 Received: (at 3361) by emacsbugs.donarmstrong.com; 26 May 2009 14:47:04 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-1.9 required=4.0 tests=AWL,MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n4QEkx6l016006 for <3361@emacsbugs.donarmstrong.com>; Tue, 26 May 2009 07:47:00 -0700 Received: by cyd.mit.edu (Postfix, from userid 1000) id 0524757E25C; Tue, 26 May 2009 10:47:22 -0400 (EDT) From: Chong Yidong To: emacs-devel@gnu.org Cc: duanpanda@gmail.com, 3361@debbugs.gnu.org Subject: Re: 23.0.92; View-scroll-page-forward/backward does wrong in text mode after text-scale-increase/decrease Date: Tue, 26 May 2009 10:47:21 -0400 Message-ID: <87d49v53ba.fsf@cyd.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > Open a normal text file with the text mode, do > (view-mode) > (text-scale-increase) or (text-scale-decrease) > (View-scroll-page-forward) or (View-scroll-page-backward) > The View-scroll-page-* command does wrong. It cannot scroll "page > size" as expected like it does when the text-scale minor mode is off. View-mode, written in the dawn of time, assumes that all lines have the default height. The following patch changes it so that scroll-up/scroll-down are passed nil arguments where possible; then Emacs will automatically determine how to scroll by one page, taking variable-height lines and text-scaling into account. It's not good to make this kind of change at this stage in the release, but this bug would be pretty annoying if you happen to come across it, and that's much more likely now we've introduced the text-scaling commands. Could someone on emacs-devel help review the patch? *** trunk/lisp/view.el.~1.102.~ 2009-05-26 10:34:04.000000000 -0400 --- trunk/lisp/view.el 2009-05-26 10:39:03.000000000 -0400 *************** *** 740,747 **** ;;; Some help routines. (defun view-window-size () ! ;; Window height excluding mode line. ! (1- (window-height))) ;; (defun view-last-command (&optional who what) ;; (setq view-last-command-entry this-command) --- 740,754 ---- ;;; Some help routines. (defun view-window-size () ! ;; Return the number of lines in the current window, excluding the ! ;; mode line. Using `window-line-height' accounts for ! ;; variable-height fonts. ! (let ((h (window-line-height -1))) ! (if h ! (1+ (nth 1 h)) ! ;; This should not happen, but if `window-line-height' returns ! ;; nil, fall back on `window-height'. ! (1- (window-height))))) ;; (defun view-last-command (&optional who what) ;; (setq view-last-command-entry this-command) *************** *** 761,771 **** (recenter '(1))) (defun view-page-size-default (lines) ! ;; Get page size. ! (let ((default (- (view-window-size) next-screen-context-lines))) ! (if (or (null lines) (zerop (setq lines (prefix-numeric-value lines)))) ! default ! (min (abs lines) default)))) (defun view-set-half-page-size-default (lines) ;; Get and maybe set half page size. --- 768,780 ---- (recenter '(1))) (defun view-page-size-default (lines) ! ;; Return nil if LINES is nil, 0, or larger than ! ;; `view-window-size'. Otherwise, return LINES. ! (and lines ! (not (zerop (setq lines (prefix-numeric-value lines)))) ! (<= (abs lines) ! (abs (- (view-window-size) next-screen-context-lines))) ! lines)) (defun view-set-half-page-size-default (lines) ;; Get and maybe set half page size. *************** *** 827,854 **** ;; This function does the job for all the scrolling commands. ;; Scroll forward LINES lines. If BACKWARD is true scroll backwards. ;; If LINES is negative scroll in the other direction. If LINES is 0 or nil, ! ;; scroll DEFAULT lines. If MAXDEFAULT is true then scroll no more than a ! ;; window full. (if (or (null lines) (zerop (setq lines (prefix-numeric-value lines)))) (setq lines default)) ! (when (< lines 0) ! (setq backward (not backward)) (setq lines (- lines))) ! (setq default (view-page-size-default nil)) ; Max scrolled at a time. ! (if maxdefault (setq lines (min lines default))) ! (cond ! (backward (scroll-down lines)) ! ((view-really-at-end) ! (if view-scroll-auto-exit (View-quit) ! (ding) ! (view-end-message))) ! (t (while (> lines default) ! (scroll-up default) ! (setq lines (- lines default)) ! (if (view-really-at-end) (setq lines 0))) ! (scroll-up lines) ! (if (view-really-at-end) (view-end-message)) ! (move-to-window-line -1) ! (beginning-of-line)))) (defun view-really-at-end () ;; Return true if buffer end visible. Maybe revert buffer and test. --- 836,857 ---- ;; This function does the job for all the scrolling commands. ;; Scroll forward LINES lines. If BACKWARD is true scroll backwards. ;; If LINES is negative scroll in the other direction. If LINES is 0 or nil, ! ;; scroll DEFAULT lines (if DEFAULT is nil, scroll by one page). If ! ;; MAXDEFAULT is true then scroll no more than a window full. (if (or (null lines) (zerop (setq lines (prefix-numeric-value lines)))) (setq lines default)) ! (when (and lines (< lines 0)) ! (setq backward (not backward) lines (- lines))) ! (when (and maxdefault lines (> lines (view-window-size))) ! (setq lines nil)) ! (cond (backward (scroll-down lines)) ! ((view-really-at-end) ! (if view-scroll-auto-exit ! (View-quit) ! (ding) ! (view-end-message))) ! (t (scroll-up lines) ! (if (view-really-at-end) (view-end-message))))) (defun view-really-at-end () ;; Return true if buffer end visible. Maybe revert buffer and test. From monnier@iro.umontreal.ca Tue May 26 10:19:21 2009 Received: (at 3361) by emacsbugs.donarmstrong.com; 26 May 2009 17:19:22 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.2 required=4.0 tests=AWL,MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from ironport2-out.teksavvy.com (ironport2-out.teksavvy.com [206.248.154.182]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n4QHJIni005491 for <3361@emacsbugs.donarmstrong.com>; Tue, 26 May 2009 10:19:19 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtIFACfBG0rO+JxR/2dsb2JhbACBT80qhAsFhX0 X-IronPort-AV: E=Sophos;i="4.41,253,1241409600"; d="scan'208";a="39128473" Received: from 206-248-156-81.dsl.teksavvy.com (HELO pastel.home) ([206.248.156.81]) by ironport2-out.teksavvy.com with ESMTP; 26 May 2009 13:19:12 -0400 Received: by pastel.home (Postfix, from userid 20848) id 9E88984B6; Tue, 26 May 2009 13:19:12 -0400 (EDT) From: Stefan Monnier To: Chong Yidong Cc: emacs-devel@gnu.org, 3361@debbugs.gnu.org, duanpanda@gmail.com Subject: Re: 23.0.92; View-scroll-page-forward/backward does wrong in text mode after text-scale-increase/decrease Message-ID: References: <87d49v53ba.fsf@cyd.mit.edu> Date: Tue, 26 May 2009 13:19:12 -0400 In-Reply-To: <87d49v53ba.fsf@cyd.mit.edu> (Chong Yidong's message of "Tue, 26 May 2009 10:47:21 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.94 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > It's not good to make this kind of change at this stage in the release, > but this bug would be pretty annoying if you happen to come across it, > and that's much more likely now we've introduced the text-scaling > commands. Could someone on emacs-devel help review the patch? It looks fine to me. Tho, you could change the doccomments to docstrings while you're there. Stefan From cyd@stupidchicken.com Tue May 26 11:20:11 2009 Received: (at control) by emacsbugs.donarmstrong.com; 26 May 2009 18:20:11 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-1.9 required=4.0 tests=AWL autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n4QIK6Th014287 for ; Tue, 26 May 2009 11:20:07 -0700 Received: by cyd.mit.edu (Postfix, from userid 1000) id B8BF457E25C; Tue, 26 May 2009 14:20:28 -0400 (EDT) From: Chong Yidong To: control@debbugs.gnu.org Subject: close 3361 Date: Tue, 26 May 2009 14:20:28 -0400 Message-ID: <87k543zpxv.fsf@cyd.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii close 3361 thanks From unknown Sun Jun 15 13:00:47 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: $requester Subject: Internal Control Message-Id: bug archived. Date: Wed, 24 Jun 2009 14:24:10 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A log time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator