From: "Felix -" <felix.1@canids.net>
To: bug-gnu-emacs@gnu.org
Subject: bug#342: kill-line sometimes unexpectedly kills invisible text
Date: Sat, 31 May 2008 13:57:01 -0700 [thread overview]
Message-ID: <433125f80805311357ua664d33o59c682ceb215d6c5@mail.gmail.com> (raw)
emacs-version "22.2.1"
current line is visible,
next line is invisible,
I move to end of visible line,
then type ctrl-k.
I expect it to kill just the visible newline,
and sometimes it does that,
but sometimes it kills the invisible line too.
what's annoying is, it's inconsistent in an unobvious way.
the behavior depends on what's in the invisible text.
the underlying problem:
kill-line in that case uses forward-visible-line
to find the end of the kill region.
this code demonstrates the forward-visible-line problem:
(with-current-buffer (get-buffer-create "*test*")
(add-to-invisibility-spec '(foo . t))
(goto-char (point-max))
(insert "\n t1: invis ends with newline: abc\n"
(propertize "def\n ghi\n" 'invisible 'foo)
"\n jkl\n")
(search-backward "abc")
(insert "[")
(forward-visible-line 1)
(insert "]")
(goto-char (point-max))
(insert "\n t2: invis doesn't end with newline: abc\n"
(propertize "def\n ghi" 'invisible 'foo)
"\n jkl\n")
(search-backward "abc")
(insert "[")
(forward-visible-line 1)
(insert "]")
(pop-to-buffer (current-buffer))
)
when I run that, my *test* buffer ends up looking like this:
t1: invis ends with newline: [abc
...]
jkl
t2: invis doesn't end with newline: [abc
]...
jkl
I don't really care whether it does t1 or t2,
I just want it to be consistently t1 or t2.
next reply other threads:[~2008-05-31 20:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-31 20:57 Felix - [this message]
2008-06-01 8:26 ` bug#342: kill-line sometimes unexpectedly kills invisible text martin rudalics
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=433125f80805311357ua664d33o59c682ceb215d6c5@mail.gmail.com \
--to=felix.1@canids.net \
--cc=342@emacsbugs.donarmstrong.com \
--cc=bug-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.