From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Samuel Wales" Subject: Re: extensible syntax Date: Mon, 5 Jan 2009 09:19:44 -0700 Message-ID: <20524da70901050819k7a5a89c6g745e9e1459293438@mail.gmail.com> References: <20524da70901041233g105f372fv175a47dc9884fa43@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LJsB9-0002hj-KF for emacs-orgmode@gnu.org; Mon, 05 Jan 2009 11:19:47 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LJsB8-0002gz-4Z for emacs-orgmode@gnu.org; Mon, 05 Jan 2009 11:19:47 -0500 Received: from [199.232.76.173] (port=60504 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LJsB7-0002gw-W0 for emacs-orgmode@gnu.org; Mon, 05 Jan 2009 11:19:46 -0500 Received: from nf-out-0910.google.com ([64.233.182.190]:35613) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LJsB7-0002hN-Ib for emacs-orgmode@gnu.org; Mon, 05 Jan 2009 11:19:45 -0500 Received: by nf-out-0910.google.com with SMTP id c7so1102581nfi.26 for ; Mon, 05 Jan 2009 08:19:44 -0800 (PST) In-Reply-To: <20524da70901041233g105f372fv175a47dc9884fa43@mail.gmail.com> Content-Disposition: inline List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hello again :), Let me provide examples -- using footnotes. All footnote references and definitions would be inside $[...]. (As mentioned in my previous post.) There was a concern about keeping code executable. You can use a parameter to specify whether you want the footnote to: - disappear in the code (thus keeping the code executable without having to use comments, so that the reference is at the correct position in the line, yet keeping the link pointing to the correct position) - or show up as a numbered or labeled reference The reference can look like: (defun my-example-defun $[fn "defun name" :invisible t] () (interactive "P") ;$[fn "interactive"] ... The second reference is visible, but the first is not. Note that this allows references with spaces (or anything else). No need to worry about syntax conflicts within org. There was also a concern about conflicting with code syntax. Your decision as a user is whether you want $[...] to be interpreted as code or footnote. You could want either one. To make it be interpreted as code, you simply prefix the $ with a \. That takes away org's special handling of the syntax. org's footnote code merely checks for a \ in front of the $ and then it knows not to do anything except remove the \. In fact, the footnote code doesn't even have to do that. The org extensible syntax code (the code for $[...]) is what does it. The footnote code simply calls the extensible syntax code. To make it be a footnote, you don't do anything. This will work for all code examples you can dream up. There is no need to worry about which languages have $[...] in them. The advantage is that for future features, the same solutions will work. And since the syntax is extensible, it will work for completely new features. Finally, the escaping scheme should be familiar to users, as it is a common method in programming languages. Is this idea possibly of interest? -- For personal gain, myalgic encephalomyelitis denialists are knowingly causing further suffering and death by grossly corrupting science. Do you care about the world? http://www.meactionuk.org.uk/What_Is_ME_What_Is_CFS.htm