Commit Graph

61 Commits

Author SHA1 Message Date
Alan Schmitt 9d39aaeac3 Koma export: Tweak the logic to output fromaddress
* ox-koma-letter.el (org-koma-letter-template): Do not output
`fromaddress' when it is a string of white spaces.
(org-koma-letter-use-title): Fix typo in the documentation string.
2014-03-10 15:14:11 +01:00
Nicolas Goaziou 059f87f448 ox-koma-letter: Reorder "SUBJECT" in template 2014-02-05 17:06:19 +01:00
Nicolas Goaziou 63d788653e ox-koma-letter: Use `org-koma-letter-use-title'
* contrib/lisp/ox-koma-letter.el (org-koma-letter-template): Use
  `org-koma-letter-use-title'.  Small refactoring.
2014-02-05 17:05:08 +01:00
Bastien Guerry 7eb570b860 Fix left-over merge conflict 2014-02-05 16:33:24 +01:00
Bastien Guerry 13b5123da1 Merge branch 'maint'
Conflicts:
	contrib/lisp/ox-koma-letter.el
2014-02-05 16:16:36 +01:00
Rasmus 980c021609 Allow separate subject and title in ox-koma-letter
* ox-koma-letter.el (org-koma-letter-use-title): New variable.
(org-koma-letter-prefer-subject): New variable.
(org-koma-letter-template): Allow separate subject and title.

Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
2014-02-05 13:45:58 +01:00
Rasmus 1f413ba32d Documentation fixes for ox-koma-script.el
* ox-koma-letter.el commentary (org-koma-letter-use-backaddress):
  Better documentation.

Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
2014-02-05 13:45:41 +01:00
Rasmus 240cd3cb40 Documentation fixes for ox-koma-script.el
* ox-koma-letter.el commentary (org-koma-letter-use-backaddress):
  Better documentation.

Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
2014-02-05 13:30:38 +01:00
Nicolas Goaziou 97b0ae8b1f ox-koma-letter: Reorder keywords in template
* contrib/lisp/ox-koma-letter.el (koma-letter): Reorder keywords in
  a more logical way when `org-export-insert-default-template' is
  called.
2014-01-22 15:50:54 +01:00
Nicolas Goaziou d74205b0f9 ox-koma-letter: Improve defcustom docstrings
* contrib/lisp/ox-koma-letter.el (org-koma-letter-class-option-file,
  org-koma-letter-author, org-koma-letter-email,
  org-koma-letter-from-address, org-koma-letter-phone-number,
  org-koma-letter-place, org-koma-letter-closing,
  org-koma-letter-signature, org-koma-letter-prefer-special-headings,
  org-koma-letter-use-backaddress, org-koma-letter-use-phone,
  org-koma-letter-use-email, org-koma-letter-use-place): Improve
  docstring.
2014-01-17 23:05:20 +01:00
Nicolas Goaziou 161eb78d06 ox-koma-letter: Fix opening setting
* contrib/lisp/ox-koma-letter.el (org-koma-letter-opening): Correctly
  report conditions to fulfill in order set opening string with
  a headline.
(org-koma-letter-headline): Opening can no longer be nil, so look out
for the empty string instead.
2014-01-17 22:55:02 +01:00
Nicolas Goaziou bec2bc6744 ox-koma-letter: Fix a comment
* contrib/lisp/ox-koma-letter.el (org-koma-letter-keyword): Fix
  a comment.
2014-01-17 22:30:39 +01:00
Nicolas Goaziou bec25b5397 ox-koma-letter: Fix cd7adb47d8
* contrib/lisp/ox-koma-letter.el (org-koma-letter--determine-to-and-from):
  Fix bug introduced in cd7adb47d8.
2014-01-17 22:30:25 +01:00
Nicolas Goaziou cd7adb47d8 ox-koma-letter: Code clean-up
* contrib/lisp/ox-koma-letter.el (org-koma-letter--normalize-string,
  org-koma-letter--format-string-as-macro): Remove functions.
