Commit graph

664 commits

Author SHA1 Message Date
Nicolas Goaziou b37761715e Added variable to configure where lists should be interpreted
* lisp/org-list.el (org-list-forbidden-blocks): variable renamed from
  org-list-blocks.
(org-list-export-context): new variable

* list/org-exp.el (org-export-mark-lists): use new variable.

* list/org-latex.el (org-export-latex-lists): use new variable
2011-02-18 12:45:09 +01:00
Nicolas Goaziou 69e02a73de Modified export engines for lists
* lisp/org-exp.el (org-export-mark-lists): new function, replacing
  org-export-mark-list-ending. It adds information as text properties
  to every list, before changes done by exporter destruct them.

* lisp/org-html.el (org-export-as-html): delegate list handling to
  external function org-html-export-list-line.
(org-html-export-list-line): new function.

* lisp/org-latex.el (org-export-latex-lists): small modification.
2011-02-18 12:45:09 +01:00
Nicolas Goaziou 2adbcfffe1 Remove uses of deprecated top-point and bottom-point functions
* lisp/org.el (org-skip-over-state-notes,org-store-log-note): use new
  accessors.

* list/ob.el (org-babel-result-end): use new accessors.

* list/org-exp.el (org-export-mark-list-ending): use new accessors.
2011-02-18 12:45:08 +01:00
Bastien Guerry d03d3575cb Code cleanup: always use 'backend instead of htmlp, latexp, etc. 2011-02-16 10:58:04 +01:00
Bastien Guerry 0491e5305e `org-export-default-language': Better docstring. 2011-02-15 18:25:43 +01:00
Dan Davison fda90a9aad New function `org-clone-local-variables'.
* org-exp.el (org-export-preprocess-string): Set the source
buffer and use `org-clone-local-variables' to get local
variables from it.

* org.el (org-clone-local-variables): New function.
2011-02-15 18:03:58 +01:00
Dan Davison 695b15da6d Allow empty strings in minted/listings latex options
* lisp/org-exp.el (org-export-format-source-code-or-example):
Allow empty string as second element in minted/listings options

Both

    (setq org-export-latex-minted-options
          '(("frame" "lines")
            ("fontsize" "\\scriptsize")
            ("linenos" "")))

and

    (setq org-export-latex-minted-options
          '(("frame" "lines")
            ("fontsize" "\\scriptsize")
            ("linenos")))

will result in latex like

\begin{minted}[frame=lines,fontsize=\scriptsize,linenos]{common-lisp}
2011-02-15 15:01:25 +00:00
Dan Davison 65d0b3d353 New UI for configuring latex src code export.
Three new user-customizable variables:

org-export-latex-listings-options (default nil)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Association list of options for the latex listings package.

These options are supplied as a comma-separated list to the
\\lstset command. Each element of the association list should be
a list containing two strings: the name of the option, and the
value. For example,

  (setq org-export-latex-listings-options
    '((\"basicstyle\" \"\\small\")
      (\"keywordstyle\" \"\\color{black}\\bfseries\\underbar\")))

will typeset the code in a small size font with underlined, bold
black keywords.

Note that the same options will be applied to blocks of all
languages.

See ftp://ftp.tex.ac.uk/tex-archive/macros/latex/contrib/listings/listings.pdf

customization group: org-export-latex

org-export-latex-minted-options (default nil)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Association list of options for the latex minted package.

These options are supplied within square brackets in
\\begin{minted} environments. Each element of the alist should be
a list containing two strings: the name of the option, and the
value. For example,

  (setq org-export-latex-minted-options
    '((\"bgcolor\" \"bg\") (\"frame\" \"lines\")))

will result in src blocks being exported with

\\begin{minted}[bgcolor=bg,frame=lines]{<LANG>}

as the start of the minted environment. Note that the same
options will be applied to blocks of all languages."

customization group: org-export-latex

See minted.googlecode.com/files/minted.pdf

org-export-latex-custom-lang-environments (default nil)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Association list mapping languages to language-specific latex
environments used during export of src blocks by the listings
and minted latex packages. For example,

  (setq org-export-latex-custom-lang-environments
     '((python \"pythoncode\")))

* lisp/org-exp.el (org-export-format-source-code-or-example):
  Support new user-customizable options
(org-export-latex-custom-lang-environments): Ensure new variable is defined
(org-export-latex-listings-options): Ensure new variable is defined
(org-export-latex-minted-options): Ensure new variable is defined

* lisp/org-latex.el (org-export-latex-listings-options): New variable
(org-export-latex-minted-options): New variable
(org-export-latex-custom-lang-environments): New variable
2011-02-15 15:01:25 +00:00
Bastien Guerry ed6d676026 Code cleanup: use a generic :for-backend parameter. 2011-02-15 11:07:46 +01:00
Lawrence Mitchell aa6dba8a74 Only match complete words in org-export-add-options-to-plist
* org-exp.el (org-export-add-options-to-plist): Require match to start
at a word-boundary.

Previously, if an option was the suffix of another option (such as TeX
and LaTeX) the setting for the former would propagator to the latter.
This seems like an unintended consequence of a lax regexp in
org-export-add-options-to-plist.  This patch allows options to share a
suffix with another option by requiring that the match against an
option starts at a word-boundary.
2011-02-13 00:47:51 +01:00
Bastien Guerry 3411a9d759 New variable to set the initial export scope.
* org-exp.el (org-export-initial-scope): new custom variable.
(org-export): Use this new variable.  If there is an active
region, tell it when prompting the user for an export command.
Also change the way the function handles selection of buffer
and subtree export.

----
Now `1' switches between subtree/buffer export until the user
select an export command.  Also, when there is an active region,
modify the message so that the user is aware he will only export
the surrounding subtree.
2011-02-11 10:44:35 +01:00
Bastien Guerry da8dc7bba7 Rewrite the handling of HTML preamble/postamble.
* org-html.el (org-export-html-auto-preamble)
(org-export-html-auto-postamble): Remove.
(org-export-html-preamble, org-export-html-postamble): Turn
into custom variables.  Update the docstrings.
(org-export-html-preamble-format)
(org-export-html-postamble-format): New custom variables.
(org-export-as-html): Use org-export-html-postamble-format and
org-export-html-preamble-format.
(org-export-html-title-format): delete.

