From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: lorentey@elte.hu (=?utf-8?Q?L=C5=91rentey_K=C3=A1roly?=) Newsgroups: gmane.emacs.devel Subject: Re: Something is rotten with end-of-line and move-end-of-line Date: Mon, 28 Nov 2005 23:24:40 +0100 Message-ID: References: <85y83dleho.fsf@lola.goethe.zz> <85br04btnu.fsf@lola.goethe.zz> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1133217056 6973 80.91.229.2 (28 Nov 2005 22:30:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 28 Nov 2005 22:30:56 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 28 23:30:46 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EgrQk-0007YH-H5 for ged-emacs-devel@m.gmane.org; Mon, 28 Nov 2005 23:25:03 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EgrQj-0002ps-5l for ged-emacs-devel@m.gmane.org; Mon, 28 Nov 2005 17:25:01 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EgrQN-0002of-Qo for emacs-devel@gnu.org; Mon, 28 Nov 2005 17:24:40 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EgrQA-0002k4-PN for emacs-devel@gnu.org; Mon, 28 Nov 2005 17:24:39 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EgrQA-0002jw-Lo for emacs-devel@gnu.org; Mon, 28 Nov 2005 17:24:26 -0500 Original-Received: from [212.92.23.158] (helo=ninsei.hu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EgrQ9-0000KK-FM for emacs-devel@gnu.org; Mon, 28 Nov 2005 17:24:26 -0500 Original-Received: from walrus (walrus.inf.elte.hu [157.181.166.149]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by chatsubo.ninsei.hu (Postfix) with ESMTP id 290601AD07 for ; Mon, 28 Nov 2005 23:24:16 +0100 (CET) Original-Received: by walrus (Postfix, from userid 1000) id 41AD85E136; Mon, 28 Nov 2005 23:24:41 +0100 (CET) Original-To: emacs-devel@gnu.org In-Reply-To: (=?utf-8?Q?L=C5=91rentey=09K=C3=A1roly's?= message of "Mon, 28 Nov 2005 21:17:59 +0100") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.52 (gnu/linux) 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:46732 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable L=C5=91rentey K=C3=A1roly writes: > Indeed, there are some bugs. [...] > Obviously this needs to be elaborated. Here is a patch that updates the doc strings and fixes move-end-of-line behaviour with respect to field boundaries. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff -u -3 -p -r1.774 simple.el *** simple.el 28 Nov 2005 19:59:34 -0000 1.774 --- simple.el 28 Nov 2005 22:10:28 -0000 *************** *** 3641,3658 **** (goto-char (previous-char-property-change (point) line-beg)))))))) (defun move-end-of-line (arg) ! "Move point to end of current line. With argument ARG not nil or 1, move forward ARG - 1 lines first. If point reaches the beginning or end of buffer, it stops there. To ignore intangibility, bind `inhibit-point-motion-hooks' to t. ! This command does not move point across a field boundary unless doing so ! would move beyond there to a different line; if ARG is nil or 1, and ! point starts at a field boundary, point does not move. To ignore field ! boundaries bind `inhibit-field-text-motion' to t." (interactive "p") (or arg (setq arg 1)) ! (let (done) (while (not done) (let ((newpos (save-excursion --- 3641,3664 ---- (goto-char (previous-char-property-change (point) line-beg)))))))) (defun move-end-of-line (arg) ! "Move point to end of current display line. With argument ARG not nil or 1, move forward ARG - 1 lines first. If point reaches the beginning or end of buffer, it stops there. To ignore intangibility, bind `inhibit-point-motion-hooks' to t. ! Unlike `end-of-line' (which see), this command ignores invisible ! newline characters while it searches for the end of the current ! line. It moves the point to the end of the displayed screen ! line, which is not necessarily the same as the end of the current ! line in the buffer. ! ! This command does not move point across the boundary of the ! current field. To ignore field boundaries bind ! `inhibit-field-text-motion' to t." (interactive "p") (or arg (setq arg 1)) ! (let ((orig (point)) ! done) (while (not done) (let ((newpos (save-excursion *************** *** 3664,3670 **** (goto-char (previous-char-property-change (point)))) (backward-char 1))) (point))))) ! (goto-char newpos) (if (and (> (point) newpos) (eq (preceding-char) ?\n)) (backward-char 1) --- 3670,3676 ---- (goto-char (previous-char-property-change (point)))) (backward-char 1))) (point))))) ! (goto-char (constrain-to-field newpos orig (/= arg 1) t nil)) (if (and (> (point) newpos) (eq (preceding-char) ?\n)) (backward-char 1) *************** *** 3682,3691 **** If point reaches the beginning or end of buffer, it stops there. To ignore intangibility, bind `inhibit-point-motion-hooks' to t. ! This command does not move point across a field boundary unless doing so ! would move beyond there to a different line; if ARG is nil or 1, and ! point starts at a field boundary, point does not move. To ignore field ! boundaries bind `inhibit-field-text-motion' to t." (interactive "p") (or arg (setq arg 1)) (if (/= arg 1) --- 3688,3703 ---- If point reaches the beginning or end of buffer, it stops there. To ignore intangibility, bind `inhibit-point-motion-hooks' to t. ! Unlike `beginning-of-line' (which see), this command ignores ! invisible newline characters while it searches for the beginning ! of the current line. It moves the point to the beginning of the ! displayed screen line, which is not necessarily the same as the ! end of the current line in the buffer. ! ! This command does not move point across the boundary of the ! current field. If ARG is nil or 1, and point starts at a field ! boundary, point does not move. To ignore field boundaries bind ! `inhibit-field-text-motion' to t." (interactive "p") (or arg (setq arg 1)) (if (/= arg 1) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable I have a feeling that C-e should behave like C-a on a field boundary, and leave the point unchanged when it is at the field end. This would make these operations idempotent. For example, let's say the buffer contents are other stuff FIELD other stuff Suppose that the characters "FIELD" have the same (front-sticky) field property, while the rest are non-field. Currently, move-beginning-of-line (C-a) is a no-op when point is before F: other stuff FIELD other stuff I argue that either C-a should be changed to go the line beginning, or move-end-of-line should behave symmetrically, i.e. it should have the following fixed point: other stuff FIELD other stuff This could be achieved by changing `constrain-to-field'. The various behaviours of C-a/C-e near field-field boundaries are also somewhat surprising at the moment. --=20 K=C3=A1roly --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --=-=-=--