GNU bug report logs - #21710
25.0.50; self-insert-command before a folded outline inserts after the outline

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Oleh Krehel <ohwoeowho@HIDDEN>; dated Mon, 19 Oct 2015 15:16:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 21710 <at> debbugs.gnu.org:


Received: (at 21710) by debbugs.gnu.org; 15 Aug 2021 17:33:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Aug 15 13:33:14 2021
Received: from localhost ([127.0.0.1]:47691 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mFK0U-0007mm-NF
	for submit <at> debbugs.gnu.org; Sun, 15 Aug 2021 13:33:14 -0400
Received: from eggs.gnu.org ([209.51.188.92]:40502)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mFK0P-0007mC-KX
 for 21710 <at> debbugs.gnu.org; Sun, 15 Aug 2021 13:33:09 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:52184)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mFK0J-0005D0-QQ; Sun, 15 Aug 2021 13:32:59 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2603
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mFK0J-0003H2-C0; Sun, 15 Aug 2021 13:32:59 -0400
Date: Sun, 15 Aug 2021 20:32:46 +0300
Message-Id: <8335raaa0x.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
In-Reply-To: <87tujqiqvd.fsf@HIDDEN> (message from Lars Ingebrigtsen on Sun, 
 15 Aug 2021 19:01:42 +0200)
Subject: Re: bug#21710: 25.0.50;
 self-insert-command before a folded outline inserts after the outline
References: <87a8resxc4.fsf@HIDDEN> <87tujqiqvd.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 21710
Cc: 21710 <at> debbugs.gnu.org, ohwoeowho@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Lars Ingebrigtsen <larsi@HIDDEN>
> Date: Sun, 15 Aug 2021 19:01:42 +0200
> Cc: 21710 <at> debbugs.gnu.org
> 
> Oleh Krehel <ohwoeowho@HIDDEN> writes:
> 
> > To reproduce with "emacs -Q", create a file ~/outline-test with the
> > following contents:
> >
> > * foo
> > some text
> > * bar
> > some text
> >
> > Open the file, move to start, "M-x" `outline-minor-mode',
> > "M-x" `outline-hide-sublevels'.
> >
> > Move to the end of bar and insert "tt" - it works correctly.
> >
> > But move to the end of foo and insert "tt": here's what it looks like
> > ("|" is the point):
> >
> > * foo...t|
> > * bartt...
> >
> > Here's the full text after "M-x" `outline-show-all':
> >
> > * foot
> > some textt
> > * bartt
> > some text
> 
> (I'm going through old bug reports that unfortunately weren't
> resolved at the time.)
> 
> I'm not seeing quite what you're seeing here in Emacs 26.1 or 28.  I'm getting:
> 
> * foo...ttttt|
> * bar...

I get in Emacs 28 exactly what the OP describes.

But isn't that expected, given the way outline-minor-mode uses the
invisible property?

> On the other hand, I'm not sure quite what it's supposed to do if you
> type after the dots.

He was typing _before_ the dots.  He said "move to the end of foo".




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#21710; Package emacs. Full text available.

Message received at 21710 <at> debbugs.gnu.org:


