From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Ken Manheimer" Newsgroups: gmane.emacs.devel Subject: Re: need option so line-move-to-column ignores fields, plus patch Date: Thu, 31 Aug 2006 12:25:32 -0400 Message-ID: <2cd46e7f0608310925t38a3e24fk81982675be954448@mail.gmail.com> References: <2cd46e7f0608310848l743430e9ia7a1d45e22428083@mail.gmail.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_4739_24408936.1157041532219" X-Trace: sea.gmane.org 1157041600 32266 80.91.229.2 (31 Aug 2006 16:26:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 31 Aug 2006 16:26:40 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 31 18:26:38 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 1GIpMS-0003iW-PU for ged-emacs-devel@m.gmane.org; Thu, 31 Aug 2006 18:25:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GIpMS-0004c6-A3 for ged-emacs-devel@m.gmane.org; Thu, 31 Aug 2006 12:25:48 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GIpMF-0004aP-FS for emacs-devel@gnu.org; Thu, 31 Aug 2006 12:25:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GIpMD-0004a1-PF for emacs-devel@gnu.org; Thu, 31 Aug 2006 12:25:34 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GIpMD-0004Zy-Dq for emacs-devel@gnu.org; Thu, 31 Aug 2006 12:25:33 -0400 Original-Received: from [64.233.184.230] (helo=wr-out-0506.google.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GIpVs-0003MC-2q for emacs-devel@gnu.org; Thu, 31 Aug 2006 12:35:32 -0400 Original-Received: by wr-out-0506.google.com with SMTP id 71so245676wra for ; Thu, 31 Aug 2006 09:25:32 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=gBN/xdx3gZ3w55SIMWVeqLDC+CO+f4I7oDo82JhBQ0VgrwD7AGK/niF7SxoY6QF2z6CmgTlRXv4EpyhnyqcLDqdq5kwD22MyW5R3SjNezUANj+tva9mAOXquxjz6FK9aXJURafzEVAif2bqiiuov004ohDw8x7xrxNBdVk8SN2c= Original-Received: by 10.90.80.8 with SMTP id d8mr238345agb; Thu, 31 Aug 2006 09:25:32 -0700 (PDT) Original-Received: by 10.90.105.4 with HTTP; Thu, 31 Aug 2006 09:25:32 -0700 (PDT) Original-To: Emacs-Devel In-Reply-To: <2cd46e7f0608310848l743430e9ia7a1d45e22428083@mail.gmail.com> 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:59165 Archived-At: ------=_Part_4739_24408936.1157041532219 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline dang, my fix is not as simple or straight forwards as i hoped. line-move-finish duplicates some of the provision for fields. i don't understand why, but it only changes the resulting column occasionally, but then in the same way as before. the upshot is that, without an additional change, the cursor winds up in column 0 occasionally. my additional change accounts for that without preventing proper handling of intangible text, which is mixed together with the inter-line fielded text provision in line-move-finish. i've tested it and established that the intangible provision still works regardless, and the field-insensitivity is complete when line-move-ignore-fields is t. i also made line-move-ignore-fields buffer-local, in keeping with the judgement that this is a provision for modes, not users. here's the new version of the ChangeLog entry, and the new version of the patch is attached: 2006-08-22 Ken Manheimer * simple.el (line-move-ignore-fields): New internal variable for overriding line-move-finish and line-move-to-column' sensitivity to fields when doing column positioning. (line-move-finish): Respect line-move-ignore-fields. (line-move-to-column): Respect line-move-ignore-fields. On 8/31/06, Ken Manheimer wrote: > i propose a change to the way line-move-to-column to enable > insensitivity to fields. without this change, modes that make certain > uses of fields sacrifice column retention in line motion. i consider > that a bug, and this a bug fix. > > in my under-development allout extensions, i'm using field boundaries > to distinguish between an outline item's structural elements (the > guide lines and topic bullet area) and the item's content, > specifically the content on the item's head line: > > | | | > here's the content. the stuff before "here's" is the bullet > and guidelines. > > this is working exactly as i need - cursor motion from within the > headline content stops when it first hits the start of the content, > yet will move into the structure area (for hot-spot navigation) with a > subsequent ^A. > > the bug is that i can't use text fields this way without sacrificing > column retention on line moves, as far as i can tell. > line-move-to-column is hard-wired to respect fields when seeking the > prior positions column, so that moving the cursor between topics > usually leaves the cursor at column 0, which is almost always not what > the user wants. > > my patch introduces a new lisp-level variable, > `line-move-ignore-fields', and a condition in line-move-to-column to > obey that variable. the default setting of line-move-ignore-fields is > nil, so the current behavior remains. my allout extension sets it to > get the behavior it needs. > > (i made it a lisp-level rather than customization variable because i > expect that it's a modal, not user policy. i feel the same way about > line-move-ignore-invisible, though, so i'm breaking with that > precedent, and could be persuaded to have the variable i'm introducing > be customizable.) > > i would be interested to hear if i missed some better way to achieve > either the cursor motion i want in the headline, without using fields, > or have column retention without adding the field sensitivity > inhibition, as i'm doing. barring that, i think this is a necessary > bug fix. > > the patch is attached, and here's the ChangeLog entry: > > 2006-08-22 Ken Manheimer > > * simple.el (line-move-ignore-fields): New lisp-level variable for > overriding line-move-to-column's sensitivity to fields when doing > column positioning. > (line-move-to-column): Respect line-move-ignore-fields. -- ken ken.manheimer@gmail.com http://myriadicity.net ------=_Part_4739_24408936.1157041532219 Content-Type: text/plain; name=line-move-patch.txt; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: base64 X-Attachment-Id: f_erjcmr3d Content-Disposition: attachment; filename="line-move-patch.txt" LS0tIHNpbXBsZS5lbAkyMiBBdWcgMjAwNiAxNzo1NDo1MiAtMDQwMAkxLjgxMgorKysgc2ltcGxl LmVsCTMxIEF1ZyAyMDA2IDEyOjIxOjQ3IC0wNDAwCQpAQCAtMzQ2Niw2ICszNDY2LDEwIEBACiAg IDp0eXBlICdib29sZWFuCiAgIDpncm91cCAnZWRpdGluZy1iYXNpY3MpCiAKKyhkZWZ2YXIgbGlu ZS1tb3ZlLWlnbm9yZS1maWVsZHMgbmlsCisgICIqTm9uLW5pbCBtZWFucyBcXFtuZXh0LWxpbmVd IGFuZCBcXFtwcmV2aW91cy1saW5lXSBpZ25vcmUgZmllbGRzLiIpCisobWFrZS12YXJpYWJsZS1i dWZmZXItbG9jYWwgJ2xpbmUtbW92ZS1pZ25vcmUtZmllbGRzKQorCiAoZGVmdW4gbGluZS1tb3Zl LWludmlzaWJsZS1wIChwb3MpCiAgICJSZXR1cm4gbm9uLW5pbCBpZiB0aGUgY2hhcmFjdGVyIGFm dGVyIFBPUyBpcyBjdXJyZW50bHkgaW52aXNpYmxlLiIKICAgKGxldCAoKHByb3AKQEAgLTM2ODMs NyArMzY4Nyw4IEBACiAJKGdvdG8tY2hhciBvcG9pbnQpCiAJKGxldCAoKGluaGliaXQtcG9pbnQt bW90aW9uLWhvb2tzIG5pbCkpCiAJICAoZ290by1jaGFyCi0JICAgKGNvbnN0cmFpbi10by1maWVs ZCBuZXcgb3BvaW50IG5pbCB0CisJICAgKGNvbnN0cmFpbi10by1maWVsZCBuZXcgKGlmIGxpbmUt bW92ZS1pZ25vcmUtZmllbGRzIG5ldyBvcG9pbnQpCisJCQkgICAgICAgbmlsIHQKIAkJCSAgICAg ICAnaW5oaWJpdC1saW5lLW1vdmUtZmllbGQtY2FwdHVyZSkpKQogCiAJOzsgSWYgYWxsIHRoaXMg bW92ZWQgdXMgdG8gYSBkaWZmZXJlbnQgbGluZSwKQEAgLTM3MDIsNyArMzcwNyw4IEBACiAgICAg KGxldCAoKG9wb2ludCAocG9pbnQpKSkKICAgICAgIChtb3ZlLXRvLWNvbHVtbiBjb2wpCiAgICAg ICA7OyBtb3ZlLXRvLWNvbHVtbiBkb2Vzbid0IHJlc3BlY3QgZmllbGQgYm91bmRhcmllcy4KLSAg ICAgIChnb3RvLWNoYXIgKGNvbnN0cmFpbi10by1maWVsZCAocG9pbnQpIG9wb2ludCkpKSkKKyAg ICAgIChpZiAobm90IGxpbmUtbW92ZS1pZ25vcmUtZmllbGRzKQorICAgICAgICAgIChnb3RvLWNo YXIgKGNvbnN0cmFpbi10by1maWVsZCAocG9pbnQpIG9wb2ludCkpKSkpCiAKICAgKHdoZW4gKGFu ZCBsaW5lLW1vdmUtaWdub3JlLWludmlzaWJsZQogCSAgICAgKG5vdCAoYm9scCkpIChsaW5lLW1v dmUtaW52aXNpYmxlLXAgKDEtIChwb2ludCkpKSkK ------=_Part_4739_24408936.1157041532219 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 ------=_Part_4739_24408936.1157041532219--