(org-koma-letter--determine-to-and-from,
org-koma-letter--special-contents-as-macro): Use `org-trim' instead of
`org-koma-letter--normalize-string'.
(org-koma-letter--special-contents-as-macro,
org-koma-letter--determine-to-and-from, org-koma-letter-headline):
Rewrite functions.
2014-01-17 21:40:00 +01:00
Nicolas Goaziou bcf61041ad ox-koma-letter: Fix code type
* contrib/lisp/ox-koma-letter.el: Fix code typo.
2014-01-17 11:33:26 +01:00
Nicolas Goaziou 50c9f04e84 ox-koma-letter: Small fix
* contrib/lisp/ox-koma-letter.el (koma-letter): Use correct default
  symbols.
2014-01-17 11:30:55 +01:00
Nicolas Goaziou 6aac287b2f ox-koma-letter: Simplify initialization
* contrib/lisp/ox-koma-letter.el (org-koma-letter-plug-into-ox):
  Remove function.
(org-koma-letter-default-class): Change default value.

A default class is installed by default upon loading the library.
2014-01-17 11:24:02 +01:00
Nicolas Goaziou 86dad6edb8 ox-koma-letter: Improve a customization menu
* contrib/lisp/ox-koma-letter.el (org-koma-letter-subject-format):
  Improve customization menu.
2014-01-17 11:14:00 +01:00
Nicolas Goaziou d7aa26b04e ox-koma-letter: Change value for folding marks
* contrib/lisp/ox-koma-letter.el (org-koma-letter-use-foldmarks):
  Change value to symbols or list of symbols.
(org-koma-letter--build-settings): Use new value for folding marks.
2014-01-17 11:01:15 +01:00
Nicolas Goaziou aa1019cd9a ox-koma-letter: Small refactoring
* contrib/lisp/ox-koma-letter.el (org-koma-letter-template): Add
  comments.
(org-koma-letter--build-settings): Rename internal bindings and
reorder insertion.
2014-01-17 10:39:05 +01:00
Nicolas Goaziou c174bf2a5c ox-koma-letter: Fix a variable type
* contrib/lisp/ox-koma-letter.el (org-koma-letter-subject-format):
  Make it clear that lists of symbols are allowed.
(org-koma-letter-template): Refactor subject-related part.
2014-01-17 10:09:17 +01:00
Nicolas Goaziou 7d67c448c9 ox-koma-letter: Fix customizable variable
* contrib/lisp/ox-koma-letter.el (org-koma-letter-use-foldmarks): Use
  correct type and improve docstring.
2014-01-17 01:37:25 +01:00
Nicolas Goaziou 4ca5cf35c8 ox-koma-letter: Fix global settings handling
* contrib/lisp/ox-koma-letter.el (koma-letter): Rewrite function.
  Global variables are no longer ignored.
(org-koma-letter--build-settings): New function.
2014-01-17 01:37:25 +01:00
Nicolas Goaziou 7c39f1b5bc ox-koma-letter: Fix a docstring
* contrib/lisp/ox-koma-letter.el (org-koma-letter-closing): Fix
  docstring.
2014-01-17 01:37:25 +01:00
Nicolas Goaziou d71f035462 ox-koma-letter: Fix customizable variables values
* contrib/lisp/ox-koma-letter.el (org-koma-letter-from-address):
(org-koma-letter-phone-number, org-koma-letter-place,
org-koma-letter-subject-format, org-koma-letter-opening,
org-koma-letter-closing, org-koma-letter-signature,
org-koma-letter-default-class, org-koma-letter-subject-format): Fix
value.
2014-01-17 01:37:25 +01:00
Nicolas Goaziou 454f7b3680 ox-koma-letter: Cleanup some docstrings
* contrib/lisp/ox-koma-letter.el (org-koma-letter-author,
  org-koma-letter-email, org-koma-letter-place,
  org-koma-letter-prefer-special-headings, org-koma-letter-signature,
  org-koma-letter-subject-format, org-koma-letter-use-backaddress,
  org-koma-letter-use-phone, org-koma-letter-use-email,
  org-koma-letter-use-place,
  org-koma-letter-headline-is-opening-maybe,
  org-koma-letter--get-tagged-contents,
  org-koma-letter--format-string-as-macro,
  org-koma-letter--normalize-string): Cleanup docstrings.
