From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id gJWlK79t+F4qVwAA0tVLHw (envelope-from ) for ; Sun, 28 Jun 2020 10:15:27 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id +OVZJ79t+F7DLgAAbx9fmQ (envelope-from ) for ; Sun, 28 Jun 2020 10:15:27 +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 0161C9400BF for ; Sun, 28 Jun 2020 10:15:26 +0000 (UTC) Received: from localhost ([::1]:57226 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jpULM-0007Fk-C6 for larch@yhetil.org; Sun, 28 Jun 2020 06:15:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39814) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jpUKh-0007Fb-PR for emacs-orgmode@gnu.org; Sun, 28 Jun 2020 06:14:43 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:45668) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jpUKg-0002Ex-8P for emacs-orgmode@gnu.org; Sun, 28 Jun 2020 06:14:43 -0400 Received: by mail-wr1-x436.google.com with SMTP id s10so13493101wrw.12 for ; Sun, 28 Jun 2020 03:14:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=z/yzS3s0k+vkywNgj58oxc7yPO0Bch6SVeGMgWItp/o=; b=Dqu0IxARHujMtdpDHlpQkUzTQNbbcymB+8Iz5Wh+Vx0r0elGlLqUH/Wg4kcj0eVeRE pKvuSzyPXd4zqkf9Ud7+yx7bC0rT2jkzWtQW6b2yHgvFS0/0ilcmd7kFa1OGsFet4xoo X7C9uBXE7JSH5yaqrmDBZes00nl2g3ZyZR92zx4lUss796UsWt0arpkjFpnrePm8s191 tIaxWG6P9yvFOftpkE/JRKklywY5zy16QLNc0g+kWzs7uJWIGR2TV2+z71klHayDyQhq rr4L2c1vOF+HsjsAn8XdUAx3CBIJefaktsbL0jmo780SZ2zQQ8Nhi8VLEZDeSBePuHIh bIxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=z/yzS3s0k+vkywNgj58oxc7yPO0Bch6SVeGMgWItp/o=; b=Rehn3lNqu11F8TBB7X4krNSfoRBzlsvHKWQBk56bjXz5UMFTsgawm/G5cPv0fpnOeI DHO7Aily7wOVcJatfY0CGM4lyPdTVDXRuitc7e2+G6Qlua6hHW9zNSsZhrQyzmWeTnTt miIFzYEhyfeo+FP27oMpHwunm2koiAuTcWnKetir8KnrcZce5GJQEOzwBjT6zJbWcY4r RsutBJrmjOqn2nsXiLYGW4jaQzNjqa5j5y7Em/WMlVmO0kZ2mD4rL3tiYg/PaOfnr3Zh UeQmXvcbfy6TqlfZAXcnOCu549woPh2t1BAQgJjdqpZybbrLTizaQzv/tnBtE2kSBa+S r+eQ== X-Gm-Message-State: AOAM530cIjKj9DWl8CfAWoYwNeaodwmZDUFSLxl89o2y205vOoN8+VUI N0UX4pi0lOk277TwL01Jj++dnEFOIZozRKsi0aou9OyyL5k= X-Google-Smtp-Source: ABdhPJx+je3tOjNQp+dWJvzpY3P6qF5lvVpx9lUc/UbMniwTjDt1c1Z/Mu2AYBAnEgZkgYVvJ9EV4ZszM/3PLDrAJh8= X-Received: by 2002:adf:f6cb:: with SMTP id y11mr11568280wrp.100.1593339280091; Sun, 28 Jun 2020 03:14:40 -0700 (PDT) MIME-Version: 1.0 From: "E.L.K." Date: Sun, 28 Jun 2020 13:14:29 +0300 Message-ID: Subject: [patch] When inserting entry template, don't include last newline in narrowed zone To: emacs-orgmode@gnu.org Content-Type: multipart/mixed; boundary="000000000000cc078505a92235fc" Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=some.any.key@gmail.com; helo=mail-wr1-x436.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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=fail (body hash did not verify) header.d=gmail.com header.s=20161025 header.b=Dqu0IxAR; dmarc=fail reason="SPF not aligned (relaxed)" 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: 1.19 X-TUID: wwTu7L6DxUp0 --000000000000cc078505a92235fc Content-Type: multipart/alternative; boundary="000000000000cc078205a92235fa" --000000000000cc078205a92235fa Content-Type: text/plain; charset="UTF-8" Hello. Org 9.3.6: when inserting the entry by capture mechanics, it narrows buffer in a way that cursor can be moved to the last line, which is the beginning of next (non-capture template) line in the original unnarowed buffer. So this allows to: start capture, move point to the very last char of the narrowed buffer, insert something. If this line in unnarowed buffer was start of heading, it breaks structure of document. This is patch in attempt to fix it. I followed same approach as in org-capture-place-item function. Thanks, Alexey --000000000000cc078205a92235fa Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello.

Org 9.3.6: when inser= ting the entry by capture mechanics, it narrows buffer in a way that cursor= can be moved to the last line, which is the beginning of next (non-capture= template) line in the original unnarowed buffer.

=
So this allows to: start capture, move point to the very last char of = the narrowed buffer, insert something. If this line in unnarowed buffer was= start of heading, it breaks structure of document.

This is patch in attempt to fix it. I followed same approach as in org-ca= pture-place-item function.

Thanks,
Alexe= y
--000000000000cc078205a92235fa-- --000000000000cc078505a92235fc Content-Type: text/x-patch; charset="US-ASCII"; name="dont-include-last-newline-in-the-insert-template-narrowing.patch" Content-Disposition: attachment; filename="dont-include-last-newline-in-the-insert-template-narrowing.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_kbyx229r0 Q29tbW9uIHN1YmRpcmVjdG9yaWVzOiBvcmctOS4zLjYvZXRjIGFuZCAvaG9tZS9lbGsvLmVtYWNz LmQvZWxwYS9vcmctOS4zLjYvZXRjCmRpZmYgLVU1IG9yZy05LjMuNi9vcmctY2FwdHVyZS5lbCAv aG9tZS9lbGsvLmVtYWNzLmQvZWxwYS9vcmctOS4zLjYvb3JnLWNhcHR1cmUuZWwKLS0tIG9yZy05 LjMuNi9vcmctY2FwdHVyZS5lbAkyMDIwLTA2LTE1IDE5OjA0OjE5LjA2MTAxMjgzMyArMDMwMAor KysgL2hvbWUvZWxrLy5lbWFjcy5kL2VscGEvb3JnLTkuMy42L29yZy1jYXB0dXJlLmVsCTIwMjAt MDYtMjggMTM6MDg6MDQuNDQ2MDQ1NTU5ICswMzAwCkBAIC0xMTQ5LDExIC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