From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id BXk6A1aaKV8CJwAA0tVLHw (envelope-from ) for ; Tue, 04 Aug 2020 17:26:46 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id oO1zOlWaKV9iIAAAB5/wlQ (envelope-from ) for ; Tue, 04 Aug 2020 17:26:45 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 75E6694053F for ; Tue, 4 Aug 2020 17:26:45 +0000 (UTC) Received: from localhost ([::1]:53288 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k30i3-0002Hu-2R for larch@yhetil.org; Tue, 04 Aug 2020 13:26:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39638) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k30hb-0002Fs-TX for emacs-orgmode@gnu.org; Tue, 04 Aug 2020 13:26:15 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:54357 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1k30ha-0000YU-2B for emacs-orgmode@gnu.org; Tue, 04 Aug 2020 13:26:15 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-246-POKOfwcTO8iND0mWY0udOA-1; Tue, 04 Aug 2020 13:26:09 -0400 X-MC-Unique: POKOfwcTO8iND0mWY0udOA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4E57F800470 for ; Tue, 4 Aug 2020 17:26:08 +0000 (UTC) Received: from alphaville.usersys.redhat.com (ovpn-112-135.phx2.redhat.com [10.3.112.135]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 33BF62B6D5 for ; Tue, 4 Aug 2020 17:26:08 +0000 (UTC) Received: from alphaville.usersys.redhat.com (localhost [IPv6:::1]) by alphaville.usersys.redhat.com (Postfix) with ESMTPS id 3BE462709DD for ; Tue, 4 Aug 2020 13:26:07 -0400 (EDT) From: Nick Dokos To: emacs-orgmode@gnu.org Subject: Bug: inserting capture template [9.3.7 (release_9.3.7-705-gea9463 @ /home/nick/elisp/org-mode/lisp/)] Date: Tue, 04 Aug 2020 13:25:57 -0400 Message-ID: <87lfiuxqze.fsf@alphaville.usersys.redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: gmail.com Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Received-SPF: softfail client-ip=205.139.110.61; envelope-from=ndokos@gmail.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/04 01:28:16 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: 7 X-Spam_score: 0.7 X-Spam_bar: / X-Spam_report: (0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FROM=0.001, NML_ADSP_CUSTOM_MED=0.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665, SPOOFED_FREEMAIL=1, URIBL_BLOCKED=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -0.91 X-TUID: YQA8+nTaC344 ------------------------------------------------------------------------ This was reported in https://emacs.stackexchange.com/questions/59928/org-ca= pture-at-point-as-sibling-of-heading I was able to reproduce it starting from emacs -q with the following ECM: emacs -q -l min.el foo.org where min.el looks like this (adjust load-path to taste): --8<---------------cut here---------------start------------->8--- (add-to-list 'load-path "~/src/org-mode/org-mode/lisp") (require 'org-loaddefs) (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode)) (global-set-key "\C-cl" 'org-store-link) (global-set-key "\C-cc" 'org-capture) (global-set-key "\C-ca" 'org-agenda) (setq org-capture-templates '(("a" "Appointment or call" entry (file+headline "~/todo.org" "Tasks= ") "* APPT %?\n %u"))) --8<---------------cut here---------------end--------------->8--- and foo.org looks like this (| is the position of the cursor): --8<---------------cut here---------------start------------->8--- * foo ** one *** two **** three | **** four --8<---------------cut here---------------end--------------->8--- In current Org mode, doing `C-0 M-x org-capture RET a' (where "a" gets me an APPT template - see below), I get: --8<---------------cut here---------------start------------->8--- * foo ** one *** two **** three * APPT=20 [2020-08-04 Tue 12:58] **** four --8<---------------cut here---------------end--------------->8--- with the template at top level. In 9.2, the same operation inserted a template as a sibling of the headline= : --8<---------------cut here---------------start------------->8--- * foo ** one =20 *** two **** three **** APPT=20 [2020-08-04 Tue 12:58] **** four --8<---------------cut here---------------end--------------->8--- The current behavior looks like a bug to me, so I bisected it to the follow= ing commit: --8<---------------cut here---------------start------------->8--- 0201d1c0cc367fea0e561ba113f02f263b0ed501 is the first bad commit commit 0201d1c0cc367fea0e561ba113f02f263b0ed501 Author: Nicolas Goaziou Date: Sat Jul 6 15:59:12 2019 +0200 Fix inserting capture templates at point =20 * lisp/org-capture.el (org-capture): (org-capture-set-target-location): (org-capture-place-entry): (org-capture-place-item): (org-capture-place-table-line): Fix inserting capture templates at point. Insert a new internal property for capture template: :insert-here. (org-capture-insert-template-here): Remove function. =20 * testing/lisp/test-org-capture.el (test-org-caputre/entry): (test-org-capture/item): (test-org-capture/table-line): Add tests. =20 Reported-by: Dominic Surano etc/ORG-NEWS | 4 +- lisp/org-capture.el | 126 +++++++++++++++--------------------= ---- testing/lisp/test-org-capture.el | 58 +++++++++++++++++- 3 files changed, 104 insertions(+), 84 deletions(-) --8<---------------cut here---------------end--------------->8--- HTH --------------------------------------------------------------------------- Emacs : GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 2.24= .32, cairo version 1.16.0) of 2020-06-15 Package: Org mode version 9.3.7 (release_9.3.7-705-gea9463 @ /home/nick/eli= sp/org-mode/lisp/) --=20 Nick "There are only two hard problems in computer science: cache invalidation, naming things, and off-by-one errors." -Martin Fowler