2014-01-16 19:00:59 +01:00
Bastien Guerry 7d9a883b50 Update copyright years again.
Hint: copyright years are all updated in Emacs.
2014-01-07 14:18:17 +01:00
Bastien Guerry 0beda99171 Revert "Update copyright years."
This reverts commit 21105594fc.
2014-01-05 06:28:07 +01:00
Bastien Guerry 21105594fc Update copyright years. 2014-01-04 18:56:11 +01:00
Alan Schmitt 32bd54d698 Koma exporter: Ensure customization to LCO files are taken into account
* contrib/lisp/ox-koma-letter.el: Change default values to match the scrlttr2
default values.  Track which options are set in the file and only output the
corresponding options when they are changed.
2013-08-31 16:33:44 +02:00
rasmus 69b20f36fe Make ox-koma-letter pass checkdoc.
* ox-koma-letter.el: Reworded parts of the head of the file.
(org-koma-letter-prefer-special-headings,
org-koma-letter-subject-format, org-koma-letter-default-class,
org-koma-letter-special-tags-in-letter,
org-koma-letter-special-tags-after-closing,
org-koma-letter-special-tags-after-letter,
org-koma-letter-plug-into-ox, org-koma-letter-email,
org-koma-letter--get-tagged-contents,
org-koma-letter-special-contents): Changed docstring to pass checkdoc.
(org-koma-letter--get-value): Renamed `org-koma-letter--get-custom'.
Docstring changed to pass checkdoc.
(org-koma-letter--special-contents-as-macro): Renamed
`org-koma-letter--prepare-special-contents-as-macro'.  Docstring
changed to pass checkdoc.
(org-koma-letter--normalize-string): Renamed
org-koma-letter--remove-offending-new-lines.  Docstring changed to
pass checkdoc.
(org-koma-letter--determine-to-and-from): Renamed
org-koma-letter--determine-special-value.  Docstring changed to pass
checkdoc.

Some functions have been renamed to make the names slightly more
informative.

Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
2013-08-27 10:10:34 +02:00
rasmus 55d18eed95 Set opening via headline
* ox-koma-letter.el (org-koma-letter-headline-is-opening-maybe): new
variable.  If `t' let headlines set subject.
(org-koma-letter-headline): let headline set opening.
(org-koma-letter-template): let opening and closing be empty if nil.

Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
2013-08-27 10:09:39 +02:00
Nicolas Goaziou 9154c70a04 Export back-ends: Apply changes to export functions
* contrib/lisp/ox-confluence.el (org-confluence-export-as-confluence):
* contrib/lisp/ox-deck.el (org-deck-export-as-html,
  org-deck-export-to-html):
* contrib/lisp/ox-freemind.el (org-freemind-export-to-freemind):
* contrib/lisp/ox-groff.el (org-groff-export-to-groff,
  org-groff-export-to-pdf):
* contrib/lisp/ox-koma-letter.el (org-koma-letter-export-as-latex,
  org-koma-letter-export-to-latex, org-koma-letter-export-to-pdf):
* contrib/lisp/ox-rss.el (org-rss-export-as-rss,
  org-rss-export-to-rss):
* contrib/lisp/ox-s5.el (org-s5-export-as-html,
  org-s5-export-to-html):
* contrib/lisp/ox-taskjuggler.el (org-taskjuggler-export):
* lisp/ob-haskell.el:
* lisp/ox-ascii.el (org-ascii-export-as-ascii,
  org-ascii-export-to-ascii):
* lisp/ox-beamer.el (org-beamer-export-as-latex,
  org-beamer-export-to-latex, org-beamer-export-to-pdf):
* lisp/ox-html.el (org-html-export-as-html, org-html-export-to-html):
* lisp/ox-icalendar.el (org-icalendar-export-to-ics):
* lisp/ox-latex.el (org-latex-export-as-latex,
  org-latex-export-to-pdf):
* lisp/ox-man.el (org-man-export-to-man, org-man-export-to-pdf):
* lisp/ox-md.el (org-md-export-as-markdown,
  org-md-export-to-markdown):
* lisp/ox-odt.el (org-odt-export-to-odt):
* lisp/ox-org.el (org-org-export-as-org, org-org-export-to-org):
* lisp/ox-publish.el (org-publish-org-to):
* lisp/ox-texinfo.el (org-texinfo-export-to-texinfo,
  org-texinfo-export-to-info):
* testing/lisp/test-ob-exp.el (test-ob-exp/org-babel-exp-src-blocks/w-no-file):
2013-08-07 16:11:42 +02:00
rasmus 08cffc1c24 Missing backtick in =`ox-koma-letter.el'=
* ox-koma-letter.el (org-koma-letter-plug-into-ox): Add a
backtick.
2013-07-26 19:48:00 +02:00
Nicolas Goaziou 0cdf2eb7ce Merge branch 'maint'
Conflicts:
	contrib/lisp/ox-koma-letter.el
