From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: lorentey@elte.hu (=?iso-8859-2?Q?L=F5rentey_K=E1roly?=) Newsgroups: gmane.emacs.devel Subject: Re: move-beginning-of-line misbehaves on wrapped-line invisible text - recent cvs checkout Date: Thu, 26 Jan 2006 04:28:49 +0100 Message-ID: References: <2cd46e7f0601121612y386d057ft68324aeb352b777d@mail.gmail.com> <2cd46e7f0601220812v53945980x8d045c3df55e5f2c@mail.gmail.com> <2cd46e7f0601231017h65e30274x18504d460d5d8042@mail.gmail.com> <2cd46e7f0601231247p76c5e25fk582a2f90c7876146@mail.gmail.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0885916766==" X-Trace: sea.gmane.org 1138249385 31303 80.91.229.2 (26 Jan 2006 04:23:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 26 Jan 2006 04:23:05 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 26 05:22:59 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1F1yem-00037J-ER for ged-emacs-devel@m.gmane.org; Thu, 26 Jan 2006 05:22:48 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F1yhX-0003qh-Tl for ged-emacs-devel@m.gmane.org; Wed, 25 Jan 2006 23:25:40 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1F1xrZ-0004cn-21 for emacs-devel@gnu.org; Wed, 25 Jan 2006 22:31:57 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1F1xrX-0004cb-DQ for emacs-devel@gnu.org; Wed, 25 Jan 2006 22:31:56 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F1xrX-0004cY-9j for emacs-devel@gnu.org; Wed, 25 Jan 2006 22:31:55 -0500 Original-Received: from [212.92.23.158] (helo=ninsei.hu) by monty-python.gnu.org with esmtp (Exim 4.52) id 1F1xos-0001gE-TR; Wed, 25 Jan 2006 22:29:16 -0500 Original-Received: from walrus (line-122-12.gprs.westel900.net [212.51.122.12]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by chatsubo.ninsei.hu (Postfix) with ESMTP id B0E70783C; Thu, 26 Jan 2006 04:28:42 +0100 (CET) Original-Received: by walrus (Postfix, from userid 1000) id A1EE2EDAF1; Thu, 26 Jan 2006 04:28:49 +0100 (CET) Original-To: ken.manheimer@gmail.com In-Reply-To: <2cd46e7f0601231247p76c5e25fk582a2f90c7876146@mail.gmail.com> (Ken Manheimer's message of "Mon, 23 Jan 2006 15:47:28 -0500") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.52 (gnu/linux) X-Mailman-Approved-At: Wed, 25 Jan 2006 23:25:25 -0500 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:49569 Archived-At: --===============0885916766== Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Ken Manheimer writes: > i now have a fix i'm more confident about, because (1) it takes care > of another problem i noticed, even with my previous fix, and (2) it > departs less from the checked-in version of the function, leaving less > room for betrayal of unfamiliar concerns. I propose the following change instead, which, in addition to incorporating your fix, restores the useful special handling of field boundaries. As noted in another thread, C-a and C-e behaviour is currently broken in the minibuffer, in *shell* buffers, in entry fields in customization buffers, and all other places where fields are used. This makes `move-{beginning,end}-of-line' inconsistent with the original `{beginning,end}-of-line' commands (which are still available) and the underlying `line-{beginning,end}-position' functions. Meanwhile, I committed two (hopefully non-controversial) related fixes in CVS; the first is for an annoying cursor display problem when point is just before an ellipsis coming from an invisible overlay. The second fixed `constrain-to-field' to always return the right result when new-pos or old-pos is on a field boundary. --=-=-= Content-Type: text/x-patch Content-Disposition: inline Index: simple.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/simple.el,v retrieving revision 1.786 diff -c -p -r1.786 simple.el *** simple.el 23 Jan 2006 04:05:59 -0000 1.786 --- simple.el 26 Jan 2006 02:52:52 -0000 *************** and `current-column' to be able to ignor *** 3691,3705 **** (defun move-end-of-line (arg) "Move point to end of current line as displayed. ! \(If there's an image in the line, this disregards newlines ! which are part of the text that the image rests on.) 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." (interactive "p") (or arg (setq arg 1)) ! (let (done) (while (not done) (let ((newpos (save-excursion --- 3691,3712 ---- (defun move-end-of-line (arg) "Move point to end of current line as displayed. ! \(This disregards invisible newlines such as those ! which are part of the text that an image rests on.) 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 function does not move point across a field boundary unless that ! would move point to a different line than the original, unconstrained ! result. If N is nil or 1, and a rear-sticky field ends at point, ! the point does not move. 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 *************** To ignore intangibility, bind `inhibit-p *** 3721,3749 **** ;; and now we're not really at eol, ;; keep going. (setq arg 1) ! (setq done t))))))) (defun move-beginning-of-line (arg) "Move point to beginning of current line as displayed. ! \(If there's an image in the line, this disregards newlines ! which are part of the text that the image rests on.) 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." (interactive "p") (or arg (setq arg 1)) (if (/= arg 1) (line-move (1- arg) t)) - - ;; Move to beginning-of-line, ignoring fields and invisibles. - (skip-chars-backward "^\n") - (while (and (not (bobp)) (line-move-invisible-p (1- (point)))) - (goto-char (previous-char-property-change (1- (point)))) - (skip-chars-backward "^\n")) (let ((orig (point))) (vertical-motion 0) (if (/= orig (point)) (goto-char (constrain-to-field (point) orig (/= arg 1) t nil))))) --- 3728,3764 ---- ;; and now we're not really at eol, ;; keep going. (setq arg 1) ! (setq done t))))) ! (if (/= orig (point)) ! (goto-char (constrain-to-field (point) orig (/= arg 1) t nil))))) (defun move-beginning-of-line (arg) "Move point to beginning of current line as displayed. ! \(This disregards invisible newlines such as those ! which are part of the text that an image rests on.) 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 function does not move point across a field boundary unless that ! would move point to a different line than the original, unconstrained ! result. If N is nil or 1, and a front-sticky field starts at point, ! the 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) (line-move (1- arg) t)) (let ((orig (point))) + ;; Move to beginning-of-line, ignoring fields and invisibles. + (skip-chars-backward "^\n") + (while (and (not (bobp)) (line-move-invisible-p (1- (point)))) + (goto-char (previous-char-property-change (point))) + (skip-chars-backward "^\n")) (vertical-motion 0) (if (/= orig (point)) (goto-char (constrain-to-field (point) orig (/= arg 1) t nil))))) --=-=-= Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: quoted-printable =2D-=20 K=E1roly --=-=-=-- --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQBD2EHx6eoyqA+yej8RAsYnAJ9nchOHC2znHrYO+2rorx006Y9sfQCgldsy 2Px1txRpBOjz9Vkv10vnvuE= =GFsK -----END PGP SIGNATURE----- --==-=-=-- --===============0885916766== 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 --===============0885916766==--