* org-exp.el (org-export-plist-vars): Remove
:auto-preamble and :auto-postamble.  Rename :preamble and
:postamble to :html-preamble and :html-postamble.

* org-publish.el (org-publish-project-alist): Remove
:auto-preamble and :auto-postamble.  Rename :preamble and
:postamble to :html-preamble and :html-postamble.

* org.texi (Publishing options): replace :preamble and
:auto-preamble by :html-preamble (same for postamble.)
2011-02-11 01:27:15 +01:00
Bastien Guerry 9e8f1ddcd8 Fix typo. 2011-02-07 16:35:59 +01:00
Dan Davison 123f3b774c make export dispatcher go away promptly
Following on from Stephen's recent post, a
thing-that-slightly-bothers-me is the way the export dispatcher window
doesn't go away until export is complete. I've briefly looked at the
code twice now and it wasn't obvious to me why the save-window-excursion
(line 941 org-exp.el) wasn't already doing what I wanted. However, the
change below seems to have the effect I wanted. While this particular
solution may be a hack, I wonder whether people would prefer its
behaviour? E.g. try exporting this:

#+title: title

#+begin_src sh :exports results
sleep 5 && echo hello
#+end_src

export can often take several seconds and it's nice to be able to zone
out looking at your org document rather than the dispatcher window.

	Modified lisp/org-exp.el

(I see that (sit-for .0001) is used in a couple of places in Org for
this effect, so maybe that should be used instead.)

Dan
2011-02-04 20:02:26 +01:00
Bastien Guerry b93aa70551 Fix bug in org-export-target-internal-links.
* org-exp.el (org-export-target-internal-links): Locally turn
on `org-link-search-must-match-exact-headline' to match exact
internal links.

Thanks to Jambunathan K for spotting this.
2011-02-03 17:59:56 +01:00
Osamu Okano a017fca37f Various docstrings typo fixes by Osamu OKANO. 2011-02-01 13:05:13 +01:00
David Maus 6575b252dc org-faq: Invalid XHTML
At Tue, 11 Jan 2011 03:31:11 +0530,
Jambunathan K wrote:
>
>
> There are 16 errors while validating org-faq page.
>
> http://validator.w3.org/check?uri=http%3A%2F%2Forgmode.org%2Fworg%2Forg-faq.html&charset=%28detect+automatically%29&doctype=Inline&group=0
>
> Can such errors be not caught as soon as it happens?

Attached patch fixes a glitch in Org's HTML export and mitigates the
problem of invalid id and name attributes.

Best,
  -- David
2011-01-31 19:32:19 +01:00
Lawrence Mitchell 81bac18755 Quote \[cmd] in docstring of org-export-with-LaTeX-fragments
* org-exp.el (org-export-with-LaTeX-fragments): Fix docstring so that
\\[ a = b \\] is not interpreted as a keybinding by
`substitute-command-keys'.

