From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: line-move-visual never set to nil? Date: Tue, 29 Jul 2008 10:34:08 -0400 Message-ID: <87y73kbvz3.fsf@stupidchicken.com> References: <18571.25125.311010.324079@gargle.gargle.HOWL> <87od4k1nj5.fsf@stupidchicken.com> <1F7E32D0-7C19-4950-94DB-F6CD33A56EB0@gmail.com> <6161f3180807290043l2b0cc1as85a338204687f183@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1217342440 28520 80.91.229.12 (29 Jul 2008 14:40:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 29 Jul 2008 14:40:40 +0000 (UTC) Cc: David Reitter , emacs-devel@gnu.org, Stefan Monnier , raman@users.sourceforge.net To: "Andrew W. Nosenko" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 29 16:41:29 2008 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.50) id 1KNqNU-00089f-PT for ged-emacs-devel@m.gmane.org; Tue, 29 Jul 2008 16:40:41 +0200 Original-Received: from localhost ([127.0.0.1]:53922 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KNqMa-0002iK-Iq for ged-emacs-devel@m.gmane.org; Tue, 29 Jul 2008 10:39:44 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KNqHL-00081D-18 for emacs-devel@gnu.org; Tue, 29 Jul 2008 10:34:19 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KNqHJ-000801-2e for emacs-devel@gnu.org; Tue, 29 Jul 2008 10:34:18 -0400 Original-Received: from [199.232.76.173] (port=33910 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KNqHI-0007zm-QR for emacs-devel@gnu.org; Tue, 29 Jul 2008 10:34:16 -0400 Original-Received: from c-24-63-201-57.hsd1.ma.comcast.net ([24.63.201.57]:23245 helo=furry) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KNqHI-0001uq-9C for emacs-devel@gnu.org; Tue, 29 Jul 2008 10:34:16 -0400 Original-Received: by furry (Postfix, from userid 1000) id E8053C055; Tue, 29 Jul 2008 10:34:08 -0400 (EDT) In-Reply-To: <6161f3180807290043l2b0cc1as85a338204687f183@mail.gmail.com> (Andrew W. Nosenko's message of "Tue, 29 Jul 2008 10:43:14 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) 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:101689 Archived-At: "Andrew W. Nosenko" writes: > The biggest problem with "visual" line motion ... is that current > defaults are beaks keybord macro. Just try to record some macro that > uses up/down key having wrapped lines, change width of the > window/frame and enjoy. :-( That's a good point. That's also why line-move doesn't try to scroll tall images when executing a keyboard macro. Maybe line-move-visual needs the same treatment, like in the following patch. WDYT? *** trunk/lisp/simple.el.~1.939.~ 2008-07-28 10:55:05.000000000 -0400 --- trunk/lisp/simple.el 2008-07-29 10:32:51.000000000 -0400 *************** *** 3978,3994 **** ;; a cleaner solution to the problem of making C-n do something ;; useful given a tall image. (defun line-move (arg &optional noerror to-end try-vscroll) ! (unless (and auto-window-vscroll try-vscroll ! ;; Only vscroll for single line moves ! (= (abs arg) 1) ! ;; But don't vscroll in a keyboard macro. ! (not defining-kbd-macro) ! (not executing-kbd-macro) ! (line-move-partial arg noerror to-end)) ! (set-window-vscroll nil 0 t) ! (if line-move-visual ! (line-move-visual arg noerror) ! (line-move-1 arg noerror to-end)))) ;; Display-based alternative to line-move-1. ;; Arg says how many lines to move. The value is t if we can move the --- 3978,3996 ---- ;; a cleaner solution to the problem of making C-n do something ;; useful given a tall image. (defun line-move (arg &optional noerror to-end try-vscroll) ! (if (or defining-kbd-macro executing-kbd-macro) ! ;; If inside a keyboard macro, don't vscroll and don't move by ! ;; screen lines. ! (progn (set-window-vscroll nil 0 t) ! (line-move-1 arg noerror to-end)) ! ;; Otherwise, only vscroll for single line moves ! (unless (and auto-window-vscroll try-vscroll ! (= (abs arg) 1) ! (line-move-partial arg noerror to-end)) ! (set-window-vscroll nil 0 t) ! (if line-move-visual ! (line-move-visual arg noerror) ! (line-move-1 arg noerror to-end))))) ;; Display-based alternative to line-move-1. ;; Arg says how many lines to move. The value is t if we can move the