Received: (at 21710) by debbugs.gnu.org; 15 Aug 2021 17:02:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Aug 15 13:02:04 2021
Received: from localhost ([127.0.0.1]:47668 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mFJWJ-00070B-QP
	for submit <at> debbugs.gnu.org; Sun, 15 Aug 2021 13:02:04 -0400
Received: from quimby.gnus.org ([95.216.78.240]:33714)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mFJWD-0006zo-TO
 for 21710 <at> debbugs.gnu.org; Sun, 15 Aug 2021 13:01:58 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=78mFqtsHE2/jm3Hip9XsqsObxUDP3eOOPddC2bf3ZS4=; b=cKU3P6hA0fNuR5QrXq0oTv69TY
 Qw6AajZWwClOoSHnCFRoDNdaXYvsNvPSwDhJ1NjtsVoxUwjsZVYh4XywQcIAZBk1D7i5+dbz1y+Rn
 vmVtCow5jydMLax3arcTsH+bjrnPbdmFEr2mNMyQqOgBpfTRrKDKeuAB6npfQd3MUM/o=;
Received: from [84.212.220.105] (helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mFJW3-0002hV-A1; Sun, 15 Aug 2021 19:01:47 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Oleh Krehel <ohwoeowho@HIDDEN>
Subject: Re: bug#21710: 25.0.50; self-insert-command before a folded outline
 inserts after the outline
References: <87a8resxc4.fsf@HIDDEN>
Date: Sun, 15 Aug 2021 19:01:42 +0200
In-Reply-To: <87a8resxc4.fsf@HIDDEN> (Oleh Krehel's message of "Mon, 19 Oct
 2015 17:16:11 +0200")
Message-ID: <87tujqiqvd.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Oleh Krehel <ohwoeowho@HIDDEN> writes: > To reproduce with
 "emacs -Q", create a file ~/outline-test with the > following contents: >
 > * foo > some text > * bar > some text > > Open the file, move to start,
 "M-x" `outline-minor-mode', > "M [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 21710
Cc: 21710 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Oleh Krehel <ohwoeowho@HIDDEN> writes:

> To reproduce with "emacs -Q", create a file ~/outline-test with the
> following contents:
>
> * foo
> some text
> * bar
> some text
>
> Open the file, move to start, "M-x" `outline-minor-mode',
> "M-x" `outline-hide-sublevels'.
>
> Move to the end of bar and insert "tt" - it works correctly.
>
> But move to the end of foo and insert "tt": here's what it looks like
> ("|" is the point):
>
> * foo...t|
> * bartt...
>
> Here's the full text after "M-x" `outline-show-all':
>
> * foot
> some textt
> * bartt
> some text

(I'm going through old bug reports that unfortunately weren't
resolved at the time.)

I'm not seeing quite what you're seeing here in Emacs 26.1 or 28.  I'm getting:

* foo...ttttt|
* bar...

And then after showing, I get:

* foo
some texttttttt
* bar
some text

So this works better than the described problem (no "bartt"), but it's
still somewhat confusing.

On the other hand, I'm not sure quite what it's supposed to do if you
type after the dots.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#21710; Package emacs. Full text available.

Message received at 21710 <at> debbugs.gnu.org:


Received: (at 21710) by debbugs.gnu.org; 21 Oct 2015 17:02:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 21 13:02:39 2015
Received: from localhost ([127.0.0.1]:59623 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Zowmd-0006ZE-5G
	for submit <at> debbugs.gnu.org; Wed, 21 Oct 2015 13:02:39 -0400
Received: from mtaout23.012.net.il ([80.179.55.175]:53524)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <eliz@HIDDEN>) id 1Zowma-0006Z4-3m
 for 21710 <at> debbugs.gnu.org; Wed, 21 Oct 2015 13:02:37 -0400
Received: from conversion-daemon.a-mtaout23.012.net.il by
 a-mtaout23.012.net.il (HyperSendmail v2007.08) id
 <0NWK00500XG8DE00@HIDDEN> for 21710 <at> debbugs.gnu.org;
 Wed, 21 Oct 2015 20:02:34 +0300 (IDT)
Received: from HOME-C4E4A596F7 ([84.94.185.246]) by a-mtaout23.012.net.il
 (HyperSendmail v2007.08) with ESMTPA id
 <0NWK005KQY098290@HIDDEN>;
 Wed, 21 Oct 2015 20:02:34 +0300 (IDT)
Date: Wed, 21 Oct 2015 20:02:33 +0300
From: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#21710: 25.0.50;
 self-insert-command before a folded outline inserts after the outline
In-reply-to: <87a8rcs777.fsf@HIDDEN>
X-012-Sender: halo1@HIDDEN
To: Oleh Krehel <ohwoeowho@HIDDEN>
Message-id: <83r3koupcm.fsf@HIDDEN>
References: <87a8resxc4.fsf@HIDDEN> <83twpmg75m.fsf@HIDDEN>
 <87a8rcs777.fsf@HIDDEN>
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 21710
Cc: 21710 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: Eli Zaretskii <eliz@HIDDEN>
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

> From: Oleh Krehel <ohwoeowho@HIDDEN>
> Cc: 21710 <at> debbugs.gnu.org
> Date: Wed, 21 Oct 2015 15:05:16 +0200
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > The reason for this is that on all header lines but the last inserting
> > the first 't' makes it invisible.
> 
> This isn't a good behavior. `self-insert-command' should not put text
> into an invisible region.

It doesn't.  It inserts the character at point.  The problem is that
the inserted character becomes invisible because the overlay becomes
applicable to it.

> "C-e" should complement this behavior, starting from:
> 
> * |foo...
> * bar...
> 
> pressing "C-e" should result in:
> 
> * foo|...
> * bar...

If that's what you want, you need to program that into the mode.  The
default effect of C-e is to put point one character before the newline
on the same visible line, which is _after_ the invisible text.  IOW,
this is not a bug, but perhaps a missing feature.

> And from the state above, pressing "C-d" should result in:
> (user-error "Overlay read-only"), instead of deleting hidden characters.

Once again, you need to program that.  By default, C-d just deletes
the character at point.

> > Then point adjustment kicks in, and moves point out of the
> > invisible region, so the second 't' is inserted at the end of the
> > sub-level text.
> 
> Can you point me to a place where I can read up on this point
> adjustment?

Some minimal Lisp-level documentation is in "(elisp) Adjusting Point.
For the gory details, see the function adjust_point_for_property in
keyboard.c.

> I'd like to help in fixing this bug, if it's not too complicated.

It's not a bug in point adjustment, strictly speaking: that part does
its job as intended.  The problem is with the fact that the inserted
character becomes invisible.

> So far, I'm looking at this code:
> 
> (defun outline-flag-region (from to flag)
>   "Hide or show lines from FROM to TO, according to FLAG.
> If FLAG is nil then text is shown, while if FLAG is t the text is hidden."
>   (remove-overlays from to 'invisible 'outline)
>   (when flag
>     ;; We use `front-advance' here because the invisible text begins at the
>     ;; very end of the heading, before the newline, so text inserted at FROM
>     ;; belongs to the heading rather than to the entry.
>     (let ((o (make-overlay from to nil 'front-advance)))
>       (overlay-put o 'evaporate t)
>       (overlay-put o 'invisible 'outline)
>       (overlay-put o 'isearch-open-invisible
> 		   (or outline-isearch-open-invisible-function
> 		       'outline-isearch-open-invisible))))
>   ;; Seems only used by lazy-lock.  I.e. obsolete.
>   (run-hooks 'outline-view-change-hook))
> 
> The comment about `front-advance' implies that what I proposed above was
> the intended behavior, which is broken currently.

Then why does it work correctly on the last heading?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#21710; Package emacs. Full text available.

Message received at 21710 <at> debbugs.gnu.org:


Received: (at 21710) by debbugs.gnu.org; 21 Oct 2015 13:04:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 21 09:04:50 2015
Received: from localhost ([127.0.0.1]:58866 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Zot4T-0007c6-JA
	for submit <at> debbugs.gnu.org; Wed, 21 Oct 2015 09:04:49 -0400
Received: from mail-wi0-f173.google.com ([209.85.212.173]:33503)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <ohwoeowho@HIDDEN>) id 1Zot4Q-0007bu-GU
 for 21710 <at> debbugs.gnu.org; Wed, 21 Oct 2015 09:04:47 -0400
Received: by wijp11 with SMTP id p11so94030407wij.0
 for <21710 <at> debbugs.gnu.org>; Wed, 21 Oct 2015 06:04:45 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version:content-type;
 bh=ba9GUHUrxOuqlFwJoP52sm2C+A3HkncBu+894mjCLVY=;
 b=he7/ROX0raM4E7y2zQpt27fdbwnFBTkHTHcaUnt1ssQpgvyTeB6n5SxihKhB9hbuzC
 MzIiCCcEMeKt1yRTyz0dv9bqkZ/H56D0QnrI/At9EfJcdo5VuYlkP61h+s46OVEsNqgX
 ycouaMHGalSM6L8rLkFz+SDhHO9JfqwjABpVRD3T8n7MYQDUohMTd/bT3tPXyjZ0mczk
 WU6F+4H2UxYQufJqQQQnbEFjxAtXfRVwmLYldeuLA9kHBHnaDenN+oIsGsaxSkj0wsro
 AD2B6fiZ8l/I/2IUubceEpEMh54C9y/W6I5nTelrb4S8JhwDwrb6GXyI7mE71rO1KB40
 jybg==
X-Received: by 10.180.89.67 with SMTP id bm3mr11482642wib.56.1445432685729;
 Wed, 21 Oct 2015 06:04:45 -0700 (PDT)
Received: from firefly (dyn069045.nbw.tue.nl. [131.155.69.45])
 by smtp.gmail.com with ESMTPSA id q1sm10314302wje.39.2015.10.21.06.04.44
 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
 Wed, 21 Oct 2015 06:04:44 -0700 (PDT)
From: Oleh Krehel <ohwoeowho@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#21710: 25.0.50;
 self-insert-command before a folded outline inserts after the outline
References: <87a8resxc4.fsf@HIDDEN> <83twpmg75m.fsf@HIDDEN>
Date: Wed, 21 Oct 2015 15:05:16 +0200
In-Reply-To: <83twpmg75m.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 19 Oct
 2015 19:22:29 +0300")
Message-ID: <87a8rcs777.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 21710
Cc: 21710 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

Eli Zaretskii <eliz@HIDDEN> writes:

> The reason for this is that on all header lines but the last inserting
> the first 't' makes it invisible.

This isn't a good behavior. `self-insert-command' should not put text
into an invisible region. Instead it should put it ahead of it.

"C-e" should complement this behavior, starting from:

* |foo...
* bar...

pressing "C-e" should result in:

* foo|...
* bar...

And from the state above, pressing "C-d" should result in:
(user-error "Overlay read-only"), instead of deleting hidden characters.

Actually, the points above are often a source of confusion and
frustration. I wouldn't be surprised that this bug was reported before.
Currently, I work around this problem either by unfolding all outlines
while I'm editing, or transforming "foo|" into "foot|" with "C-b ot C-d"
instead of a simple "t".

> Then point adjustment kicks in, and moves point out of the
> invisible region, so the second 't' is inserted at the end of the
> sub-level text.

Can you point me to a place where I can read up on this point
adjustment? I'd like to help in fixing this bug, if it's not too
complicated. So far, I'm looking at this code:

(defun outline-flag-region (from to flag)
  "Hide or show lines from FROM to TO, according to FLAG.
If FLAG is nil then text is shown, while if FLAG is t the text is hidden."
  (remove-overlays from to 'invisible 'outline)
  (when flag
    ;; We use `front-advance' here because the invisible text begins at the
    ;; very end of the heading, before the newline, so text inserted at FROM
    ;; belongs to the heading rather than to the entry.
    (let ((o (make-overlay from to nil 'front-advance)))
      (overlay-put o 'evaporate t)
      (overlay-put o 'invisible 'outline)
      (overlay-put o 'isearch-open-invisible
		   (or outline-isearch-open-invisible-function
		       'outline-isearch-open-invisible))))
  ;; Seems only used by lazy-lock.  I.e. obsolete.
  (run-hooks 'outline-view-change-hook))

The comment about `front-advance' implies that what I proposed above was
the intended behavior, which is broken currently.






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#21710; Package emacs. Full text available.

Message received at 21710 <at> debbugs.gnu.org:


Received: (at 21710) by debbugs.gnu.org; 19 Oct 2015 16:22:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 19 12:22:32 2015
Received: from localhost ([127.0.0.1]:56939 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ZoDCh-0004o4-3E
	for submit <at> debbugs.gnu.org; Mon, 19 Oct 2015 12:22:31 -0400
Received: from mtaout23.012.net.il ([80.179.55.175]:57837)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <eliz@HIDDEN>) id 1ZoDCe-0004nv-Em
 for 21710 <at> debbugs.gnu.org; Mon, 19 Oct 2015 12:22:29 -0400
Received: from conversion-daemon.a-mtaout23.012.net.il by
 a-mtaout23.012.net.il (HyperSendmail v2007.08) id
 <0NWH00J006RVS500@HIDDEN> for 21710 <at> debbugs.gnu.org;
 Mon, 19 Oct 2015 19:22:27 +0300 (IDT)
Received: from HOME-C4E4A596F7 ([84.94.185.246]) by a-mtaout23.012.net.il
 (HyperSendmail v2007.08) with ESMTPA id
 <0NWH00JWO6TEOG50@HIDDEN>;
 Mon, 19 Oct 2015 19:22:27 +0300 (IDT)
Date: Mon, 19 Oct 2015 19:22:29 +0300
From: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#21710: 25.0.50;
 self-insert-command before a folded outline inserts after the outline
In-reply-to: <87a8resxc4.fsf@HIDDEN>
X-012-Sender: halo1@HIDDEN
To: Oleh Krehel <ohwoeowho@HIDDEN>
Message-id: <83twpmg75m.fsf@HIDDEN>
References: <87a8resxc4.fsf@HIDDEN>
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 21710
Cc: 21710 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: Eli Zaretskii <eliz@HIDDEN>
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

> From: Oleh Krehel <ohwoeowho@HIDDEN>
> Date: Mon, 19 Oct 2015 17:16:11 +0200
> 
> To reproduce with "emacs -Q", create a file ~/outline-test with the
> following contents:
> 
> * foo
> some text
> * bar
> some text
> 
> Open the file, move to start, "M-x" `outline-minor-mode',
> "M-x" `outline-hide-sublevels'.
> 
> Move to the end of bar and insert "tt" - it works correctly.
> 
> But move to the end of foo and insert "tt": here's what it looks like
> ("|" is the point):
> 
> * foo...t|
> * bartt...
> 
> Here's the full text after "M-x" `outline-show-all':
> 
> * foot
> some textt
> * bartt
> some text
> 
> As you see, the second "t" was inserted after the outline.

The reason for this is that on all header lines but the last inserting
the first 't' makes it invisible.  On the last line, 't' stays
visible.  Then point adjustment kicks in, and moves point out of the
invisible region, so the second 't' is inserted at the end of the
sub-level text.

This hints at stickiness, but I cannot find anything in the
documentation about stickiness of overlays.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#21710; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 19 Oct 2015 15:15:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 19 11:15:46 2015
Received: from localhost ([127.0.0.1]:56882 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ZoCA5-0001fc-O8
	for submit <at> debbugs.gnu.org; Mon, 19 Oct 2015 11:15:45 -0400
Received: from eggs.gnu.org ([208.118.235.92]:33591)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <ohwoeowho@HIDDEN>) id 1ZoCA3-0001fS-Tw
 for submit <at> debbugs.gnu.org; Mon, 19 Oct 2015 11:15:44 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <ohwoeowho@HIDDEN>) id 1ZoCA2-0003vr-W1
 for submit <at> debbugs.gnu.org; Mon, 19 Oct 2015 11:15:43 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM,
 T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:36739)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <ohwoeowho@HIDDEN>) id 1ZoCA2-0003vd-RM
 for submit <at> debbugs.gnu.org; Mon, 19 Oct 2015 11:15:42 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:43549)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <ohwoeowho@HIDDEN>) id 1ZoCA1-0005Hr-Io
 for bug-gnu-emacs@HIDDEN; Mon, 19 Oct 2015 11:15:42 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <ohwoeowho@HIDDEN>) id 1ZoC9y-0003tC-R6
 for bug-gnu-emacs@HIDDEN; Mon, 19 Oct 2015 11:15:41 -0400
Received: from mail-wi0-x22f.google.com ([2a00:1450:400c:c05::22f]:33878)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <ohwoeowho@HIDDEN>) id 1ZoC9y-0003ss-JR
 for bug-gnu-emacs@HIDDEN; Mon, 19 Oct 2015 11:15:38 -0400