2013-07-12 09:10:26 +02:00
Nicolas Goaziou a2a5c8fd5b ox-beamer/latex/koma-letter: Fix missing newlines in header
* contrib/lisp/ox-koma-letter.el (org-koma-letter-template): Fix
  missing newlines in header.
* lisp/ox-beamer.el (org-beamer-template): Fix missing newlines in
  header.
* lisp/ox-latex.el (org-latex-template): Fix missing newlines in
  header.
2013-07-12 09:07:23 +02:00
Eric Schulte d316ecab0e missing argument to error message
* contrib/lisp/ox-koma-letter.el (org-koma-letter-template): Missing
  argument to error message.
2013-06-13 09:44:49 -06:00
rasmus a9c044a648 Possible to set default class for ox koma letters.
* ox-koma-letter.el (org-koma-letter-default-class): default class for
=ox-koma-letter=. Default is nil.
* ox-koma-letter.el (org-koma-letter-plug-into-ox): add a sparse
letter class to =`org-latex-class'= and set it to default.

By default it will use =`org-latex-default-class'=.

Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
2013-06-12 13:38:48 +02:00
rasmus 878ff19f35 Added support for to and from heading.
* ox-koma-letter.el: documentation.
(org-koma-letter-special-tags-in-letter): list of tags that
are typeset as part of the letter.
(org-koma-letter--determine-special-value): determine which
value to use (for to and from currentlly) if more than
candidate is available.  Which value is selected depends on
`org-koma-letter-prefer-special-headings'.
(org-koma-letter-prefer-special-headings): a boolean stating
whether to prefer headings with to/from or the #+X_ADDRESS.

The following letter now exports "as expected".  In particular when
special-headings is t heading values have presedence so the
from address would be ="Rasmus\nEmacs\nOrg-mode"= where the
=\n=s would be escaped.  If specia-headings is nil (default)
the from would be my-adr.  The same is true for TO address.

Here's the contents

* from :from:

   Rasmus
   Emacs
   Org-mode

On a technical note, note that the default value will be used if
neither #+X_ADDRESS or a heading is given.

Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
2013-06-12 13:38:31 +02:00
rasmus.pank 8dd2aa4041 Bug fixes for ox-koma-letter.el
* ox-koma-letter.el: updated documentation and improved defcustoms.
(org-koma-letter-special-tags-after-letter)
(org-koma-letter-special-tags-after-closing): now symbol.
(org-koma-letter--get-custom): falls back to value
(org-koma-letter--prepare-special-contents-as-macro): let
newlines be handled outside of the function
(org-koma-letter--remove-offending-new-lines): function to add
new lines.
(org-koma-letter-headline): updated to work with symbols and
made more robust.
(org-koma-letter-export-to-latex): reset
=`org-koma-letter-special-contents'= to nil

Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
2013-06-12 13:37:56 +02:00
rasmus.pank 26a9b02483 ox-koma-letter: changed handling of subject.
* ox-koma-letter.el: =`org-koma-letter-subject-format'= can now be a list.  Default is t.
   If nil neither subject format nor type is exported.
* ox-koma-letter.el (org-koma-letter-template): better subject handling.
* ox-koma-letter.el (org-koma-letter-template): allow for t value of =#+OPTIONS: subject:VALUE=
* ox-koma-letter.el (org-koma-letter-template): export of subject format is independent
of title, but title is not independent of =:with-subject=.

The issue was with =#+OPTIONS: subject:t= one would get a LaTeX error.

New behavior:

If =#+OPTIONS: subject:(x,y)= then =\KOMAoption{subject}{x, y}=.

If =subject:x= then =\KOMAoption{subject}{x}=.

If =subject:t= then =\KOMAoption{subject}{...}= is not set but
\setkomavar{subject}{...} is set (in the output file)

If =subject:nil= neither are printed.

Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
2013-05-27 08:38:44 +02:00
rasmus.pank 7542aabb44 Change default of org-koma-letter-signature to nil.
* ox-koma-letter.el(org-koma-letter-signature): set to nil.

The previoues value corresponds to the default value cf. the the koma
manual pp. 183.

Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
2013-05-27 08:35:35 +02:00
rasmus.pank 3571a852a0 Added support for after closing and after document entities in ox-koma-letter.
* ox-koma-letter.el (org-koma-letter-special-tags-after-closing):
  specials tags inserted after =\end{closing}=.
* ox-koma-letter.el (org-koma-letter-special-tags): collect
  the special lists.
* ox-koma-letter.el (org-koma-letter-headline): stores content
  in of headline if the first tag is special.  Otherwise return content.
* ox-koma-letter.el (org-koma-letter-special-content): holds special
  content temporarily.
* ox-koma-letter.el (org-koma-letter--format-string-as-macro): format a string as
  a macro or don't.
* ox-koma-letter.el (org-koma-letter-template): added support
  for the headings with special tags.

The following example will now export a sensible manner.

* my letter
  here's a letter
* PS :ps:
  it's requires this patch
* CC :cc:
  Nicolas, Viktor and Alan
* ENCL :encl:
  many patches
  1. this patch
  2. another patch.
* include patches :after_letter:
  \myspecialmacro

  \includepdf{pdf}

Namely, content of ps, encl and cc headings will be exported after
\closing{.}  in the order prescribed by
=`org-koma-letter-special-tags-after-closing'= as a (LaTeX) macro
removing trailing and leading newlines.  The macro is the same as the
tag, althogh the case is determined by the special list.

