From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: pjb@informatimago.com (Pascal J. Bourguignon) Newsgroups: gmane.emacs.help Subject: Re: line-move-visual Date: Tue, 15 Jun 2010 08:54:18 +0200 Organization: Informatimago Message-ID: <87bpbcrdk5.fsf@kuiper.lan.informatimago.com> References: <089883ee-0a63-4cb4-a0ec-d2fe4e71cc03@y18g2000prn.googlegroups.com> <87wruco5yq.fsf@lola.goethe.zz> <87wrubfd8p.fsf@rapttech.com.au> <848w6ndwn0.fsf@cs.bham.ac.uk> <87d3vx5cku.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1291834699 26560 80.91.229.12 (8 Dec 2010 18:58:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 8 Dec 2010 18:58:19 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 08 19:58:15 2010 Return-path: Envelope-to: geh-help-gnu-emacs@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 1PQPDT-0002Q7-9u for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 19:58:15 +0100 Original-Received: from localhost ([127.0.0.1]:34095 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQPDS-0001Bd-KQ for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 13:58:14 -0500 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs,comp.lang.lisp Original-Lines: 51 Original-X-Trace: individual.net W3gkDeAaq0vnv+A1mJwnbg64Wa8T78vVQDbEF1GXlmzL475osK Cancel-Lock: sha1:ODdiZWJiNDFmYzgwZjU0ZDc1MzFhNzZkNzc0YWMyNjQ3ZjM5OThiZA== sha1:a85kJLa0ovpeTgrb5HMkOVfM72g= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en X-Disabled: X-No-Archive: no User-Agent: Gnus/5.101 (Gnus v5.10.10) Emacs/23.2 (gnu/linux) Original-Xref: usenet.stanford.edu gnu.emacs.help:178948 comp.emacs:100041 comp.lang.lisp:289177 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:75840 Archived-At: Stefan Monnier writes: >>> principal way of working, rather than in special cases in some obscure >>> feature (keyboard macros). >> Keyboard macros are far from obscure. > > Indeed. > >>> And it was dashed near impossible to move easily to the middle of >>> long, long lines. >> C-u right-arrow > > How convenient! > Say you're in a window and want to go down 3 visual lines on the same > long logical line. What number do you use? Ok, let's make it easier > and say that you happen to know that the window is 76-chars wide. > So 76 by 3? quick? quick? 240. You can refine later. > Now let's do that again but with 13 lines, where you don't actually know > it's "13": you first have to count it. Let's say you can't even count the lines! You can always, and only with emacs, type: M-: (forward-char (/ (- (progn (end-of-line) (point)) (progn (beginning-of-line) (point))) 2)) RET > The best I could come up with, is C-76 C-f and then C-x z z z ... until > you reach the line. > Now this all becomes a lot more interesting once you add word-wrap into > the mix, or TABs, or bytes displayed \NNN, or the presence of various > fonts and/or font-sizes on that long line, or variable-pitch fonts, ... Well, C-f C-n is all you need. I mean, keep C-f pressed until the cursor reaches the column you want, you don't even need to count 76. And keep C-n pressed until the cursor reaches the line you want. > Stefan "who reached for the mouse in all those cases, tho > typically only after first unconsciously hitting C-n > a few times and then realizing that C-n jumped way > further than intended" WFM. So far. -- __Pascal Bourguignon__ http://www.informatimago.com/