From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#342: kill-line sometimes unexpectedly kills invisible text Date: Sun, 01 Jun 2008 10:26:56 +0200 Message-ID: <48425D50.3060703@gmx.at> References: <433125f80805311357ua664d33o59c682ceb215d6c5@mail.gmail.com> Reply-To: martin rudalics , 342@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1212310351 21958 80.91.229.12 (1 Jun 2008 08:52:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 1 Jun 2008 08:52:31 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org To: Felix - , 342@emacsbugs.donarmstrong.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 01 10:53:13 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K2jJE-0006DR-UK for geb-bug-gnu-emacs@m.gmane.org; Sun, 01 Jun 2008 10:53:01 +0200 Original-Received: from localhost ([127.0.0.1]:32914 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K2jIT-00042h-48 for geb-bug-gnu-emacs@m.gmane.org; Sun, 01 Jun 2008 04:52:13 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K2jI7-0003uU-Rc for bug-gnu-emacs@gnu.org; Sun, 01 Jun 2008 04:51:51 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K2jI6-0003tn-1m for bug-gnu-emacs@gnu.org; Sun, 01 Jun 2008 04:51:51 -0400 Original-Received: from [199.232.76.173] (port=36154 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K2jI5-0003tj-TU for bug-gnu-emacs@gnu.org; Sun, 01 Jun 2008 04:51:49 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:58410) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K2jI5-00035Z-BG for bug-gnu-emacs@gnu.org; Sun, 01 Jun 2008 04:51:49 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m518pjUx020072; Sun, 1 Jun 2008 01:51:45 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m518o59S019114; Sun, 1 Jun 2008 01:50:05 -0700 X-Loop: don@donarmstrong.com Resent-From: martin rudalics Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sun, 01 Jun 2008 08:50:05 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 342 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 342-submit@emacsbugs.donarmstrong.com id=B342.121230989217753 (code B ref 342); Sun, 01 Jun 2008 08:50:05 +0000 Original-Received: (at 342) by emacsbugs.donarmstrong.com; 1 Jun 2008 08:44:52 +0000 Original-Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id m518il0U017737 for <342@emacsbugs.donarmstrong.com>; Sun, 1 Jun 2008 01:44:49 -0700 Original-Received: (qmail invoked by alias); 01 Jun 2008 08:44:41 -0000 Original-Received: from 62-47-36-46.adsl.highway.telekom.at (EHLO [62.47.36.46]) [62.47.36.46] by mail.gmx.net (mp029) with SMTP; 01 Jun 2008 10:44:41 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1+cKckobO6cldLhswfn/+KyljSAhM4s4jtx2U0nOg XbRZ/twEn0lPYJ User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en In-Reply-To: <433125f80805311357ua664d33o59c682ceb215d6c5@mail.gmail.com> X-Y-GMX-Trusted: 0 X-CrossAssassin-Score: 2 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Resent-Date: Sun, 01 Jun 2008 04:51:51 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:18206 Archived-At: > 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. FWIW, your problem is caused by the (unless (bolp) (goto-char opoint)))) checks in `forward-visible-line' which get you back to the position before the invisible text if that text does not end in a newline as with the t2 part of your code. Hence the invisible text won't be killed for t2. In the t1 part the invisible region ends in a newline and kill-line will kill it along with the visible text. I think the behavior of Emacs is consistent here but maybe not very intuitive. On the other hand I'm quite confident that changing that behavior will break something else :-(