unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Guillermo R. Palavecino" <grpala@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Keeping hidden characters visible to the cursor
Date: Sun, 15 Nov 2009 23:50:29 -0500	[thread overview]
Message-ID: <jwvvdhb9izg.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <58e36f420911151434t774614cma327eb36beb8396d@mail.gmail.com> (Guillermo R. Palavecino's message of "Sun, 15 Nov 2009 20:34:00 -0200")

> 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




      reply	other threads:[~2009-11-16  4:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-15 22:34 Keeping hidden characters visible to the cursor Guillermo R. Palavecino
2009-11-16  4:50 ` Stefan Monnier [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvvdhb9izg.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=grpala@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).