In a docstring \\[text] is used to indicate that text should be
interpreted by `substitute-command-keys'.  To avoid this
interpretation, we need to prefix it with \\=.
2011-01-26 19:07:31 +01:00
Julien Danjou 84d7165d74 org: remove org-invisible-p
I just found a left over in org-list.el. :)

Updated patch attached.

>From bf6c65a42e04d4753c58795442a479685bb5f318 Mon Sep 17 00:00:00 2001
From: Julien Danjou <julien@danjou.info>
Date: Wed, 26 Jan 2011 11:14:11 +0100
Subject: [PATCH] org: remove org-invisible-p

* org.el: Remove org-invisible-p: outline-invisible-p is
available in Emacs 22 and in recent XEmacs 21. Replace in
various files.

Signed-off-by: Julien Danjou <julien@danjou.info>
2011-01-26 18:26:46 +01:00
Bastien Guerry c8ec337d68 org-exp.el: cosmetic change to `org-get-file-contents' 2011-01-18 01:24:12 +01:00
Puneeth Chaganti 7b399fe128 How do I include text between a range of line numbers with #INCLUDE
Hi Carsten,

On Sat, Jan 8, 2011 at 11:35 PM, Carsten Dominik
<carsten.dominik@gmail.com> wrote:
> Hi Puneeth,
>
> can cou please augment the patch with a propert ChangeLog-like entry, and
> with documentation for the manual, and then resubmit?

Here is a patch with a ChangeLog entry and documentation for the
manual. Please tell me if it looks OK. Also, I hope using
git-format-patch is the right way to send this page. If not, what is
the right way?

Thanks,
Puneeth

>From 4a9be5b1a7a19c5d092ed14a86d29ad83122e9a8 Mon Sep 17 00:00:00 2001
From: Puneeth Chaganti <punchagan@gmail.com>
Date: Sun, 9 Jan 2011 00:48:51 +0530
Subject: [PATCH] Include only specified range of line numbers of a file

* doc/org.texi (Include files): Document :lines.
* lisp/org-exp.el (org-export-handle-include-files): Support :lines
property.
(org-get-file-contents): New argument lines to include specify a range
of lines to include.

On Fri, Jan 7, 2011 at 1:29 PM, Puneeth <punchagan@gmail.com> wrote:
> On Fri, Jan 7, 2011 at 10:03 AM, Venkatesh Choppella
> <venkatesh.choppella@iiit.ac.in> wrote:
>> I would like to include a part of a file (between a given range of
>> line numbers) instead of the whole file.  Is there a way to do that
>> in org-mode?
>
> It isn't possible to include files using line numbers, as of now.
> Here's a quick patch that would add this feature.  I have tested it
> with small files and works fine. Can somebody tell me if it looks
> good?
>
> :lines "5-10"  will include the lines from 5 to 10, 10 excluded.
> :lines "-10"  will include the lines from 1 to 10, 10 excluded.
> :lines "5-"  will include the lines from 1 to the end of the file.
>
> HTH,
> Puneeth
2011-01-18 01:02:04 +01:00
Carsten Dominik 08755d7aa9 Fix regexp in export engine 2011-01-05 17:53:41 +01:00
Bastien Guerry a39c35fcd9 org-exp.el: Inhibit read-only when grabbing the title from a subtree.
Eric S. Fraga found this problem while trying to export a subtree from
a read-only file.
2011-01-04 17:03:14 +01:00
Nicolas Goaziou 478eabccbd org-exp: ensure list ending marker is inserted on a line on its own
* lisp/org-exp.el (org-export-mark-list-ending): insert additional
  newline characters if end-list-marker is at a wrong position.

