From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Keeping hidden characters visible to the cursor Date: Sun, 15 Nov 2009 23:50:29 -0500 Message-ID: References: <58e36f420911151434t774614cma327eb36beb8396d@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 1258347051 11505 80.91.229.12 (16 Nov 2009 04:50:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 16 Nov 2009 04:50:51 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Guillermo R. Palavecino" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 16 05:50:44 2009 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 1N9tY3-0002tC-Ap for ged-emacs-devel@m.gmane.org; Mon, 16 Nov 2009 05:50:43 +0100 Original-Received: from localhost ([127.0.0.1]:39482 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N9tY3-0002bl-6s for ged-emacs-devel@m.gmane.org; Sun, 15 Nov 2009 23:50:43 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N9tXx-0002aZ-Lo for emacs-devel@gnu.org; Sun, 15 Nov 2009 23:50:37 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N9tXs-0002Sy-EC for emacs-devel@gnu.org; Sun, 15 Nov 2009 23:50:36 -0500 Original-Received: from [199.232.76.173] (port=40688 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N9tXs-0002Sf-93 for emacs-devel@gnu.org; Sun, 15 Nov 2009 23:50:32 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:53195 helo=ironport2-out.pppoe.ca) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N9tXr-00021s-PN for emacs-devel@gnu.org; Sun, 15 Nov 2009 23:50:32 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAD9pAEtMCqHJ/2dsb2JhbACBTdIYhDwEiT4 X-IronPort-AV: E=Sophos;i="4.44,749,1249272000"; d="scan'208";a="49457563" Original-Received: from 76-10-161-201.dsl.teksavvy.com (HELO pastel.home) ([76.10.161.201]) by ironport2-out.pppoe.ca with ESMTP; 15 Nov 2009 23:50:29 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 5AF188154; Sun, 15 Nov 2009 23:50:29 -0500 (EST) In-Reply-To: <58e36f420911151434t774614cma327eb36beb8396d@mail.gmail.com> (Guillermo R. Palavecino's message of "Sun, 15 Nov 2009 20:34:00 -0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:117028 Archived-At: > font-lock-string-face to get the underlining BUT there's one thing I could > not achieve yet: To keep the cursor aware of these hidden characters. > Whenever I moved the cursor it skipped the position as if nothing existed in > that position, and entering some text right before the string went inside > the string. This is part of `point-adjustment'. E.g. you can set global-disable-point-adjustment to disable it. But maybe a better way is to change the way you make the text invisible: depending on the stickiness (resp. the insertion-type) of the text-property (resp. overlay), the point-adjustment will try to put point at one end or the other of the invisible text. If neither end is sticky, then point will sometimes get to one end and sometimes to the other, depending on how you get there. E.g. if the "b" in "abc" is made non-sticky invisible, then C-f from "!abc" will get you to "a!bc" and the next C-f to "abc!", whereas C-b from "abc!" will get you to "ab!c" and the next to "!abc". Stefan