From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Porter Subject: Re: [RFC] Document level property drawer Date: Mon, 30 Sep 2019 11:01:36 -0500 Message-ID: <87eezxrcwv.fsf@alphapapa.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:38468) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iEy7a-0004vD-UO for emacs-orgmode@gnu.org; Mon, 30 Sep 2019 12:02:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iEy7W-00049M-Gg for emacs-orgmode@gnu.org; Mon, 30 Sep 2019 12:01:56 -0400 Received: from 195-159-176-226.customer.powertech.no ([195.159.176.226]:35422 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iEy7Q-00043q-Rz for emacs-orgmode@gnu.org; Mon, 30 Sep 2019 12:01:52 -0400 Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1iEy7K-0004EG-G1 for emacs-orgmode@gnu.org; Mon, 30 Sep 2019 18:01:42 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Gustav Wikström writes: > Hi, > > This patch introduces a document level property drawer. > > This has been discussed previously in a larger context: > - https://lists.gnu.org/archive/html/emacs-orgmode/2019-06/msg00000.html > - https://lists.gnu.org/archive/html/emacs-orgmode/2019-08/msg00339.html > - https://lists.gnu.org/archive/html/emacs-orgmode/2019-09/msg00010.html > > The patch is a somewhat modified version of what was included in the third > link above. How does it differ from what was previously proposed? > The following will be true for document level property drawers: > 1) In the same way that one can have a property drawer for a heading, one > can have a property drawer for a whole document. > 2) All existing commands that can work with property drawers will > (shall) work also on property drawers before the first heading. What exactly does "will (shall)" mean? > 3) Properties defined in a property drawer will have precedence over > properties defined as a property keyword, if the same property is > defined using both conventions. That protocol seems unnatural and confusing to me: - If precedence were to be defined by something other than file-order, it seems to me that those defined with #+ keywords should have precedence, because they are more visible, while those in drawers are hidden. - However, it seems to me that the simplest, most natural protocol would be for later declarations to override earlier ones. > 4) The position for the document level property drawer is: > - At the first line in a file that is not a comment or a keyword. > > I.e. the following will work: > > #+begin_src org > # -*- mode: org -*- > ,#+TITLE: Test > :PROPERTIES: > :CATEGORY: Test > :END: > > Preamble > > ,* Some heading > Some content > #+end_src > > > but not this: > > #+begin_src org > Some comment and/or empty line > > :PROPERTIES: > :CATEGORY: Test > :END: > > ,* Some heading > Some content > #+end_src That feels unintuitive to me. Document-level property keywords may appear anywhere in a file, so it seems inconsistent for document-level property drawers to be limited in this way, as if there were an implied headline at the top of the file. If it were so, I would expect to see many mailing list posts by users asking why the properties defined in their document-level property drawers aren't working. Given that there is no enforcement in Org's UI to keep such drawers in certain places, I think the implementation should be tolerant of users' preferences and mistakes (cf. Postel's Law).