This solves a problem arising when exporting a region to HTML with a
list ending at the end of region. The marker would then be inserted on
the last line, following text from the list.
2010-12-22 09:54:14 +01:00
Eric Schulte f8000a9bc1 org-export-string now accepts symbolic or string fmt argument
* lisp/org-exp.el (org-export-string): Use `format' to construct
  function call to allow symbolic or string arguments.
2010-12-16 18:09:51 -07:00
Carsten Dominik 7666ba421f Version number back to 7.4 2010-12-10 18:49:40 +01:00
Carsten Dominik 76a25715c9 Bump version number to 7.5 2010-12-10 18:43:10 +01:00
Nicolas Goaziou 9be9f727f8 Fix LaTeX export of subtrees and inline tasks 2010-12-06 19:13:09 +01:00
Puneeth Chaganti 249ae99b18 Include an .org file and lower the level of all its headers
* doc/org.texi (Include files): Document :minlevel.
* lisp/org-exp.el (org-export-handle-include-files): Support :minlevel
property.
(org-get-file-contents): New argument minlevel to demote included
content.

On Sat, Nov 13, 2010 at 1:12 AM, Carsten Dominik
<carsten.dominik@gmail.com> wrote:
>
> On Nov 10, 2010, at 3:46 AM, Jianshi Huang wrote:
>
>> Hi,
>>
>> I know I can include any file using #+INCLUDE.
>>
>> I need to include several org files, but they were edited
>> independently as a complete document.
>>
>> Now I want to lower the levels of headers in these org files
>> automatically during inclusion. Is there a way to do that?
>
> No. But since #+include accepts arguments, it could be implemented,
> something like
>
> #+include "aaa.org" :minlevel 4
>
> or so. I would accept a good patch to this effect.

Here's a patch. I tested it with a simple document and works fine.

Thanks,
Puneeth
2010-11-15 11:15:53 +01:00
Nicolas Goaziou c303127cee babel: delay call to `org-export-blocks-preprocess' in export
* lisp/org-exp.el (org-export-preprocess-string): delaying code block
  processing a bit to allow correct list parsing in the export string
2010-11-12 16:39:35 -07:00
Dan Davison e89e1facc2 Remove hard-wired configuration of latex minted export
* lisp/org-exp.el: (org-export-format-source-code-or-example):
  Remove hard-wired configuration of minted export
  (org-export-latex-minted-with-line-numbers): remove variable

* lisp/org-latex.el: (org-export-latex-minted-with-line-numbers):
  remove variable
2010-11-12 11:00:44 +00:00
David Maus 6c95170ca0 Limit search for in-buffer options beginning of first headline
* org-exp.el (org-export-visible): Limit search for in-buffer options
beginning of first headline.
2010-11-07 20:06:54 +01:00
Bastien Guerry 6630edbd0f Set version number to 7.3 2010-11-07 14:52:14 +01:00
Carsten Dominik 350b75be63 Rewrite of the clock table code
* lisp/org.el (org-shorten-string): New function.
* lisp/org-exp.el (org-export-convert-protected-spaces): New function.
(org-export-preprocess-string): Call
`org-export-convert-protected-spaces' to handle new hard spaces.

* lisp/org-clock.el (org-clocktable): New customization group.
(org-clocktable-defaults): New option.
(org-clock-clocktable-formatter): New option.
(org-clock-clocktable-default-properties): New option.
(org-dblock-write:clocktable): Rewrite to split out functionality
into separate functions.
(org-clocktable-write-default):
(org-clocktable-indent-string):
(org-clock-get-table-data): New functions.
* lisp/org-agenda.el (org-agenda-list):
(org-agenda-redo):
(org-agenda-clockreport-mode):
(org-agenda-set-mode-name): Rewrite to implement filtered clock tables.
* doc/org.texi (Clocking commands):
(The clock table): New sections.
(Agenda commands): Document filtered clock reports.
2010-11-02 08:47:23 +01:00
Carsten Dominik adede9fbaf Fix export bug of a region with an ARCHIVE property set 2010-11-01 13:57:02 +01:00
Carsten Dominik 82af72eef7 Push version number to 7.02trans 2010-10-29 09:11:46 +02:00
Dan Davison 9c55868550 Alter way in which user chooses minted for latex source code export
* lisp/org-exp.el (org-export-format-source-code-or-example): Use
  minted for latex source code export if `org-export-latex-listings' has
  the value 'minted
* lisp/org-latex.el (org-export-latex-listings): Document special
  value 'minted
* lisp/org-latex.el (org-export-latex-minted): Delete variable
2010-10-28 21:55:40 +01:00
David Maus 9e8b867c77 Fix reference to wrong symbol
* org-exp.el (org-export-string): Fix reference to wrong symbol.
2010-10-24 20:41:26 +02:00
Eric Schulte e6c9936373 suggesting a new function org-export-string
The attached patch adds a new functions org-export-string.