Received: by wikq8 with SMTP id q8so10607033wik.1
 for <bug-gnu-emacs@HIDDEN>; Mon, 19 Oct 2015 08:15:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=from:to:subject:date:message-id:mime-version:content-type;
 bh=zag42U6mmxm7kNL0sSQljlzYlTqJxGh4FngD5ZY5OPw=;
 b=IBTBLoINgECZePl42GDbwVoja9HXkRPtSNJJaPmsTk5bjRDuFKzygREZsD5oq6oGJO
 rxlo98KB/pKDF1DR3nfvHwL5XXA6Zf+jPRvFh+UkcNhtGKGNkqjT1GGtd0d9hxxM64Z0
 Yk+FhtF9INVhpvFt5q2BNJuOqdN4aisu5LE+tJZn2OYqwbXY8tgkbQmjRZsjcm9ubgy+
 kWb7H3tjuAaowsLm8tNr1aohh/sBF5Hi2olWaMucaigrnhoz7miPJYuZ6/t/K1mxhBU9
 Lg4akgum/c1QQPh4/suu1hKy0CzDc1Ojta0pwTv/0oH8do1tczuJsYIdLMiNC6mLNnxu
 NAjQ==
X-Received: by 10.180.34.38 with SMTP id w6mr19437128wii.78.1445267737171;
 Mon, 19 Oct 2015 08:15:37 -0700 (PDT)
