From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id KPZyN88N5mK0tQAAbAwnHQ (envelope-from ) for ; Sun, 31 Jul 2022 07:06:23 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id EGt1N88N5mL+KAAA9RJhRA (envelope-from ) for ; Sun, 31 Jul 2022 07:06:23 +0200 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 A261413B06 for ; Sun, 31 Jul 2022 07:06:22 +0200 (CEST) Received: from localhost ([::1]:41184 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oI19g-0003j4-Kl for larch@yhetil.org; Sun, 31 Jul 2022 01:06:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46908) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oI19A-0003iw-BT for emacs-orgmode@gnu.org; Sun, 31 Jul 2022 01:05:48 -0400 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]:36457) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oI196-0006G9-6Q for emacs-orgmode@gnu.org; Sun, 31 Jul 2022 01:05:47 -0400 Received: by mail-pg1-x52c.google.com with SMTP id s206so7074070pgs.3 for ; Sat, 30 Jul 2022 22:05:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=TgT0vXBYBjJItpiz9pj5pmnSAXRgWsKJotRZpkAhn+M=; b=VYOsqneITt8eeh0Cb2Xtt0AkgY+PEv3foNIzeH/ycJS4NWe6I2FYGTax5JeWac3jzo J0Kg8QBCrQnHQIvcEA4mKsroivrmIXHWcIcWz7QUNMJPiMNSc16M20nmJNS3alBW2C8S Xjh47HZ7TaPbFXCWxWTgIoX9Y/GVoYOUA/FRS3skS7Xxd8iv4Hnbbf4O14qy4QcrxUOm g++q37sm88emIefEl3RCgPJk31XNTCF9pU/L6Opyka3RMwf62PomUf8TK2LG6yadLv1t U+us5B9dPLw+GOh1Npyykqp0sYh0pXngtUUzi+vVurtQd8kf/r5IlDOV4BjD4aPDU/q+ OEvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=TgT0vXBYBjJItpiz9pj5pmnSAXRgWsKJotRZpkAhn+M=; b=0KXuQXn17Syl1SXUe/8h6HUglo+VIwoTz6cYk3k1jr8nKm1HQqnqXNWjHpqGjY8jwh QstqZF3AKVwiXJpaIaIY/SZ2joxjJTJYmcN9r7Gi9oh/TDhG9tfY/ggDE9JbfZSdlO4f cRkB6q22o7iGPzG2K8vmCID0dQAFsNdG7ClhLphMdsuI0jyM+7rkhCUfI4cBNdXcRMuQ a/92bb8al0PtUUPEGlBKAMkhuZ9Kw5GGLo81Nyd/JHGrarr4BCTOipL+SQNJPnjSFCXm Due9Ej0WAo9micio9ubIyCSl2MDFbWIgR8o582qB5dCK3peA33Z6JQywlydX8rdEv3bV 6cpQ== X-Gm-Message-State: AJIora8Hj5KUC3XgPTPHQ5Eceq+Ka/oCY47JKfBgUxEjcfxuIrUHCll+ Acv/Zaij7P/27DSrgBA3Mr0= X-Google-Smtp-Source: AGRyM1s05pR+UEhrwCdaxY8HU7W70Nmx/qo9dh/n2qSo/pVcuB50EuK0ZKJ8navrerTqvAOzXGuRJw== X-Received: by 2002:a05:6a00:a29:b0:52a:c0c3:4379 with SMTP id p41-20020a056a000a2900b0052ac0c34379mr10660590pfh.15.1659243938168; Sat, 30 Jul 2022 22:05:38 -0700 (PDT) Received: from localhost ([1.83.155.1]) by smtp.gmail.com with ESMTPSA id n184-20020a6227c1000000b0052aaf7fe731sm5764849pfn.45.2022.07.30.22.05.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Jul 2022 22:05:37 -0700 (PDT) From: Ihor Radchenko To: Caleb Chase Cc: emacs-orgmode@gnu.org Subject: Re: [BUG] org-capture-kill: doesn't remove the right text region In-Reply-To: <874jz7rpx4.fsf@localhost> References: <874jz7rpx4.fsf@localhost> Date: Sun, 31 Jul 2022 13:06:34 +0800 Message-ID: <875yjdkh0l.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::52c; envelope-from=yantar92@gmail.com; helo=mail-pg1-x52c.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 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-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1659243982; h=from:from:sender:sender: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:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=TgT0vXBYBjJItpiz9pj5pmnSAXRgWsKJotRZpkAhn+M=; b=peXV0W6aAoXoL48ooElMV8O2AfvYqx+Y898SRa8ma3sG3rWGXRAmsgSet2i3uoSgCzsbzC d2WhieGoeQNURw+cmkpG28EUvsJKTtxyGmTYP9jW6k8S+//zqLcrQGTRGwGwRKnbMjDU9g +BMHGrSo51pU/DCyFGyJio6zpPSTgSR1Kxsds6DhjPmBUpOti6EHHjJadbMpBjesi/dmp0 /kR22fq+5LEtnQIs6yNQ72g8RMoVnpHr5Zu07Rr0IFAclNVQci1IUL30AbXIlSQYzMMNM8 k/Qah9C9Evew51n+uY49bcRygwXXvBpLckp46fdOhLnh8WXfhnKx1GFxtiOiOQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1659243982; a=rsa-sha256; cv=none; b=gjZoDJO74M9Ora2pbuJE+7bBs5XxAZfJjLIdeQDiMY1O/LziJTCFJZEA7NcVWnZvZ4uhu0 nkKSt3pkantcAeRA1nNHo8RSlt4Jcb5gv7ME7IDV4DZ+pAA4RGWv2LaNFp3bMPeOXxtARM /BVJEKSRGRHce2sFdP3d8TgzY+QlZ3+f9fFnG4jXC2fBt/2HwtFZdsRGKQN6tKsL5rQ25n dFpMf3JWTnGPfhkLUjQYbH4gCr2YUFrySnPdZOHdHG4sia57YiYH2dBm8juI4azZcgt7Zd kPklW/e64ECZP8JVCZS3RBnkwP2OxDluSiy01JGKVsJJnbPcXv9Xn62SWqNPqw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=VYOsqneI; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -1.92 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=VYOsqneI; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: A261413B06 X-Spam-Score: -1.92 X-Migadu-Scanner: scn1.migadu.com X-TUID: 2yIWcLgjcAxT Ihor Radchenko writes: > Caleb Chase writes: > >> I discovered a bug with org-capture and org-capture kill when >> canceling an item or plain type template on a heading that has only an >> empty line for content. Minimal reproduction is as follows: > > The fix is attached. > The reason why this bug is happening is `org-capture-empty-lines-before` > adding/removing the lines before the capture region. This situation was > not considered by org-capture. > > Note that `org-capture-empty-lines-before` changes are not going to be > restored upon capture abortion. Fixing this will not be trivial (AFAIU, > suggestions are welcome) and the gains are marginal - I doubt that > anyone is going to care much about this side effect. Of course, feel > free to disagree by replying. Applied onto main via 2ea0830f0. https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=2ea0830f07fa81b6e22ccdd43ad351ad76fcc097 Best, Ihor