The concents of the =after_letter= heading will be inserted after
=\end{letter}= and newlines are preserved.

Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
2013-05-27 08:33:12 +02:00
rasmus.pank ba7a2cc8da Fix handling of author and email in koma exporter.
* ox-koma-letter.el (org-koma-letter-author): defaults to a function
that returns =`user-full-name'=.

Setting the variables `org-koma-letter-author' and
`org-koma-letter-email' to the values of `user-full-name' and
`user-mail-address' respectively, allows the user to skip =#+AUTHOR:=
and =#+EMAIL:= lines when configuring a letter.  However, if the user
wishes to set this information in LCO files, these variables need to
be set to nil.

With the old after-init-hook method my user name was always set to "".
Now org-koma-letter will (i) allow for default nil values (good if you
use LCO files); (ii) default to =`user-full-name'= and
=`user-mail-address'= like =ox-latex.el=.  These values are obtained
on-the-fly.

The two variables in question can also be strings or functions
returning strings.

Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
2013-05-27 08:29:12 +02:00
rasmus.pank 832c6fd728 Changed =#+SENDER= to =#+AUTHOR= and removed duplicated email and author variables in =ox-koma-letter.el=.
* ox-koma-letter.el: changed the unorthodox =SENDER= keyword to
  the ordinary =AUTHOR= keyword.
* ox-koma-letter.el: changed email to work as in standard
  latex exporter and dropped dedicated ox-koma-letter variable.

Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
2013-05-21 13:31:25 +02:00
Viktor Rosenfeld 0e85c43935 ox-koma-letter.el: Give the user complete control over foldmarks appearance.
* ox-koma-letter.el (org-koma-letter-use-foldmarks) Update
	documentation
	(org-koma-letter-template): Pass foldmarks setting to
	KOMA-Script

TINYCHANGE

Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
2013-05-05 19:04:41 +02:00
Viktor Rosenfeld d19964c74f ox-koma-letter.el: No default opening and closing line.
* ox-koma-letter.el (org-koma-letter-opening): No default / set to nil.
	(org-koma-letter-closing): No default / set to nil.

	We should not assume a formal English opening and closing
	line.  A letter requires many personal options, such as the
	address, so it is no more work to also these options.

TINYCHANGE

Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
2013-05-05 18:21:51 +02:00
Viktor Rosenfeld 9655a18d88 ox-koma-letter.el: Support multiple LCO files
* ox-koma-letter.el (org-koma-letter-template): Treat `#+LCO:'
  variable as a list of multiple LCO files separated by spaces.

