emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Samuel Wales" <samologist@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: extensible syntax
Date: Mon, 5 Jan 2009 09:19:44 -0700	[thread overview]
Message-ID: <20524da70901050819k7a5a89c6g745e9e1459293438@mail.gmail.com> (raw)
In-Reply-To: <20524da70901041233g105f372fv175a47dc9884fa43@mail.gmail.com>

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

  reply	other threads:[~2009-01-05 16:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-04 20:33 extensible syntax Samuel Wales
2009-01-05 16:19 ` Samuel Wales [this message]
2009-01-06 10:08   ` Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20524da70901050819k7a5a89c6g745e9e1459293438@mail.gmail.com \
    --to=samologist@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).