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 YOekBBj/cF9zdAAA0tVLHw (envelope-from ) for ; Sun, 27 Sep 2020 21:07:36 +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 oD91ABj/cF/tRwAAbx9fmQ (envelope-from ) for ; Sun, 27 Sep 2020 21:07:36 +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 8D598940393 for ; Sun, 27 Sep 2020 21:07:35 +0000 (UTC) Received: from localhost ([::1]:33842 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMdtO-0002xh-FT for larch@yhetil.org; Sun, 27 Sep 2020 17:07:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52640) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMdsv-0002xZ-9l for emacs-orgmode@gnu.org; Sun, 27 Sep 2020 17:07:05 -0400 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:32847) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kMdst-0001L2-Gl for emacs-orgmode@gnu.org; Sun, 27 Sep 2020 17:07:04 -0400 Received: by mail-pg1-x543.google.com with SMTP id o25so6516907pgm.0 for ; Sun, 27 Sep 2020 14:07:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=zH3MTI7ShXYMasR7iqEZcnjOu53csH73GdNbU19Zen4=; b=tOCgOzjFTd+cZfv7JQUo0prY7ubLp8rCxLcd6We7BoVCKV1ZlBtxC1vWgF/wb5cA/Z 3OyWGWbIyYZfv4sPL5d3oTsCrPD9cBfaszvjGyhFVuy0kQAUlJej/MqhKB2i2QibOj3L jRPVB7CNYDQgADqS0qklb2WoYdQoDE7/PEHfbXlxcIdnLrtpyXijsQ2bI7zQJ8ftU/Ox Kyr4M9gYmcfXHciUI0mkqFLtdx/5He2vgwIu1TgOJWRNTOMxnPHFy/z9XMoEs160zPL/ hMsG7p4492H9ZhNA1G7HQa5M5TIGrz4qWpCOZhj6NXjkXg0ukLa0TEqmiP8bukdDO40/ i6Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=zH3MTI7ShXYMasR7iqEZcnjOu53csH73GdNbU19Zen4=; b=NAgx/Aq1tVaThiC0OLlDnK/vKjPzVZFxLxbZ664s4juoTNCDSiezlzhzXue0FxJV+Q Ch1UNchWxzbxeICrS3fdT8xF7I0L9BDwkYjPiVVai2LrA4RCpeLRVv2QCXUoX/kvgmnA XqZSuHT7KMUYPmToxL5B8bHJaAKpA8GsISIY9TTJhorL9caDMkpXpe0cQTjLLSm30vBj 53MJClnMmoabzUMx+btiomsoANFY48tt4t6+pvUktrIVnlghPBgP4UK40yqg/GV2pPBl AU0dG9sa0uOzmQHSAMlH6ewC198fQx6L8v0Bsb2xpCGcxwyTI7O3QShYh5kj4NHqnSje dLSg== X-Gm-Message-State: AOAM531rL2Yq3S/vbkqq9r5WKb0tvcZhe4S7jjdmpWiAyGTtweG9DMPP ofULFvCZTkaM/QlOCUrxvEYZKLxu2TS//esXI2M= X-Google-Smtp-Source: ABdhPJxXuk4Q2NUSO/A6bfUa584vgdf0bR8/LqiRxZr1H6jx31KMwv12FyvCJe8b5RZIXGCkk75lr2Dy4Mv9U/WSDjY= X-Received: by 2002:a17:902:aa0a:b029:d0:89f4:6224 with SMTP id be10-20020a170902aa0ab02900d089f46224mr8791385plb.12.1601240821779; Sun, 27 Sep 2020 14:07:01 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:6a10:8371:0:0:0:0 with HTTP; Sun, 27 Sep 2020 14:07:01 -0700 (PDT) In-Reply-To: <87wo0f4i75.fsf@nicolasgoaziou.fr> References: <878scvbsfi.fsf@aquinas> <87wo0f4i75.fsf@nicolasgoaziou.fr> From: Samuel Wales Date: Sun, 27 Sep 2020 14:07:01 -0700 Message-ID: Subject: Re: newline or no newline at end of capture: expected behavior To: Samuel Wales , Richard Lawrence , emacs-orgmode@gnu.org Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::543; envelope-from=samologist@gmail.com; helo=mail-pg1-x543.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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=pass header.d=gmail.com header.s=20161025 header.b=tOCgOzjF; dmarc=pass (policy=none) header.from=gmail.com; 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.71 X-TUID: fpDzV9/gZrga hi nicolas, thanks, that helps to know that org adds a newline. this prevents the failure mode of corrupted headers. just to confirm, do you mean capture /templates/ [potentially verifiable by org] vs. /finalized buffers/? it sounds like you mean templates, because otherwise org just does whatever is necessary to create desired lines? the user can mess with the buffer, so might leave a trailing newline or not. might copy from a file that ensures trailing newline, or one that does not, etc. thus finalized buffers can contain anything. or nothing. at present, possibly due to my own errors, without the options specified explicitly, i get blank lines below the header if i finalize the buffer with a trailing newline, and blank lines below the target header if i capture with an empty buffer. in maint. On 9/27/20, Nicolas Goaziou wrote: > Hello, > > Samuel Wales writes: > >> thank you. when i can, i will try explicitly setting all three to 0 >> to see if that prevents the unwanted newlines, in the buffer with >> newline on last line, and empty buffer, cases. >> >> the docstring says empty-lines defaults to 0, which is what i want. >> it does not say what the default for after and before are. >> >> it /sounds/ like capture is supposed to produce the desired number >> [and position] of empty lines regardless of whether the buffer is >> empty or there is or is not a trailing newline on the final line of >> hte buffer. is this more or less correct? > > I didn't read the whole thread, but a final newline is mandatory in all > capture templates, independently on the number of desired blank lines. > If such final newline is not provided, the capture mechanism will add > one. > > The only exception is about empty capture templates, which are left > as-is, i.e. a "final newline" is not added in that case. > > I don't know if that answers your question, but HTH. > > Regards, > -- > Nicolas Goaziou > -- The Kafka Pandemic Please learn what misopathy is. https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html