all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David <de_bb@arcor.de>
To: help-gnu-emacs@gnu.org
Subject: Confusion regarding invisible text
Date: Sun, 28 Sep 2008 13:04:19 +0200	[thread overview]
Message-ID: <87r674y1jg.fsf@arcor.de> (raw)

Hi all,

I'm trying to understand how Emacs handles cursor movements and
invisible text, and was hoping someone around here could shed some light
on this issue. I'm using the following test code (with Emacs 22.3):

(save-excursion
  (set-buffer (get-buffer-create "invtest"))
  (erase-buffer)
  (insert "\naaaaa\nbbbbb\n")
  (goto-char (point-min))
  (forward-line 1)
  (set-text-properties (point) (1+ (point-at-eol)) '(invisible t intangible t)))

If you evaluate the above and switch to the buffer "invtest", you will
only see the string "bbbbb", since "aaaaa" is made invisible. Now use
the arrow keys to put the cursor on the first "b" and do "C-u C-x =". It
will say that there is the invisible character "a" at point position
2. If you put the cursor on the next "b", it will correctly say that
it's a "b" at position 9.

It seems that I cannot access the point position of the first "b"
through cursor movements. The Emacs Lisp manual says:

"Thus, if the command moved point back into an invisible range, Emacs
moves point back to the beginning of that range, and then back one more
character.  If the command moved point forward into an invisible range,
Emacs moves point forward up to the first visible character that follows
the invisible text."

This seems to imply that cursor movement would skip over invisible text,
or am I misunderstanding this paragraph? I'd appreciate if someone could
explain this behavior to me, and maybe also how to best avoid a
situation like the above.

-David





             reply	other threads:[~2008-09-28 11:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-28 11:04 David [this message]
2008-10-01 19:47 ` Confusion regarding invisible text Nikolaj Schumacher

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

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

  git send-email \
    --in-reply-to=87r674y1jg.fsf@arcor.de \
    --to=de_bb@arcor.de \
    --cc=help-gnu-emacs@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.