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 tcb4AOqG5V+CUQAA0tVLHw (envelope-from ) for ; Fri, 25 Dec 2020 06:30:02 +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 n/TaN+mG5V8uEQAAbx9fmQ (envelope-from ) for ; Fri, 25 Dec 2020 06:30:01 +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 1E702940355 for ; Fri, 25 Dec 2020 06:30:00 +0000 (UTC) Received: from localhost ([::1]:44816 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ksgbv-0000zt-JF for larch@yhetil.org; Fri, 25 Dec 2020 01:29:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50328) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ksgbL-0000zk-Tk for emacs-orgmode@gnu.org; Fri, 25 Dec 2020 01:29:25 -0500 Received: from mail-qk1-x732.google.com ([2607:f8b0:4864:20::732]:45376) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ksgbJ-0003xF-Ms for emacs-orgmode@gnu.org; Fri, 25 Dec 2020 01:29:23 -0500 Received: by mail-qk1-x732.google.com with SMTP id b64so3558941qkc.12 for ; Thu, 24 Dec 2020 22:29:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=XWm1b8X4zp25pCWljS7+EvEI/QQogwF7cY4F7dzd/zQ=; b=c2RbnBMHNnX3650pvACZreYAe0/P0rCdcngj7hsIFX0gBOaHWHpyVZUfBTblyAi1zt NIXPno2JlsTWaxw4FwwbKPN1luWanjScLlcD6RD07W57pljosHPq0CsvDlQyNjdeb/9T pAW0DUxefjFUGkkJ+5RQcX3R5/8y6151ow9EhcAjEZuvl3M6pBOCzrRm62JcezOqiLTV ZAllYcOR33UY3jn5Kopdp2DX6PwoZjkzbFClHdOdBUnOZ2lltXX58CHuN6vIw1N3fyEg tZm/x5yI+1I8BAhPMAlkdY1iTqNSo3CMS3EttD1lOFcnbKnVKuKUww9XBr7dkLlqxTCN T3fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=XWm1b8X4zp25pCWljS7+EvEI/QQogwF7cY4F7dzd/zQ=; b=PpQOXIEIsVHqucLReCRaTuS2aSN6Cf/sUERrp+nASf8QS6a12FAk+iGcPeNPxh9W53 /G6se+LchYfXdBRKVbU4AykeNxFXn8s+2SUwPhN6uhwQSz26tKeSsi6kSfeh3s0XmOGe ZKe5pCZ3epto4TdLsRiZRaPGihwxvGB2svG93TUc+J6SAzjrv1QStQ4HnqoEm1Pkg7rI iKsJYuSRu1qTyrg/lCPYqd8H8k+C4vIxcctt/H/Lk1oVHSM4cj3FFXAelHXb5wbFlmqM lVr8LFv2tTLU5TeRCYlPB8qccbVd90oNF3jYCT1rOwSUYopg6ESW7gWIZJsKTnfwkwf2 fLbA== X-Gm-Message-State: AOAM5339D345hJJ/sDHSpkkRjx6gxUYul2cJxaxO7OTMwtoiIxJTenjw hzG0A4p3/Z84VA6G2wKPGuwwzbiOuWs= X-Google-Smtp-Source: ABdhPJzXRugeh/lMTTOMKw7CDcDUIQVWAUkfiGU2uDfbJj8wF0g86T5jPG57S60YXsNrPVOSSYUkDw== X-Received: by 2002:a37:9d84:: with SMTP id g126mr34289839qke.262.1608877759323; Thu, 24 Dec 2020 22:29:19 -0800 (PST) Received: from [172.20.10.2] (7.sub-174-215-146.myvzw.com. [174.215.146.7]) by smtp.gmail.com with ESMTPSA id e10sm16829948qte.48.2020.12.24.22.29.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Dec 2020 22:29:18 -0800 (PST) Subject: Re: did behaviour of RET change again? To: Tom Gillespie , Greg Minshall References: <505431.1608780887@apollo2.minshall.org> From: Devin Prater Message-ID: <2bcc0b31-c535-e2d9-9187-440f8b05a37d@gmail.com> Date: Fri, 25 Dec 2020 00:29:15 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Received-SPF: pass client-ip=2607:f8b0:4864:20::732; envelope-from=r.d.t.prater@gmail.com; helo=mail-qk1-x732.google.com X-Spam_score_int: -38 X-Spam_score: -3.9 X-Spam_bar: --- X-Spam_report: (-3.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_FROM=0.001, NICE_REPLY_A=-1.825, 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: , Cc: Emacs Org mode mailing list Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.02 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=c2RbnBMH; 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-Migadu-Queue-Id: 1E702940355 X-Spam-Score: -2.02 X-Migadu-Scanner: scn1.migadu.com X-TUID: SdPJuzm3N7Oh For me, I don't like my paragraphs indented. That just adds more speech from Emacspeak. I'm glad y'all talked about which setting does this so I can turn it off.. I mean, I don't know of any reason why paragraphs should be indented, but that's just my opinion. Maybe visual appeal, looking more like a word processor? On 12/24/20 12:35 AM, Tom Gillespie wrote: >> possibly i'm misunderstanding, but my sense is that the value of org >> adapt indentation doesn't change what you might actually find ("in a >> .org file in the wild"). so, whatever its value, your grammar would >> have to deal with all cases? > Yep, we can't magically change all the files out in the wild. > Until I wrote this email out I agreed about the grammar too, but > as it turns out I think there might be a compromise, which is that > a grammar could be allowed to interpret certain types of lines > with leading whitespace as if they were paragraph lines instead of > as say, the start of an org-babel block. That way an interoperable > org spec could be made simpler without preventing e.g. the elisp > implementation from going above and beyond the spect to provide > support for leading whitespace. > > My interest in the org-adapt-indentation setting is to try to align what > most users are doing out in the wild with a representation for their > org files that is less ambiguous and more performant (among other > things). > > If I had to guess I would say that most new org files have leading > whitespace precisely because org-adapt-indentation is set to t by > default. Getting users to transition their files requires an incentive, > and some users may find that they use org in such a way that they > don't need to. > > While writing this email I thought of a reasonable incentive, which is > that only files without leading significant whitespace (i.e. that look like > those that are authored with org-adapt-indentation nil) have specified > behavior for things like org-babel blocks. This would allow best effort > by the elisp org-mode implementation to allow users who don't care > about interoperability to continue as they have been doing, while also > providing clear guidance for what users must do if they want > consistent behavior on other tools that consume org formatted files. > This is critical for keeping the org spec from becoming overly complex. > > The first step would thus be to reduce the rate at which new org files > are created with leading whitespace by changing org-adapt-indentation > to be nil by default. > > The second step would be to give users a clear way forward to safely > normalizing their files. Org has a habit of reindenting subsets of files > from time to time, but in general doing a complete switch to have no > significant whitespace can be risky. > > The third step would be to let the incentives and needs of users > play out over time, but users would generally probably be happier > because by default they would be in the "my files are portable and > generally interpretable without me having to do any additional work" > state instead of the "why did no one tell me the defaults weren't > portable" state. > >> or, and maybe this would make sense, you'd define an "interoperability" >> form of .org, that all "wild" .org files could be (programmatically) >> converted into, without losing any of their semantics? > Yep exactly. For many use cases the cost of stripping the whitespace > that corresponds to heading level is not unreasonable, e.g. since it > would only have to be done once. However, if you are writing another > org implementation, then every single time you parse a heading and > its accompanying section you have to strip the whitespace, and that > will happen every single time a user modifies the file, which starts to > get expensive. Alternately you could implement it so that everything > is stripped once and then you keep a version in memory that the user > edits which doesn't have leading whitespace, but then every time you > save you have to splice it all back in to preserve the roundtrip. > > This also doesn't even begin to deal with the fact that users can create > malformed org files that can have lines that are less than the expected > significant indentation. This becomes a complete nightmare when trying > to come up with some rational way of dealing with org babel blocks for > languages like python where there is significant whitespace. > > Consider the horror if trying to specify the correct behavior in a situation > like this. Better just to declare it a malformed babel block and move on. > Unfortunately you can't always detect that such things are malformed > during the first pass of parsing because you have to count the number of > spaces. > > #+begin_src org > # -*- org-adapt-indentation: t -*- > ,*** Oh No > ,#+begin_src python > class What: > have = 'you' > done = 'now' > ,#+end_src > #+end_src > > In order to ensure that org files can be reliably interpreted this either > means that the specification for handling cases like this becomes > extremely complex, or the spec can say "you can have leading > whitespace, but nasal demons may come for you, there is only > specified behavior if you do not have leading whitespace." > > Having unspecified behavior in cases like that would mean that an > implementation could be fully compliant if it were to treat any > #+begin_src lang line that started with whitespace as if it were > a paragraph instead of a babel block. I suspect that this will be > the best way forward. > >> (anyway, good luck with that, even with any significant subset of that!) > Thanks, and thanks for the inspiration! > Tom >