,----
| org-export-string is a Lisp function in `org-exp.el'.
|
| (org-export-string STRING FMT &optional DIR)
|
| Export STRING to FMT using existing export facilities.
| During export STRING is saved to a temporary file whose location
| could vary.  Optional argument DIR can be used to force the
| directory in which the temporary file is created during export
| which can be useful for resolving relative paths.  Dir defaults
| to the value of `temporary-file-directory'.
`----

This function should be useful in user code, and can already reduce the
amount of code in ob-org.el and org-mime.el.

>From e51017e4d7051aad31384a470f0a695dca0d6716 Mon Sep 17 00:00:00 2001
From: Eric Schulte <schulte.eric@gmail.com>
Date: Sun, 17 Oct 2010 15:17:13 -0600
Subject: [PATCH] org-export-string -- exports a string of org-mode markup text

* lisp/org-exp.el (org-export-string): new function org-export-string
  can be used to convert a string of test in org-mode markup to a
  specified format

* contrib/lisp/org-mime.el (org-mime-htmlize): now using new
  org-export-string function for exportation

* lisp/ob-org.el (org-babel-execute:org): now using new
  org-export-string function for exportation
2010-10-22 06:48:32 -06:00
Carsten Dominik 9dc28ea0ed Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode 2010-10-22 09:20:05 +02:00
Carsten Dominik ca991d2ad4 HTML export: Improved support for field alignment, including centering
* doc/org.texi: Document the <c> cookie.
* lisp/org-exp.el (org-store-forced-table-alignment):
(org-export-remove-special-table-lines): Allow the "c" cookie for
table alignment.
* lisp/org-html.el (org-export-table-header-tags):
(org-export-table-data-tags): Add another %s format for the alignment.
(org-export-html-table-align-individual-fields): New option.
(org-format-org-table-html): Implement field-by-field alignment and
support centering.
(org-format-table-table-html): Make sure the new table tag formats
don't break this function.
* lisp/org-table.el (org-table-cookie-line-p):
(org-table-align): Allow for the <c> cookie.
* lisp/org.el (org-set-font-lock-defaults): Allow for the <c> cookie.
2010-10-22 09:19:39 +02:00
David Maus 8d85a67deb Skip normalization of plain links that are part of another link
* org-exp.el (org-export-normalize-links): Skip normalization of plain
links that are part of another link.
2010-10-22 06:22:41 +02:00
Carsten Dominik 7712d78ab4 HTML export: Use forced alignment like <l> or <r> in tables
* lisp/org-table.el (org-table-cookie-line-p): Fix indentation.
* lisp/org-exp.el (org-store-forced-table-alignment): New function.
(org-export-preprocess-string): Call `org-store-forced-table-alignment'.
* lisp/org-html.el (org-format-org-table-html): Use stored
alignment information.
2010-10-21 16:28:06 +02:00
Dan Davison eb75d6de40 Eliminate a compiler warning caused by the latex minted patch
* org-exp.el (org-export-latex-minted-with-line-numbers):
	Ensure that variable is declared
2010-10-13 08:43:17 +01:00
Dan Davison 60fa8cf31a LaTeX minted package for fontified source code export
* org-exp.el (org-export-format-source-code-or-example): latex
    formatting of source code blocks using the minted package
    (org-export-plist-vars): Add :latex-minted property
    (org-export-latex-minted): Ensure variable is defined
    (org-export-latex-minted-langs): Ensure variable is defined

    * org-latex.el (org-export-latex-minted): new variable
    (org-export-latex-minted-langs): new variable
    (org-export-latex-minted-with-line-numbers): new variable
    (org-export-latex-minted):
2010-10-12 23:20:28 +01:00
Łukasz Stelmach 8b4e52d80c there is no &sacute; in HTML
* lisp/org-exp.el (org-export-language-setup): Fix Polish entries.

Hello.

There is no such named entity as &sacute;. If you want to be 7bit clean
then use &#x015b; (or decimal &#347;).
2010-10-05 11:54:36 +02:00
Carsten Dominik a1dc916be6 Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode 2010-09-16 17:20:02 +02:00
David Maus d78eba7efb Add macro to insert property values into exported text
Example:

{{{property(id)}}}

Will insert the ID property of current subtree if the Org buffer is
exported.

* lisp/org-exp.el (org-infile-export-plist): Define property macro

TINYCHANGE
2010-09-16 16:59:30 +02:00
Nicolas Goaziou b5eb7047f3 Now both indentation and regexps can end lists
* org-list.el (org-list-ending-method): New customizable variable to
  tell Org Mode how lists end. See docstring.
2010-09-01 19:05:54 +02:00
Nicolas Goaziou ff6c147ac6 Defined `org-item-beginning-re'. Org capture should recognize new lists.
* org-capture.el (org-capture-place-item): use `org-search-forward-unenclosed'
  and `org-search-backward-unenclosed' and new variable `org-item-beginning-re'.
* org-list.el (org-item-beginning-re): regexp matching beginning of an item.
2010-09-01 19:05:49 +02:00