all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Matt Armstrong <matt@rfc20.org>
To: "Eason Huang" <aqua0210@foxmail.com>,
	"Gerd Möllmann" <gerd.moellmann@gmail.com>
Cc: Ihor Radchenko <yantar92@posteo.net>,
	Eli Qian <eli.q.qian@gmail.com>, Eli Zaretskii <eliz@gnu.org>,
	58928@debbugs.gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#58928: 29.0.50; overlays in org-mode are disrupted after call `org-capture`
Date: Thu, 03 Nov 2022 15:51:28 -0700	[thread overview]
Message-ID: <87sfiz4pov.fsf@rfc20.org> (raw)
In-Reply-To: <tencent_1713D7C8368FE4065EF24B6A90A236E0C109@qq.com>

Eason Huang <aqua0210@foxmail.com> writes:

> I can reproduce the following steps, may be you can have try:
>
> 1. emacs -Q , launch Emacs
> 2. M-x org-capture, and then type `t` (task)
>    Now the buffer CAPTURE-.notes will open with contents as bellow:
>
>    ** TODO (now the cursor is here, you can type some characters, such as "test1", and then type C-C C-c )
>   [2022-11-03 Thu]
>
> 3. C-x b, switch-to-buffer .notes
>   The contents is as below:
> * Tasks
> ** TODO test1(move cusror here and type TAB)
>   [2022-11-03 Thu]
>
> 4. Now the .notes buffer is like this:
> * Tasks
> ** TODO test1...
> 5. Try step 2 again, now you will see the issue. Now the .notes buffer looks like this:
> * Tasks
> ** TODO test1...TODO
>   [2022-11-03 Thu]
>   test1

I can reproduce this too.  Note that this is a new set of repro steps
that are easier to do after "emacs -Q".  Thanks Eason!

I think it is a different bug now visible after Stefan fixed the first
one.

It looks like `insert-before-markers' behaves differently for overlays
ending at `point'.  Indirect buffers are not required to reproduce it.
These tests now fail when they used to pass:

(ert-deftest test-overlay-insert-before-markers-empty ()
  (with-temp-buffer
    (insert "1234")
    (let ((overlay (make-overlay 2 2)))
      (goto-char 2)
      (insert-before-markers "x")
      (should (equal 3 (overlay-end overlay))))))

(ert-deftest test-overlay-insert-before-markers-non-empty ()
  (with-temp-buffer
    (insert "1234")
    (let ((overlay (make-overlay 2 3)))
      (goto-char 3)
      (insert-before-markers "x")
      (should (equal 4 (overlay-end overlay))))))

I am not sure that fixing this behavior difference will fix Eason's
repro steps, but it is worth fixing the above anyway.

Stefan, I won't have time to work on this until tomorrow.  If you have
the time I won't mind if you take a crack at a fix as you'll be about
100 times faster.  ;-)





  parent reply	other threads:[~2022-11-03 22:51 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-31 13:58 bug#58928: 29.0.50; overlays in org-mode are disrupted after call `org-capture` Eli Qian
2022-11-01  6:14 ` Eli Zaretskii
2022-11-01  7:01   ` Gerd Möllmann
     [not found]     ` <87sfj3gmsx.fsf@gmail.com>
2022-11-01  7:50       ` Gerd Möllmann
2022-11-01  8:08         ` Gerd Möllmann
2022-11-01  9:07         ` Ihor Radchenko
2022-11-01  9:20           ` Gerd Möllmann
2022-11-01 22:36             ` Matt Armstrong
2022-11-01 23:25               ` Matt Armstrong
2022-11-02  1:39             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-02  2:49               ` Matt Armstrong
2022-11-02  4:53               ` Gerd Möllmann
2022-11-03 13:10               ` Eason Huang
2022-11-03 14:25                 ` Gerd Möllmann
2022-11-03 14:57                   ` Eason Huang
2022-11-03 15:18                     ` Gerd Möllmann
2022-11-03 15:41                       ` Eason Huang
2022-11-03 15:02                   ` Eason Huang
2022-11-03 15:45                     ` Eason Huang
2022-11-03 16:12                       ` Gerd Möllmann
2022-11-03 22:51                     ` Matt Armstrong [this message]
2022-11-04  2:49                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-04  4:33                       ` Matt Armstrong
2022-11-04 16:05                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-04 22:47                           ` Matt Armstrong
2022-11-04 22:58                             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-05  6:28                             ` Eli Zaretskii
2022-11-04  3:47                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-04 18:06                       ` Matt Armstrong
2022-11-05  2:45                         ` Ihor Radchenko

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=87sfiz4pov.fsf@rfc20.org \
    --to=matt@rfc20.org \
    --cc=58928@debbugs.gnu.org \
    --cc=aqua0210@foxmail.com \
    --cc=eli.q.qian@gmail.com \
    --cc=eliz@gnu.org \
    --cc=gerd.moellmann@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    --cc=yantar92@posteo.net \
    /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.