Received: from firefly (dyn069045.nbw.tue.nl. [131.155.69.45])
 by smtp.gmail.com with ESMTPSA id jh4sm8686385wjb.33.2015.10.19.08.15.36
 for <bug-gnu-emacs@HIDDEN>
 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
 Mon, 19 Oct 2015 08:15:36 -0700 (PDT)
From: Oleh Krehel <ohwoeowho@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 25.0.50;
 self-insert-command before a folded outline inserts after the outline
Date: Mon, 19 Oct 2015 17:16:11 +0200
Message-ID: <87a8resxc4.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.0 (----)

To reproduce with "emacs -Q", create a file ~/outline-test with the
following contents:

* foo
some text
* bar
some text

Open the file, move to start, "M-x" `outline-minor-mode',
"M-x" `outline-hide-sublevels'.

Move to the end of bar and insert "tt" - it works correctly.

But move to the end of foo and insert "tt": here's what it looks like
("|" is the point):

* foo...t|
* bartt...

Here's the full text after "M-x" `outline-show-all':

* foot
some textt
* bartt
some text

As you see, the second "t" was inserted after the outline.
Since Org mode uses outlines, this bug also appears there.




Acknowledgement sent to Oleh Krehel <ohwoeowho@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#21710; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 15 Aug 2021 17:45:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.