Example:

  #+LCO: Default Signed

will result in the following LaTeX fragment

  #+BEGIN_SRC latex
  \LoadLetterOption{Default}
  \LoadLetterOption{Signed}
  #+END_SRC

Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
2013-04-23 09:17:56 +02:00
Viktor Rosenfeld bb03429cf8 ox-koma-letter: Export options to control letter
* ox-koma-letter.el ((org-koma-letter-use-subject):
  Configure printing of subject line.
  (org-koma-letter-use-backaddress): Configure presence of back
  address.
  (org-koma-letter-use-foldmarks): Configure presence of foldmarks.
  (org-koma-letter-use-phone): Configure printing of phone number.
  (org-koma-letter-use-email): Configure printing of email.
  (org-koma-letter-use-place): Configure printing of place.
  (koma-letter): Add export option to exporter backend.
  (org-koma-letter-template): Evaluate export options in
  exporter template.

Usage:

  #+OPTIONS: backaddress:t foldmarks:t subject:titled phone:t email:t place:t

Except for `subject', all options are boolean, i.e., the accept the
values `nil' and `t'. `subject' accepts the values defined in
`scrlttr2`, i.e., `afteropening', `beforeopening', `centered', `left',
`right', `titled', `underlined', and `untitled'.

Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
2013-04-23 09:17:20 +02:00
Viktor Rosenfeld cab6718d4b ox-koma-letter.el: Set LCO option before other KOMA variables
* ox-koma-letter.el (org-koma-letter-closing): More
  business-like closing.
  (org-koma-letter-from-address): Do not set default personal
  information.
  (org-koma-letter-opening): Gendered opening.
  (org-koma-letter-phone-number): Do not set default personal
  information.
  (org-koma-letter-sender): Use `#+SENDER:' instead of
  `#+AUTHOR:' because the latter is always set by the LaTeX
  exporter.
  (org-koma-letter-email): Duplicte `#+EMAIL:' in this exporter
  because it is always set by the LaTeX exporter.
  (koma-letter): Add additional `#+SENDER:' and `#+EMAIL:' to
  exporter (see above).
  (org-koma-letter-template): Set LCO before evaluating other
  KOMA variables if they are set; add `#+SENDER:' and `#+EMAIL:'
  to template (see above).

The LCO file is set loaded first and KOMA variables are only set if
their value is not `nil'.

Example:

  #+LCO: Default
  #+SIGNATURE: A friend

will result in the following LaTeX code:

  #+BEGIN_SRC latex
  \LoadLetterOption{Default}        % LCO file, with default signature
  \setkomavar{signature}{A friend}  % Overwrite signature
  #+END_SRC

Other KOMA variables defined in the LCO file, e.g., `fromaddress', will
not be overwritten.

Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
2013-04-23 09:16:53 +02:00