emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Michael Zeller <michael.dylan.zeller@gmail.com>
To: Michael Zeller <michael.dylan.zeller@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Include mechanism for web publishing
Date: Tue, 28 Jul 2009 17:53:06 -0700	[thread overview]
Message-ID: <87d47kgvil.fsf@zeller.michaelzeller.com> (raw)
In-Reply-To: <87hbwwgw75.fsf@zeller.michaelzeller.com> (Michael Zeller's message of "Tue, 28 Jul 2009 17:38:22 -0700")

Opps, for some reason the important portion didn't copy. You'll have to
forgive me, I'm still learning gnus.

Michael Zeller <michael.dylan.zeller@gmail.com> writes:

> diff --git a/doc/org.texi b/doc/org.texi
> index e28b185..43cd2ab 100644
> --- a/doc/org.texi
> +++ b/doc/org.texi
> @@ -8262,13 +8262,15 @@ include your @file{.emacs} file, you could use:
>  @end example
>  @noindent
>  The optional second and third parameter are the markup (@samp{quote},
> -@samp{example}, or @samp{src}), and, if the markup is @samp{src}, the
> -language for formatting the contents.  The markup is optional, if it is not
> -given, the text will be assumed to be in Org mode format and will be
> -processed normally.  The include line will also allow additional keyword
> -parameters @code{:prefix1} and @code{:prefix} to specify prefixes for the
> -first line and for each following line, as well as any options accepted by
> -the selected markup.  For example, to include a file as an item, use
> +@samp{example}, @samp{org}, or @samp{src}), and, if the markup is @samp{src},
> +the language for formatting the contents. If the markup is @samp{org}, the
> +text will be assumed to be in Org mode format and will be processed
> +normally. The markup is optional, if it is not given, the text will be
> +included as is and any Org markup will be escaped.  The include line will
> +also allow additional keyword parameters @code{:prefix1} and @code{:prefix}
> +to specify prefixes for the first line and for each following line, as well
> +as any options accepted by the selected markup.  For example, to include a
> +file as an item, use
>  
>  @example
>  #+INCLUDE: "~/snippets/xx" :prefix1 "   + " :prefix "     "
> diff --git a/lisp/org-exp.el b/lisp/org-exp.el
> index 280b1f4..83f9b74 100644
> --- a/lisp/org-exp.el
> +++ b/lisp/org-exp.el
> @@ -2085,13 +2085,14 @@ TYPE must be a string, any of:
>               (not (file-readable-p file)))
>           (insert (format "CANNOT INCLUDE FILE %s" file))
>         (when markup
> - (if (equal (downcase markup) "src")
> - (setq start (format "#+begin_src %s %s\n"
> - (or lang "fundamental")
> - (or switches ""))
> - end "#+end_src")
> - (setq start (format "#+begin_%s %s\n" markup switches)
> - end  (format "#+end_%s" markup))))
> - (cond ((equal (downcase markup) "src")
> - (setq start (format "#+begin_src %s %s\n"
> - (or lang "fundamental")
> - (or switches ""))
> - end "#+end_src"))
> - ((equal (downcase markup) "org") nil)
> - (t (setq start (format "#+begin_%s %s\n" markup switches)
> - end  (format "#+end_%s" markup)))))
+         (cond ((equal (downcase markup) "src")
+                 (setq start (format "#+begin_src %s %s\n"
+                                     (or lang "fundamental")
+                                     (or switches ""))
+                       end "#+end_src"))
+                ((equal (downcase markup) "org") nil)
+                (t (setq start (format "#+begin_%s %s\n" markup switches)
+                         end  (format "#+end_%s" markup)))))
>         (insert (or start ""))
>         (insert (org-get-file-contents (expand-file-name file) prefix prefix1 markup))
>         (or (bolp) (newline))
>
> I hope that helps!
> ~Michael Zeller

  reply	other threads:[~2009-07-29  0:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-28 22:38 Include mechanism for web publishing Israel Herraiz
2009-07-29  0:38 ` Michael Zeller
2009-07-29  0:53   ` Michael Zeller [this message]
2009-07-29 14:08     ` Israel Herraiz
2009-07-29 15:25       ` Bastien

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=87d47kgvil.fsf@zeller.michaelzeller.com \
    --to=michael.dylan.zeller@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).