From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Matt Armstrong Newsgroups: gmane.emacs.bugs 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 Message-ID: <87sfiz4pov.fsf@rfc20.org> References: <87eduohyds.fsf@gmail.com> <834jvjdwwl.fsf@gnu.org> <87sfj3gmsx.fsf@gmail.com> <87bkprm4a9.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3297"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Ihor Radchenko , Eli Qian , Eli Zaretskii , 58928@debbugs.gnu.org, Stefan Monnier To: Eason Huang , Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 04 00:02:07 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oqjDr-0000cO-4S for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 04 Nov 2022 00:02:07 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oqjDN-0000rF-2H; Thu, 03 Nov 2022 19:01:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqj46-0004Vb-FJ for bug-gnu-emacs@gnu.org; Thu, 03 Nov 2022 18:52:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oqj46-0001Tg-7V for bug-gnu-emacs@gnu.org; Thu, 03 Nov 2022 18:52:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oqj45-0001rU-Mi for bug-gnu-emacs@gnu.org; Thu, 03 Nov 2022 18:52:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Matt Armstrong Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 03 Nov 2022 22:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58928 X-GNU-PR-Package: emacs Original-Received: via spool by 58928-submit@debbugs.gnu.org id=B58928.16675159077131 (code B ref 58928); Thu, 03 Nov 2022 22:52:01 +0000 Original-Received: (at 58928) by debbugs.gnu.org; 3 Nov 2022 22:51:47 +0000 Original-Received: from localhost ([127.0.0.1]:50973 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqj3q-0001qw-Lp for submit@debbugs.gnu.org; Thu, 03 Nov 2022 18:51:46 -0400 Original-Received: from relay5-d.mail.gandi.net ([217.70.183.197]:53157) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqj3m-0001qa-TA for 58928@debbugs.gnu.org; Thu, 03 Nov 2022 18:51:45 -0400 Original-Received: (Authenticated sender: matt@rfc20.org) by mail.gandi.net (Postfix) with ESMTPSA id 05C7B1C0004; Thu, 3 Nov 2022 22:51:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rfc20.org; s=gm1; t=1667515896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yJ5PGFi239AugP3fzwRjz75OvfoAj6zLT0q3LPYg+sI=; b=osUK8Sogti3kCgrAnRHdiznlOAwHf+fWnFYchh0Ihm2x8tt89xHqH0xPbOceI/FB66wC6O XtMuBYD8DT5qrvOnKr7Pu6R/lGgnACWQfXlQ6+Zjpfn0Q89xU5cQpPogyt39+Hk7D36Uro zzbxiG2OgAjSLyoVV+IN4mlIhhnA3CNJHpPF58IyaoA43e4hHFWwepMdkwSq0BCDWvT7Fh 5+CO6oBu/SMdA/0KljvSdhcWy0A3YuEcGE5gySq/33cRMiNIYHkd4Uwzl26hNvpEQlZyAh IZ2JsI2Zgdhy/VMtVV+LwuA4Y5q7laeP28/8YjM1+OpTZNjTiZTvjA70xUJF3Q== Original-Received: from matt by naz with local (Exim 4.96) (envelope-from ) id 1oqj3Y-000uNI-2R; Thu, 03 Nov 2022 15:51:28 -0700 In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org 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" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:247028 Archived-At: Eason Huang 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. ;-)