emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Yu <yu_icq@gmx.at>
To: org-mode mailing list <emacs-orgmode@gnu.org>
Subject: "noweb-ref": Limiting scope of definitions?
Date: Mon, 30 Jan 2012 17:31:57 +0100	[thread overview]
Message-ID: <CANtbJLED9WY4DDm0c7r4oDEJ8pYOeNC_dX5DLao9sTd7HU+49w@mail.gmail.com> (raw)

Hello!

Scenario
-----------------

  * Maintain a potentially long org file as an appendix.
  * In this appendix, many independent scripting tasks will be documented.
  * Each such scripting task has similiar partial tasks, e.g. imports,
"settings", ...

In such a case, many independent scripts may contain a block
"<<imports>>" or something or something to the same effect, i.e. an
overlap of definitions could be avoided only by some sort of scoping:
  (a) manually, e.g. by prefixing the names with a script-specific
        string (e.g. <<task1-imports>>. While this is flexible (i.e.
        allows reuse of code from other script), it also reduces the
        readability of the NOWEB code).
  (b) providing some sort of scoping, e.g. declaring definitions section-local.


Implementation Idea
----------------------------------

A simple implementation, maintaining the flexibility of the manual
solution, would be to create a header argument like ":noweb-prefix",
that effectively just adds a prefix to the noweb reference names (both
in declaring the block (#+name, :noweb-ref) and in using it
(<<name>>)), unless such a prefix is explicitly specified. This could
then be set as needed, for specific blocks or subtrees (as property)
or any mixture of such.

A prefix would then be recognized by a delimiter string to be specified.

This solution would also be downward compatible with existing files,
as the syntax for recognizing a prefix would be relevant only when
deciding whether to apply an explicitly introduced ":noweb-prefix".

             reply	other threads:[~2012-01-30 16:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-30 16:31 Yu [this message]
2012-02-01 14:16 ` "noweb-ref": Limiting scope of definitions? Eric Schulte

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=CANtbJLED9WY4DDm0c7r4oDEJ8pYOeNC_dX5DLao9sTd7HU+49w@mail.gmail.com \
    --to=yu_icq@gmx.at \
    --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).